@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
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/expressive/typing-lines/TypingLines.tsx"],"names":[],"mappings":";;;;;;;;AAWA,IAAM,iBAAA,GAAoB,EAAA;AAC1B,IAAM,mBAAA,GAAsB,EAAA;AAC5B,IAAM,YAAA,GAAe,GAAA;AACrB,IAAM,cAAA,GAAiB,EAAA;AACvB,IAAM,OAAA,GAAU,IAAA;AAEhB,IAAM,UAAA,GAAa,uBAAA;AACnB,IAAM,cAAA,GAAiB,kCAAA;AAevB,IAAM,OAAA,GAAU,CAAC,IAAA,EAAc,IAAA,KAAsB,SAAS,MAAA,GAAU,IAAA,GAAO,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,GAAI,EAAC,GAAK,CAAC,GAAG,IAAI,CAAA;AAE/G,SAAS,UAAA,CAAW,EAAA,EAAiB,KAAA,EAAiB,MAAA,EAAgB,QAAA,EAAoB;AACxF,EAAA,OAAO,QAAA,CAAS,KAAA,GAAQ,MAAA,IAAU,EAAA,CAAG,SAAA,EAAW;AAC9C,IAAA,EAAA,CAAG,WAAA,CAAY,GAAG,SAAS,CAAA;AAC3B,IAAA,IAAI,QAAA,CAAS,QAAQ,CAAA,IAAK,EAAA,CAAG,WAAW,EAAA,CAAG,WAAA,CAAY,GAAG,SAAS,CAAA;AACnE,IAAA,QAAA,CAAS,KAAA,EAAA;AAAA,EACX;AACA,EAAA,KAAA,IAAS,CAAA,GAAI,QAAA,CAAS,KAAA,EAAO,CAAA,GAAI,QAAQ,CAAA,EAAA,EAAK;AAC5C,IAAA,IAAI,GAAG,EAAA,CAAG,WAAA,CAAY,QAAA,CAAS,cAAA,CAAe,GAAG,CAAC,CAAA;AAClD,IAA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AAA,EAAK,QAAA,EAAU,SAAA,EAAU,wBAAA,EAAyB,CAAA;AAAA,wBACvD,MAAA,EAAA,EAAK,GAAA,EAAK,SAAS,SAAA,EAAU,uBAAA,EAAwB,eAAY,MAAA,EAAO,CAAA;AAAA,IACxE,KAAA,KAAU,MAAA,GAAS,IAAA,mBAClB,GAAA,CAAC,MAAA,EAAA,EAAK,GAAA,EAAK,QAAA,EAAU,SAAA,EAAW,CAAA,+CAAA,EAAkD,KAAK,CAAA,CAAA,EAAI,aAAA,EAAY,MAAA,EAAO;AAAA,GAAA,EAElH,CAAA;AAEJ","file":"typing-lines.js","sourcesContent":["'use client';\n\nimport './typing-lines.css';\n\nimport { useEffect, useRef, type HTMLAttributes } from 'react';\n\nimport type { DataAttributes } from '../../../dom-props';\nimport { loop } from '../../../engine';\nimport type { TypingLinesStyle } from '../../../tokens/component-styles.generated';\nimport { cx } from '../../internal/utils/cx';\n\nconst CHARACTER_TYPE_MS = 54;\nconst CHARACTER_DELETE_MS = 26;\nconst WORD_TYPE_MS = 210;\nconst WORD_DELETE_MS = 90;\nconst HOLD_MS = 2400;\nconst RESTART_LEAD_MS = 420;\nconst WORD_CLASS = 'zc-typing-lines__word';\nconst BLINKING_CLASS = 'zc-typing-lines__caret--blinking';\n\nexport type TypingUnit = 'character' | 'word';\nexport type TypingCaret = 'line' | 'block' | 'underscore' | 'none';\n\ntype Phase = 'typing' | 'holding' | 'deleting';\n\ninterface Progress {\n index: number;\n count: number;\n phase: Phase;\n elapsed: number;\n built: number;\n}\n\nconst unitsOf = (line: string, unit: TypingUnit) => (unit === 'word' ? (line ? line.split(' ') : []) : [...line]);\n\nfunction paintWords(el: HTMLElement, words: string[], target: number, progress: Progress) {\n while (progress.built > target && el.lastChild) {\n el.removeChild(el.lastChild);\n if (progress.built > 1 && el.lastChild) el.removeChild(el.lastChild);\n progress.built--;\n }\n for (let i = progress.built; i < target; i++) {\n if (i) el.appendChild(document.createTextNode(' '));\n const span = document.createElement('span');\n span.className = WORD_CLASS;\n span.textContent = words[i];\n el.appendChild(span);\n progress.built = i + 1;\n }\n}\n\nfunction paint(el: HTMLElement, line: string, unit: TypingUnit, count: number, progress: Progress) {\n if (unit === 'word') {\n paintWords(el, unitsOf(line, unit), count, progress);\n return;\n }\n el.textContent = [...line].slice(0, count).join('');\n progress.built = 0;\n}\n\nfunction advance(progress: Progress, dt: number, lines: string[], unit: TypingUnit) {\n const total = unitsOf(lines[progress.index] ?? '', unit).length;\n const typeRate = unit === 'word' ? WORD_TYPE_MS : CHARACTER_TYPE_MS;\n const deleteRate = unit === 'word' ? WORD_DELETE_MS : CHARACTER_DELETE_MS;\n progress.elapsed += dt;\n\n if (progress.phase === 'typing') {\n if (progress.elapsed > typeRate) {\n progress.elapsed = 0;\n progress.count++;\n if (progress.count >= total) {\n progress.count = total;\n progress.phase = 'holding';\n }\n }\n return;\n }\n if (progress.phase === 'holding') {\n if (progress.elapsed > HOLD_MS) {\n progress.elapsed = 0;\n progress.phase = 'deleting';\n }\n return;\n }\n if (progress.elapsed > deleteRate) {\n progress.elapsed = 0;\n progress.count--;\n if (progress.count <= 0) {\n progress.count = 0;\n progress.phase = 'typing';\n progress.elapsed = -RESTART_LEAD_MS;\n progress.index = lines.length ? (progress.index + 1) % lines.length : 0;\n }\n }\n}\n\nexport interface TypingLinesOwnProps {\n /** The lines to type, in order; the sequence restarts once the last one has been deleted. */\n lines: string[];\n /** Whether the line arrives one character or one whole word at a time. @default 'character' */\n unit?: TypingUnit;\n /** Caret shape. It holds solid while characters land and blinks only once the line is idle. @default 'line' */\n caret?: TypingCaret;\n /** Multiplies the typing rate; sampled live on every frame. @default 1 */\n speed?: number;\n /** Extra class(es) merged onto the root. */\n className?: string;\n /** Inline styles merged onto the root. */\n style?: TypingLinesStyle;\n}\n\nexport interface TypingLinesProps extends TypingLinesOwnProps {\n /** Standard <span> attributes (aria-*, data-*, title, ...) forwarded to the root. */\n htmlProps?: Omit<HTMLAttributes<HTMLSpanElement>, keyof TypingLinesOwnProps> & DataAttributes;\n}\n\nexport function TypingLines({\n lines,\n unit = 'character',\n caret = 'line',\n speed = 1,\n className = '',\n style,\n htmlProps,\n}: TypingLinesProps) {\n const rootRef = useRef<HTMLSpanElement>(null);\n const textRef = useRef<HTMLSpanElement>(null);\n const caretRef = useRef<HTMLSpanElement>(null);\n const labelRef = useRef<HTMLSpanElement>(null);\n const speedRef = useRef(speed);\n const key = lines.join('\u0000') + '\u0001' + unit;\n\n useEffect(() => {\n speedRef.current = speed;\n }, [speed]);\n\n useEffect(() => {\n const el = rootRef.current;\n const text = textRef.current;\n if (!el || !text) return;\n\n const progress: Progress = { index: 0, count: 0, phase: 'typing', elapsed: 0, built: 0 };\n text.textContent = '';\n\n const showLabel = () => {\n if (labelRef.current) labelRef.current.textContent = lines[progress.index] ?? '';\n };\n const settle = () => {\n const line = lines[0] ?? '';\n progress.index = 0;\n progress.count = unitsOf(line, unit).length;\n progress.phase = 'holding';\n paint(text, line, unit, progress.count, progress);\n caretRef.current?.classList.remove(BLINKING_CLASS);\n showLabel();\n };\n\n let painted = -1;\n showLabel();\n\n const playback = loop(\n (_k, dt) => {\n const before = progress.index;\n advance(progress, dt, lines, unit);\n if (progress.index !== before) {\n progress.built = 0;\n text.textContent = '';\n showLabel();\n }\n if (progress.count !== painted) {\n paint(text, lines[progress.index] ?? '', unit, progress.count, progress);\n painted = progress.count;\n }\n caretRef.current?.classList.toggle(BLINKING_CLASS, progress.phase === 'holding');\n },\n { el, speed: () => speedRef.current, snap: settle },\n );\n\n return () => playback.stop();\n }, [key, lines, unit]);\n\n return (\n <span ref={rootRef} className={cx('zc-typing-lines', className)} style={style} {...htmlProps}>\n <span ref={labelRef} className=\"zc-typing-lines__label\" />\n <span ref={textRef} className=\"zc-typing-lines__text\" aria-hidden=\"true\" />\n {caret === 'none' ? null : (\n <span ref={caretRef} className={`zc-typing-lines__caret zc-typing-lines__caret--${caret}`} aria-hidden=\"true\" />\n )}\n </span>\n );\n}\n"]}
1
+ {"version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AC,MAAA,EAAA,EAAK,GAAA,EAAK,QAAA,EAAU,SAAA,EAAW,CAAA,+CAAA,EAAkD,KAAK,CAAA,CAAA,EAAI,aAAA,EAAY,MAAA,EAAO;AAAA,GAAA,EAElH,CAAA;AAEJ","file":"typing-lines.js","sourcesContent":["'use client';\n\nimport './typing-lines.css';\n\nimport { useEffect, useRef, type HTMLAttributes } from 'react';\n\nimport type { DataAttributes } from '../../../dom-props';\nimport { loop } from '../../../engine';\nimport type { TypingLinesStyle } from '../../../tokens/component-styles.generated';\nimport { cx } from '../../internal/utils/cx';\n\nconst CHARACTER_TYPE_MS = 54;\nconst CHARACTER_DELETE_MS = 26;\nconst WORD_TYPE_MS = 210;\nconst WORD_DELETE_MS = 90;\nconst HOLD_MS = 2400;\nconst RESTART_LEAD_MS = 420;\nconst WORD_CLASS = 'zc-typing-lines__word';\nconst BLINKING_CLASS = 'zc-typing-lines__caret--blinking';\n\nexport type TypingUnit = 'character' | 'word';\nexport type TypingCaret = 'line' | 'block' | 'underscore' | 'none';\n\ntype Phase = 'typing' | 'holding' | 'deleting';\n\ninterface Progress {\n index: number;\n count: number;\n phase: Phase;\n elapsed: number;\n built: number;\n}\n\nconst unitsOf = (line: string, unit: TypingUnit) => (unit === 'word' ? (line ? line.split(' ') : []) : [...line]);\n\nfunction paintWords(el: HTMLElement, words: string[], target: number, progress: Progress) {\n while (progress.built > target && el.lastChild) {\n el.removeChild(el.lastChild);\n if (progress.built > 1 && el.lastChild) el.removeChild(el.lastChild);\n progress.built--;\n }\n for (let i = progress.built; i < target; i++) {\n if (i) el.appendChild(document.createTextNode(' '));\n const span = document.createElement('span');\n span.className = WORD_CLASS;\n span.textContent = words[i];\n el.appendChild(span);\n progress.built = i + 1;\n }\n}\n\nfunction paint(el: HTMLElement, line: string, unit: TypingUnit, count: number, progress: Progress) {\n if (unit === 'word') {\n paintWords(el, unitsOf(line, unit), count, progress);\n return;\n }\n el.textContent = [...line].slice(0, count).join('');\n progress.built = 0;\n}\n\nfunction advance(progress: Progress, dt: number, lines: string[], unit: TypingUnit) {\n const total = unitsOf(lines[progress.index] ?? '', unit).length;\n const typeRate = unit === 'word' ? WORD_TYPE_MS : CHARACTER_TYPE_MS;\n const deleteRate = unit === 'word' ? WORD_DELETE_MS : CHARACTER_DELETE_MS;\n progress.elapsed += dt;\n\n if (progress.phase === 'typing') {\n if (progress.elapsed > typeRate) {\n progress.elapsed = 0;\n progress.count++;\n if (progress.count >= total) {\n progress.count = total;\n progress.phase = 'holding';\n }\n }\n return;\n }\n if (progress.phase === 'holding') {\n if (progress.elapsed > HOLD_MS) {\n progress.elapsed = 0;\n progress.phase = 'deleting';\n }\n return;\n }\n if (progress.elapsed > deleteRate) {\n progress.elapsed = 0;\n progress.count--;\n if (progress.count <= 0) {\n progress.count = 0;\n progress.phase = 'typing';\n progress.elapsed = -RESTART_LEAD_MS;\n progress.index = lines.length ? (progress.index + 1) % lines.length : 0;\n }\n }\n}\n\nexport interface TypingLinesOwnProps {\n /** The lines to type, in order; the sequence restarts once the last one has been deleted. */\n lines: string[];\n /** Whether the line arrives one character or one whole word at a time. @default 'character' */\n unit?: TypingUnit;\n /** Caret shape. It holds solid while characters land and blinks only once the line is idle. @default 'line' */\n caret?: TypingCaret;\n /** Multiplies the typing rate; sampled live on every frame. @default 1 */\n speed?: number;\n /** Extra class(es) merged onto the root. */\n className?: string;\n /** Inline styles merged onto the root. */\n style?: TypingLinesStyle;\n}\n\nexport interface TypingLinesProps extends TypingLinesOwnProps {\n /** Standard <span> attributes (aria-*, data-*, title, ...) forwarded to the root. */\n htmlProps?: Omit<HTMLAttributes<HTMLSpanElement>, keyof TypingLinesOwnProps> & DataAttributes;\n}\n\nexport function TypingLines({\n lines,\n unit = 'character',\n caret = 'line',\n speed = 1,\n className = '',\n style,\n htmlProps,\n}: TypingLinesProps) {\n const rootRef = useRef<HTMLSpanElement>(null);\n const textRef = useRef<HTMLSpanElement>(null);\n const caretRef = useRef<HTMLSpanElement>(null);\n const labelRef = useRef<HTMLSpanElement>(null);\n const speedRef = useRef(speed);\n const key = lines.join('\\u0000') + '\\u0001' + unit;\n\n useEffect(() => {\n speedRef.current = speed;\n }, [speed]);\n\n useEffect(() => {\n const el = rootRef.current;\n const text = textRef.current;\n if (!el || !text) return;\n\n const progress: Progress = { index: 0, count: 0, phase: 'typing', elapsed: 0, built: 0 };\n text.textContent = '';\n\n const showLabel = () => {\n if (labelRef.current) labelRef.current.textContent = lines[progress.index] ?? '';\n };\n const settle = () => {\n const line = lines[0] ?? '';\n progress.index = 0;\n progress.count = unitsOf(line, unit).length;\n progress.phase = 'holding';\n paint(text, line, unit, progress.count, progress);\n caretRef.current?.classList.remove(BLINKING_CLASS);\n showLabel();\n };\n\n let painted = -1;\n showLabel();\n\n const playback = loop(\n (_k, dt) => {\n const before = progress.index;\n advance(progress, dt, lines, unit);\n if (progress.index !== before) {\n progress.built = 0;\n text.textContent = '';\n showLabel();\n }\n if (progress.count !== painted) {\n paint(text, lines[progress.index] ?? '', unit, progress.count, progress);\n painted = progress.count;\n }\n caretRef.current?.classList.toggle(BLINKING_CLASS, progress.phase === 'holding');\n },\n { el, speed: () => speedRef.current, snap: settle },\n );\n\n return () => playback.stop();\n }, [key, lines, unit]);\n\n return (\n <span ref={rootRef} className={cx('zc-typing-lines', className)} style={style} {...htmlProps}>\n <span ref={labelRef} className=\"zc-typing-lines__label\" />\n <span ref={textRef} className=\"zc-typing-lines__text\" aria-hidden=\"true\" />\n {caret === 'none' ? null : (\n <span ref={caretRef} className={`zc-typing-lines__caret zc-typing-lines__caret--${caret}`} aria-hidden=\"true\" />\n )}\n </span>\n );\n}\n"]}
@@ -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-weight-field {
@@ -24,7 +24,7 @@
24
24
  --weight-field-peak-weight: 900;
25
25
  /* How much a unit widens under the pointer. */
26
26
  --weight-field-hover-padding: calc(1em / 12);
27
- /* The text stroke every unit carries; the peak letter doubles it. */
27
+ /* The text stroke every unit carries, doubled on the peak letter. */
28
28
  --weight-field-stroke: calc(1em * 125 / 6000);
29
29
  --_weight-field-stroke-peak: calc(var(--weight-field-stroke) * 2);
30
30
  /* How long a unit takes to settle at a new weight. */
package/dist/youtube.css CHANGED
@@ -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-youtube {
package/dist/youtube.js CHANGED
@@ -1,7 +1,7 @@
1
- 'use client';import { startDrag } from './chunk-FEXUS4SV.js';
1
+ 'use client';import { startDrag } from './chunk-XKDR22VE.js';
2
2
  import './chunk-VNVVG47J.js';
3
3
  import { useControllable } from './chunk-MMRIQNEN.js';
4
- import './chunk-N2GJEO5Z.js';
4
+ import './chunk-6H3IJ752.js';
5
5
  import { cx } from './chunk-QGNC7LH5.js';
6
6
  import './youtube.css';
7
7
  import { useRef, useEffect } from 'react';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zyncat/ui",
3
- "version": "0.15.0",
4
- "packageManager": "pnpm@11.13.0",
3
+ "version": "0.18.0",
4
+ "packageManager": "pnpm@11.26.0",
5
5
  "description": "A React 19 design system: accessible, animated UI components built on a small, closed CSS design-token vocabulary. No Tailwind, no CSS-in-JS.",
6
6
  "keywords": [
7
7
  "react",
@@ -298,6 +298,21 @@
298
298
  "types": "./dist/types/tokens/theme.d.ts",
299
299
  "import": "./dist/theme.js"
300
300
  },
301
+ "./theme-switcher": {
302
+ "source": "./src/components/composites/theme-switcher/ThemeSwitcher.tsx",
303
+ "types": "./dist/types/components/composites/theme-switcher/ThemeSwitcher.d.ts",
304
+ "import": "./dist/theme-switcher.js"
305
+ },
306
+ "./theme-grid": {
307
+ "source": "./src/components/composites/theme-switcher/ThemeGrid.tsx",
308
+ "types": "./dist/types/components/composites/theme-switcher/ThemeGrid.d.ts",
309
+ "import": "./dist/theme-grid.js"
310
+ },
311
+ "./spinner": {
312
+ "source": "./src/components/primitives/spinner/Spinner.tsx",
313
+ "types": "./dist/types/components/primitives/spinner/Spinner.d.ts",
314
+ "import": "./dist/spinner.js"
315
+ },
301
316
  "./styles.css": "./src/styles.css",
302
317
  "./tailwind.css": "./tailwind.css",
303
318
  "./next": {
@@ -315,31 +330,12 @@
315
330
  "next.d.mts"
316
331
  ],
317
332
  "scripts": {
318
- "build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly && pnpm --filter zyncat-ui build",
319
- "build:docs": "turbo run build --filter=zyncat-ui-docs",
320
- "dev": "turbo run dev --filter=zyncat-ui-docs",
321
- "dev:lib": "tsup --watch",
322
- "typecheck": "tsc -p tsconfig.build.json --noEmit --declaration false && tsc -p tsconfig.node.json && pnpm --filter zyncat-ui typecheck",
323
- "check:css": "node scripts/check-css-graph.mjs",
324
- "check:contracts": "node scripts/check-contracts.mjs",
325
- "check:usage": "node scripts/check-usage.mjs",
326
- "check:skill": "node scripts/gen-skill.mjs --check",
327
- "check:authoring": "node scripts/check-authoring.mjs",
328
- "check:exports": "node scripts/sync-exports.mjs",
329
- "check:props": "node scripts/gen-props.mjs --check",
330
- "check:tsconfig": "node scripts/sync-tsconfig.mjs --check",
331
- "check:theme": "node scripts/gen-theme.mjs --check",
332
- "check:shim": "node scripts/gen-shim.mjs --check",
333
- "docs:props": "node scripts/gen-props.mjs",
334
- "sync:exports": "node scripts/sync-exports.mjs --write",
335
- "sync:tsconfig": "node scripts/sync-tsconfig.mjs",
336
- "sync:skill": "node scripts/gen-skill.mjs",
337
- "sync:theme": "node scripts/gen-theme.mjs",
338
- "sync:shim": "node scripts/gen-shim.mjs",
333
+ "build": "node scripts/build.mjs",
334
+ "check": "node scripts/check.mjs",
339
335
  "sync": "node scripts/sync.mjs",
340
336
  "verify": "node scripts/verify.mjs",
337
+ "dev": "turbo run dev --filter=zyncat-ui-docs",
341
338
  "format": "prettier --write --cache .",
342
- "format:check": "prettier --check --cache .",
343
339
  "prepublishOnly": "pnpm build"
344
340
  },
345
341
  "commitlint": {
@@ -34,7 +34,7 @@ init over hand-wiring it.
34
34
  - `import '@zyncat/ui/styles.css'` once at the root - fonts + tokens; each component lazy-loads its
35
35
  own CSS. `import './zyncat.theme.css'` right after it - the eight decisions init wrote beside the
36
36
  entry; a retheme is editing a value there.
37
- - Theming that is data: `defineTheme` + `<ZyncatTheme theme={{ base, dark }} />` from
37
+ - Theming that is data: `defineTheme` + `<ZyncatTheme themes={{ default: { light, dark } }} />` from
38
38
  `@zyncat/ui/theme`, once at the root. Typed, server-rendered, no build config. See
39
39
  references/theming.md before writing one.
40
40
  - One subpath per component: `import { Button } from '@zyncat/ui/button'`. There is no barrel.
@@ -1,6 +1,6 @@
1
1
  # @zyncat/ui component index
2
2
 
3
- Generated from @zyncat/ui v0.15.0 by `pnpm sync:skill` - do not edit by hand.
3
+ Generated from @zyncat/ui v0.18.0 by `pnpm sync skill` - do not edit by hand.
4
4
  If node_modules/@zyncat/ui/package.json shows a DIFFERENT version, this index is stale:
5
5
  trust the get_component MCP tool and re-run `npx zyncat-ui init` to refresh the skill.
6
6
 
@@ -14,6 +14,7 @@ Badge - @zyncat/ui/badge - Glass or outline chip for ambient status - toned, dot
14
14
  StatusBadge - @zyncat/ui/status-badge - Canonical post status - tone + one-word label.
15
15
  CountBadge - @zyncat/ui/count-badge - Mono tabular count; `roll` animates digits like an odometer.
16
16
  Glide / GlidePill - @zyncat/ui/glide - A persistent background pill that glides smoothly between hovered/active elements.
17
+ Spinner - @zyncat/ui/spinner - Indeterminate loader; three looks, no JavaScript, no layout of its own.
17
18
 
18
19
  == Forms ==
19
20
  Every form field takes label, helper/error/warning/success, size sm|md|lg, disabled.
@@ -54,6 +55,8 @@ Alert - @zyncat/ui/alert - Persistent, in-flow status.
54
55
  Toast - @zyncat/ui/toast - Imperative transient notifications: mount <Toaster /> once at the app root, then call toast() from anywhere.
55
56
  toast-store - @zyncat/ui/toast-store - The headless store behind Toast: subscribe to the toast queue and drive it without rendering <Toaster />.
56
57
  EmojiPickerPanel - @zyncat/ui/emoji-picker - Searchable emoji panel - grid, scrollspy category rail, recents in localStorage - living in a Popover, becoming a bottom Sheet on narrow viewports.
58
+ ThemeSwitcher - @zyncat/ui/theme-switcher - The theme control: a chip painted in the live palette opens a grid of miniatures, one card per palette and side plus a split System card, each drawn from that theme's real tokens.
59
+ ThemeGrid - @zyncat/ui/theme-grid - The theme picker without a surface: a radio grid of miniatures, one card per palette and side plus a split System card, each drawn from that theme's real tokens.
57
60
 
58
61
  == Expressive ==
59
62
  Creative motion components. Each publishes scoped --<component>-* custom properties as its theming surface.
@@ -79,7 +82,7 @@ YouTube - @zyncat/ui/youtube - Replica of three YouTube surfaces, picked with su
79
82
  == Dev tools ==
80
83
  motion-tokens - @zyncat/ui/motion-tokens - TypeScript readers for the motion token vocabulary - duration/ease/distance/scale token names resolved to the live CSS values.
81
84
  MotionDevtools - @zyncat/ui/motion-devtools - Dev-only floating panel that slows or freezes EVERY animation at once (CSS and WAAPI) for motion debugging.
82
- Theme - @zyncat/ui/theme - Typed theming - defineTheme is the shape of a theme, not a list of every token; ZyncatTheme renders the set as unlayered CSS with no build step.
85
+ Theme - @zyncat/ui/theme - Typed theming and the theme state: defineTheme shapes a theme, ZyncatTheme emits the CSS and the pre-paint boot script, useTheme reads and sets the choice.
83
86
 
84
87
  == Types-only modules (documented by their .d.ts alone) ==
85
88
  @zyncat/ui/next - get_component("next")
@@ -27,25 +27,32 @@ own `-subtle`, `-text` and `-wash`; the `--radius-*` steps are fixed ratios of `
27
27
  `--radius: 0` squares every corner (`--radius-full` is a shape and stays put); the `--type-*` bundles
28
28
  follow the faces. Set a derived token only to break it away from its decision.
29
29
 
30
- Dark ships in the package. `data-theme="dark"` on `<html>` turns the page - the base layer paints
30
+ Palette and polarity are two attributes. `data-theme='<name>'` picks the palette, `data-polarity='light|dark'`
31
+ picks the side, and they are independent - a palette carries both sides.
32
+
33
+ Dark ships in the package. `data-polarity="dark"` on `<html>` turns the page - the base layer paints
31
34
  `body` in `--bg-app`, `--text-body` and `--type-body`, so there is no wrapper to add - and on any
32
- element it turns that subtree, where `data-theme="light"` makes a light island. The dark theme sets
33
- the neutral roles (`--bg-*`, `--text-*`, `--border-*`), the shadow ink, `--shadow-strength` (how much
34
- shadow the surfaces cast), `--sheen-strength` (how bright the white top-light highlights render) and
35
- `--glow-strength` (how much light a hovered hue fill casts on the canvas around it), drops the filled
36
- faces (`--accent-fill`, `--danger-fill`) a step, and re-derives the hue steps whose light values pin a
37
- lightness near white; the decisions cascade in, so the accent a project sets is the dark theme's
38
- accent too. Extend it in the same block -
39
- `[data-theme='dark'] { --accent: oklch(0.72 0.14 292); --shadow-strength: 2.5; }` - and whatever is
35
+ element it turns that subtree, where `data-polarity="light"` makes a light island. The dark polarity
36
+ sets the neutral roles (`--bg-*`, `--text-*`, `--border-*`), the shadow ink, `--shadow-strength` (how
37
+ much shadow the surfaces cast), `--sheen-strength` (how bright the white top-light highlights render)
38
+ and `--glow-strength` (how much light a hovered hue fill casts on the canvas around it), drops the
39
+ filled faces (`--accent-fill`, `--danger-fill`) a step, and re-derives the hue steps whose light
40
+ values pin a lightness near white; the decisions cascade in, so the accent a project sets is the dark
41
+ side's accent too. Extend it in the same block -
42
+ `[data-polarity='dark'] { --accent: oklch(0.72 0.14 292); --shadow-strength: 2.5; }` - and whatever is
40
43
  left out keeps the shipped dark value. The derived tokens are declared on every theme root (`:root`
41
- and any element with `data-theme`), so a subtree theme that repoints `--accent` re-derives all of
42
- them; the neutral roles cascade like any property, so a theme of your own that sets `--bg-app` and
43
- `--text-body` keeps them without restating the rest.
44
- Components read the tokens live, and the WAAPI engine reads the same values at `<body>` - again
45
- whenever `data-theme` changes or `prefers-reduced-motion` flips - so motion retimes with the CSS.
46
- Reduced motion is handled here - every `--duration-*` collapses to 1ms under
47
- `prefers-reduced-motion`, so derive your own delays from a duration token, and repoint durations on
48
- `:root` rather than a nested scope or the collapse cannot reach them.
44
+ and any element with `data-theme` or `data-polarity`), so a subtree that repoints `--accent`
45
+ re-derives all of them; the neutral roles cascade like any property, so a theme of your own that sets
46
+ `--bg-app` and `--text-body` keeps them without restating the rest. Overlays portal to `<body>` but
47
+ carry their trigger's palette and polarity onto their own panel, so a Dropdown, Select, Popover,
48
+ Tooltip, Dialog, Modal or Sheet opened from inside a themed island paints as the island does.
49
+ Components read the tokens live, and the WAAPI engine reads them off the element it is animating -
50
+ overlays off their trigger - so a subtree theme retimes motion as well as colour, and a page with no
51
+ subtree theme reads `<body>` as before. The read refreshes whenever `data-theme` or `data-polarity`
52
+ changes anywhere, `prefers-reduced-motion` flips or `ZyncatTheme` renders. Reduced motion is handled
53
+ here - every `--duration-*` collapses to 1ms under `prefers-reduced-motion` - so derive your own
54
+ delays from a duration token, and repoint durations on `:root` for the collapse to reach the whole
55
+ page.
49
56
 
50
57
  `@zyncat/ui/theme` is the same level with a type on it, for a theme that is data - several named
51
58
  themes, or values computed at build time. `defineTheme` takes one object shaped like a theme: four
@@ -62,19 +69,20 @@ on `defineTheme` drops those lines from `zyncat.theme.css`.
62
69
  ```tsx
63
70
  import { defineTheme, ZyncatTheme } from '@zyncat/ui/theme';
64
71
 
65
- const base = defineTheme({
72
+ const light = defineTheme({
66
73
  color: { accent: 'oklch(0.58 0.19 292)' },
67
74
  shape: { radius: '0.75rem' },
68
75
  components: { odometer: { accent: 'var(--warning)' } },
69
76
  });
70
77
  const dark = defineTheme({ color: { accent: 'oklch(0.72 0.14 292)' }, custom: { '--shadow-strength': 2.5 } });
71
78
 
72
- <ZyncatTheme theme={{ base, dark }} />;
79
+ <ZyncatTheme themes={{ default: { light, dark } }} />;
73
80
  ```
74
81
 
75
- `base` lands on `:root`; every other key is a `[data-theme='<key>']` block, so `dark` and `light`
76
- extend the shipped polarities rather than starting them. Durations you repoint keep their
77
- reduced-motion collapse automatically.
82
+ Every key is a palette carrying a `light` and a `dark` side, and `dark` is a delta - what `light`
83
+ sets and `dark` leaves out carries over. `default` lands on `:root`; every other key becomes
84
+ `[data-theme='<key>']`, so both extend the shipped polarities rather than starting them. Durations
85
+ you repoint keep their reduced-motion collapse automatically.
78
86
 
79
87
  The vocabulary a page reads is the roles, never the plumbing:
80
88
  `--bg-app/-surface/-surface-raised/-subtle/-muted/-inset/-overlay`,
@@ -147,7 +155,7 @@ the face), with `font-body`, `leading-<role>`, `tracking-caps`, `tracking-displa
147
155
  colour utility on `ring-<hue>`);
148
156
  `duration-fast` … `duration-slowest`, `ease-standard`, `ease-entrance`, `ease-exit`, `ease-spring`,
149
157
  `ease-glide`; `max-w-prose`, `max-w-floating`. Each utility reads the token itself, so a themed
150
- subtree and the dark theme reach it, and `dark:` follows `data-theme` rather than the OS. The names
158
+ subtree and the dark polarity reach it, and `dark:` follows `data-polarity` rather than the OS. The names
151
159
  Tailwind also ships - `rounded-md`, `shadow-md`, `tracking-tight` - read the zyncat token of the same
152
160
  name, so `--radius` in the theme file moves utilities and components together. Spacing stays
153
161
  Tailwind's own scale; both sit on the 4px grid. Reach for a role utility before an arbitrary value:
@@ -15,7 +15,7 @@ import { useControllable } from '../../internal/hooks/use-controllable';
15
15
  import { Icon, type IconName } from '../../internal/icon/Icon';
16
16
  import { IconSlot } from '../../internal/icon/IconSlot';
17
17
  import { cx } from '../../internal/utils/cx';
18
- import { Button } from '../../primitives/button/Button';
18
+ import { buttonClass } from '../../primitives/button/button-style';
19
19
 
20
20
  export type AlertTone = 'info' | 'success' | 'warning' | 'danger';
21
21
 
@@ -125,9 +125,13 @@ export function Alert({
125
125
  {children != null && <p className="zc-alert__desc">{children}</p>}
126
126
  </div>
127
127
  {action && (
128
- <Button variant="unstyled" size="sm" className="zc-alert__action" onClick={action.onClick}>
128
+ <button
129
+ type="button"
130
+ className={buttonClass({ size: 'sm', className: 'zc-alert__action' })}
131
+ onClick={action.onClick}
132
+ >
129
133
  {action.label}
130
- </Button>
134
+ </button>
131
135
  )}
132
136
  {dismissible && (
133
137
  <button type="button" className="zc-alert__close" aria-label="Dismiss" onClick={dismiss}>
@@ -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-alert-shell {
@@ -14,6 +14,7 @@ import { activationProps, type ActivateOn } from '../../internal/utils/activatio
14
14
  import { cx } from '../../internal/utils/cx';
15
15
  import { Button } from '../../primitives/button/Button';
16
16
  import { col, DOW, grid, MONTHS, parse, today, toKey, tzLabel, within } from './date-utils';
17
+ import { MonthJump } from './month-jump';
17
18
  import { useDayFocus } from './use-day-focus';
18
19
 
19
20
  const PILL_FLIP = { timing: UIMotion.t.settle };
@@ -56,6 +57,11 @@ export function DtpPanel({ val, commit, min, max, timezone, label, close, slot,
56
57
  function goToMonth(y: number, m: number) {
57
58
  setView((v) => (v.y === y && v.m === m ? v : { y: y, m: m }));
58
59
  }
60
+ const jumpedRef = useRef(false);
61
+ function jumpToMonth(y: number, m: number) {
62
+ jumpedRef.current = true;
63
+ goToMonth(y, m);
64
+ }
59
65
  function nav(dir: number) {
60
66
  const d = new Date(view.y, view.m + dir, 1);
61
67
  goToMonth(d.getFullYear(), d.getMonth());
@@ -75,7 +81,9 @@ export function DtpPanel({ val, commit, min, max, timezone, label, close, slot,
75
81
  const prev = prevViewRef.current;
76
82
  prevViewRef.current = viewIdx;
77
83
  const el = daysRef.current;
78
- if (prev == null || prev === viewIdx || !el) return;
84
+ const jumped = jumpedRef.current;
85
+ jumpedRef.current = false;
86
+ if (prev == null || prev === viewIdx || !el || jumped) return;
79
87
  const dir = viewIdx > prev ? 1 : -1;
80
88
  animate(el, slideIn(dir * UIMotion.dist.md, UIMotion.t.enter));
81
89
  }, [viewIdx]);
@@ -129,9 +137,7 @@ export function DtpPanel({ val, commit, min, max, timezone, label, close, slot,
129
137
  <div className="zc-dtp" role="dialog" aria-label={label || 'Pick a date'}>
130
138
  <div className="zc-dtp__cal">
131
139
  <div className="zc-dtp__head">
132
- <span className="zc-dtp__month" aria-live="polite">
133
- {MONTHS[view.m]} <span className="zc-dtp__year">{view.y}</span>
134
- </span>
140
+ <MonthJump y={view.y} m={view.m} min={min} max={max} activateOn={activateOn} onPick={jumpToMonth} />
135
141
  <div className="zc-dtp__navs">
136
142
  <button
137
143
  type="button"