@zyncat/ui 0.13.1 → 0.17.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 (505) hide show
  1. package/README.md +46 -157
  2. package/dist/alert.css +27 -34
  3. package/dist/alert.js +26 -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 +53 -51
  8. package/dist/avatar.js +29 -7
  9. package/dist/avatar.js.map +1 -1
  10. package/dist/badge.css +31 -37
  11. package/dist/badge.js +1 -1
  12. package/dist/bloom-HV23M4AW.js +81 -0
  13. package/dist/bloom-HV23M4AW.js.map +1 -0
  14. package/dist/button.css +99 -118
  15. package/dist/button.js +3 -1
  16. package/dist/checkbox.css +28 -33
  17. package/dist/checkbox.js +2 -2
  18. package/dist/chunk-2YGHPQ66.js +16 -0
  19. package/dist/chunk-2YGHPQ66.js.map +1 -0
  20. package/dist/chunk-3MLUH2QL.js +53 -0
  21. package/dist/chunk-3MLUH2QL.js.map +1 -0
  22. package/dist/{chunk-RJFGWJ4W.js → chunk-3XRVPCIM.js} +6 -6
  23. package/dist/chunk-3XRVPCIM.js.map +1 -0
  24. package/dist/{chunk-FONOS5RN.js → chunk-4PQDVK23.js} +11 -10
  25. package/dist/chunk-4PQDVK23.js.map +1 -0
  26. package/dist/{chunk-45R4Z5XN.js → chunk-5VC3TUZ2.js} +4 -4
  27. package/dist/{chunk-45R4Z5XN.js.map → chunk-5VC3TUZ2.js.map} +1 -1
  28. package/dist/{chunk-A5WTZACK.js → chunk-5W5TKANX.js} +3 -3
  29. package/dist/{chunk-A5WTZACK.js.map → chunk-5W5TKANX.js.map} +1 -1
  30. package/dist/{chunk-227ZW4V7.js → chunk-6IXLW7QA.js} +11 -11
  31. package/dist/chunk-6IXLW7QA.js.map +1 -0
  32. package/dist/chunk-7NHY2CRA.js +132 -0
  33. package/dist/chunk-7NHY2CRA.js.map +1 -0
  34. package/dist/{chunk-EF6RPXU7.js → chunk-7VTWJL72.js} +43 -35
  35. package/dist/chunk-7VTWJL72.js.map +1 -0
  36. package/dist/chunk-7ZSIUUC3.js +50 -0
  37. package/dist/chunk-7ZSIUUC3.js.map +1 -0
  38. package/dist/{chunk-TYHR4VNM.js → chunk-AREEMG47.js} +10 -8
  39. package/dist/chunk-AREEMG47.js.map +1 -0
  40. package/dist/{chunk-DDRSMHN4.js → chunk-DH7DT6EO.js} +3 -3
  41. package/dist/{chunk-DDRSMHN4.js.map → chunk-DH7DT6EO.js.map} +1 -1
  42. package/dist/chunk-EOWWVFBF.js +14 -0
  43. package/dist/chunk-EOWWVFBF.js.map +1 -0
  44. package/dist/{chunk-5PZ43DCG.js → chunk-FLDIRXFU.js} +12 -13
  45. package/dist/chunk-FLDIRXFU.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-M43IOM5C.js → chunk-GWCBTD63.js} +3 -3
  49. package/dist/{chunk-M43IOM5C.js.map → chunk-GWCBTD63.js.map} +1 -1
  50. package/dist/chunk-GZ6UMHCK.js +103 -0
  51. package/dist/chunk-GZ6UMHCK.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-IJS7TPGV.js → chunk-HWDIVGME.js} +14 -7
  55. package/dist/chunk-HWDIVGME.js.map +1 -0
  56. package/dist/chunk-KSAJ6DED.js +16 -0
  57. package/dist/chunk-KSAJ6DED.js.map +1 -0
  58. package/dist/chunk-LH2UIEKN.js +42 -0
  59. package/dist/chunk-LH2UIEKN.js.map +1 -0
  60. package/dist/{chunk-JY6A2ZJZ.js → chunk-LNAV5E7S.js} +2 -2
  61. package/dist/{chunk-JY6A2ZJZ.js.map → chunk-LNAV5E7S.js.map} +1 -1
  62. package/dist/{chunk-CF4QHO4N.js → chunk-M2A6PZ7J.js} +10 -10
  63. package/dist/{chunk-CF4QHO4N.js.map → chunk-M2A6PZ7J.js.map} +1 -1
  64. package/dist/chunk-NYQQH4R5.js +40 -0
  65. package/dist/chunk-NYQQH4R5.js.map +1 -0
  66. package/dist/{chunk-TVYH4AN7.js → chunk-ODRO3KS6.js} +13 -13
  67. package/dist/chunk-ODRO3KS6.js.map +1 -0
  68. package/dist/chunk-PU3QWBEL.js +39 -0
  69. package/dist/chunk-PU3QWBEL.js.map +1 -0
  70. package/dist/{chunk-4BSHB7R3.js → chunk-QDAN43B6.js} +9 -9
  71. package/dist/chunk-QDAN43B6.js.map +1 -0
  72. package/dist/{chunk-XNIYSAMJ.js → chunk-RW2A4M2Q.js} +14 -9
  73. package/dist/chunk-RW2A4M2Q.js.map +1 -0
  74. package/dist/{chunk-TUTXXC3W.js → chunk-RY35IU3G.js} +3 -3
  75. package/dist/{chunk-TUTXXC3W.js.map → chunk-RY35IU3G.js.map} +1 -1
  76. package/dist/{chunk-EAI4POPB.js → chunk-TBLPZQSI.js} +56 -50
  77. package/dist/chunk-TBLPZQSI.js.map +1 -0
  78. package/dist/{chunk-AADAJL7D.js → chunk-UKPX3RIP.js} +8 -9
  79. package/dist/chunk-UKPX3RIP.js.map +1 -0
  80. package/dist/chunk-VDOBLABP.js +38 -0
  81. package/dist/chunk-VDOBLABP.js.map +1 -0
  82. package/dist/chunk-VNVVG47J.js +12 -0
  83. package/dist/chunk-VNVVG47J.js.map +1 -0
  84. package/dist/{chunk-4C5RZXBT.js → chunk-VZXML7EH.js} +8 -8
  85. package/dist/chunk-VZXML7EH.js.map +1 -0
  86. package/dist/{chunk-43M6GQ4Q.js → chunk-WC45VSST.js} +51 -32
  87. package/dist/chunk-WC45VSST.js.map +1 -0
  88. package/dist/{chunk-3MPF7FZV.js → chunk-WCWV5IX6.js} +3 -3
  89. package/dist/{chunk-3MPF7FZV.js.map → chunk-WCWV5IX6.js.map} +1 -1
  90. package/dist/chunk-WQKWPI6V.js +196 -0
  91. package/dist/chunk-WQKWPI6V.js.map +1 -0
  92. package/dist/{chunk-VAXCXZ53.js → chunk-WZUTBJC4.js} +5 -4
  93. package/dist/chunk-WZUTBJC4.js.map +1 -0
  94. package/dist/chunk-ZHMOH62S.js +101 -0
  95. package/dist/chunk-ZHMOH62S.js.map +1 -0
  96. package/dist/cli.js +356 -28
  97. package/dist/collapse.css +21 -33
  98. package/dist/collapse.js +1 -1
  99. package/dist/confetti.css +20 -13
  100. package/dist/confetti.js +7 -6
  101. package/dist/confetti.js.map +1 -1
  102. package/dist/count-badge.js +2 -2
  103. package/dist/date-field.js +22 -19
  104. package/dist/date-field.js.map +1 -1
  105. package/dist/date-picker.css +287 -185
  106. package/dist/date-range-field.js +75 -59
  107. package/dist/date-range-field.js.map +1 -1
  108. package/dist/datetime-field.js +26 -23
  109. package/dist/datetime-field.js.map +1 -1
  110. package/dist/dialog.css +35 -44
  111. package/dist/dialog.js +23 -22
  112. package/dist/dialog.js.map +1 -1
  113. package/dist/digit-strip.css +17 -17
  114. package/dist/dropdown.css +37 -28
  115. package/dist/dropdown.js +77 -40
  116. package/dist/dropdown.js.map +1 -1
  117. package/dist/emoji-picker.js +44 -45
  118. package/dist/emoji-picker.js.map +1 -1
  119. package/dist/facebook-feed.css +146 -149
  120. package/dist/facebook-feed.js +106 -102
  121. package/dist/facebook-feed.js.map +1 -1
  122. package/dist/flow-field.css +9 -5
  123. package/dist/flow-field.js +8 -7
  124. package/dist/flow-field.js.map +1 -1
  125. package/dist/glide.js +4 -3
  126. package/dist/icon.css +8 -11
  127. package/dist/input.css +81 -86
  128. package/dist/instagram-feed.css +66 -67
  129. package/dist/instagram-feed.js +61 -44
  130. package/dist/instagram-feed.js.map +1 -1
  131. package/dist/lens.css +42 -39
  132. package/dist/lens.js +17 -16
  133. package/dist/lens.js.map +1 -1
  134. package/dist/mcp.js +4 -3
  135. package/dist/menu-surface.css +55 -35
  136. package/dist/modal.css +3 -5
  137. package/dist/modal.js +12 -11
  138. package/dist/modal.js.map +1 -1
  139. package/dist/morphing-text.css +27 -17
  140. package/dist/morphing-text.js +14 -13
  141. package/dist/morphing-text.js.map +1 -1
  142. package/dist/motion-devtools.css +118 -69
  143. package/dist/motion-devtools.js +230 -65
  144. package/dist/motion-devtools.js.map +1 -1
  145. package/dist/motion-tokens.js +1 -1
  146. package/dist/multi-select.js +21 -16
  147. package/dist/multi-select.js.map +1 -1
  148. package/dist/number-field.js +15 -15
  149. package/dist/number-field.js.map +1 -1
  150. package/dist/odometer.css +23 -17
  151. package/dist/odometer.js +12 -11
  152. package/dist/odometer.js.map +1 -1
  153. package/dist/otp-field.js +3 -3
  154. package/dist/otp-field.js.map +1 -1
  155. package/dist/overlay.css +5 -10
  156. package/dist/pagination.css +11 -16
  157. package/dist/pagination.js +13 -10
  158. package/dist/pagination.js.map +1 -1
  159. package/dist/paint-CJQCM6ZO.js +260 -0
  160. package/dist/paint-CJQCM6ZO.js.map +1 -0
  161. package/dist/popover.css +14 -16
  162. package/dist/popover.js +10 -9
  163. package/dist/radio-group.css +65 -76
  164. package/dist/radio-group.js +30 -29
  165. package/dist/radio-group.js.map +1 -1
  166. package/dist/select.css +67 -76
  167. package/dist/select.js +19 -14
  168. package/dist/select.js.map +1 -1
  169. package/dist/sheet.css +13 -15
  170. package/dist/sheet.js +11 -10
  171. package/dist/spinner.css +115 -0
  172. package/dist/spinner.js +4 -0
  173. package/dist/spinner.js.map +1 -0
  174. package/dist/status-badge.js +9 -9
  175. package/dist/status-badge.js.map +1 -1
  176. package/dist/styles.css +35 -35
  177. package/dist/support-rail.css +110 -256
  178. package/dist/support-rail.js +116 -123
  179. package/dist/support-rail.js.map +1 -1
  180. package/dist/table.css +77 -85
  181. package/dist/table.js +44 -41
  182. package/dist/table.js.map +1 -1
  183. package/dist/tabs.css +81 -93
  184. package/dist/tabs.js +23 -20
  185. package/dist/tabs.js.map +1 -1
  186. package/dist/tag.css +49 -54
  187. package/dist/tag.js +13 -12
  188. package/dist/tag.js.map +1 -1
  189. package/dist/text-field.js +5 -5
  190. package/dist/textarea.css +47 -50
  191. package/dist/textarea.js +16 -16
  192. package/dist/textarea.js.map +1 -1
  193. package/dist/theme-grid.js +11 -0
  194. package/dist/theme-grid.js.map +1 -0
  195. package/dist/theme-switcher.css +107 -0
  196. package/dist/theme-switcher.js +70 -0
  197. package/dist/theme-switcher.js.map +1 -0
  198. package/dist/theme-transition-LLC644ZR.js +346 -0
  199. package/dist/theme-transition-LLC644ZR.js.map +1 -0
  200. package/dist/theme-transition.css +48 -0
  201. package/dist/theme.js +74 -27
  202. package/dist/theme.js.map +1 -1
  203. package/dist/tide-DJZMDAFT.js +57 -0
  204. package/dist/tide-DJZMDAFT.js.map +1 -0
  205. package/dist/tiktok.css +114 -119
  206. package/dist/tiktok.js +53 -52
  207. package/dist/tiktok.js.map +1 -1
  208. package/dist/time-field.js +26 -20
  209. package/dist/time-field.js.map +1 -1
  210. package/dist/toast-store.js +2 -1
  211. package/dist/toast.css +51 -79
  212. package/dist/toast.js +34 -26
  213. package/dist/toast.js.map +1 -1
  214. package/dist/toggle-tag.js +23 -14
  215. package/dist/toggle-tag.js.map +1 -1
  216. package/dist/toggle.css +27 -32
  217. package/dist/toggle.js +7 -7
  218. package/dist/toggle.js.map +1 -1
  219. package/dist/tooltip.css +17 -24
  220. package/dist/tooltip.js +117 -95
  221. package/dist/tooltip.js.map +1 -1
  222. package/dist/trigger.css +4 -4
  223. package/dist/types/components/composites/alert/Alert.d.ts +1 -2
  224. package/dist/types/components/composites/date-picker/TimeField.d.ts +1 -2
  225. package/dist/types/components/composites/date-picker/field-shell.d.ts +1 -1
  226. package/dist/types/components/composites/date-picker/month-jump.d.ts +11 -0
  227. package/dist/types/components/composites/date-picker/time-core.d.ts +1 -2
  228. package/dist/types/components/composites/dropdown/Dropdown.d.ts +9 -1
  229. package/dist/types/components/composites/dropdown/types.d.ts +14 -0
  230. package/dist/types/components/composites/emoji-picker/EmojiPickerPanel.d.ts +1 -1
  231. package/dist/types/components/composites/emoji-picker/data.d.ts +2 -5
  232. package/dist/types/components/composites/emoji-picker/react/useEmojiPicker.d.ts +0 -11
  233. package/dist/types/components/composites/emoji-picker/types.d.ts +3 -8
  234. package/dist/types/components/composites/select/MultiSelect.d.ts +6 -1
  235. package/dist/types/components/composites/select/Select.d.ts +6 -1
  236. package/dist/types/components/composites/select/core/index.d.ts +1 -1
  237. package/dist/types/components/composites/select/core/menu.d.ts +3 -3
  238. package/dist/types/components/composites/select/core/panel.d.ts +3 -3
  239. package/dist/types/components/composites/tabs/Tabs.d.ts +7 -10
  240. package/dist/types/components/composites/theme-switcher/ThemeGrid.d.ts +20 -0
  241. package/dist/types/components/composites/theme-switcher/ThemeSwitcher.d.ts +24 -0
  242. package/dist/types/components/composites/toast/Toast.d.ts +1 -1
  243. package/dist/types/components/composites/tooltip/Tooltip.d.ts +9 -1
  244. package/dist/types/components/composites/tooltip/tooltip-store.d.ts +5 -6
  245. package/dist/types/components/compound/support-rail/SupportRail.d.ts +10 -8
  246. package/dist/types/components/dev/MotionDevtools.d.ts +12 -5
  247. package/dist/types/components/expressive/theme-transition/bloom.d.ts +2 -0
  248. package/dist/types/components/expressive/theme-transition/paint.d.ts +2 -0
  249. package/dist/types/components/expressive/theme-transition/scene.d.ts +24 -0
  250. package/dist/types/components/expressive/theme-transition/theme-transition.d.ts +19 -0
  251. package/dist/types/components/expressive/theme-transition/tide.d.ts +2 -0
  252. package/dist/types/components/internal/hooks/use-host-election.d.ts +8 -0
  253. package/dist/types/components/internal/icon/Icon.d.ts +2 -3
  254. package/dist/types/components/internal/menu/highlight.d.ts +7 -0
  255. package/dist/types/components/internal/utils/activation.d.ts +0 -4
  256. package/dist/types/components/primitives/avatar/Avatar.d.ts +1 -1
  257. package/dist/types/components/primitives/button/Button.d.ts +10 -13
  258. package/dist/types/components/primitives/button/button-style.d.ts +15 -0
  259. package/dist/types/components/primitives/input/TextField.d.ts +1 -2
  260. package/dist/types/components/primitives/spinner/Spinner.d.ts +27 -0
  261. package/dist/types/components/primitives/textarea/Textarea.d.ts +0 -1
  262. package/dist/types/engine/animate.d.ts +1 -0
  263. package/dist/types/shared-slot.d.ts +1 -0
  264. package/dist/types/tokens/component-styles.generated.d.ts +80 -155
  265. package/dist/types/tokens/motion-defaults.generated.d.ts +34 -0
  266. package/dist/types/tokens/motion-scale.d.ts +2 -2
  267. package/dist/types/tokens/motion-tokens.d.ts +7 -0
  268. package/dist/types/tokens/theme-store.d.ts +47 -0
  269. package/dist/types/tokens/theme-sync.d.ts +9 -0
  270. package/dist/types/tokens/theme-tokens.generated.d.ts +693 -1117
  271. package/dist/types/tokens/theme.d.ts +28 -5
  272. package/dist/typing-lines.css +18 -11
  273. package/dist/typing-lines.js +9 -8
  274. package/dist/typing-lines.js.map +1 -1
  275. package/dist/weight-field.css +32 -18
  276. package/dist/weight-field.js +4 -4
  277. package/dist/weight-field.js.map +1 -1
  278. package/dist/youtube.css +91 -97
  279. package/dist/youtube.js +87 -86
  280. package/dist/youtube.js.map +1 -1
  281. package/package.json +27 -31
  282. package/skills/zyncat-ui/SKILL.md +5 -3
  283. package/skills/zyncat-ui/references/components.md +7 -4
  284. package/skills/zyncat-ui/references/theming.md +105 -34
  285. package/src/components/composites/alert/Alert.tsx +15 -12
  286. package/src/components/composites/alert/alert.css +27 -34
  287. package/src/components/composites/date-picker/DateField.tsx +1 -1
  288. package/src/components/composites/date-picker/DateRangeField.tsx +1 -1
  289. package/src/components/composites/date-picker/DateTimeField.tsx +4 -4
  290. package/src/components/composites/date-picker/TimeField.tsx +8 -5
  291. package/src/components/composites/date-picker/calendar-panel.tsx +33 -22
  292. package/src/components/composites/date-picker/date-picker.css +287 -185
  293. package/src/components/composites/date-picker/field-shell.tsx +7 -7
  294. package/src/components/composites/date-picker/month-jump.tsx +192 -0
  295. package/src/components/composites/date-picker/range-panel.tsx +51 -36
  296. package/src/components/composites/date-picker/time-core.tsx +4 -6
  297. package/src/components/composites/date-picker/use-day-focus.ts +1 -1
  298. package/src/components/composites/dialog/Dialog.tsx +11 -11
  299. package/src/components/composites/dialog/dialog.css +35 -44
  300. package/src/components/composites/dropdown/Dropdown.tsx +15 -2
  301. package/src/components/composites/dropdown/Dropdown.usage.md +7 -4
  302. package/src/components/composites/dropdown/dropdown.css +37 -28
  303. package/src/components/composites/dropdown/menu-panel.tsx +56 -27
  304. package/src/components/composites/dropdown/types.ts +28 -6
  305. package/src/components/composites/emoji-picker/EmojiPickerPanel.tsx +5 -4
  306. package/src/components/composites/emoji-picker/EmojiPickerPanel.usage.md +4 -4
  307. package/src/components/composites/emoji-picker/data.ts +2 -5
  308. package/src/components/composites/emoji-picker/dom.ts +6 -6
  309. package/src/components/composites/emoji-picker/react/category-bar.tsx +6 -6
  310. package/src/components/composites/emoji-picker/react/useEmojiPicker.ts +0 -11
  311. package/src/components/composites/emoji-picker/scaffold.ts +7 -7
  312. package/src/components/composites/emoji-picker/search.ts +0 -7
  313. package/src/components/composites/emoji-picker/styles.css +35 -35
  314. package/src/components/composites/emoji-picker/types.ts +3 -8
  315. package/src/components/composites/modal/Modal.tsx +2 -2
  316. package/src/components/composites/modal/modal.css +3 -5
  317. package/src/components/composites/pagination/Pagination.tsx +7 -7
  318. package/src/components/composites/pagination/pagination.css +11 -16
  319. package/src/components/composites/popover/Popover.tsx +2 -2
  320. package/src/components/composites/popover/popover.css +14 -16
  321. package/src/components/composites/select/MultiSelect.tsx +11 -2
  322. package/src/components/composites/select/MultiSelect.usage.md +2 -1
  323. package/src/components/composites/select/Select.tsx +10 -1
  324. package/src/components/composites/select/Select.usage.md +2 -1
  325. package/src/components/composites/select/core/index.ts +1 -1
  326. package/src/components/composites/select/core/menu.tsx +19 -4
  327. package/src/components/composites/select/core/panel.tsx +19 -15
  328. package/src/components/composites/select/core/trigger.tsx +5 -5
  329. package/src/components/composites/select/select.css +67 -76
  330. package/src/components/composites/sheet/Sheet.tsx +2 -2
  331. package/src/components/composites/sheet/sheet.css +13 -15
  332. package/src/components/composites/sheet/use-sheet-drag.ts +1 -1
  333. package/src/components/composites/table/Table.tsx +35 -35
  334. package/src/components/composites/table/table.css +77 -85
  335. package/src/components/composites/tabs/Tabs.tsx +20 -21
  336. package/src/components/composites/tabs/Tabs.usage.md +3 -2
  337. package/src/components/composites/tabs/tabs.css +81 -93
  338. package/src/components/composites/theme-switcher/ThemeGrid.tsx +133 -0
  339. package/src/components/composites/theme-switcher/ThemeGrid.usage.md +20 -0
  340. package/src/components/composites/theme-switcher/ThemeSwitcher.tsx +75 -0
  341. package/src/components/composites/theme-switcher/ThemeSwitcher.usage.md +21 -0
  342. package/src/components/composites/theme-switcher/theme-switcher.css +107 -0
  343. package/src/components/composites/toast/Toast.tsx +24 -18
  344. package/src/components/composites/toast/toast-store.ts +8 -6
  345. package/src/components/composites/toast/toast.css +51 -79
  346. package/src/components/composites/tooltip/Tooltip.tsx +40 -19
  347. package/src/components/composites/tooltip/Tooltip.usage.md +9 -1
  348. package/src/components/composites/tooltip/tooltip-host.tsx +55 -23
  349. package/src/components/composites/tooltip/tooltip-store.ts +36 -53
  350. package/src/components/composites/tooltip/tooltip.css +17 -24
  351. package/src/components/compound/support-rail/SupportRail.tsx +132 -144
  352. package/src/components/compound/support-rail/SupportRail.usage.md +7 -6
  353. package/src/components/compound/support-rail/support-rail.css +110 -256
  354. package/src/components/dev/MotionDevtools.tsx +272 -51
  355. package/src/components/dev/MotionDevtools.usage.md +12 -4
  356. package/src/components/dev/motion-devtools.css +118 -69
  357. package/src/components/dev/slowmo-engine.ts +16 -15
  358. package/src/components/expressive/confetti/Confetti.tsx +4 -4
  359. package/src/components/expressive/confetti/confetti.css +20 -13
  360. package/src/components/expressive/facebook-feed/chrome.tsx +2 -2
  361. package/src/components/expressive/facebook-feed/facebook-feed.css +146 -149
  362. package/src/components/expressive/facebook-feed/post.tsx +39 -39
  363. package/src/components/expressive/facebook-feed/reel.tsx +41 -37
  364. package/src/components/expressive/facebook-feed/story.tsx +27 -27
  365. package/src/components/expressive/flow-field/FlowField.tsx +5 -5
  366. package/src/components/expressive/flow-field/flow-field.css +9 -5
  367. package/src/components/expressive/instagram-feed/InstagramFeed.tsx +52 -44
  368. package/src/components/expressive/instagram-feed/instagram-feed.css +66 -67
  369. package/src/components/expressive/lens/Lens.tsx +14 -14
  370. package/src/components/expressive/lens/lens.css +42 -39
  371. package/src/components/expressive/morphing-text/MorphingText.tsx +12 -13
  372. package/src/components/expressive/morphing-text/morphing-text.css +27 -17
  373. package/src/components/expressive/odometer/Odometer.tsx +9 -9
  374. package/src/components/expressive/odometer/odometer.css +23 -17
  375. package/src/components/expressive/theme-transition/bloom.ts +88 -0
  376. package/src/components/expressive/theme-transition/paint.ts +296 -0
  377. package/src/components/expressive/theme-transition/scene.ts +38 -0
  378. package/src/components/expressive/theme-transition/theme-transition.css +48 -0
  379. package/src/components/expressive/theme-transition/theme-transition.ts +423 -0
  380. package/src/components/expressive/theme-transition/tide.ts +65 -0
  381. package/src/components/expressive/tiktok/TikTok.tsx +54 -54
  382. package/src/components/expressive/tiktok/tiktok.css +114 -119
  383. package/src/components/expressive/typing-lines/TypingLines.tsx +0 -0
  384. package/src/components/expressive/typing-lines/typing-lines.css +18 -11
  385. package/src/components/expressive/weight-field/WeightField.tsx +4 -4
  386. package/src/components/expressive/weight-field/weight-field.css +32 -18
  387. package/src/components/expressive/youtube/YouTube.tsx +4 -4
  388. package/src/components/expressive/youtube/glyphs.tsx +16 -16
  389. package/src/components/expressive/youtube/media.tsx +3 -3
  390. package/src/components/expressive/youtube/post.tsx +28 -28
  391. package/src/components/expressive/youtube/short.tsx +25 -25
  392. package/src/components/expressive/youtube/video.tsx +13 -13
  393. package/src/components/expressive/youtube/youtube.css +91 -97
  394. package/src/components/internal/glass/glass.css +20 -23
  395. package/src/components/internal/glass/glint.ts +3 -3
  396. package/src/components/internal/hooks/use-host-election.ts +46 -0
  397. package/src/components/internal/icon/Icon.tsx +3 -5
  398. package/src/components/internal/icon/IconSlot.tsx +1 -1
  399. package/src/components/internal/icon/icon.css +8 -11
  400. package/src/components/internal/menu/highlight.ts +12 -0
  401. package/src/components/internal/menu/menu-row.tsx +5 -5
  402. package/src/components/internal/menu/menu-surface.css +55 -35
  403. package/src/components/internal/overlay/layer.tsx +2 -1
  404. package/src/components/internal/overlay/modal.tsx +5 -4
  405. package/src/components/internal/overlay/overlay.css +5 -10
  406. package/src/components/internal/overlay/trigger.css +4 -4
  407. package/src/components/internal/utils/activation.ts +0 -4
  408. package/src/components/primitives/avatar/Avatar.tsx +24 -8
  409. package/src/components/primitives/avatar/AvatarGroup.tsx +4 -4
  410. package/src/components/primitives/avatar/avatar.css +53 -51
  411. package/src/components/primitives/badge/Badge.tsx +9 -9
  412. package/src/components/primitives/badge/StatusBadge.tsx +7 -7
  413. package/src/components/primitives/badge/badge.css +31 -37
  414. package/src/components/primitives/badge/digit-strip.css +17 -17
  415. package/src/components/primitives/badge/digit-strip.tsx +4 -4
  416. package/src/components/primitives/button/Button.tsx +14 -28
  417. package/src/components/primitives/button/button-style.ts +28 -0
  418. package/src/components/primitives/button/button.css +99 -118
  419. package/src/components/primitives/checkbox/Checkbox.tsx +10 -4
  420. package/src/components/primitives/checkbox/check-glyph.tsx +5 -5
  421. package/src/components/primitives/checkbox/checkbox.css +28 -33
  422. package/src/components/primitives/collapse/Collapse.tsx +2 -2
  423. package/src/components/primitives/collapse/collapse.css +21 -33
  424. package/src/components/primitives/collapse/collapse.typecheck.tsx +1 -1
  425. package/src/components/primitives/input/NumberField.tsx +11 -11
  426. package/src/components/primitives/input/OtpField.tsx +3 -3
  427. package/src/components/primitives/input/TextField.tsx +9 -10
  428. package/src/components/primitives/input/field-chrome.tsx +6 -6
  429. package/src/components/primitives/input/input.css +81 -86
  430. package/src/components/primitives/radio-group/RadioGroup.tsx +23 -23
  431. package/src/components/primitives/radio-group/radio-group.css +65 -76
  432. package/src/components/primitives/spinner/Spinner.tsx +70 -0
  433. package/src/components/primitives/spinner/Spinner.usage.md +19 -0
  434. package/src/components/primitives/spinner/spinner.css +115 -0
  435. package/src/components/primitives/tag/Tag.tsx +5 -5
  436. package/src/components/primitives/tag/ToggleTag.tsx +11 -6
  437. package/src/components/primitives/tag/tag.css +49 -54
  438. package/src/components/primitives/textarea/Textarea.tsx +13 -14
  439. package/src/components/primitives/textarea/textarea.css +47 -50
  440. package/src/components/primitives/toggle/Toggle.tsx +7 -7
  441. package/src/components/primitives/toggle/toggle.css +27 -32
  442. package/src/engine/animate.ts +12 -3
  443. package/src/engine/flip.ts +2 -1
  444. package/src/mcp/server.ts +5 -2
  445. package/src/motion/flip.ts +7 -8
  446. package/src/motion/glide.tsx +41 -26
  447. package/src/shared-slot.ts +10 -0
  448. package/src/styles.css +8 -16
  449. package/src/tokens/base.css +15 -0
  450. package/src/tokens/color.css +22 -63
  451. package/src/tokens/component-styles.generated.ts +81 -155
  452. package/src/tokens/dark.css +58 -0
  453. package/src/tokens/decisions.css +23 -0
  454. package/src/tokens/elevation.css +65 -23
  455. package/src/tokens/fonts.css +0 -2
  456. package/src/tokens/glass.css +17 -10
  457. package/src/tokens/motion-defaults.generated.ts +21 -0
  458. package/src/tokens/motion-scale.ts +2 -2
  459. package/src/tokens/motion-tokens.ts +65 -40
  460. package/src/tokens/motion-tokens.usage.md +5 -2
  461. package/src/tokens/motion.css +18 -28
  462. package/src/tokens/radius.css +12 -10
  463. package/src/tokens/reset.css +36 -0
  464. package/src/tokens/semantic.css +51 -39
  465. package/src/tokens/spacing.css +6 -7
  466. package/src/tokens/theme-store.ts +187 -0
  467. package/src/tokens/theme-sync.tsx +62 -0
  468. package/src/tokens/theme-tokens.generated.ts +708 -1121
  469. package/src/tokens/theme.tsx +116 -38
  470. package/src/tokens/theme.usage.md +26 -19
  471. package/src/tokens/typography.css +18 -20
  472. package/tailwind.css +187 -0
  473. package/dist/chunk-227ZW4V7.js.map +0 -1
  474. package/dist/chunk-43M6GQ4Q.js.map +0 -1
  475. package/dist/chunk-4BSHB7R3.js.map +0 -1
  476. package/dist/chunk-4C5RZXBT.js.map +0 -1
  477. package/dist/chunk-5PZ43DCG.js.map +0 -1
  478. package/dist/chunk-7IZJERGA.js +0 -80
  479. package/dist/chunk-7IZJERGA.js.map +0 -1
  480. package/dist/chunk-AADAJL7D.js.map +0 -1
  481. package/dist/chunk-CNWTIMIP.js +0 -39
  482. package/dist/chunk-CNWTIMIP.js.map +0 -1
  483. package/dist/chunk-EAI4POPB.js.map +0 -1
  484. package/dist/chunk-EF6RPXU7.js.map +0 -1
  485. package/dist/chunk-FONOS5RN.js.map +0 -1
  486. package/dist/chunk-FQEHSKEI.js +0 -38
  487. package/dist/chunk-FQEHSKEI.js.map +0 -1
  488. package/dist/chunk-HY5MPISE.js +0 -52
  489. package/dist/chunk-HY5MPISE.js.map +0 -1
  490. package/dist/chunk-I45AU6KH.js.map +0 -1
  491. package/dist/chunk-IJS7TPGV.js.map +0 -1
  492. package/dist/chunk-OWNMRMPN.js +0 -14
  493. package/dist/chunk-OWNMRMPN.js.map +0 -1
  494. package/dist/chunk-RJFGWJ4W.js.map +0 -1
  495. package/dist/chunk-TCUCYFT7.js +0 -25
  496. package/dist/chunk-TCUCYFT7.js.map +0 -1
  497. package/dist/chunk-TVYH4AN7.js.map +0 -1
  498. package/dist/chunk-TYHR4VNM.js.map +0 -1
  499. package/dist/chunk-VAXCXZ53.js.map +0 -1
  500. package/dist/chunk-XNIYSAMJ.js.map +0 -1
  501. package/dist/chunk-Y2YA7QRF.js +0 -17
  502. package/dist/chunk-Y2YA7QRF.js.map +0 -1
  503. package/src/tokens/avatar.css +0 -24
  504. package/src/tokens/icons.css +0 -11
  505. package/src/tokens/layers.css +0 -11
@@ -26,14 +26,17 @@ import { Presence } from '../../../motion/presence';
26
26
  import { popOut } from '../../../motion/presets';
27
27
  import { UIMotion } from '../../../tokens/motion-tokens';
28
28
  import { fireGlint } from '../../internal/glass/glint';
29
+ import { hostRegistry, useElectedHost } from '../../internal/hooks/use-host-election';
29
30
  import { Icon, type IconName } from '../../internal/icon/Icon';
30
31
  import { cx } from '../../internal/utils/cx';
31
32
  import { tokenPx } from '../../internal/utils/token-px';
32
33
  import { Button } from '../../primitives/button/Button';
34
+ import { Spinner } from '../../primitives/spinner/Spinner';
33
35
  import { DEFAULT_TOASTER_CONFIG, UIToast, type ToasterConfig, type ToastRecord, type ToastTone } from './toast-store';
34
36
 
35
37
  const SM = UIMotion;
36
38
  const store = UIToast;
39
+ const toasterReg = hostRegistry('toast.host@1');
37
40
 
38
41
  const COLLAPSE_GRACE = 140;
39
42
  const SWIPE_X = 64;
@@ -162,7 +165,7 @@ function ToastItem({
162
165
  as="li"
163
166
  ref={ref}
164
167
  exit={popOut(SM.scale.floating, SM.t.exit)}
165
- className="toast glass"
168
+ className="zc-toast zc-glass"
166
169
  data-tone={t.tone}
167
170
  data-behind={behind ? '' : undefined}
168
171
  role={t.tone === 'danger' ? 'alert' : 'status'}
@@ -172,30 +175,30 @@ function ToastItem({
172
175
  if (e.key === 'Escape' && t.dismissible) store.dismiss(t.id);
173
176
  }}
174
177
  >
175
- {t.node ? <div className="toast__custom">{t.node as ReactNode}</div> : <ToastBody t={t} />}
178
+ {t.node ? <div className="zc-toast__custom">{t.node as ReactNode}</div> : <ToastBody t={t} />}
176
179
  </Motion>
177
180
  );
178
181
  }
179
182
 
180
183
  function ToastBody({ t }: { t: ToastRecord }) {
181
184
  return (
182
- <div className="toast__inner">
185
+ <div className="zc-toast__inner">
183
186
  {(t.tone !== 'default' || isFinite(t.duration)) && (
184
- <span className="toast__icon">
187
+ <span className="zc-toast__icon">
185
188
  {t.tone !== 'default' && (
186
- <Motion as="span" className="toast__icon-glyph" animate={GLYPH_POP} deps={[t.tone]}>
189
+ <Motion as="span" className="zc-toast__icon-glyph" animate={GLYPH_POP} deps={[t.tone]}>
187
190
  {t.tone === 'loading' ? (
188
- <span className="toast__spinner" aria-hidden="true"></span>
191
+ <Spinner label={null} className="zc-toast__spinner" />
189
192
  ) : (
190
193
  <Icon name={TONE_ICON[t.tone] || 'info'} weight="fill" />
191
194
  )}
192
195
  </Motion>
193
196
  )}
194
197
  {isFinite(t.duration) && (
195
- <svg key={'ring-' + t.timerKey} className="toast__ring" viewBox="0 0 36 36" aria-hidden="true">
196
- <circle className="toast__ring-track" cx="18" cy="18" r="16.5"></circle>
198
+ <svg key={'ring-' + t.timerKey} className="zc-toast__ring" viewBox="0 0 36 36" aria-hidden="true">
199
+ <circle className="zc-toast__ring-track" cx="18" cy="18" r="16.5"></circle>
197
200
  <circle
198
- className="toast__ring-arc"
201
+ className="zc-toast__ring-arc"
199
202
  cx="18"
200
203
  cy="18"
201
204
  r="16.5"
@@ -206,12 +209,12 @@ function ToastBody({ t }: { t: ToastRecord }) {
206
209
  )}
207
210
  </span>
208
211
  )}
209
- <Motion className="toast__text" animate={TEXT_FADE} deps={[String(t.message) + '-' + String(t.description)]}>
210
- <p className="toast__message">{t.message}</p>
211
- {t.description != null && <p className="toast__desc">{t.description}</p>}
212
+ <Motion className="zc-toast__text" animate={TEXT_FADE} deps={[String(t.message) + '-' + String(t.description)]}>
213
+ <p className="zc-toast__message">{t.message}</p>
214
+ {t.description != null && <p className="zc-toast__desc">{t.description}</p>}
212
215
  </Motion>
213
216
  {t.count > 1 && (
214
- <Motion as="span" className="toast__count" animate={COUNT_POP} deps={[t.count]}>
217
+ <Motion as="span" className="zc-toast__count" animate={COUNT_POP} deps={[t.count]}>
215
218
  ×{t.count}
216
219
  </Motion>
217
220
  )}
@@ -219,7 +222,7 @@ function ToastBody({ t }: { t: ToastRecord }) {
219
222
  <Button
220
223
  variant="secondary"
221
224
  size="sm"
222
- className="toast__action"
225
+ className="zc-toast__action"
223
226
  onClick={() => {
224
227
  if (t.action.onClick) t.action.onClick();
225
228
  store.dismiss(t.id);
@@ -229,7 +232,7 @@ function ToastBody({ t }: { t: ToastRecord }) {
229
232
  </Button>
230
233
  )}
231
234
  {t.dismissible && (
232
- <button type="button" className="toast__close" aria-label="Dismiss" onClick={() => store.dismiss(t.id)}>
235
+ <button type="button" className="zc-toast__close" aria-label="Dismiss" onClick={() => store.dismiss(t.id)}>
233
236
  <Icon name="close" size="sm" />
234
237
  </button>
235
238
  )}
@@ -299,7 +302,7 @@ function ToastHost({ config, htmlProps }: { config: ToasterConfig; htmlProps?: H
299
302
  return createPortal(
300
303
  <ol
301
304
  {...htmlProps}
302
- className={cx('toast-viewport', paused && 'is-paused', htmlProps?.className)}
305
+ className={cx('zc-toast-viewport', paused && 'zc-is-paused', htmlProps?.className)}
303
306
  data-position={config.position}
304
307
  style={
305
308
  config.offset
@@ -359,18 +362,21 @@ export interface ToasterProps extends Partial<ToasterConfig> {
359
362
  htmlProps?: HTMLAttributes<HTMLOListElement> & DataAttributes;
360
363
  }
361
364
 
362
- export function Toaster({ htmlProps, ...props }: ToasterProps): ReactElement {
365
+ export function Toaster({ htmlProps, ...props }: ToasterProps): ReactElement | null {
363
366
  const config: ToasterConfig = { ...DEFAULT_TOASTER_CONFIG, ...stripUndefined(props) };
367
+ const isHost = useElectedHost(toasterReg, 'toaster');
364
368
 
365
369
  useEffect(() => {
370
+ if (!isHost) return undefined;
366
371
  store.config = config;
367
372
  store.mounted = true;
368
373
  if (config.expand) store.setExpanded(true);
369
374
  return () => {
370
375
  store.mounted = false;
371
376
  };
372
- }, [config.position, config.duration, config.visibleToasts, config.gap, config.offset, config.expand]);
377
+ }, [isHost, config.position, config.duration, config.visibleToasts, config.gap, config.offset, config.expand]);
373
378
 
379
+ if (!isHost) return null;
374
380
  return <ToastHost config={config} htmlProps={htmlProps} />;
375
381
  }
376
382
 
@@ -1,3 +1,5 @@
1
+ import { sharedSlot } from '../../../shared-slot';
2
+
1
3
  export type ToastTone = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'loading' | 'custom';
2
4
 
3
5
  export interface ToastAction {
@@ -62,8 +64,8 @@ const DURATION: Record<string, number> = {
62
64
  loading: Infinity,
63
65
  };
64
66
 
65
- let uid = 0;
66
- const timers = new Map<string, ReturnType<typeof setTimeout>>();
67
+ const ids = sharedSlot('toast.ids@1', () => ({ n: 0 }));
68
+ const timers = sharedSlot('toast.timers@1', () => new Map<string, ReturnType<typeof setTimeout>>());
67
69
 
68
70
  interface ToastStore {
69
71
  toasts: ToastRecord[];
@@ -85,7 +87,7 @@ interface ToastStore {
85
87
  setExpanded(v: boolean): void;
86
88
  }
87
89
 
88
- const store: ToastStore = {
90
+ const store: ToastStore = sharedSlot('toast.store@1', (): ToastStore => ({
89
91
  toasts: [],
90
92
  paused: false,
91
93
  expanded: false,
@@ -174,7 +176,7 @@ const store: ToastStore = {
174
176
  store.expanded = v;
175
177
  store.emit();
176
178
  },
177
- };
179
+ }));
178
180
 
179
181
  let warned = false;
180
182
  let warnScheduled = false;
@@ -201,7 +203,7 @@ function resolveDuration(tone: ToastTone, opt?: number): number {
201
203
 
202
204
  function make(tone: ToastTone, message: string | null, opts: ToastOptions = {}): string {
203
205
  warnIfDetached();
204
- const id = opts.id != null ? String(opts.id) : 'toast-' + ++uid;
206
+ const id = opts.id != null ? String(opts.id) : 'toast-' + ++ids.n;
205
207
  const duration = resolveDuration(tone, opts.duration);
206
208
  if (store.toasts.some((t) => t.id === id)) {
207
209
  return store.update(id, {
@@ -273,7 +275,7 @@ toast.promise = function <T>(promise: Promise<T>, msgs: ToastPromiseMsgs<T> = {}
273
275
 
274
276
  toast.custom = (node, opts = {}) => {
275
277
  warnIfDetached();
276
- const id = opts.id != null ? String(opts.id) : 'toast-' + ++uid;
278
+ const id = opts.id != null ? String(opts.id) : 'toast-' + ++ids.n;
277
279
  const duration = opts.duration != null ? opts.duration : Infinity;
278
280
  if (store.toasts.some((t) => t.id === id)) return store.update(id, { node });
279
281
  return store.add({
@@ -1,39 +1,34 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
- /* toast.css - the glass notification card, tinted per tone (a draining timer ring). */
5
-
6
- .toast-viewport {
4
+ .zc-toast-viewport {
7
5
  position: fixed;
8
6
  width: min(22.5rem, calc(100vw - 2 * var(--toast-offset, var(--space-6))));
9
7
  z-index: var(--layer-toast);
10
8
  margin: 0;
11
9
  padding: 0;
12
10
  list-style: none;
13
- pointer-events: none; /* only the cards themselves are live */
11
+ pointer-events: none;
14
12
  }
15
13
 
16
- /* Anchored by [data-position]; --toast-offset (set by <Toaster offset>) overrides the edge inset. */
17
- .toast-viewport[data-position^='top'] {
14
+ .zc-toast-viewport[data-position^='top'] {
18
15
  top: var(--toast-offset, var(--space-6));
19
16
  }
20
- .toast-viewport[data-position^='bottom'] {
17
+ .zc-toast-viewport[data-position^='bottom'] {
21
18
  bottom: var(--toast-offset, var(--space-6));
22
19
  }
23
- .toast-viewport[data-position$='right'] {
20
+ .zc-toast-viewport[data-position$='right'] {
24
21
  right: var(--toast-offset, var(--space-6));
25
22
  }
26
- .toast-viewport[data-position$='left'] {
23
+ .zc-toast-viewport[data-position$='left'] {
27
24
  left: var(--toast-offset, var(--space-6));
28
25
  }
29
- .toast-viewport[data-position$='center'] {
26
+ .zc-toast-viewport[data-position$='center'] {
30
27
  left: 50%;
31
28
  transform: translateX(-50%);
32
29
  }
33
30
 
34
- /* The card - a glass consumer (.glass is set in JSX). */
35
- .toast {
36
- /* tone hooks - set by [data-tone] below */
31
+ .zc-toast {
37
32
  --toast-hue: var(--text-subtle);
38
33
  --glass-fg: var(--text-strong);
39
34
  --glass-tint: color-mix(in oklab, var(--glass-tint-neutral) 75%, transparent);
@@ -43,59 +38,55 @@
43
38
  left: 0;
44
39
  width: 100%;
45
40
  box-sizing: border-box;
46
- overflow: hidden; /* custom content stays in the pane */
41
+ overflow: hidden;
47
42
  pointer-events: auto;
48
43
  border-radius: var(--radius-lg);
49
44
 
50
- /* Motion owns transform - keep only the color/shadow transitions (never smooth Motion's writes) */
51
45
  transition:
52
46
  background-color var(--duration-base) var(--ease-standard),
53
47
  box-shadow var(--duration-base) var(--ease-standard);
54
48
  }
55
49
 
56
- /* Cards pin to the stack's edge; Motion offsets each one away from it (up from bottom, down from top). */
57
- .toast-viewport[data-position^='bottom'] .toast {
50
+ .zc-toast-viewport[data-position^='bottom'] .zc-toast {
58
51
  bottom: 0;
59
52
  transform-origin: center bottom;
60
53
  }
61
- .toast-viewport[data-position^='top'] .toast {
54
+ .zc-toast-viewport[data-position^='top'] .zc-toast {
62
55
  top: 0;
63
56
  transform-origin: center top;
64
57
  }
65
58
 
66
- /* rich panes for genuine status, diluted to stay glass; neutral otherwise */
67
- .toast[data-tone='success'] {
59
+ .zc-toast[data-tone='success'] {
68
60
  --toast-hue: var(--success);
69
61
  --glass-fg: var(--success-text);
70
62
  --glass-tint: color-mix(in oklab, var(--glass-tint-success) 70%, transparent);
71
63
  }
72
- .toast[data-tone='danger'] {
64
+ .zc-toast[data-tone='danger'] {
73
65
  --toast-hue: var(--danger);
74
66
  --glass-fg: var(--danger-text);
75
67
  --glass-tint: color-mix(in oklab, var(--glass-tint-danger) 70%, transparent);
76
68
  }
77
- .toast[data-tone='warning'] {
69
+ .zc-toast[data-tone='warning'] {
78
70
  --toast-hue: var(--warning);
79
71
  --glass-fg: var(--warning-text);
80
72
  --glass-tint: color-mix(in oklab, var(--glass-tint-warning) 70%, transparent);
81
73
  }
82
- .toast[data-tone='info'] {
74
+ .zc-toast[data-tone='info'] {
83
75
  --toast-hue: var(--info);
84
76
  --glass-fg: var(--info-text);
85
77
  --glass-tint: color-mix(in oklab, var(--glass-tint-info) 70%, transparent);
86
78
  }
87
79
 
88
- /* receding cards fall quiet: tone drains out, sheen dims, content fades */
89
- .toast[data-behind] {
80
+ .zc-toast[data-behind] {
90
81
  --glass-tint: color-mix(in oklab, var(--glass-tint-neutral) 75%, transparent);
91
82
  --glass-sheen-rest: 0.3;
92
83
  }
93
- .toast[data-behind] .toast__inner,
94
- .toast[data-behind] .toast__custom {
84
+ .zc-toast[data-behind] .zc-toast__inner,
85
+ .zc-toast[data-behind] .zc-toast__custom {
95
86
  opacity: 0;
96
87
  }
97
88
 
98
- .toast__inner {
89
+ .zc-toast__inner {
99
90
  display: flex;
100
91
  align-items: center;
101
92
  gap: var(--space-3);
@@ -103,8 +94,7 @@
103
94
  transition: var(--transition-opacity);
104
95
  }
105
96
 
106
- /* the dial - glyph centered in the timer ring; one instrument, not two */
107
- .toast__icon {
97
+ .zc-toast__icon {
108
98
  position: relative;
109
99
  flex: none;
110
100
  display: grid;
@@ -113,36 +103,35 @@
113
103
  height: calc(var(--icon-md) + 2 * var(--space-2));
114
104
  color: var(--toast-hue);
115
105
  }
116
- .toast__icon-glyph {
106
+ .zc-toast__icon-glyph {
117
107
  display: grid;
118
108
  place-items: center;
119
109
  }
120
110
 
121
- /* the ring - a draining arc; linear by design, animation-duration set at runtime to the toast's lifetime */
122
- .toast__ring {
111
+ .zc-toast__ring {
123
112
  position: absolute;
124
113
  inset: 0;
125
114
  width: 100%;
126
115
  height: 100%;
127
- transform: rotate(-90deg); /* arc starts at 12 o'clock */
116
+ transform: rotate(-90deg);
128
117
  pointer-events: none;
129
118
  }
130
- .toast__ring circle {
119
+ .zc-toast__ring circle {
131
120
  fill: none;
132
121
  stroke-width: var(--border-emphasis);
133
122
  }
134
- .toast__ring-track {
123
+ .zc-toast__ring-track {
135
124
  stroke: color-mix(in oklab, var(--toast-hue) 16%, transparent);
136
125
  }
137
- .toast__ring-arc {
126
+ .zc-toast__ring-arc {
138
127
  stroke: var(--toast-hue);
139
128
  stroke-linecap: round;
140
- stroke-dasharray: 1; /* pathLength=1 - offset is a fraction */
141
- animation-name: toast-ring;
129
+ stroke-dasharray: 1; /* the circle sets pathLength=1 */
130
+ animation-name: toast-ring; /* the duration is inline, set to the toast's lifetime */
142
131
  animation-timing-function: linear;
143
132
  animation-fill-mode: both;
144
133
  }
145
- .toast-viewport.is-paused .toast__ring-arc {
134
+ .zc-toast-viewport.zc-is-paused .zc-toast__ring-arc {
146
135
  animation-play-state: paused;
147
136
  }
148
137
  @keyframes toast-ring {
@@ -154,27 +143,26 @@
154
143
  }
155
144
  }
156
145
 
157
- .toast__text {
146
+ .zc-toast__text {
158
147
  flex: 1 1 auto;
159
148
  min-width: 0;
160
149
  }
161
- .toast__message {
150
+ .zc-toast__message {
162
151
  margin: 0;
163
152
  font: var(--type-label);
164
153
  color: var(--glass-fg);
165
154
  text-wrap: pretty;
166
155
  }
167
- .toast__desc {
156
+ .zc-toast__desc {
168
157
  margin: var(--space-1) 0 0;
169
158
  font: var(--type-caption);
170
159
  color: color-mix(in oklab, var(--glass-fg) 76%, transparent);
171
160
  text-wrap: pretty;
172
161
  }
173
162
 
174
- /* coalesce counter - same toast refired becomes a xN counter (mono) */
175
- .toast__count {
163
+ .zc-toast__count {
176
164
  flex: none;
177
- font-family: var(--font-mono);
165
+ font-family: var(--font-code);
178
166
  font-size: var(--size-micro);
179
167
  line-height: var(--leading-micro);
180
168
  font-variant-numeric: tabular-nums;
@@ -184,12 +172,11 @@
184
172
  padding: 0 var(--space-1);
185
173
  }
186
174
 
187
- .toast__action {
175
+ .zc-toast__action {
188
176
  flex: none;
189
177
  }
190
178
 
191
- /* dismiss - appears only while the card is hovered or holds focus */
192
- .toast__close {
179
+ .zc-toast__close {
193
180
  flex: none;
194
181
  appearance: none;
195
182
  display: grid;
@@ -208,53 +195,38 @@
208
195
  var(--transition-control),
209
196
  opacity var(--duration-fast) var(--ease-standard);
210
197
  }
211
- .toast:hover .toast__close,
212
- .toast:focus-within .toast__close {
198
+ .zc-toast:hover .zc-toast__close,
199
+ .zc-toast:focus-within .zc-toast__close {
213
200
  opacity: 1;
214
201
  }
215
- .toast__close:hover {
202
+ .zc-toast__close:hover {
216
203
  background: color-mix(in oklab, var(--glass-fg) 9%, transparent);
217
204
  color: var(--glass-fg);
218
205
  }
219
- .toast__close:active {
206
+ .zc-toast__close:active {
220
207
  background: color-mix(in oklab, var(--glass-fg) 14%, transparent);
221
208
  }
222
- .toast__close:focus-visible {
223
- outline: none;
224
- box-shadow: var(--focus-ring);
209
+ .zc-toast__close:focus-visible {
210
+ outline: var(--focus-ring);
225
211
  opacity: 1;
226
212
  }
227
213
 
228
- /* Loading spinner - continuous --duration-spin (linear is allowed for loops; reduced motion slows, never freezes) */
229
- .toast__spinner {
230
- display: block;
231
- box-sizing: border-box;
232
- width: var(--icon-sm);
233
- height: var(--icon-sm);
234
- border-radius: var(--radius-full);
235
- border: var(--border-emphasis) solid currentColor;
236
- border-right-color: transparent;
214
+ .zc-toast__spinner {
215
+ font-size: var(--icon-sm);
237
216
  color: var(--text-muted);
238
- animation: toast-spin var(--duration-spin) linear infinite;
239
- }
240
- @keyframes toast-spin {
241
- to {
242
- transform: rotate(1turn);
243
- }
244
217
  }
245
218
 
246
- /* Custom slot - bare neutral glass; the consumer owns the interior. */
247
- .toast__custom {
219
+ .zc-toast__custom {
248
220
  padding: var(--space-3) var(--space-4);
249
221
  transition: var(--transition-opacity);
250
222
  }
251
223
 
252
224
  @media (prefers-reduced-motion: reduce) {
253
- /* travel/gestures collapse via the tokens; the ring is data, so it keeps running */
254
- .toast,
255
- .toast__close,
256
- .toast__inner,
257
- .toast__custom {
225
+ /* the ring keeps running: it is a clock, not decoration */
226
+ .zc-toast,
227
+ .zc-toast__close,
228
+ .zc-toast__inner,
229
+ .zc-toast__custom {
258
230
  transition: none;
259
231
  }
260
232
  }
@@ -15,6 +15,8 @@ import {
15
15
  } from 'react';
16
16
 
17
17
  import type { DataAttributes } from '../../../dom-props';
18
+ import { usePresence } from '../../../motion/presence-context';
19
+ import { useControllable } from '../../internal/hooks/use-controllable';
18
20
  import { cx } from '../../internal/utils/cx';
19
21
  import { TooltipHost } from './tooltip-host';
20
22
  import { CLOSE_GRACE, OPEN_DELAY, store, useHostElection, type Placement } from './tooltip-store';
@@ -26,6 +28,14 @@ export interface TooltipProps {
26
28
  shortcut?: string | null;
27
29
  /** Preferred side; flips automatically when out of viewport room. */
28
30
  placement?: Placement;
31
+ /** Controlled visibility - shows with no hover or focus, and stays until you clear it.
32
+ * Omit to stay uncontrolled. One bubble shows at a time: the newest wins, and the ones
33
+ * under it come back when it leaves. */
34
+ open?: boolean;
35
+ /** Initial state when uncontrolled. Default false. */
36
+ defaultOpen?: boolean;
37
+ /** Fires whenever hover, focus, or Escape asks for a new state. Pair with `open` for controlled use. */
38
+ onOpenChange?: (open: boolean) => void;
29
39
  /** Suppress the tooltip entirely (trigger renders untouched). */
30
40
  disabled?: boolean;
31
41
  /** ms before a cold hover shows; warm hovers + focus are instant. Default 350. */
@@ -45,6 +55,9 @@ export function Tooltip({
45
55
  content,
46
56
  shortcut = null,
47
57
  placement = 'top',
58
+ open: controlledOpen,
59
+ defaultOpen = false,
60
+ onOpenChange,
48
61
  disabled = false,
49
62
  openDelay = OPEN_DELAY,
50
63
  closeDelay = CLOSE_GRACE,
@@ -54,38 +67,46 @@ export function Tooltip({
54
67
  }: TooltipProps) {
55
68
  const wrapRef = useRef<HTMLSpanElement | null>(null);
56
69
  const openTimer = useRef<ReturnType<typeof setTimeout> | 0>(0);
57
- const myId = id || 'tip-' + useId();
70
+ const autoId = useId();
71
+ const myId = id || 'tip-' + autoId;
58
72
  const isHost = useHostElection();
73
+ const { isPresent } = usePresence();
74
+ const [open, setOpen] = useControllable(controlledOpen, defaultOpen, onOpenChange);
59
75
 
60
- const anchorEl = (): HTMLElement | null => (wrapRef.current?.firstElementChild as HTMLElement) ?? null;
76
+ useEffect(() => {
77
+ if (!open || disabled || !isPresent) return undefined;
78
+ store.open({
79
+ id: myId,
80
+ content,
81
+ shortcut,
82
+ placement,
83
+ anchor: () => (wrapRef.current?.firstElementChild as HTMLElement) ?? null,
84
+ dismiss: () => setOpen(false),
85
+ });
86
+ return () => store.close(myId, closeDelay);
87
+ }, [open, disabled, isPresent, content, shortcut, placement, closeDelay, myId, setOpen]);
88
+
89
+ useEffect(() => {
90
+ if (!isPresent) store.close(myId, 0);
91
+ }, [isPresent, myId]);
61
92
 
62
93
  useEffect(
63
94
  () => () => {
64
95
  clearTimeout(openTimer.current);
65
96
  store.close(myId, 0);
66
97
  },
67
- [],
68
- ); // eslint-disable-line react-hooks/exhaustive-deps
98
+ [myId],
99
+ );
69
100
 
70
101
  function show(immediate: boolean) {
71
- if (disabled) return;
72
102
  clearTimeout(openTimer.current);
73
- if (!anchorEl()) return;
74
- const open = () =>
75
- store.open({
76
- id: myId,
77
- content,
78
- shortcut,
79
- placement,
80
- anchor: anchorEl,
81
- rect: () => anchorEl()!.getBoundingClientRect(),
82
- });
83
- if (immediate || store.isWarm()) open();
84
- else openTimer.current = setTimeout(open, openDelay);
103
+ if (disabled || !wrapRef.current?.firstElementChild) return;
104
+ if (immediate || store.isWarm()) setOpen(true);
105
+ else openTimer.current = setTimeout(() => setOpen(true), openDelay);
85
106
  }
86
107
  function hide() {
87
108
  clearTimeout(openTimer.current);
88
- store.close(myId, closeDelay);
109
+ setOpen(false);
89
110
  }
90
111
 
91
112
  const onEnter = (e: PointerEvent) => {
@@ -100,7 +121,7 @@ export function Tooltip({
100
121
  <span
101
122
  {...htmlProps}
102
123
  ref={wrapRef}
103
- className={cx('tooltip-anchor', htmlProps?.className)}
124
+ className={cx('zc-tooltip-anchor', htmlProps?.className)}
104
125
  onPointerEnter={onEnter}
105
126
  onPointerLeave={hide}
106
127
  onPointerDown={hide}
@@ -5,10 +5,18 @@ Docs: https://ui.zyncat.app/tooltip
5
5
 
6
6
  Transient hint on hover/focus; wraps any child (no ref wiring needed).
7
7
 
8
- content, shortcut, placement top|bottom|left|right.
8
+ content, shortcut, placement top|bottom|left|right; open/defaultOpen/onOpenChange to drive it yourself, for a
9
+ hint no hover would ever fire. With open set, hover, focus and Escape decide nothing on their own - they only
10
+ report through onOpenChange, so a parent that ignores it keeps the bubble up. Scrolling never closes it: the
11
+ bubble tracks its anchor through page and container scroll, and leaves on pointer out, blur, or a handled Escape.
12
+ It also leaves the moment a surface around it starts animating out, so a tooltip inside a closing Popover or
13
+ Modal goes with it rather than outliving the panel.
9
14
 
10
15
  ```tsx
11
16
  <Tooltip content="Save changes" shortcut="⌘S">
12
17
  <Button>Save</Button>
13
18
  </Tooltip>
19
+ <Tooltip content="Drafts land here" open={tour === 'drafts'} onOpenChange={(next) => !next && nextStep()}>
20
+ <Button variant="ghost">Drafts</Button>
21
+ </Tooltip>
14
22
  ```