@zyncat/ui 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) 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 +21 -24
  10. package/dist/button.js +3 -1
  11. package/dist/checkbox.css +1 -1
  12. package/dist/chunk-2YGHPQ66.js +16 -0
  13. package/dist/chunk-2YGHPQ66.js.map +1 -0
  14. package/dist/{chunk-K45CWVHS.js → chunk-3MLUH2QL.js} +4 -4
  15. package/dist/{chunk-K45CWVHS.js.map → chunk-3MLUH2QL.js.map} +1 -1
  16. package/dist/{chunk-FVPNICF4.js → chunk-4PQDVK23.js} +4 -4
  17. package/dist/{chunk-FVPNICF4.js.map → chunk-4PQDVK23.js.map} +1 -1
  18. package/dist/{chunk-FLQVOSFC.js → chunk-6IXLW7QA.js} +7 -7
  19. package/dist/{chunk-FLQVOSFC.js.map → chunk-6IXLW7QA.js.map} +1 -1
  20. package/dist/chunk-7NHY2CRA.js +132 -0
  21. package/dist/chunk-7NHY2CRA.js.map +1 -0
  22. package/dist/{chunk-BH4JFWXQ.js → chunk-7VTWJL72.js} +19 -16
  23. package/dist/chunk-7VTWJL72.js.map +1 -0
  24. package/dist/chunk-7ZSIUUC3.js +50 -0
  25. package/dist/chunk-7ZSIUUC3.js.map +1 -0
  26. package/dist/{chunk-6X3G4GIM.js → chunk-DH7DT6EO.js} +3 -3
  27. package/dist/{chunk-6X3G4GIM.js.map → chunk-DH7DT6EO.js.map} +1 -1
  28. package/dist/{chunk-QGVFFT2B.js → chunk-EOWWVFBF.js} +3 -3
  29. package/dist/{chunk-QGVFFT2B.js.map → chunk-EOWWVFBF.js.map} +1 -1
  30. package/dist/{chunk-RBSHRRNO.js → chunk-FLDIRXFU.js} +5 -5
  31. package/dist/{chunk-RBSHRRNO.js.map → chunk-FLDIRXFU.js.map} +1 -1
  32. package/dist/{chunk-5GBV45YD.js → chunk-GWCBTD63.js} +3 -3
  33. package/dist/{chunk-5GBV45YD.js.map → chunk-GWCBTD63.js.map} +1 -1
  34. package/dist/chunk-GZ6UMHCK.js +103 -0
  35. package/dist/chunk-GZ6UMHCK.js.map +1 -0
  36. package/dist/{chunk-FEXUS4SV.js → chunk-HWDIVGME.js} +11 -5
  37. package/dist/chunk-HWDIVGME.js.map +1 -0
  38. package/dist/chunk-KSAJ6DED.js +16 -0
  39. package/dist/chunk-KSAJ6DED.js.map +1 -0
  40. package/dist/{chunk-UYSXJ7MH.js → chunk-LH2UIEKN.js} +7 -17
  41. package/dist/chunk-LH2UIEKN.js.map +1 -0
  42. package/dist/{chunk-CAXQJSIE.js → chunk-M2A6PZ7J.js} +6 -6
  43. package/dist/{chunk-CAXQJSIE.js.map → chunk-M2A6PZ7J.js.map} +1 -1
  44. package/dist/chunk-NYQQH4R5.js +40 -0
  45. package/dist/chunk-NYQQH4R5.js.map +1 -0
  46. package/dist/{chunk-BTF6DAE3.js → chunk-ODRO3KS6.js} +4 -4
  47. package/dist/{chunk-BTF6DAE3.js.map → chunk-ODRO3KS6.js.map} +1 -1
  48. package/dist/{chunk-GJTHWB6O.js → chunk-QDAN43B6.js} +3 -3
  49. package/dist/{chunk-GJTHWB6O.js.map → chunk-QDAN43B6.js.map} +1 -1
  50. package/dist/{chunk-MDSRZ4QR.js → chunk-RY35IU3G.js} +3 -3
  51. package/dist/{chunk-MDSRZ4QR.js.map → chunk-RY35IU3G.js.map} +1 -1
  52. package/dist/{chunk-GOLSYGRA.js → chunk-TBLPZQSI.js} +84 -48
  53. package/dist/chunk-TBLPZQSI.js.map +1 -0
  54. package/dist/{chunk-5X3MJRIM.js → chunk-UKPX3RIP.js} +3 -3
  55. package/dist/{chunk-5X3MJRIM.js.map → chunk-UKPX3RIP.js.map} +1 -1
  56. package/dist/{chunk-CFRGQJ23.js → chunk-VZXML7EH.js} +4 -4
  57. package/dist/{chunk-CFRGQJ23.js.map → chunk-VZXML7EH.js.map} +1 -1
  58. package/dist/{chunk-PWQVSVXR.js → chunk-WC45VSST.js} +8 -8
  59. package/dist/{chunk-PWQVSVXR.js.map → chunk-WC45VSST.js.map} +1 -1
  60. package/dist/chunk-WQKWPI6V.js +196 -0
  61. package/dist/chunk-WQKWPI6V.js.map +1 -0
  62. package/dist/{chunk-N2GJEO5Z.js → chunk-ZHMOH62S.js} +4 -4
  63. package/dist/chunk-ZHMOH62S.js.map +1 -0
  64. package/dist/cli.js +259 -43
  65. package/dist/collapse.css +8 -5
  66. package/dist/confetti.css +3 -3
  67. package/dist/confetti.js +2 -2
  68. package/dist/date-field.js +16 -14
  69. package/dist/date-field.js.map +1 -1
  70. package/dist/date-picker.css +168 -43
  71. package/dist/date-range-field.js +38 -23
  72. package/dist/date-range-field.js.map +1 -1
  73. package/dist/datetime-field.js +17 -15
  74. package/dist/datetime-field.js.map +1 -1
  75. package/dist/dialog.css +4 -3
  76. package/dist/dialog.js +8 -8
  77. package/dist/digit-strip.css +1 -1
  78. package/dist/dropdown.css +1 -1
  79. package/dist/dropdown.js +8 -8
  80. package/dist/emoji-picker.js +14 -14
  81. package/dist/facebook-feed.css +1 -1
  82. package/dist/flow-field.css +4 -4
  83. package/dist/flow-field.js +3 -3
  84. package/dist/flow-field.js.map +1 -1
  85. package/dist/glide.js +3 -3
  86. package/dist/icon.css +1 -1
  87. package/dist/input.css +7 -4
  88. package/dist/instagram-feed.css +1 -1
  89. package/dist/instagram-feed.js +2 -2
  90. package/dist/lens.css +1 -2
  91. package/dist/lens.js +2 -2
  92. package/dist/mcp.js +1 -1
  93. package/dist/menu-surface.css +1 -1
  94. package/dist/modal.css +1 -1
  95. package/dist/modal.js +6 -6
  96. package/dist/morphing-text.css +2 -2
  97. package/dist/morphing-text.js +2 -2
  98. package/dist/motion-devtools.css +77 -2
  99. package/dist/motion-devtools.js +194 -37
  100. package/dist/motion-devtools.js.map +1 -1
  101. package/dist/motion-tokens.js +1 -1
  102. package/dist/multi-select.js +9 -9
  103. package/dist/number-field.js +3 -3
  104. package/dist/odometer.css +1 -1
  105. package/dist/odometer.js +2 -2
  106. package/dist/overlay.css +1 -1
  107. package/dist/pagination.css +1 -1
  108. package/dist/pagination.js +6 -4
  109. package/dist/pagination.js.map +1 -1
  110. package/dist/paint-CJQCM6ZO.js +260 -0
  111. package/dist/paint-CJQCM6ZO.js.map +1 -0
  112. package/dist/popover.css +1 -1
  113. package/dist/popover.js +6 -6
  114. package/dist/radio-group.css +6 -4
  115. package/dist/radio-group.js +6 -6
  116. package/dist/select.css +1 -1
  117. package/dist/select.js +9 -9
  118. package/dist/sheet.css +1 -1
  119. package/dist/sheet.js +7 -7
  120. package/dist/spinner.css +115 -0
  121. package/dist/spinner.js +4 -0
  122. package/dist/spinner.js.map +1 -0
  123. package/dist/status-badge.js +2 -2
  124. package/dist/styles.css +1 -1
  125. package/dist/support-rail.css +76 -238
  126. package/dist/support-rail.js +97 -105
  127. package/dist/support-rail.js.map +1 -1
  128. package/dist/table.css +2 -2
  129. package/dist/table.js +8 -6
  130. package/dist/table.js.map +1 -1
  131. package/dist/tabs.css +10 -14
  132. package/dist/tabs.js +6 -6
  133. package/dist/tag.css +1 -1
  134. package/dist/tag.js +6 -6
  135. package/dist/text-field.js +3 -3
  136. package/dist/textarea.css +1 -1
  137. package/dist/textarea.js +2 -2
  138. package/dist/theme-grid.js +11 -0
  139. package/dist/theme-grid.js.map +1 -0
  140. package/dist/theme-switcher.css +107 -0
  141. package/dist/theme-switcher.js +70 -0
  142. package/dist/theme-switcher.js.map +1 -0
  143. package/dist/theme-transition-LLC644ZR.js +346 -0
  144. package/dist/theme-transition-LLC644ZR.js.map +1 -0
  145. package/dist/theme-transition.css +48 -0
  146. package/dist/theme.js +57 -26
  147. package/dist/theme.js.map +1 -1
  148. package/dist/tide-DJZMDAFT.js +57 -0
  149. package/dist/tide-DJZMDAFT.js.map +1 -0
  150. package/dist/tiktok.css +2 -3
  151. package/dist/tiktok.js +2 -2
  152. package/dist/time-field.js +4 -4
  153. package/dist/toast.css +2 -14
  154. package/dist/toast.js +11 -9
  155. package/dist/toast.js.map +1 -1
  156. package/dist/toggle-tag.js +2 -2
  157. package/dist/toggle.css +1 -1
  158. package/dist/tooltip.css +1 -1
  159. package/dist/tooltip.js +5 -5
  160. package/dist/trigger.css +1 -1
  161. package/dist/types/components/composites/date-picker/month-jump.d.ts +11 -0
  162. package/dist/types/components/composites/theme-switcher/ThemeGrid.d.ts +20 -0
  163. package/dist/types/components/composites/theme-switcher/ThemeSwitcher.d.ts +24 -0
  164. package/dist/types/components/compound/support-rail/SupportRail.d.ts +10 -8
  165. package/dist/types/components/dev/MotionDevtools.d.ts +10 -5
  166. package/dist/types/components/expressive/theme-transition/bloom.d.ts +2 -0
  167. package/dist/types/components/expressive/theme-transition/paint.d.ts +2 -0
  168. package/dist/types/components/expressive/theme-transition/scene.d.ts +24 -0
  169. package/dist/types/components/expressive/theme-transition/theme-transition.d.ts +19 -0
  170. package/dist/types/components/expressive/theme-transition/tide.d.ts +2 -0
  171. package/dist/types/components/internal/icon/Icon.d.ts +1 -0
  172. package/dist/types/components/primitives/button/Button.d.ts +9 -12
  173. package/dist/types/components/primitives/button/button-style.d.ts +15 -0
  174. package/dist/types/components/primitives/spinner/Spinner.d.ts +27 -0
  175. package/dist/types/engine/animate.d.ts +1 -0
  176. package/dist/types/tokens/component-styles.generated.d.ts +35 -38
  177. package/dist/types/tokens/motion-tokens.d.ts +2 -2
  178. package/dist/types/tokens/theme-store.d.ts +47 -0
  179. package/dist/types/tokens/theme-sync.d.ts +7 -1
  180. package/dist/types/tokens/theme-tokens.generated.d.ts +121 -109
  181. package/dist/types/tokens/theme.d.ts +28 -5
  182. package/dist/typing-lines.css +1 -1
  183. package/dist/typing-lines.js +2 -2
  184. package/dist/weight-field.css +2 -2
  185. package/dist/youtube.css +1 -1
  186. package/dist/youtube.js +2 -2
  187. package/package.json +25 -31
  188. package/skills/zyncat-ui/references/components.md +5 -2
  189. package/src/components/composites/alert/Alert.tsx +7 -3
  190. package/src/components/composites/alert/alert.css +1 -1
  191. package/src/components/composites/date-picker/calendar-panel.tsx +10 -4
  192. package/src/components/composites/date-picker/date-picker.css +168 -43
  193. package/src/components/composites/date-picker/month-jump.tsx +192 -0
  194. package/src/components/composites/date-picker/range-panel.tsx +20 -5
  195. package/src/components/composites/dialog/dialog.css +4 -3
  196. package/src/components/composites/dropdown/dropdown.css +1 -1
  197. package/src/components/composites/emoji-picker/styles.css +1 -1
  198. package/src/components/composites/modal/modal.css +1 -1
  199. package/src/components/composites/pagination/pagination.css +1 -1
  200. package/src/components/composites/popover/popover.css +1 -1
  201. package/src/components/composites/select/select.css +1 -1
  202. package/src/components/composites/sheet/sheet.css +1 -1
  203. package/src/components/composites/table/table.css +2 -2
  204. package/src/components/composites/tabs/tabs.css +10 -14
  205. package/src/components/composites/theme-switcher/ThemeGrid.tsx +133 -0
  206. package/src/components/composites/theme-switcher/ThemeGrid.usage.md +20 -0
  207. package/src/components/composites/theme-switcher/ThemeSwitcher.tsx +75 -0
  208. package/src/components/composites/theme-switcher/ThemeSwitcher.usage.md +21 -0
  209. package/src/components/composites/theme-switcher/theme-switcher.css +107 -0
  210. package/src/components/composites/toast/Toast.tsx +2 -1
  211. package/src/components/composites/toast/toast.css +2 -14
  212. package/src/components/composites/tooltip/tooltip.css +1 -1
  213. package/src/components/compound/support-rail/SupportRail.tsx +116 -128
  214. package/src/components/compound/support-rail/SupportRail.usage.md +7 -6
  215. package/src/components/compound/support-rail/support-rail.css +76 -238
  216. package/src/components/dev/MotionDevtools.tsx +252 -42
  217. package/src/components/dev/MotionDevtools.usage.md +12 -4
  218. package/src/components/dev/motion-devtools.css +77 -2
  219. package/src/components/dev/slowmo-engine.ts +1 -1
  220. package/src/components/expressive/confetti/confetti.css +3 -3
  221. package/src/components/expressive/facebook-feed/facebook-feed.css +1 -1
  222. package/src/components/expressive/flow-field/FlowField.tsx +1 -1
  223. package/src/components/expressive/flow-field/flow-field.css +4 -4
  224. package/src/components/expressive/instagram-feed/instagram-feed.css +1 -1
  225. package/src/components/expressive/lens/lens.css +1 -2
  226. package/src/components/expressive/morphing-text/morphing-text.css +2 -2
  227. package/src/components/expressive/odometer/odometer.css +1 -1
  228. package/src/components/expressive/theme-transition/bloom.ts +88 -0
  229. package/src/components/expressive/theme-transition/paint.ts +296 -0
  230. package/src/components/expressive/theme-transition/scene.ts +38 -0
  231. package/src/components/expressive/theme-transition/theme-transition.css +48 -0
  232. package/src/components/expressive/theme-transition/theme-transition.ts +423 -0
  233. package/src/components/expressive/theme-transition/tide.ts +65 -0
  234. package/src/components/expressive/tiktok/tiktok.css +2 -3
  235. package/src/components/expressive/typing-lines/typing-lines.css +1 -1
  236. package/src/components/expressive/weight-field/weight-field.css +2 -2
  237. package/src/components/expressive/youtube/youtube.css +1 -1
  238. package/src/components/internal/glass/glass.css +1 -1
  239. package/src/components/internal/icon/Icon.tsx +2 -0
  240. package/src/components/internal/icon/icon.css +1 -1
  241. package/src/components/internal/menu/menu-surface.css +1 -1
  242. package/src/components/internal/overlay/overlay.css +1 -1
  243. package/src/components/internal/overlay/trigger.css +1 -1
  244. package/src/components/primitives/avatar/avatar.css +3 -2
  245. package/src/components/primitives/badge/badge.css +1 -1
  246. package/src/components/primitives/badge/digit-strip.css +1 -1
  247. package/src/components/primitives/button/Button.tsx +12 -26
  248. package/src/components/primitives/button/button-style.ts +28 -0
  249. package/src/components/primitives/button/button.css +21 -24
  250. package/src/components/primitives/checkbox/checkbox.css +1 -1
  251. package/src/components/primitives/collapse/collapse.css +8 -5
  252. package/src/components/primitives/input/input.css +7 -4
  253. package/src/components/primitives/radio-group/radio-group.css +6 -4
  254. package/src/components/primitives/spinner/Spinner.tsx +70 -0
  255. package/src/components/primitives/spinner/Spinner.usage.md +19 -0
  256. package/src/components/primitives/spinner/spinner.css +115 -0
  257. package/src/components/primitives/tag/tag.css +1 -1
  258. package/src/components/primitives/textarea/textarea.css +1 -1
  259. package/src/components/primitives/toggle/toggle.css +1 -1
  260. package/src/engine/animate.ts +10 -2
  261. package/src/mcp/server.ts +2 -1
  262. package/src/styles.css +3 -3
  263. package/src/tokens/base.css +5 -5
  264. package/src/tokens/color.css +8 -9
  265. package/src/tokens/component-styles.generated.ts +36 -38
  266. package/src/tokens/dark.css +8 -13
  267. package/src/tokens/decisions.css +5 -8
  268. package/src/tokens/elevation.css +18 -26
  269. package/src/tokens/glass.css +3 -2
  270. package/src/tokens/motion-defaults.generated.ts +1 -1
  271. package/src/tokens/motion-tokens.ts +3 -3
  272. package/src/tokens/motion.css +9 -9
  273. package/src/tokens/radius.css +3 -2
  274. package/src/tokens/reset.css +36 -0
  275. package/src/tokens/semantic.css +10 -18
  276. package/src/tokens/spacing.css +1 -1
  277. package/src/tokens/theme-store.ts +187 -0
  278. package/src/tokens/theme-sync.tsx +49 -2
  279. package/src/tokens/theme-tokens.generated.ts +124 -110
  280. package/src/tokens/theme.tsx +96 -24
  281. package/src/tokens/theme.usage.md +25 -24
  282. package/src/tokens/typography.css +4 -3
  283. package/tailwind.css +7 -13
  284. package/dist/chunk-6SUHSSOK.js +0 -25
  285. package/dist/chunk-6SUHSSOK.js.map +0 -1
  286. package/dist/chunk-BH4JFWXQ.js.map +0 -1
  287. package/dist/chunk-FEXUS4SV.js.map +0 -1
  288. package/dist/chunk-GOLSYGRA.js.map +0 -1
  289. package/dist/chunk-N2GJEO5Z.js.map +0 -1
  290. package/dist/chunk-UYSXJ7MH.js.map +0 -1
@@ -1,25 +1,26 @@
1
- 'use client';
2
-
3
- import './button.css';
4
-
5
1
  import type { ButtonHTMLAttributes, CSSProperties, ReactNode, Ref } from 'react';
6
2
 
7
3
  import type { DataAttributes } from '../../../dom-props';
8
4
  import { cx } from '../../internal/utils/cx';
5
+ import { Spinner } from '../spinner/Spinner';
6
+ import { buttonClass, type ButtonSize, type ButtonVariant } from './button-style';
7
+
8
+ export { buttonClass } from './button-style';
9
+ export type { ButtonSize, ButtonStyleProps, ButtonVariant } from './button-style';
9
10
 
10
11
  interface ButtonOwnProps {
11
- /** Visual weight / intent. `unstyled` emits base chrome only (sizing, focus ring,
12
- * layout) with no skin - for local re-skins via `className`, e.g. Alert's tone action. @default 'primary' */
13
- variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'link' | 'unstyled';
12
+ /** Visual weight / intent. @default 'primary' */
13
+ variant?: ButtonVariant;
14
14
  /** Forwarded to the underlying <button> (React 19 ref-as-prop). */
15
15
  ref?: Ref<HTMLButtonElement>;
16
16
  /** Control height. sm 28px - md 32px (default) - lg 37px. @default 'md' */
17
- size?: 'sm' | 'md' | 'lg' | 'icon';
17
+ size?: ButtonSize;
18
18
  /** `submit` / `reset` / `button`. @default 'button' */
19
19
  type?: 'button' | 'submit' | 'reset';
20
20
  /** Disable the control (also implied by `loading`). */
21
21
  disabled?: boolean;
22
- /** Loading - swaps content for a spinner and makes the button inert. */
22
+ /** Loading - swaps the label for a spinner and makes the button inert. The label stays
23
+ * mounted but invisible, so the button holds its width. */
23
24
  loading?: boolean;
24
25
  /** Stretch to fill the container width. */
25
26
  fullWidth?: boolean;
@@ -29,10 +30,6 @@ interface ButtonOwnProps {
29
30
  style?: CSSProperties;
30
31
  /** Button label. */
31
32
  children?: ReactNode;
32
- /** Click handler */
33
- onClick?: React.MouseEventHandler<HTMLButtonElement>;
34
- /** Pointer handler */
35
- onPointerDown?: React.PointerEventHandler<HTMLButtonElement>;
36
33
  }
37
34
 
38
35
  type ButtonRestProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonOwnProps> & DataAttributes;
@@ -53,20 +50,11 @@ export function Button({
53
50
  className = '',
54
51
  style,
55
52
  children,
56
- onClick,
57
53
  ref,
58
- onPointerDown,
59
54
  htmlProps,
60
55
  ...rest
61
56
  }: ButtonProps) {
62
- const cls = cx(
63
- 'zc-btn',
64
- variant !== 'unstyled' && `zc-btn--${variant}`,
65
- size !== 'md' && `zc-btn--${size}`,
66
- fullWidth && 'zc-btn--block',
67
- loading && 'zc-is-loading',
68
- className,
69
- );
57
+ const cls = cx(buttonClass({ variant, size, fullWidth, className }), loading && 'zc-is-loading');
70
58
 
71
59
  return (
72
60
  <button
@@ -76,13 +64,11 @@ export function Button({
76
64
  style={style}
77
65
  disabled={disabled || loading}
78
66
  aria-busy={loading || undefined}
79
- onClick={onClick}
80
- onPointerDown={onPointerDown}
81
67
  {...rest}
82
68
  {...htmlProps}
83
69
  >
84
70
  <span className="zc-btn__label">{children}</span>
85
- {loading ? <span className="zc-btn__spinner" aria-hidden="true" /> : null}
71
+ {loading ? <Spinner label={null} className="zc-btn__spinner" /> : null}
86
72
  </button>
87
73
  );
88
74
  }
@@ -0,0 +1,28 @@
1
+ import './button.css';
2
+
3
+ import { cx } from '../../internal/utils/cx';
4
+
5
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger' | 'link';
6
+ export type ButtonSize = 'sm' | 'md' | 'lg' | 'icon';
7
+
8
+ export interface ButtonStyleProps {
9
+ /** Visual weight / intent. Omit for base chrome only - sizing, focus ring, layout -
10
+ * with no skin, for a local re-skin through `className`. */
11
+ variant?: ButtonVariant;
12
+ /** Control height. sm 28px - md 32px (default) - lg 37px. @default 'md' */
13
+ size?: ButtonSize;
14
+ /** Stretch to fill the container width. */
15
+ fullWidth?: boolean;
16
+ /** Extra class(es) merged onto the result. */
17
+ className?: string;
18
+ }
19
+
20
+ export function buttonClass({ variant, size = 'md', fullWidth, className }: ButtonStyleProps = {}): string {
21
+ return cx(
22
+ 'zc-btn',
23
+ variant && `zc-btn--${variant}`,
24
+ size !== 'md' && `zc-btn--${size}`,
25
+ fullWidth && 'zc-btn--block',
26
+ className,
27
+ );
28
+ }
@@ -1,4 +1,4 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @property --btn-grad-a {
4
4
  syntax: '<color>';
@@ -16,6 +16,7 @@
16
16
  --btn-shadow: none;
17
17
  --btn-ring: var(--ring-accent);
18
18
  --btn-gap: var(--space-2);
19
+ --btn-press-scale: 0.96;
19
20
 
20
21
  position: relative;
21
22
  isolation: isolate;
@@ -28,6 +29,7 @@
28
29
  padding: 0 var(--space-4);
29
30
  border: var(--border-hairline) solid transparent;
30
31
  border-radius: var(--radius-md);
32
+ background-color: transparent;
31
33
  background-origin: border-box;
32
34
 
33
35
  font-family: var(--font-body);
@@ -52,7 +54,7 @@
52
54
  color var(--duration-fast) var(--ease-standard),
53
55
  box-shadow var(--duration-fast) var(--ease-standard),
54
56
  outline-color var(--duration-fast) var(--ease-standard),
55
- transform var(--duration-fast) var(--ease-standard);
57
+ transform var(--duration-slow) var(--ease-standard);
56
58
  outline: var(--ring-rest);
57
59
  }
58
60
 
@@ -60,6 +62,10 @@
60
62
  outline: var(--btn-ring);
61
63
  }
62
64
 
65
+ .zc-btn:active:not(:disabled):not(.zc-is-loading) {
66
+ transform: scale(var(--btn-press-scale));
67
+ }
68
+
63
69
  .zc-btn--sm {
64
70
  height: var(--control-height-sm);
65
71
  padding: 0 var(--space-3);
@@ -125,8 +131,6 @@
125
131
  .zc-btn--primary:active:not(:disabled):not(.zc-is-loading) {
126
132
  --btn-grad-a: color-mix(in oklab, var(--accent-hover) 70%, var(--accent-active));
127
133
  --btn-grad-b: var(--accent-fill);
128
- transform: translateY(var(--space-px));
129
- --btn-shadow: inset 0 1px 2px 0 rgb(var(--shadow-rgb) / 0.16), 0 1px 1px 0 rgb(var(--shadow-rgb) / 0.08);
130
134
  }
131
135
 
132
136
  .zc-btn--secondary {
@@ -149,7 +153,6 @@
149
153
  .zc-btn--secondary:active:not(:disabled):not(.zc-is-loading) {
150
154
  --btn-grad-a: color-mix(in oklab, var(--text-secondary) 5%, var(--btn-face-lit));
151
155
  --btn-grad-b: color-mix(in oklab, var(--text-secondary) 5%, var(--btn-face-shade));
152
- transform: translateY(var(--space-px));
153
156
  --btn-shadow: inset 0 1px 2px 0 rgb(var(--shadow-rgb) / 0.06);
154
157
  }
155
158
 
@@ -177,9 +180,6 @@
177
180
  opacity: 1;
178
181
  transform: scale(1);
179
182
  }
180
- .zc-btn--ghost:active:not(:disabled):not(.zc-is-loading) {
181
- transform: translateY(var(--space-px));
182
- }
183
183
  .zc-btn--ghost:active:not(:disabled):not(.zc-is-loading)::before {
184
184
  background: var(--neutral-wash-press);
185
185
  }
@@ -204,7 +204,6 @@
204
204
  .zc-btn--danger:active:not(:disabled):not(.zc-is-loading) {
205
205
  --btn-grad-a: color-mix(in oklab, var(--danger) 70%, var(--danger-active));
206
206
  --btn-grad-b: var(--danger-fill);
207
- transform: translateY(var(--space-px));
208
207
  --btn-shadow: inset 0 1px 2px 0 rgb(var(--shadow-rgb) / 0.16), 0 1px 1px 0 rgb(var(--shadow-rgb) / 0.08);
209
208
  }
210
209
 
@@ -215,6 +214,7 @@
215
214
  color: var(--text-accent);
216
215
  background: none;
217
216
  --btn-shadow: none;
217
+ --btn-press-scale: 1;
218
218
  font-weight: var(--weight-medium);
219
219
  }
220
220
  .zc-btn--link:hover:not(:disabled):not(.zc-is-loading) {
@@ -238,18 +238,21 @@
238
238
  transform: none;
239
239
  }
240
240
  .zc-btn--primary:disabled {
241
- background: var(--accent-disabled);
241
+ --btn-grad-a: var(--accent-disabled);
242
+ --btn-grad-b: var(--accent-disabled);
242
243
  color: var(--text-on-accent);
243
244
  --btn-shadow: none;
244
245
  }
245
246
  .zc-btn--danger:disabled {
246
- background: var(--danger-disabled);
247
+ --btn-grad-a: var(--danger-disabled);
248
+ --btn-grad-b: var(--danger-disabled);
247
249
  color: var(--text-on-accent);
248
250
  --btn-shadow: none;
249
251
  }
250
252
  .zc-btn--secondary:disabled {
251
253
  color: var(--text-disabled);
252
- background: var(--bg-subtle);
254
+ --btn-grad-a: var(--bg-subtle);
255
+ --btn-grad-b: var(--bg-subtle);
253
256
  border-color: var(--border-subtle);
254
257
  --btn-shadow: none;
255
258
  }
@@ -270,18 +273,12 @@
270
273
  position: absolute;
271
274
  top: 50%;
272
275
  left: 50%;
273
- width: 1em;
274
- height: 1em;
275
- margin: -0.5em 0 0 -0.5em;
276
- border-radius: var(--radius-full);
277
- border: var(--border-emphasis) solid currentColor;
278
- border-right-color: transparent;
279
- opacity: 0.9;
280
- animation: btn-spin var(--duration-spin) var(--ease-standard) infinite;
281
- }
282
- @keyframes btn-spin {
283
- to {
284
- transform: rotate(360deg);
276
+ translate: -50% -50%;
277
+ }
278
+
279
+ @media (prefers-reduced-motion: reduce) {
280
+ .zc-btn:active:not(:disabled):not(.zc-is-loading) {
281
+ transform: none;
285
282
  }
286
283
  }
287
284
  }
@@ -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-cbx {
@@ -1,4 +1,4 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  /* Registered non-inheriting so a Collapse's inline timing never leaks into a Collapse nested
4
4
  inside it; unset, they resolve invalid and the var() fallbacks supply the defaults. */
@@ -35,8 +35,7 @@
35
35
  .zc-collapse[data-open='false'] {
36
36
  visibility: hidden;
37
37
  }
38
- /* No visibility: visible here - open flips it the same frame, and inheriting it keeps a Collapse
39
- nested under a closed ancestor hidden. */
38
+ /* No visibility: visible here - inheriting it would reveal a Collapse nested under a closed one. */
40
39
  .zc-collapse[data-open='true'] {
41
40
  grid-template-rows: 1fr;
42
41
  transition:
@@ -53,12 +52,16 @@
53
52
  grid-template-columns: 1fr;
54
53
  }
55
54
 
56
- /* min-size:0 is what lets the grid track collapse to 0. */
57
55
  .zc-collapse__inner {
58
- overflow: hidden;
56
+ overflow-x: visible;
57
+ overflow-y: clip;
59
58
  min-height: 0;
60
59
  min-width: 0;
61
60
  }
61
+ .zc-collapse[data-axis='width'] .zc-collapse__inner {
62
+ overflow-x: clip;
63
+ overflow-y: visible;
64
+ }
62
65
 
63
66
  .zc-collapse--fade .zc-collapse__inner {
64
67
  opacity: 0;
@@ -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-fld {
@@ -205,8 +205,6 @@
205
205
  display: grid;
206
206
  grid-template-rows: 1fr 1fr;
207
207
  border-left: var(--border-hairline) solid var(--border-default);
208
- border-radius: 0 var(--radius-md) var(--radius-md) 0;
209
- overflow: hidden;
210
208
  }
211
209
  .zc-numf__step {
212
210
  border: 0;
@@ -218,6 +216,12 @@
218
216
  transition: var(--transition-control);
219
217
  padding: 0;
220
218
  }
219
+ .zc-numf__step:first-child {
220
+ border-start-end-radius: var(--radius-md);
221
+ }
222
+ .zc-numf__step:last-child {
223
+ border-end-end-radius: var(--radius-md);
224
+ }
221
225
  .zc-numf__step:hover {
222
226
  background: var(--neutral-wash);
223
227
  color: var(--text-strong);
@@ -232,7 +236,6 @@
232
236
  }
233
237
  .zc-numf__step:focus-visible {
234
238
  outline: var(--ring-accent);
235
- outline-offset: var(--ring-inset);
236
239
  }
237
240
  .zc-numf__step + .zc-numf__step {
238
241
  border-top: var(--border-hairline) solid var(--border-default);
@@ -1,10 +1,12 @@
1
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
2
 
3
3
  @layer zyncat.components {
4
- /* Bespoke px: the dot sizes sit off the token ramp on purpose. */
4
+ /* Bespoke px: the authored value is the ring gap and the marker falls out of it, so the two
5
+ never leave an odd remainder to halve. */
5
6
  .zc-rg {
6
7
  --radio-group-dot: 18px;
7
- --radio-group-dot-inner: 8px;
8
+ --radio-group-dot-gap: 4px;
9
+ --radio-group-dot-inner: calc(var(--radio-group-dot) - 2 * (var(--border-hairline) + var(--radio-group-dot-gap)));
8
10
 
9
11
  display: grid;
10
12
  border: 0;
@@ -14,7 +16,7 @@
14
16
  }
15
17
  .zc-rg--sm {
16
18
  --radio-group-dot: 16px;
17
- --radio-group-dot-inner: 7px;
19
+ --radio-group-dot-gap: 3px;
18
20
  }
19
21
 
20
22
  .zc-rg__label {
@@ -0,0 +1,70 @@
1
+ import './spinner.css';
2
+
3
+ import type { CSSProperties } from 'react';
4
+
5
+ import type { DataAttributes } from '../../../dom-props';
6
+ import { cx } from '../../internal/utils/cx';
7
+
8
+ export type SpinnerSize = 'inherit' | 'sm' | 'md' | 'lg';
9
+ export type SpinnerThickness = 'thin' | 'regular' | 'bold';
10
+ export type SpinnerVariant = 'arc' | 'dots' | 'pulse';
11
+
12
+ const PART_COUNT: Record<SpinnerVariant, number> = { arc: 0, pulse: 0, dots: 3 };
13
+
14
+ export interface SpinnerProps {
15
+ /** Diameter. `inherit` tracks the parent's font size at 1em, so a spinner beside a label
16
+ * always matches it; for any other size set `style={{ fontSize }}`. @default 'inherit' */
17
+ size?: SpinnerSize;
18
+ /** Stroke weight, scaled to the diameter so it holds up at every size. @default 'regular' */
19
+ thickness?: SpinnerThickness;
20
+ /** Which loader to draw. @default 'arc' */
21
+ variant?: SpinnerVariant;
22
+ /** What assistive tech announces. Pass `null` when something nearby already announces the
23
+ * wait - a button's `aria-busy`, an enclosing `role="status"` - and the spinner turns
24
+ * decorative rather than announcing it twice. @default 'Loading' */
25
+ label?: string | null;
26
+ /** Hold invisible for a beat before fading in, so work that finishes quickly never flashes
27
+ * a spinner. @default false */
28
+ delay?: boolean;
29
+ /** Extra class(es) merged onto the root. */
30
+ className?: string;
31
+ /** Inline styles merged onto the root. */
32
+ style?: CSSProperties;
33
+ }
34
+
35
+ export function Spinner({
36
+ size = 'inherit',
37
+ thickness = 'regular',
38
+ variant = 'arc',
39
+ label = 'Loading',
40
+ delay = false,
41
+ className,
42
+ style,
43
+ ...rest
44
+ }: SpinnerProps & DataAttributes) {
45
+ const decorative = label === null;
46
+
47
+ return (
48
+ <span
49
+ className={cx(
50
+ 'zc-spin',
51
+ `zc-spin--${variant}`,
52
+ size !== 'inherit' && `zc-spin--${size}`,
53
+ thickness !== 'regular' && `zc-spin--${thickness}`,
54
+ delay && 'zc-spin--delayed',
55
+ className,
56
+ )}
57
+ style={style}
58
+ role={decorative ? undefined : 'status'}
59
+ aria-label={decorative ? undefined : label}
60
+ aria-hidden={decorative ? true : undefined}
61
+ {...rest}
62
+ >
63
+ <span className="zc-spin__figure">
64
+ {Array.from({ length: PART_COUNT[variant] }, (_, i) => (
65
+ <span key={i} className="zc-spin__part" style={{ '--_spinner-i': i } as CSSProperties} />
66
+ ))}
67
+ </span>
68
+ </span>
69
+ );
70
+ }
@@ -0,0 +1,19 @@
1
+ # Spinner - @zyncat/ui/spinner
2
+
3
+ Group: primitives
4
+ Docs: https://ui.zyncat.app/spinner
5
+
6
+ Indeterminate loader; three looks, no JavaScript, no layout of its own.
7
+
8
+ Sizing is type-relative: the default `size="inherit"` draws at 1em, so a spinner beside a label
9
+ matches it without being told to, and `style={{ fontSize }}` sets any other diameter. thickness
10
+ scales with the diameter, so a large spinner is not a hairline. It announces itself as
11
+ `role="status"` labelled "Loading" by default; pass `label={null}` where something nearby already
12
+ announces the wait, as Button does through `aria-busy`. delay holds it invisible for a beat, so work
13
+ that finishes quickly never flashes a spinner.
14
+
15
+ ```tsx
16
+ <Spinner />
17
+ <Spinner variant="dots" size="lg" thickness="bold" />
18
+ <Spinner label={null} delay />
19
+ ```
@@ -0,0 +1,115 @@
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
2
+
3
+ @layer zyncat.components {
4
+ .zc-spin {
5
+ --_spinner-size: 1em;
6
+ --_spinner-stroke: 0.125em;
7
+ --_spinner-dim: 0.16;
8
+ --_spinner-onset: var(--duration-slowest);
9
+
10
+ display: inline-block;
11
+ vertical-align: middle;
12
+ flex: none;
13
+ color: inherit;
14
+ }
15
+
16
+ .zc-spin--sm {
17
+ font-size: var(--size-caption);
18
+ }
19
+ .zc-spin--md {
20
+ font-size: var(--size-heading);
21
+ }
22
+ .zc-spin--lg {
23
+ font-size: var(--size-title-lg);
24
+ }
25
+
26
+ .zc-spin--thin {
27
+ --_spinner-stroke: 0.09em;
28
+ }
29
+ .zc-spin--bold {
30
+ --_spinner-stroke: 0.19em;
31
+ }
32
+
33
+ .zc-spin__figure {
34
+ position: relative;
35
+ display: block;
36
+ inline-size: var(--_spinner-size);
37
+ block-size: var(--_spinner-size);
38
+ }
39
+
40
+ .zc-spin--delayed .zc-spin__figure {
41
+ animation: zc-spin-appear var(--duration-base) var(--ease-standard) var(--_spinner-onset) backwards;
42
+ }
43
+ @keyframes zc-spin-appear {
44
+ from {
45
+ opacity: 0;
46
+ }
47
+ }
48
+
49
+ .zc-spin--arc .zc-spin__figure {
50
+ border-radius: var(--radius-full);
51
+ border: var(--_spinner-stroke) solid currentColor;
52
+ border-inline-end-color: transparent;
53
+ animation: zc-spin-turn var(--duration-spin) linear infinite;
54
+ }
55
+ .zc-spin--delayed.zc-spin--arc .zc-spin__figure {
56
+ animation:
57
+ zc-spin-turn var(--duration-spin) linear infinite,
58
+ zc-spin-appear var(--duration-base) var(--ease-standard) var(--_spinner-onset) backwards;
59
+ }
60
+ @keyframes zc-spin-turn {
61
+ to {
62
+ rotate: 1turn;
63
+ }
64
+ }
65
+
66
+ .zc-spin--pulse .zc-spin__figure::before,
67
+ .zc-spin--pulse .zc-spin__figure::after {
68
+ content: '';
69
+ position: absolute;
70
+ inset: 0;
71
+ border-radius: var(--radius-full);
72
+ border: var(--_spinner-stroke) solid currentColor;
73
+ animation: zc-spin-ping var(--duration-spin) var(--ease-standard) infinite;
74
+ }
75
+ .zc-spin--pulse .zc-spin__figure::after {
76
+ animation-delay: calc(var(--duration-spin) / -2);
77
+ }
78
+ @keyframes zc-spin-ping {
79
+ from {
80
+ scale: 0.2;
81
+ opacity: 1;
82
+ }
83
+ to {
84
+ scale: 1;
85
+ opacity: 0;
86
+ }
87
+ }
88
+
89
+ .zc-spin--dots .zc-spin__figure {
90
+ display: flex;
91
+ align-items: center;
92
+ justify-content: space-between;
93
+ inline-size: calc(var(--_spinner-size) * 2);
94
+ }
95
+ .zc-spin--dots .zc-spin__part {
96
+ inline-size: calc(var(--_spinner-size) / 2.6);
97
+ block-size: calc(var(--_spinner-size) / 2.6);
98
+ border-radius: var(--radius-full);
99
+ background: currentColor;
100
+ animation: zc-spin-bob var(--duration-spin) var(--ease-standard) infinite;
101
+ animation-delay: calc(var(--_spinner-i) * var(--duration-spin) / 6);
102
+ }
103
+ @keyframes zc-spin-bob {
104
+ 0%,
105
+ 70%,
106
+ 100% {
107
+ scale: 0.6;
108
+ opacity: var(--_spinner-dim);
109
+ }
110
+ 35% {
111
+ scale: 1;
112
+ opacity: 1;
113
+ }
114
+ }
115
+ }
@@ -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-tag {
@@ -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-txa {
@@ -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-sw {
@@ -19,6 +19,7 @@ export interface Layer {
19
19
  opacity?: number[];
20
20
  width?: Size[];
21
21
  height?: Size[];
22
+ radius?: string[];
22
23
  timing?: Timing;
23
24
  composite?: CompositeOperation;
24
25
  }
@@ -26,6 +27,11 @@ export interface Layer {
26
27
  export type Placement = Omit<Layer, 'timing' | 'composite'>;
27
28
 
28
29
  const RESET: Record<string, string> = { translate: '0px 0px', scale: '1' };
30
+ const CSS_NAME: Record<string, string> = { borderRadius: 'border-radius' };
31
+
32
+ function cssName(key: string): string {
33
+ return CSS_NAME[key] ?? key;
34
+ }
29
35
  const AUTO_METRIC = { width: 'offsetWidth', height: 'offsetHeight' } as const;
30
36
  const SIZES = ['width', 'height'] as const;
31
37
 
@@ -47,7 +53,7 @@ function cssLength(value: Length): string {
47
53
  }
48
54
 
49
55
  function currentValue(el: HTMLElement, key: string): string {
50
- const raw = getComputedStyle(el).getPropertyValue(key).trim();
56
+ const raw = getComputedStyle(el).getPropertyValue(cssName(key)).trim();
51
57
  return raw && raw !== 'none' ? raw : RESET[key];
52
58
  }
53
59
 
@@ -63,6 +69,7 @@ function compile(el: HTMLElement, layer: Layer) {
63
69
  }
64
70
  if (layer.scale) frames.scale = layer.scale.map((v) => (typeof v === 'number' ? String(v) : `${v[0]} ${v[1]}`));
65
71
  if (layer.opacity) frames.opacity = layer.opacity.map(String);
72
+ if (layer.radius) frames.borderRadius = [...layer.radius];
66
73
 
67
74
  for (const key of SIZES) {
68
75
  const list = layer[key];
@@ -115,7 +122,8 @@ function play(el: HTMLElement, layer: Layer): Playback | null {
115
122
 
116
123
  if (resolved.duration <= 0) {
117
124
  claim(el, keys, null);
118
- if (timing?.fill !== 'none') for (const key of keys) el.style.setProperty(key, frames[key][frames[key].length - 1]);
125
+ if (timing?.fill !== 'none')
126
+ for (const key of keys) el.style.setProperty(cssName(key), frames[key][frames[key].length - 1]);
119
127
  return null;
120
128
  }
121
129
 
package/src/mcp/server.ts CHANGED
@@ -382,7 +382,8 @@ const CONTRIBUTOR_TOOLS = [
382
382
  properties: {
383
383
  topic: {
384
384
  type: 'string',
385
- description: 'One section, e.g. "tokens", "contracts", "overrides", "compose", "tier". Omit for all.',
385
+ description:
386
+ 'One section, e.g. "tokens", "retiring", "contracts", "overrides", "compose", "tier". Omit for all.',
386
387
  },
387
388
  },
388
389
  additionalProperties: false,
package/src/styles.css CHANGED
@@ -1,9 +1,9 @@
1
1
  /* Zyncat UI global layer - import ONCE at your app root: import '@zyncat/ui/styles.css'.
2
- Fonts, tokens, the dark theme, the body defaults and the shared glass utility, in the `zyncat`
3
- layers so an unlayered rule of yours wins. Component CSS ships per component. Order matters. */
2
+ The reset layer is first, so everything else outranks it. Component CSS ships per component. */
4
3
 
5
- @layer zyncat.tokens, zyncat.components;
4
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
6
5
 
6
+ @import './tokens/reset.css';
7
7
  @import './tokens/decisions.css';
8
8
  @import './tokens/fonts.css';
9
9
 
@@ -1,8 +1,4 @@
1
- /* The base layer paints the page - app surface, body ink, body type - so `data-theme` on <html>
2
- turns the whole page, not only the components. Its own cascade layer, after the components, so
3
- a consumer's unlayered body rule still wins; antialiasing keeps light ink from bloating. */
4
-
5
- @layer zyncat.tokens, zyncat.components;
1
+ @layer zyncat.reset, zyncat.tokens, zyncat.components;
6
2
 
7
3
  @layer zyncat.base {
8
4
  body {
@@ -12,4 +8,8 @@
12
8
  -webkit-font-smoothing: antialiased;
13
9
  -moz-osx-font-smoothing: grayscale;
14
10
  }
11
+
12
+ ::selection {
13
+ background-color: color-mix(in oklab, var(--accent) 30%, transparent);
14
+ }
15
15
  }