@sdxc/ui 2026.11.27 → 2026.11.29

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 (417) hide show
  1. package/README.md +265 -162
  2. package/dist/app/app-shell.d.ts +85 -50
  3. package/dist/app/app-shell.js +419 -222
  4. package/dist/app/auto-refresh.d.ts +68 -51
  5. package/dist/app/auto-refresh.js +193 -61
  6. package/dist/app/board.d.ts +40 -17
  7. package/dist/app/board.js +173 -88
  8. package/dist/app/chart.d.ts +10 -63
  9. package/dist/app/chart.js +22 -29
  10. package/dist/app/code-view.d.ts +12 -11
  11. package/dist/app/code-view.js +83 -19
  12. package/dist/app/command-palette.d.ts +61 -33
  13. package/dist/app/command-palette.js +178 -32
  14. package/dist/app/contribution-graph.d.ts +30 -14
  15. package/dist/app/contribution-graph.js +87 -26
  16. package/dist/app/danger-zone.d.ts +40 -35
  17. package/dist/app/danger-zone.js +177 -34
  18. package/dist/app/detail-sheet.d.ts +42 -51
  19. package/dist/app/detail-sheet.js +156 -37
  20. package/dist/app/diff.d.ts +6 -5
  21. package/dist/app/diff.js +9 -6
  22. package/dist/app/drop-zone.d.ts +3 -13
  23. package/dist/app/drop-zone.js +2 -2
  24. package/dist/app/editor-layout.d.ts +69 -47
  25. package/dist/app/editor-layout.js +256 -115
  26. package/dist/app/empty.d.ts +16 -12
  27. package/dist/app/empty.js +45 -19
  28. package/dist/app/file-trigger.d.ts +5 -13
  29. package/dist/app/file-trigger.js +3 -4
  30. package/dist/app/filter-bar.d.ts +182 -120
  31. package/dist/app/filter-bar.js +509 -161
  32. package/dist/app/filter-menu.d.ts +51 -33
  33. package/dist/app/filter-menu.js +105 -40
  34. package/dist/app/gantt.d.ts +67 -27
  35. package/dist/app/gantt.js +320 -163
  36. package/dist/app/grid-list.d.ts +2 -15
  37. package/dist/app/grid-list.js +3 -3
  38. package/dist/app/merge-box.d.ts +58 -52
  39. package/dist/app/merge-box.js +107 -46
  40. package/dist/app/mixins/optimistic-toggle-sync.d.ts +2 -2
  41. package/dist/app/mixins/optimistic-toggle-sync.js +3 -2
  42. package/dist/app/mixins/range-picker-keys.d.ts +1 -1
  43. package/dist/app/mixins/range-picker-keys.js +1 -1
  44. package/dist/app/mixins/save-bar-sync.d.ts +1 -1
  45. package/dist/app/mixins/save-bar-sync.js +3 -2
  46. package/dist/app/mixins/split-view.d.ts +3 -1
  47. package/dist/app/mixins/split-view.js +16 -8
  48. package/dist/app/optimistic-toggle.d.ts +65 -37
  49. package/dist/app/optimistic-toggle.js +38 -15
  50. package/dist/app/page-header.d.ts +80 -58
  51. package/dist/app/page-header.js +329 -154
  52. package/dist/app/profile-picker.d.ts +31 -24
  53. package/dist/app/profile-picker.js +134 -58
  54. package/dist/app/range-picker.d.ts +62 -59
  55. package/dist/app/range-picker.js +124 -37
  56. package/dist/app/review-thread.d.ts +69 -66
  57. package/dist/app/review-thread.js +203 -53
  58. package/dist/app/save-bar.d.ts +56 -27
  59. package/dist/app/save-bar.js +66 -14
  60. package/dist/app/selection-bar.d.ts +64 -66
  61. package/dist/app/selection-bar.js +157 -56
  62. package/dist/app/settings-layout.d.ts +65 -52
  63. package/dist/app/settings-layout.js +198 -71
  64. package/dist/app/settings-section.d.ts +86 -93
  65. package/dist/app/settings-section.js +297 -120
  66. package/dist/app/shortcut-list.d.ts +19 -8
  67. package/dist/app/shortcut-list.js +50 -9
  68. package/dist/app/sparkline.d.ts +14 -16
  69. package/dist/app/sparkline.js +20 -7
  70. package/dist/app/split-view.d.ts +66 -42
  71. package/dist/app/split-view.js +235 -128
  72. package/dist/app/stat-card.d.ts +16 -4
  73. package/dist/app/stat-card.js +57 -21
  74. package/dist/app/status-strip.d.ts +24 -25
  75. package/dist/app/status-strip.js +82 -25
  76. package/dist/app/tab-bar.d.ts +15 -7
  77. package/dist/app/tab-bar.js +74 -37
  78. package/dist/app/table.d.ts +37 -38
  79. package/dist/app/table.js +101 -45
  80. package/dist/app/view-options.d.ts +100 -76
  81. package/dist/app/view-options.js +263 -129
  82. package/dist/audio/media-tile.d.ts +33 -21
  83. package/dist/audio/media-tile.js +139 -79
  84. package/dist/audio/player-bar.d.ts +24 -43
  85. package/dist/audio/player-bar.js +183 -118
  86. package/dist/audio/queue-list.d.ts +40 -36
  87. package/dist/audio/queue-list.js +172 -73
  88. package/dist/audio/track-list.d.ts +53 -54
  89. package/dist/audio/track-list.js +127 -35
  90. package/dist/blog/archive-list.d.ts +158 -0
  91. package/dist/blog/archive-list.js +353 -0
  92. package/dist/blog/article-layout.d.ts +81 -0
  93. package/dist/blog/article-layout.js +211 -0
  94. package/dist/blog/author-card.d.ts +99 -0
  95. package/dist/blog/author-card.js +184 -0
  96. package/dist/blog/blog-masthead.d.ts +55 -0
  97. package/dist/blog/blog-masthead.js +143 -0
  98. package/dist/blog/index.d.ts +21 -0
  99. package/dist/blog/index.js +21 -0
  100. package/dist/blog/link-host.d.ts +47 -0
  101. package/dist/blog/link-host.js +61 -0
  102. package/dist/blog/newsletter-form.d.ts +66 -0
  103. package/dist/blog/newsletter-form.js +100 -0
  104. package/dist/blog/post-byline.d.ts +96 -0
  105. package/dist/blog/post-byline.js +180 -0
  106. package/dist/blog/post-entry.d.ts +153 -0
  107. package/dist/blog/post-entry.js +402 -0
  108. package/dist/blog/post-stream.d.ts +92 -0
  109. package/dist/blog/post-stream.js +163 -0
  110. package/dist/blog/series-nav.d.ts +144 -0
  111. package/dist/blog/series-nav.js +275 -0
  112. package/dist/blog/tag-cloud.d.ts +103 -0
  113. package/dist/blog/tag-cloud.js +138 -0
  114. package/dist/blog/tag-list.d.ts +91 -0
  115. package/dist/blog/tag-list.js +92 -0
  116. package/dist/blog/widget.d.ts +68 -0
  117. package/dist/blog/widget.js +61 -0
  118. package/dist/chat/activity.d.ts +47 -15
  119. package/dist/chat/activity.js +124 -46
  120. package/dist/chat/mention-menu.d.ts +6 -7
  121. package/dist/chat/mention-menu.js +4 -4
  122. package/dist/chat/message-group.d.ts +17 -4
  123. package/dist/chat/message-group.js +29 -6
  124. package/dist/color/color-field.d.ts +41 -68
  125. package/dist/color/color-field.js +21 -38
  126. package/dist/color/color-picker.d.ts +10 -61
  127. package/dist/color/color-picker.js +7 -15
  128. package/dist/color/color-swatch-picker.d.ts +0 -11
  129. package/dist/color/color-swatch-picker.js +2 -3
  130. package/dist/color/color-wheel.d.ts +3 -13
  131. package/dist/color/color-wheel.js +1 -2
  132. package/dist/commerce/cart-drawer.d.ts +41 -24
  133. package/dist/commerce/cart-drawer.js +129 -58
  134. package/dist/commerce/cart-line.d.ts +34 -19
  135. package/dist/commerce/cart-line.js +94 -28
  136. package/dist/commerce/checkout-layout.d.ts +23 -19
  137. package/dist/commerce/checkout-layout.js +53 -24
  138. package/dist/commerce/facet-filters.d.ts +57 -59
  139. package/dist/commerce/facet-filters.js +219 -129
  140. package/dist/commerce/item-options-dialog.d.ts +69 -40
  141. package/dist/commerce/item-options-dialog.js +231 -104
  142. package/dist/commerce/menu-item-card.d.ts +36 -20
  143. package/dist/commerce/menu-item-card.js +114 -61
  144. package/dist/commerce/option-group.d.ts +46 -27
  145. package/dist/commerce/option-group.js +123 -52
  146. package/dist/commerce/order-summary.d.ts +41 -26
  147. package/dist/commerce/order-summary.js +103 -49
  148. package/dist/commerce/order-tracker.d.ts +32 -16
  149. package/dist/commerce/order-tracker.js +91 -66
  150. package/dist/commerce/price.d.ts +41 -25
  151. package/dist/commerce/price.js +131 -68
  152. package/dist/commerce/product-card.d.ts +66 -36
  153. package/dist/commerce/product-card.js +215 -100
  154. package/dist/commerce/product-gallery.d.ts +72 -38
  155. package/dist/commerce/product-gallery.js +187 -82
  156. package/dist/commerce/promo-code.d.ts +73 -37
  157. package/dist/commerce/promo-code.js +172 -77
  158. package/dist/commerce/question-list.d.ts +43 -35
  159. package/dist/commerce/question-list.js +146 -72
  160. package/dist/commerce/shipping-estimate.d.ts +68 -33
  161. package/dist/commerce/shipping-estimate.js +149 -25
  162. package/dist/commerce/sort-select.d.ts +33 -22
  163. package/dist/commerce/sort-select.js +55 -26
  164. package/dist/commerce/variant-picker.d.ts +25 -23
  165. package/dist/commerce/variant-picker.js +103 -29
  166. package/dist/{docs → components}/anchor-heading.d.ts +1 -1
  167. package/dist/{docs → components}/anchor-heading.js +1 -1
  168. package/dist/components/autocomplete.d.ts +19 -21
  169. package/dist/components/autocomplete.js +57 -21
  170. package/dist/components/banner.d.ts +48 -37
  171. package/dist/components/banner.js +69 -27
  172. package/dist/components/button.d.ts +2 -18
  173. package/dist/components/button.js +4 -3
  174. package/dist/components/callout.d.ts +52 -0
  175. package/dist/components/callout.js +77 -0
  176. package/dist/components/checkbox.d.ts +3 -12
  177. package/dist/components/checkbox.js +1 -2
  178. package/dist/components/code-block.d.ts +110 -0
  179. package/dist/{docs → components}/code-block.js +92 -23
  180. package/dist/components/confirm.d.ts +63 -130
  181. package/dist/components/confirm.js +133 -52
  182. package/dist/{docs → components}/copy-button.d.ts +1 -1
  183. package/dist/{docs → components}/copy-button.js +3 -3
  184. package/dist/components/date-field.d.ts +40 -60
  185. package/dist/components/date-field.js +23 -36
  186. package/dist/components/date-picker.d.ts +11 -67
  187. package/dist/components/date-picker.js +4 -15
  188. package/dist/components/date-range-picker.d.ts +20 -91
  189. package/dist/components/date-range-picker.js +13 -27
  190. package/dist/components/dialog-dismiss.d.ts +1 -1
  191. package/dist/components/dialog-dismiss.js +1 -1
  192. package/dist/components/field-parts.d.ts +158 -0
  193. package/dist/components/field-parts.js +237 -0
  194. package/dist/components/filter-links.d.ts +107 -0
  195. package/dist/components/filter-links.js +120 -0
  196. package/dist/components/form.d.ts +3 -1
  197. package/dist/components/form.js +3 -1
  198. package/dist/components/index.d.ts +14 -7
  199. package/dist/components/index.js +14 -7
  200. package/dist/components/listbox.d.ts +0 -9
  201. package/dist/components/listbox.js +2 -2
  202. package/dist/components/media-grid.d.ts +15 -16
  203. package/dist/components/media-grid.js +75 -34
  204. package/dist/components/pager.d.ts +103 -0
  205. package/dist/components/pager.js +187 -0
  206. package/dist/components/property-list.d.ts +38 -39
  207. package/dist/components/property-list.js +149 -96
  208. package/dist/components/radio-group.d.ts +0 -11
  209. package/dist/components/radio-group.js +5 -6
  210. package/dist/components/range-calendar.d.ts +2 -14
  211. package/dist/components/range-calendar.js +2 -2
  212. package/dist/components/range-months.d.ts +12 -2
  213. package/dist/components/range-months.js +32 -16
  214. package/dist/components/rating-input.d.ts +14 -6
  215. package/dist/components/rating-input.js +26 -12
  216. package/dist/components/rating.d.ts +13 -8
  217. package/dist/components/rating.js +19 -5
  218. package/dist/components/review-card.d.ts +51 -26
  219. package/dist/components/review-card.js +173 -40
  220. package/dist/components/search-field.js +18 -8
  221. package/dist/components/section-bar.d.ts +23 -15
  222. package/dist/components/section-bar.js +59 -37
  223. package/dist/components/sidebar.d.ts +27 -0
  224. package/dist/components/sidebar.js +49 -20
  225. package/dist/{docs → components}/table-of-contents.d.ts +1 -1
  226. package/dist/{docs → components}/table-of-contents.js +3 -3
  227. package/dist/components/text-field.d.ts +54 -81
  228. package/dist/components/text-field.js +30 -44
  229. package/dist/components/time-field.d.ts +45 -65
  230. package/dist/components/time-field.js +23 -35
  231. package/dist/components/timeline.d.ts +80 -86
  232. package/dist/components/timeline.js +383 -170
  233. package/dist/components/typeset.d.ts +5 -0
  234. package/dist/components/typeset.js +17 -2
  235. package/dist/docs/code-tabs.d.ts +50 -24
  236. package/dist/docs/code-tabs.js +91 -25
  237. package/dist/docs/docs-feedback.d.ts +70 -27
  238. package/dist/docs/docs-feedback.js +156 -27
  239. package/dist/docs/docs-footer.d.ts +36 -22
  240. package/dist/docs/docs-footer.js +76 -23
  241. package/dist/docs/docs-hub.d.ts +103 -73
  242. package/dist/docs/docs-hub.js +333 -83
  243. package/dist/docs/docs-layout.d.ts +111 -42
  244. package/dist/docs/docs-layout.js +371 -97
  245. package/dist/docs/docs-nav-tools.d.ts +11 -7
  246. package/dist/docs/docs-nav-tools.js +4 -3
  247. package/dist/docs/docs-nav.d.ts +53 -17
  248. package/dist/docs/docs-nav.js +125 -14
  249. package/dist/docs/docs-not-found.d.ts +61 -35
  250. package/dist/docs/docs-not-found.js +198 -52
  251. package/dist/docs/docs-page-header.d.ts +47 -30
  252. package/dist/docs/docs-page-header.js +114 -31
  253. package/dist/docs/docs-pager.d.ts +43 -27
  254. package/dist/docs/docs-pager.js +73 -23
  255. package/dist/docs/file-tree.d.ts +16 -6
  256. package/dist/docs/file-tree.js +19 -4
  257. package/dist/docs/index.d.ts +0 -7
  258. package/dist/docs/index.js +0 -7
  259. package/dist/docs/install-command.d.ts +7 -6
  260. package/dist/docs/install-command.js +8 -10
  261. package/dist/docs/mixins/docs-nav-tools.js +1 -1
  262. package/dist/docs/next-steps.d.ts +56 -23
  263. package/dist/docs/next-steps.js +121 -35
  264. package/dist/docs/page-actions.d.ts +68 -46
  265. package/dist/docs/page-actions.js +129 -21
  266. package/dist/docs/steps.d.ts +14 -11
  267. package/dist/docs/steps.js +36 -18
  268. package/dist/docs/ui-label.d.ts +7 -6
  269. package/dist/docs/ui-label.js +21 -8
  270. package/dist/finance/ledger.d.ts +33 -29
  271. package/dist/finance/ledger.js +190 -43
  272. package/dist/finance/payment-card.d.ts +43 -31
  273. package/dist/finance/payment-card.js +170 -67
  274. package/dist/landing/author-band.d.ts +57 -54
  275. package/dist/landing/author-band.js +218 -64
  276. package/dist/landing/case-study.d.ts +57 -57
  277. package/dist/landing/case-study.js +148 -17
  278. package/dist/landing/changelog-strip.d.ts +56 -36
  279. package/dist/landing/changelog-strip.js +176 -68
  280. package/dist/landing/closing-cta.d.ts +21 -41
  281. package/dist/landing/closing-cta.js +13 -19
  282. package/dist/landing/code-stage.d.ts +55 -47
  283. package/dist/landing/code-stage.js +198 -67
  284. package/dist/landing/contributor-wall.d.ts +4 -4
  285. package/dist/landing/contributor-wall.js +4 -4
  286. package/dist/landing/curriculum.d.ts +74 -45
  287. package/dist/landing/curriculum.js +220 -62
  288. package/dist/landing/drawn-chart.d.ts +18 -10
  289. package/dist/landing/drawn-chart.js +57 -26
  290. package/dist/landing/episode-player.d.ts +69 -43
  291. package/dist/landing/episode-player.js +213 -48
  292. package/dist/landing/event-ticker.d.ts +13 -7
  293. package/dist/landing/event-ticker.js +67 -32
  294. package/dist/landing/fan-out-diagram.d.ts +19 -8
  295. package/dist/landing/fan-out-diagram.js +60 -19
  296. package/dist/landing/faq-band.d.ts +30 -48
  297. package/dist/landing/faq-band.js +37 -30
  298. package/dist/landing/feature-band.d.ts +48 -76
  299. package/dist/landing/feature-band.js +71 -49
  300. package/dist/landing/flow-diagram.d.ts +16 -8
  301. package/dist/landing/flow-diagram.js +50 -18
  302. package/dist/landing/install-tabs.d.ts +16 -14
  303. package/dist/landing/install-tabs.js +87 -39
  304. package/dist/landing/landing-header.d.ts +75 -66
  305. package/dist/landing/landing-header.js +284 -57
  306. package/dist/landing/landing-hero.d.ts +59 -87
  307. package/dist/landing/landing-hero.js +157 -128
  308. package/dist/landing/landing-section.d.ts +0 -9
  309. package/dist/landing/landing-section.js +1 -2
  310. package/dist/landing/logo-cloud.d.ts +26 -9
  311. package/dist/landing/logo-cloud.js +62 -18
  312. package/dist/landing/phone-fan.d.ts +15 -7
  313. package/dist/landing/phone-fan.js +60 -17
  314. package/dist/landing/price-list.d.ts +29 -22
  315. package/dist/landing/price-list.js +175 -77
  316. package/dist/landing/pricing-band.d.ts +46 -53
  317. package/dist/landing/pricing-band.js +167 -51
  318. package/dist/landing/product-frame.d.ts +44 -42
  319. package/dist/landing/product-frame.js +182 -85
  320. package/dist/landing/proof-strip.d.ts +7 -2
  321. package/dist/landing/proof-strip.js +7 -2
  322. package/dist/landing/rails.d.ts +1 -1
  323. package/dist/landing/rails.js +1 -1
  324. package/dist/landing/segmented-stage.d.ts +19 -8
  325. package/dist/landing/segmented-stage.js +60 -16
  326. package/dist/landing/sequence-diagram.d.ts +18 -8
  327. package/dist/landing/sequence-diagram.js +49 -18
  328. package/dist/landing/site-footer.d.ts +89 -68
  329. package/dist/landing/site-footer.js +344 -111
  330. package/dist/landing/site-header.d.ts +118 -80
  331. package/dist/landing/site-header.js +482 -67
  332. package/dist/landing/sponsor-wall.d.ts +34 -15
  333. package/dist/landing/sponsor-wall.js +111 -34
  334. package/dist/landing/stat-strip.d.ts +7 -9
  335. package/dist/landing/stat-strip.js +57 -22
  336. package/dist/landing/step-list.d.ts +18 -21
  337. package/dist/landing/step-list.js +132 -38
  338. package/dist/landing/tabbed-stage.d.ts +23 -15
  339. package/dist/landing/tabbed-stage.js +103 -21
  340. package/dist/landing/testimonial-band.d.ts +58 -61
  341. package/dist/landing/testimonial-band.js +209 -71
  342. package/dist/landing/typed-terminal.d.ts +9 -6
  343. package/dist/landing/typed-terminal.js +16 -5
  344. package/dist/landing/usage-estimate.d.ts +83 -74
  345. package/dist/landing/usage-estimate.js +254 -113
  346. package/dist/landing/utils/has-parts.d.ts +17 -0
  347. package/dist/landing/utils/has-parts.js +24 -0
  348. package/dist/map/map-canvas.d.ts +15 -16
  349. package/dist/map/map-canvas.js +40 -24
  350. package/dist/map/map.d.ts +42 -33
  351. package/dist/map/map.js +149 -38
  352. package/dist/mixins/aria-checked.d.ts +1 -4
  353. package/dist/mixins/aria-checked.js +1 -4
  354. package/dist/mixins/clear-field.d.ts +2 -4
  355. package/dist/mixins/clear-field.js +2 -4
  356. package/dist/mixins/index.d.ts +2 -0
  357. package/dist/mixins/index.js +2 -0
  358. package/dist/schedule/agenda.d.ts +69 -41
  359. package/dist/schedule/agenda.js +273 -134
  360. package/dist/schedule/day-strip.d.ts +38 -26
  361. package/dist/schedule/day-strip.js +119 -88
  362. package/dist/test/map.d.ts +1 -1
  363. package/dist/test/map.js +1 -6
  364. package/dist/test/reels.js +1 -1
  365. package/dist/test/stories.js +2 -2
  366. package/dist/travel/boarding-pass.d.ts +94 -70
  367. package/dist/travel/boarding-pass.js +341 -144
  368. package/dist/travel/car-offer.d.ts +109 -49
  369. package/dist/travel/car-offer.js +424 -64
  370. package/dist/travel/fare-options.d.ts +58 -34
  371. package/dist/travel/fare-options.js +210 -69
  372. package/dist/travel/flight-itinerary.d.ts +62 -55
  373. package/dist/travel/flight-itinerary.js +230 -55
  374. package/dist/travel/flight-option.d.ts +65 -33
  375. package/dist/travel/flight-option.js +250 -69
  376. package/dist/travel/flight-segment.d.ts +121 -70
  377. package/dist/travel/flight-segment.js +358 -96
  378. package/dist/travel/package-savings.d.ts +79 -39
  379. package/dist/travel/package-savings.js +309 -65
  380. package/dist/travel/price-breakdown.d.ts +30 -22
  381. package/dist/travel/price-breakdown.js +72 -17
  382. package/dist/travel/rating-breakdown.d.ts +25 -18
  383. package/dist/travel/rating-breakdown.js +60 -23
  384. package/dist/travel/seat-map.d.ts +29 -22
  385. package/dist/travel/seat-map.js +140 -78
  386. package/dist/travel/trip-timeline.d.ts +77 -39
  387. package/dist/travel/trip-timeline.js +316 -107
  388. package/dist/utils/eyebrow.d.ts +2 -2
  389. package/dist/utils/eyebrow.js +3 -3
  390. package/dist/utils/index.d.ts +0 -1
  391. package/dist/utils/index.js +0 -1
  392. package/dist/video/episode-list.d.ts +22 -14
  393. package/dist/video/episode-list.js +89 -53
  394. package/dist/video/reel-feed.d.ts +21 -15
  395. package/dist/video/reel-feed.js +59 -24
  396. package/dist/video/story-viewer.d.ts +6 -5
  397. package/dist/video/story-viewer.js +84 -53
  398. package/dist/video/title-hero.d.ts +8 -8
  399. package/dist/video/title-hero.js +48 -34
  400. package/dist/video/video-card.d.ts +34 -20
  401. package/dist/video/video-card.js +119 -76
  402. package/dist/video/video-player.d.ts +17 -14
  403. package/dist/video/video-player.js +68 -30
  404. package/dist/video/video-shelf.d.ts +26 -14
  405. package/dist/video/video-shelf.js +88 -50
  406. package/package.json +4 -2
  407. package/dist/docs/callout.d.ts +0 -46
  408. package/dist/docs/callout.js +0 -61
  409. package/dist/docs/code-block.d.ts +0 -74
  410. package/dist/utils/field-parts.d.ts +0 -26
  411. package/dist/utils/field-parts.js +0 -12
  412. /package/dist/{docs/mixins → mixins}/copy-feedback.d.ts +0 -0
  413. /package/dist/{docs/mixins → mixins}/copy-feedback.js +0 -0
  414. /package/dist/{docs/mixins → mixins}/toc-spy.d.ts +0 -0
  415. /package/dist/{docs/mixins → mixins}/toc-spy.js +0 -0
  416. /package/dist/{docs/utils → utils}/reveal-in-scroller.d.ts +0 -0
  417. /package/dist/{docs/utils → utils}/reveal-in-scroller.js +0 -0
@@ -18,22 +18,18 @@ export declare namespace ContributionGraph {
18
18
  /** Picks the day's level against `levels`; repeated dates add up. */
19
19
  count: number;
20
20
  }
21
- /** Every string the graph shows, so an app translates each one. */
21
+ /** Every string the graph announces, so an app translates each one. */
22
22
  interface Labels {
23
- /** The table's caption, the graph's summary ("4,015 contributions in the last year"). */
23
+ /** The table's caption for assistive technology ("4,015 contributions in the last year"). */
24
24
  caption: string;
25
25
  /**
26
26
  * A day's name, plural on its count, from the date the graph formats in `locale`:
27
27
  * `(12, "Tuesday, Nov 3") => "12 contributions on Tuesday, Nov 3"`.
28
28
  */
29
29
  day: (count: number, date: string) => string;
30
- /** The legend's low end ("Less"). */
31
- less: string;
32
- /** The legend's high end ("More"). */
33
- more: string;
34
30
  }
35
31
  /** Props accepted by {@link ContributionGraph}; the host is a `<div>`. */
36
- interface Props extends Omit<TagProps<"div">, "children"> {
32
+ interface Props extends TagProps<"div"> {
37
33
  /** The counts to plot, in any order; only days between `start` and `end` are drawn. */
38
34
  days: readonly Day[];
39
35
  /** The first day drawn, as `YYYY-MM-DD`. */
@@ -48,9 +44,18 @@ export declare namespace ContributionGraph {
48
44
  locale?: string;
49
45
  /** First day of the week, 0 = Sunday; defaults to the locale's. */
50
46
  weekStart?: number;
51
- /** Every string the graph shows, so it reads in any language. */
47
+ /** Every string the graph announces, so it reads in any language. */
52
48
  labels: Labels;
53
49
  }
50
+ /** Every native `<p>` attribute. */
51
+ interface SummaryProps extends TagProps<"p"> {
52
+ }
53
+ /** Every native `<div>` attribute. */
54
+ interface LegendProps extends TagProps<"div"> {
55
+ }
56
+ /** Every native `<span>` attribute. */
57
+ interface LegendPartProps extends TagProps<"span"> {
58
+ }
54
59
  /** Props {@link ContributionGraphTooltip} serializes for hydration, which is why they are a `type`. */
55
60
  type TooltipProps = {
56
61
  /** The CSS anchor name the tooltip positions against, unique to its graph. */
@@ -75,9 +80,9 @@ export declare function weekStartFor(locale?: string): number;
75
80
  */
76
81
  export declare function contributionLevel(count: number, levels?: readonly number[]): number;
77
82
  /**
78
- * Without script each day's `title` names its count; mapping `@sdxc/ui/app/contribution-graph` in
79
- * the browser entry runs {@link ContributionGraphTooltip}, for a shared tooltip and arrow keys. Size
80
- * it with `--ui-contribution-graph-cell` and `-gap`, match `-bg` to the surface, tint `--graph-level-0`–`4`.
83
+ * Draws the year's grid with its `.Summary` above and `.Legend` below, wherever written; each day's
84
+ * `title` names its count, and {@link ContributionGraphTooltip} adds a shared tooltip and arrow keys.
85
+ * Size it with `--ui-contribution-graph-cell` and `-gap`; tint `--graph-level-0`–`4`.
81
86
  *
82
87
  * @param handle Runtime handle carrying the host `<div>`'s props.
83
88
  * @returns The render function producing the graph's markup.
@@ -91,12 +96,23 @@ export declare function contributionLevel(count: number, levels?: readonly numbe
91
96
  * labels={{
92
97
  * caption: t("profile.contributions", { count: total }),
93
98
  * day: (count, date) => t("profile.contributionsOn", { count, date }),
94
- * less: t("graph.less"),
95
- * more: t("graph.more"),
96
99
  * }}
97
- * />
100
+ * >
101
+ * <ContributionGraph.Summary>{t("profile.contributions", { count: total })}</ContributionGraph.Summary>
102
+ * <ContributionGraph.Legend>
103
+ * <ContributionGraph.LegendLabel>{t("graph.less")}</ContributionGraph.LegendLabel>
104
+ * <ContributionGraph.LegendScale />
105
+ * <ContributionGraph.LegendLabel>{t("graph.more")}</ContributionGraph.LegendLabel>
106
+ * </ContributionGraph.Legend>
107
+ * </ContributionGraph>
98
108
  */
99
109
  export declare function ContributionGraph(handle: Handle<ContributionGraph.Props>): () => import("remix/component").RemixElement;
110
+ export declare namespace ContributionGraph {
111
+ var Summary: (handle: Handle<ContributionGraph.SummaryProps>) => () => import("remix/component").RemixElement;
112
+ var Legend: (handle: Handle<ContributionGraph.LegendProps>) => () => import("remix/component").RemixElement;
113
+ var LegendLabel: (handle: Handle<ContributionGraph.LegendPartProps>) => () => import("remix/component").RemixElement;
114
+ var LegendScale: (handle: Handle<ContributionGraph.LegendPartProps>) => () => import("remix/component").RemixElement;
115
+ }
100
116
  /**
101
117
  * Client island behind {@link ContributionGraph}'s tooltip and keyboard: a manual popover that
102
118
  * `contributionGraphKeys()` fills with the hovered or focused day's name and anchors to it, while
@@ -88,9 +88,9 @@ function anchorName(id) {
88
88
  return `--ui-contribution-graph-${id.replace(/[^\w-]/g, "-")}`;
89
89
  }
90
90
  /**
91
- * Without script each day's `title` names its count; mapping `@sdxc/ui/app/contribution-graph` in
92
- * the browser entry runs {@link ContributionGraphTooltip}, for a shared tooltip and arrow keys. Size
93
- * it with `--ui-contribution-graph-cell` and `-gap`, match `-bg` to the surface, tint `--graph-level-0`–`4`.
91
+ * Draws the year's grid with its `.Summary` above and `.Legend` below, wherever written; each day's
92
+ * `title` names its count, and {@link ContributionGraphTooltip} adds a shared tooltip and arrow keys.
93
+ * Size it with `--ui-contribution-graph-cell` and `-gap`; tint `--graph-level-0`–`4`.
94
94
  *
95
95
  * @param handle Runtime handle carrying the host `<div>`'s props.
96
96
  * @returns The render function producing the graph's markup.
@@ -104,14 +104,19 @@ function anchorName(id) {
104
104
  * labels={{
105
105
  * caption: t("profile.contributions", { count: total }),
106
106
  * day: (count, date) => t("profile.contributionsOn", { count, date }),
107
- * less: t("graph.less"),
108
- * more: t("graph.more"),
109
107
  * }}
110
- * />
108
+ * >
109
+ * <ContributionGraph.Summary>{t("profile.contributions", { count: total })}</ContributionGraph.Summary>
110
+ * <ContributionGraph.Legend>
111
+ * <ContributionGraph.LegendLabel>{t("graph.less")}</ContributionGraph.LegendLabel>
112
+ * <ContributionGraph.LegendScale />
113
+ * <ContributionGraph.LegendLabel>{t("graph.more")}</ContributionGraph.LegendLabel>
114
+ * </ContributionGraph.Legend>
115
+ * </ContributionGraph>
111
116
  */
112
117
  export function ContributionGraph(handle) {
113
118
  return () => {
114
- let { days, start, end, levels, href, locale, weekStart, labels, mix, ...rest } = handle.props;
119
+ let { days, start, end, levels, href, locale, weekStart, labels, children, mix, ...rest } = handle.props;
115
120
  let first = dayNumber(start);
116
121
  let last = Math.max(first, dayNumber(end));
117
122
  let startsOn = weekStart ?? weekStartFor(locale);
@@ -143,7 +148,7 @@ export function ContributionGraph(handle) {
143
148
  timeZone: "UTC",
144
149
  });
145
150
  let anchor = anchorName(handle.id);
146
- return (_jsxs("div", { ...rest, "data-slot": "contribution-graph", mix: mergeMix([flex(), raw({ flexDirection: "column" }), gap(2), minIs(0)], mix), children: [_jsx("p", { "aria-hidden": "true", "data-slot": "contribution-graph-summary", mix: [raw({ margin: 0 }), text("sm"), weight("medium"), fg("neutral.emphasis")], children: labels.caption }), _jsx("div", { "data-slot": "contribution-graph-scroller", mix: [
151
+ return (_jsxs("div", { ...rest, "data-slot": "contribution-graph", mix: mergeMix([flex(), raw({ flexDirection: "column" }), gap(2), minIs(0)], mix), children: [children, _jsx("div", { "data-slot": "contribution-graph-scroller", mix: [
147
152
  minIs(0),
148
153
  /**
149
154
  * Laid out from the end, the scroller's resting position is its newest week, so a
@@ -213,26 +218,82 @@ export function ContributionGraph(handle) {
213
218
  }
214
219
  return (_jsx("td", { tabIndex: tabIndex, "aria-label": name, title: name, "data-slot": "contribution-graph-day", "data-level": level, "data-count": count, "data-date": date, "data-week": index, "data-row": row }));
215
220
  })] }));
216
- }) })] }) }), _jsxs("div", { "data-slot": "contribution-graph-legend", mix: [
217
- flex(),
218
- items("center"),
219
- justify("end"),
220
- gap(1),
221
- text("xs"),
222
- fg("neutral.muted"),
223
- nowrap(),
224
- tabularNums(),
225
- raw({
226
- "& > [data-level]": {
227
- inlineSize: "var(--ui-contribution-graph-cell, 10px)",
228
- blockSize: "var(--ui-contribution-graph-cell, 10px)",
229
- borderRadius: "2px",
230
- },
231
- }),
232
- raw(levelRules("& > span")),
233
- ], children: [_jsx("span", { mix: [raw({ marginInlineEnd: "0.25rem" })], children: labels.less }), LEVELS.map((level) => (_jsx("span", { "aria-hidden": "true", "data-level": level }))), _jsx("span", { mix: [raw({ marginInlineStart: "0.25rem" })], children: labels.more })] }), _jsx(ContributionGraphTooltip, { anchor: anchor })] }));
221
+ }) })] }) }), _jsx(ContributionGraphTooltip, { anchor: anchor })] }));
234
222
  };
235
223
  }
224
+ /**
225
+ * The graph's summary line above the grid, such as "4,015 contributions in the last year",
226
+ * hidden from assistive technology since the table's caption says the same.
227
+ *
228
+ * @param handle Runtime handle carrying the host `<p>`'s props.
229
+ * @returns The render function producing the summary.
230
+ */
231
+ ContributionGraph.Summary = function ContributionGraphSummary(handle) {
232
+ return () => {
233
+ let { mix, ...rest } = handle.props;
234
+ return (_jsx("p", { "aria-hidden": "true", "data-slot": "contribution-graph-summary", ...rest, mix: mergeMix([raw({ margin: 0, order: "-1" }), text("sm"), weight("medium"), fg("neutral.emphasis")], mix) }));
235
+ };
236
+ };
237
+ /**
238
+ * The legend under the grid, end-aligned: a {@link ContributionGraph.LegendLabel} at each end of
239
+ * a {@link ContributionGraph.LegendScale}, in the order written.
240
+ *
241
+ * @param handle Runtime handle carrying the host `<div>`'s props.
242
+ * @returns The render function producing the legend.
243
+ */
244
+ ContributionGraph.Legend = function ContributionGraphLegend(handle) {
245
+ return () => {
246
+ let { mix, ...rest } = handle.props;
247
+ return (_jsx("div", { "data-slot": "contribution-graph-legend", ...rest, mix: mergeMix([
248
+ flex(),
249
+ items("center"),
250
+ justify("end"),
251
+ gap(1),
252
+ text("xs"),
253
+ fg("neutral.muted"),
254
+ nowrap(),
255
+ tabularNums(),
256
+ raw({ order: "1" }),
257
+ ], mix) }));
258
+ };
259
+ };
260
+ /**
261
+ * One end of the legend, such as "Less" or "More", spaced a little from the scale.
262
+ *
263
+ * @param handle Runtime handle carrying the host `<span>`'s props.
264
+ * @returns The render function producing the label.
265
+ */
266
+ ContributionGraph.LegendLabel = function ContributionGraphLegendLabel(handle) {
267
+ return () => {
268
+ let { mix, ...rest } = handle.props;
269
+ return (_jsx("span", { "data-slot": "contribution-graph-legend-label", ...rest, mix: mergeMix([raw({ marginInline: "0.25rem" })], mix) }));
270
+ };
271
+ };
272
+ /**
273
+ * One swatch per level, lowest first, in the graph's own tints; decorative, since the labels
274
+ * around it say which end is which.
275
+ *
276
+ * @param handle Runtime handle carrying the host `<span>`'s props.
277
+ * @returns The render function producing the swatches.
278
+ */
279
+ ContributionGraph.LegendScale = function ContributionGraphLegendScale(handle) {
280
+ return () => {
281
+ let { mix, ...rest } = handle.props;
282
+ return (_jsx("span", { "aria-hidden": "true", "data-slot": "contribution-graph-legend-scale", ...rest, mix: mergeMix([
283
+ flex(),
284
+ items("center"),
285
+ gap(1),
286
+ raw({
287
+ "& > [data-level]": {
288
+ inlineSize: "var(--ui-contribution-graph-cell, 10px)",
289
+ blockSize: "var(--ui-contribution-graph-cell, 10px)",
290
+ borderRadius: "2px",
291
+ },
292
+ }),
293
+ raw(levelRules("& > span")),
294
+ ], mix), children: LEVELS.map((level) => (_jsx("span", { "data-level": level }))) }));
295
+ };
296
+ };
236
297
  /**
237
298
  * Tints each level from its `--graph-level-N` token, which an app's theme may set; unset, level 0 is
238
299
  * the neutral tint and levels 1–4 mix the accent into it, so both light and dark themes are designed.
@@ -1,35 +1,28 @@
1
1
  /**
2
- * The last section of a settings page, holding the actions that cannot be undone. Each
3
- * action is a row that names its consequences and opens a `Confirm`, so the decision is
4
- * read twice before anything is deleted, and a danger border sets the section apart.
2
+ * The last section of a settings page, holding the actions that cannot be undone, as pieces a
3
+ * caller arranges: a heading and description over a danger-bordered card of action rows, each
4
+ * naming its consequences and opening a `Confirm`, so the decision is read twice.
5
5
  *
6
6
  * @author [Sergio Xalambrí](https://sergiodxa.com)
7
7
  * @copyright Sergio Xalambrí 2026
8
8
  */
9
- import type { Handle, Props as TagProps, RemixNode } from "remix/component";
10
- import { Confirm } from "../components/confirm.js";
9
+ import type { Handle, Props as TagProps } from "remix/component";
11
10
  import type { ActionPlacement as ActionPlacementType } from "./styles/action-row.js";
12
11
  /**
13
- * Prop types for {@link DangerZone} and {@link DangerZone.Action}.
12
+ * Prop types for {@link DangerZone} and its parts.
14
13
  */
15
14
  export declare namespace DangerZone {
16
- /** Props accepted by {@link DangerZone}. */
17
- interface Props extends Omit<TagProps<"section">, "title"> {
18
- /** The section's heading, such as "Danger zone". */
19
- title: RemixNode;
20
- description?: RemixNode;
15
+ /** Every native `<section>` attribute; name it with a {@link DangerZone.Title} or `aria-label`. */
16
+ type Props = TagProps<"section">;
17
+ /** What the section shares with its heading. */
18
+ interface Context {
19
+ /** The heading's id, which names the section. */
20
+ titleId: string;
21
21
  }
22
22
  /** Where an action's button sits: at the row's end on its title's line, or below its text. */
23
23
  type ActionPlacement = ActionPlacementType;
24
- /** Props accepted by {@link DangerZone.Action}. */
25
- interface ActionProps extends Omit<TagProps<"div">, "title"> {
26
- /** The confirm dialog's `id`, which the row's button opens. */
27
- id: string;
28
- /** What the action does, such as "Delete team". */
29
- title: RemixNode;
30
- description?: RemixNode;
31
- /** What is lost, one item each: "14 monitors stop checking", "Invoices stay in Billing". */
32
- consequences?: ReadonlyArray<RemixNode>;
24
+ /** Every native `<div>` attribute, plus where the row's button sits. */
25
+ interface ActionProps extends TagProps<"div"> {
33
26
  /**
34
27
  * Where the button sits on a wide card: under the text, for a row that lists its
35
28
  * consequences, or at the row's end on the title's line, for a short one. A narrow
@@ -38,29 +31,41 @@ export declare namespace DangerZone {
38
31
  * @default "below"
39
32
  */
40
33
  actionPlacement?: ActionPlacement;
41
- /** The row's button text; name the action, such as "Delete team". */
42
- buttonLabel: RemixNode;
43
- /**
44
- * The confirmation the button opens. Name the item in the title and description and
45
- * the action on the confirm button; add `typeToConfirm` for the biggest deletions.
46
- */
47
- confirm: Omit<Confirm.Props, "id">;
48
34
  }
35
+ /** What a row shares with its button. */
36
+ interface ActionContext {
37
+ actionPlacement: ActionPlacement;
38
+ }
39
+ /** Every native `<button>` attribute; `commandfor` names the row's `Confirm`. */
40
+ type TriggerProps = TagProps<"button">;
49
41
  }
50
42
  /**
51
- * Renders the section: a heading over a card with a danger border whose rows are
52
- * {@link DangerZone.Action}s.
43
+ * Renders the section, laying out its {@link DangerZone.Title}, {@link DangerZone.Description}
44
+ * and {@link DangerZone.Card} in the order given, each spaced from the one before it.
53
45
  *
54
46
  * @param handle Runtime handle carrying the section's props.
55
47
  * @returns The render function producing the section's markup.
56
48
  * @example
57
- * <DangerZone title="Danger zone">
58
- * <DangerZone.Action id="delete-team" title="Delete team" buttonLabel="Delete team"
59
- * consequences={["14 monitors stop checking", "Status pages go offline"]}
60
- * confirm={{ title: "Delete team?", confirmLabel: "Delete team", cancelLabel: "Cancel", form: { action: "/team/delete" } }} />
49
+ * <DangerZone>
50
+ * <DangerZone.Title>Danger zone</DangerZone.Title>
51
+ * <DangerZone.Card>
52
+ * <DangerZone.Action>
53
+ * <DangerZone.ActionTitle>Delete team</DangerZone.ActionTitle>
54
+ * <DangerZone.Consequences><li>14 monitors stop checking</li></DangerZone.Consequences>
55
+ * <DangerZone.Trigger commandfor="delete-team">Delete team</DangerZone.Trigger>
56
+ * <Confirm id="delete-team" … />
57
+ * </DangerZone.Action>
58
+ * </DangerZone.Card>
61
59
  * </DangerZone>
62
60
  */
63
- export declare function DangerZone(handle: Handle<DangerZone.Props>): () => import("remix/component").RemixElement;
61
+ export declare function DangerZone(handle: Handle<DangerZone.Props, DangerZone.Context>): () => import("remix/component").RemixElement;
64
62
  export declare namespace DangerZone {
65
- var Action: (handle: Handle<DangerZone.ActionProps>) => () => import("remix/component").RemixElement;
63
+ var Title: (handle: Handle<TagProps<"h2">>) => () => import("remix/component").RemixElement;
64
+ var Description: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
65
+ var Card: (handle: Handle<TagProps<"div">>) => () => import("remix/component").RemixElement;
66
+ var Action: (handle: Handle<DangerZone.ActionProps, DangerZone.ActionContext>) => () => import("remix/component").RemixElement;
67
+ var ActionTitle: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
68
+ var ActionDescription: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
69
+ var Consequences: (handle: Handle<TagProps<"ul">>) => () => import("remix/component").RemixElement;
70
+ var Trigger: (handle: Handle<DangerZone.TriggerProps>) => () => import("remix/component").RemixElement;
66
71
  }
@@ -1,66 +1,209 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
1
+ import { jsx as _jsx } from "remix/component/jsx-runtime";
2
2
  import { bg, border, fg } from "@sdxc/u/color";
3
3
  import { rounded } from "@sdxc/u/effects";
4
- import { listStyle, mergeMix } from "@sdxc/u/general";
4
+ import { listStyle, mergeMix, raw } from "@sdxc/u/general";
5
5
  import { container, vstack } from "@sdxc/u/layout";
6
6
  import { divide, overflow } from "@sdxc/u/overflow";
7
7
  import { m, minIs, p, pis } from "@sdxc/u/size";
8
+ import { when } from "@sdxc/u/state";
8
9
  import { balance, pretty, text, weight } from "@sdxc/u/typography";
9
10
  import { Button } from "../components/button.js";
10
- import { Confirm } from "../components/confirm.js";
11
- import { actionRowGrid, onTitleLine } from "./styles/action-row.js";
11
+ import { onTitleLine } from "./styles/action-row.js";
12
+ /** The marker attribute the section's and rows' layouts select their parts by. */
13
+ const PART = "data-danger-zone-part";
12
14
  /** Container an action row measures, stacking its button under the text when narrow. */
13
15
  const ROW_CONTAINER = "ui-danger-zone";
16
+ /** Container width from which an end-placed button leaves the stack for the row's end. */
17
+ const ROW_WIDE = `@container ${ROW_CONTAINER} (min-width: 32rem)`;
14
18
  /** Where an action's button sits when `actionPlacement` is omitted. */
15
19
  const DEFAULT_ACTION_PLACEMENT = "below";
16
20
  /**
17
- * Renders the section: a heading over a card with a danger border whose rows are
18
- * {@link DangerZone.Action}s.
21
+ * Renders the section, laying out its {@link DangerZone.Title}, {@link DangerZone.Description}
22
+ * and {@link DangerZone.Card} in the order given, each spaced from the one before it.
19
23
  *
20
24
  * @param handle Runtime handle carrying the section's props.
21
25
  * @returns The render function producing the section's markup.
22
26
  * @example
23
- * <DangerZone title="Danger zone">
24
- * <DangerZone.Action id="delete-team" title="Delete team" buttonLabel="Delete team"
25
- * consequences={["14 monitors stop checking", "Status pages go offline"]}
26
- * confirm={{ title: "Delete team?", confirmLabel: "Delete team", cancelLabel: "Cancel", form: { action: "/team/delete" } }} />
27
+ * <DangerZone>
28
+ * <DangerZone.Title>Danger zone</DangerZone.Title>
29
+ * <DangerZone.Card>
30
+ * <DangerZone.Action>
31
+ * <DangerZone.ActionTitle>Delete team</DangerZone.ActionTitle>
32
+ * <DangerZone.Consequences><li>14 monitors stop checking</li></DangerZone.Consequences>
33
+ * <DangerZone.Trigger commandfor="delete-team">Delete team</DangerZone.Trigger>
34
+ * <Confirm id="delete-team" … />
35
+ * </DangerZone.Action>
36
+ * </DangerZone.Card>
27
37
  * </DangerZone>
28
38
  */
29
39
  export function DangerZone(handle) {
30
40
  return () => {
31
- let { title, description, children, mix, ...rest } = handle.props;
41
+ let { children, mix, ...rest } = handle.props;
32
42
  let titleId = `${handle.id}-title`;
33
- return (_jsxs("section", { ...rest, "aria-labelledby": titleId, "data-slot": "danger-zone", mix: mergeMix([vstack({ gap: 3, align: "stretch" })], mix), children: [_jsxs("header", { mix: [vstack({ gap: 1, align: "stretch" })], children: [_jsx("h2", { id: titleId, mix: [m(0), text("base"), weight("semibold"), fg("neutral.emphasis"), balance()], children: title }), description ? (_jsx("p", { mix: [m(0), text("sm"), fg("neutral.muted"), pretty()], children: description })) : null] }), _jsx("div", { "data-slot": "danger-zone-card", mix: [
34
- vstack({ gap: 0, align: "stretch" }),
35
- rounded("lg"),
36
- border({ color: "danger", width: 1 }),
37
- bg(),
38
- overflow("hidden"),
39
- divide("block", "danger"),
40
- ], children: children })] }));
43
+ handle.context.set({ titleId });
44
+ return (_jsx("section", { "aria-labelledby": rest["aria-label"] === undefined ? titleId : undefined, "data-slot": "danger-zone", ...rest, mix: mergeMix([
45
+ vstack({ gap: 0, align: "stretch" }),
46
+ when(`& > [${PART}=description]:not(:first-child)`, raw({ marginBlockStart: "0.25rem" })),
47
+ when(`& > [${PART}=card]:not(:first-child)`, raw({ marginBlockStart: "0.75rem" })),
48
+ ], mix), children: children }));
41
49
  };
42
50
  }
43
51
  /**
44
- * Renders one irreversible action: its title, description and consequence list, then a
45
- * danger button that opens its {@link Confirm}, under the text or at the row's end as
46
- * `actionPlacement` says.
52
+ * The section's heading, which names it.
47
53
  *
48
- * @param handle Runtime handle carrying the action's props.
54
+ * @param handle Runtime handle carrying the heading's props.
55
+ * @returns The render function producing the heading.
56
+ * @example <DangerZone.Title>Danger zone</DangerZone.Title>
57
+ */
58
+ DangerZone.Title = function DangerZoneTitle(handle) {
59
+ return () => {
60
+ let { children, mix, ...rest } = handle.props;
61
+ let context = handle.context.get(DangerZone);
62
+ return (_jsx("h2", { id: context?.titleId, "data-slot": "danger-zone-title", "data-danger-zone-part": "title", ...rest, mix: mergeMix([m(0), text("base"), weight("semibold"), fg("neutral.emphasis"), balance()], mix), children: children }));
63
+ };
64
+ };
65
+ /**
66
+ * A muted line under the section's heading.
67
+ *
68
+ * @param handle Runtime handle carrying the paragraph's props.
69
+ * @returns The render function producing the paragraph.
70
+ * @example <DangerZone.Description>These actions cannot be undone.</DangerZone.Description>
71
+ */
72
+ DangerZone.Description = function DangerZoneDescription(handle) {
73
+ return () => {
74
+ let { children, mix, ...rest } = handle.props;
75
+ return (_jsx("p", { "data-slot": "danger-zone-description", "data-danger-zone-part": "description", ...rest, mix: mergeMix([m(0), text("sm"), fg("neutral.muted"), pretty()], mix), children: children }));
76
+ };
77
+ };
78
+ /**
79
+ * The danger-bordered card holding the section's {@link DangerZone.Action} rows, a rule
80
+ * between each.
81
+ *
82
+ * @param handle Runtime handle carrying the card's props.
83
+ * @returns The render function producing the card.
84
+ * @example <DangerZone.Card><DangerZone.Action>…</DangerZone.Action></DangerZone.Card>
85
+ */
86
+ DangerZone.Card = function DangerZoneCard(handle) {
87
+ return () => {
88
+ let { children, mix, ...rest } = handle.props;
89
+ return (_jsx("div", { "data-slot": "danger-zone-card", "data-danger-zone-part": "card", ...rest, mix: mergeMix([
90
+ vstack({ gap: 0, align: "stretch" }),
91
+ rounded("lg"),
92
+ border({ color: "danger", width: 1 }),
93
+ bg(),
94
+ overflow("hidden"),
95
+ divide("block", "danger"),
96
+ ], mix), children: children }));
97
+ };
98
+ };
99
+ /**
100
+ * One irreversible action as a row: its {@link DangerZone.ActionTitle},
101
+ * {@link DangerZone.ActionDescription} and {@link DangerZone.Consequences} stack in one column,
102
+ * and its {@link DangerZone.Trigger} sits under them or at the row's end as `actionPlacement`
103
+ * says. Put the `Confirm` the trigger opens inside the row too; it takes no room while closed.
104
+ *
105
+ * @param handle Runtime handle carrying the row's props.
49
106
  * @returns The render function producing the row's markup.
50
107
  * @example
51
- * <DangerZone.Action id="transfer" title="Transfer ownership" buttonLabel="Transfer…" actionPlacement="end" confirm={…} />
108
+ * <DangerZone.Action actionPlacement="end">
109
+ * <DangerZone.ActionTitle>Transfer ownership</DangerZone.ActionTitle>
110
+ * <DangerZone.Trigger commandfor="transfer">Transfer…</DangerZone.Trigger>
111
+ * <Confirm id="transfer" … />
112
+ * </DangerZone.Action>
52
113
  */
53
114
  DangerZone.Action = function DangerZoneAction(handle) {
54
115
  return () => {
55
- let { id, title, description, consequences, actionPlacement: actionPlacementProp, buttonLabel, confirm, mix, ...rest } = handle.props;
56
- let actionPlacement = actionPlacementProp ?? DEFAULT_ACTION_PLACEMENT;
57
- return (_jsxs("div", { ...rest, "data-slot": "danger-zone-action", "data-action-placement": actionPlacement, mix: mergeMix([container(ROW_CONTAINER)], mix), children: [_jsxs("div", { mix: [p(4), actionRowGrid(ROW_CONTAINER, actionPlacement, "0.75rem 1.5rem")], children: [_jsxs("div", { "data-slot": "danger-zone-text", mix: [vstack({ gap: 1, align: "stretch" }), minIs(0)], children: [_jsx("p", { mix: [m(0), text("sm"), weight("medium"), fg("neutral.emphasis")], children: title }), description ? (_jsx("p", { mix: [m(0), text("sm"), fg("neutral.muted"), pretty()], children: description })) : null, consequences && consequences.length > 0 ? (_jsx("ul", { "data-slot": "danger-zone-consequences", mix: [
58
- vstack({ gap: 0.5, align: "stretch" }),
59
- m(0),
60
- pis(5),
61
- listStyle("disc"),
62
- text("sm"),
63
- fg("neutral.muted"),
64
- ], children: consequences.map((consequence) => (_jsx("li", { children: consequence }))) })) : null] }), _jsx("div", { "data-slot": "danger-zone-control", mix: [minIs(0), actionPlacement === "end" ? onTitleLine(ROW_CONTAINER) : undefined], children: _jsx(Button, { commandfor: id, command: "show-modal", color: "danger", variant: "outline", size: "sm", children: buttonLabel }) })] }), _jsx(Confirm, { ...confirm, id: id })] }));
116
+ let { actionPlacement = DEFAULT_ACTION_PLACEMENT, children, mix, ...rest } = handle.props;
117
+ handle.context.set({ actionPlacement });
118
+ return (_jsx("div", { "data-slot": "danger-zone-action", "data-action-placement": actionPlacement, ...rest, mix: mergeMix([container(ROW_CONTAINER)], mix), children: _jsx("div", { "data-slot": "danger-zone-row", mix: [
119
+ p(4),
120
+ raw({
121
+ display: "grid",
122
+ gridTemplateColumns: "minmax(0, 1fr)",
123
+ alignItems: "start",
124
+ justifyItems: "stretch",
125
+ rowGap: "0.25rem",
126
+ columnGap: "1.5rem",
127
+ ...(actionPlacement === "end"
128
+ ? { [ROW_WIDE]: { gridTemplateColumns: "minmax(0, 1fr) auto" } }
129
+ : {}),
130
+ }),
131
+ when(`& > :not([${PART}=control])`, raw({ gridColumn: "1" })),
132
+ ], children: children }) }));
133
+ };
134
+ };
135
+ /**
136
+ * What the action does, the row's first line.
137
+ *
138
+ * @param handle Runtime handle carrying the paragraph's props.
139
+ * @returns The render function producing the title.
140
+ * @example <DangerZone.ActionTitle>Delete team</DangerZone.ActionTitle>
141
+ */
142
+ DangerZone.ActionTitle = function DangerZoneActionTitle(handle) {
143
+ return () => {
144
+ let { children, mix, ...rest } = handle.props;
145
+ return (_jsx("p", { "data-slot": "danger-zone-action-title", "data-danger-zone-part": "action-title", ...rest, mix: mergeMix([m(0), text("sm"), weight("medium"), fg("neutral.emphasis")], mix), children: children }));
146
+ };
147
+ };
148
+ /**
149
+ * A muted line explaining the action.
150
+ *
151
+ * @param handle Runtime handle carrying the paragraph's props.
152
+ * @returns The render function producing the description.
153
+ * @example <DangerZone.ActionDescription>Permanently delete Acme Ops.</DangerZone.ActionDescription>
154
+ */
155
+ DangerZone.ActionDescription = function DangerZoneActionDescription(handle) {
156
+ return () => {
157
+ let { children, mix, ...rest } = handle.props;
158
+ return (_jsx("p", { "data-slot": "danger-zone-action-description", "data-danger-zone-part": "action-description", ...rest, mix: mergeMix([m(0), text("sm"), fg("neutral.muted"), pretty()], mix), children: children }));
159
+ };
160
+ };
161
+ /**
162
+ * What is lost, as a bulleted list of `<li>` children: "14 monitors stop checking", "Invoices
163
+ * stay in Billing".
164
+ *
165
+ * @param handle Runtime handle carrying the list's props.
166
+ * @returns The render function producing the list.
167
+ * @example <DangerZone.Consequences><li>Status pages go offline</li></DangerZone.Consequences>
168
+ */
169
+ DangerZone.Consequences = function DangerZoneConsequences(handle) {
170
+ return () => {
171
+ let { children, mix, ...rest } = handle.props;
172
+ return (_jsx("ul", { "data-slot": "danger-zone-consequences", "data-danger-zone-part": "consequences", ...rest, mix: mergeMix([
173
+ vstack({ gap: 0.5, align: "stretch" }),
174
+ m(0),
175
+ pis(5),
176
+ listStyle("disc"),
177
+ text("sm"),
178
+ fg("neutral.muted"),
179
+ ], mix), children: children }));
180
+ };
181
+ };
182
+ /**
183
+ * The row's danger button, which opens the `Confirm` its `commandfor` names. Under the text it
184
+ * keeps a wider gap from the line above; placed at the end of a wide row it is centred on the
185
+ * title's first line.
186
+ *
187
+ * @param handle Runtime handle carrying the button's props.
188
+ * @returns The render function producing the button in its cell.
189
+ * @example <DangerZone.Trigger commandfor="delete-team">Delete team</DangerZone.Trigger>
190
+ */
191
+ DangerZone.Trigger = function DangerZoneTrigger(handle) {
192
+ return () => {
193
+ let { children, mix, ...rest } = handle.props;
194
+ let context = handle.context.get(DangerZone.Action);
195
+ let end = (context?.actionPlacement ?? DEFAULT_ACTION_PLACEMENT) === "end";
196
+ return (_jsx("div", { "data-slot": "danger-zone-control", "data-danger-zone-part": "control", mix: [
197
+ minIs(0),
198
+ raw({
199
+ gridColumn: "1",
200
+ justifySelf: "start",
201
+ marginBlockStart: "0.5rem",
202
+ ...(end
203
+ ? { [ROW_WIDE]: { gridColumn: "2", gridRow: "1", marginBlockStart: "0" } }
204
+ : {}),
205
+ }),
206
+ end ? onTitleLine(ROW_CONTAINER) : undefined,
207
+ ], children: _jsx(Button, { command: "show-modal", color: "danger", variant: "outline", size: "sm", "data-slot": "danger-zone-trigger", ...rest, mix: mix, children: children }) }));
65
208
  };
66
209
  };