@zyncat/ui 0.13.0 → 0.15.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 (440) hide show
  1. package/README.md +72 -13
  2. package/dist/alert.css +26 -33
  3. package/dist/alert.js +18 -17
  4. package/dist/alert.js.map +1 -1
  5. package/dist/avatar-group.js +2 -2
  6. package/dist/avatar-group.js.map +1 -1
  7. package/dist/avatar.css +51 -50
  8. package/dist/avatar.js +29 -7
  9. package/dist/avatar.js.map +1 -1
  10. package/dist/badge.css +30 -36
  11. package/dist/badge.js +1 -1
  12. package/dist/button.css +80 -96
  13. package/dist/button.js +1 -1
  14. package/dist/checkbox.css +27 -32
  15. package/dist/checkbox.js +2 -2
  16. package/dist/{chunk-RJFGWJ4W.js → chunk-3XRVPCIM.js} +6 -6
  17. package/dist/chunk-3XRVPCIM.js.map +1 -0
  18. package/dist/{chunk-M43IOM5C.js → chunk-5GBV45YD.js} +3 -3
  19. package/dist/{chunk-M43IOM5C.js.map → chunk-5GBV45YD.js.map} +1 -1
  20. package/dist/{chunk-45R4Z5XN.js → chunk-5VC3TUZ2.js} +4 -4
  21. package/dist/{chunk-45R4Z5XN.js.map → chunk-5VC3TUZ2.js.map} +1 -1
  22. package/dist/{chunk-A5WTZACK.js → chunk-5W5TKANX.js} +3 -3
  23. package/dist/{chunk-A5WTZACK.js.map → chunk-5W5TKANX.js.map} +1 -1
  24. package/dist/{chunk-AADAJL7D.js → chunk-5X3MJRIM.js} +8 -9
  25. package/dist/chunk-5X3MJRIM.js.map +1 -0
  26. package/dist/{chunk-TCUCYFT7.js → chunk-6SUHSSOK.js} +3 -3
  27. package/dist/{chunk-TCUCYFT7.js.map → chunk-6SUHSSOK.js.map} +1 -1
  28. package/dist/{chunk-DDRSMHN4.js → chunk-6X3G4GIM.js} +3 -3
  29. package/dist/{chunk-DDRSMHN4.js.map → chunk-6X3G4GIM.js.map} +1 -1
  30. package/dist/{chunk-TYHR4VNM.js → chunk-AREEMG47.js} +10 -8
  31. package/dist/chunk-AREEMG47.js.map +1 -0
  32. package/dist/{chunk-EF6RPXU7.js → chunk-BH4JFWXQ.js} +36 -31
  33. package/dist/chunk-BH4JFWXQ.js.map +1 -0
  34. package/dist/{chunk-TVYH4AN7.js → chunk-BTF6DAE3.js} +13 -13
  35. package/dist/chunk-BTF6DAE3.js.map +1 -0
  36. package/dist/{chunk-CF4QHO4N.js → chunk-CAXQJSIE.js} +10 -10
  37. package/dist/{chunk-CF4QHO4N.js.map → chunk-CAXQJSIE.js.map} +1 -1
  38. package/dist/{chunk-4C5RZXBT.js → chunk-CFRGQJ23.js} +8 -8
  39. package/dist/chunk-CFRGQJ23.js.map +1 -0
  40. package/dist/{chunk-IJS7TPGV.js → chunk-FEXUS4SV.js} +6 -5
  41. package/dist/chunk-FEXUS4SV.js.map +1 -0
  42. package/dist/{chunk-227ZW4V7.js → chunk-FLQVOSFC.js} +11 -11
  43. package/dist/chunk-FLQVOSFC.js.map +1 -0
  44. package/dist/{chunk-FONOS5RN.js → chunk-FVPNICF4.js} +11 -10
  45. package/dist/chunk-FVPNICF4.js.map +1 -0
  46. package/dist/{chunk-I45AU6KH.js → chunk-GGDAMIBH.js} +13 -7
  47. package/dist/chunk-GGDAMIBH.js.map +1 -0
  48. package/dist/{chunk-4BSHB7R3.js → chunk-GJTHWB6O.js} +9 -9
  49. package/dist/chunk-GJTHWB6O.js.map +1 -0
  50. package/dist/{chunk-EAI4POPB.js → chunk-GOLSYGRA.js} +45 -75
  51. package/dist/chunk-GOLSYGRA.js.map +1 -0
  52. package/dist/chunk-H3X2263Y.js +17 -0
  53. package/dist/chunk-H3X2263Y.js.map +1 -0
  54. package/dist/chunk-K45CWVHS.js +53 -0
  55. package/dist/chunk-K45CWVHS.js.map +1 -0
  56. package/dist/{chunk-JY6A2ZJZ.js → chunk-LNAV5E7S.js} +2 -2
  57. package/dist/{chunk-JY6A2ZJZ.js.map → chunk-LNAV5E7S.js.map} +1 -1
  58. package/dist/{chunk-TUTXXC3W.js → chunk-MDSRZ4QR.js} +3 -3
  59. package/dist/{chunk-TUTXXC3W.js.map → chunk-MDSRZ4QR.js.map} +1 -1
  60. package/dist/chunk-N2GJEO5Z.js +101 -0
  61. package/dist/chunk-N2GJEO5Z.js.map +1 -0
  62. package/dist/chunk-PU3QWBEL.js +39 -0
  63. package/dist/chunk-PU3QWBEL.js.map +1 -0
  64. package/dist/{chunk-43M6GQ4Q.js → chunk-PWQVSVXR.js} +51 -32
  65. package/dist/chunk-PWQVSVXR.js.map +1 -0
  66. package/dist/chunk-QGVFFT2B.js +14 -0
  67. package/dist/chunk-QGVFFT2B.js.map +1 -0
  68. package/dist/{chunk-5PZ43DCG.js → chunk-RBSHRRNO.js} +12 -13
  69. package/dist/chunk-RBSHRRNO.js.map +1 -0
  70. package/dist/{chunk-XNIYSAMJ.js → chunk-RW2A4M2Q.js} +14 -9
  71. package/dist/chunk-RW2A4M2Q.js.map +1 -0
  72. package/dist/{chunk-HY5MPISE.js → chunk-UYSXJ7MH.js} +9 -9
  73. package/dist/chunk-UYSXJ7MH.js.map +1 -0
  74. package/dist/chunk-VDOBLABP.js +38 -0
  75. package/dist/chunk-VDOBLABP.js.map +1 -0
  76. package/dist/chunk-VNVVG47J.js +12 -0
  77. package/dist/chunk-VNVVG47J.js.map +1 -0
  78. package/dist/{chunk-3MPF7FZV.js → chunk-WCWV5IX6.js} +3 -3
  79. package/dist/{chunk-3MPF7FZV.js.map → chunk-WCWV5IX6.js.map} +1 -1
  80. package/dist/{chunk-VAXCXZ53.js → chunk-WZUTBJC4.js} +5 -4
  81. package/dist/chunk-WZUTBJC4.js.map +1 -0
  82. package/dist/cli.js +137 -25
  83. package/dist/collapse.css +15 -30
  84. package/dist/collapse.js +1 -1
  85. package/dist/confetti.css +19 -12
  86. package/dist/confetti.js +7 -6
  87. package/dist/confetti.js.map +1 -1
  88. package/dist/count-badge.js +2 -2
  89. package/dist/date-field.js +20 -19
  90. package/dist/date-field.js.map +1 -1
  91. package/dist/date-picker.css +131 -154
  92. package/dist/date-range-field.js +55 -54
  93. package/dist/date-range-field.js.map +1 -1
  94. package/dist/datetime-field.js +24 -23
  95. package/dist/datetime-field.js.map +1 -1
  96. package/dist/dialog.css +31 -41
  97. package/dist/dialog.js +23 -22
  98. package/dist/dialog.js.map +1 -1
  99. package/dist/digit-strip.css +16 -16
  100. package/dist/dropdown.css +36 -27
  101. package/dist/dropdown.js +77 -40
  102. package/dist/dropdown.js.map +1 -1
  103. package/dist/emoji-picker.js +44 -45
  104. package/dist/emoji-picker.js.map +1 -1
  105. package/dist/facebook-feed.css +145 -148
  106. package/dist/facebook-feed.js +106 -102
  107. package/dist/facebook-feed.js.map +1 -1
  108. package/dist/flow-field.css +8 -4
  109. package/dist/flow-field.js +7 -6
  110. package/dist/flow-field.js.map +1 -1
  111. package/dist/glide.js +4 -3
  112. package/dist/icon.css +7 -10
  113. package/dist/input.css +76 -84
  114. package/dist/instagram-feed.css +65 -66
  115. package/dist/instagram-feed.js +61 -44
  116. package/dist/instagram-feed.js.map +1 -1
  117. package/dist/lens.css +42 -38
  118. package/dist/lens.js +17 -16
  119. package/dist/lens.js.map +1 -1
  120. package/dist/mcp.js +3 -2
  121. package/dist/menu-surface.css +54 -34
  122. package/dist/modal.css +2 -4
  123. package/dist/modal.js +12 -11
  124. package/dist/modal.js.map +1 -1
  125. package/dist/morphing-text.css +26 -16
  126. package/dist/morphing-text.js +14 -13
  127. package/dist/morphing-text.js.map +1 -1
  128. package/dist/motion-devtools.css +42 -68
  129. package/dist/motion-devtools.js +47 -39
  130. package/dist/motion-devtools.js.map +1 -1
  131. package/dist/motion-tokens.js +1 -1
  132. package/dist/multi-select.js +21 -16
  133. package/dist/multi-select.js.map +1 -1
  134. package/dist/number-field.js +14 -14
  135. package/dist/number-field.js.map +1 -1
  136. package/dist/odometer.css +22 -16
  137. package/dist/odometer.js +12 -11
  138. package/dist/odometer.js.map +1 -1
  139. package/dist/otp-field.js +3 -3
  140. package/dist/otp-field.js.map +1 -1
  141. package/dist/overlay.css +4 -9
  142. package/dist/pagination.css +10 -15
  143. package/dist/pagination.js +11 -10
  144. package/dist/pagination.js.map +1 -1
  145. package/dist/popover.css +13 -15
  146. package/dist/popover.js +10 -9
  147. package/dist/radio-group.css +60 -73
  148. package/dist/radio-group.js +30 -29
  149. package/dist/radio-group.js.map +1 -1
  150. package/dist/select.css +66 -75
  151. package/dist/select.js +19 -14
  152. package/dist/select.js.map +1 -1
  153. package/dist/sheet.css +12 -14
  154. package/dist/sheet.js +11 -10
  155. package/dist/status-badge.js +9 -9
  156. package/dist/status-badge.js.map +1 -1
  157. package/dist/styles.css +34 -34
  158. package/dist/support-rail.css +116 -100
  159. package/dist/support-rail.js +41 -40
  160. package/dist/support-rail.js.map +1 -1
  161. package/dist/table.css +76 -84
  162. package/dist/table.js +42 -41
  163. package/dist/table.js.map +1 -1
  164. package/dist/tabs.css +82 -90
  165. package/dist/tabs.js +23 -20
  166. package/dist/tabs.js.map +1 -1
  167. package/dist/tag.css +48 -53
  168. package/dist/tag.js +13 -12
  169. package/dist/tag.js.map +1 -1
  170. package/dist/text-field.js +5 -5
  171. package/dist/textarea.css +46 -49
  172. package/dist/textarea.js +16 -16
  173. package/dist/textarea.js.map +1 -1
  174. package/dist/theme.js +31 -15
  175. package/dist/theme.js.map +1 -1
  176. package/dist/tiktok.css +113 -117
  177. package/dist/tiktok.js +53 -52
  178. package/dist/tiktok.js.map +1 -1
  179. package/dist/time-field.js +26 -20
  180. package/dist/time-field.js.map +1 -1
  181. package/dist/toast-store.js +2 -1
  182. package/dist/toast.css +49 -65
  183. package/dist/toast.js +32 -26
  184. package/dist/toast.js.map +1 -1
  185. package/dist/toggle-tag.js +22 -13
  186. package/dist/toggle-tag.js.map +1 -1
  187. package/dist/toggle.css +26 -31
  188. package/dist/toggle.js +7 -7
  189. package/dist/toggle.js.map +1 -1
  190. package/dist/tooltip.css +16 -23
  191. package/dist/tooltip.js +117 -95
  192. package/dist/tooltip.js.map +1 -1
  193. package/dist/trigger.css +3 -3
  194. package/dist/types/components/composites/alert/Alert.d.ts +1 -2
  195. package/dist/types/components/composites/date-picker/TimeField.d.ts +1 -2
  196. package/dist/types/components/composites/date-picker/field-shell.d.ts +1 -1
  197. package/dist/types/components/composites/date-picker/time-core.d.ts +1 -2
  198. package/dist/types/components/composites/dropdown/Dropdown.d.ts +9 -1
  199. package/dist/types/components/composites/dropdown/types.d.ts +14 -0
  200. package/dist/types/components/composites/emoji-picker/EmojiPickerPanel.d.ts +1 -1
  201. package/dist/types/components/composites/emoji-picker/data.d.ts +2 -5
  202. package/dist/types/components/composites/emoji-picker/react/useEmojiPicker.d.ts +0 -11
  203. package/dist/types/components/composites/emoji-picker/types.d.ts +3 -8
  204. package/dist/types/components/composites/select/MultiSelect.d.ts +6 -1
  205. package/dist/types/components/composites/select/Select.d.ts +6 -1
  206. package/dist/types/components/composites/select/core/index.d.ts +1 -1
  207. package/dist/types/components/composites/select/core/menu.d.ts +3 -3
  208. package/dist/types/components/composites/select/core/panel.d.ts +3 -3
  209. package/dist/types/components/composites/tabs/Tabs.d.ts +7 -10
  210. package/dist/types/components/composites/toast/Toast.d.ts +1 -1
  211. package/dist/types/components/composites/tooltip/Tooltip.d.ts +9 -1
  212. package/dist/types/components/composites/tooltip/tooltip-store.d.ts +5 -6
  213. package/dist/types/components/dev/MotionDevtools.d.ts +3 -1
  214. package/dist/types/components/internal/hooks/use-host-election.d.ts +8 -0
  215. package/dist/types/components/internal/icon/Icon.d.ts +1 -3
  216. package/dist/types/components/internal/menu/highlight.d.ts +7 -0
  217. package/dist/types/components/internal/utils/activation.d.ts +0 -4
  218. package/dist/types/components/primitives/avatar/Avatar.d.ts +1 -1
  219. package/dist/types/components/primitives/button/Button.d.ts +1 -1
  220. package/dist/types/components/primitives/input/TextField.d.ts +1 -2
  221. package/dist/types/components/primitives/textarea/Textarea.d.ts +0 -1
  222. package/dist/types/shared-slot.d.ts +1 -0
  223. package/dist/types/tokens/component-styles.generated.d.ts +79 -151
  224. package/dist/types/tokens/motion-defaults.generated.d.ts +34 -0
  225. package/dist/types/tokens/motion-scale.d.ts +2 -2
  226. package/dist/types/tokens/motion-tokens.d.ts +7 -0
  227. package/dist/types/tokens/theme-sync.d.ts +3 -0
  228. package/dist/types/tokens/theme-tokens.generated.d.ts +669 -1105
  229. package/dist/typing-lines.css +17 -10
  230. package/dist/typing-lines.js +9 -8
  231. package/dist/typing-lines.js.map +1 -1
  232. package/dist/weight-field.css +31 -17
  233. package/dist/weight-field.js +4 -4
  234. package/dist/weight-field.js.map +1 -1
  235. package/dist/youtube.css +90 -96
  236. package/dist/youtube.js +87 -86
  237. package/dist/youtube.js.map +1 -1
  238. package/package.json +3 -1
  239. package/skills/zyncat-ui/SKILL.md +5 -3
  240. package/skills/zyncat-ui/references/components.md +4 -4
  241. package/skills/zyncat-ui/references/theming.md +105 -34
  242. package/src/components/composites/alert/Alert.tsx +9 -10
  243. package/src/components/composites/alert/alert.css +26 -33
  244. package/src/components/composites/date-picker/DateField.tsx +1 -1
  245. package/src/components/composites/date-picker/DateRangeField.tsx +1 -1
  246. package/src/components/composites/date-picker/DateTimeField.tsx +4 -4
  247. package/src/components/composites/date-picker/TimeField.tsx +8 -5
  248. package/src/components/composites/date-picker/calendar-panel.tsx +25 -20
  249. package/src/components/composites/date-picker/date-picker.css +131 -154
  250. package/src/components/composites/date-picker/field-shell.tsx +7 -7
  251. package/src/components/composites/date-picker/range-panel.tsx +34 -34
  252. package/src/components/composites/date-picker/time-core.tsx +4 -6
  253. package/src/components/composites/date-picker/use-day-focus.ts +1 -1
  254. package/src/components/composites/dialog/Dialog.tsx +11 -11
  255. package/src/components/composites/dialog/dialog.css +31 -41
  256. package/src/components/composites/dropdown/Dropdown.tsx +15 -2
  257. package/src/components/composites/dropdown/Dropdown.usage.md +7 -4
  258. package/src/components/composites/dropdown/dropdown.css +36 -27
  259. package/src/components/composites/dropdown/menu-panel.tsx +56 -27
  260. package/src/components/composites/dropdown/types.ts +28 -6
  261. package/src/components/composites/emoji-picker/EmojiPickerPanel.tsx +5 -4
  262. package/src/components/composites/emoji-picker/EmojiPickerPanel.usage.md +4 -4
  263. package/src/components/composites/emoji-picker/data.ts +2 -5
  264. package/src/components/composites/emoji-picker/dom.ts +6 -6
  265. package/src/components/composites/emoji-picker/react/category-bar.tsx +6 -6
  266. package/src/components/composites/emoji-picker/react/useEmojiPicker.ts +0 -11
  267. package/src/components/composites/emoji-picker/scaffold.ts +7 -7
  268. package/src/components/composites/emoji-picker/search.ts +0 -7
  269. package/src/components/composites/emoji-picker/styles.css +34 -34
  270. package/src/components/composites/emoji-picker/types.ts +3 -8
  271. package/src/components/composites/modal/Modal.tsx +2 -2
  272. package/src/components/composites/modal/modal.css +2 -4
  273. package/src/components/composites/pagination/Pagination.tsx +7 -7
  274. package/src/components/composites/pagination/pagination.css +10 -15
  275. package/src/components/composites/popover/Popover.tsx +2 -2
  276. package/src/components/composites/popover/popover.css +13 -15
  277. package/src/components/composites/select/MultiSelect.tsx +11 -2
  278. package/src/components/composites/select/MultiSelect.usage.md +2 -1
  279. package/src/components/composites/select/Select.tsx +10 -1
  280. package/src/components/composites/select/Select.usage.md +2 -1
  281. package/src/components/composites/select/core/index.ts +1 -1
  282. package/src/components/composites/select/core/menu.tsx +19 -4
  283. package/src/components/composites/select/core/panel.tsx +19 -15
  284. package/src/components/composites/select/core/trigger.tsx +5 -5
  285. package/src/components/composites/select/select.css +66 -75
  286. package/src/components/composites/sheet/Sheet.tsx +2 -2
  287. package/src/components/composites/sheet/sheet.css +12 -14
  288. package/src/components/composites/sheet/use-sheet-drag.ts +1 -1
  289. package/src/components/composites/table/Table.tsx +35 -35
  290. package/src/components/composites/table/table.css +76 -84
  291. package/src/components/composites/tabs/Tabs.tsx +20 -21
  292. package/src/components/composites/tabs/Tabs.usage.md +3 -2
  293. package/src/components/composites/tabs/tabs.css +82 -90
  294. package/src/components/composites/toast/Toast.tsx +23 -18
  295. package/src/components/composites/toast/toast-store.ts +8 -6
  296. package/src/components/composites/toast/toast.css +49 -65
  297. package/src/components/composites/tooltip/Tooltip.tsx +40 -19
  298. package/src/components/composites/tooltip/Tooltip.usage.md +9 -1
  299. package/src/components/composites/tooltip/tooltip-host.tsx +55 -23
  300. package/src/components/composites/tooltip/tooltip-store.ts +36 -53
  301. package/src/components/composites/tooltip/tooltip.css +16 -23
  302. package/src/components/compound/support-rail/SupportRail.tsx +33 -33
  303. package/src/components/compound/support-rail/support-rail.css +116 -100
  304. package/src/components/dev/MotionDevtools.tsx +28 -17
  305. package/src/components/dev/MotionDevtools.usage.md +2 -2
  306. package/src/components/dev/motion-devtools.css +42 -68
  307. package/src/components/dev/slowmo-engine.ts +16 -15
  308. package/src/components/expressive/confetti/Confetti.tsx +4 -4
  309. package/src/components/expressive/confetti/confetti.css +19 -12
  310. package/src/components/expressive/facebook-feed/chrome.tsx +2 -2
  311. package/src/components/expressive/facebook-feed/facebook-feed.css +145 -148
  312. package/src/components/expressive/facebook-feed/post.tsx +39 -39
  313. package/src/components/expressive/facebook-feed/reel.tsx +41 -37
  314. package/src/components/expressive/facebook-feed/story.tsx +27 -27
  315. package/src/components/expressive/flow-field/FlowField.tsx +4 -4
  316. package/src/components/expressive/flow-field/flow-field.css +8 -4
  317. package/src/components/expressive/instagram-feed/InstagramFeed.tsx +52 -44
  318. package/src/components/expressive/instagram-feed/instagram-feed.css +65 -66
  319. package/src/components/expressive/lens/Lens.tsx +14 -14
  320. package/src/components/expressive/lens/lens.css +42 -38
  321. package/src/components/expressive/morphing-text/MorphingText.tsx +12 -13
  322. package/src/components/expressive/morphing-text/morphing-text.css +26 -16
  323. package/src/components/expressive/odometer/Odometer.tsx +9 -9
  324. package/src/components/expressive/odometer/odometer.css +22 -16
  325. package/src/components/expressive/tiktok/TikTok.tsx +54 -54
  326. package/src/components/expressive/tiktok/tiktok.css +113 -117
  327. package/src/components/expressive/typing-lines/TypingLines.tsx +0 -0
  328. package/src/components/expressive/typing-lines/typing-lines.css +17 -10
  329. package/src/components/expressive/weight-field/WeightField.tsx +4 -4
  330. package/src/components/expressive/weight-field/weight-field.css +31 -17
  331. package/src/components/expressive/youtube/YouTube.tsx +4 -4
  332. package/src/components/expressive/youtube/glyphs.tsx +16 -16
  333. package/src/components/expressive/youtube/media.tsx +3 -3
  334. package/src/components/expressive/youtube/post.tsx +28 -28
  335. package/src/components/expressive/youtube/short.tsx +25 -25
  336. package/src/components/expressive/youtube/video.tsx +13 -13
  337. package/src/components/expressive/youtube/youtube.css +90 -96
  338. package/src/components/internal/glass/glass.css +19 -22
  339. package/src/components/internal/glass/glint.ts +3 -3
  340. package/src/components/internal/hooks/use-host-election.ts +46 -0
  341. package/src/components/internal/icon/Icon.tsx +1 -5
  342. package/src/components/internal/icon/IconSlot.tsx +1 -1
  343. package/src/components/internal/icon/icon.css +7 -10
  344. package/src/components/internal/menu/highlight.ts +12 -0
  345. package/src/components/internal/menu/menu-row.tsx +5 -5
  346. package/src/components/internal/menu/menu-surface.css +54 -34
  347. package/src/components/internal/overlay/layer.tsx +2 -1
  348. package/src/components/internal/overlay/modal.tsx +5 -4
  349. package/src/components/internal/overlay/overlay.css +4 -9
  350. package/src/components/internal/overlay/trigger.css +3 -3
  351. package/src/components/internal/utils/activation.ts +0 -4
  352. package/src/components/primitives/avatar/Avatar.tsx +24 -8
  353. package/src/components/primitives/avatar/AvatarGroup.tsx +4 -4
  354. package/src/components/primitives/avatar/avatar.css +51 -50
  355. package/src/components/primitives/badge/Badge.tsx +9 -9
  356. package/src/components/primitives/badge/StatusBadge.tsx +7 -7
  357. package/src/components/primitives/badge/badge.css +30 -36
  358. package/src/components/primitives/badge/digit-strip.css +16 -16
  359. package/src/components/primitives/badge/digit-strip.tsx +4 -4
  360. package/src/components/primitives/button/Button.tsx +8 -8
  361. package/src/components/primitives/button/button.css +80 -96
  362. package/src/components/primitives/checkbox/Checkbox.tsx +10 -4
  363. package/src/components/primitives/checkbox/check-glyph.tsx +5 -5
  364. package/src/components/primitives/checkbox/checkbox.css +27 -32
  365. package/src/components/primitives/collapse/Collapse.tsx +2 -2
  366. package/src/components/primitives/collapse/collapse.css +15 -30
  367. package/src/components/primitives/collapse/collapse.typecheck.tsx +1 -1
  368. package/src/components/primitives/input/NumberField.tsx +11 -11
  369. package/src/components/primitives/input/OtpField.tsx +3 -3
  370. package/src/components/primitives/input/TextField.tsx +9 -10
  371. package/src/components/primitives/input/field-chrome.tsx +6 -6
  372. package/src/components/primitives/input/input.css +76 -84
  373. package/src/components/primitives/radio-group/RadioGroup.tsx +23 -23
  374. package/src/components/primitives/radio-group/radio-group.css +60 -73
  375. package/src/components/primitives/tag/Tag.tsx +5 -5
  376. package/src/components/primitives/tag/ToggleTag.tsx +11 -6
  377. package/src/components/primitives/tag/tag.css +48 -53
  378. package/src/components/primitives/textarea/Textarea.tsx +13 -14
  379. package/src/components/primitives/textarea/textarea.css +46 -49
  380. package/src/components/primitives/toggle/Toggle.tsx +7 -7
  381. package/src/components/primitives/toggle/toggle.css +26 -31
  382. package/src/engine/animate.ts +2 -1
  383. package/src/engine/flip.ts +2 -1
  384. package/src/mcp/server.ts +3 -1
  385. package/src/motion/flip.ts +7 -8
  386. package/src/motion/glide.tsx +41 -26
  387. package/src/shared-slot.ts +10 -0
  388. package/src/styles.css +7 -15
  389. package/src/tokens/base.css +15 -0
  390. package/src/tokens/color.css +19 -59
  391. package/src/tokens/component-styles.generated.ts +79 -151
  392. package/src/tokens/dark.css +63 -0
  393. package/src/tokens/decisions.css +26 -0
  394. package/src/tokens/elevation.css +71 -21
  395. package/src/tokens/fonts.css +0 -2
  396. package/src/tokens/glass.css +15 -9
  397. package/src/tokens/motion-defaults.generated.ts +21 -0
  398. package/src/tokens/motion-scale.ts +2 -2
  399. package/src/tokens/motion-tokens.ts +65 -40
  400. package/src/tokens/motion-tokens.usage.md +5 -2
  401. package/src/tokens/motion.css +12 -22
  402. package/src/tokens/radius.css +10 -9
  403. package/src/tokens/semantic.css +57 -37
  404. package/src/tokens/spacing.css +5 -6
  405. package/src/tokens/theme-sync.tsx +15 -0
  406. package/src/tokens/theme-tokens.generated.ts +682 -1109
  407. package/src/tokens/theme.tsx +22 -16
  408. package/src/tokens/theme.usage.md +19 -13
  409. package/src/tokens/typography.css +16 -19
  410. package/tailwind.css +193 -0
  411. package/dist/chunk-227ZW4V7.js.map +0 -1
  412. package/dist/chunk-43M6GQ4Q.js.map +0 -1
  413. package/dist/chunk-4BSHB7R3.js.map +0 -1
  414. package/dist/chunk-4C5RZXBT.js.map +0 -1
  415. package/dist/chunk-5PZ43DCG.js.map +0 -1
  416. package/dist/chunk-7IZJERGA.js +0 -80
  417. package/dist/chunk-7IZJERGA.js.map +0 -1
  418. package/dist/chunk-AADAJL7D.js.map +0 -1
  419. package/dist/chunk-CNWTIMIP.js +0 -39
  420. package/dist/chunk-CNWTIMIP.js.map +0 -1
  421. package/dist/chunk-EAI4POPB.js.map +0 -1
  422. package/dist/chunk-EF6RPXU7.js.map +0 -1
  423. package/dist/chunk-FONOS5RN.js.map +0 -1
  424. package/dist/chunk-FQEHSKEI.js +0 -38
  425. package/dist/chunk-FQEHSKEI.js.map +0 -1
  426. package/dist/chunk-HY5MPISE.js.map +0 -1
  427. package/dist/chunk-I45AU6KH.js.map +0 -1
  428. package/dist/chunk-IJS7TPGV.js.map +0 -1
  429. package/dist/chunk-OWNMRMPN.js +0 -14
  430. package/dist/chunk-OWNMRMPN.js.map +0 -1
  431. package/dist/chunk-RJFGWJ4W.js.map +0 -1
  432. package/dist/chunk-TVYH4AN7.js.map +0 -1
  433. package/dist/chunk-TYHR4VNM.js.map +0 -1
  434. package/dist/chunk-VAXCXZ53.js.map +0 -1
  435. package/dist/chunk-XNIYSAMJ.js.map +0 -1
  436. package/dist/chunk-Y2YA7QRF.js +0 -17
  437. package/dist/chunk-Y2YA7QRF.js.map +0 -1
  438. package/src/tokens/avatar.css +0 -24
  439. package/src/tokens/icons.css +0 -11
  440. package/src/tokens/layers.css +0 -11
@@ -1,33 +1,83 @@
1
- /* Elevation - layered shadows, focus/selection rings, border widths.
2
- The floating steps (lg, xl) are three layers: a tight contact shadow that pins the panel to
3
- what it sits on, a mid layer for form, and a wide ambient one. Drop the contact layer and the
4
- panel reads soft and unanchored no matter how large the ambient blur is. */
1
+ /* Elevation - shadows, top-light highlights, rings and border widths, on every theme root.
2
+ Three strengths scale the lighting per polarity: every shadow, white highlight and cast-light
3
+ alpha is a multiple of --shadow-strength, --sheen-strength or --glow-strength. */
5
4
 
6
5
  @layer zyncat.tokens, zyncat.components;
7
6
 
8
7
  @layer zyncat.tokens {
9
8
  :root {
10
- --shadow-xs: 0 1px 1px rgb(var(--shadow-rgb) / 0.04);
11
- --shadow-sm: 0 1px 2px rgb(var(--shadow-rgb) / 0.05), 0 1px 1px rgb(var(--shadow-rgb) / 0.04);
12
- --shadow-md: 0 2px 4px rgb(var(--shadow-rgb) / 0.04), 0 6px 12px rgb(var(--shadow-rgb) / 0.07);
9
+ /* Border widths - weight comes from the colour, not the thickness. */
10
+ --border-hairline: 1px;
11
+ --border-emphasis: 1.5px;
12
+
13
+ /* How far every focus ring reaches past the border box - the exact room a clipping
14
+ ancestor reserves so a ring is never cut. */
15
+ --ring-width: 3px;
16
+
17
+ --layer-overlay: 1000; /* a band - each overlay adds its stack depth, so a later one paints above an earlier one */
18
+ --layer-toast: 1050;
19
+ --layer-tooltip: 1100;
20
+ }
21
+
22
+ :root,
23
+ [data-theme='light'] {
24
+ /* Multiplies every shadow alpha - 1 on the white canvas; black on dark needs 3-4x to read. */
25
+ --shadow-strength: 1;
26
+ /* Multiplies every white top-light highlight - 1 on the white canvas, a fifth on dark. */
27
+ --sheen-strength: 1;
28
+ /* Multiplies the light a lifted hue fill casts around it - off on the white canvas, on in dark. */
29
+ --glow-strength: 0;
30
+ }
31
+
32
+ :root,
33
+ [data-theme] {
34
+ --shadow-xs: 0 1px 1px rgb(var(--shadow-rgb) / calc(0.04 * var(--shadow-strength)));
35
+ --shadow-sm:
36
+ 0 1px 2px rgb(var(--shadow-rgb) / calc(0.05 * var(--shadow-strength))),
37
+ 0 1px 1px rgb(var(--shadow-rgb) / calc(0.04 * var(--shadow-strength)));
38
+ --shadow-md:
39
+ 0 2px 4px rgb(var(--shadow-rgb) / calc(0.04 * var(--shadow-strength))),
40
+ 0 6px 12px rgb(var(--shadow-rgb) / calc(0.07 * var(--shadow-strength)));
41
+ /* The floating steps are three layers: a tight contact shadow, a mid layer for form, a wide
42
+ ambient one. Without the contact layer the panel reads soft and unanchored. */
13
43
  --shadow-lg:
14
- 0 1px 2px rgb(var(--shadow-rgb) / 0.06), 0 4px 8px rgb(var(--shadow-rgb) / 0.04),
15
- 0 12px 28px rgb(var(--shadow-rgb) / 0.1);
44
+ 0 1px 2px rgb(var(--shadow-rgb) / calc(0.06 * var(--shadow-strength))),
45
+ 0 4px 8px rgb(var(--shadow-rgb) / calc(0.04 * var(--shadow-strength))),
46
+ 0 12px 28px rgb(var(--shadow-rgb) / calc(0.1 * var(--shadow-strength)));
16
47
  --shadow-xl:
17
- 0 1px 2px rgb(var(--shadow-rgb) / 0.06), 0 8px 16px rgb(var(--shadow-rgb) / 0.06),
18
- 0 24px 48px rgb(var(--shadow-rgb) / 0.14);
48
+ 0 1px 2px rgb(var(--shadow-rgb) / calc(0.06 * var(--shadow-strength))),
49
+ 0 8px 16px rgb(var(--shadow-rgb) / calc(0.06 * var(--shadow-strength))),
50
+ 0 24px 48px rgb(var(--shadow-rgb) / calc(0.14 * var(--shadow-strength)));
19
51
 
20
- /* Borders - one hairline (1px); weight comes from the border color, not thickness; 2px for focus/selected. */
21
- --border-hairline: 1px;
22
- --border-emphasis: 1.5px;
52
+ /* Focus & selection ring hues - each tracks its role; danger rings on its fill tone, the
53
+ lighter face the destructive button rests on. */
54
+ --ring-color-accent: color-mix(in oklab, var(--accent) 32%, transparent);
55
+ --ring-color-danger: oklch(from var(--danger) 0.602 0.196 h / 0.3);
56
+ --ring-color-warning: color-mix(in oklab, var(--warning) 30%, transparent);
57
+ --ring-color-success: color-mix(in oklab, var(--success) 30%, transparent);
58
+
59
+ /* The rings themselves - outline values, so a ring never shares box-shadow with elevation and a
60
+ clipping ancestor can reserve exactly --ring-width. Outlines follow border-radius everywhere
61
+ this library supports. --ring-rest is the resting ring a control fades in from; --ring-inset
62
+ is the offset that turns a ring inward, for a control flush with a clipping edge. */
63
+ --ring-rest: var(--ring-width) solid transparent;
64
+ --ring-inset: calc(var(--ring-width) * -1);
65
+ --ring-accent: var(--ring-width) solid var(--ring-color-accent);
66
+ --ring-danger: var(--ring-width) solid var(--ring-color-danger);
67
+ --ring-warning: var(--ring-width) solid var(--ring-color-warning);
68
+ --ring-success: var(--ring-width) solid var(--ring-color-success);
23
69
 
24
- /* Focus & selection rings - box-shadows (not outlines) so they follow border-radius. */
70
+ /* Cast light - the hover of the primary and destructive buttons; each tracks its ring's hue. */
71
+ --glow-accent: 0 4px 16px oklch(from var(--accent) l c h / calc(0.4 * var(--glow-strength)));
72
+ --glow-danger: 0 4px 16px oklch(from var(--danger) 0.602 0.196 h / calc(0.4 * var(--glow-strength)));
73
+ }
25
74
 
26
- /* Derive from --accent so the ring tracks the active accent and theme, never a fixed hue. */
27
- --ring-accent: 0 0 0 3px color-mix(in oklab, var(--accent) 32%, transparent);
28
- --ring-danger: 0 0 0 3px oklch(0.602 0.196 27 / 0.3);
29
- --ring-warning: 0 0 0 3px color-mix(in oklab, var(--warning) 30%, transparent);
30
- --ring-success: 0 0 0 3px color-mix(in oklab, var(--success) 30%, transparent);
31
- --ring-offset: 0 0 0 2px var(--bg-surface), 0 0 0 4px color-mix(in oklab, var(--accent) 40%, transparent);
75
+ /* Forced colours repaint every outline-color, transparent included, so the resting ring would
76
+ sit on every control as a permanent border. It costs the fade-in, not the ring. */
77
+ @media (forced-colors: active) {
78
+ :root,
79
+ [data-theme] {
80
+ --ring-rest: none;
81
+ }
32
82
  }
33
83
  }
@@ -1,3 +1 @@
1
- /* Webfonts - Geist (UI) + Geist Mono (numerals, data, code) from Google Fonts; self-host woff2 for prod. */
2
-
3
1
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap');
@@ -1,5 +1,3 @@
1
- /* Glass tokens - structural frosted-surface pieces; per-tone tints live in semantic.css. */
2
-
3
1
  @layer zyncat.tokens, zyncat.components;
4
2
 
5
3
  @layer zyncat.tokens {
@@ -8,17 +6,25 @@
8
6
  --glass-blur-strong: 16px;
9
7
  --glass-saturate: 1.5;
10
8
 
9
+ --glass-sheen-rest: 0.8;
10
+ --glass-sheen-hover: 1;
11
+ }
12
+
13
+ :root,
14
+ [data-theme] {
11
15
  --glass-sheen: linear-gradient(
12
16
  145deg,
13
- rgb(255 255 255 / 0.55) 0%,
14
- rgb(255 255 255 / 0.1) 24%,
17
+ rgb(255 255 255 / calc(0.55 * var(--sheen-strength))) 0%,
18
+ rgb(255 255 255 / calc(0.1 * var(--sheen-strength))) 24%,
15
19
  rgb(255 255 255 / 0) 46%
16
20
  );
17
- --glass-sheen-rest: 0.8;
18
- --glass-sheen-hover: 1;
21
+ --glass-highlight: inset 0 1px 0 0 rgb(255 255 255 / calc(0.55 * var(--sheen-strength)));
19
22
 
20
- --glass-highlight: inset 0 1px 0 0 rgb(255 255 255 / 0.55);
21
- --glass-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.05), 0 2px 5px rgb(var(--shadow-rgb) / 0.05);
22
- --glass-shadow-hover: 0 2px 4px rgb(var(--shadow-rgb) / 0.06), 0 8px 18px rgb(var(--shadow-rgb) / 0.1);
23
+ --glass-shadow:
24
+ 0 1px 2px rgb(var(--shadow-rgb) / calc(0.05 * var(--shadow-strength))),
25
+ 0 2px 5px rgb(var(--shadow-rgb) / calc(0.05 * var(--shadow-strength)));
26
+ --glass-shadow-hover:
27
+ 0 2px 4px rgb(var(--shadow-rgb) / calc(0.06 * var(--shadow-strength))),
28
+ 0 8px 18px rgb(var(--shadow-rgb) / calc(0.1 * var(--shadow-strength)));
23
29
  }
24
30
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The motion tokens as numbers, for the readers that need a value before a stylesheet answers:
3
+ * durations in milliseconds, distances in pixels at a 16px root, easings as cubic-bezier points.
4
+ *
5
+ * Generated from the token and component CSS by `scripts/gen-theme.mjs` - `pnpm sync` rebuilds it.
6
+ */
7
+ export const motionDefaults = {
8
+ duration: { fast: 140, base: 200, slow: 300, slower: 450, slowest: 900, spin: 600, pulse: 1600 } satisfies Record<
9
+ string,
10
+ number
11
+ >,
12
+ ease: {
13
+ standard: [0.2, 0, 0, 1],
14
+ entrance: [0.25, 1, 0.4, 1],
15
+ exit: [0.4, 0, 1, 1],
16
+ spring: [0.34, 1.4, 0.5, 1],
17
+ glide: [0.32, 0.55, 0, 1],
18
+ } satisfies Record<string, [number, number, number, number]>,
19
+ distance: { sm: 8, md: 16, lg: 24 } satisfies Record<string, number>,
20
+ scale: { panel: 0.98, floating: 0.96, chip: 0.9 } satisfies Record<string, number>,
21
+ };
@@ -12,8 +12,8 @@ export type DurationToken = 'fast' | 'base' | 'slow' | 'slower' | 'slowest';
12
12
  * - `entrance` cubic-bezier(0.16, 1, 0.3, 1) - hard deceleration; content arriving on screen.
13
13
  * - `exit` cubic-bezier(0.4, 0, 1, 1) - accelerates away; content leaving (pair with a faster duration).
14
14
  * - `spring` cubic-bezier(0.34, 1.4, 0.5, 1) - overshoots then settles; playful confirmations.
15
- * - `glide` cubic-bezier(0.55, 0, 0.15, 1) - symmetric in-out travel; a persistent element moving
16
- * between positions, never enter/exit. */
15
+ * - `glide` cubic-bezier(0.32, 0.55, 0, 1) - fast out, soft landing; a persistent element moving to a
16
+ * new target, never enter/exit. */
17
17
  export type EaseToken = 'standard' | 'entrance' | 'exit' | 'spring' | 'glide';
18
18
 
19
19
  export type DistanceToken = 'sm' | 'md' | 'lg';
@@ -1,3 +1,4 @@
1
+ import { motionDefaults } from './motion-defaults.generated';
1
2
  import type { DistanceToken, DurationToken, EaseToken, ScaleToken } from './motion-scale';
2
3
 
3
4
  export interface MotionTransition {
@@ -32,22 +33,32 @@ export interface MotionTokens {
32
33
  dist: Record<DistanceToken, number>;
33
34
  scale: Record<ScaleToken, number>;
34
35
  /** ready-made Motion transitions */
35
- t: { enter: MotionTransition; exit: MotionTransition; layout: MotionTransition; settle: MotionTransition };
36
+ t: {
37
+ enter: MotionTransition;
38
+ exit: MotionTransition;
39
+ layout: MotionTransition;
40
+ settle: MotionTransition;
41
+ glide: MotionTransition;
42
+ };
36
43
  reduced: boolean;
37
44
  }
38
45
 
39
46
  type MotionScales = Pick<MotionTokens, 'dur' | 'ease' | 'dist' | 'scale'>;
40
47
 
41
- const DEFAULT_DUR: MotionTokens['dur'] = { fast: 0.14, base: 0.25, slow: 0.33, slower: 0.45, slowest: 0.9 };
42
- const DEFAULT_EASE: MotionTokens['ease'] = {
43
- standard: [0.2, 0, 0, 1],
44
- entrance: [0.25, 1, 0.4, 1],
45
- exit: [0.4, 0, 1, 1],
46
- spring: [0.34, 1.4, 0.5, 1],
47
- glide: [0.55, 0, 0.15, 1],
48
+ const DURATION_TOKENS: DurationToken[] = ['fast', 'base', 'slow', 'slower', 'slowest'];
49
+ const EASE_TOKENS: EaseToken[] = ['standard', 'entrance', 'exit', 'spring', 'glide'];
50
+ const DISTANCE_TOKENS: DistanceToken[] = ['sm', 'md', 'lg'];
51
+ const SCALE_TOKENS: ScaleToken[] = ['panel', 'floating', 'chip'];
52
+
53
+ const table = <K extends string, V>(keys: readonly K[], read: (key: K) => V): Record<K, V> =>
54
+ Object.fromEntries(keys.map((key) => [key, read(key)])) as Record<K, V>;
55
+
56
+ const DEFAULTS: MotionScales = {
57
+ dur: table(DURATION_TOKENS, (key) => motionDefaults.duration[key] / 1000),
58
+ ease: table(EASE_TOKENS, (key) => motionDefaults.ease[key]),
59
+ dist: table(DISTANCE_TOKENS, (key) => motionDefaults.distance[key]),
60
+ scale: table(SCALE_TOKENS, (key) => motionDefaults.scale[key]),
48
61
  };
49
- const DEFAULT_DIST: MotionTokens['dist'] = { sm: 8, md: 16, lg: 24 };
50
- const DEFAULT_SCALE: MotionTokens['scale'] = { panel: 0.98, floating: 0.95, chip: 0.9 };
51
62
 
52
63
  function build(scales: MotionScales): MotionTokens {
53
64
  const { dur, ease } = scales;
@@ -60,13 +71,14 @@ function build(scales: MotionScales): MotionTokens {
60
71
  exit: { duration: dur.fast, ease: ease.exit },
61
72
  layout: { duration: dur.slow, ease: ease.entrance },
62
73
  settle: reduced ? { duration: 0 } : { type: 'spring', visualDuration: dur.fast, bounce: 0.25 },
74
+ glide: { duration: dur.base, ease: ease.glide },
63
75
  },
64
76
  };
65
77
  }
66
78
 
67
79
  function readFromDom(): MotionTokens {
68
- const cs = getComputedStyle(document.documentElement);
69
- const rootFontSize = parseFloat(cs.fontSize) || 16;
80
+ const cs = getComputedStyle(document.body ?? document.documentElement);
81
+ const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
70
82
  const seconds = (name: string, fallback: number): number => {
71
83
  const v = cs.getPropertyValue(name).trim();
72
84
  const n = v.slice(-2) === 'ms' ? parseFloat(v) / 1000 : parseFloat(v);
@@ -87,36 +99,49 @@ function readFromDom(): MotionTokens {
87
99
  return m && m.length === 4 ? (m.map(Number) as Bezier) : fallback;
88
100
  };
89
101
  return build({
90
- dur: {
91
- fast: seconds('--duration-fast', DEFAULT_DUR.fast),
92
- base: seconds('--duration-base', DEFAULT_DUR.base),
93
- slow: seconds('--duration-slow', DEFAULT_DUR.slow),
94
- slower: seconds('--duration-slower', DEFAULT_DUR.slower),
95
- slowest: seconds('--duration-slowest', DEFAULT_DUR.slowest),
96
- },
97
- ease: {
98
- standard: bezier('--ease-standard', DEFAULT_EASE.standard),
99
- entrance: bezier('--ease-entrance', DEFAULT_EASE.entrance),
100
- exit: bezier('--ease-exit', DEFAULT_EASE.exit),
101
- spring: bezier('--ease-spring', DEFAULT_EASE.spring),
102
- glide: bezier('--ease-glide', DEFAULT_EASE.glide),
103
- },
104
- dist: {
105
- sm: pixels('--distance-sm', DEFAULT_DIST.sm),
106
- md: pixels('--distance-md', DEFAULT_DIST.md),
107
- lg: pixels('--distance-lg', DEFAULT_DIST.lg),
108
- },
109
- scale: {
110
- panel: ratio('--scale-panel', DEFAULT_SCALE.panel),
111
- floating: ratio('--scale-floating', DEFAULT_SCALE.floating),
112
- chip: ratio('--scale-chip', DEFAULT_SCALE.chip),
113
- },
102
+ dur: table(DURATION_TOKENS, (key) => seconds(`--duration-${key}`, DEFAULTS.dur[key])),
103
+ ease: table(EASE_TOKENS, (key) => bezier(`--ease-${key}`, DEFAULTS.ease[key])),
104
+ dist: table(DISTANCE_TOKENS, (key) => pixels(`--distance-${key}`, DEFAULTS.dist[key])),
105
+ scale: table(SCALE_TOKENS, (key) => ratio(`--scale-${key}`, DEFAULTS.scale[key])),
114
106
  });
115
107
  }
116
108
 
117
- export const UIMotion: MotionTokens =
118
- typeof document !== 'undefined'
119
- ? readFromDom()
120
- : build({ dur: DEFAULT_DUR, ease: DEFAULT_EASE, dist: DEFAULT_DIST, scale: DEFAULT_SCALE });
109
+ const isRecord = (value: unknown): value is Record<string, unknown> =>
110
+ typeof value === 'object' && value !== null && !Array.isArray(value);
111
+
112
+ function replaceInto(target: Record<string, unknown>, next: Record<string, unknown>): void {
113
+ for (const key of Object.keys(target)) if (!(key in next)) delete target[key];
114
+ for (const [key, value] of Object.entries(next)) {
115
+ const current = target[key];
116
+ if (isRecord(current) && isRecord(value)) replaceInto(current, value);
117
+ else target[key] = value;
118
+ }
119
+ }
120
+
121
+ const hasDom = typeof document !== 'undefined';
122
+
123
+ export const UIMotion: MotionTokens = hasDom ? readFromDom() : build(DEFAULTS);
124
+
125
+ /**
126
+ * Re-reads the motion tokens into `UIMotion` in place, so every held reference sees the new values. Runs on
127
+ * a `data-theme` change, a `prefers-reduced-motion` flip and after `ZyncatTheme` renders; call it yourself
128
+ * after injecting a stylesheet that retimes the `--duration-*` tokens.
129
+ */
130
+ export function refreshMotionTokens(): MotionTokens {
131
+ if (hasDom)
132
+ replaceInto(UIMotion as unknown as Record<string, unknown>, readFromDom() as unknown as Record<string, unknown>);
133
+ return UIMotion;
134
+ }
135
+
136
+ if (hasDom) {
137
+ if (typeof matchMedia === 'function')
138
+ matchMedia('(prefers-reduced-motion: reduce)').addEventListener('change', () => refreshMotionTokens());
139
+ if (typeof MutationObserver === 'function')
140
+ new MutationObserver(() => refreshMotionTokens()).observe(document.documentElement, {
141
+ attributes: true,
142
+ attributeFilter: ['data-theme'],
143
+ subtree: true,
144
+ });
145
+ }
121
146
 
122
147
  export default UIMotion;
@@ -6,8 +6,11 @@ TypeScript readers for the motion token vocabulary - duration/ease/distance/scal
6
6
 
7
7
  Use it to time your own animation code off the same tokens the components read, so your motion
8
8
  retimes with the theme and collapses under reduced motion exactly like the library's. UIMotion
9
- carries dur/ease/dist/scale maps, ready-made enter/exit/layout/settle transitions on `t`, and
10
- `reduced`, which reflects prefers-reduced-motion.
9
+ carries dur/ease/dist/scale maps, ready-made enter/exit/layout/settle/glide transitions on `t`, and
10
+ `reduced`, which reflects prefers-reduced-motion. It re-reads in place when `data-theme` changes on any
11
+ element, when prefers-reduced-motion flips and after `ZyncatTheme` renders, so read it at call time rather
12
+ than into a module constant; `refreshMotionTokens()` re-reads it after a stylesheet of your own retimes the `--duration-*`
13
+ tokens.
11
14
 
12
15
  ```tsx
13
16
  import { UIMotion } from '@zyncat/ui/motion-tokens';
@@ -1,13 +1,10 @@
1
- /* Motion system - durations, brand curves, travel distances, rest scales, and pre-composed transitions;
2
- smooths every layout shift by default. */
3
-
4
1
  @layer zyncat.tokens, zyncat.components;
5
2
 
6
3
  @layer zyncat.tokens {
7
4
  :root {
8
- --duration-fast: 140ms;
9
- --duration-base: 200ms;
10
- --duration-slow: 300ms;
5
+ --duration-fast: 140ms; /* micro feedback - hover washes, presses, control tint */
6
+ --duration-base: 200ms; /* standard element transitions - fades, toggles, badge morphs */
7
+ --duration-slow: 300ms; /* layout-scale movement - Collapse, panel resizes, reordering */
11
8
  --duration-slower: 450ms; /* large-surface movement - dialog, sheet, page-scale reveals */
12
9
  --duration-slowest: 900ms; /* hero-scale movement - card expansion, container transforms; the scale's ceiling */
13
10
  --duration-spin: 600ms; /* continuous loaders only; deliberately outside the UI-transition scale */
@@ -18,42 +15,35 @@
18
15
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
19
16
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
20
17
  --ease-glide: cubic-bezier(
18
+ 0.32,
21
19
  0.55,
22
20
  0,
23
- 0.15,
24
21
  1
25
- ); /* in-out travel - persistent element gliding between siblings; not for enter/exit */
22
+ ); /* fast out, soft landing - a persistent element moving to a new target, never enter/exit */
26
23
 
27
- /* Travel - how far a surface moves on the way in or out. A magnitude scale, snapped to the 4px
28
- spacing spine; pick by how far the surface has conceptually come, not by how big it is. */
29
24
  --distance-sm: 0.5rem; /* 8px - settling into place; the surface is already where it belongs */
30
25
  --distance-md: 1rem; /* 16px - arriving from an adjacent position - page turns, tab panels, paged ranges */
31
26
  --distance-lg: 1.5rem; /* 24px - arriving from outside the surface - a toast joining its stack */
32
27
 
33
- /* Rest scale - what a surface scales from on the way in, and to on the way out. Picked by surface
34
- size, not by taste: the same ratio reads as more movement the wider the surface, so a dialog
35
- needs a smaller one than a tag to land at the same perceived distance. */
28
+ /* Rest scale - picked by surface size: the same ratio reads as more movement the wider the
29
+ surface, so a dialog takes a smaller one than a tag to land at the same perceived distance. */
36
30
  --scale-panel: 0.98; /* full-width surfaces - dialog, modal, sheet */
37
31
  --scale-floating: 0.96; /* floating surfaces - popover, tooltip, menu, toast, alert */
38
32
  --scale-chip: 0.9; /* small inline elements - tag, badge, count */
33
+ }
39
34
 
35
+ :root,
36
+ [data-theme] {
40
37
  --transition-control:
41
38
  color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard),
42
- border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
39
+ border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard),
40
+ outline-color var(--duration-fast) var(--ease-standard);
43
41
  --transition-colors:
44
42
  color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard),
45
43
  border-color var(--duration-fast) var(--ease-standard);
46
44
  --transition-opacity: opacity var(--duration-base) var(--ease-standard);
47
- --transition-transform: transform var(--duration-base) var(--ease-standard);
48
-
49
- /* Layout transition - animatable stand-ins for width/height; apply wherever size may change. */
50
- --transition-layout:
51
- grid-template-rows var(--duration-slow) var(--ease-entrance),
52
- grid-template-columns var(--duration-slow) var(--ease-entrance),
53
- max-height var(--duration-slow) var(--ease-entrance), max-width var(--duration-slow) var(--ease-entrance);
54
45
  }
55
46
 
56
- /* Accessibility: honor reduced-motion globally - every consumer gets it free. */
57
47
  @media (prefers-reduced-motion: reduce) {
58
48
  :root {
59
49
  --duration-fast: 1ms;
@@ -1,15 +1,16 @@
1
- /* Corner radii - a restrained set; --radius-md (6px) is the control default. */
2
-
3
1
  @layer zyncat.tokens, zyncat.components;
4
2
 
5
3
  @layer zyncat.tokens {
6
4
  :root {
7
- --radius-0: 0;
8
- --radius-sm: 0.25rem;
9
- --radius-md: 0.375rem;
10
- --radius-lg: 0.5rem;
11
- --radius-xl: 0.75rem;
12
- --radius-2xl: 1rem;
13
- --radius-full: 624.9375rem;
5
+ --radius-full: 624.9375rem; /* the pill - a shape, not a step of --radius, so it stays literal */
6
+ }
7
+
8
+ :root,
9
+ [data-theme] {
10
+ --radius-sm: calc(var(--radius) * 0.5);
11
+ --radius-md: calc(var(--radius) * 0.75);
12
+ --radius-lg: var(--radius);
13
+ --radius-xl: calc(var(--radius) * 1.5);
14
+ --radius-2xl: calc(var(--radius) * 2);
14
15
  }
15
16
  }
@@ -1,13 +1,21 @@
1
- /* Semantic layer - the intent-named aliases components consume; repoint these to re-theme. */
1
+ /* Semantic layer - the intent-named roles components consume.
2
+ Neutral roles are a polarity: light values on `:root, [data-theme='light']`, dark ones in dark.css.
3
+ Derived roles sit on every theme root, so a subtree that repoints a decision re-derives them. */
2
4
 
3
5
  @layer zyncat.tokens, zyncat.components;
4
6
 
5
7
  @layer zyncat.tokens {
6
8
  :root {
7
- /* The canvas is pure white; cards and floating panels share it and separate with
8
- hairlines and shadow, the way print separates with rules rather than tint.
9
- The tinted trio steps for real: subtle (hover wash) < muted (passive fill)
10
- < inset (a recessed well - code, terminals), each one ramp stop apart. */
9
+ /* The ink on a hue fill - white in either polarity, since the fills stay mid-lightness on dark. */
10
+ --text-on-accent: var(--gray-0);
11
+ }
12
+
13
+ :root,
14
+ [data-theme='light'] {
15
+ color-scheme: light;
16
+
17
+ /* The canvas is pure white and cards and panels share it, separated by hairlines and shadow the
18
+ way print separates with rules rather than tint; subtle < muted < inset step one ramp stop apart. */
11
19
  --bg-app: var(--gray-0);
12
20
  --bg-surface: var(--gray-0);
13
21
  --bg-surface-raised: var(--gray-0);
@@ -22,47 +30,59 @@
22
30
  --text-muted: var(--gray-600);
23
31
  --text-subtle: var(--gray-500);
24
32
  --text-disabled: var(--gray-400);
25
- --text-accent: var(--teal-700);
26
- --text-on-accent: var(--gray-0);
33
+ /* The ink on a strong-ink fill - the canvas colour in either polarity. */
27
34
  --text-inverse: var(--gray-0);
28
35
 
29
36
  --border-subtle: var(--gray-150);
30
37
  --border-default: var(--gray-200);
31
38
  --border-strong: var(--gray-300);
39
+ }
40
+
41
+ :root,
42
+ [data-theme] {
43
+ /* Accent family. Fill is the resting face of a filled control, a step down on dark where it reads
44
+ as a light source; hover, active and lift step lightness from the accent, the tints take only its hue. */
45
+ --accent-fill: var(--accent);
46
+ --accent-lift: oklch(from var(--accent) calc(l + 0.075) calc(c - 0.006) h);
47
+ --accent-hover: oklch(from var(--accent) calc(l - 0.07) calc(c - 0.004) h);
48
+ --accent-active: oklch(from var(--accent) calc(l - 0.152) calc(c - 0.018) h);
49
+ --accent-subtle: oklch(from var(--accent) 0.972 0.02 h);
50
+ --accent-border: oklch(from var(--accent) 0.88 0.066 h);
51
+ --accent-disabled: oklch(from var(--accent) 0.795 0.092 h);
52
+ --accent-wash: oklch(from var(--accent) l c h / 0.08);
53
+ --text-accent: var(--accent-active);
54
+
55
+ /* Hover and press fills are translucent washes of the ink, never opaque near-whites: an opaque
56
+ patch vanishes on a tinted surface, and a dark theme's light ink washes light by itself. */
57
+ --neutral-wash: color-mix(in oklab, var(--text-secondary) 6%, transparent);
58
+ --neutral-wash-press: color-mix(in oklab, var(--text-secondary) 10%, transparent);
59
+
60
+ /* Info reads as the accent's own hue one step down; repoint --info to give it a hue of its own. */
61
+ --info: var(--accent-hover);
62
+ --info-subtle: oklch(from var(--info) 0.972 0.02 h);
63
+ --info-text: oklch(from var(--info) calc(l - 0.082) calc(c - 0.014) h);
64
+ --info-wash: oklch(from var(--info) 0.63 0.118 h / 0.08);
32
65
 
33
- --accent-lift: var(--teal-400);
34
- --accent: var(--teal-500);
35
- --accent-hover: var(--teal-600);
36
- --accent-active: var(--teal-700);
37
- --accent-subtle: var(--teal-50);
38
- --accent-border: var(--teal-200);
39
- --accent-disabled: var(--teal-300);
66
+ --success-subtle: oklch(from var(--success) 0.965 0.028 h);
67
+ --success-text: oklch(from var(--success) calc(l - 0.086) calc(c - 0.022) h);
68
+ --success-wash: oklch(from var(--success) 0.62 0.13 h / 0.1);
40
69
 
41
- --success-subtle: var(--green-50);
42
- --success: var(--green-600);
43
- --success-text: var(--green-700);
44
- --warning-subtle: var(--amber-50);
45
- --warning: var(--amber-600);
46
- --warning-text: var(--amber-700);
47
- --danger-subtle: var(--red-50);
48
- --danger: var(--red-600);
49
- --danger-text: var(--red-700);
50
- --info-subtle: var(--teal-50);
51
- --info: var(--teal-600);
52
- --info-text: var(--teal-700);
53
- --danger-disabled: var(--red-300);
70
+ --warning-subtle: oklch(from var(--warning) 0.972 0.034 h);
71
+ --warning-text: oklch(from var(--warning) calc(l - 0.14) calc(c - 0.024) h);
72
+ --warning-wash: oklch(from var(--warning) 0.76 0.14 h / 0.12);
54
73
 
55
- /* State layer: interactive hover/press fills are translucent washes, never opaque
56
- near-whites - opaque --bg-subtle patches vanish on tinted/app surfaces. Press > hover. */
57
- --neutral-wash: var(--gray-wash);
58
- --neutral-wash-press: var(--gray-wash-strong);
59
- --accent-wash: var(--teal-wash);
60
- --success-wash: var(--green-wash);
61
- --warning-wash: var(--amber-wash);
62
- --danger-wash: var(--red-wash);
74
+ /* Danger carries the destructive button's ladder too: fill is the resting face, one step
75
+ lighter than the --danger ink so white text sits on it; lift is the hover face above that. */
76
+ --danger-lift: oklch(from var(--danger) 0.64 0.2 h);
77
+ --danger-fill: oklch(from var(--danger) 0.602 0.196 h);
78
+ --danger-active: oklch(from var(--danger) calc(l - 0.067) calc(c - 0.024) h);
79
+ --danger-subtle: oklch(from var(--danger) 0.968 0.02 h);
80
+ --danger-text: var(--danger-active);
81
+ --danger-disabled: oklch(from var(--danger) 0.8 0.09 h);
82
+ --danger-wash: oklch(from var(--danger) 0.602 0.196 h / 0.1);
63
83
 
64
- /* Glass tints - per-tone translucent fills derived from the status hues; alpha kept low so the frost reads through. */
65
- --glass-tint-neutral: color-mix(in oklab, var(--gray-600) 13%, transparent);
84
+ /* Per-tone glass tints - alpha kept low so the frost reads through. */
85
+ --glass-tint-neutral: color-mix(in oklab, var(--text-muted) 13%, transparent);
66
86
  --glass-tint-info: color-mix(in oklab, var(--info) 17%, transparent);
67
87
  --glass-tint-success: color-mix(in oklab, var(--success) 17%, transparent);
68
88
  --glass-tint-warning: color-mix(in oklab, var(--warning) 21%, transparent);
@@ -1,11 +1,8 @@
1
- /* Spacing spine - one 4px base and a short scale; every gap snaps to a step. */
2
-
3
1
  @layer zyncat.tokens, zyncat.components;
4
2
 
5
3
  @layer zyncat.tokens {
6
4
  :root {
7
5
  --space-px: 1px;
8
- --space-0: 0;
9
6
  --space-1: 0.25rem;
10
7
  --space-2: 0.5rem;
11
8
  --space-3: 0.75rem;
@@ -17,14 +14,16 @@
17
14
  --space-9: 6rem;
18
15
  --space-10: 8rem;
19
16
 
20
- --container-max: 72rem;
21
17
  --measure-prose: 38rem;
22
- --sidebar-width: 16rem;
23
18
 
24
19
  --control-height-sm: 1.75rem;
25
20
  --control-height: 2rem;
26
21
  --control-height-lg: 2.3rem;
27
22
  --control-box: 1.125rem;
28
- --control-switch: 1.25rem; /* switch track (md); the one control size off the scale - width reuses --control-height(-sm), sm height reuses --space-4 */
23
+ --control-switch: 1.25rem; /* the switch track - the one control size off the scale */
24
+
25
+ --icon-sm: 17px;
26
+ --icon-md: 20px;
27
+ --icon-lg: 26px;
29
28
  }
30
29
  }
@@ -0,0 +1,15 @@
1
+ 'use client';
2
+
3
+ import { useEffect } from 'react';
4
+
5
+ import { refreshMotionTokens } from './motion-tokens';
6
+
7
+ export function ThemeSync({ css }: { css: string }): null {
8
+ useEffect(() => {
9
+ refreshMotionTokens();
10
+ return () => {
11
+ refreshMotionTokens();
12
+ };
13
+ }, [css]);
14
+ return null;
15
+ }