@sdxc/ui 2026.10.30 → 2026.11.1

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 (410) hide show
  1. package/README.md +187 -113
  2. package/dist/{behaviors → app/behaviors}/drag-session.js +1 -1
  3. package/dist/{behaviors → app/behaviors}/toaster.js +1 -1
  4. package/dist/{components → app}/chart.d.ts +1 -1
  5. package/dist/{components → app}/chart.js +18 -34
  6. package/dist/{components → app}/context-menu.d.ts +2 -2
  7. package/dist/{components → app}/context-menu.js +8 -7
  8. package/dist/{components → app}/drop-indicator.js +3 -3
  9. package/dist/{components → app}/drop-zone.js +3 -3
  10. package/dist/{components → app}/empty.d.ts +1 -1
  11. package/dist/{components → app}/empty.js +11 -21
  12. package/dist/{components → app}/file-trigger.js +2 -2
  13. package/dist/{components → app}/grid-list.d.ts +1 -1
  14. package/dist/{components → app}/grid-list.js +16 -18
  15. package/dist/app/index.d.ts +41 -0
  16. package/dist/app/index.js +41 -0
  17. package/dist/{components → app}/menubar.js +5 -7
  18. package/dist/{mixins → app/mixins}/drag-reorder.js +1 -1
  19. package/dist/{mixins → app/mixins}/drop-zone.js +1 -1
  20. package/dist/{mixins → app/mixins}/grid-list-keys.js +2 -2
  21. package/dist/{mixins → app/mixins}/menubar-keys.js +2 -2
  22. package/dist/{mixins → app/mixins}/resize-handle.js +3 -3
  23. package/dist/{mixins/treeKeys.js → app/mixins/tree-keys.js} +2 -2
  24. package/dist/{components → app}/resizable.js +7 -10
  25. package/dist/{components → app}/shortcut-list.js +4 -3
  26. package/dist/{components → app}/skeleton.js +3 -3
  27. package/dist/{styles → app/styles}/chart-palette.d.ts +1 -1
  28. package/dist/{styles → app/styles}/graphic-host.d.ts +1 -1
  29. package/dist/{styles → app/styles}/legend-toggle.d.ts +1 -1
  30. package/dist/{components → app}/table.js +12 -15
  31. package/dist/{components → app}/toast.js +18 -24
  32. package/dist/{components → app}/toolbar.js +3 -3
  33. package/dist/{components → app}/tree.d.ts +1 -1
  34. package/dist/{components → app}/tree.js +10 -14
  35. package/dist/{utils → app/utils}/chart-path.d.ts +1 -1
  36. package/dist/{utils → app/utils}/chart-path.js +2 -2
  37. package/dist/{utils → app/utils}/chart-scale.js +1 -1
  38. package/dist/behaviors/index.d.ts +0 -5
  39. package/dist/behaviors/index.js +0 -5
  40. package/dist/{components → chat}/attachment.d.ts +1 -1
  41. package/dist/{components → chat}/attachment.js +17 -23
  42. package/dist/{behaviors → chat/behaviors}/scroll-follow-model.js +1 -1
  43. package/dist/{components → chat}/bubble.js +14 -14
  44. package/dist/chat/index.d.ts +16 -0
  45. package/dist/chat/index.js +16 -0
  46. package/dist/{components → chat}/marker.js +6 -8
  47. package/dist/{components → chat}/message-scroller.d.ts +1 -1
  48. package/dist/{components → chat}/message-scroller.js +12 -18
  49. package/dist/{components → chat}/message.js +10 -12
  50. package/dist/{mixins → chat/mixins}/message-follow.js +2 -2
  51. package/dist/{components → color}/color-area.js +7 -10
  52. package/dist/{components → color}/color-field.js +7 -6
  53. package/dist/{components → color}/color-picker.d.ts +1 -1
  54. package/dist/{components → color}/color-picker.js +9 -12
  55. package/dist/{components → color}/color-slider.js +10 -13
  56. package/dist/{components → color}/color-swatch-picker.js +4 -5
  57. package/dist/{components → color}/color-swatch.js +3 -4
  58. package/dist/{components → color}/color-wheel.js +5 -6
  59. package/dist/color/index.d.ts +21 -0
  60. package/dist/color/index.js +21 -0
  61. package/dist/{mixins → color/mixins}/color-area-drag.d.ts +1 -1
  62. package/dist/{mixins → color/mixins}/color-area-drag.js +2 -2
  63. package/dist/{mixins → color/mixins}/color-preview.js +1 -1
  64. package/dist/{mixins → color/mixins}/color-wheel-drag.js +1 -1
  65. package/dist/{styles → color/styles}/rtl-aware-gradient-direction.d.ts +1 -1
  66. package/dist/components/accordion.d.ts +3 -3
  67. package/dist/components/accordion.js +19 -15
  68. package/dist/components/alert-dialog.js +5 -4
  69. package/dist/components/alert.js +10 -20
  70. package/dist/components/aspect-ratio.js +3 -4
  71. package/dist/components/avatar.d.ts +6 -6
  72. package/dist/components/avatar.js +56 -8
  73. package/dist/components/badge.js +11 -9
  74. package/dist/components/breadcrumbs.js +7 -9
  75. package/dist/components/button.d.ts +8 -6
  76. package/dist/components/button.js +22 -14
  77. package/dist/components/calendar.js +13 -24
  78. package/dist/components/card.js +9 -11
  79. package/dist/components/carousel.d.ts +1 -1
  80. package/dist/components/carousel.js +12 -20
  81. package/dist/components/checkbox-group.js +3 -3
  82. package/dist/components/checkbox.js +2 -2
  83. package/dist/components/combobox.js +6 -6
  84. package/dist/components/command.js +10 -14
  85. package/dist/components/cta-group.d.ts +30 -14
  86. package/dist/components/cta-group.js +29 -10
  87. package/dist/components/date-field.js +2 -1
  88. package/dist/components/date-picker.js +4 -5
  89. package/dist/components/date-range-picker.js +3 -2
  90. package/dist/components/description.js +2 -1
  91. package/dist/components/dialog-dismiss.d.ts +18 -0
  92. package/dist/components/dialog-dismiss.js +15 -0
  93. package/dist/components/dialog.js +11 -15
  94. package/dist/components/disclosure.js +10 -14
  95. package/dist/components/drawer.js +3 -4
  96. package/dist/components/field-error.js +3 -3
  97. package/dist/components/form.js +2 -1
  98. package/dist/components/group.js +3 -3
  99. package/dist/components/header.js +3 -3
  100. package/dist/components/heading-scope.js +2 -1
  101. package/dist/components/heading.d.ts +4 -4
  102. package/dist/components/heading.js +7 -7
  103. package/dist/components/highlight.js +17 -12
  104. package/dist/components/hover-card.js +6 -8
  105. package/dist/components/image-placeholder.js +13 -19
  106. package/dist/components/index.d.ts +6 -38
  107. package/dist/components/index.js +6 -38
  108. package/dist/components/input.js +3 -4
  109. package/dist/components/item.js +10 -19
  110. package/dist/components/keyboard.js +3 -3
  111. package/dist/components/label.js +2 -1
  112. package/dist/components/link-button.d.ts +7 -5
  113. package/dist/components/link-button.js +16 -11
  114. package/dist/components/link.js +3 -4
  115. package/dist/components/listbox.js +6 -11
  116. package/dist/components/menu.js +5 -6
  117. package/dist/components/meter.js +5 -6
  118. package/dist/components/modal.js +9 -11
  119. package/dist/components/nav-link.d.ts +1 -1
  120. package/dist/components/nav-link.js +3 -4
  121. package/dist/components/navigation-menu.js +17 -23
  122. package/dist/components/number-field.js +8 -10
  123. package/dist/components/otp-field.js +2 -1
  124. package/dist/components/overlay-arrow.js +3 -4
  125. package/dist/components/pagination.js +8 -10
  126. package/dist/components/popover.js +3 -4
  127. package/dist/components/progress-bar.js +5 -5
  128. package/dist/components/radio-group.js +5 -7
  129. package/dist/components/range-calendar.js +3 -3
  130. package/dist/components/scroll-area.js +4 -5
  131. package/dist/components/search-field.js +8 -11
  132. package/dist/components/section.js +2 -1
  133. package/dist/components/select.js +10 -22
  134. package/dist/components/selection-indicator.js +3 -3
  135. package/dist/components/sentinel-row.js +3 -3
  136. package/dist/components/separator.js +3 -3
  137. package/dist/components/shared-element.js +2 -1
  138. package/dist/components/sheet.js +6 -7
  139. package/dist/components/sidebar.js +48 -76
  140. package/dist/components/slider.js +8 -10
  141. package/dist/components/spinner.js +3 -3
  142. package/dist/components/switch.js +3 -3
  143. package/dist/components/tabs.js +9 -12
  144. package/dist/components/tag-group.js +7 -9
  145. package/dist/components/text-field.js +2 -1
  146. package/dist/components/text.js +2 -1
  147. package/dist/components/textarea.js +3 -4
  148. package/dist/components/time-field.js +2 -1
  149. package/dist/components/toggle-button.js +5 -7
  150. package/dist/components/tooltip.js +3 -3
  151. package/dist/components/typeset.js +128 -123
  152. package/dist/components/youtube-embed.js +2 -1
  153. package/dist/docs/anchor-heading.d.ts +41 -0
  154. package/dist/docs/anchor-heading.js +62 -0
  155. package/dist/docs/callout.d.ts +46 -0
  156. package/dist/docs/callout.js +61 -0
  157. package/dist/docs/code-block.d.ts +74 -0
  158. package/dist/docs/code-block.js +322 -0
  159. package/dist/docs/code-tabs-sync.d.ts +26 -0
  160. package/dist/docs/code-tabs-sync.js +12 -0
  161. package/dist/docs/code-tabs.d.ts +53 -0
  162. package/dist/docs/code-tabs.js +102 -0
  163. package/dist/docs/copy-button.d.ts +31 -0
  164. package/dist/docs/copy-button.js +49 -0
  165. package/dist/docs/docs-feedback.d.ts +55 -0
  166. package/dist/docs/docs-feedback.js +72 -0
  167. package/dist/docs/docs-footer.d.ts +40 -0
  168. package/dist/docs/docs-footer.js +45 -0
  169. package/dist/docs/docs-hub.d.ts +93 -0
  170. package/dist/docs/docs-hub.js +142 -0
  171. package/dist/docs/docs-layout.d.ts +90 -0
  172. package/dist/docs/docs-layout.js +166 -0
  173. package/dist/docs/docs-nav-tools.d.ts +25 -0
  174. package/dist/docs/docs-nav-tools.js +14 -0
  175. package/dist/docs/docs-nav.d.ts +53 -0
  176. package/dist/docs/docs-nav.js +76 -0
  177. package/dist/docs/docs-not-found.d.ts +68 -0
  178. package/dist/docs/docs-not-found.js +100 -0
  179. package/dist/docs/docs-page-header.d.ts +55 -0
  180. package/dist/docs/docs-page-header.js +54 -0
  181. package/dist/docs/docs-pager.d.ts +46 -0
  182. package/dist/docs/docs-pager.js +74 -0
  183. package/dist/docs/file-tree.d.ts +57 -0
  184. package/dist/docs/file-tree.js +142 -0
  185. package/dist/docs/index.d.ts +38 -0
  186. package/dist/docs/index.js +38 -0
  187. package/dist/docs/install-command.d.ts +54 -0
  188. package/dist/docs/install-command.js +33 -0
  189. package/dist/docs/mixins/code-tabs-sync.d.ts +47 -0
  190. package/dist/docs/mixins/code-tabs-sync.js +137 -0
  191. package/dist/docs/mixins/copy-feedback.d.ts +25 -0
  192. package/dist/docs/mixins/copy-feedback.js +49 -0
  193. package/dist/docs/mixins/copy-from-url.d.ts +27 -0
  194. package/dist/docs/mixins/copy-from-url.js +95 -0
  195. package/dist/docs/mixins/docs-nav-tools.d.ts +27 -0
  196. package/dist/docs/mixins/docs-nav-tools.js +97 -0
  197. package/dist/docs/mixins/toc-spy.d.ts +30 -0
  198. package/dist/docs/mixins/toc-spy.js +165 -0
  199. package/dist/docs/next-steps.d.ts +45 -0
  200. package/dist/docs/next-steps.js +79 -0
  201. package/dist/docs/page-actions.d.ts +77 -0
  202. package/dist/docs/page-actions.js +78 -0
  203. package/dist/docs/plan-notice.d.ts +28 -0
  204. package/dist/docs/plan-notice.js +33 -0
  205. package/dist/docs/props-table.d.ts +64 -0
  206. package/dist/docs/props-table.js +147 -0
  207. package/dist/docs/steps.d.ts +51 -0
  208. package/dist/docs/steps.js +112 -0
  209. package/dist/docs/table-of-contents.d.ts +49 -0
  210. package/dist/docs/table-of-contents.js +139 -0
  211. package/dist/docs/ui-label.d.ts +51 -0
  212. package/dist/docs/ui-label.js +64 -0
  213. package/dist/docs/utils/docs-tree.d.ts +81 -0
  214. package/dist/docs/utils/docs-tree.js +57 -0
  215. package/dist/docs/utils/reveal-in-scroller.d.ts +19 -0
  216. package/dist/docs/utils/reveal-in-scroller.js +43 -0
  217. package/dist/landing/accent-text.d.ts +47 -0
  218. package/dist/landing/accent-text.js +107 -0
  219. package/dist/landing/animations/entrance.d.ts +40 -0
  220. package/dist/landing/animations/entrance.js +52 -0
  221. package/dist/landing/announcement-chip.d.ts +45 -0
  222. package/dist/landing/announcement-chip.js +36 -0
  223. package/dist/landing/author-band.d.ts +78 -0
  224. package/dist/landing/author-band.js +190 -0
  225. package/dist/landing/bento.d.ts +99 -0
  226. package/dist/landing/bento.js +138 -0
  227. package/dist/landing/changelog-strip.d.ts +74 -0
  228. package/dist/landing/changelog-strip.js +201 -0
  229. package/dist/{patterns → landing}/check-row.js +5 -7
  230. package/dist/{patterns → landing}/closing-cta.d.ts +4 -4
  231. package/dist/{patterns → landing}/closing-cta.js +8 -8
  232. package/dist/landing/code-stage.d.ts +93 -0
  233. package/dist/landing/code-stage.js +434 -0
  234. package/dist/landing/crosshair.d.ts +44 -0
  235. package/dist/landing/crosshair.js +48 -0
  236. package/dist/landing/curriculum.d.ts +79 -0
  237. package/dist/landing/curriculum.js +194 -0
  238. package/dist/landing/drawn-chart.d.ts +74 -0
  239. package/dist/landing/drawn-chart.js +377 -0
  240. package/dist/landing/event-ticker.d.ts +71 -0
  241. package/dist/landing/event-ticker.js +331 -0
  242. package/dist/landing/fan-out-diagram.d.ts +70 -0
  243. package/dist/landing/fan-out-diagram.js +481 -0
  244. package/dist/{patterns → landing}/faq-band.d.ts +5 -5
  245. package/dist/{patterns → landing}/faq-band.js +13 -14
  246. package/dist/landing/feature-band.d.ts +108 -0
  247. package/dist/landing/feature-band.js +67 -0
  248. package/dist/landing/feature.d.ts +148 -0
  249. package/dist/landing/feature.js +219 -0
  250. package/dist/landing/flow-diagram.d.ts +62 -0
  251. package/dist/landing/flow-diagram.js +240 -0
  252. package/dist/{patterns → landing}/icon-well.d.ts +17 -7
  253. package/dist/landing/icon-well.js +31 -0
  254. package/dist/landing/index.d.ts +52 -0
  255. package/dist/landing/index.js +52 -0
  256. package/dist/{patterns → landing}/install-tabs.js +4 -5
  257. package/dist/landing/landing-header.d.ts +103 -0
  258. package/dist/landing/landing-header.js +110 -0
  259. package/dist/landing/landing-hero.d.ts +119 -0
  260. package/dist/landing/landing-hero.js +172 -0
  261. package/dist/{components/marketing-section.d.ts → landing/landing-section.d.ts} +38 -15
  262. package/dist/landing/landing-section.js +183 -0
  263. package/dist/landing/logo-cloud.d.ts +56 -0
  264. package/dist/landing/logo-cloud.js +160 -0
  265. package/dist/landing/logo-sentence.d.ts +38 -0
  266. package/dist/landing/logo-sentence.js +51 -0
  267. package/dist/landing/marquee.d.ts +44 -0
  268. package/dist/landing/marquee.js +97 -0
  269. package/dist/landing/motion-loop.d.ts +43 -0
  270. package/dist/landing/motion-loop.js +42 -0
  271. package/dist/landing/pricing-band.d.ts +94 -0
  272. package/dist/landing/pricing-band.js +151 -0
  273. package/dist/landing/product-frame.d.ts +108 -0
  274. package/dist/landing/product-frame.js +202 -0
  275. package/dist/{patterns → landing}/proof-strip.d.ts +4 -4
  276. package/dist/{patterns → landing}/proof-strip.js +3 -3
  277. package/dist/landing/rails.d.ts +45 -0
  278. package/dist/landing/rails.js +69 -0
  279. package/dist/landing/rotating-text.d.ts +44 -0
  280. package/dist/landing/rotating-text.js +67 -0
  281. package/dist/landing/segmented-stage.d.ts +75 -0
  282. package/dist/landing/segmented-stage.js +141 -0
  283. package/dist/landing/sequence-diagram.d.ts +65 -0
  284. package/dist/landing/sequence-diagram.js +348 -0
  285. package/dist/landing/site-footer.d.ts +100 -0
  286. package/dist/landing/site-footer.js +274 -0
  287. package/dist/landing/site-header.d.ts +126 -0
  288. package/dist/landing/site-header.js +595 -0
  289. package/dist/{components → landing}/split.d.ts +12 -5
  290. package/dist/{components → landing}/split.js +26 -18
  291. package/dist/landing/sponsor-wall.d.ts +81 -0
  292. package/dist/landing/sponsor-wall.js +241 -0
  293. package/dist/{components → landing}/stat-strip.d.ts +31 -7
  294. package/dist/landing/stat-strip.js +105 -0
  295. package/dist/landing/step-list.d.ts +73 -0
  296. package/dist/landing/step-list.js +182 -0
  297. package/dist/landing/styles/card-grid.d.ts +115 -0
  298. package/dist/landing/styles/card-grid.js +295 -0
  299. package/dist/{patterns → landing}/tabbed-stage.d.ts +26 -8
  300. package/dist/landing/tabbed-stage.js +233 -0
  301. package/dist/landing/testimonial-band.d.ts +110 -0
  302. package/dist/landing/testimonial-band.js +164 -0
  303. package/dist/landing/typed-terminal.d.ts +62 -0
  304. package/dist/landing/typed-terminal.js +233 -0
  305. package/dist/landing/utils/pause-toggle.d.ts +37 -0
  306. package/dist/landing/utils/pause-toggle.js +71 -0
  307. package/dist/mixins/copy-to-clipboard.d.ts +6 -0
  308. package/dist/mixins/copy-to-clipboard.js +17 -1
  309. package/dist/mixins/dialog-dismiss.d.ts +21 -0
  310. package/dist/mixins/dialog-dismiss.js +62 -0
  311. package/dist/mixins/index.d.ts +2 -15
  312. package/dist/mixins/index.js +2 -15
  313. package/dist/styles/index.d.ts +2 -5
  314. package/dist/styles/index.js +2 -5
  315. package/dist/styles/landing.d.ts +200 -0
  316. package/dist/styles/landing.js +516 -0
  317. package/dist/styles/surface-control.d.ts +18 -0
  318. package/dist/styles/surface-control.js +31 -0
  319. package/dist/utils/eyebrow.d.ts +39 -0
  320. package/dist/utils/eyebrow.js +21 -0
  321. package/dist/utils/index.d.ts +1 -5
  322. package/dist/utils/index.js +1 -5
  323. package/package.json +14 -4
  324. package/src/theme.css +87 -22
  325. package/dist/components/feature.d.ts +0 -102
  326. package/dist/components/feature.js +0 -150
  327. package/dist/components/logo-cloud.d.ts +0 -42
  328. package/dist/components/logo-cloud.js +0 -41
  329. package/dist/components/marketing-header.d.ts +0 -71
  330. package/dist/components/marketing-header.js +0 -81
  331. package/dist/components/marketing-section.js +0 -117
  332. package/dist/components/stat-strip.js +0 -65
  333. package/dist/patterns/accent-text.d.ts +0 -30
  334. package/dist/patterns/accent-text.js +0 -17
  335. package/dist/patterns/announcement-chip.d.ts +0 -41
  336. package/dist/patterns/announcement-chip.js +0 -49
  337. package/dist/patterns/bento.d.ts +0 -68
  338. package/dist/patterns/bento.js +0 -94
  339. package/dist/patterns/code-stage.d.ts +0 -63
  340. package/dist/patterns/code-stage.js +0 -82
  341. package/dist/patterns/feature-band.d.ts +0 -85
  342. package/dist/patterns/feature-band.js +0 -50
  343. package/dist/patterns/icon-well.js +0 -38
  344. package/dist/patterns/index.d.ts +0 -23
  345. package/dist/patterns/index.js +0 -23
  346. package/dist/patterns/landing-hero.d.ts +0 -93
  347. package/dist/patterns/landing-hero.js +0 -126
  348. package/dist/patterns/product-frame.d.ts +0 -60
  349. package/dist/patterns/product-frame.js +0 -70
  350. package/dist/patterns/step-list.d.ts +0 -47
  351. package/dist/patterns/step-list.js +0 -85
  352. package/dist/patterns/tabbed-stage.js +0 -77
  353. package/dist/styles/marketing.d.ts +0 -120
  354. package/dist/styles/marketing.js +0 -225
  355. package/dist/utils/semantic-color-panel.d.ts +0 -35
  356. package/dist/utils/semantic-color-panel.js +0 -28
  357. /package/dist/{behaviors → app/behaviors}/drag-session.d.ts +0 -0
  358. /package/dist/{behaviors → app/behaviors}/resize-session.d.ts +0 -0
  359. /package/dist/{behaviors → app/behaviors}/resize-session.js +0 -0
  360. /package/dist/{behaviors → app/behaviors}/selection-model.d.ts +0 -0
  361. /package/dist/{behaviors → app/behaviors}/selection-model.js +0 -0
  362. /package/dist/{behaviors → app/behaviors}/toaster.d.ts +0 -0
  363. /package/dist/{components → app}/drop-indicator.d.ts +0 -0
  364. /package/dist/{components → app}/drop-zone.d.ts +0 -0
  365. /package/dist/{components → app}/file-trigger.d.ts +0 -0
  366. /package/dist/{components → app}/menubar.d.ts +0 -0
  367. /package/dist/{mixins → app/mixins}/chart-tooltip.d.ts +0 -0
  368. /package/dist/{mixins → app/mixins}/chart-tooltip.js +0 -0
  369. /package/dist/{mixins → app/mixins}/context-menu.d.ts +0 -0
  370. /package/dist/{mixins → app/mixins}/context-menu.js +0 -0
  371. /package/dist/{mixins → app/mixins}/drag-reorder.d.ts +0 -0
  372. /package/dist/{mixins → app/mixins}/drop-zone.d.ts +0 -0
  373. /package/dist/{mixins → app/mixins}/grid-list-keys.d.ts +0 -0
  374. /package/dist/{mixins → app/mixins}/menubar-keys.d.ts +0 -0
  375. /package/dist/{mixins → app/mixins}/resize-handle.d.ts +0 -0
  376. /package/dist/{mixins/treeKeys.d.ts → app/mixins/tree-keys.d.ts} +0 -0
  377. /package/dist/{components → app}/resizable.d.ts +0 -0
  378. /package/dist/{components → app}/shortcut-list.d.ts +0 -0
  379. /package/dist/{components → app}/skeleton.d.ts +0 -0
  380. /package/dist/{styles → app/styles}/chart-palette.js +0 -0
  381. /package/dist/{styles → app/styles}/graphic-host.js +0 -0
  382. /package/dist/{styles → app/styles}/legend-toggle.js +0 -0
  383. /package/dist/{components → app}/table.d.ts +0 -0
  384. /package/dist/{components → app}/toast.d.ts +0 -0
  385. /package/dist/{components → app}/toolbar.d.ts +0 -0
  386. /package/dist/{utils → app/utils}/chart-marker-indices.d.ts +0 -0
  387. /package/dist/{utils → app/utils}/chart-marker-indices.js +0 -0
  388. /package/dist/{utils → app/utils}/chart-scale.d.ts +0 -0
  389. /package/dist/{behaviors → chat/behaviors}/scroll-follow-model.d.ts +0 -0
  390. /package/dist/{components → chat}/bubble.d.ts +0 -0
  391. /package/dist/{components → chat}/marker.d.ts +0 -0
  392. /package/dist/{components → chat}/message.d.ts +0 -0
  393. /package/dist/{mixins → chat/mixins}/attachment-trigger.d.ts +0 -0
  394. /package/dist/{mixins → chat/mixins}/attachment-trigger.js +0 -0
  395. /package/dist/{mixins → chat/mixins}/message-follow.d.ts +0 -0
  396. /package/dist/{components → color}/color-area.d.ts +0 -0
  397. /package/dist/{components → color}/color-field.d.ts +0 -0
  398. /package/dist/{components → color}/color-slider.d.ts +0 -0
  399. /package/dist/{components → color}/color-swatch-picker.d.ts +0 -0
  400. /package/dist/{components → color}/color-swatch.d.ts +0 -0
  401. /package/dist/{components → color}/color-wheel.d.ts +0 -0
  402. /package/dist/{mixins → color/mixins}/color-channel-sync.d.ts +0 -0
  403. /package/dist/{mixins → color/mixins}/color-channel-sync.js +0 -0
  404. /package/dist/{mixins → color/mixins}/color-preview.d.ts +0 -0
  405. /package/dist/{mixins → color/mixins}/color-wheel-drag.d.ts +0 -0
  406. /package/dist/{styles → color/styles}/rtl-aware-gradient-direction.js +0 -0
  407. /package/dist/{utils → color/utils}/hue-spectrum.d.ts +0 -0
  408. /package/dist/{utils → color/utils}/hue-spectrum.js +0 -0
  409. /package/dist/{patterns → landing}/check-row.d.ts +0 -0
  410. /package/dist/{patterns → landing}/install-tabs.d.ts +0 -0
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { animationHost, keyframes } from "@sdxc/u/animation";
3
+ import { fg, outline } from "@sdxc/u/color";
4
+ import { rounded, transition } from "@sdxc/u/effects";
5
+ import { mergeMix, raw } from "@sdxc/u/general";
6
+ import { motionSafe } from "@sdxc/u/responsive";
7
+ import { mis } from "@sdxc/u/size";
8
+ import { hover, when } from "@sdxc/u/state";
9
+ import { textDecoration, weight } from "@sdxc/u/typography";
10
+ import { readAmbientLevel, TAG_BY_LEVEL } from "../components/heading-scope.js";
11
+ /**
12
+ * Custom property setting the space a jump leaves above the heading; set it on any
13
+ * ancestor to the sticky header's height plus breathing room.
14
+ */
15
+ export const ANCHOR_HEADING_SCROLL_MARGIN = "--ui-docs-scroll-margin";
16
+ /** Level with no `level` prop and no `HeadingScope` around the heading: a page section. */
17
+ const DEFAULT_LEVEL = 2;
18
+ /** `@keyframes` name of the highlight a heading shows when it is the URL's target. */
19
+ const FLASH = "ui-anchor-heading-flash";
20
+ /**
21
+ * Renders the heading with its `#` link after the text. The link stays in the tab order
22
+ * at all times, shows on hover of the heading or on its own focus, and shows always on
23
+ * devices without hover. Jumps clear `--ui-docs-scroll-margin` (default `5rem`).
24
+ *
25
+ * @param handle Runtime handle carrying the heading's props.
26
+ * @returns The render function producing the heading's markup.
27
+ * @example
28
+ * <AnchorHeading id="install" linkLabel="Link to Install">Install</AnchorHeading>
29
+ */
30
+ export function AnchorHeading(handle) {
31
+ return () => {
32
+ let { id, level, linkLabel, children, mix, ...rest } = handle.props;
33
+ let Tag = TAG_BY_LEVEL[level ?? readAmbientLevel(handle) ?? DEFAULT_LEVEL];
34
+ return (_jsxs(Tag, { ...rest, id: id, "data-slot": "anchor-heading", mix: mergeMix([
35
+ raw({ scrollMarginBlockStart: `var(${ANCHOR_HEADING_SCROLL_MARGIN}, 5rem)` }),
36
+ rounded("sm"),
37
+ keyframes(FLASH, {
38
+ from: { backgroundColor: "var(--ui-brand-bg-tint)" },
39
+ to: { backgroundColor: "transparent" },
40
+ }),
41
+ motionSafe(when("&:target", animationHost(FLASH, { duration: "1.2s", easing: "ease-out" }))),
42
+ ], mix), children: [children, _jsx("a", { href: `#${id}`, "aria-label": linkLabel, "data-slot": "anchor-heading-link", mix: [
43
+ mis("0.35em"),
44
+ weight("normal"),
45
+ fg("neutral.muted"),
46
+ textDecoration("none"),
47
+ rounded("sm"),
48
+ hover(fg("brand")),
49
+ when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
50
+ /**
51
+ * Hidden and shown in one rule, so the shown states always outrank the
52
+ * hidden one whatever order the stylesheet layers land in.
53
+ */
54
+ raw({
55
+ opacity: 0,
56
+ "&:focus-visible, &:where([data-slot='anchor-heading']:hover > *)": { opacity: 1 },
57
+ "@media (hover: none)": { opacity: 1 },
58
+ }),
59
+ motionSafe(transition("opacity, color", { duration: 150 })),
60
+ ], children: _jsx("span", { "aria-hidden": "true", children: "#" }) })] }));
61
+ };
62
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * A docs aside for the one thing a reader must not miss: a note, a tip, a warning or a
3
+ * danger, tinted lightly in its kind's colour and opened by the kind's icon and label.
4
+ * It is static content present at load, so it is a named `<aside>` and never a live region.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
10
+ /**
11
+ * Prop types for {@link Callout}.
12
+ */
13
+ export declare namespace Callout {
14
+ /**
15
+ * How serious the aside is, from adding context to warning of loss. Each kind draws
16
+ * its own icon as well as its own colour, so kinds read apart without colour.
17
+ */
18
+ type Kind = "note" | "tip" | "warning" | "danger";
19
+ /**
20
+ * Native `<aside>` attributes plus the kind, its translated label and an optional title.
21
+ */
22
+ interface Props extends Omit<TagProps<"aside">, "title"> {
23
+ kind: Kind;
24
+ /**
25
+ * The kind's name in the reader's language ("Note", "Warning"). It is the aside's
26
+ * accessible name and its visible heading when no `title` is given.
27
+ */
28
+ label: string;
29
+ /** A specific heading that replaces the label on screen; the accessible name keeps both. */
30
+ title?: string;
31
+ children: RemixNode;
32
+ }
33
+ }
34
+ /**
35
+ * Renders the aside: a 6% tint with a 30% border of the kind's colour, a small radius,
36
+ * and a heading line led by the glyph in the kind's colour. Text keeps the page's ink in
37
+ * both themes, so a long callout reads like the prose around it.
38
+ *
39
+ * @param handle Runtime handle carrying the host `<aside>`'s props.
40
+ * @returns The render function producing the callout's markup.
41
+ * @example
42
+ * <Callout kind="warning" label={t("callout.warning")}>Rotate the key before you deploy.</Callout>
43
+ * @example
44
+ * <Callout kind="tip" label={t("callout.tip")} title="Faster local runs">Pass `--watch`.</Callout>
45
+ */
46
+ export declare function Callout(handle: Handle<Callout.Props>): () => import("remix/component").RemixElement;
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { InfoIcon, LightbulbIcon, OctagonAlertIcon, TriangleAlertIcon } from "@sdxc/icons";
3
+ import { bg, border, colorMix, fg } from "@sdxc/u/color";
4
+ import { rounded } from "@sdxc/u/effects";
5
+ import { mergeMix } from "@sdxc/u/general";
6
+ import { hstack, inlineFlex, vstack } from "@sdxc/u/layout";
7
+ import { m, minIs, p } from "@sdxc/u/size";
8
+ import { when } from "@sdxc/u/state";
9
+ import { leading, overflowWrap, text, weight } from "@sdxc/u/typography";
10
+ /** The semantic tone and glyph each kind draws with. */
11
+ const CALLOUT_KINDS = {
12
+ note: { tone: "brand", Glyph: InfoIcon },
13
+ tip: { tone: "success", Glyph: LightbulbIcon },
14
+ warning: { tone: "warning", Glyph: TriangleAlertIcon },
15
+ danger: { tone: "danger", Glyph: OctagonAlertIcon },
16
+ };
17
+ /**
18
+ * Mixes a share of a tone's text colour into transparency, so the tint and the border
19
+ * follow the theme's light and dark values of that tone.
20
+ *
21
+ * @param tone Semantic tone to mix from.
22
+ * @param weight Percentage of the tone in the mix.
23
+ */
24
+ function toneMix(tone, weight) {
25
+ return colorMix("oklab", { color: `var(--ui-${tone}-fg)`, weight }, "transparent");
26
+ }
27
+ /**
28
+ * Renders the aside: a 6% tint with a 30% border of the kind's colour, a small radius,
29
+ * and a heading line led by the glyph in the kind's colour. Text keeps the page's ink in
30
+ * both themes, so a long callout reads like the prose around it.
31
+ *
32
+ * @param handle Runtime handle carrying the host `<aside>`'s props.
33
+ * @returns The render function producing the callout's markup.
34
+ * @example
35
+ * <Callout kind="warning" label={t("callout.warning")}>Rotate the key before you deploy.</Callout>
36
+ * @example
37
+ * <Callout kind="tip" label={t("callout.tip")} title="Faster local runs">Pass `--watch`.</Callout>
38
+ */
39
+ export function Callout(handle) {
40
+ return () => {
41
+ let { children, kind, label, mix, title, ...rest } = handle.props;
42
+ let { tone, Glyph } = CALLOUT_KINDS[kind] ?? CALLOUT_KINDS.note;
43
+ return (_jsxs("aside", { "aria-label": title ? `${label}: ${title}` : label, ...rest, "data-slot": "callout", "data-kind": kind, mix: mergeMix([
44
+ vstack({ gap: 2, align: "stretch" }),
45
+ minIs(0),
46
+ p(3, 4),
47
+ rounded("md"),
48
+ border({ color: toneMix(tone, 30), width: 1, style: "solid" }),
49
+ bg(toneMix(tone, 6)),
50
+ text("sm"),
51
+ leading("relaxed"),
52
+ overflowWrap("anywhere"),
53
+ when("& > :where(:not([data-slot='callout-title']))", m(0)),
54
+ ], mix), children: [_jsxs("p", { "data-slot": "callout-title", mix: [
55
+ m(0),
56
+ hstack({ gap: 2, align: "center" }),
57
+ weight("semibold"),
58
+ fg("neutral.emphasis"),
59
+ ], children: [_jsx("span", { "data-slot": "callout-icon", mix: [inlineFlex(), fg(tone)], children: _jsx(Glyph, { size: 16, "aria-hidden": "true" }) }), title ?? label] }), children] }));
60
+ };
61
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * A titled code card for documentation: the file it belongs to (with an icon for its
3
+ * kind) or "Terminal", highlighted, added and removed lines, optional line numbers, and a
4
+ * copy button that copies what a reader should paste — no `$` prompts, no output lines.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Handle, Props as TagProps } from "remix/component";
10
+ /**
11
+ * Prop types for {@link CodeBlock}.
12
+ */
13
+ export declare namespace CodeBlock {
14
+ /**
15
+ * One painted run of source. Structural, so the runs a Markdown pipeline already
16
+ * painted with `@sdxc/highlight` pass straight through.
17
+ */
18
+ interface Token {
19
+ type: string;
20
+ value: string;
21
+ }
22
+ /** The copy button's strings; the library ships no copy of its own. */
23
+ interface Labels {
24
+ /** The button's accessible name, such as "Copy code". */
25
+ copy: string;
26
+ /** What a screen reader announces after a copy, such as "Copied". */
27
+ copied: string;
28
+ }
29
+ /** How a line is marked: a changed line to look at, or a line a diff adds or removes. */
30
+ type Mark = "highlight" | "add" | "remove";
31
+ /**
32
+ * Props accepted by {@link CodeBlock}. Line numbers in `highlight`, `add` and `remove`
33
+ * count from 1, the way prose refers to them.
34
+ */
35
+ interface Props extends Omit<TagProps<"figure">, "title" | "children"> {
36
+ /** The source as written; a single trailing newline is dropped. */
37
+ code: string;
38
+ /** Language the code highlights as, named the way a fence names it (`ts`, `sh`). */
39
+ language?: string;
40
+ /** Runs already painted for `code`, which skip highlighting here. */
41
+ tokens?: readonly Token[];
42
+ /**
43
+ * What the header reads as: a file path draws an icon for its kind, and anything
44
+ * else (such as "Terminal") reads as written. Without one the header names the
45
+ * language, and a block with neither floats its copy button over the code.
46
+ */
47
+ title?: string;
48
+ highlight?: readonly number[];
49
+ add?: readonly number[];
50
+ /** Lines a diff removes; they stay on screen and stay off the clipboard. */
51
+ remove?: readonly number[];
52
+ /** Numbers each line in a gutter, for long listings prose refers to by line. */
53
+ lineNumbers?: boolean;
54
+ labels: Labels;
55
+ /**
56
+ * The `id` of the `<code>` element the copy button targets. Defaults to one derived
57
+ * from the code, which stays the same on every render of the same block.
58
+ */
59
+ codeId?: string;
60
+ }
61
+ }
62
+ /**
63
+ * Renders the card: a header naming the file (or the language) with the copy button, and
64
+ * the code, which scrolls sideways inside the card. Marked lines tint across the full
65
+ * scroll width with a 2px bar whose width comes out of the line's padding, so no text moves.
66
+ *
67
+ * @param handle Runtime handle carrying the block's props.
68
+ * @returns The render function producing the card.
69
+ * @example
70
+ * <CodeBlock title="vite.config.ts" language="ts" code={source} highlight={[4, 5]} labels={{ copy: t("copy"), copied: t("copied") }} />
71
+ * @example
72
+ * <CodeBlock title="Terminal" language="sh" code={"$ npm add @sdxc/ui\n$ npm run dev"} labels={labels} />
73
+ */
74
+ export declare function CodeBlock(handle: Handle<CodeBlock.Props>): () => import("remix/component").RemixElement;
@@ -0,0 +1,322 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { tokenize } from "@sdxc/highlight";
3
+ import { FileBracesIcon, FileCodeIcon, FileCogIcon, FileIcon, FileTextIcon, TerminalIcon, } from "@sdxc/icons";
4
+ import { bg, border, borderEdge, fg } from "@sdxc/u/color";
5
+ import { rounded } from "@sdxc/u/effects";
6
+ import { mergeMix, raw } from "@sdxc/u/general";
7
+ import { absolute, hstack, inlineFlex, insBs, insIe, relative, shrink } from "@sdxc/u/layout";
8
+ import { overflowX } from "@sdxc/u/overflow";
9
+ import { bs, m, minIs, pi } from "@sdxc/u/size";
10
+ import { z } from "@sdxc/u/stacking";
11
+ import { font, text, truncate } from "@sdxc/u/typography";
12
+ import { COPY_EXCLUDE_ATTRIBUTE } from "../mixins/copy-to-clipboard.js";
13
+ import { CopyButton } from "./copy-button.js";
14
+ /** Inline padding of every line, which a marked line splits between its bar and its text. */
15
+ const LINE_INSET = "1rem";
16
+ /** Width of the bar a marked line draws on its inline-start edge. */
17
+ const MARK_BAR = "2px";
18
+ /** Languages whose blocks are shell sessions: a `$ ` prompt marks a command, not code. */
19
+ const SHELL_LANGUAGES = new Set(["sh", "bash", "shell", "zsh", "fish", "console", "terminal"]);
20
+ /** The prompt a shell block draws before each command, outside the copied text. */
21
+ const PROMPT = "$ ";
22
+ /**
23
+ * Token colors as `[light, dark]` pairs, the GitHub palettes the shared highlight
24
+ * stylesheet ships, used when the page declares no `--highlight-*` property of its own.
25
+ */
26
+ const TOKEN_PALETTE = {
27
+ comment: ["#6a737d", "#8b949e"],
28
+ keyword: ["#d73a49", "#ff7b72"],
29
+ operator: ["#d73a49", "#ff7b72"],
30
+ string: ["#032f62", "#a5d6ff"],
31
+ builtin: ["#032f62", "#a5d6ff"],
32
+ "attr-name": ["#032f62", "#a5d6ff"],
33
+ "attr-value": ["#032f62", "#a5d6ff"],
34
+ number: ["#005cc5", "#79c0ff"],
35
+ boolean: ["#005cc5", "#79c0ff"],
36
+ constant: ["#005cc5", "#79c0ff"],
37
+ property: ["#005cc5", "#79c0ff"],
38
+ tag: ["#005cc5", "#79c0ff"],
39
+ function: ["#6f42c1", "#d2a8ff"],
40
+ "class-name": ["#6f42c1", "#d2a8ff"],
41
+ regex: ["#e36209", "#ffa657"],
42
+ variable: ["#e36209", "#ffa657"],
43
+ punctuation: ["#24292f", "#e6edf3"],
44
+ inserted: ["#22863a", "#7ee787"],
45
+ deleted: ["#b31d28", "#ffa198"],
46
+ };
47
+ /** FNV-1a offset basis, the starting state of the hash that names a block's code. */
48
+ const FNV_OFFSET = 0x811c9dc5;
49
+ /** FNV-1a prime, which spreads each character through the hash. */
50
+ const FNV_PRIME = 0x01000193;
51
+ /**
52
+ * Renders the card: a header naming the file (or the language) with the copy button, and
53
+ * the code, which scrolls sideways inside the card. Marked lines tint across the full
54
+ * scroll width with a 2px bar whose width comes out of the line's padding, so no text moves.
55
+ *
56
+ * @param handle Runtime handle carrying the block's props.
57
+ * @returns The render function producing the card.
58
+ * @example
59
+ * <CodeBlock title="vite.config.ts" language="ts" code={source} highlight={[4, 5]} labels={{ copy: t("copy"), copied: t("copied") }} />
60
+ * @example
61
+ * <CodeBlock title="Terminal" language="sh" code={"$ npm add @sdxc/ui\n$ npm run dev"} labels={labels} />
62
+ */
63
+ export function CodeBlock(handle) {
64
+ return () => {
65
+ let { add, code, codeId, highlight, labels, language, lineNumbers = false, mix, remove, title, tokens, ...rest } = handle.props;
66
+ let shell = isShell(language, title);
67
+ let lines = paintLines(code, language, tokens, shell, { add, highlight, remove });
68
+ let id = codeId ?? stableId(code);
69
+ let heading = title ?? (language && language !== "plain" ? language : undefined);
70
+ let copy = _jsx(CopyButton, { target: id, label: labels.copy, copiedLabel: labels.copied });
71
+ let digits = Math.max(2, String(lines.length).length);
72
+ return (_jsxs("figure", { ...rest, "data-slot": "code-block", "data-language": language, mix: mergeMix([
73
+ relative(),
74
+ m(0),
75
+ minIs(0),
76
+ rounded("lg"),
77
+ border({ color: "neutral.border", width: 1, style: "solid" }),
78
+ bg("neutral.bg-tint"),
79
+ raw({ overflow: "hidden" }),
80
+ ], mix), children: [heading ? (_jsxs("figcaption", { mix: [
81
+ hstack({ gap: 2, align: "center", justify: "between" }),
82
+ bs("2.5rem"),
83
+ pi(4, 1),
84
+ borderEdge("block-end", { color: "neutral.border", width: 1, style: "solid" }),
85
+ ], children: [_jsxs("span", { mix: [hstack({ gap: 2, align: "center" }), minIs(0), fg("neutral")], children: [_jsx("span", { "data-slot": "code-block-icon", mix: [inlineFlex(), shrink(0)], children: _jsx(TitleIcon, { title: title, shell: shell }) }), _jsx("span", { mix: [minIs(0), truncate(), title && isPath(title) ? font("mono") : [], text("xs")], children: heading })] }), copy] })) : (_jsx("span", { mix: [absolute(), insBs("0.375rem"), insIe("0.375rem"), z(1)], children: copy })), _jsx("pre", { "data-not-typeset": "", "data-line-numbers": lineNumbers ? "" : undefined, mix: [
86
+ m(0),
87
+ overflowX("auto"),
88
+ fg("neutral.emphasis"),
89
+ font("mono"),
90
+ raw({
91
+ paddingBlock: "0.875rem",
92
+ paddingInline: 0,
93
+ border: 0,
94
+ borderRadius: 0,
95
+ background: "transparent",
96
+ fontSize: "0.8125rem",
97
+ lineHeight: 1.7,
98
+ whiteSpace: "pre",
99
+ tabSize: 4,
100
+ overscrollBehaviorInline: "contain",
101
+ }),
102
+ ], children: _jsx("code", { id: id, className: language ? `language-${language}` : undefined, mix: [lineRules(Boolean(heading), lineNumbers, digits)], children: renderLines(lines) }) })] }));
103
+ };
104
+ }
105
+ /**
106
+ * Every rule the lines follow, in one block so a marked line's padding, bar and tint
107
+ * resolve by specificity alone. The grid makes each line as wide as the longest one, so a
108
+ * tint runs the full scroll width, and drops the newlines between lines from layout while
109
+ * leaving them in the text a copy reads.
110
+ *
111
+ * @param hasHeader Whether the copy button sits in a header rather than over the code.
112
+ * @param lineNumbers Whether lines draw a gutter number.
113
+ * @param digits Digits the widest line number needs.
114
+ */
115
+ function lineRules(hasHeader, lineNumbers, digits) {
116
+ let markedInset = `calc(${LINE_INSET} - ${MARK_BAR})`;
117
+ let tint = (tone) => `color-mix(in oklab, var(--ui-${tone}-fg) 12%, transparent)`;
118
+ return raw({
119
+ display: "grid",
120
+ minInlineSize: "100%",
121
+ inlineSize: "max-content",
122
+ counterReset: "line",
123
+ font: "inherit",
124
+ background: "transparent",
125
+ padding: 0,
126
+ "& > [data-line]": {
127
+ position: "relative",
128
+ minBlockSize: "1lh",
129
+ paddingInlineStart: LINE_INSET,
130
+ paddingInlineEnd: hasHeader ? LINE_INSET : "3rem",
131
+ counterIncrement: "line",
132
+ },
133
+ "& > [data-mark]": {
134
+ paddingInlineStart: markedInset,
135
+ borderInlineStartWidth: MARK_BAR,
136
+ borderInlineStartStyle: "solid",
137
+ },
138
+ '& > [data-mark="highlight"]': {
139
+ backgroundColor: tint("brand"),
140
+ borderInlineStartColor: `var(--ui-brand-fg)`,
141
+ },
142
+ '& > [data-mark="add"]': {
143
+ backgroundColor: tint("success"),
144
+ borderInlineStartColor: `var(--ui-success-fg)`,
145
+ },
146
+ '& > [data-mark="remove"]': {
147
+ backgroundColor: tint("danger"),
148
+ borderInlineStartColor: `var(--ui-danger-fg)`,
149
+ },
150
+ '& > [data-mark="add"]::after, & > [data-mark="remove"]::after': {
151
+ position: "absolute",
152
+ insetInlineStart: "0.3rem",
153
+ userSelect: "none",
154
+ color: "var(--ui-neutral-fg-muted)",
155
+ },
156
+ '& > [data-mark="add"]::after': { content: '"+"' },
157
+ '& > [data-mark="remove"]::after': { content: '"-"' },
158
+ "& > [data-output]": { color: "var(--ui-neutral-fg-muted)" },
159
+ "& [data-prompt]::before": {
160
+ content: `"${PROMPT}"`,
161
+ userSelect: "none",
162
+ color: "var(--ui-neutral-fg-muted)",
163
+ },
164
+ ...(lineNumbers
165
+ ? {
166
+ "& > [data-line]::before": {
167
+ content: "counter(line)",
168
+ display: "inline-block",
169
+ inlineSize: `${digits}ch`,
170
+ marginInlineEnd: "1.5ch",
171
+ textAlign: "end",
172
+ userSelect: "none",
173
+ color: "var(--ui-neutral-fg-muted)",
174
+ },
175
+ }
176
+ : {}),
177
+ });
178
+ }
179
+ /**
180
+ * The glyph before the header text: a terminal for a shell session, otherwise a file
181
+ * glyph picked by the title's extension, so a reader sees what kind of file it is.
182
+ */
183
+ function TitleIcon(handle) {
184
+ return () => {
185
+ let { shell, title } = handle.props;
186
+ let extension = title?.match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase();
187
+ if (shell && !extension)
188
+ return _jsx(TerminalIcon, { size: 14, "aria-hidden": "true" });
189
+ if (extension === "json" || extension === "jsonc") {
190
+ return _jsx(FileBracesIcon, { size: 14, "aria-hidden": "true" });
191
+ }
192
+ if (extension && ["md", "mdx", "txt"].includes(extension)) {
193
+ return _jsx(FileTextIcon, { size: 14, "aria-hidden": "true" });
194
+ }
195
+ if (extension && ["toml", "yaml", "yml", "env", "ini"].includes(extension)) {
196
+ return _jsx(FileCogIcon, { size: 14, "aria-hidden": "true" });
197
+ }
198
+ if (extension)
199
+ return _jsx(FileCodeIcon, { size: 14, "aria-hidden": "true" });
200
+ return _jsx(FileIcon, { size: 14, "aria-hidden": "true" });
201
+ };
202
+ }
203
+ /** Whether a title names a file, which sets it in the mono face. */
204
+ function isPath(title) {
205
+ return /[/.]/.test(title) && !/\s/.test(title);
206
+ }
207
+ /** Whether the block is a shell session, by its language or a "Terminal" title. */
208
+ function isShell(language, title) {
209
+ if (language && SHELL_LANGUAGES.has(language.toLowerCase()))
210
+ return true;
211
+ return title?.trim().toLowerCase() === "terminal";
212
+ }
213
+ /**
214
+ * Splits the code into lines, each holding its runs and its mark. In a shell block a
215
+ * line opening with `$ ` loses the prompt, which the line draws as decoration instead,
216
+ * and once any line has a prompt the lines that are neither commands nor a continued
217
+ * command (after a trailing `\`) read as output.
218
+ */
219
+ function paintLines(code, language, tokens, shell, marks) {
220
+ let source = code.replace(/\r?\n$/, "");
221
+ let rawLines = source.split(/\r?\n/);
222
+ let prompts = rawLines.map((line) => shell && line.startsWith(PROMPT));
223
+ let hasPrompts = prompts.some(Boolean);
224
+ let stripped = rawLines.map((line, index) => (prompts[index] ? line.slice(PROMPT.length) : line));
225
+ let text = hasPrompts ? stripped.join("\n") : source;
226
+ let runs = tokens ?? (language ? tokenize(text, language) : [{ type: "plain", value: text }]);
227
+ let lines = [];
228
+ let continued = false;
229
+ for (let [index, lineTokens] of splitLines(runs).slice(0, rawLines.length).entries()) {
230
+ let prompt = prompts[index] ?? false;
231
+ let command = prompt || continued;
232
+ continued = command && (rawLines[index] ?? "").endsWith("\\");
233
+ lines.push({
234
+ tokens: tokens && prompt ? dropLeading(lineTokens, PROMPT.length) : lineTokens,
235
+ mark: markOf(index + 1, marks),
236
+ prompt,
237
+ output: hasPrompts && !command,
238
+ });
239
+ }
240
+ return lines;
241
+ }
242
+ /** The mark a line carries; a removal or addition wins over a plain highlight. */
243
+ function markOf(number, marks) {
244
+ if (marks.remove?.includes(number))
245
+ return "remove";
246
+ if (marks.add?.includes(number))
247
+ return "add";
248
+ if (marks.highlight?.includes(number))
249
+ return "highlight";
250
+ return undefined;
251
+ }
252
+ /**
253
+ * Splits runs at newlines so each line owns its runs; a run spanning lines (a block
254
+ * comment, a template literal) becomes one run per line, same type.
255
+ */
256
+ function splitLines(runs) {
257
+ let lines = [[]];
258
+ for (let run of runs) {
259
+ for (let [index, piece] of run.value.split(/\r?\n/).entries()) {
260
+ if (index > 0)
261
+ lines.push([]);
262
+ if (piece.length > 0)
263
+ lines[lines.length - 1]?.push({ type: run.type, value: piece });
264
+ }
265
+ }
266
+ return lines;
267
+ }
268
+ /** Drops the first `count` characters of a line's runs, for a prompt already painted in. */
269
+ function dropLeading(runs, count) {
270
+ let remaining = count;
271
+ let result = [];
272
+ for (let run of runs) {
273
+ if (remaining >= run.value.length) {
274
+ remaining -= run.value.length;
275
+ continue;
276
+ }
277
+ result.push({ type: run.type, value: run.value.slice(remaining) });
278
+ remaining = 0;
279
+ }
280
+ return result;
281
+ }
282
+ /**
283
+ * Draws every line with a newline between each pair, so the text a copy reads keeps the
284
+ * source's shape. Output and removed lines carry the attribute that keeps them off the
285
+ * clipboard.
286
+ */
287
+ function renderLines(lines) {
288
+ let nodes = [];
289
+ for (let [index, line] of lines.entries()) {
290
+ if (index > 0)
291
+ nodes.push("\n");
292
+ let excluded = line.output || line.mark === "remove";
293
+ nodes.push(_jsxs("span", { "data-line": "", "data-mark": line.mark, "data-output": line.output ? "" : undefined, ...(excluded ? { [COPY_EXCLUDE_ATTRIBUTE]: "" } : {}), children: [line.prompt ? _jsx("span", { "data-prompt": "" }) : null, renderRuns(line.tokens)] }));
294
+ }
295
+ return nodes;
296
+ }
297
+ /**
298
+ * Renders runs as text and `span.token.<type>` elements, the class contract the shared
299
+ * highlight stylesheet colors; each span also carries its color with a scheme-aware
300
+ * fallback, so code reads in color on a page that never loaded that stylesheet.
301
+ */
302
+ function renderRuns(runs) {
303
+ return runs.map((run) => {
304
+ let palette = TOKEN_PALETTE[run.type];
305
+ if (run.type === "plain" || !palette)
306
+ return run.value;
307
+ let [light, dark] = palette;
308
+ return (_jsx("span", { className: `token ${run.type}`, mix: [raw({ color: `var(--highlight-${run.type}, light-dark(${light}, ${dark}))` })], children: run.value }));
309
+ });
310
+ }
311
+ /**
312
+ * An element id derived from the code. A documentation page is cached against the bytes
313
+ * it rendered, so an id that changed per render would cost a fresh download.
314
+ */
315
+ function stableId(value) {
316
+ let hash = FNV_OFFSET;
317
+ for (let index = 0; index < value.length; index += 1) {
318
+ hash ^= value.charCodeAt(index);
319
+ hash = Math.imul(hash, FNV_PRIME);
320
+ }
321
+ return `code-${(hash >>> 0).toString(36)}`;
322
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Client island: keeps one set of code tabs on the choice every set sharing its sync key
3
+ * makes, and remembers it. It owns no visible markup, so the tabs stay server HTML and
4
+ * switch without script; only this marker hydrates.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { EntryComponent } from "remix/component";
10
+ import type { CodeTabsPersistence } from "./mixins/code-tabs-sync.js";
11
+ /**
12
+ * Props {@link CodeTabsSync} serializes into the page for hydration, which is why they
13
+ * are a `type`: `SerializableProps` rejects an interface.
14
+ */
15
+ export type CodeTabsSyncProps = {
16
+ /** The key the tab sets share, such as `package-manager`. */
17
+ syncKey: string;
18
+ /** Where the choice is remembered between pages. */
19
+ persist: CodeTabsPersistence;
20
+ };
21
+ /**
22
+ * Renders a hidden marker carrying {@link codeTabsSync}. `CodeTabs` renders it whenever it
23
+ * has a `syncKey`; the island loads from the bare `@sdxc/ui/code-tabs-sync` specifier,
24
+ * which the app's browser entry maps to a dynamic import.
25
+ */
26
+ export declare const CodeTabsSync: EntryComponent<CodeTabsSyncProps>;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "remix/component/jsx-runtime";
2
+ import { hidden } from "@sdxc/u/layout";
3
+ import { clientEntry } from "remix/component";
4
+ import { codeTabsSync } from "./mixins/code-tabs-sync.js";
5
+ /**
6
+ * Renders a hidden marker carrying {@link codeTabsSync}. `CodeTabs` renders it whenever it
7
+ * has a `syncKey`; the island loads from the bare `@sdxc/ui/code-tabs-sync` specifier,
8
+ * which the app's browser entry maps to a dynamic import.
9
+ */
10
+ export const CodeTabsSync = clientEntry("@sdxc/ui/code-tabs-sync#CodeTabsSync", function CodeTabsSync(handle) {
11
+ return () => (_jsx("span", { mix: [hidden(), codeTabsSync(handle.props.syncKey, handle.props.persist)] }));
12
+ });
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Tabs over code that mirrors a reader's choice — package manager, framework, language.
3
+ * The tabs are radios switched by CSS, so they work without script; with a `syncKey`, a
4
+ * small island switches every set sharing it and remembers the choice for the next page.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
10
+ import type { CodeTabsPersistence } from "./mixins/code-tabs-sync.js";
11
+ /**
12
+ * Prop types for {@link CodeTabs}.
13
+ */
14
+ export declare namespace CodeTabs {
15
+ /** One tab: its label in the strip, the value a sync key stores, and its panel. */
16
+ interface Tab {
17
+ label: string;
18
+ /** Stable across pages and sets, such as `bun`; the value a sync key remembers. */
19
+ value: string;
20
+ /** What the panel shows, usually a `CodeBlock`. */
21
+ children: RemixNode;
22
+ }
23
+ /** Props accepted by {@link CodeTabs}. */
24
+ interface Props extends Omit<TagProps<"form">, "children" | "aria-label"> {
25
+ tabs: readonly Tab[];
26
+ /** Every set with this key on the page switches together, such as `package-manager`. */
27
+ syncKey?: string;
28
+ /**
29
+ * Where a synced choice is remembered between pages: `cookie` lets the server render
30
+ * it (read it with `readCodeTabsCookie` and pass `selected`), `local` restores it after
31
+ * hydration, and `none` only syncs this page. Defaults to `local`.
32
+ */
33
+ persist?: CodeTabsPersistence;
34
+ /** The value of the tab to render selected, such as the reader's remembered choice. Defaults to the first tab. */
35
+ selected?: string;
36
+ /** Names the strip of tabs for assistive technology, such as "Package manager". */
37
+ "aria-label": string;
38
+ }
39
+ }
40
+ /**
41
+ * Renders the strip of tabs over a stack of panels that share one grid cell, so the set
42
+ * is as tall as its tallest panel and switching never moves the page. The selected tab's
43
+ * underline grows in over 150ms, and holds still under reduced motion.
44
+ *
45
+ * @param handle Runtime handle carrying the set's props.
46
+ * @returns The render function producing the set.
47
+ * @example
48
+ * <CodeTabs syncKey="framework" aria-label={t("framework")} tabs={[
49
+ * { label: "Remix", value: "remix", children: <CodeBlock title="app/root.tsx" … /> },
50
+ * { label: "Hono", value: "hono", children: <CodeBlock title="src/index.ts" … /> },
51
+ * ]} />
52
+ */
53
+ export declare function CodeTabs(handle: Handle<CodeTabs.Props>): () => import("remix/component").RemixElement;