@usefragments/ui 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (457) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/fragments-wordmark.cjs +2 -2
  3. package/dist/assets/fragments-wordmark.d.ts.map +1 -1
  4. package/dist/assets/fragments-wordmark.js +2 -2
  5. package/dist/assets/ui.css +4720 -4159
  6. package/dist/chart.cjs +24 -6
  7. package/dist/chart.js +24 -6
  8. package/dist/codeblock.cjs +55 -29
  9. package/dist/codeblock.js +55 -29
  10. package/dist/colorpicker.cjs +3 -1
  11. package/dist/colorpicker.js +3 -1
  12. package/dist/components/Accordion/Accordion.module.scss.cjs +8 -8
  13. package/dist/components/Accordion/Accordion.module.scss.js +8 -8
  14. package/dist/components/Alert/Alert.module.scss.cjs +15 -12
  15. package/dist/components/Alert/Alert.module.scss.js +15 -12
  16. package/dist/components/Alert/index.cjs +7 -1
  17. package/dist/components/Alert/index.d.ts +12 -6
  18. package/dist/components/Alert/index.d.ts.map +1 -1
  19. package/dist/components/Alert/index.js +7 -1
  20. package/dist/components/AppShell/AppShell.module.scss.cjs +14 -14
  21. package/dist/components/AppShell/AppShell.module.scss.js +14 -14
  22. package/dist/components/Avatar/Avatar.module.scss.cjs +14 -14
  23. package/dist/components/Avatar/Avatar.module.scss.js +14 -14
  24. package/dist/components/Badge/Badge.module.scss.cjs +19 -19
  25. package/dist/components/Badge/Badge.module.scss.js +19 -19
  26. package/dist/components/BentoGrid/BentoGrid.module.scss.cjs +14 -14
  27. package/dist/components/BentoGrid/BentoGrid.module.scss.js +14 -14
  28. package/dist/components/Box/Box.module.scss.cjs +152 -152
  29. package/dist/components/Box/Box.module.scss.js +152 -152
  30. package/dist/components/Box/index.cjs +64 -75
  31. package/dist/components/Box/index.d.ts +16 -16
  32. package/dist/components/Box/index.d.ts.map +1 -1
  33. package/dist/components/Box/index.js +64 -75
  34. package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.cjs +8 -8
  35. package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.js +8 -8
  36. package/dist/components/Button/Button.module.scss.cjs +14 -14
  37. package/dist/components/Button/Button.module.scss.js +14 -14
  38. package/dist/components/Card/Card.module.scss.cjs +29 -17
  39. package/dist/components/Card/Card.module.scss.js +30 -18
  40. package/dist/components/Card/index.cjs +8 -0
  41. package/dist/components/Card/index.d.ts +12 -2
  42. package/dist/components/Card/index.d.ts.map +1 -1
  43. package/dist/components/Card/index.js +8 -0
  44. package/dist/components/Chart/Chart.module.scss.cjs +15 -15
  45. package/dist/components/Chart/Chart.module.scss.js +15 -15
  46. package/dist/components/Chart/index.d.ts.map +1 -1
  47. package/dist/components/Checkbox/Checkbox.module.scss.cjs +9 -9
  48. package/dist/components/Checkbox/Checkbox.module.scss.js +9 -9
  49. package/dist/components/Checkbox/index.cjs +2 -2
  50. package/dist/components/Checkbox/index.d.ts.map +1 -1
  51. package/dist/components/Checkbox/index.js +2 -2
  52. package/dist/components/Chip/Chip.module.scss.cjs +15 -15
  53. package/dist/components/Chip/Chip.module.scss.js +15 -15
  54. package/dist/components/Chip/index.cjs +2 -1
  55. package/dist/components/Chip/index.d.ts.map +1 -1
  56. package/dist/components/Chip/index.js +2 -1
  57. package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +26 -23
  58. package/dist/components/CodeBlock/CodeBlock.module.scss.js +26 -23
  59. package/dist/components/CodeBlock/css-variables-theme.cjs +98 -0
  60. package/dist/components/CodeBlock/css-variables-theme.d.ts +27 -0
  61. package/dist/components/CodeBlock/css-variables-theme.d.ts.map +1 -0
  62. package/dist/components/CodeBlock/css-variables-theme.js +98 -0
  63. package/dist/components/CodeBlock/index.d.ts +17 -3
  64. package/dist/components/CodeBlock/index.d.ts.map +1 -1
  65. package/dist/components/Collapsible/Collapsible.module.scss.cjs +9 -9
  66. package/dist/components/Collapsible/Collapsible.module.scss.js +9 -9
  67. package/dist/components/ColorPicker/ColorPicker.module.scss.cjs +14 -14
  68. package/dist/components/ColorPicker/ColorPicker.module.scss.js +14 -14
  69. package/dist/components/ColorPicker/index.d.ts.map +1 -1
  70. package/dist/components/Combobox/Combobox.module.scss.cjs +21 -21
  71. package/dist/components/Combobox/Combobox.module.scss.js +21 -21
  72. package/dist/components/Combobox/index.cjs +17 -1
  73. package/dist/components/Combobox/index.d.ts.map +1 -1
  74. package/dist/components/Combobox/index.js +17 -1
  75. package/dist/components/Command/Command.module.scss.cjs +11 -11
  76. package/dist/components/Command/Command.module.scss.js +11 -11
  77. package/dist/components/Command/index.cjs +26 -15
  78. package/dist/components/Command/index.d.ts +2 -2
  79. package/dist/components/Command/index.d.ts.map +1 -1
  80. package/dist/components/Command/index.js +26 -15
  81. package/dist/components/ConversationList/ConversationList.module.scss.cjs +10 -10
  82. package/dist/components/ConversationList/ConversationList.module.scss.js +10 -10
  83. package/dist/components/DataTable/DataTable.icons.cjs +6 -33
  84. package/dist/components/DataTable/DataTable.icons.d.ts.map +1 -1
  85. package/dist/components/DataTable/DataTable.icons.js +6 -33
  86. package/dist/components/DataTable/DataTable.module.scss.cjs +27 -27
  87. package/dist/components/DataTable/DataTable.module.scss.js +27 -27
  88. package/dist/components/DataTable/index.d.ts.map +1 -1
  89. package/dist/components/DatePicker/DatePicker.module.scss.cjs +33 -33
  90. package/dist/components/DatePicker/DatePicker.module.scss.js +33 -33
  91. package/dist/components/DatePicker/index.d.ts.map +1 -1
  92. package/dist/components/Dialog/Dialog.module.scss.cjs +14 -14
  93. package/dist/components/Dialog/Dialog.module.scss.js +14 -14
  94. package/dist/components/Dialog/index.cjs +11 -14
  95. package/dist/components/Dialog/index.d.ts +7 -7
  96. package/dist/components/Dialog/index.d.ts.map +1 -1
  97. package/dist/components/Dialog/index.js +11 -14
  98. package/dist/components/Drawer/Drawer.module.scss.cjs +29 -29
  99. package/dist/components/Drawer/Drawer.module.scss.js +29 -29
  100. package/dist/components/Editor/Editor.module.scss.cjs +17 -17
  101. package/dist/components/Editor/Editor.module.scss.js +17 -17
  102. package/dist/components/Editor/index.d.ts +10 -10
  103. package/dist/components/Editor/index.d.ts.map +1 -1
  104. package/dist/components/EmptyState/EmptyState.module.scss.cjs +11 -8
  105. package/dist/components/EmptyState/EmptyState.module.scss.js +11 -8
  106. package/dist/components/EmptyState/index.cjs +8 -6
  107. package/dist/components/EmptyState/index.d.ts +9 -4
  108. package/dist/components/EmptyState/index.d.ts.map +1 -1
  109. package/dist/components/EmptyState/index.js +8 -6
  110. package/dist/components/Field/Field.module.scss.cjs +5 -5
  111. package/dist/components/Field/Field.module.scss.js +5 -5
  112. package/dist/components/Field/index.cjs +9 -1
  113. package/dist/components/Field/index.d.ts.map +1 -1
  114. package/dist/components/Field/index.js +9 -1
  115. package/dist/components/Fieldset/Fieldset.module.scss.cjs +3 -3
  116. package/dist/components/Fieldset/Fieldset.module.scss.js +3 -3
  117. package/dist/components/Grid/index.cjs +1 -1
  118. package/dist/components/Grid/index.js +1 -1
  119. package/dist/components/Header/Header.module.scss.cjs +33 -33
  120. package/dist/components/Header/Header.module.scss.js +33 -33
  121. package/dist/components/Header/index.cjs +17 -38
  122. package/dist/components/Header/index.d.ts +15 -11
  123. package/dist/components/Header/index.d.ts.map +1 -1
  124. package/dist/components/Header/index.js +17 -38
  125. package/dist/components/Icon/Icon.module.scss.cjs +15 -15
  126. package/dist/components/Icon/Icon.module.scss.js +15 -15
  127. package/dist/components/IconButton/IconButton.module.scss.cjs +8 -8
  128. package/dist/components/IconButton/IconButton.module.scss.js +8 -8
  129. package/dist/components/IconButton/index.cjs +2 -1
  130. package/dist/components/IconButton/index.d.ts.map +1 -1
  131. package/dist/components/IconButton/index.js +2 -1
  132. package/dist/components/Image/Image.module.scss.cjs +27 -27
  133. package/dist/components/Image/Image.module.scss.js +27 -27
  134. package/dist/components/Input/Input.module.scss.cjs +17 -17
  135. package/dist/components/Input/Input.module.scss.js +17 -17
  136. package/dist/components/Link/Link.module.scss.cjs +14 -10
  137. package/dist/components/Link/Link.module.scss.js +14 -10
  138. package/dist/components/Link/index.d.ts +1 -1
  139. package/dist/components/Link/index.d.ts.map +1 -1
  140. package/dist/components/List/List.module.scss.cjs +19 -19
  141. package/dist/components/List/List.module.scss.js +19 -19
  142. package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
  143. package/dist/components/Listbox/Listbox.module.scss.js +8 -8
  144. package/dist/components/Loading/Loading.module.scss.cjs +34 -34
  145. package/dist/components/Loading/Loading.module.scss.js +34 -34
  146. package/dist/components/Loading/index.cjs +1 -1
  147. package/dist/components/Loading/index.js +1 -1
  148. package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
  149. package/dist/components/Markdown/Markdown.module.scss.js +1 -1
  150. package/dist/components/Markdown/index.d.ts +2 -2
  151. package/dist/components/Markdown/index.d.ts.map +1 -1
  152. package/dist/components/Menu/Menu.module.scss.cjs +14 -14
  153. package/dist/components/Menu/Menu.module.scss.js +14 -14
  154. package/dist/components/Message/Message.module.scss.cjs +18 -18
  155. package/dist/components/Message/Message.module.scss.js +18 -18
  156. package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +34 -31
  157. package/dist/components/NavigationMenu/NavigationMenu.module.scss.js +34 -31
  158. package/dist/components/NavigationMenu/index.cjs +32 -15
  159. package/dist/components/NavigationMenu/index.d.ts +12 -6
  160. package/dist/components/NavigationMenu/index.d.ts.map +1 -1
  161. package/dist/components/NavigationMenu/index.js +32 -15
  162. package/dist/components/Pagination/Pagination.module.scss.cjs +10 -10
  163. package/dist/components/Pagination/Pagination.module.scss.js +10 -10
  164. package/dist/components/Popover/Popover.module.scss.cjs +10 -10
  165. package/dist/components/Popover/Popover.module.scss.js +10 -10
  166. package/dist/components/Progress/Progress.module.scss.cjs +25 -25
  167. package/dist/components/Progress/Progress.module.scss.js +25 -25
  168. package/dist/components/Prompt/Prompt.module.scss.cjs +28 -28
  169. package/dist/components/Prompt/Prompt.module.scss.js +28 -28
  170. package/dist/components/RadioGroup/RadioGroup.module.scss.cjs +15 -15
  171. package/dist/components/RadioGroup/RadioGroup.module.scss.js +15 -15
  172. package/dist/components/ScrollArea/ScrollArea.module.scss.cjs +5 -5
  173. package/dist/components/ScrollArea/ScrollArea.module.scss.js +5 -5
  174. package/dist/components/ScrollArea/index.d.ts +4 -4
  175. package/dist/components/ScrollArea/index.d.ts.map +1 -1
  176. package/dist/components/ScrollArea/scroll-state.d.ts +5 -5
  177. package/dist/components/Select/Select.module.scss.cjs +21 -21
  178. package/dist/components/Select/Select.module.scss.js +21 -21
  179. package/dist/components/Separator/Separator.module.scss.cjs +11 -11
  180. package/dist/components/Separator/Separator.module.scss.js +11 -11
  181. package/dist/components/Sidebar/Sidebar.module.scss.cjs +43 -43
  182. package/dist/components/Sidebar/Sidebar.module.scss.js +43 -43
  183. package/dist/components/Sidebar/index.cjs +12 -35
  184. package/dist/components/Sidebar/index.d.ts +19 -19
  185. package/dist/components/Sidebar/index.d.ts.map +1 -1
  186. package/dist/components/Sidebar/index.js +12 -35
  187. package/dist/components/Skeleton/Skeleton.module.scss.cjs +50 -46
  188. package/dist/components/Skeleton/Skeleton.module.scss.js +50 -46
  189. package/dist/components/Slider/Slider.module.scss.cjs +12 -12
  190. package/dist/components/Slider/Slider.module.scss.js +12 -12
  191. package/dist/components/Stack/Stack.module.scss.cjs +25 -25
  192. package/dist/components/Stack/Stack.module.scss.js +25 -25
  193. package/dist/components/Stack/index.cjs +1 -1
  194. package/dist/components/Stack/index.js +1 -1
  195. package/dist/components/Switch/Switch.module.scss.cjs +9 -9
  196. package/dist/components/Switch/Switch.module.scss.js +9 -9
  197. package/dist/components/Table/Table.module.scss.cjs +19 -19
  198. package/dist/components/Table/Table.module.scss.js +19 -19
  199. package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
  200. package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
  201. package/dist/components/TableOfContents/index.cjs +13 -9
  202. package/dist/components/TableOfContents/index.d.ts +5 -3
  203. package/dist/components/TableOfContents/index.d.ts.map +1 -1
  204. package/dist/components/TableOfContents/index.js +13 -9
  205. package/dist/components/Tabs/Tabs.module.scss.cjs +12 -12
  206. package/dist/components/Tabs/Tabs.module.scss.js +12 -12
  207. package/dist/components/Tabs/index.cjs +26 -6
  208. package/dist/components/Tabs/index.d.ts.map +1 -1
  209. package/dist/components/Tabs/index.js +26 -6
  210. package/dist/components/Text/Text.module.scss.cjs +87 -75
  211. package/dist/components/Text/Text.module.scss.js +87 -75
  212. package/dist/components/Text/index.cjs +49 -41
  213. package/dist/components/Text/index.d.ts +12 -11
  214. package/dist/components/Text/index.d.ts.map +1 -1
  215. package/dist/components/Text/index.js +49 -41
  216. package/dist/components/Textarea/Textarea.module.scss.cjs +24 -24
  217. package/dist/components/Textarea/Textarea.module.scss.js +24 -24
  218. package/dist/components/Theme/index.cjs +2 -1
  219. package/dist/components/Theme/index.d.ts.map +1 -1
  220. package/dist/components/Theme/index.js +2 -1
  221. package/dist/components/ThemeToggle/ThemeToggle.module.scss.cjs +9 -6
  222. package/dist/components/ThemeToggle/ThemeToggle.module.scss.js +9 -6
  223. package/dist/components/ThemeToggle/index.cjs +31 -6
  224. package/dist/components/ThemeToggle/index.d.ts +7 -2
  225. package/dist/components/ThemeToggle/index.d.ts.map +1 -1
  226. package/dist/components/ThemeToggle/index.js +32 -7
  227. package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +13 -13
  228. package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +13 -13
  229. package/dist/components/Toast/Toast.module.scss.cjs +20 -20
  230. package/dist/components/Toast/Toast.module.scss.js +20 -20
  231. package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +17 -17
  232. package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +17 -17
  233. package/dist/components/Tooltip/Tooltip.module.scss.cjs +3 -3
  234. package/dist/components/Tooltip/Tooltip.module.scss.js +3 -3
  235. package/dist/components/Tooltip/index.cjs +24 -40
  236. package/dist/components/Tooltip/index.d.ts +4 -4
  237. package/dist/components/Tooltip/index.d.ts.map +1 -1
  238. package/dist/components/Tooltip/index.js +24 -40
  239. package/dist/components/VisuallyHidden/index.d.ts +2 -2
  240. package/dist/data-table.cjs +2 -1
  241. package/dist/data-table.js +2 -1
  242. package/dist/datepicker.cjs +3 -2
  243. package/dist/datepicker.js +3 -2
  244. package/dist/editor.cjs +68 -28
  245. package/dist/editor.js +68 -28
  246. package/dist/index.cjs +1 -1
  247. package/dist/index.d.ts +1 -1
  248. package/dist/index.d.ts.map +1 -1
  249. package/dist/index.js +2 -2
  250. package/dist/markdown.cjs +21 -29
  251. package/dist/markdown.js +21 -29
  252. package/dist/measurements/generated.cjs +9 -1
  253. package/dist/measurements/generated.d.ts +7 -0
  254. package/dist/measurements/generated.d.ts.map +1 -1
  255. package/dist/measurements/generated.js +9 -1
  256. package/dist/utils/a11y.cjs +5 -2
  257. package/dist/utils/a11y.d.ts +5 -5
  258. package/dist/utils/a11y.d.ts.map +1 -1
  259. package/dist/utils/a11y.js +5 -2
  260. package/dist/utils/canonical-stamp.cjs +2 -8
  261. package/dist/utils/canonical-stamp.d.ts.map +1 -1
  262. package/dist/utils/canonical-stamp.js +1 -7
  263. package/dist/utils/css-warning.cjs +1 -1
  264. package/dist/utils/css-warning.js +1 -1
  265. package/dist/utils/env.cjs +17 -0
  266. package/dist/utils/env.d.ts +3 -0
  267. package/dist/utils/env.d.ts.map +1 -0
  268. package/dist/utils/env.js +17 -0
  269. package/dist/utils/keyboard-shortcuts.cjs +3 -10
  270. package/dist/utils/keyboard-shortcuts.d.ts +4 -4
  271. package/dist/utils/keyboard-shortcuts.d.ts.map +1 -1
  272. package/dist/utils/keyboard-shortcuts.js +3 -10
  273. package/dist/utils/seed-derivation.cjs +10 -6
  274. package/dist/utils/seed-derivation.d.ts.map +1 -1
  275. package/dist/utils/seed-derivation.js +10 -6
  276. package/fragments.json +1 -1
  277. package/package.json +6 -4
  278. package/src/assets/fragments-logo.tsx +2 -2
  279. package/src/assets/fragments-wordmark.tsx +4 -2
  280. package/src/components/Accordion/Accordion.contract.json +24 -48
  281. package/src/components/Alert/Alert.contract.json +37 -53
  282. package/src/components/Alert/Alert.module.scss +24 -0
  283. package/src/components/Alert/index.tsx +55 -29
  284. package/src/components/AppShell/AppShell.contract.json +34 -51
  285. package/src/components/AppShell/AppShell.module.scss +53 -40
  286. package/src/components/Avatar/Avatar.contract.json +31 -48
  287. package/src/components/Avatar/Avatar.module.scss +4 -1
  288. package/src/components/Badge/Badge.contract.json +37 -42
  289. package/src/components/Badge/Badge.module.scss +9 -2
  290. package/src/components/BentoGrid/BentoGrid.contract.json +21 -45
  291. package/src/components/Box/Box.contract.json +40 -148
  292. package/src/components/Box/index.tsx +92 -99
  293. package/src/components/Breadcrumbs/Breadcrumbs.contract.json +21 -34
  294. package/src/components/Breadcrumbs/Breadcrumbs.module.scss +12 -7
  295. package/src/components/Button/Button.module.scss +8 -7
  296. package/src/components/ButtonGroup/ButtonGroup.contract.json +32 -47
  297. package/src/components/Card/Card.module.scss +82 -1
  298. package/src/components/Card/index.tsx +21 -2
  299. package/src/components/Chart/Chart.contract.json +21 -29
  300. package/src/components/Chart/index.tsx +36 -6
  301. package/src/components/Checkbox/Checkbox.contract.json +24 -24
  302. package/src/components/Checkbox/Checkbox.module.scss +32 -23
  303. package/src/components/Checkbox/index.tsx +4 -2
  304. package/src/components/Chip/Chip.contract.json +33 -40
  305. package/src/components/Chip/Chip.module.scss +2 -2
  306. package/src/components/Chip/index.tsx +2 -1
  307. package/src/components/CodeBlock/CodeBlock.contract.json +46 -76
  308. package/src/components/CodeBlock/CodeBlock.module.scss +40 -15
  309. package/src/components/CodeBlock/css-variables-theme.ts +102 -0
  310. package/src/components/CodeBlock/index.tsx +91 -35
  311. package/src/components/Collapsible/Collapsible.contract.json +21 -36
  312. package/src/components/ColorPicker/ColorPicker.contract.json +29 -48
  313. package/src/components/ColorPicker/ColorPicker.module.scss +15 -12
  314. package/src/components/ColorPicker/index.tsx +5 -1
  315. package/src/components/Combobox/Combobox.contract.json +36 -37
  316. package/src/components/Combobox/Combobox.module.scss +1 -1
  317. package/src/components/Combobox/index.tsx +31 -5
  318. package/src/components/Command/Command.contract.json +21 -43
  319. package/src/components/Command/index.tsx +58 -47
  320. package/src/components/ConversationList/ConversationList.contract.json +27 -32
  321. package/src/components/DataTable/DataTable.icons.tsx +4 -21
  322. package/src/components/DataTable/DataTable.module.scss +12 -8
  323. package/src/components/DataTable/index.tsx +8 -7
  324. package/src/components/DatePicker/DatePicker.contract.json +27 -28
  325. package/src/components/DatePicker/DatePicker.module.scss +12 -5
  326. package/src/components/DatePicker/index.tsx +5 -2
  327. package/src/components/Dialog/Dialog.module.scss +3 -3
  328. package/src/components/Dialog/index.tsx +47 -37
  329. package/src/components/Drawer/Drawer.contract.json +22 -36
  330. package/src/components/Editor/Editor.contract.json +31 -48
  331. package/src/components/Editor/Editor.module.scss +36 -14
  332. package/src/components/Editor/index.tsx +240 -179
  333. package/src/components/EmptyState/EmptyState.contract.json +31 -43
  334. package/src/components/EmptyState/EmptyState.module.scss +8 -0
  335. package/src/components/EmptyState/index.tsx +48 -23
  336. package/src/components/Field/Field.contract.json +28 -46
  337. package/src/components/Field/index.tsx +5 -1
  338. package/src/components/Fieldset/Fieldset.contract.json +21 -38
  339. package/src/components/Fieldset/Fieldset.module.scss +10 -3
  340. package/src/components/Form/Form.contract.json +20 -20
  341. package/src/components/Grid/Grid.contract.json +28 -64
  342. package/src/components/Grid/index.tsx +10 -10
  343. package/src/components/Header/Header.contract.json +31 -67
  344. package/src/components/Header/Header.module.scss +36 -21
  345. package/src/components/Header/index.tsx +134 -122
  346. package/src/components/Icon/Icon.contract.json +22 -62
  347. package/src/components/IconButton/IconButton.contract.json +34 -18
  348. package/src/components/IconButton/IconButton.module.scss +6 -7
  349. package/src/components/IconButton/index.tsx +2 -1
  350. package/src/components/Image/Image.contract.json +23 -56
  351. package/src/components/Input/Input.contract.json +26 -32
  352. package/src/components/Input/Input.module.scss +3 -2
  353. package/src/components/Link/Link.contract.json +32 -52
  354. package/src/components/Link/Link.module.scss +23 -6
  355. package/src/components/Link/index.tsx +1 -1
  356. package/src/components/List/List.contract.json +23 -52
  357. package/src/components/List/List.module.scss +1 -1
  358. package/src/components/Listbox/Listbox.contract.json +21 -37
  359. package/src/components/Loading/Loading.contract.json +37 -61
  360. package/src/components/Loading/Loading.module.scss +10 -7
  361. package/src/components/Loading/index.tsx +2 -2
  362. package/src/components/Main/Main.contract.json +17 -9
  363. package/src/components/Markdown/Markdown.contract.json +22 -43
  364. package/src/components/Markdown/Markdown.module.scss +43 -5
  365. package/src/components/Markdown/index.tsx +48 -49
  366. package/src/components/Menu/Menu.contract.json +25 -41
  367. package/src/components/Menu/Menu.module.scss +23 -8
  368. package/src/components/Message/Message.contract.json +29 -52
  369. package/src/components/Message/Message.module.scss +12 -5
  370. package/src/components/NavigationMenu/NavigationMenu.contract.json +36 -45
  371. package/src/components/NavigationMenu/NavigationMenu.module.scss +64 -19
  372. package/src/components/NavigationMenu/index.tsx +105 -81
  373. package/src/components/Pagination/Pagination.contract.json +22 -40
  374. package/src/components/Pagination/Pagination.module.scss +2 -2
  375. package/src/components/Popover/Popover.contract.json +24 -46
  376. package/src/components/Popover/Popover.module.scss +6 -5
  377. package/src/components/Progress/Progress.contract.json +32 -28
  378. package/src/components/Progress/Progress.module.scss +3 -2
  379. package/src/components/Prompt/Prompt.contract.json +31 -47
  380. package/src/components/Prompt/Prompt.module.scss +13 -5
  381. package/src/components/RadioGroup/RadioGroup.contract.json +23 -24
  382. package/src/components/RadioGroup/RadioGroup.module.scss +13 -14
  383. package/src/components/ScrollArea/ScrollArea.contract.json +18 -19
  384. package/src/components/ScrollArea/ScrollArea.module.scss +15 -15
  385. package/src/components/ScrollArea/index.tsx +16 -16
  386. package/src/components/ScrollArea/scroll-state.ts +24 -24
  387. package/src/components/Select/Select.module.scss +2 -2
  388. package/src/components/Separator/Separator.contract.json +24 -48
  389. package/src/components/Sidebar/Sidebar.contract.json +35 -67
  390. package/src/components/Sidebar/Sidebar.module.scss +22 -13
  391. package/src/components/Sidebar/index.tsx +164 -164
  392. package/src/components/Skeleton/Skeleton.contract.json +28 -54
  393. package/src/components/Skeleton/Skeleton.module.scss +27 -10
  394. package/src/components/Slider/Slider.contract.json +27 -39
  395. package/src/components/Slider/Slider.module.scss +3 -3
  396. package/src/components/Stack/Stack.contract.json +29 -56
  397. package/src/components/Stack/Stack.module.scss +13 -12
  398. package/src/components/Stack/index.tsx +3 -3
  399. package/src/components/Switch/Switch.contract.json +33 -46
  400. package/src/components/Switch/Switch.module.scss +64 -26
  401. package/src/components/Table/Table.contract.json +28 -46
  402. package/src/components/Table/Table.module.scss +15 -3
  403. package/src/components/TableOfContents/TableOfContents.contract.json +34 -21
  404. package/src/components/TableOfContents/TableOfContents.module.scss +15 -5
  405. package/src/components/TableOfContents/index.tsx +26 -9
  406. package/src/components/Tabs/Tabs.contract.json +24 -45
  407. package/src/components/Tabs/Tabs.module.scss +1 -1
  408. package/src/components/Tabs/index.tsx +15 -3
  409. package/src/components/Text/Text.contract.json +30 -72
  410. package/src/components/Text/Text.module.scss +21 -4
  411. package/src/components/Text/index.tsx +113 -75
  412. package/src/components/Textarea/Textarea.contract.json +25 -43
  413. package/src/components/Textarea/Textarea.module.scss +2 -4
  414. package/src/components/Theme/Theme.contract.json +32 -51
  415. package/src/components/Theme/index.tsx +2 -1
  416. package/src/components/ThemeToggle/ThemeToggle.module.scss +23 -7
  417. package/src/components/ThemeToggle/index.tsx +43 -7
  418. package/src/components/ThinkingIndicator/ThinkingIndicator.contract.json +23 -40
  419. package/src/components/Toast/Toast.contract.json +30 -40
  420. package/src/components/Toast/Toast.module.scss +1 -1
  421. package/src/components/ToggleGroup/ToggleGroup.contract.json +29 -30
  422. package/src/components/ToggleGroup/ToggleGroup.module.scss +38 -5
  423. package/src/components/Tooltip/Tooltip.contract.json +31 -52
  424. package/src/components/Tooltip/index.tsx +19 -24
  425. package/src/components/VisuallyHidden/VisuallyHidden.contract.json +22 -44
  426. package/src/components/VisuallyHidden/index.tsx +5 -5
  427. package/src/index.ts +2 -2
  428. package/src/measurements/generated.ts +9 -2
  429. package/src/measurements/measurements.json +7 -0
  430. package/src/recipes/_boolean-range.scss +3 -11
  431. package/src/recipes/_field.scss +5 -1
  432. package/src/recipes/_layout.scss +14 -7
  433. package/src/recipes/_popup.scss +12 -2
  434. package/src/recipes/_prose.scss +13 -5
  435. package/src/recipes/_table-chrome.scss +16 -2
  436. package/src/scss.d.ts +1 -1
  437. package/src/styles/globals.scss +20 -19
  438. package/src/tokens/_computed.scss +5 -16
  439. package/src/tokens/_derive.scss +112 -210
  440. package/src/tokens/_measurements.catalog.generated.css +6 -1
  441. package/src/tokens/_measurements.generated.scss +14 -1
  442. package/src/tokens/_mixins.scss +7 -8
  443. package/src/tokens/_palettes.scss +39 -167
  444. package/src/tokens/_seeds.scss +20 -20
  445. package/src/tokens/_variables.scss +183 -38
  446. package/src/utils/a11y.tsx +69 -69
  447. package/src/utils/aria.ts +3 -3
  448. package/src/utils/canonical-stamp.ts +2 -12
  449. package/src/utils/css-warning.ts +7 -7
  450. package/src/utils/env.ts +25 -0
  451. package/src/utils/keyboard-shortcuts.ts +131 -126
  452. package/src/utils/seed-derivation.ts +10 -6
  453. package/src/components/Button/Button.contract.json +0 -218
  454. package/src/components/Card/Card.contract.json +0 -175
  455. package/src/components/DataTable/DataTable.contract.json +0 -302
  456. package/src/components/Dialog/Dialog.contract.json +0 -159
  457. package/src/components/Select/Select.contract.json +0 -259
@@ -1,16 +1,9 @@
1
1
  {
2
2
  "$schema": "https://usefragments.com/schemas/contract.v1.json",
3
3
  "name": "CodeBlock",
4
- "description": "Syntax-highlighted code display with copy functionality, theming, diff view, and collapsible sections",
4
+ "description": "Shows code with syntax colors, a copy button, and diff or collapse when you need them.",
5
5
  "category": "display",
6
- "tags": [
7
- "code",
8
- "syntax",
9
- "highlighting",
10
- "documentation",
11
- "developer",
12
- "diff"
13
- ],
6
+ "tags": ["code", "syntax", "highlighting", "documentation", "developer", "diff"],
14
7
  "status": "stable",
15
8
  "dependencies": [
16
9
  {
@@ -24,7 +17,7 @@
24
17
  "propsSummary": [
25
18
  "code: string (required)",
26
19
  "language: tsx|typescript|ts|javascript|js|jsx|bash|shell|css|scss|sass|json|html|xml|markdown|md|yaml|yml|python|py|ruby|go|rust|java|kotlin|swift|c|cpp|csharp|php|sql|graphql|diff|plaintext|text (default: tsx)",
27
- "theme: synthwave-84|github-dark|github-light|one-dark-pro|dracula|nord|monokai|vitesse-dark|vitesse-light|min-dark|min-light (default: one-dark-pro)",
20
+ "theme: css-variables|synthwave-84|github-dark|github-light|one-dark-pro|dracula|nord|monokai|vitesse-dark|vitesse-light|min-dark|min-light (default: css-variables)",
28
21
  "showCopy: boolean (default: true)",
29
22
  "title: string",
30
23
  "filename: string",
@@ -96,10 +89,11 @@
96
89
  },
97
90
  "theme": {
98
91
  "type": "enum",
99
- "description": "Syntax highlighting theme",
100
- "default": "one-dark-pro",
92
+ "description": "Syntax highlighting theme. css-variables maps spans onto --fui-code-token-* so both themes stay readable.",
93
+ "default": "css-variables",
101
94
  "required": false,
102
95
  "values": [
96
+ "css-variables",
103
97
  "synthwave-84",
104
98
  "github-dark",
105
99
  "github-light",
@@ -190,6 +184,12 @@
190
184
  "default": "5",
191
185
  "required": false
192
186
  },
187
+ "collapseAction": {
188
+ "type": "\"lines\" | \"expand\"",
189
+ "description": "Collapse control copy: line-count bar, or a single Expand / Collapse control",
190
+ "default": "lines",
191
+ "required": false
192
+ },
193
193
  "compact": {
194
194
  "type": "boolean",
195
195
  "description": "Compact mode with reduced padding",
@@ -207,11 +207,7 @@
207
207
  "description": "Where to place the copy button when not using persistentCopy",
208
208
  "default": "auto",
209
209
  "required": false,
210
- "values": [
211
- "auto",
212
- "header",
213
- "overlay"
214
- ]
210
+ "values": ["auto", "header", "overlay"]
215
211
  },
216
212
  "bg": {
217
213
  "type": "string",
@@ -226,118 +222,97 @@
226
222
  },
227
223
  "usage": {
228
224
  "when": [
229
- "Displaying code examples in documentation",
230
- "Showing installation commands",
231
- "Presenting configuration snippets",
232
- "Teaching programming concepts",
233
- "Showing code diffs or changes",
234
- "Displaying long code files with collapse functionality"
225
+ "Code examples inside prose or docs",
226
+ "Install and config snippets",
227
+ "Showing what changed, as a diff"
235
228
  ],
236
229
  "whenNot": [
237
- "User-editable code (use code editor)",
238
- "Very short inline code (use <code> element)",
239
- "Non-code content (use Text or Card)"
230
+ "The user needs to edit it (use an editor)",
231
+ "A couple of words inline (use a code element)"
240
232
  ],
241
233
  "guidelines": [
242
- "Always specify the correct language for accurate highlighting",
243
- "Use filename prop to show source file name in header bar",
244
- "Use copyPlacement=\"auto\" to render copy in overlay mode when no filename is provided",
245
- "Use title prop for external labels above the code block",
246
- "Enable line numbers for longer code samples",
247
- "Use highlightLines to draw attention to key lines",
248
- "Use addedLines/removedLines for diff highlighting",
249
- "Set maxHeight for very long code blocks to prevent layout issues",
250
- "Use collapsible for code samples that users may want to skim",
251
- "Choose a theme that matches your documentation style",
252
- "Keep code examples concise and focused",
253
- "Use CodeBlock.Tabbed for multi-language snippets; tabs support controlled value/onValueChange and explicit tab values"
234
+ "Set language every time wrong highlighting is worse than none",
235
+ "filename for a real file, title for a label, caption for the aside",
236
+ "Line numbers earn their keep once you need to point at a line",
237
+ "highlightLines for emphasis; addedLines and removedLines for diffs",
238
+ "maxHeight or collapsible keeps a long file from swallowing the page",
239
+ "CodeBlock.Tabbed groups the same snippet across languages"
254
240
  ],
255
241
  "accessibility": [
256
- "Code is presented in a semantic pre/code structure",
257
- "Copy button has appropriate aria-label",
258
- "Keyboard accessible copy functionality",
259
- "Collapse button has aria-expanded state"
242
+ "Renders as semantic pre and code",
243
+ "The copy button is labelled and keyboard reachable",
244
+ "The collapse toggle reports aria-expanded"
260
245
  ]
261
246
  },
262
247
  "examples": [
263
248
  {
264
249
  "name": "Default",
265
- "description": "Basic code block with syntax highlighting",
250
+ "description": "Pass code and language; highlighting and copy come free.",
266
251
  "code": "<CodeBlock code={`import { Button } from '@usefragments/ui';\n\nfunction App() {\n return <Button>Click me</Button>;\n}`} language=\"tsx\" />"
267
252
  },
268
253
  {
269
254
  "name": "With Filename",
270
- "description": "Code block with filename in header bar",
255
+ "description": "A header bar names the source file and holds the copy button.",
271
256
  "code": "<CodeBlock filename=\"app.tsx\" code={`import { Button, Card } from '@usefragments/ui';\n\nfunction App() {\n return (\n <Card>\n <Card.Header>Welcome</Card.Header>\n <Card.Content>\n <Button>Get Started</Button>\n </Card.Content>\n </Card>\n );\n}`} language=\"tsx\" />"
272
257
  },
273
258
  {
274
259
  "name": "With Title",
275
- "description": "Code block with external title label",
260
+ "description": "A label above the block, outside the code surface.",
276
261
  "code": "<CodeBlock title=\"Installation\" code=\"npm install @usefragments/ui\" language=\"bash\" />"
277
262
  },
278
263
  {
279
264
  "name": "With Caption",
280
- "description": "Code block with footer caption",
265
+ "description": "A footer line for the aside that does not belong in the code.",
281
266
  "code": "<CodeBlock\n code={`const API_URL = process.env.NEXT_PUBLIC_API_URL;`}\n language=\"typescript\"\n caption=\"Environment variables must be prefixed with NEXT_PUBLIC_ to be available in the browser.\"\n/>"
282
267
  },
283
268
  {
284
269
  "name": "With Line Numbers",
285
- "description": "Shows line numbers for reference",
270
+ "description": "Turn these on once a snippet is long enough to point at.",
286
271
  "code": "<CodeBlock code={`const greeting = \"Hello\";\nconst name = \"World\";\nconsole.log(\\`\\${greeting}, \\${name}!\\`);`} language=\"typescript\" showLineNumbers />"
287
272
  },
288
273
  {
289
274
  "name": "Custom Start Line",
290
- "description": "Shows code excerpt starting from a specific line number",
275
+ "description": "Numbering starts where the excerpt actually starts in the file.",
291
276
  "code": "<CodeBlock\n code={` return (\n <button onClick={() => setCount(c => c + 1)}>\n Count: {count}\n </button>\n );\n}`}\n language=\"tsx\"\n showLineNumbers\n startLineNumber={15}\n caption=\"Lines 15-20 from Counter.tsx\"\n/>"
292
277
  },
293
278
  {
294
279
  "name": "With Highlighted Lines",
295
- "description": "Emphasizes specific lines of code",
280
+ "description": "Marks the lines the prose is talking about.",
296
281
  "code": "<CodeBlock code={`import { useState } from 'react';\n\nfunction Counter() {\n const [count, setCount] = useState(0);\n\n return (\n <button onClick={() => setCount(c => c + 1)}>\n Count: {count}\n </button>\n );\n}`} language=\"tsx\" showLineNumbers highlightLines={[4, '7-9']} />"
297
282
  },
298
283
  {
299
284
  "name": "Diff View",
300
- "description": "Shows added and removed lines in a diff-like format",
285
+ "description": "Added and removed lines, side by side with the rest.",
301
286
  "code": "<CodeBlock\n code={`import { useState } from 'react';\nimport { useCallback } from 'react';\n\nfunction Counter() {\n const [count, setCount] = useState(0);\n const increment = () => setCount(c => c + 1);\n const increment = useCallback(() => setCount(c => c + 1), []);\n\n return <button onClick={increment}>Count: {count}</button>;\n}`}\n language=\"tsx\"\n showLineNumbers\n removedLines={[6]}\n addedLines={[2, 7]}\n/>"
302
287
  },
303
288
  {
304
- "name": "GitHub Dark Theme",
305
- "description": "Using the GitHub Dark theme",
289
+ "name": "Custom Theme",
290
+ "description": "Any Shiki theme works — pass its name to theme.",
306
291
  "code": "<CodeBlock\n code={`async function fetchUser(id: string) {\n const response = await fetch(\\`/api/users/\\${id}\\`);\n return response.json();\n}`}\n language=\"typescript\"\n theme=\"github-dark\"\n/>"
307
292
  },
308
- {
309
- "name": "GitHub Light Theme",
310
- "description": "Using the GitHub Light theme for light backgrounds",
311
- "code": "<CodeBlock\n code={`def fibonacci(n):\n if n <= 1:\n return n\n return fibonacci(n - 1) + fibonacci(n - 2)`}\n language=\"python\"\n theme=\"github-light\"\n/>"
312
- },
313
- {
314
- "name": "Dracula Theme",
315
- "description": "Using the popular Dracula theme",
316
- "code": "<CodeBlock\n code={`fn main() {\n println!(\"Hello, Rust!\");\n}`}\n language=\"rust\"\n theme=\"dracula\"\n/>"
317
- },
318
293
  {
319
294
  "name": "Word Wrap",
320
- "description": "Long lines wrap instead of scrolling horizontally",
295
+ "description": "Long lines break instead of scrolling sideways.",
321
296
  "code": "<CodeBlock\n code={`const longString = \"This is a very long string that would normally cause horizontal scrolling, but with word wrap enabled it will break to the next line instead.\";`}\n language=\"typescript\"\n wordWrap\n/>"
322
297
  },
323
298
  {
324
299
  "name": "Max Height with Scroll",
325
- "description": "Constrains height with scrollable content",
300
+ "description": "Caps the height so one snippet cannot own the page.",
326
301
  "code": "<CodeBlock\n code={`// This code block has a maximum height\nfunction processItems(items: string[]) {\n const results = [];\n for (const item of items) {\n if (item.startsWith('_')) {\n continue;\n }\n const processed = item.trim().toLowerCase();\n if (processed.length > 0) {\n results.push(processed);\n }\n }\n return results;\n}\n\nexport default processItems;`}\n language=\"typescript\"\n maxHeight={150}\n showLineNumbers\n/>"
327
302
  },
328
303
  {
329
304
  "name": "Collapsible",
330
- "description": "Long code that can be expanded/collapsed",
305
+ "description": "Shows the opening lines and hides the rest behind a toggle.",
331
306
  "code": "<CodeBlock\n code={`import React, { useState, useEffect } from 'react';\n\ninterface User {\n id: string;\n name: string;\n email: string;\n avatar?: string;\n}\n\nexport function UserProfile({ userId }: { userId: string }) {\n const [user, setUser] = useState<User | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n async function fetchUser() {\n try {\n setLoading(true);\n const response = await fetch(\\`/api/users/\\${userId}\\`);\n if (!response.ok) throw new Error('Failed to fetch');\n const data = await response.json();\n setUser(data);\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Unknown error');\n } finally {\n setLoading(false);\n }\n }\n fetchUser();\n }, [userId]);\n\n if (loading) return <div>Loading...</div>;\n if (error) return <div>Error: {error}</div>;\n if (!user) return null;\n\n return (\n <div>\n <h1>{user.name}</h1>\n <p>{user.email}</p>\n </div>\n );\n}`}\n language=\"tsx\"\n showLineNumbers\n collapsible\n defaultCollapsed\n collapsedLines={8}\n/>"
332
307
  },
333
308
  {
334
309
  "name": "JSON",
335
- "description": "Configuration file example",
310
+ "description": "Config files highlight the same way source does.",
336
311
  "code": "<CodeBlock title=\"package.json\" code={`{\n \"name\": \"my-app\",\n \"dependencies\": {\n \"@usefragments/ui\": \"^0.3.0\"\n }\n}`} language=\"json\" />"
337
312
  },
338
313
  {
339
314
  "name": "Without Copy Button",
340
- "description": "Minimal display without copy functionality",
315
+ "description": "Drop the copy button when the snippet is not meant to be reused.",
341
316
  "code": "<CodeBlock code=\"const simple = true;\" language=\"typescript\" showCopy={false} />"
342
317
  }
343
318
  ],
@@ -357,7 +332,7 @@
357
332
  "propsSummary": [
358
333
  "code: string - required code content",
359
334
  "language: tsx|typescript|javascript|jsx|bash|shell|css|scss|sass|json|html|xml|markdown|md|yaml|yml|python|py|ruby|go|rust|java|kotlin|swift|c|cpp|csharp|php|sql|graphql|diff|plaintext",
360
- "theme: synthwave-84|github-dark|github-light|one-dark-pro|dracula|nord|monokai|vitesse-dark|vitesse-light|min-dark|min-light (default: one-dark-pro)",
335
+ "theme: css-variables|synthwave-84|github-dark|github-light|one-dark-pro|dracula|nord|monokai|vitesse-dark|vitesse-light|min-dark|min-light (default: css-variables)",
361
336
  "showCopy: boolean (default: true)",
362
337
  "copyPlacement: auto|header|overlay (default: auto)",
363
338
  "title: string - optional external label",
@@ -373,18 +348,13 @@
373
348
  "collapsible: boolean (default: false)",
374
349
  "defaultCollapsed: boolean (default: false)",
375
350
  "collapsedLines: number (default: 5)",
376
- "CodeBlock.Tabbed: tabs[] plus optional defaultTab/value/onValueChange for multi-language snippets"
351
+ "CodeBlock.Tabbed: tabs[] plus optional defaultTab/value/onValueChange for multi-language snippets; collapsible/defaultCollapsed/collapsedLines forward to every panel"
377
352
  ],
378
- "a11yRules": [
379
- "A11Y_CODE_SEMANTIC",
380
- "A11Y_BTN_LABEL"
381
- ]
353
+ "a11yRules": ["A11Y_CODE_SEMANTIC", "A11Y_BTN_LABEL"]
382
354
  },
383
355
  "ai": {
384
356
  "compositionPattern": "compound",
385
- "subComponents": [
386
- "Tabbed"
387
- ]
357
+ "subComponents": ["Tabbed"]
388
358
  },
389
359
  "provenance": {
390
360
  "source": "migrated",
@@ -7,7 +7,7 @@
7
7
  @use "../../recipes/typography" as typography;
8
8
 
9
9
  .container {
10
- --_fui-code-inline-inset: var(--fui-raw-space-16);
10
+ --_fui-code-inline-inset: var(--fui-raw-space-16, 16px);
11
11
 
12
12
  inline-size: 100%;
13
13
  }
@@ -27,9 +27,24 @@
27
27
  .wrapper {
28
28
  position: relative;
29
29
  overflow: hidden;
30
+ // A hairline keeps the block legible on any ground: the light code surface
31
+ // and the sunken app main share the same tone, so fill alone can vanish.
32
+ border: var(--fui-stroke-hairline, $fui-stroke-hairline) solid
33
+ var(--fui-code-border, var(--fui-border, #{$fui-border}));
30
34
  border-radius: var(--fui-radius-lg, $fui-radius-lg);
31
35
  background-color: var(--fui-code-bg, $fui-code-bg);
32
36
  color: var(--fui-code-text, var(--fui-text-primary, #{$fui-text-primary}));
37
+ --shiki-color-text: var(--fui-code-text, var(--fui-text-primary, #{$fui-text-primary}));
38
+ --shiki-color-background: var(--fui-code-bg, #{$fui-code-bg});
39
+ --shiki-token-keyword: var(--fui-code-token-keyword, #{$fui-code-token-keyword});
40
+ --shiki-token-string: var(--fui-code-token-string, #{$fui-code-token-string});
41
+ --shiki-token-string-expression: var(--fui-code-token-string, #{$fui-code-token-string});
42
+ --shiki-token-comment: var(--fui-code-token-comment, #{$fui-code-token-comment});
43
+ --shiki-token-function: var(--fui-code-token-function, #{$fui-code-token-function});
44
+ --shiki-token-constant: var(--fui-code-token-number, #{$fui-code-token-number});
45
+ --shiki-token-parameter: var(--fui-code-token-variable, #{$fui-code-token-variable});
46
+ --shiki-token-punctuation: var(--fui-code-token-punctuation, #{$fui-code-token-punctuation});
47
+ --shiki-token-link: var(--fui-link-ink, #{$fui-link-ink});
33
48
  }
34
49
 
35
50
  .header {
@@ -38,7 +53,7 @@
38
53
  justify-content: space-between;
39
54
  min-block-size: action.track("md");
40
55
  padding-inline: layout.gap("lg");
41
- border-block-end: var(--fui-stroke-hairline) solid
56
+ border-block-end: var(--fui-stroke-hairline, $fui-stroke-hairline) solid
42
57
  var(--fui-code-border, var(--fui-border, #{$fui-border}));
43
58
  }
44
59
 
@@ -94,13 +109,6 @@
94
109
  .copyOverlay.copied {
95
110
  opacity: 1;
96
111
  }
97
-
98
- .codeContainer :global(.shiki),
99
- .loading pre {
100
- padding-inline-end: calc(
101
- var(--_fui-code-inline-inset) + #{action.track("sm")} + var(--fui-raw-space-12)
102
- );
103
- }
104
112
  }
105
113
 
106
114
  .icon {
@@ -117,6 +125,18 @@
117
125
  opacity: 1;
118
126
  }
119
127
 
128
+ // Overlay + persistent copy both sit absolute — reserve trailing space so
129
+ // content-sized blocks don't collide with the control.
130
+ .withCopyOverlay,
131
+ .persistentCopyWrapper {
132
+ .codeContainer :global(.shiki),
133
+ .loading pre {
134
+ padding-inline-end: calc(
135
+ var(--_fui-code-inline-inset) + #{action.track("sm")} + var(--fui-raw-space-12, 12px)
136
+ );
137
+ }
138
+ }
139
+
120
140
  .loading pre,
121
141
  .codeContainer :global(.shiki) {
122
142
  @include prose.code-block("default");
@@ -152,7 +172,7 @@
152
172
  &:global(.highlighted) {
153
173
  margin-inline: calc(-1 * var(--_fui-code-inline-inset));
154
174
  padding-inline: var(--_fui-code-inline-inset);
155
- border-inline-start: var(--fui-stroke-default) solid
175
+ border-inline-start: var(--fui-stroke-default, $fui-stroke-default) solid
156
176
  var(--fui-color-info-text, $fui-color-info-text);
157
177
  background-color: var(--fui-code-highlight-bg, var(--fui-bg-hover, #{$fui-bg-hover}));
158
178
  }
@@ -174,7 +194,7 @@
174
194
  }
175
195
 
176
196
  :global(.shiki)::-webkit-scrollbar {
177
- block-size: var(--fui-raw-space-4);
197
+ block-size: var(--fui-raw-space-4, 4px);
178
198
  }
179
199
 
180
200
  :global(.shiki)::-webkit-scrollbar-thumb {
@@ -184,7 +204,7 @@
184
204
  }
185
205
 
186
206
  .withLineNumbers .codeContainer :global(.shiki) {
187
- padding-inline-start: var(--fui-raw-space-8);
207
+ padding-inline-start: var(--fui-raw-space-8, 8px);
188
208
  }
189
209
 
190
210
  .withDiff {
@@ -220,7 +240,7 @@
220
240
  }
221
241
 
222
242
  .compact {
223
- --_fui-code-inline-inset: var(--fui-raw-space-12);
243
+ --_fui-code-inline-inset: var(--fui-raw-space-12, 12px);
224
244
 
225
245
  .wrapper {
226
246
  border-radius: var(--fui-radius-md, $fui-radius-md);
@@ -250,8 +270,9 @@
250
270
  @include action.size("sm");
251
271
 
252
272
  inline-size: 100%;
253
- border-block-start: 0;
254
- background: linear-gradient(to bottom, transparent, var(--fui-code-bg, $fui-code-bg) 40%);
273
+ border-block-start: var(--fui-stroke-hairline, $fui-stroke-hairline) solid
274
+ var(--fui-border, $fui-border);
275
+ background: var(--fui-code-bg, $fui-code-bg);
255
276
  color: var(--fui-code-text-muted, var(--fui-text-secondary, #{$fui-text-secondary}));
256
277
  cursor: pointer;
257
278
 
@@ -266,6 +287,10 @@
266
287
  }
267
288
  }
268
289
 
290
+ .collapseExpand {
291
+ justify-content: flex-end;
292
+ }
293
+
269
294
  .tabbedPanel {
270
295
  margin-block-start: 0;
271
296
  }
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Shiki theme whose token colors are CSS variables from the kit palette.
3
+ *
4
+ * Bundled shiki themes (including the old `css-variables` theme) were removed
5
+ * from shiki 3; this object is the replacement. `codeToHtml` accepts it as the
6
+ * `theme` option and writes `color: var(--fui-code-token-*)` onto spans.
7
+ */
8
+ export const FUI_CSS_VARIABLES_THEME = {
9
+ name: "css-variables",
10
+ type: "dark" as const,
11
+ colors: {
12
+ "editor.foreground": "var(--fui-code-text)",
13
+ "editor.background": "var(--fui-code-bg)",
14
+ },
15
+ tokenColors: [
16
+ { settings: { foreground: "var(--fui-code-text)" } },
17
+ {
18
+ scope: [
19
+ "comment",
20
+ "punctuation.definition.comment",
21
+ "string.comment",
22
+ "string.quoted.docstring.multi",
23
+ ],
24
+ settings: { foreground: "var(--fui-code-token-comment)" },
25
+ },
26
+ {
27
+ scope: [
28
+ "keyword",
29
+ "keyword.control",
30
+ "keyword.other",
31
+ "storage",
32
+ "storage.type",
33
+ "storage.modifier",
34
+ "storage.control.clojure",
35
+ ],
36
+ settings: { foreground: "var(--fui-code-token-keyword)" },
37
+ },
38
+ {
39
+ scope: [
40
+ "string",
41
+ "string.quoted",
42
+ "string.template",
43
+ "string.interpolated",
44
+ "string.regexp",
45
+ "string.unquoted.plain.out.yaml",
46
+ "markup.inline",
47
+ ],
48
+ settings: { foreground: "var(--fui-code-token-string)" },
49
+ },
50
+ {
51
+ scope: [
52
+ "constant.numeric",
53
+ "constant.language",
54
+ "constant.other",
55
+ "constant.character.format.placeholder",
56
+ "constant.other.placeholder",
57
+ ],
58
+ settings: { foreground: "var(--fui-code-token-number)" },
59
+ },
60
+ {
61
+ scope: [
62
+ "entity.name.function",
63
+ "support.function",
64
+ "meta.function-call",
65
+ "meta.instance.constructor",
66
+ "entity.other.attribute-name",
67
+ "entity.name.tag",
68
+ "support.class.component",
69
+ "meta.tag",
70
+ ],
71
+ settings: { foreground: "var(--fui-code-token-function)" },
72
+ },
73
+ {
74
+ scope: [
75
+ "punctuation",
76
+ "punctuation.separator",
77
+ "punctuation.definition.arguments",
78
+ "punctuation.definition.dict",
79
+ "punctuation.definition.string",
80
+ "punctuation.definition.template-expression",
81
+ "meta.brace",
82
+ "keyword.operator",
83
+ "keyword.operator.accessor",
84
+ ],
85
+ settings: { foreground: "var(--fui-code-token-punctuation)" },
86
+ },
87
+ {
88
+ scope: [
89
+ "variable",
90
+ "variable.other",
91
+ "variable.parameter",
92
+ "variable.language",
93
+ "entity.name",
94
+ "support.variable",
95
+ "support.type",
96
+ "meta.property-name",
97
+ "meta.property-value",
98
+ ],
99
+ settings: { foreground: "var(--fui-code-token-variable)" },
100
+ },
101
+ ],
102
+ };