@once-ui-system/core 1.8.4 → 2.0.0-alpha.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 (561) hide show
  1. package/ai/catalog.json +166 -78
  2. package/ai/components/Accordion.json +1 -1
  3. package/ai/components/BarChart.json +34 -3
  4. package/ai/components/Book.json +128 -0
  5. package/ai/components/Button.json +1 -1
  6. package/ai/components/Card.json +1 -0
  7. package/ai/components/Carousel.json +1 -1
  8. package/ai/components/ChartHeader.json +2 -1
  9. package/ai/components/ChartStatus.json +2 -1
  10. package/ai/components/Checkbox.json +2 -2
  11. package/ai/components/CodeBlock.json +23 -2
  12. package/ai/components/ColorInput.json +1 -1
  13. package/ai/components/DataTooltip.json +3 -2
  14. package/ai/components/DatePicker.json +2 -2
  15. package/ai/components/Dialog.json +1 -1
  16. package/ai/components/DropdownWrapper.json +6 -4
  17. package/ai/components/Effect.json +133 -0
  18. package/ai/components/Fade.json +1 -1
  19. package/ai/components/Feedback.json +1 -1
  20. package/ai/components/IconButton.json +1 -1
  21. package/ai/components/InfoTip.json +125 -0
  22. package/ai/components/Input.json +5 -4
  23. package/ai/components/Legend.json +2 -1
  24. package/ai/components/LineBarChart.json +34 -3
  25. package/ai/components/LineChart.json +39 -3
  26. package/ai/components/LinearGauge.json +3 -2
  27. package/ai/components/LinearGradient.json +2 -1
  28. package/ai/components/Logo.json +2 -2
  29. package/ai/components/Media.json +1 -1
  30. package/ai/components/MediaUpload.json +21 -2
  31. package/ai/components/Modal.json +1 -1
  32. package/ai/components/NavGroup.json +130 -0
  33. package/ai/components/NavIcon.json +1 -1
  34. package/ai/components/NavItem.json +14 -0
  35. package/ai/components/Option.json +2 -2
  36. package/ai/components/Particle.json +1 -1
  37. package/ai/components/PieChart.json +32 -3
  38. package/ai/components/ProgressBar.json +1 -1
  39. package/ai/components/Pulse.json +1 -1
  40. package/ai/components/RadialGauge.json +4 -3
  41. package/ai/components/RadialGradient.json +2 -1
  42. package/ai/components/RadioButton.json +1 -1
  43. package/ai/components/RevealFx.json +1 -1
  44. package/ai/components/Scrubber.json +136 -0
  45. package/ai/components/SegmentedControl.json +3 -3
  46. package/ai/components/Setting.json +128 -0
  47. package/ai/components/SettingAxes.json +127 -0
  48. package/ai/components/SettingGroup.json +129 -0
  49. package/ai/components/ShineFx.json +1 -1
  50. package/ai/components/Skeleton.json +2 -3
  51. package/ai/components/SplitView.json +2 -0
  52. package/ai/components/StylePanel.json +4 -2
  53. package/ai/components/Swatch.json +11 -0
  54. package/ai/components/Swiper.json +1 -1
  55. package/ai/components/Switch.json +1 -1
  56. package/ai/components/Tag.json +1 -1
  57. package/ai/components/Textarea.json +6 -5
  58. package/ai/components/ThemeSwitcher.json +3 -0
  59. package/ai/components/Toast.json +1 -1
  60. package/ai/components/ToggleButton.json +2 -1
  61. package/ai/eval-tasks.md +8 -0
  62. package/ai/examples/app-shell.tsx +111 -0
  63. package/ai/examples/auth.tsx +1 -1
  64. package/ai/examples/blocks/Dashboard1.tsx +17 -28
  65. package/ai/examples/blocks/Feed3.tsx +4 -4
  66. package/ai/examples/blocks/Footer1.tsx +5 -3
  67. package/ai/examples/blocks/Footer2.tsx +3 -3
  68. package/ai/examples/blocks/Footer3.tsx +1 -1
  69. package/ai/examples/blocks/Footer4.tsx +6 -5
  70. package/ai/examples/blocks/Header1.tsx +7 -6
  71. package/ai/examples/blocks/Header3.tsx +7 -7
  72. package/ai/examples/blocks/Header4.tsx +5 -5
  73. package/ai/examples/blocks/Sidebar4.tsx +1 -1
  74. package/ai/examples/blocks/Streaming1.tsx +4 -4
  75. package/ai/examples/blocks/Table1.tsx +6 -6
  76. package/ai/examples/blocks/Waitlist1.tsx +5 -5
  77. package/ai/examples/blocks/content/resources.ts +3 -1
  78. package/ai/examples/dashboard.tsx +8 -9
  79. package/ai/examples/marketing-hero.tsx +2 -2
  80. package/ai/examples/pricing.tsx +4 -5
  81. package/ai/examples/settings.tsx +3 -3
  82. package/ai/gotchas.json +80 -23
  83. package/ai/layouts.md +154 -0
  84. package/ai/manifest.json +3 -2
  85. package/ai/recipes.md +49 -4
  86. package/ai/rules.compact.md +18 -3
  87. package/ai/rules.md +68 -10
  88. package/ai/spec.json +634 -176
  89. package/dist/ai/catalog.json +166 -78
  90. package/dist/ai/components/Accordion.json +1 -1
  91. package/dist/ai/components/BarChart.json +34 -3
  92. package/dist/ai/components/Book.json +128 -0
  93. package/dist/ai/components/Button.json +1 -1
  94. package/dist/ai/components/Card.json +1 -0
  95. package/dist/ai/components/Carousel.json +1 -1
  96. package/dist/ai/components/ChartHeader.json +2 -1
  97. package/dist/ai/components/ChartStatus.json +2 -1
  98. package/dist/ai/components/Checkbox.json +2 -2
  99. package/dist/ai/components/CodeBlock.json +23 -2
  100. package/dist/ai/components/ColorInput.json +1 -1
  101. package/dist/ai/components/DataTooltip.json +3 -2
  102. package/dist/ai/components/DatePicker.json +2 -2
  103. package/dist/ai/components/Dialog.json +1 -1
  104. package/dist/ai/components/DropdownWrapper.json +6 -4
  105. package/dist/ai/components/Effect.json +133 -0
  106. package/dist/ai/components/Fade.json +1 -1
  107. package/dist/ai/components/Feedback.json +1 -1
  108. package/dist/ai/components/IconButton.json +1 -1
  109. package/dist/ai/components/InfoTip.json +125 -0
  110. package/dist/ai/components/Input.json +5 -4
  111. package/dist/ai/components/Legend.json +2 -1
  112. package/dist/ai/components/LineBarChart.json +34 -3
  113. package/dist/ai/components/LineChart.json +39 -3
  114. package/dist/ai/components/LinearGauge.json +3 -2
  115. package/dist/ai/components/LinearGradient.json +2 -1
  116. package/dist/ai/components/Logo.json +2 -2
  117. package/dist/ai/components/Media.json +1 -1
  118. package/dist/ai/components/MediaUpload.json +21 -2
  119. package/dist/ai/components/Modal.json +1 -1
  120. package/dist/ai/components/NavGroup.json +130 -0
  121. package/dist/ai/components/NavIcon.json +1 -1
  122. package/dist/ai/components/NavItem.json +14 -0
  123. package/dist/ai/components/Option.json +2 -2
  124. package/dist/ai/components/Particle.json +1 -1
  125. package/dist/ai/components/PieChart.json +32 -3
  126. package/dist/ai/components/ProgressBar.json +1 -1
  127. package/dist/ai/components/Pulse.json +1 -1
  128. package/dist/ai/components/RadialGauge.json +4 -3
  129. package/dist/ai/components/RadialGradient.json +2 -1
  130. package/dist/ai/components/RadioButton.json +1 -1
  131. package/dist/ai/components/RevealFx.json +1 -1
  132. package/dist/ai/components/Scrubber.json +136 -0
  133. package/dist/ai/components/SegmentedControl.json +3 -3
  134. package/dist/ai/components/Setting.json +128 -0
  135. package/dist/ai/components/SettingAxes.json +127 -0
  136. package/dist/ai/components/SettingGroup.json +129 -0
  137. package/dist/ai/components/ShineFx.json +1 -1
  138. package/dist/ai/components/Skeleton.json +2 -3
  139. package/dist/ai/components/SplitView.json +2 -0
  140. package/dist/ai/components/StylePanel.json +4 -2
  141. package/dist/ai/components/Swatch.json +11 -0
  142. package/dist/ai/components/Swiper.json +1 -1
  143. package/dist/ai/components/Switch.json +1 -1
  144. package/dist/ai/components/Tag.json +1 -1
  145. package/dist/ai/components/Textarea.json +6 -5
  146. package/dist/ai/components/ThemeSwitcher.json +3 -0
  147. package/dist/ai/components/Toast.json +1 -1
  148. package/dist/ai/components/ToggleButton.json +2 -1
  149. package/dist/ai/eval-tasks.md +8 -0
  150. package/dist/ai/gotchas.json +80 -23
  151. package/dist/ai/layouts.md +154 -0
  152. package/dist/ai/manifest.json +3 -2
  153. package/dist/ai/recipes.md +49 -4
  154. package/dist/ai/rules.compact.md +18 -3
  155. package/dist/ai/rules.md +68 -10
  156. package/dist/ai/spec.json +634 -176
  157. package/dist/components/Accordion.d.ts +2 -1
  158. package/dist/components/Accordion.d.ts.map +1 -1
  159. package/dist/components/Accordion.js.map +1 -1
  160. package/dist/components/Avatar.js +1 -1
  161. package/dist/components/Avatar.js.map +1 -1
  162. package/dist/components/Background.d.ts +6 -6
  163. package/dist/components/Background.d.ts.map +1 -1
  164. package/dist/components/Book.d.ts +28 -0
  165. package/dist/components/Book.d.ts.map +1 -0
  166. package/dist/components/Book.js +24 -0
  167. package/dist/components/Book.js.map +1 -0
  168. package/dist/components/Book.module.scss +45 -0
  169. package/dist/components/Button.d.ts +1 -1
  170. package/dist/components/Button.d.ts.map +1 -1
  171. package/dist/components/Button.js +4 -4
  172. package/dist/components/Button.js.map +1 -1
  173. package/dist/components/Card.d.ts +8 -0
  174. package/dist/components/Card.d.ts.map +1 -1
  175. package/dist/components/Card.js +10 -2
  176. package/dist/components/Card.js.map +1 -1
  177. package/dist/components/Card.module.scss +11 -1
  178. package/dist/components/Carousel.d.ts +7 -1
  179. package/dist/components/Carousel.d.ts.map +1 -1
  180. package/dist/components/Carousel.js +7 -7
  181. package/dist/components/Carousel.js.map +1 -1
  182. package/dist/components/Carousel.module.scss +1 -8
  183. package/dist/components/Checkbox.d.ts +3 -3
  184. package/dist/components/Checkbox.d.ts.map +1 -1
  185. package/dist/components/Checkbox.js +5 -5
  186. package/dist/components/Checkbox.js.map +1 -1
  187. package/dist/components/ClientFlex.d.ts.map +1 -1
  188. package/dist/components/ClientFlex.js +5 -10
  189. package/dist/components/ClientFlex.js.map +1 -1
  190. package/dist/components/ClientGrid.d.ts.map +1 -1
  191. package/dist/components/ClientGrid.js +2 -7
  192. package/dist/components/ClientGrid.js.map +1 -1
  193. package/dist/components/ColorInput.d.ts +1 -1
  194. package/dist/components/ColorInput.d.ts.map +1 -1
  195. package/dist/components/ColorInput.js +7 -13
  196. package/dist/components/ColorInput.js.map +1 -1
  197. package/dist/components/CompareImage.d.ts.map +1 -1
  198. package/dist/components/CompareImage.js +2 -2
  199. package/dist/components/CompareImage.js.map +1 -1
  200. package/dist/components/DateInput.d.ts.map +1 -1
  201. package/dist/components/DateInput.js +10 -1
  202. package/dist/components/DateInput.js.map +1 -1
  203. package/dist/components/DatePicker.d.ts +2 -2
  204. package/dist/components/DatePicker.d.ts.map +1 -1
  205. package/dist/components/DatePicker.js +21 -14
  206. package/dist/components/DatePicker.js.map +1 -1
  207. package/dist/components/DateRangeInput.js +3 -3
  208. package/dist/components/DateRangeInput.js.map +1 -1
  209. package/dist/components/Dialog.d.ts +1 -1
  210. package/dist/components/Dialog.d.ts.map +1 -1
  211. package/dist/components/Dialog.js +14 -14
  212. package/dist/components/Dialog.js.map +1 -1
  213. package/dist/components/DropdownWrapper.d.ts +8 -3
  214. package/dist/components/DropdownWrapper.d.ts.map +1 -1
  215. package/dist/components/DropdownWrapper.js +17 -6
  216. package/dist/components/DropdownWrapper.js.map +1 -1
  217. package/dist/components/Effect.d.ts +41 -0
  218. package/dist/components/Effect.d.ts.map +1 -0
  219. package/dist/components/Effect.js +30 -0
  220. package/dist/components/Effect.js.map +1 -0
  221. package/dist/components/ElementType.d.ts +2 -1
  222. package/dist/components/ElementType.d.ts.map +1 -1
  223. package/dist/components/ElementType.js +4 -2
  224. package/dist/components/ElementType.js.map +1 -1
  225. package/dist/components/EmojiPicker.d.ts.map +1 -1
  226. package/dist/components/EmojiPicker.js +1 -1
  227. package/dist/components/EmojiPicker.js.map +1 -1
  228. package/dist/components/Feedback.d.ts +1 -1
  229. package/dist/components/Feedback.d.ts.map +1 -1
  230. package/dist/components/Feedback.js +2 -2
  231. package/dist/components/Feedback.js.map +1 -1
  232. package/dist/components/Flex.d.ts.map +1 -1
  233. package/dist/components/Flex.js +46 -5
  234. package/dist/components/Flex.js.map +1 -1
  235. package/dist/components/Icon.d.ts.map +1 -1
  236. package/dist/components/Icon.js.map +1 -1
  237. package/dist/components/IconButton.d.ts +1 -1
  238. package/dist/components/IconButton.d.ts.map +1 -1
  239. package/dist/components/IconButton.js +4 -4
  240. package/dist/components/IconButton.js.map +1 -1
  241. package/dist/components/InfoTip.d.ts +17 -0
  242. package/dist/components/InfoTip.d.ts.map +1 -0
  243. package/dist/components/InfoTip.js +12 -0
  244. package/dist/components/InfoTip.js.map +1 -0
  245. package/dist/components/Input.d.ts +11 -5
  246. package/dist/components/Input.d.ts.map +1 -1
  247. package/dist/components/Input.js +32 -16
  248. package/dist/components/Input.js.map +1 -1
  249. package/dist/components/Input.module.scss +313 -1
  250. package/dist/components/InteractiveDetails.d.ts.map +1 -1
  251. package/dist/components/InteractiveDetails.js +1 -1
  252. package/dist/components/InteractiveDetails.js.map +1 -1
  253. package/dist/components/Kbd.d.ts.map +1 -1
  254. package/dist/components/Kbd.js +4 -1
  255. package/dist/components/Kbd.js.map +1 -1
  256. package/dist/components/Logo.d.ts +16 -4
  257. package/dist/components/Logo.d.ts.map +1 -1
  258. package/dist/components/Logo.js +32 -14
  259. package/dist/components/Logo.js.map +1 -1
  260. package/dist/components/Media.d.ts +9 -2
  261. package/dist/components/Media.d.ts.map +1 -1
  262. package/dist/components/Media.js +25 -16
  263. package/dist/components/Media.js.map +1 -1
  264. package/dist/components/MediaAudioPlayer.d.ts +29 -0
  265. package/dist/components/MediaAudioPlayer.d.ts.map +1 -0
  266. package/dist/components/MediaAudioPlayer.js +115 -0
  267. package/dist/components/MediaAudioPlayer.js.map +1 -0
  268. package/dist/components/MediaAudioPlayer.module.scss +38 -0
  269. package/dist/components/Modal.d.ts +1 -1
  270. package/dist/components/Modal.d.ts.map +1 -1
  271. package/dist/components/Modal.js +10 -10
  272. package/dist/components/Modal.js.map +1 -1
  273. package/dist/components/NavGroup.d.ts +33 -0
  274. package/dist/components/NavGroup.d.ts.map +1 -0
  275. package/dist/components/NavGroup.js +27 -0
  276. package/dist/components/NavGroup.js.map +1 -0
  277. package/dist/components/NavIcon.d.ts +1 -1
  278. package/dist/components/NavIcon.d.ts.map +1 -1
  279. package/dist/components/NavIcon.js +2 -2
  280. package/dist/components/NavIcon.js.map +1 -1
  281. package/dist/components/NavItem.d.ts +24 -0
  282. package/dist/components/NavItem.d.ts.map +1 -0
  283. package/dist/components/NavItem.js +18 -0
  284. package/dist/components/NavItem.js.map +1 -0
  285. package/dist/components/NumberInput.js +1 -1
  286. package/dist/components/NumberInput.js.map +1 -1
  287. package/dist/components/OgCard.js +3 -3
  288. package/dist/components/OgCard.js.map +1 -1
  289. package/dist/components/Option.d.ts +3 -3
  290. package/dist/components/Option.d.ts.map +1 -1
  291. package/dist/components/Option.js +2 -2
  292. package/dist/components/Option.js.map +1 -1
  293. package/dist/components/Particle.d.ts +2 -2
  294. package/dist/components/Particle.d.ts.map +1 -1
  295. package/dist/components/PasswordInput.d.ts.map +1 -1
  296. package/dist/components/PasswordInput.js +2 -2
  297. package/dist/components/PasswordInput.js.map +1 -1
  298. package/dist/components/ProgressBar.d.ts +1 -1
  299. package/dist/components/ProgressBar.d.ts.map +1 -1
  300. package/dist/components/ProgressBar.js +2 -2
  301. package/dist/components/ProgressBar.js.map +1 -1
  302. package/dist/components/Pulse.d.ts +1 -1
  303. package/dist/components/Pulse.d.ts.map +1 -1
  304. package/dist/components/Pulse.js +2 -2
  305. package/dist/components/Pulse.js.map +1 -1
  306. package/dist/components/RadioButton.d.ts +2 -2
  307. package/dist/components/RadioButton.d.ts.map +1 -1
  308. package/dist/components/RadioButton.js +1 -1
  309. package/dist/components/RadioButton.js.map +1 -1
  310. package/dist/components/RevealFx.d.ts +2 -1
  311. package/dist/components/RevealFx.d.ts.map +1 -1
  312. package/dist/components/RevealFx.js +8 -8
  313. package/dist/components/RevealFx.js.map +1 -1
  314. package/dist/components/ScrollContainer.d.ts.map +1 -1
  315. package/dist/components/ScrollContainer.js +1 -1
  316. package/dist/components/ScrollContainer.js.map +1 -1
  317. package/dist/components/Scrubber.d.ts +70 -0
  318. package/dist/components/Scrubber.d.ts.map +1 -0
  319. package/dist/components/Scrubber.js +161 -0
  320. package/dist/components/Scrubber.js.map +1 -0
  321. package/dist/components/SegmentedControl.d.ts +4 -4
  322. package/dist/components/SegmentedControl.d.ts.map +1 -1
  323. package/dist/components/SegmentedControl.js +11 -11
  324. package/dist/components/SegmentedControl.js.map +1 -1
  325. package/dist/components/Select.d.ts.map +1 -1
  326. package/dist/components/Select.js +48 -15
  327. package/dist/components/Select.js.map +1 -1
  328. package/dist/components/ServerFlex.d.ts +0 -1
  329. package/dist/components/ServerFlex.d.ts.map +1 -1
  330. package/dist/components/ServerFlex.js +99 -52
  331. package/dist/components/ServerFlex.js.map +1 -1
  332. package/dist/components/ServerGrid.d.ts +0 -1
  333. package/dist/components/ServerGrid.d.ts.map +1 -1
  334. package/dist/components/ServerGrid.js +11 -9
  335. package/dist/components/ServerGrid.js.map +1 -1
  336. package/dist/components/Setting.d.ts +50 -0
  337. package/dist/components/Setting.d.ts.map +1 -0
  338. package/dist/components/Setting.js +43 -0
  339. package/dist/components/Setting.js.map +1 -0
  340. package/dist/components/ShineFx.d.ts +1 -0
  341. package/dist/components/ShineFx.d.ts.map +1 -1
  342. package/dist/components/ShineFx.js +2 -2
  343. package/dist/components/ShineFx.js.map +1 -1
  344. package/dist/components/Skeleton.d.ts +16 -3
  345. package/dist/components/Skeleton.d.ts.map +1 -1
  346. package/dist/components/Skeleton.js +2 -2
  347. package/dist/components/Skeleton.js.map +1 -1
  348. package/dist/components/Skeleton.module.scss +14 -51
  349. package/dist/components/SplitView.d.ts +23 -3
  350. package/dist/components/SplitView.d.ts.map +1 -1
  351. package/dist/components/SplitView.js +90 -58
  352. package/dist/components/SplitView.js.map +1 -1
  353. package/dist/components/StyleOverlay.d.ts.map +1 -1
  354. package/dist/components/StyleOverlay.js +1 -1
  355. package/dist/components/StyleOverlay.js.map +1 -1
  356. package/dist/components/StylePanel.d.ts +47 -6
  357. package/dist/components/StylePanel.d.ts.map +1 -1
  358. package/dist/components/StylePanel.js +16 -189
  359. package/dist/components/StylePanel.js.map +1 -1
  360. package/dist/components/StylePanel.module.scss +6 -1
  361. package/dist/components/StylePanelSections.d.ts +117 -0
  362. package/dist/components/StylePanelSections.d.ts.map +1 -0
  363. package/dist/components/StylePanelSections.js +175 -0
  364. package/dist/components/StylePanelSections.js.map +1 -0
  365. package/dist/components/Swiper.d.ts +7 -1
  366. package/dist/components/Swiper.d.ts.map +1 -1
  367. package/dist/components/Swiper.js +7 -7
  368. package/dist/components/Swiper.js.map +1 -1
  369. package/dist/components/Switch.d.ts +2 -2
  370. package/dist/components/Switch.d.ts.map +1 -1
  371. package/dist/components/Switch.js +4 -4
  372. package/dist/components/Switch.js.map +1 -1
  373. package/dist/components/Table.d.ts.map +1 -1
  374. package/dist/components/Table.js +2 -2
  375. package/dist/components/Table.js.map +1 -1
  376. package/dist/components/Tag.d.ts +1 -1
  377. package/dist/components/Tag.d.ts.map +1 -1
  378. package/dist/components/Tag.js +2 -2
  379. package/dist/components/Tag.js.map +1 -1
  380. package/dist/components/Textarea.d.ts +15 -5
  381. package/dist/components/Textarea.d.ts.map +1 -1
  382. package/dist/components/Textarea.js +31 -17
  383. package/dist/components/Textarea.js.map +1 -1
  384. package/dist/components/ThemeSwitcher.d.ts +14 -1
  385. package/dist/components/ThemeSwitcher.d.ts.map +1 -1
  386. package/dist/components/ThemeSwitcher.js +19 -9
  387. package/dist/components/ThemeSwitcher.js.map +1 -1
  388. package/dist/components/ThemeSwitcher.module.scss +54 -0
  389. package/dist/components/Toast.d.ts +1 -1
  390. package/dist/components/Toast.d.ts.map +1 -1
  391. package/dist/components/Toast.js +2 -2
  392. package/dist/components/Toast.js.map +1 -1
  393. package/dist/components/ToggleButton.d.ts +9 -2
  394. package/dist/components/ToggleButton.d.ts.map +1 -1
  395. package/dist/components/ToggleButton.js +5 -5
  396. package/dist/components/ToggleButton.js.map +1 -1
  397. package/dist/components/User.js +1 -1
  398. package/dist/components/User.js.map +1 -1
  399. package/dist/components/index.d.ts +7 -0
  400. package/dist/components/index.d.ts.map +1 -1
  401. package/dist/components/index.js +7 -0
  402. package/dist/components/index.js.map +1 -1
  403. package/dist/contexts/AdapterProvider.d.ts +50 -0
  404. package/dist/contexts/AdapterProvider.d.ts.map +1 -0
  405. package/dist/contexts/AdapterProvider.js +91 -0
  406. package/dist/contexts/AdapterProvider.js.map +1 -0
  407. package/dist/contexts/IconProvider.d.ts +2 -2
  408. package/dist/contexts/IconProvider.d.ts.map +1 -1
  409. package/dist/contexts/IconProvider.js +2 -2
  410. package/dist/contexts/IconProvider.js.map +1 -1
  411. package/dist/contexts/LayoutProvider.d.ts +0 -2
  412. package/dist/contexts/LayoutProvider.d.ts.map +1 -1
  413. package/dist/contexts/LayoutProvider.js +15 -10
  414. package/dist/contexts/LayoutProvider.js.map +1 -1
  415. package/dist/contexts/ThemeProvider.d.ts +29 -1
  416. package/dist/contexts/ThemeProvider.d.ts.map +1 -1
  417. package/dist/contexts/ThemeProvider.js +42 -15
  418. package/dist/contexts/ThemeProvider.js.map +1 -1
  419. package/dist/contexts/index.d.ts +3 -2
  420. package/dist/contexts/index.d.ts.map +1 -1
  421. package/dist/contexts/index.js +3 -2
  422. package/dist/contexts/index.js.map +1 -1
  423. package/dist/css/styles.css +1 -1
  424. package/dist/css/tokens.css +1 -1
  425. package/dist/hooks/index.d.ts +0 -1
  426. package/dist/hooks/index.d.ts.map +1 -1
  427. package/dist/hooks/index.js +0 -1
  428. package/dist/hooks/index.js.map +1 -1
  429. package/dist/icons/ATTRIBUTION.md +19 -0
  430. package/dist/icons/data.d.ts +1919 -0
  431. package/dist/icons/data.d.ts.map +1 -0
  432. package/dist/icons/data.js +102 -0
  433. package/dist/icons/data.js.map +1 -0
  434. package/dist/icons/renderIcon.d.ts +26 -0
  435. package/dist/icons/renderIcon.d.ts.map +1 -0
  436. package/dist/icons/renderIcon.js +22 -0
  437. package/dist/icons/renderIcon.js.map +1 -0
  438. package/dist/icons.d.ts +35 -4
  439. package/dist/icons.d.ts.map +1 -1
  440. package/dist/icons.js +13 -60
  441. package/dist/icons.js.map +1 -1
  442. package/dist/modules/code/CodeBlock.impl.d.ts +2 -1
  443. package/dist/modules/code/CodeBlock.impl.d.ts.map +1 -1
  444. package/dist/modules/code/CodeBlock.impl.js +7 -2
  445. package/dist/modules/code/CodeBlock.impl.js.map +1 -1
  446. package/dist/modules/data/ChartHeader.d.ts.map +1 -1
  447. package/dist/modules/data/ChartHeader.js +1 -1
  448. package/dist/modules/data/ChartHeader.js.map +1 -1
  449. package/dist/modules/data/DataTooltip.d.ts +1 -1
  450. package/dist/modules/data/DataTooltip.d.ts.map +1 -1
  451. package/dist/modules/data/DataTooltip.js +2 -2
  452. package/dist/modules/data/DataTooltip.js.map +1 -1
  453. package/dist/modules/data/LinearGauge.d.ts +3 -2
  454. package/dist/modules/data/LinearGauge.d.ts.map +1 -1
  455. package/dist/modules/data/LinearGauge.js +1 -1
  456. package/dist/modules/data/LinearGauge.js.map +1 -1
  457. package/dist/modules/data/PieChart.impl.d.ts +1 -1
  458. package/dist/modules/data/PieChart.impl.d.ts.map +1 -1
  459. package/dist/modules/data/PieChart.impl.js +4 -1
  460. package/dist/modules/data/PieChart.impl.js.map +1 -1
  461. package/dist/modules/data/RadialGauge.d.ts +3 -2
  462. package/dist/modules/data/RadialGauge.d.ts.map +1 -1
  463. package/dist/modules/data/RadialGauge.js +1 -1
  464. package/dist/modules/data/RadialGauge.js.map +1 -1
  465. package/dist/modules/data/interfaces.d.ts +12 -3
  466. package/dist/modules/data/interfaces.d.ts.map +1 -1
  467. package/dist/modules/index.d.ts +1 -4
  468. package/dist/modules/index.d.ts.map +1 -1
  469. package/dist/modules/index.js +9 -3
  470. package/dist/modules/index.js.map +1 -1
  471. package/dist/modules/media/MediaUpload.impl.d.ts +1 -1
  472. package/dist/modules/media/MediaUpload.impl.d.ts.map +1 -1
  473. package/dist/modules/media/MediaUpload.impl.js +1 -1
  474. package/dist/modules/media/MediaUpload.impl.js.map +1 -1
  475. package/dist/modules/navigation/Kbar.d.ts +5 -4
  476. package/dist/modules/navigation/Kbar.d.ts.map +1 -1
  477. package/dist/modules/navigation/Kbar.js +32 -35
  478. package/dist/modules/navigation/Kbar.js.map +1 -1
  479. package/dist/modules/navigation/MegaMenu.d.ts +5 -3
  480. package/dist/modules/navigation/MegaMenu.d.ts.map +1 -1
  481. package/dist/modules/navigation/MegaMenu.js +24 -12
  482. package/dist/modules/navigation/MegaMenu.js.map +1 -1
  483. package/dist/modules/navigation/MobileMegaMenu.d.ts +3 -2
  484. package/dist/modules/navigation/MobileMegaMenu.d.ts.map +1 -1
  485. package/dist/modules/navigation/MobileMegaMenu.js +1 -1
  486. package/dist/modules/navigation/MobileMegaMenu.js.map +1 -1
  487. package/dist/modules/seo/Meta.d.ts +40 -2
  488. package/dist/modules/seo/Meta.d.ts.map +1 -1
  489. package/dist/modules/seo/Meta.js.map +1 -1
  490. package/dist/modules/seo/Schema.d.ts.map +1 -1
  491. package/dist/modules/seo/Schema.js +1 -2
  492. package/dist/modules/seo/Schema.js.map +1 -1
  493. package/dist/next/index.d.ts +35 -0
  494. package/dist/next/index.d.ts.map +1 -0
  495. package/dist/next/index.js +56 -0
  496. package/dist/next/index.js.map +1 -0
  497. package/dist/package.json +52 -7
  498. package/dist/scripts/init-agent.js +0 -0
  499. package/dist/scripts/validate-ai-code.js +74 -10
  500. package/dist/server/og-utils.d.ts +9 -3
  501. package/dist/server/og-utils.d.ts.map +1 -1
  502. package/dist/server/og-utils.js +15 -9
  503. package/dist/server/og-utils.js.map +1 -1
  504. package/dist/styles/breakpoints.scss +16 -5
  505. package/dist/test/setup.js +21 -0
  506. package/dist/test/setup.js.map +1 -1
  507. package/dist/types.d.ts +13 -1
  508. package/dist/types.d.ts.map +1 -1
  509. package/dist/types.js.map +1 -1
  510. package/dist/utils/colorScheme.d.ts +35 -0
  511. package/dist/utils/colorScheme.d.ts.map +1 -0
  512. package/dist/utils/colorScheme.js +140 -0
  513. package/dist/utils/colorScheme.js.map +1 -0
  514. package/dist/utils/index.d.ts +2 -0
  515. package/dist/utils/index.d.ts.map +1 -1
  516. package/dist/utils/index.js +2 -0
  517. package/dist/utils/index.js.map +1 -1
  518. package/dist/utils/navMatch.d.ts +21 -0
  519. package/dist/utils/navMatch.d.ts.map +1 -0
  520. package/dist/utils/navMatch.js +26 -0
  521. package/dist/utils/navMatch.js.map +1 -0
  522. package/package.json +228 -171
  523. package/scripts/init-agent.js +0 -0
  524. package/scripts/validate-ai-code.js +74 -10
  525. package/LICENSE.md +0 -21
  526. package/dist/css/styles.css.map +0 -1
  527. package/dist/css/tokens.css.map +0 -1
  528. package/dist/hooks/useResponsiveClasses.d.ts +0 -9
  529. package/dist/hooks/useResponsiveClasses.d.ts.map +0 -1
  530. package/dist/hooks/useResponsiveClasses.js +0 -293
  531. package/dist/hooks/useResponsiveClasses.js.map +0 -1
  532. package/dist/styles/background.scss +0 -423
  533. package/dist/styles/border.scss +0 -546
  534. package/dist/styles/color.scss +0 -183
  535. package/dist/styles/display.scss +0 -391
  536. package/dist/styles/flex.scss +0 -518
  537. package/dist/styles/global.scss +0 -36
  538. package/dist/styles/grid.scss +0 -293
  539. package/dist/styles/index.scss +0 -14
  540. package/dist/styles/position.scss +0 -1549
  541. package/dist/styles/shadow.scss +0 -19
  542. package/dist/styles/size.scss +0 -53
  543. package/dist/styles/spacing.scss +0 -1505
  544. package/dist/styles/typography.scss +0 -223
  545. package/dist/styles/utilities.scss +0 -23
  546. package/dist/tokens/border.scss +0 -95
  547. package/dist/tokens/data.scss +0 -107
  548. package/dist/tokens/function.scss +0 -742
  549. package/dist/tokens/index.scss +0 -8
  550. package/dist/tokens/layout.scss +0 -275
  551. package/dist/tokens/scheme.scss +0 -352
  552. package/dist/tokens/shadow.scss +0 -7
  553. package/dist/tokens/theme.scss +0 -657
  554. package/dist/tokens/typography.scss +0 -118
  555. package/next-env.d.ts +0 -5
  556. package/scripts/copy-files.js +0 -103
  557. package/scripts/generate-ai-spec.js +0 -464
  558. package/scripts/generate-emoji-data.js +0 -128
  559. package/scss.d.ts +0 -4
  560. package/tsconfig.vitest.json +0 -20
  561. package/vitest.config.ts +0 -19
@@ -1 +1,313 @@
1
- .base { backdrop-filter: var(--backdrop-filter); min-height: var(--static-space-56); &.focused, &.filled { border-color: var(--neutral-border-medium); } &:has(.placeholder):has(.floating) { .placeholder { padding-top: var(--static-space-12); } } } .resizeHandle { &::after { pointer-events: none; content: ''; position: absolute; right: 0; bottom: 0; width: var(--static-space-32); height: var(--static-space-32); border: 1px solid var(--neutral-border-strong); transform: translateX(50%) translateY(50%) rotate(45deg); background-color: var(--neutral-alpha-weak); } ::-webkit-resizer { display: none; } } .label { position: absolute; left: var(--static-space-16); transition: transform 0.3s, top 0.3s, left 0.3s; color: var(--neutral-on-background-medium); pointer-events: none; transform-origin: left; &.floating { transform: scale(0.75); } } .inputLabel { top: 50%; transform: translateY(-50%); } .textareaLabel { top: calc(var(--static-space-16) + var(--static-space-2)); } .xs { min-height: var(--static-space-40); .label, .textareaLabel { &.floating { top: calc(var(--static-space-4) - var(--static-space-1)); } } .inputLabel, .textareaLabel { &.floating { transform: scale(0.6); } } } .s { min-height: var(--static-space-48); .label, .textareaLabel { &.floating { top: calc(var(--static-space-4) - var(--static-space-1)); } } } .m { min-height: var(--static-space-56); .label, .textareaLabel { &.floating { top: calc(var(--static-space-8) - var(--static-space-2)); } } } .l { min-height: var(--static-space-64); .label { &.floating { top: calc(var(--static-space-8) - var(--static-space-2)); } } .textareaLabel { &.floating { top: var(--static-space-4); } } } .xl { min-height: var(--static-space-72); .label { &.floating { top: calc(var(--static-space-12) - var(--static-space-2)); } } .textareaLabel { &.floating { top: var(--static-space-4); } } } .input { width: 100%; height: 100%; border: none; background: none; color: var(--neutral-on-background-strong); padding: 0 var(--static-space-12); outline: none; border-radius: var(--radius-s); &.placeholder { padding-top: 0; } &.textarea.placeholder { padding-top: var(--static-space-12); padding-bottom: var(--static-space-12); } &:not(.placeholder) { padding-top: var(--static-space-16); } &.placeholder.hasChildren { padding-top: var(--static-space-16); } &::placeholder { color: var(--neutral-on-background-weak); } &:disabled { color: var(--neutral-on-background-weak); cursor: not-allowed; } &:autofill, &:-webkit-autofill { background-color: var(--static-transparent) !important; -webkit-box-shadow: 0 0 0 var(--static-space-32) var(--neutral-background-medium) inset !important; -webkit-text-fill-color: var(--neutral-on-background-strong) !important; } } .error { .base { background-color: var(--danger-background-medium); border-color: var(--danger-border-medium); } .input, .prefix, .suffix { color: var(--danger-on-background-medium); } .label { color: var(--danger-on-background-weak); } .resizeHandle { &::after { border-color: var(--danger-border-medium); background-color: var(--danger-alpha-weak); } } } .prefix, .suffix { align-self: center; } .input[type="color"] { opacity: 0; }
1
+ /* Field metrics
2
+ ----------------------------------------------------------------------------
3
+ The floating label and the value are placed by where their INK falls — cap
4
+ height down to descender — rather than by their line boxes. A line box
5
+ carries invisible leading on both sides, so centring line boxes pays for
6
+ that leading twice: the pair drifts apart and the block rides high in the
7
+ field. Ratios below (cap 0.72em, ascender 0.80em, descender 0.20em) are
8
+ approximations that hold for Geist and most UI sans faces.
9
+
10
+ Two offsets here are structural rather than typographic. `.base` carries a
11
+ 1px border, and Input.tsx / Textarea.tsx render the inner Column with
12
+ padding="4". The label is absolutely positioned against that Column, so it
13
+ measures from the border edge; the value additionally clears the Column's
14
+ padding. Both are named below — if either changes in the TSX, change it
15
+ here too.
16
+
17
+ `--fld-gap` is the label-to-value distance in em of the value. xs and s keep
18
+ the base 0.25; m, l and xl take 0.375, which reads about 2px looser at each
19
+ of those sizes (m 4px to 6px, l 4.5 to 6.75, xl 5 to 7.5). The pair was
20
+ optically tight once the label actually floated — at the small sizes the
21
+ label is scaled down far enough that the base ratio still reads open. The
22
+ field height does not change: a taller ink block re-centres, so the label
23
+ rises by half the increase and the value drops by half.
24
+
25
+ On touch the value is clamped to 16px so iOS Safari does not zoom on focus,
26
+ and its line-height is clamped with it at 1.3 — Once UI's own body-s ratio is
27
+ 1.286, and any looser a floor would also lift sizes that never had a problem.
28
+ Flooring font-size alone would put
29
+ 16px glyphs in the 16.88px line box that body-s resolves to on mobile. */
30
+
31
+ /* Opt-in via the `focusRing` prop. Fields ship without one on purpose — the
32
+ look is the borderless native field Apple and Revolut settled on — but that
33
+ leaves a keyboard user with no indication of where they are, while `Card`
34
+ and `SmartLink` in this same library do show one. The ring is drawn on the
35
+ field rather than the control because the control sits inside the border and
36
+ the Column's padding, so its own outline would fall within the field.
37
+
38
+ Note that a text field matches `:focus-visible` however it was focused: the
39
+ pseudo-class always matches an element that takes keyboard input, so the
40
+ ring appears on a mouse click too. `:focus-visible` is still the right
41
+ selector — it is what the rest of the library uses, and it is what keeps
42
+ the ring off a field focused programmatically.
43
+
44
+ Two selectors, because focus lands in two places. A plain field focuses its
45
+ own control. `Select` moves focus off the trigger and into the dropdown, so
46
+ for most of the interaction the control is not the focused element at all —
47
+ it tracks focus across the whole widget instead and marks the wrapper, the
48
+ same descendant shape `.error .base` uses below. Same outline as the
49
+ `.focus-ring` utility either way, so an opted-in field matches every other
50
+ focusable thing on the page. */
51
+ .base.focusRing:has(.input:focus-visible),
52
+ .focused .base.focusRing {
53
+ outline: var(--static-space-2) solid var(--brand-solid-strong);
54
+ outline-offset: 2px;
55
+ }
56
+
57
+ .base {
58
+ --fld-border: 1px;
59
+ --fld-well: var(--static-space-4); /* Column padding="4" in the TSX */
60
+ --fld-gap: var(--fld-gap-loose, 0.25); /* label to value, in em of the value */
61
+
62
+ --fld-label-fs: calc(var(--font-size-label-m) * var(--font-size-label-multiplier));
63
+ --fld-label-lh: calc(var(--line-height-label-m) * var(--line-height-label-multiplier));
64
+
65
+ --fld-fs: var(--fld-fs-base);
66
+ --fld-lh: var(--fld-lh-base);
67
+ --fld-h: var(--fld-h-base);
68
+
69
+ --fld-cap-label: calc(var(--fld-label-fs) * 0.72 * var(--fld-label-scale));
70
+ --fld-cap-value: calc(var(--fld-fs) * 0.72);
71
+ --fld-desc-value: calc(var(--fld-fs) * 0.2);
72
+ --fld-gap-size: calc(var(--fld-fs) * var(--fld-gap));
73
+
74
+ --fld-ink: calc(
75
+ var(--fld-cap-label) + var(--fld-gap-size) + var(--fld-cap-value) + var(--fld-desc-value)
76
+ );
77
+
78
+ /* The box the value actually gets: the field less its border and the well. */
79
+ --fld-box: calc(var(--fld-h) - 2 * var(--fld-border) - 2 * var(--fld-well));
80
+ --fld-ink-top: calc((var(--fld-box) - var(--fld-ink)) / 2);
81
+
82
+ /* Inputs centre their ink in a fixed box; textareas grow, so they anchor to a
83
+ fixed top inset and share only the gap below the label. */
84
+ --fld-anchor: var(--fld-ink-top);
85
+
86
+ /* Distance from a text box's top edge to the cap height of its first line. */
87
+ --fld-lead-value: calc((var(--fld-lh) - var(--fld-fs)) / 2 + var(--fld-fs) * 0.08);
88
+ --fld-lead-label: calc(
89
+ ((var(--fld-label-lh) - var(--fld-label-fs)) / 2 + var(--fld-label-fs) * 0.08) *
90
+ var(--fld-label-scale)
91
+ );
92
+
93
+ --fld-label-top: calc(var(--fld-well) + var(--fld-anchor) - var(--fld-lead-label));
94
+ --fld-value-top: calc(
95
+ var(--fld-anchor) + var(--fld-cap-label) + var(--fld-gap-size) - var(--fld-lead-value)
96
+ );
97
+ /* A single-line <input> centres its text in its content box, so the box is
98
+ pinched to exactly one line — otherwise the padding above would only move
99
+ the text by half of itself and the ink would sit low. */
100
+ --fld-value-bottom: max(0px, calc(var(--fld-box) - var(--fld-value-top) - var(--fld-lh)));
101
+
102
+ backdrop-filter: var(--backdrop-filter);
103
+ min-height: var(--fld-h);
104
+
105
+ &:has(.textarea) {
106
+ --fld-anchor: var(--static-space-8);
107
+ }
108
+ }
109
+
110
+ @media (hover: none) and (pointer: coarse) {
111
+ .base {
112
+ --fld-fs: max(var(--fld-fs-base), 16px);
113
+ --fld-lh: max(var(--fld-lh-base), calc(var(--fld-fs) * 1.3));
114
+ --fld-h: max(var(--fld-h-base), var(--fld-h-touch));
115
+ }
116
+ }
117
+
118
+ .xs {
119
+ --fld-fs-base: calc(var(--font-size-body-s) * var(--font-size-body-multiplier));
120
+ --fld-lh-base: calc(var(--line-height-body-s) * var(--line-height-body-multiplier));
121
+ --fld-h-base: var(--static-space-40);
122
+ --fld-h-touch: 40px;
123
+ --fld-label-scale: 0.6;
124
+ --fld-inset: var(--static-space-12);
125
+ }
126
+
127
+ .s {
128
+ --fld-fs-base: calc(var(--font-size-body-s) * var(--font-size-body-multiplier));
129
+ --fld-lh-base: calc(var(--line-height-body-s) * var(--line-height-body-multiplier));
130
+ --fld-h-base: var(--static-space-48);
131
+ --fld-h-touch: 48px;
132
+ --fld-label-scale: 0.75;
133
+ --fld-inset: var(--static-space-12);
134
+ }
135
+
136
+ .m {
137
+ --fld-fs-base: calc(var(--font-size-body-m) * var(--font-size-body-multiplier));
138
+ --fld-lh-base: calc(var(--line-height-body-m) * var(--line-height-body-multiplier));
139
+ --fld-h-base: var(--static-space-56);
140
+ --fld-h-touch: 0px;
141
+ --fld-label-scale: 0.75;
142
+ --fld-gap-loose: 0.375;
143
+ --fld-inset: var(--static-space-16);
144
+ }
145
+
146
+ .l {
147
+ --fld-fs-base: calc(var(--font-size-body-l) * var(--font-size-body-multiplier));
148
+ --fld-lh-base: calc(var(--line-height-body-l) * var(--line-height-body-multiplier));
149
+ --fld-h-base: var(--static-space-64);
150
+ --fld-h-touch: 0px;
151
+ --fld-label-scale: 0.75;
152
+ --fld-gap-loose: 0.375;
153
+ --fld-inset: var(--static-space-16);
154
+ }
155
+
156
+ .xl {
157
+ --fld-fs-base: calc(var(--font-size-body-xl) * var(--font-size-body-multiplier));
158
+ --fld-lh-base: calc(var(--line-height-body-xl) * var(--line-height-body-multiplier));
159
+ --fld-h-base: var(--static-space-72);
160
+ --fld-h-touch: 0px;
161
+ --fld-label-scale: 0.75;
162
+ --fld-gap-loose: 0.375;
163
+ --fld-inset: var(--static-space-16);
164
+ }
165
+
166
+ .resizeHandle {
167
+ &::after {
168
+ pointer-events: none;
169
+ content: '';
170
+ position: absolute;
171
+ right: 0;
172
+ bottom: 0;
173
+ width: var(--static-space-32);
174
+ height: var(--static-space-32);
175
+ border: 1px solid var(--neutral-border-strong);
176
+ transform: translateX(50%) translateY(50%) rotate(45deg);
177
+ background-color: var(--neutral-alpha-weak);
178
+ }
179
+
180
+ ::-webkit-resizer {
181
+ display: none;
182
+ }
183
+ }
184
+
185
+ .label {
186
+ position: absolute;
187
+ left: var(--fld-inset);
188
+ transition: transform 0.3s, top 0.3s, left 0.3s;
189
+ color: var(--neutral-on-background-medium);
190
+ pointer-events: none;
191
+ /* `left top`, not the default `left center`: scaling about the top edge makes
192
+ the floating label's `top` its visual top, so the placement maths above can
193
+ be read directly off the value. */
194
+ transform-origin: left top;
195
+
196
+ &.floating {
197
+ transform: scale(var(--fld-label-scale));
198
+ }
199
+ }
200
+
201
+ .inputLabel {
202
+ top: 50%;
203
+ transform: translateY(-50%);
204
+
205
+ &.floating {
206
+ top: var(--fld-label-top);
207
+ }
208
+ }
209
+
210
+ .textareaLabel {
211
+ top: calc(var(--static-space-16) + var(--static-space-2));
212
+
213
+ &.floating {
214
+ top: var(--fld-label-top);
215
+ }
216
+ }
217
+
218
+ .input {
219
+ width: 100%;
220
+ height: 100%;
221
+ border: none;
222
+ background: none;
223
+ color: var(--neutral-on-background-strong);
224
+ font-size: var(--fld-fs);
225
+ line-height: var(--fld-lh);
226
+ /* The Column's padding already supplies `--fld-well` of the inset. */
227
+ padding: 0 calc(var(--fld-inset) - var(--fld-well));
228
+ outline: none;
229
+ border-radius: var(--radius-s);
230
+
231
+ &.textarea {
232
+ height: auto;
233
+ padding-bottom: var(--static-space-12);
234
+ }
235
+
236
+ &::placeholder {
237
+ color: var(--neutral-on-background-weak);
238
+ }
239
+
240
+ &:disabled {
241
+ color: var(--neutral-on-background-weak);
242
+ cursor: not-allowed;
243
+ }
244
+
245
+ &:autofill,
246
+ &:-webkit-autofill {
247
+ background-color: var(--static-transparent) !important;
248
+ -webkit-box-shadow: 0 0 0 var(--static-space-32) var(--neutral-background-medium) inset !important;
249
+ -webkit-text-fill-color: var(--neutral-on-background-strong) !important;
250
+ /* The browser fills the field without firing focus, blur or change, so
251
+ React never learns the field is no longer empty and the label stayed on
252
+ top of the filled text. An animation is the one event autofill does
253
+ emit: Input.tsx listens for it by name and sets the filled state. */
254
+ animation: onAutoFill 1ms;
255
+ }
256
+ }
257
+
258
+ /* The value only clears room for the label once the label is actually floating
259
+ above it — an input with no label keeps its text centred by the UA. */
260
+ .base:has(.label.floating) .input {
261
+ padding-top: var(--fld-value-top);
262
+
263
+ &:not(.textarea) {
264
+ padding-bottom: var(--fld-value-bottom);
265
+ }
266
+ }
267
+
268
+ .error {
269
+ .base {
270
+ background-color: var(--danger-background-medium);
271
+ border-color: var(--danger-border-medium);
272
+ }
273
+
274
+ .input,
275
+ .prefix,
276
+ .suffix {
277
+ color: var(--danger-on-background-medium);
278
+ }
279
+
280
+ .label {
281
+ color: var(--danger-on-background-weak);
282
+ }
283
+
284
+ .resizeHandle {
285
+ &::after {
286
+ border-color: var(--danger-border-medium);
287
+ background-color: var(--danger-alpha-weak);
288
+ }
289
+ }
290
+ }
291
+
292
+ .prefix,
293
+ .suffix {
294
+ align-self: center;
295
+ }
296
+
297
+ .input[type="color"] {
298
+ opacity: 0;
299
+ }
300
+
301
+ /* Inert by design — the animation exists only so autofill announces itself,
302
+ and nothing reads `--fld-autofill`. A custom property is animated rather
303
+ than a real one so the keyframes cannot fight any declared style, and the
304
+ duration is non-zero so `animationstart` is guaranteed to fire. */
305
+ @keyframes onAutoFill {
306
+ from {
307
+ --fld-autofill: 0;
308
+ }
309
+
310
+ to {
311
+ --fld-autofill: 1;
312
+ }
313
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"InteractiveDetails.d.ts","sourceRoot":"","sources":["../../src/components/InteractiveDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAA4B,eAAe,EAAO,MAAM,GAAG,CAAC;AAEnE,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAiCxD,CAAC;AAIH,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"InteractiveDetails.d.ts","sourceRoot":"","sources":["../../src/components/InteractiveDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAA4B,eAAe,EAAO,MAAM,GAAG,CAAC;AAEnE,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAkCxD,CAAC;AAIH,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef } from "react";
4
4
  import { Text, Column, IconButton, Row } from ".";
5
5
  const InteractiveDetails = forwardRef(({ label, description, iconButtonProps, onClick, className, id, disabled }, ref) => {
6
- return (_jsxs(Column, { ref: ref, cursor: disabled ? "not-allowed" : undefined, className: className, onClick: onClick, id: id, children: [_jsxs(Row, { gap: "4", vertical: "center", children: [_jsx(Text, { as: "span", variant: "label-default-m", onBackground: disabled ? "neutral-weak" : "neutral-strong", children: label }), iconButtonProps?.tooltip && (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsx(IconButton, { size: "s", variant: "ghost", icon: "help", ...iconButtonProps }) }))] }), description && (_jsx(Text, { as: "span", variant: "body-default-s", onBackground: "neutral-weak", children: description }))] }));
6
+ return (_jsxs(Column, { ref: ref, cursor: disabled ? "not-allowed" : undefined, className: className, onClick: onClick, id: id, children: [_jsxs(Row, { gap: "4", vertical: "center", children: [_jsx(Text, { as: "span", variant: "label-default-m", onBackground: disabled ? "neutral-weak" : "neutral-strong", children: label }), iconButtonProps?.tooltip && (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsx(IconButton, { size: "s", variant: "ghost", icon: "help", "aria-label": "More information", ...iconButtonProps }) }))] }), description && (_jsx(Text, { as: "span", variant: "body-default-s", onBackground: "neutral-weak", children: description }))] }));
7
7
  });
8
8
  InteractiveDetails.displayName = "InteractiveDetails";
9
9
  export { InteractiveDetails };
@@ -1 +1 @@
1
- {"version":3,"file":"InteractiveDetails.js","sourceRoot":"","sources":["../../src/components/InteractiveDetails.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAmB,GAAG,EAAE,MAAM,GAAG,CAAC;AAYnE,MAAM,kBAAkB,GAAsC,UAAU,CAGtE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAE;IACnF,OAAO,CACL,MAAC,MAAM,IACL,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAC5C,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,aAEN,MAAC,GAAG,IAAC,GAAG,EAAC,GAAG,EAAC,QAAQ,EAAC,QAAQ,aAC5B,KAAC,IAAI,IACH,EAAE,EAAC,MAAM,EACT,OAAO,EAAC,iBAAiB,EACzB,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CA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AM,EACT,OAAO,EAAC,iBAAiB,EACzB,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,gBAAgB,YAEzD,KAAK,GACD,EACN,eAAe,EAAE,OAAO,IAAI,CAC3B,cAAK,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,YACtC,KAAC,UAAU,IAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,gBACvC,kBAAkB,KAAK,eAAe,GAAI,GAC/C,CACP,IACG,EACL,WAAW,IAAI,CACd,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,gBAAgB,EAAC,YAAY,EAAC,cAAc,YACjE,WAAW,GACP,CACR,IACM,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../src/components/Kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,IAAI,EAAQ,MAAM,GAAG,CAAC;AAE/B,UAAU,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,GAAG,8FAsBR,CAAC;AAIF,OAAO,EAAE,GAAG,EAAE,CAAC;AACf,YAAY,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../src/components/Kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,IAAI,EAAQ,MAAM,GAAG,CAAC;AAE/B,UAAU,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,GAAG,8FA0BR,CAAC;AAIF,OAAO,EAAE,GAAG,EAAE,CAAC;AACf,YAAY,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,7 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Flex, Text } from ".";
4
- const Kbd = forwardRef(({ label, children, className, style, ...rest }, ref) => (_jsx(Flex, { as: "kbd", ref: ref, horizontal: "center", minWidth: "32", background: "neutral-strong", radius: "s", paddingX: "4", paddingY: "2", onBackground: "neutral-medium", border: "neutral-strong", className: className, style: style, ...rest, children: _jsx(Text, { as: "span", variant: "label-default-s", children: label || children }) })));
4
+ const Kbd = forwardRef(({ label, children, className, style, ...rest }, ref) => (_jsx(Flex, { as: "kbd", ref: ref,
5
+ // A <kbd> belongs in a sentence. Flex is display: flex, so without this
6
+ // one every Kbd in prose broke the line and filled the column.
7
+ inline: true, fit: true, horizontal: "center", minWidth: "32", background: "neutral-strong", radius: "s", paddingX: "4", paddingY: "2", onBackground: "neutral-medium", border: "neutral-strong", className: className, style: style, ...rest, children: _jsx(Text, { as: "span", variant: "label-default-s", children: label || children }) })));
5
8
  Kbd.displayName = "Kbd";
6
9
  export { Kbd };
7
10
  //# sourceMappingURL=Kbd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Kbd.js","sourceRoot":"","sources":["../../src/components/Kbd.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QACN,GAAG,QACH,UAAU,EAAC,QAAQ,EACnB,QAAQ,EAAC,IAAI,EACb,UAAU,EAAC,gBAAgB,EAC3B,MAAM,EAAC,GAAG,EACV,QAAQ,EAAC,GAAG,EACZ,QAAQ,EAAC,GAAG,EACZ,YAAY,EAAC,gBAAgB,EAC7B,MAAM,EAAC,gBAAgB,EACvB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,KACR,IAAI,YAER,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,iBAAiB,YACtC,KAAK,IAAI,QAAQ,GACb,GACF,CACR,CACF,CAAC;AAEF,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,CAAC"}
@@ -1,11 +1,23 @@
1
- import React from "react";
2
- import { TShirtSizes } from "../types";
1
+ import type React from "react";
2
+ import type { TShirtSizes } from "../types";
3
+ /**
4
+ * A single asset, or one per theme.
5
+ *
6
+ * Passing `{ light, dark }` renders both and lets CSS pick, so one `<Logo>`
7
+ * covers both themes. Before this you had to render the component twice —
8
+ * once with `light`, once with `dark` — which meant eight elements for four
9
+ * client logos in a row, and two places to keep in sync for every change.
10
+ */
11
+ type LogoSource = string | {
12
+ light: string;
13
+ dark: string;
14
+ };
3
15
  interface LogoProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
4
16
  className?: string;
5
17
  size?: TShirtSizes;
6
18
  style?: React.CSSProperties;
7
- icon?: string;
8
- wordmark?: string;
19
+ icon?: LogoSource;
20
+ wordmark?: LogoSource;
9
21
  href?: string;
10
22
  dark?: boolean;
11
23
  light?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../src/components/Logo.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAgB,WAAW,EAAE,MAAM,UAAU,CAAC;AAYrD,UAAU,SAAU,SAAQ,KAAK,CAAC,oBA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,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C;AAED,QAAA,MAAM,IAAI,kFA8LT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -1,10 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useEffect, forwardRef } from "react";
4
- import Link from "next/link";
5
3
  import classNames from "clsx";
6
- import { Flex, ContextMenu, Option, Icon, Column, Line } from ".";
7
- import { useToast } from "../contexts";
4
+ import { forwardRef, useEffect } from "react";
5
+ import { useAdapters, useToast } from "../contexts";
6
+ import { Column, ContextMenu, Flex, Icon, Line, Option } from ".";
8
7
  const sizeMap = {
9
8
  xs: "20",
10
9
  s: "24",
@@ -18,14 +17,33 @@ const Logo = forwardRef(({ size = "m", href, icon, wordmark, className, style, d
18
17
  console.warn("Both 'icon' and 'wordmark' props are set to false. The logo will not render any content.");
19
18
  }
20
19
  }, [icon, wordmark]);
21
- const content = (_jsxs(_Fragment, { children: [icon && (_jsx("img", { style: {
22
- height: `var(--static-space-${sizeMap[size]})`,
23
- width: "auto",
24
- }, alt: "Trademark", src: icon })), wordmark && (_jsx("img", { style: {
25
- height: `var(--static-space-${sizeMap[size]})`,
26
- width: "auto",
27
- }, alt: "Trademark", src: wordmark }))] }));
20
+ /**
21
+ * One <img> for a plain source; for a per-theme source, both, each gated by
22
+ * the same light-flex / dark-flex classes the `light` and `dark` props use.
23
+ * Rendering both rather than reading the theme at runtime keeps the
24
+ * component server-renderable and avoids a flash on first paint.
25
+ */
26
+ /**
27
+ * The copy-to-clipboard actions need one concrete file. A per-theme source
28
+ * has two, so they take the light asset — the one a brand page shows by
29
+ * default and the one someone pasting a logo almost always wants.
30
+ */
31
+ const resolveSource = (source) => typeof source === "string" ? source : source?.light;
32
+ const renderSource = (source) => {
33
+ if (!source)
34
+ return null;
35
+ const imgStyle = {
36
+ height: `var(--static-space-${sizeMap[size]})`,
37
+ width: "auto",
38
+ };
39
+ if (typeof source === "string") {
40
+ return _jsx("img", { style: imgStyle, alt: "Trademark", src: source });
41
+ }
42
+ return (_jsxs(_Fragment, { children: [_jsx("img", { className: "light-flex", style: imgStyle, alt: "Trademark", src: source.light }), _jsx("img", { className: "dark-flex", style: imgStyle, alt: "Trademark", src: source.dark })] }));
43
+ };
44
+ const content = (_jsxs(_Fragment, { children: [renderSource(icon), renderSource(wordmark)] }));
28
45
  const { addToast } = useToast();
46
+ const { Link } = useAdapters();
29
47
  const copyIconToClipboard = async () => {
30
48
  if (!icon) {
31
49
  addToast({
@@ -35,7 +53,7 @@ const Logo = forwardRef(({ size = "m", href, icon, wordmark, className, style, d
35
53
  return;
36
54
  }
37
55
  try {
38
- const response = await fetch(icon);
56
+ const response = await fetch(resolveSource(icon));
39
57
  const svgText = await response.text();
40
58
  await navigator.clipboard.writeText(svgText);
41
59
  addToast({
@@ -60,7 +78,7 @@ const Logo = forwardRef(({ size = "m", href, icon, wordmark, className, style, d
60
78
  return;
61
79
  }
62
80
  try {
63
- const response = await fetch(wordmark);
81
+ const response = await fetch(resolveSource(wordmark));
64
82
  const svgText = await response.text();
65
83
  await navigator.clipboard.writeText(svgText);
66
84
  addToast({
@@ -77,7 +95,7 @@ const Logo = forwardRef(({ size = "m", href, icon, wordmark, className, style, d
77
95
  }
78
96
  };
79
97
  const renderDropdownContent = () => {
80
- return (_jsxs(Column, { fillWidth: true, children: [_jsxs(Column, { fillWidth: true, padding: "4", gap: "4", children: [brand?.copy && icon && (_jsx(Option, { value: "copy-icon", label: "Copy icon as SVG", hasPrefix: _jsx(Logo, { size: "xs", icon: icon, style: { opacity: 0.5 } }), onClick: copyIconToClipboard })), brand?.copy && wordmark && (_jsx(Option, { value: "copy-wordmark", label: "Copy wordmark as SVG", hasPrefix: _jsx(Icon, { size: "xs", onBackground: "neutral-weak", name: "wordmark" }), onClick: copyWordmarkToClipboard }))] }), brand?.url && (_jsxs(_Fragment, { children: [_jsx(Line, {}), _jsx(Column, { fillWidth: true, padding: "4", children: _jsx(Option, { value: "brand-guidelines", label: "Visit brand guidelines", hasPrefix: _jsx(Icon, { size: "xs", onBackground: "neutral-weak", name: "arrowUpRight" }), href: brand.url }) })] }))] }));
98
+ return (_jsxs(Column, { fillWidth: true, children: [_jsxs(Column, { fillWidth: true, padding: "4", gap: "4", children: [brand?.copy && icon && (_jsx(Option, { value: "copy-icon", label: "Copy icon as SVG", prefix: _jsx(Logo, { size: "xs", icon: icon, style: { opacity: 0.5 } }), onClick: copyIconToClipboard })), brand?.copy && wordmark && (_jsx(Option, { value: "copy-wordmark", label: "Copy wordmark as SVG", prefix: _jsx(Icon, { size: "xs", onBackground: "neutral-weak", name: "wordmark" }), onClick: copyWordmarkToClipboard }))] }), brand?.url && (_jsxs(_Fragment, { children: [_jsx(Line, {}), _jsx(Column, { fillWidth: true, padding: "4", children: _jsx(Option, { value: "brand-guidelines", label: "Visit brand guidelines", prefix: _jsx(Icon, { size: "xs", onBackground: "neutral-weak", name: "arrowUpRight" }), href: brand.url }) })] }))] }));
81
99
  };
82
100
  const enableContext = brand && ((brand.copy && (icon || wordmark)) || brand.url);
83
101
  const renderLogo = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../src/components/Logo.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,UAAU,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,GAAiC;IAC5C,EAAE,EAAE,IAAI;IACR,CAAC,EAAE,IAAI;IACP,CAAC,E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C;QACJ,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,aAAa,CAAC,CAAC,CAAC,CACrB,KAAC,WAAW,IAAC,QAAQ,EAAE,qBAAqB,EAAE,EAAE,SAAS,EAAC,cAAc,YACrE,UAAU,EAAE,GACD,CACf,CAAC,CAAC,CAAC,CACF,UAAU,EAAE,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
- import React, { CSSProperties, ReactNode } from "react";
1
+ import type React from "react";
2
+ import { type CSSProperties, type ReactNode } from "react";
2
3
  import { Flex } from ".";
3
4
  export interface MediaProps extends React.ComponentProps<typeof Flex> {
4
5
  aspectRatio?: string;
@@ -12,7 +13,13 @@ export interface MediaProps extends React.ComponentProps<typeof Flex> {
12
13
  sizes?: string | number;
13
14
  priority?: boolean;
14
15
  caption?: ReactNode;
15
- fill?: boolean;
16
+ /**
17
+ * Drop the intrinsic aspect ratio and let the media stretch to whatever box
18
+ * it is in. Named `stretch` rather than `fill` because `fill` is a layout
19
+ * prop on every Flex-derived component (fillWidth + fillHeight) and shadowing
20
+ * it here meant `<Media fill />` did not do the one thing its name promised.
21
+ */
22
+ stretch?: boolean;
16
23
  fillWidth?: boolean;
17
24
  loop?: boolean;
18
25
  autoplay?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Media.d.ts","sourceRoot":"","sources":["../../src/components/Media.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,aAAa,EAA+B,SAAS,EAAc,MAAM,OAAO,CAAC;AACjG,OAAO,EAAU,IAAI,EAA6B,MAAM,GAAG,CAAC;AAK5D,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CA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C,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,KAAK,gGAgQV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useState, useRef, useEffect, forwardRef } from "react";
4
- import { Column, Flex, Row, Skeleton, ScrollLock } from ".";
5
- import { MediaVideoPlayer } from "./MediaVideoPlayer";
6
- import Image from "next/image";
7
3
  import classNames from "clsx";
8
- const Media = forwardRef(({ src, alt = "", fillWidth = true, fill = false, loading = false, enlarge = false, unoptimized = false, objectFit = "cover", sizes = "100vw", aspectRatio = "original", height, priority, caption, loop = true, autoplay = true, sound = false, controls = false, style, className, ...rest }, ref) => {
4
+ import { forwardRef, useEffect, useRef, useState } from "react";
5
+ import { useAdapters } from "../contexts/AdapterProvider";
6
+ import { Column, Flex, Row, ScrollLock, Skeleton } from ".";
7
+ import { MediaVideoPlayer } from "./MediaVideoPlayer";
8
+ const Media = forwardRef(({ src, alt = "", fillWidth = true, stretch = false, loading = false, enlarge = false, unoptimized = false, objectFit = "cover", sizes = "100vw", aspectRatio = "original", height, priority, caption, loop = true, autoplay = true, sound = false, controls = false, style, className, ...rest }, ref) => {
9
+ const { Image } = useAdapters();
9
10
  const [isEnlarged, setIsEnlarged] = useState(false);
10
11
  const imageRef = useRef(null);
11
12
  const handleImageClick = () => {
@@ -59,11 +60,11 @@ const Media = forwardRef(({ src, alt = "", fillWidth = true, fill = false, loadi
59
60
  };
60
61
  };
61
62
  const isYouTubeVideo = (url) => {
62
- const youtubeRegex = /(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/;
63
+ const youtubeRegex = /(?:youtube\.com\/(?:[^/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/;
63
64
  return youtubeRegex.test(url);
64
65
  };
65
66
  const getYouTubeEmbedUrl = (url) => {
66
- const match = url.match(/(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);
67
+ const match = url.match(/(?:youtube\.com\/(?:[^/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);
67
68
  if (!match)
68
69
  return "";
69
70
  const id = match[1];
@@ -86,30 +87,38 @@ const Media = forwardRef(({ src, alt = "", fillWidth = true, fill = false, loadi
86
87
  const isYouTube = isYouTubeVideo(src);
87
88
  const useCustomVideoControls = isVideo && controls;
88
89
  const canEnlarge = enlarge && !useCustomVideoControls;
89
- const resolvedSizes = typeof sizes === "number"
90
- ? `(max-width: ${sizes}px) 100vw, ${sizes}px`
91
- : sizes;
92
- return (_jsxs(_Fragment, { children: [_jsx(ScrollLock, { enabled: isEnlarged }), isEnlarged && canEnlarge && typeof document !== 'undefined' && (_jsx(Flex, { center: true, position: "fixed", background: "overlay", pointerEvents: "auto", onClick: handleOverlayClick, top: "0", left: "0", zIndex: 9, opacity: 100, cursor: "interactive", transition: "macro-medium", className: "cursor-interactive", style: {
90
+ const resolvedSizes = typeof sizes === "number" ? `(max-width: ${sizes}px) 100vw, ${sizes}px` : sizes;
91
+ return (_jsxs(_Fragment, { children: [_jsx(ScrollLock, { enabled: isEnlarged }), isEnlarged && canEnlarge && typeof document !== "undefined" && (_jsx(Flex, { center: true, position: "fixed", background: "overlay", pointerEvents: "auto", onClick: handleOverlayClick, top: "0", left: "0", zIndex: 9, opacity: 100, cursor: "interactive", transition: "macro-medium", className: "cursor-interactive", style: {
93
92
  backdropFilter: "blur(0.5rem)",
94
93
  width: "100vw",
95
94
  height: "100vh",
96
- } })), _jsxs(_Fragment, { children: [_jsxs(Column, { as: caption ? "figure" : undefined, ref: imageRef, fillWidth: true, overflow: "hidden", zIndex: 0, margin: "0", style: {
95
+ } })), _jsxs(_Fragment, { children: [_jsxs(Column, { as: caption ? "figure" : undefined, ref: imageRef, fillWidth: fillWidth, overflow: "hidden", zIndex: 0, margin: "0", style: {
97
96
  outline: "none",
98
97
  isolation: "isolate",
99
- height: aspectRatio === "original" ? undefined : aspectRatio ? "" : height ? `${height}rem` : "100%",
98
+ height: aspectRatio === "original"
99
+ ? undefined
100
+ : aspectRatio
101
+ ? ""
102
+ : height
103
+ ? `${height}rem`
104
+ : "100%",
100
105
  aspectRatio: aspectRatio === "original" ? undefined : aspectRatio,
101
106
  borderRadius: isEnlarged ? "0" : undefined,
102
107
  ...calculateTransform(),
103
108
  ...style,
104
- }, onClick: handleImageClick, className: classNames(canEnlarge && !isEnlarged ? "cursor-zoom-in" : canEnlarge && isEnlarged ? "cursor-zoom-out" : undefined, className), ...rest, children: [loading && _jsx(Skeleton, { shape: "block", radius: rest.radius }), !loading && isVideo && useCustomVideoControls && (_jsx(MediaVideoPlayer, { src: src, autoplay: autoplay, loop: loop, muted: !sound, objectFit: objectFit })), !loading && isVideo && !useCustomVideoControls && (_jsx("video", { src: src, autoPlay: autoplay, loop: loop, muted: !sound, playsInline: true, style: {
109
+ }, onClick: handleImageClick, className: classNames(canEnlarge && !isEnlarged
110
+ ? "cursor-zoom-in"
111
+ : canEnlarge && isEnlarged
112
+ ? "cursor-zoom-out"
113
+ : undefined, className), ...rest, children: [loading && _jsx(Skeleton, { shape: "block", radius: rest.radius }), !loading && isVideo && useCustomVideoControls && (_jsx(MediaVideoPlayer, { src: src, autoplay: autoplay, loop: loop, muted: !sound, objectFit: objectFit })), !loading && isVideo && !useCustomVideoControls && (_jsx("video", { src: src, autoPlay: autoplay, loop: loop, muted: !sound, playsInline: true, style: {
105
114
  width: "100%",
106
115
  height: "100%",
107
116
  objectFit: objectFit,
108
117
  } })), !loading && isYouTube && (_jsx("iframe", { width: "100%", height: "100%", src: getYouTubeEmbedUrl(src), frameBorder: "0", allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, style: {
109
118
  objectFit: objectFit,
110
- } })), !loading && !isVideo && !isYouTube && (_jsx(Image, { src: src, alt: alt, sizes: isEnlarged ? "100vw" : resolvedSizes, priority: priority, unoptimized: unoptimized, fill: fill || !aspectRatio, width: fill ? undefined : 0, height: fill ? undefined : 0, style: {
119
+ } })), !loading && !isVideo && !isYouTube && (_jsx(Image, { src: src, alt: alt, sizes: isEnlarged ? "100vw" : resolvedSizes, priority: priority, unoptimized: unoptimized, fill: stretch || !aspectRatio, width: stretch ? undefined : 0, height: stretch ? undefined : 0, style: {
111
120
  objectFit: objectFit,
112
- aspectRatio: fill ? undefined : aspectRatio,
121
+ aspectRatio: stretch ? undefined : aspectRatio,
113
122
  width: aspectRatio ? "100%" : undefined,
114
123
  height: aspectRatio ? "100%" : undefined,
115
124
  } }))] }), caption && (_jsx(Row, { as: "figcaption", fillWidth: true, textVariant: "label-default-s", onBackground: "neutral-weak", paddingY: "12", paddingX: "24", horizontal: "center", align: "center", children: caption }))] })] }));