@zyncat/ui 0.15.0 → 0.18.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 (339) hide show
  1. package/README.md +32 -202
  2. package/dist/alert.css +1 -1
  3. package/dist/alert.js +18 -10
  4. package/dist/alert.js.map +1 -1
  5. package/dist/avatar.css +3 -2
  6. package/dist/badge.css +1 -1
  7. package/dist/bloom-HV23M4AW.js +81 -0
  8. package/dist/bloom-HV23M4AW.js.map +1 -0
  9. package/dist/button.css +38 -31
  10. package/dist/button.js +4 -1
  11. package/dist/checkbox.css +1 -1
  12. package/dist/{chunk-5W5TKANX.js → chunk-2DNKZ57E.js} +3 -3
  13. package/dist/{chunk-5W5TKANX.js.map → chunk-2DNKZ57E.js.map} +1 -1
  14. package/dist/chunk-2YGHPQ66.js +16 -0
  15. package/dist/chunk-2YGHPQ66.js.map +1 -0
  16. package/dist/{chunk-N2GJEO5Z.js → chunk-6H3IJ752.js} +24 -9
  17. package/dist/chunk-6H3IJ752.js.map +1 -0
  18. package/dist/chunk-7NHY2CRA.js +132 -0
  19. package/dist/chunk-7NHY2CRA.js.map +1 -0
  20. package/dist/{chunk-PWQVSVXR.js → chunk-AIAPXRCI.js} +20 -19
  21. package/dist/chunk-AIAPXRCI.js.map +1 -0
  22. package/dist/{chunk-K45CWVHS.js → chunk-BRKGYLEQ.js} +12 -9
  23. package/dist/chunk-BRKGYLEQ.js.map +1 -0
  24. package/dist/{chunk-MDSRZ4QR.js → chunk-C3D32LE3.js} +6 -5
  25. package/dist/chunk-C3D32LE3.js.map +1 -0
  26. package/dist/chunk-F2TB3TT6.js +103 -0
  27. package/dist/chunk-F2TB3TT6.js.map +1 -0
  28. package/dist/{chunk-FVPNICF4.js → chunk-F64Z42PJ.js} +6 -6
  29. package/dist/{chunk-FVPNICF4.js.map → chunk-F64Z42PJ.js.map} +1 -1
  30. package/dist/{chunk-QGVFFT2B.js → chunk-HBWRKEW4.js} +3 -3
  31. package/dist/{chunk-QGVFFT2B.js.map → chunk-HBWRKEW4.js.map} +1 -1
  32. package/dist/{chunk-CAXQJSIE.js → chunk-JINATP4N.js} +13 -13
  33. package/dist/chunk-JINATP4N.js.map +1 -0
  34. package/dist/chunk-KSAJ6DED.js +16 -0
  35. package/dist/chunk-KSAJ6DED.js.map +1 -0
  36. package/dist/{chunk-BH4JFWXQ.js → chunk-M2KGLH2G.js} +19 -16
  37. package/dist/chunk-M2KGLH2G.js.map +1 -0
  38. package/dist/{chunk-6X3G4GIM.js → chunk-N43NDSME.js} +3 -3
  39. package/dist/{chunk-6X3G4GIM.js.map → chunk-N43NDSME.js.map} +1 -1
  40. package/dist/chunk-NYQQH4R5.js +40 -0
  41. package/dist/chunk-NYQQH4R5.js.map +1 -0
  42. package/dist/{chunk-BTF6DAE3.js → chunk-ODRO3KS6.js} +4 -4
  43. package/dist/{chunk-BTF6DAE3.js.map → chunk-ODRO3KS6.js.map} +1 -1
  44. package/dist/chunk-PXQBJMPJ.js +50 -0
  45. package/dist/chunk-PXQBJMPJ.js.map +1 -0
  46. package/dist/{chunk-GJTHWB6O.js → chunk-QDAN43B6.js} +3 -3
  47. package/dist/{chunk-GJTHWB6O.js.map → chunk-QDAN43B6.js.map} +1 -1
  48. package/dist/{chunk-RBSHRRNO.js → chunk-RJENXXTI.js} +5 -5
  49. package/dist/{chunk-RBSHRRNO.js.map → chunk-RJENXXTI.js.map} +1 -1
  50. package/dist/chunk-RLNCRDAL.js +89 -0
  51. package/dist/chunk-RLNCRDAL.js.map +1 -0
  52. package/dist/{chunk-GOLSYGRA.js → chunk-TBLPZQSI.js} +84 -48
  53. package/dist/chunk-TBLPZQSI.js.map +1 -0
  54. package/dist/{chunk-WZUTBJC4.js → chunk-TDHLZY6I.js} +23 -5
  55. package/dist/chunk-TDHLZY6I.js.map +1 -0
  56. package/dist/chunk-TP2AC5MQ.js +13 -0
  57. package/dist/chunk-TP2AC5MQ.js.map +1 -0
  58. package/dist/chunk-TRPAKUIB.js +196 -0
  59. package/dist/chunk-TRPAKUIB.js.map +1 -0
  60. package/dist/{chunk-5X3MJRIM.js → chunk-UKPX3RIP.js} +3 -3
  61. package/dist/{chunk-5X3MJRIM.js.map → chunk-UKPX3RIP.js.map} +1 -1
  62. package/dist/{chunk-5GBV45YD.js → chunk-V6QAAOA5.js} +3 -3
  63. package/dist/{chunk-5GBV45YD.js.map → chunk-V6QAAOA5.js.map} +1 -1
  64. package/dist/{chunk-FLQVOSFC.js → chunk-VJXP256V.js} +10 -10
  65. package/dist/chunk-VJXP256V.js.map +1 -0
  66. package/dist/{chunk-IUQAUBVM.js → chunk-VQFILXQN.js} +5 -5
  67. package/dist/chunk-VQFILXQN.js.map +1 -0
  68. package/dist/{chunk-CFRGQJ23.js → chunk-VZXML7EH.js} +4 -4
  69. package/dist/{chunk-CFRGQJ23.js.map → chunk-VZXML7EH.js.map} +1 -1
  70. package/dist/{chunk-FEXUS4SV.js → chunk-XKDR22VE.js} +11 -5
  71. package/dist/chunk-XKDR22VE.js.map +1 -0
  72. package/dist/cli.js +262 -45
  73. package/dist/collapse.css +8 -5
  74. package/dist/confetti.css +3 -3
  75. package/dist/confetti.js +2 -2
  76. package/dist/date-field.js +20 -18
  77. package/dist/date-field.js.map +1 -1
  78. package/dist/date-picker.css +168 -43
  79. package/dist/date-range-field.js +42 -27
  80. package/dist/date-range-field.js.map +1 -1
  81. package/dist/datetime-field.js +21 -19
  82. package/dist/datetime-field.js.map +1 -1
  83. package/dist/dialog.css +4 -3
  84. package/dist/dialog.js +12 -12
  85. package/dist/dialog.js.map +1 -1
  86. package/dist/digit-strip.css +1 -1
  87. package/dist/dropdown.css +1 -1
  88. package/dist/dropdown.js +16 -16
  89. package/dist/dropdown.js.map +1 -1
  90. package/dist/emoji-picker.js +41 -26
  91. package/dist/emoji-picker.js.map +1 -1
  92. package/dist/facebook-feed.css +1 -1
  93. package/dist/flow-field.css +4 -4
  94. package/dist/flow-field.js +3 -3
  95. package/dist/flow-field.js.map +1 -1
  96. package/dist/glide.js +3 -3
  97. package/dist/icon.css +1 -1
  98. package/dist/input.css +7 -4
  99. package/dist/instagram-feed.css +1 -1
  100. package/dist/instagram-feed.js +2 -2
  101. package/dist/lens.css +1 -2
  102. package/dist/lens.js +2 -2
  103. package/dist/mcp.js +1 -1
  104. package/dist/menu-surface.css +1 -1
  105. package/dist/modal.css +1 -1
  106. package/dist/modal.js +10 -10
  107. package/dist/modal.js.map +1 -1
  108. package/dist/morphing-text.css +2 -2
  109. package/dist/morphing-text.js +2 -2
  110. package/dist/motion-devtools.css +77 -2
  111. package/dist/motion-devtools.js +194 -37
  112. package/dist/motion-devtools.js.map +1 -1
  113. package/dist/motion-tokens.js +1 -1
  114. package/dist/multi-select.js +12 -12
  115. package/dist/number-field.js +3 -3
  116. package/dist/odometer.css +1 -1
  117. package/dist/odometer.js +2 -2
  118. package/dist/overlay.css +1 -1
  119. package/dist/pagination.css +1 -1
  120. package/dist/pagination.js +6 -4
  121. package/dist/pagination.js.map +1 -1
  122. package/dist/paint-CJQCM6ZO.js +260 -0
  123. package/dist/paint-CJQCM6ZO.js.map +1 -0
  124. package/dist/popover.css +1 -1
  125. package/dist/popover.js +10 -10
  126. package/dist/radio-group.css +6 -4
  127. package/dist/radio-group.js +6 -6
  128. package/dist/select.css +1 -1
  129. package/dist/select.js +12 -12
  130. package/dist/sheet.css +1 -1
  131. package/dist/sheet.js +9 -9
  132. package/dist/spinner.css +115 -0
  133. package/dist/spinner.js +4 -0
  134. package/dist/spinner.js.map +1 -0
  135. package/dist/status-badge.js +2 -2
  136. package/dist/styles.css +1 -1
  137. package/dist/support-rail.css +76 -238
  138. package/dist/support-rail.js +99 -107
  139. package/dist/support-rail.js.map +1 -1
  140. package/dist/table.css +2 -2
  141. package/dist/table.js +8 -6
  142. package/dist/table.js.map +1 -1
  143. package/dist/tabs.css +10 -14
  144. package/dist/tabs.js +17 -11
  145. package/dist/tabs.js.map +1 -1
  146. package/dist/tag.css +1 -1
  147. package/dist/tag.js +6 -6
  148. package/dist/text-field.js +3 -3
  149. package/dist/textarea.css +1 -1
  150. package/dist/textarea.js +2 -2
  151. package/dist/theme-grid.js +11 -0
  152. package/dist/theme-grid.js.map +1 -0
  153. package/dist/theme-switcher.css +107 -0
  154. package/dist/theme-switcher.js +70 -0
  155. package/dist/theme-switcher.js.map +1 -0
  156. package/dist/theme-transition-VGLPZDJI.js +346 -0
  157. package/dist/theme-transition-VGLPZDJI.js.map +1 -0
  158. package/dist/theme-transition.css +48 -0
  159. package/dist/theme.js +57 -26
  160. package/dist/theme.js.map +1 -1
  161. package/dist/tide-DJZMDAFT.js +57 -0
  162. package/dist/tide-DJZMDAFT.js.map +1 -0
  163. package/dist/tiktok.css +2 -3
  164. package/dist/tiktok.js +2 -2
  165. package/dist/time-field.js +4 -4
  166. package/dist/toast.css +2 -14
  167. package/dist/toast.js +12 -10
  168. package/dist/toast.js.map +1 -1
  169. package/dist/toggle-tag.js +2 -2
  170. package/dist/toggle.css +1 -1
  171. package/dist/tooltip.css +1 -1
  172. package/dist/tooltip.js +25 -22
  173. package/dist/tooltip.js.map +1 -1
  174. package/dist/trigger.css +1 -1
  175. package/dist/types/components/composites/date-picker/month-jump.d.ts +11 -0
  176. package/dist/types/components/composites/theme-switcher/ThemeGrid.d.ts +20 -0
  177. package/dist/types/components/composites/theme-switcher/ThemeSwitcher.d.ts +24 -0
  178. package/dist/types/components/compound/support-rail/SupportRail.d.ts +10 -8
  179. package/dist/types/components/dev/MotionDevtools.d.ts +10 -5
  180. package/dist/types/components/expressive/theme-transition/bloom.d.ts +2 -0
  181. package/dist/types/components/expressive/theme-transition/paint.d.ts +2 -0
  182. package/dist/types/components/expressive/theme-transition/scene.d.ts +24 -0
  183. package/dist/types/components/expressive/theme-transition/theme-transition.d.ts +19 -0
  184. package/dist/types/components/expressive/theme-transition/tide.d.ts +2 -0
  185. package/dist/types/components/internal/hooks/use-press-feedback.d.ts +7 -0
  186. package/dist/types/components/internal/icon/Icon.d.ts +1 -0
  187. package/dist/types/components/internal/overlay/layer.d.ts +7 -1
  188. package/dist/types/components/internal/utils/token-px.d.ts +1 -1
  189. package/dist/types/components/primitives/button/Button.d.ts +9 -12
  190. package/dist/types/components/primitives/button/button-style.d.ts +15 -0
  191. package/dist/types/components/primitives/spinner/Spinner.d.ts +27 -0
  192. package/dist/types/engine/animate.d.ts +1 -0
  193. package/dist/types/motion/motion-timing.d.ts +1 -1
  194. package/dist/types/tokens/component-styles.generated.d.ts +35 -38
  195. package/dist/types/tokens/motion-tokens.d.ts +5 -3
  196. package/dist/types/tokens/theme-store.d.ts +47 -0
  197. package/dist/types/tokens/theme-sync.d.ts +7 -1
  198. package/dist/types/tokens/theme-tokens.generated.d.ts +125 -115
  199. package/dist/types/tokens/theme.d.ts +28 -5
  200. package/dist/typing-lines.css +1 -1
  201. package/dist/typing-lines.js +2 -2
  202. package/dist/typing-lines.js.map +1 -1
  203. package/dist/weight-field.css +2 -2
  204. package/dist/youtube.css +1 -1
  205. package/dist/youtube.js +2 -2
  206. package/package.json +20 -24
  207. package/skills/zyncat-ui/SKILL.md +1 -1
  208. package/skills/zyncat-ui/references/components.md +5 -2
  209. package/skills/zyncat-ui/references/theming.md +31 -23
  210. package/src/components/composites/alert/Alert.tsx +7 -3
  211. package/src/components/composites/alert/alert.css +1 -1
  212. package/src/components/composites/date-picker/calendar-panel.tsx +10 -4
  213. package/src/components/composites/date-picker/date-picker.css +168 -43
  214. package/src/components/composites/date-picker/month-jump.tsx +192 -0
  215. package/src/components/composites/date-picker/range-panel.tsx +20 -5
  216. package/src/components/composites/dialog/Dialog.tsx +2 -2
  217. package/src/components/composites/dialog/dialog.css +4 -3
  218. package/src/components/composites/dropdown/Dropdown.tsx +5 -5
  219. package/src/components/composites/dropdown/dropdown.css +1 -1
  220. package/src/components/composites/emoji-picker/react/category-bar.tsx +17 -5
  221. package/src/components/composites/emoji-picker/scaffold.ts +6 -5
  222. package/src/components/composites/emoji-picker/styles.css +1 -1
  223. package/src/components/composites/modal/Modal.tsx +2 -2
  224. package/src/components/composites/modal/modal.css +1 -1
  225. package/src/components/composites/pagination/pagination.css +1 -1
  226. package/src/components/composites/popover/Popover.tsx +5 -5
  227. package/src/components/composites/popover/popover.css +1 -1
  228. package/src/components/composites/select/core/menu.tsx +15 -10
  229. package/src/components/composites/select/select.css +1 -1
  230. package/src/components/composites/sheet/Sheet.tsx +2 -2
  231. package/src/components/composites/sheet/sheet.css +1 -1
  232. package/src/components/composites/table/table.css +2 -2
  233. package/src/components/composites/tabs/Tabs.tsx +13 -7
  234. package/src/components/composites/tabs/tabs.css +10 -14
  235. package/src/components/composites/theme-switcher/ThemeGrid.tsx +133 -0
  236. package/src/components/composites/theme-switcher/ThemeGrid.usage.md +20 -0
  237. package/src/components/composites/theme-switcher/ThemeSwitcher.tsx +75 -0
  238. package/src/components/composites/theme-switcher/ThemeSwitcher.usage.md +21 -0
  239. package/src/components/composites/theme-switcher/theme-switcher.css +107 -0
  240. package/src/components/composites/toast/Toast.tsx +2 -1
  241. package/src/components/composites/toast/toast.css +2 -14
  242. package/src/components/composites/tooltip/tooltip-host.tsx +19 -17
  243. package/src/components/composites/tooltip/tooltip.css +1 -1
  244. package/src/components/compound/support-rail/SupportRail.tsx +116 -128
  245. package/src/components/compound/support-rail/SupportRail.usage.md +7 -6
  246. package/src/components/compound/support-rail/support-rail.css +76 -238
  247. package/src/components/dev/MotionDevtools.tsx +252 -42
  248. package/src/components/dev/MotionDevtools.usage.md +12 -4
  249. package/src/components/dev/motion-devtools.css +77 -2
  250. package/src/components/dev/slowmo-engine.ts +1 -1
  251. package/src/components/expressive/confetti/confetti.css +3 -3
  252. package/src/components/expressive/facebook-feed/facebook-feed.css +1 -1
  253. package/src/components/expressive/flow-field/FlowField.tsx +1 -1
  254. package/src/components/expressive/flow-field/flow-field.css +4 -4
  255. package/src/components/expressive/instagram-feed/instagram-feed.css +1 -1
  256. package/src/components/expressive/lens/lens.css +1 -2
  257. package/src/components/expressive/morphing-text/morphing-text.css +2 -2
  258. package/src/components/expressive/odometer/odometer.css +1 -1
  259. package/src/components/expressive/theme-transition/bloom.ts +88 -0
  260. package/src/components/expressive/theme-transition/paint.ts +296 -0
  261. package/src/components/expressive/theme-transition/scene.ts +38 -0
  262. package/src/components/expressive/theme-transition/theme-transition.css +48 -0
  263. package/src/components/expressive/theme-transition/theme-transition.ts +423 -0
  264. package/src/components/expressive/theme-transition/tide.ts +65 -0
  265. package/src/components/expressive/tiktok/tiktok.css +2 -3
  266. package/src/components/expressive/typing-lines/TypingLines.tsx +0 -0
  267. package/src/components/expressive/typing-lines/typing-lines.css +1 -1
  268. package/src/components/expressive/weight-field/weight-field.css +2 -2
  269. package/src/components/expressive/youtube/youtube.css +1 -1
  270. package/src/components/internal/glass/glass.css +1 -1
  271. package/src/components/internal/hooks/use-press-feedback.ts +52 -0
  272. package/src/components/internal/icon/Icon.tsx +2 -0
  273. package/src/components/internal/icon/icon.css +1 -1
  274. package/src/components/internal/menu/menu-surface.css +1 -1
  275. package/src/components/internal/overlay/layer.tsx +35 -2
  276. package/src/components/internal/overlay/overlay.css +1 -1
  277. package/src/components/internal/overlay/position.ts +2 -2
  278. package/src/components/internal/overlay/trigger.css +1 -1
  279. package/src/components/internal/utils/token-px.ts +4 -4
  280. package/src/components/primitives/avatar/avatar.css +3 -2
  281. package/src/components/primitives/badge/badge.css +1 -1
  282. package/src/components/primitives/badge/digit-strip.css +1 -1
  283. package/src/components/primitives/button/Button.tsx +28 -27
  284. package/src/components/primitives/button/button-style.ts +28 -0
  285. package/src/components/primitives/button/button.css +38 -31
  286. package/src/components/primitives/checkbox/checkbox.css +1 -1
  287. package/src/components/primitives/collapse/collapse.css +8 -5
  288. package/src/components/primitives/input/input.css +7 -4
  289. package/src/components/primitives/radio-group/radio-group.css +6 -4
  290. package/src/components/primitives/spinner/Spinner.tsx +70 -0
  291. package/src/components/primitives/spinner/Spinner.usage.md +19 -0
  292. package/src/components/primitives/spinner/spinner.css +115 -0
  293. package/src/components/primitives/tag/tag.css +1 -1
  294. package/src/components/primitives/textarea/textarea.css +1 -1
  295. package/src/components/primitives/toggle/toggle.css +1 -1
  296. package/src/engine/animate.ts +10 -2
  297. package/src/mcp/server.ts +2 -1
  298. package/src/motion/glide.tsx +9 -6
  299. package/src/motion/motion-timing.ts +5 -2
  300. package/src/styles.css +3 -4
  301. package/src/tokens/base.css +5 -5
  302. package/src/tokens/color.css +8 -9
  303. package/src/tokens/component-styles.generated.ts +36 -38
  304. package/src/tokens/dark.css +8 -13
  305. package/src/tokens/decisions.css +9 -12
  306. package/src/tokens/elevation.css +18 -26
  307. package/src/tokens/glass.css +3 -2
  308. package/src/tokens/motion-defaults.generated.ts +1 -1
  309. package/src/tokens/motion-tokens.ts +27 -8
  310. package/src/tokens/motion.css +9 -9
  311. package/src/tokens/radius.css +3 -2
  312. package/src/tokens/reset.css +36 -0
  313. package/src/tokens/semantic.css +12 -22
  314. package/src/tokens/spacing.css +1 -1
  315. package/src/tokens/theme-store.ts +187 -0
  316. package/src/tokens/theme-sync.tsx +49 -2
  317. package/src/tokens/theme-tokens.generated.ts +128 -116
  318. package/src/tokens/theme.tsx +96 -24
  319. package/src/tokens/theme.usage.md +25 -24
  320. package/src/tokens/typography.css +4 -3
  321. package/tailwind.css +8 -14
  322. package/dist/chunk-6SUHSSOK.js +0 -25
  323. package/dist/chunk-6SUHSSOK.js.map +0 -1
  324. package/dist/chunk-BH4JFWXQ.js.map +0 -1
  325. package/dist/chunk-CAXQJSIE.js.map +0 -1
  326. package/dist/chunk-FEXUS4SV.js.map +0 -1
  327. package/dist/chunk-FLQVOSFC.js.map +0 -1
  328. package/dist/chunk-GOLSYGRA.js.map +0 -1
  329. package/dist/chunk-IUQAUBVM.js.map +0 -1
  330. package/dist/chunk-K45CWVHS.js.map +0 -1
  331. package/dist/chunk-MDSRZ4QR.js.map +0 -1
  332. package/dist/chunk-N2GJEO5Z.js.map +0 -1
  333. package/dist/chunk-PWQVSVXR.js.map +0 -1
  334. package/dist/chunk-UE63OOVG.js +0 -13
  335. package/dist/chunk-UE63OOVG.js.map +0 -1
  336. package/dist/chunk-UYSXJ7MH.js +0 -52
  337. package/dist/chunk-UYSXJ7MH.js.map +0 -1
  338. package/dist/chunk-WZUTBJC4.js.map +0 -1
  339. package/src/tokens/fonts.css +0 -1
@@ -2,9 +2,18 @@
2
2
 
3
3
  import './motion-devtools.css';
4
4
 
5
- import { useEffect, useState, type CSSProperties } from 'react';
5
+ import {
6
+ useCallback,
7
+ useEffect,
8
+ useRef,
9
+ useState,
10
+ type CSSProperties,
11
+ type MouseEvent as ReactMouseEvent,
12
+ type PointerEvent as ReactPointerEvent,
13
+ } from 'react';
6
14
  import { createPortal } from 'react-dom';
7
15
 
16
+ import { startDrag } from '../../engine';
8
17
  import { cx } from '../internal/utils/cx';
9
18
  import { Button } from '../primitives/button/Button';
10
19
  import { Checkbox } from '../primitives/checkbox/Checkbox';
@@ -14,11 +23,12 @@ import { motionSlowmo, shouldBeActive, type SlowmoState } from './slowmo-engine'
14
23
  export type MotionDevtoolsPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
15
24
 
16
25
  export interface MotionDevtoolsProps {
17
- /** Which corner of the viewport to pin to. @default 'bottom-right' */
26
+ /** Which corner of the viewport the panel rests in. Dragging moves it off. @default 'bottom-right' */
18
27
  placement?: MotionDevtoolsPlacement;
19
- /** Distance from the viewport edges, in px. @default 16 */
28
+ /** Distance from the viewport edges at rest, in px. @default 16 */
20
29
  offset?: number;
21
- /** Quick-select slow-down factors (1 = real time). @default [1, 2, 4, 8, 16] */
30
+ /** Quick-select slow-down factors (1 = real time). Also the ladder the slower/faster
31
+ * shortcuts step through. @default [1, 2, 4, 8, 16] */
22
32
  presets?: number[];
23
33
  /** Upper bound of the fine slider. @default 16 */
24
34
  maxFactor?: number;
@@ -27,7 +37,11 @@ export interface MotionDevtoolsProps {
27
37
  /** Scale setTimeout/setInterval too, so duration-coupled JS cleanups don't truncate
28
38
  * slowed CSS. Exposed as a live toggle in the panel. @default true */
29
39
  scaleTimers?: boolean;
30
- /** Remember the chosen factor across reloads (localStorage). @default true */
40
+ /** Bind the global Alt-chord shortcuts. The panel lists them under Shortcuts. @default true */
41
+ hotkeys?: boolean;
42
+ /** Let the panel be dragged anywhere in the viewport by its header. @default true */
43
+ draggable?: boolean;
44
+ /** Remember the chosen factor and dragged position across reloads (localStorage). @default true */
31
45
  persist?: boolean;
32
46
  /** Start with the full panel open rather than collapsed to its header. @default false */
33
47
  defaultOpen?: boolean;
@@ -35,8 +49,64 @@ export interface MotionDevtoolsProps {
35
49
  className?: string;
36
50
  }
37
51
 
52
+ type ChordId = 'freeze' | 'slower' | 'faster' | 'realtime' | 'panel';
53
+
54
+ interface Chord {
55
+ id: ChordId;
56
+ code: string;
57
+ label: string;
58
+ keys: string[];
59
+ }
60
+
61
+ const CHORDS: Chord[] = [
62
+ { id: 'freeze', code: 'KeyP', label: 'Freeze / resume', keys: ['P'] },
63
+ { id: 'slower', code: 'Comma', label: 'Slower', keys: [','] },
64
+ { id: 'faster', code: 'Period', label: 'Faster', keys: ['.'] },
65
+ { id: 'realtime', code: 'Digit0', label: 'Real time', keys: ['0'] },
66
+ { id: 'panel', code: 'KeyM', label: 'Show / hide', keys: ['M'] },
67
+ ];
68
+
38
69
  const STORAGE_KEY = 'zyncat-ui:motion-devtools';
70
+ const DRAG_SLOP_PX = 4;
71
+ const TEXT_INPUT_TYPES = new Set([
72
+ 'text',
73
+ 'search',
74
+ 'email',
75
+ 'url',
76
+ 'tel',
77
+ 'password',
78
+ 'number',
79
+ 'date',
80
+ 'time',
81
+ 'datetime-local',
82
+ 'month',
83
+ 'week',
84
+ ]);
85
+
39
86
  const fmt = (n: number) => (Number.isInteger(n) ? String(n) : n.toFixed(1));
87
+ const clampRange = (min: number, max: number, v: number) => (v < min ? min : v > max ? max : v);
88
+ const altLabel = () => (/mac|iphone|ipad|ipod/i.test(navigator.userAgent) ? '⌥' : 'Alt');
89
+
90
+ function isTextEntry(target: EventTarget | null): boolean {
91
+ if (!(target instanceof HTMLElement)) return false;
92
+ if (target.isContentEditable) return true;
93
+ if (target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) return true;
94
+ return target instanceof HTMLInputElement && TEXT_INPUT_TYPES.has(target.type);
95
+ }
96
+
97
+ function Chevron({ open }: { open: boolean }) {
98
+ return (
99
+ <svg
100
+ className={'zc-mdt__chevron' + (open ? ' zc-mdt__chevron--open' : '')}
101
+ width="12"
102
+ height="12"
103
+ viewBox="0 0 12 12"
104
+ aria-hidden="true"
105
+ >
106
+ <path d="M2.5 4.5 6 8l3.5-3.5" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" />
107
+ </svg>
108
+ );
109
+ }
40
110
 
41
111
  function GaugeGlyph() {
42
112
  return (
@@ -62,6 +132,14 @@ function GaugeGlyph() {
62
132
  );
63
133
  }
64
134
 
135
+ function PauseGlyph() {
136
+ return (
137
+ <svg className="zc-mdt__glyph" width="15" height="15" viewBox="0 0 24 24" aria-hidden="true">
138
+ <path d="M9 5v14M15 5v14" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" />
139
+ </svg>
140
+ );
141
+ }
142
+
65
143
  export function MotionDevtools({
66
144
  placement = 'bottom-right',
67
145
  offset = 16,
@@ -69,28 +147,100 @@ export function MotionDevtools({
69
147
  maxFactor = 16,
70
148
  defaultFactor = 1,
71
149
  scaleTimers = true,
150
+ hotkeys = true,
151
+ draggable = true,
72
152
  persist = true,
73
153
  defaultOpen = false,
74
154
  className,
75
155
  }: MotionDevtoolsProps) {
76
156
  const [mounted, setMounted] = useState(false);
77
157
  const [open, setOpen] = useState(defaultOpen);
158
+ const [showKeys, setShowKeys] = useState(false);
78
159
  const [snap, setSnap] = useState<SlowmoState>(() => motionSlowmo.get());
79
160
  const [timers, setTimers] = useState(scaleTimers);
80
161
 
162
+ const rootRef = useRef<HTMLDivElement>(null);
163
+ const posRef = useRef({ x: 0, y: 0 });
164
+ const pressRef = useRef({ x: 0, y: 0 });
165
+ const runChordRef = useRef<(id: ChordId) => void>(() => {});
166
+
167
+ const writePos = useCallback(() => {
168
+ const el = rootRef.current;
169
+ if (el) el.style.translate = `${posRef.current.x}px ${posRef.current.y}px`;
170
+ }, []);
171
+
172
+ const clampIntoView = useCallback(() => {
173
+ const el = rootRef.current;
174
+ if (!el) return;
175
+ writePos();
176
+ const rect = el.getBoundingClientRect();
177
+ const restLeft = rect.left - posRef.current.x;
178
+ const restTop = rect.top - posRef.current.y;
179
+ posRef.current = {
180
+ x: clampRange(-restLeft, window.innerWidth - rect.width - restLeft, posRef.current.x),
181
+ y: clampRange(-restTop, window.innerHeight - rect.height - restTop, posRef.current.y),
182
+ };
183
+ writePos();
184
+ }, [writePos]);
185
+
186
+ const savePrefs = useCallback(() => {
187
+ if (!persist) return;
188
+ const { factor, paused } = motionSlowmo.get();
189
+ try {
190
+ localStorage.setItem(STORAGE_KEY, JSON.stringify({ factor, paused, ...posRef.current }));
191
+ } catch {}
192
+ }, [persist]);
193
+
194
+ const setFactor = (factor: number) => motionSlowmo.set({ factor, paused: false });
195
+
196
+ const stepFactor = (direction: 1 | -1) => {
197
+ const ladder = [...new Set(presets)].sort((a, b) => a - b);
198
+ const current = motionSlowmo.get().factor;
199
+ const next = direction > 0 ? ladder.find((p) => p > current) : ladder.findLast((p) => p < current);
200
+ if (next !== undefined) setFactor(next);
201
+ };
202
+
203
+ const onHeadPointerDown = (e: ReactPointerEvent<HTMLButtonElement>) => {
204
+ pressRef.current = { x: e.clientX, y: e.clientY };
205
+ const el = rootRef.current;
206
+ if (!draggable || e.button !== 0 || !el) return;
207
+ const start = { ...posRef.current };
208
+ let moved = false;
209
+ startDrag(e, {
210
+ onMove: (info) => {
211
+ if (!moved && Math.hypot(info.offset.x, info.offset.y) < DRAG_SLOP_PX) return;
212
+ moved = true;
213
+ el.dataset.dragging = '';
214
+ posRef.current = { x: start.x + info.offset.x, y: start.y + info.offset.y };
215
+ clampIntoView();
216
+ },
217
+ onEnd: () => {
218
+ if (!moved) return;
219
+ delete el.dataset.dragging;
220
+ savePrefs();
221
+ },
222
+ });
223
+ };
224
+
225
+ const isDragRelease = (e: ReactMouseEvent<HTMLButtonElement>) =>
226
+ e.detail !== 0 && Math.hypot(e.clientX - pressRef.current.x, e.clientY - pressRef.current.y) >= DRAG_SLOP_PX;
227
+
81
228
  useEffect(() => motionSlowmo.subscribe(setSnap), []);
82
229
 
83
230
  useEffect(() => {
84
231
  setMounted(true);
85
- let initial: Partial<SlowmoState> = { factor: defaultFactor, paused: false };
232
+ let stored: { factor?: number; paused?: boolean; x?: number; y?: number } = {};
86
233
  if (persist) {
87
234
  try {
88
235
  const raw = localStorage.getItem(STORAGE_KEY);
89
- if (raw) initial = { ...initial, ...JSON.parse(raw) };
236
+ if (raw) stored = JSON.parse(raw);
90
237
  } catch {}
91
238
  }
92
- motionSlowmo.set(initial);
93
- if ((initial.factor ?? 1) > 1 || initial.paused) setOpen(true);
239
+ posRef.current = { x: stored.x ?? 0, y: stored.y ?? 0 };
240
+ const factor = stored.factor ?? defaultFactor;
241
+ const paused = stored.paused ?? false;
242
+ motionSlowmo.set({ factor, paused });
243
+ if (shouldBeActive(factor, paused)) setOpen(true);
94
244
  // eslint-disable-next-line react-hooks/exhaustive-deps
95
245
  }, []);
96
246
 
@@ -99,61 +249,99 @@ export function MotionDevtools({
99
249
  }, [timers]);
100
250
 
101
251
  useEffect(() => {
102
- if (!persist) return;
103
- try {
104
- localStorage.setItem(STORAGE_KEY, JSON.stringify({ factor: snap.factor, paused: snap.paused }));
105
- } catch {}
106
- }, [snap.factor, snap.paused, persist]);
252
+ if (mounted) savePrefs();
253
+ }, [snap.factor, snap.paused, mounted, savePrefs]);
254
+
255
+ useEffect(() => {
256
+ const el = rootRef.current;
257
+ if (!mounted || !el) return;
258
+ const observer = new ResizeObserver(clampIntoView);
259
+ observer.observe(el);
260
+ window.addEventListener('resize', clampIntoView);
261
+ return () => {
262
+ observer.disconnect();
263
+ window.removeEventListener('resize', clampIntoView);
264
+ };
265
+ }, [mounted, clampIntoView]);
266
+
267
+ useEffect(() => {
268
+ runChordRef.current = (id: ChordId) => {
269
+ const live = motionSlowmo.get();
270
+ switch (id) {
271
+ case 'freeze':
272
+ return motionSlowmo.set({ paused: !live.paused });
273
+ case 'slower':
274
+ return stepFactor(1);
275
+ case 'faster':
276
+ return stepFactor(-1);
277
+ case 'realtime':
278
+ return motionSlowmo.reset();
279
+ case 'panel':
280
+ return setOpen((o) => !o);
281
+ }
282
+ };
283
+ });
284
+
285
+ useEffect(() => {
286
+ if (!hotkeys) return;
287
+ const onKeyDown = (e: KeyboardEvent) => {
288
+ if (!e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || isTextEntry(e.target)) return;
289
+ const chord = CHORDS.find((c) => c.code === e.code);
290
+ if (!chord) return;
291
+ e.preventDefault();
292
+ e.stopPropagation();
293
+ runChordRef.current(chord.id);
294
+ };
295
+ window.addEventListener('keydown', onKeyDown, true);
296
+ return () => window.removeEventListener('keydown', onKeyDown, true);
297
+ }, [hotkeys]);
107
298
 
108
299
  if (!mounted) return null;
109
300
 
110
301
  const active = shouldBeActive(snap.factor, snap.paused);
302
+ const fill = `${((Math.min(snap.factor, maxFactor) - 1) / Math.max(1, maxFactor - 1)) * 100}%`;
303
+ const alt = altLabel();
304
+
305
+ const readout = snap.paused
306
+ ? { value: 'Paused', unit: 'frozen' }
307
+ : snap.factor === 1
308
+ ? { value: 'Normal', unit: 'real-time' }
309
+ : { value: `${fmt(snap.factor)}×`, unit: 'slower' };
310
+
111
311
  const rootClass = cx(
112
312
  'zc-mdt',
113
313
  `zc-mdt--${placement}`,
114
314
  active && 'zc-mdt--active',
115
315
  snap.paused && 'zc-mdt--paused',
316
+ draggable && 'zc-mdt--draggable',
116
317
  className,
117
318
  );
118
319
 
119
- const setFactor = (factor: number) => motionSlowmo.set({ factor, paused: false });
120
- const fill = `${((Math.min(snap.factor, maxFactor) - 1) / Math.max(1, maxFactor - 1)) * 100}%`;
121
- const pillBadge = snap.factor === 1 ? '1×' : `${fmt(snap.factor)}×`;
122
-
123
320
  return createPortal(
124
- <div className={rootClass} style={{ '--mdt-offset': `${offset}px` } as CSSProperties}>
321
+ <div ref={rootRef} className={rootClass} style={{ '--mdt-offset': `${offset}px` } as CSSProperties}>
125
322
  <div className={'zc-mdt__panel' + (open ? ' zc-is-open' : '')} role="group" aria-label="Motion devtools">
126
323
  <button
127
324
  className="zc-mdt__head"
128
- onClick={() => setOpen((o) => !o)}
325
+ onPointerDown={onHeadPointerDown}
326
+ onClick={(e) => {
327
+ if (!isDragRelease(e)) setOpen((o) => !o);
328
+ }}
129
329
  aria-expanded={open}
130
- title="Motion devtools"
330
+ title={draggable ? 'Motion devtools - drag to move' : 'Motion devtools'}
131
331
  aria-label={open ? 'Collapse motion devtools' : 'Expand motion devtools'}
132
332
  >
133
- <GaugeGlyph />
333
+ {snap.paused ? <PauseGlyph /> : <GaugeGlyph />}
134
334
  <span className="zc-mdt__spacer" />
135
- <span className="zc-mdt__badge">{pillBadge}</span>
136
- <svg
137
- className={'zc-mdt__chevron' + (open ? ' zc-mdt__chevron--open' : '')}
138
- width="12"
139
- height="12"
140
- viewBox="0 0 12 12"
141
- aria-hidden="true"
142
- >
143
- <path d="M2.5 4.5 6 8l3.5-3.5" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" />
144
- </svg>
335
+ <span className="zc-mdt__badge">{`${fmt(snap.factor)}×`}</span>
336
+ <Chevron open={open} />
145
337
  </button>
146
338
 
147
339
  <Collapse open={open} fade>
148
340
  <div className="zc-mdt__body">
149
341
  <span className="zc-mdt__title">Motion</span>
150
342
  <div className="zc-mdt__readout">
151
- <span className="zc-mdt__value">
152
- {snap.paused ? 'Paused' : snap.factor === 1 ? 'Normal' : `${fmt(snap.factor)}×`}
153
- </span>
154
- <span className="zc-mdt__unit">
155
- {snap.paused ? 'frozen' : snap.factor === 1 ? 'real-time' : 'slower'}
156
- </span>
343
+ <span className="zc-mdt__value">{readout.value}</span>
344
+ <span className="zc-mdt__unit">{readout.unit}</span>
157
345
  </div>
158
346
 
159
347
  <input
@@ -196,10 +384,32 @@ export function MotionDevtools({
196
384
 
197
385
  <div className="zc-mdt__opt">
198
386
  <Checkbox size="sm" checked={timers} onChange={(e) => setTimers(e.target.checked)} label="Scale timers" />
199
- <p className="zc-mdt__hint">
200
- Slows CSS, Motion &amp; WAAPI together. Timer scaling keeps duration-based cleanups from cutting
201
- animations short.
202
- </p>
387
+
388
+ <button className="zc-mdt__more" onClick={() => setShowKeys((k) => !k)} aria-expanded={showKeys}>
389
+ <span>Shortcuts</span>
390
+ <Chevron open={showKeys} />
391
+ </button>
392
+
393
+ <Collapse open={showKeys} fade>
394
+ <dl className="zc-mdt__keys">
395
+ {CHORDS.map((chord) => (
396
+ <div className="zc-mdt__keyrow" key={chord.id}>
397
+ <dt>{chord.label}</dt>
398
+ <dd>
399
+ <kbd className="zc-mdt__key">{alt}</kbd>
400
+ {chord.keys.map((key) => (
401
+ <kbd className="zc-mdt__key" key={key}>
402
+ {key}
403
+ </kbd>
404
+ ))}
405
+ </dd>
406
+ </div>
407
+ ))}
408
+ </dl>
409
+ <p className="zc-mdt__hint">
410
+ Timer scaling keeps duration-based cleanups from cutting slowed animations short.
411
+ </p>
412
+ </Collapse>
203
413
  </div>
204
414
  </div>
205
415
  </Collapse>
@@ -4,10 +4,18 @@ Group: dev
4
4
 
5
5
  Dev-only floating panel that slows or freezes EVERY animation at once (CSS and WAAPI) for motion debugging.
6
6
 
7
- Mount once at the app root - no provider, touches no other component. Gate behind a dev check; keep
8
- it out of production. placement top-left|top-right|bottom-left|bottom-right, offset, presets,
9
- maxFactor, defaultFactor, scaleTimers, persist, defaultOpen, className (extra class on the panel
10
- root, e.g. a host token scope). Also exports motionSlowmo for console/hotkey control.
7
+ Mount once at the app root behind a dev check: no provider, no wrapper, and no effect on any other
8
+ component. `placement` top-left|top-right|bottom-left|bottom-right, `offset`, `presets`, `maxFactor`,
9
+ `defaultFactor`, `defaultOpen`, `scaleTimers`, `hotkeys`, `draggable`, `persist`, `className` (extra
10
+ class on the panel root, e.g. a host token scope). While `hotkeys` is on, Alt chords reach it from
11
+ anywhere on the page: Alt P freezes or resumes, Alt , and Alt . step down and up the `presets` ladder,
12
+ Alt 0 returns to real time, Alt M shows or hides the panel. They match the physical key, so a layout
13
+ where Option+P types another character still fires them, they want Alt alone, and they stay quiet
14
+ while you are typing in a field. The open panel lists them under Shortcuts at its foot, closed until
15
+ you ask for it, with the note on what timer scaling buys you. With `draggable` on the header is a drag
16
+ handle: the panel goes anywhere in the viewport and snaps to nothing, held inside the edges as you
17
+ drag, as the window resizes, and as it widens on open. `persist` remembers where you dropped it
18
+ alongside the chosen factor. `motionSlowmo` is exported too, to drive the same state from the console.
11
19
 
12
20
  ```tsx
13
21
  {
@@ -1,4 +1,4 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
4
  .zc-mdt {
@@ -13,9 +13,10 @@
13
13
 
14
14
  --mdt-offset: 16px;
15
15
  --mdt-surface: color-mix(in oklab, var(--bg-surface, #fff) 88%, transparent);
16
+ --_mdt-body-max: calc(100dvh - var(--mdt-offset) * 2 - 3.25rem);
16
17
 
17
18
  position: fixed;
18
- z-index: 2147483000;
19
+ z-index: var(--layer-infinity, 2147483647);
19
20
  display: flex;
20
21
  color: var(--text-body, oklch(0.35 0.01 264));
21
22
  font-family: var(--font-body, ui-sans-serif, system-ui, sans-serif);
@@ -88,6 +89,17 @@
88
89
  .zc-mdt__head:focus-visible {
89
90
  outline: var(--ring-accent, 3px solid oklch(0.7 0.12 185 / 0.35));
90
91
  }
92
+ .zc-mdt--draggable .zc-mdt__head {
93
+ cursor: grab;
94
+ touch-action: none;
95
+ }
96
+ .zc-mdt[data-dragging] {
97
+ user-select: none;
98
+ }
99
+ .zc-mdt[data-dragging] .zc-mdt__head {
100
+ cursor: grabbing;
101
+ background: var(--neutral-wash, oklch(0.5 0.01 264 / 0.07));
102
+ }
91
103
 
92
104
  .zc-mdt__glyph {
93
105
  color: var(--text-subtle, oklch(0.6 0.01 264));
@@ -135,6 +147,10 @@
135
147
  box-sizing: border-box;
136
148
  width: 100%;
137
149
  min-width: 208px; /* wider than the collapsed pill on purpose: the controls never reflow while it opens */
150
+ max-height: var(--_mdt-body-max);
151
+ overflow-y: auto;
152
+ scrollbar-width: thin;
153
+ scroll-padding-block: var(--ring-gutter, 3px);
138
154
  display: flex;
139
155
  flex-direction: column;
140
156
  gap: 0.8125rem;
@@ -238,6 +254,65 @@
238
254
  font-size: 0.6875rem;
239
255
  line-height: 1.45;
240
256
  color: var(--text-subtle, oklch(0.6 0.01 264));
257
+ margin: 0.5rem 0 0;
258
+ }
259
+
260
+ .zc-mdt__more {
261
+ appearance: none;
262
+ display: flex;
263
+ align-items: center;
264
+ justify-content: space-between;
265
+ width: 100%;
266
+ padding: 0.125rem 0;
267
+ border: 0;
268
+ border-radius: var(--radius-sm, 0.25rem);
269
+ background: transparent;
270
+ color: var(--text-subtle, oklch(0.6 0.01 264));
271
+ font: inherit;
272
+ font-size: 0.6875rem;
273
+ font-weight: 650;
274
+ letter-spacing: 0.06em;
275
+ text-transform: uppercase;
276
+ cursor: pointer;
277
+ }
278
+ .zc-mdt__more:hover {
279
+ color: var(--text-body, oklch(0.35 0.01 264));
280
+ }
281
+ .zc-mdt__more:focus-visible {
282
+ outline: var(--ring-accent, 3px solid oklch(0.7 0.12 185 / 0.35));
283
+ }
284
+
285
+ .zc-mdt__keys {
286
+ display: flex;
287
+ flex-direction: column;
288
+ gap: 0.3125rem;
289
+ margin: 0.125rem 0 0;
290
+ }
291
+ .zc-mdt__keyrow {
292
+ display: flex;
293
+ align-items: center;
294
+ justify-content: space-between;
295
+ gap: 0.5rem;
296
+ }
297
+ .zc-mdt__keyrow dt {
298
+ font-size: 0.6875rem;
299
+ color: var(--text-muted, oklch(0.55 0.01 264));
300
+ }
301
+ .zc-mdt__keyrow dd {
302
+ display: flex;
303
+ gap: 0.1875rem;
241
304
  margin: 0;
242
305
  }
306
+ .zc-mdt__key {
307
+ min-width: 1.125rem;
308
+ padding: 0.0625rem 0.25rem;
309
+ border: 1px solid var(--border-subtle, oklch(0.92 0.004 264));
310
+ border-radius: var(--radius-sm, 0.25rem);
311
+ background: var(--bg-muted, oklch(0.97 0.004 264));
312
+ color: var(--text-subtle, oklch(0.6 0.01 264));
313
+ font-family: var(--font-code, ui-monospace, SFMono-Regular, Menlo, monospace);
314
+ font-size: 0.625rem;
315
+ line-height: 1.4;
316
+ text-align: center;
317
+ }
243
318
  }
@@ -58,7 +58,7 @@ function applyCssTokens() {
58
58
  const ms = state.paused ? FROZEN_MS : baseMs[token] * state.factor;
59
59
  return `${token}: ${ms}ms !important;`;
60
60
  });
61
- overrideSheet.textContent = `:root, [data-theme] { ${declarations.join(' ')} }`;
61
+ overrideSheet.textContent = `:root, [data-theme], [data-polarity] { ${declarations.join(' ')} }`;
62
62
  }
63
63
 
64
64
  function clearCssTokens() {
@@ -1,14 +1,14 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
4
  .zc-confetti {
5
- /* The five papers a burst draws from; a slot set to a role follows the theme. */
5
+ /* The five papers a burst draws from. */
6
6
  --confetti-paper-1: oklch(0.53 0.2 288);
7
7
  --confetti-paper-2: var(--accent);
8
8
  --confetti-paper-3: oklch(0.78 0.115 62);
9
9
  --confetti-paper-4: oklch(0.67 0.18 12);
10
10
  --confetti-paper-5: var(--text-strong);
11
- /* How often each paper appears - five weights, in slot order. */
11
+ /* How often each paper appears, in slot order. */
12
12
  --confetti-weights: 1 1 1 1 0.45;
13
13
 
14
14
  /* What the reverse side of a piece darkens toward. */
@@ -1,4 +1,4 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
4
  .zc-facebook-feed-post,
@@ -41,7 +41,7 @@ const WIDTH_GAIN = 1.2;
41
41
  const ALPHA_REST = 0.42;
42
42
  const ALPHA_GAIN = 0.58;
43
43
 
44
- const THEME_ATTRIBUTES: MutationObserverInit = { attributeFilter: ['class', 'style', 'data-theme'] };
44
+ const THEME_ATTRIBUTES: MutationObserverInit = { attributeFilter: ['class', 'style', 'data-theme', 'data-polarity'] };
45
45
 
46
46
  const JITTER_X = 12.9898;
47
47
  const JITTER_Y = 78.233;
@@ -1,15 +1,15 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
4
  .zc-flow-field {
5
- /* The particle colour at rest - the ramp's cold end. */
5
+ /* The particle colour at rest. */
6
6
  --flow-field-ink: var(--text-subtle);
7
- /* The particle colour at full speed - the ramp's hot end. */
7
+ /* The particle colour at full speed. */
8
8
  --flow-field-accent: var(--accent);
9
9
  /* The field's minimum height before content sizes it. */
10
10
  --flow-field-min-height: var(--space-10);
11
11
 
12
- /* The twelve stops from ink to accent, sampled at the next measure; set all twelve for a ramp of your own. */
12
+ /* The twelve stops from ink to accent, set together for a ramp of your own. */
13
13
  --flow-field-ramp-0: var(--flow-field-ink);
14
14
  --flow-field-ramp-1: color-mix(in oklab, var(--flow-field-accent) 9%, var(--flow-field-ink));
15
15
  --flow-field-ramp-2: color-mix(in oklab, var(--flow-field-accent) 18%, var(--flow-field-ink));
@@ -1,4 +1,4 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
4
  .zc-instagram-feed,
@@ -1,4 +1,4 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
4
  .zc-lens {
@@ -28,7 +28,6 @@
28
28
 
29
29
  .zc-lens:focus-visible {
30
30
  outline: var(--focus-ring);
31
- outline-offset: var(--ring-inset);
32
31
  }
33
32
 
34
33
  .zc-lens--active {
@@ -1,4 +1,4 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
4
  .zc-morphing-text {
@@ -12,7 +12,7 @@
12
12
  --morphing-text-leading: 1.2;
13
13
  /* Letter spacing. */
14
14
  --morphing-text-tracking: var(--tracking-display);
15
- /* How much letters blur on the way between words; 0 cuts clean. */
15
+ /* How much letters blur between words, 0 cutting clean. */
16
16
  --morphing-text-smear: 1;
17
17
  /* The rule at rest. */
18
18
  --morphing-text-rule-ink: var(--text-strong);
@@ -1,4 +1,4 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
4
  .zc-odometer {