@getcortexlabs/mavis-core 0.1.0-alpha.1 → 0.1.0-alpha.11

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 (482) hide show
  1. package/README.md +2 -2
  2. package/dist/accordion.d.ts +17 -0
  3. package/dist/accordion.d.ts.map +1 -0
  4. package/dist/accordion.js +42 -0
  5. package/dist/accordion.js.map +1 -0
  6. package/dist/alert.d.ts +21 -0
  7. package/dist/alert.d.ts.map +1 -0
  8. package/dist/alert.js +13 -0
  9. package/dist/alert.js.map +1 -0
  10. package/dist/app-icons.d.ts +27 -0
  11. package/dist/app-icons.d.ts.map +1 -0
  12. package/dist/app-icons.js +42 -0
  13. package/dist/app-icons.js.map +1 -0
  14. package/dist/avatar.d.ts +10 -0
  15. package/dist/avatar.d.ts.map +1 -0
  16. package/dist/avatar.js +11 -0
  17. package/dist/avatar.js.map +1 -0
  18. package/dist/badge.d.ts +7 -0
  19. package/dist/badge.d.ts.map +1 -0
  20. package/dist/badge.js +11 -0
  21. package/dist/badge.js.map +1 -0
  22. package/dist/capabilities.d.ts +132 -0
  23. package/dist/capabilities.d.ts.map +1 -0
  24. package/dist/capabilities.js +180 -0
  25. package/dist/capabilities.js.map +1 -0
  26. package/dist/chart.d.ts +40 -0
  27. package/dist/chart.d.ts.map +1 -0
  28. package/dist/chart.js +73 -0
  29. package/dist/chart.js.map +1 -0
  30. package/dist/chip.d.ts +9 -0
  31. package/dist/chip.d.ts.map +1 -0
  32. package/dist/chip.js +16 -0
  33. package/dist/chip.js.map +1 -0
  34. package/dist/choice-motion.d.ts +14 -0
  35. package/dist/choice-motion.d.ts.map +1 -0
  36. package/dist/choice-motion.js +5 -0
  37. package/dist/choice-motion.js.map +1 -0
  38. package/dist/choice.d.ts +15 -0
  39. package/dist/choice.d.ts.map +1 -0
  40. package/dist/choice.js +27 -0
  41. package/dist/choice.js.map +1 -0
  42. package/dist/collections.d.ts +46 -0
  43. package/dist/collections.d.ts.map +1 -0
  44. package/dist/collections.js +48 -0
  45. package/dist/collections.js.map +1 -0
  46. package/dist/combobox.d.ts +42 -0
  47. package/dist/combobox.d.ts.map +1 -0
  48. package/dist/combobox.js +159 -0
  49. package/dist/combobox.js.map +1 -0
  50. package/dist/contracts.d.ts +1321 -0
  51. package/dist/contracts.d.ts.map +1 -0
  52. package/dist/contracts.js +268 -0
  53. package/dist/contracts.js.map +1 -0
  54. package/dist/date-input.d.ts +10 -0
  55. package/dist/date-input.d.ts.map +1 -0
  56. package/dist/date-input.js +58 -0
  57. package/dist/date-input.js.map +1 -0
  58. package/dist/date-time.d.ts +19 -0
  59. package/dist/date-time.d.ts.map +1 -0
  60. package/dist/date-time.js +27 -0
  61. package/dist/date-time.js.map +1 -0
  62. package/dist/date.d.ts +96 -0
  63. package/dist/date.d.ts.map +1 -0
  64. package/dist/date.js +235 -0
  65. package/dist/date.js.map +1 -0
  66. package/dist/dialog.d.ts +4 -0
  67. package/dist/dialog.d.ts.map +1 -0
  68. package/dist/dialog.js +21 -0
  69. package/dist/dialog.js.map +1 -0
  70. package/dist/discovery.d.ts +49 -0
  71. package/dist/discovery.d.ts.map +1 -0
  72. package/dist/discovery.js +80 -0
  73. package/dist/discovery.js.map +1 -0
  74. package/dist/empty-state.d.ts +2 -0
  75. package/dist/empty-state.d.ts.map +1 -0
  76. package/dist/empty-state.js +5 -0
  77. package/dist/empty-state.js.map +1 -0
  78. package/dist/experimental-collections.d.ts +82 -0
  79. package/dist/experimental-collections.d.ts.map +1 -0
  80. package/dist/experimental-collections.js +8 -0
  81. package/dist/experimental-collections.js.map +1 -0
  82. package/dist/experimental-effects.d.ts +107 -0
  83. package/dist/experimental-effects.d.ts.map +1 -0
  84. package/dist/experimental-effects.js +24 -0
  85. package/dist/experimental-effects.js.map +1 -0
  86. package/dist/experimental-platforms.d.ts +94 -0
  87. package/dist/experimental-platforms.d.ts.map +1 -0
  88. package/dist/experimental-platforms.js +2 -0
  89. package/dist/experimental-platforms.js.map +1 -0
  90. package/dist/experimental-playback.d.ts +63 -0
  91. package/dist/experimental-playback.d.ts.map +1 -0
  92. package/dist/experimental-playback.js +46 -0
  93. package/dist/experimental-playback.js.map +1 -0
  94. package/dist/experimental-regions.d.ts +179 -0
  95. package/dist/experimental-regions.d.ts.map +1 -0
  96. package/dist/experimental-regions.js +554 -0
  97. package/dist/experimental-regions.js.map +1 -0
  98. package/dist/experimental-sensors.d.ts +42 -0
  99. package/dist/experimental-sensors.d.ts.map +1 -0
  100. package/dist/experimental-sensors.js +2 -0
  101. package/dist/experimental-sensors.js.map +1 -0
  102. package/dist/experimental-surfaces.d.ts +127 -0
  103. package/dist/experimental-surfaces.d.ts.map +1 -0
  104. package/dist/experimental-surfaces.js +2 -0
  105. package/dist/experimental-surfaces.js.map +1 -0
  106. package/dist/experimental.d.ts +197 -0
  107. package/dist/experimental.d.ts.map +1 -0
  108. package/dist/experimental.js +855 -0
  109. package/dist/experimental.js.map +1 -0
  110. package/dist/files.d.ts +87 -0
  111. package/dist/files.d.ts.map +1 -0
  112. package/dist/files.js +328 -0
  113. package/dist/files.js.map +1 -0
  114. package/dist/form.d.ts +39 -0
  115. package/dist/form.d.ts.map +1 -0
  116. package/dist/form.js +170 -0
  117. package/dist/form.js.map +1 -0
  118. package/dist/grid.d.ts +3 -0
  119. package/dist/grid.d.ts.map +1 -0
  120. package/dist/grid.js +16 -0
  121. package/dist/grid.js.map +1 -0
  122. package/dist/icon.d.ts +15 -0
  123. package/dist/icon.d.ts.map +1 -0
  124. package/dist/icon.js +28 -0
  125. package/dist/icon.js.map +1 -0
  126. package/dist/icons.d.ts +2002 -0
  127. package/dist/icons.d.ts.map +1 -0
  128. package/dist/icons.js +2003 -0
  129. package/dist/icons.js.map +1 -0
  130. package/dist/index.d.ts +59 -3
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +42 -1
  133. package/dist/index.js.map +1 -1
  134. package/dist/input.d.ts +14 -0
  135. package/dist/input.d.ts.map +1 -1
  136. package/dist/input.js +12 -0
  137. package/dist/input.js.map +1 -1
  138. package/dist/link.d.ts +36 -0
  139. package/dist/link.d.ts.map +1 -0
  140. package/dist/link.js +60 -0
  141. package/dist/link.js.map +1 -0
  142. package/dist/list-item.d.ts +3 -0
  143. package/dist/list-item.d.ts.map +1 -0
  144. package/dist/list-item.js +7 -0
  145. package/dist/list-item.js.map +1 -0
  146. package/dist/motion.d.ts +58 -0
  147. package/dist/motion.d.ts.map +1 -0
  148. package/dist/motion.js +73 -0
  149. package/dist/motion.js.map +1 -0
  150. package/dist/multi-select.d.ts +4 -0
  151. package/dist/multi-select.d.ts.map +1 -0
  152. package/dist/multi-select.js +23 -0
  153. package/dist/multi-select.js.map +1 -0
  154. package/dist/navigation-transition.d.ts +10 -0
  155. package/dist/navigation-transition.d.ts.map +1 -0
  156. package/dist/navigation-transition.js +10 -0
  157. package/dist/navigation-transition.js.map +1 -0
  158. package/dist/navigation.d.ts +22 -0
  159. package/dist/navigation.d.ts.map +1 -0
  160. package/dist/navigation.js +54 -0
  161. package/dist/navigation.js.map +1 -0
  162. package/dist/number-input.d.ts +21 -0
  163. package/dist/number-input.d.ts.map +1 -0
  164. package/dist/number-input.js +63 -0
  165. package/dist/number-input.js.map +1 -0
  166. package/dist/popover.d.ts +17 -0
  167. package/dist/popover.d.ts.map +1 -0
  168. package/dist/popover.js +19 -0
  169. package/dist/popover.js.map +1 -0
  170. package/dist/progress.d.ts +19 -0
  171. package/dist/progress.d.ts.map +1 -0
  172. package/dist/progress.js +19 -0
  173. package/dist/progress.js.map +1 -0
  174. package/dist/responsive.d.ts +18 -0
  175. package/dist/responsive.d.ts.map +1 -0
  176. package/dist/responsive.js +35 -0
  177. package/dist/responsive.js.map +1 -0
  178. package/dist/section-scroll.d.ts +14 -0
  179. package/dist/section-scroll.d.ts.map +1 -0
  180. package/dist/section-scroll.js +28 -0
  181. package/dist/section-scroll.js.map +1 -0
  182. package/dist/segmented.d.ts +11 -0
  183. package/dist/segmented.d.ts.map +1 -0
  184. package/dist/segmented.js +30 -0
  185. package/dist/segmented.js.map +1 -0
  186. package/dist/sheet.d.ts +19 -0
  187. package/dist/sheet.d.ts.map +1 -0
  188. package/dist/sheet.js +15 -0
  189. package/dist/sheet.js.map +1 -0
  190. package/dist/tabs.d.ts +11 -0
  191. package/dist/tabs.d.ts.map +1 -0
  192. package/dist/tabs.js +28 -0
  193. package/dist/tabs.js.map +1 -0
  194. package/dist/theme/themes.d.ts.map +1 -1
  195. package/dist/theme/themes.js +85 -12
  196. package/dist/theme/themes.js.map +1 -1
  197. package/dist/theme/types.d.ts +64 -4
  198. package/dist/theme/types.d.ts.map +1 -1
  199. package/dist/theme/typography.d.ts +10 -0
  200. package/dist/theme/typography.d.ts.map +1 -0
  201. package/dist/theme/typography.js +90 -0
  202. package/dist/theme/typography.js.map +1 -0
  203. package/dist/time.d.ts +34 -0
  204. package/dist/time.d.ts.map +1 -0
  205. package/dist/time.js +78 -0
  206. package/dist/time.js.map +1 -0
  207. package/dist/toast.d.ts +43 -0
  208. package/dist/toast.d.ts.map +1 -0
  209. package/dist/toast.js +228 -0
  210. package/dist/toast.js.map +1 -0
  211. package/dist/vue/button-content.d.ts +10 -0
  212. package/dist/vue/button-content.d.ts.map +1 -0
  213. package/dist/vue/button-content.js +54 -0
  214. package/dist/vue/button-content.js.map +1 -0
  215. package/dist/vue/cached-activity.d.ts +3 -0
  216. package/dist/vue/cached-activity.d.ts.map +1 -0
  217. package/dist/vue/cached-activity.js +13 -0
  218. package/dist/vue/cached-activity.js.map +1 -0
  219. package/dist/vue/carousel.d.ts +11 -0
  220. package/dist/vue/carousel.d.ts.map +1 -0
  221. package/dist/vue/carousel.js +115 -0
  222. package/dist/vue/carousel.js.map +1 -0
  223. package/dist/vue/chart.d.ts +194 -0
  224. package/dist/vue/chart.d.ts.map +1 -0
  225. package/dist/vue/chart.js +246 -0
  226. package/dist/vue/chart.js.map +1 -0
  227. package/dist/vue/combobox.d.ts +155 -0
  228. package/dist/vue/combobox.d.ts.map +1 -0
  229. package/dist/vue/combobox.js +195 -0
  230. package/dist/vue/combobox.js.map +1 -0
  231. package/dist/vue/command-palette.d.ts +129 -0
  232. package/dist/vue/command-palette.d.ts.map +1 -0
  233. package/dist/vue/command-palette.js +187 -0
  234. package/dist/vue/command-palette.js.map +1 -0
  235. package/dist/vue/component-props.d.ts +3310 -0
  236. package/dist/vue/component-props.d.ts.map +1 -0
  237. package/dist/vue/component-props.js +43 -0
  238. package/dist/vue/component-props.js.map +1 -0
  239. package/dist/vue/configurator-props.d.ts +277 -0
  240. package/dist/vue/configurator-props.d.ts.map +1 -0
  241. package/dist/vue/configurator-props.js +63 -0
  242. package/dist/vue/configurator-props.js.map +1 -0
  243. package/dist/vue/configurator.d.ts +403 -0
  244. package/dist/vue/configurator.d.ts.map +1 -0
  245. package/dist/vue/configurator.js +287 -0
  246. package/dist/vue/configurator.js.map +1 -0
  247. package/dist/vue/contracts.d.ts +18 -0
  248. package/dist/vue/contracts.d.ts.map +1 -0
  249. package/dist/vue/contracts.js +24 -0
  250. package/dist/vue/contracts.js.map +1 -0
  251. package/dist/vue/data-table.d.ts +17 -0
  252. package/dist/vue/data-table.d.ts.map +1 -0
  253. package/dist/vue/data-table.js +133 -0
  254. package/dist/vue/data-table.js.map +1 -0
  255. package/dist/vue/date-calendar.d.ts +64 -0
  256. package/dist/vue/date-calendar.d.ts.map +1 -0
  257. package/dist/vue/date-calendar.js +65 -0
  258. package/dist/vue/date-calendar.js.map +1 -0
  259. package/dist/vue/date-picker.d.ts +1000 -0
  260. package/dist/vue/date-picker.d.ts.map +1 -0
  261. package/dist/vue/date-picker.js +334 -0
  262. package/dist/vue/date-picker.js.map +1 -0
  263. package/dist/vue/date-props.d.ts +278 -0
  264. package/dist/vue/date-props.d.ts.map +1 -0
  265. package/dist/vue/date-props.js +81 -0
  266. package/dist/vue/date-props.js.map +1 -0
  267. package/dist/vue/dialog.d.ts +21 -0
  268. package/dist/vue/dialog.d.ts.map +1 -0
  269. package/dist/vue/dialog.js +58 -0
  270. package/dist/vue/dialog.js.map +1 -0
  271. package/dist/vue/discovery-components.d.ts +50 -0
  272. package/dist/vue/discovery-components.d.ts.map +1 -0
  273. package/dist/vue/discovery-components.js +2 -0
  274. package/dist/vue/discovery-components.js.map +1 -0
  275. package/dist/vue/discovery-controls.d.ts +197 -0
  276. package/dist/vue/discovery-controls.d.ts.map +1 -0
  277. package/dist/vue/discovery-controls.js +166 -0
  278. package/dist/vue/discovery-controls.js.map +1 -0
  279. package/dist/vue/discovery-props.d.ts +249 -0
  280. package/dist/vue/discovery-props.d.ts.map +1 -0
  281. package/dist/vue/discovery-props.js +87 -0
  282. package/dist/vue/discovery-props.js.map +1 -0
  283. package/dist/vue/files.d.ts +53 -0
  284. package/dist/vue/files.d.ts.map +1 -0
  285. package/dist/vue/files.js +40 -0
  286. package/dist/vue/files.js.map +1 -0
  287. package/dist/vue/forms.d.ts +4 -0
  288. package/dist/vue/forms.d.ts.map +1 -0
  289. package/dist/vue/forms.js +15 -0
  290. package/dist/vue/forms.js.map +1 -0
  291. package/dist/vue/global-components.d.ts +259 -3
  292. package/dist/vue/global-components.d.ts.map +1 -1
  293. package/dist/vue/index.d.ts +54 -4
  294. package/dist/vue/index.d.ts.map +1 -1
  295. package/dist/vue/index.js +45 -2
  296. package/dist/vue/index.js.map +1 -1
  297. package/dist/vue/inline-content.d.ts +54 -0
  298. package/dist/vue/inline-content.d.ts.map +1 -0
  299. package/dist/vue/inline-content.js +64 -0
  300. package/dist/vue/inline-content.js.map +1 -0
  301. package/dist/vue/layout-context.d.ts +4 -2
  302. package/dist/vue/layout-context.d.ts.map +1 -1
  303. package/dist/vue/layout-context.js +7 -2
  304. package/dist/vue/layout-context.js.map +1 -1
  305. package/dist/vue/list-motion.d.ts +7 -0
  306. package/dist/vue/list-motion.d.ts.map +1 -0
  307. package/dist/vue/list-motion.js +28 -0
  308. package/dist/vue/list-motion.js.map +1 -0
  309. package/dist/vue/loading-effect.d.ts +7 -0
  310. package/dist/vue/loading-effect.d.ts.map +1 -0
  311. package/dist/vue/loading-effect.js +32 -0
  312. package/dist/vue/loading-effect.js.map +1 -0
  313. package/dist/vue/menu.d.ts +122 -0
  314. package/dist/vue/menu.d.ts.map +1 -0
  315. package/dist/vue/menu.js +79 -0
  316. package/dist/vue/menu.js.map +1 -0
  317. package/dist/vue/navigation-controls.d.ts +124 -0
  318. package/dist/vue/navigation-controls.d.ts.map +1 -0
  319. package/dist/vue/navigation-controls.js +117 -0
  320. package/dist/vue/navigation-controls.js.map +1 -0
  321. package/dist/vue/navigation-props.d.ts +283 -0
  322. package/dist/vue/navigation-props.d.ts.map +1 -0
  323. package/dist/vue/navigation-props.js +82 -0
  324. package/dist/vue/navigation-props.js.map +1 -0
  325. package/dist/vue/navigation.d.ts +7 -0
  326. package/dist/vue/navigation.d.ts.map +1 -0
  327. package/dist/vue/navigation.js +15 -0
  328. package/dist/vue/navigation.js.map +1 -0
  329. package/dist/vue/platform.d.ts +37 -0
  330. package/dist/vue/platform.d.ts.map +1 -0
  331. package/dist/vue/platform.js +46 -0
  332. package/dist/vue/platform.js.map +1 -0
  333. package/dist/vue/props.d.ts +3326 -510
  334. package/dist/vue/props.d.ts.map +1 -1
  335. package/dist/vue/props.js +314 -83
  336. package/dist/vue/props.js.map +1 -1
  337. package/dist/vue/reveal-state.d.ts +18 -0
  338. package/dist/vue/reveal-state.d.ts.map +1 -0
  339. package/dist/vue/reveal-state.js +76 -0
  340. package/dist/vue/reveal-state.js.map +1 -0
  341. package/dist/vue/theme-provider.d.ts +58 -0
  342. package/dist/vue/theme-provider.d.ts.map +1 -0
  343. package/dist/vue/theme-provider.js +69 -0
  344. package/dist/vue/theme-provider.js.map +1 -0
  345. package/dist/vue/theme.d.ts +1029 -19
  346. package/dist/vue/theme.d.ts.map +1 -1
  347. package/dist/vue/theme.js +47 -2
  348. package/dist/vue/theme.js.map +1 -1
  349. package/dist/vue/time-picker.d.ts +488 -0
  350. package/dist/vue/time-picker.d.ts.map +1 -0
  351. package/dist/vue/time-picker.js +190 -0
  352. package/dist/vue/time-picker.js.map +1 -0
  353. package/dist/vue/toast.d.ts +29 -0
  354. package/dist/vue/toast.d.ts.map +1 -0
  355. package/dist/vue/toast.js +79 -0
  356. package/dist/vue/toast.js.map +1 -0
  357. package/dist/vue/tree-view.d.ts +111 -0
  358. package/dist/vue/tree-view.d.ts.map +1 -0
  359. package/dist/vue/tree-view.js +180 -0
  360. package/dist/vue/tree-view.js.map +1 -0
  361. package/dist/vue/virtual-list.d.ts +26 -0
  362. package/dist/vue/virtual-list.d.ts.map +1 -0
  363. package/dist/vue/virtual-list.js +2 -0
  364. package/dist/vue/virtual-list.js.map +1 -0
  365. package/dist/vue/wayfinding-controls.d.ts +198 -0
  366. package/dist/vue/wayfinding-controls.d.ts.map +1 -0
  367. package/dist/vue/wayfinding-controls.js +310 -0
  368. package/dist/vue/wayfinding-controls.js.map +1 -0
  369. package/dist/vue/wayfinding-props.d.ts +221 -0
  370. package/dist/vue/wayfinding-props.d.ts.map +1 -0
  371. package/dist/vue/wayfinding-props.js +86 -0
  372. package/dist/vue/wayfinding-props.js.map +1 -0
  373. package/dist/vue/workflow-props.d.ts +110 -0
  374. package/dist/vue/workflow-props.d.ts.map +1 -0
  375. package/dist/vue/workflow-props.js +37 -0
  376. package/dist/vue/workflow-props.js.map +1 -0
  377. package/dist/vue/workflows.d.ts +267 -0
  378. package/dist/vue/workflows.d.ts.map +1 -0
  379. package/dist/vue/workflows.js +200 -0
  380. package/dist/vue/workflows.js.map +1 -0
  381. package/dist/wayfinding.d.ts +50 -0
  382. package/dist/wayfinding.d.ts.map +1 -0
  383. package/dist/wayfinding.js +54 -0
  384. package/dist/wayfinding.js.map +1 -0
  385. package/package.json +5 -1
  386. package/src/accordion.ts +66 -0
  387. package/src/alert.ts +16 -0
  388. package/src/app-icons.ts +57 -0
  389. package/src/avatar.ts +11 -0
  390. package/src/badge.ts +11 -0
  391. package/src/capabilities.ts +183 -0
  392. package/src/chart.ts +112 -0
  393. package/src/chip.ts +20 -0
  394. package/src/choice-motion.ts +12 -0
  395. package/src/choice.ts +41 -0
  396. package/src/collections.ts +87 -0
  397. package/src/combobox.ts +198 -0
  398. package/src/contracts.ts +324 -0
  399. package/src/date-input.ts +87 -0
  400. package/src/date-time.ts +37 -0
  401. package/src/date.ts +280 -0
  402. package/src/dialog.ts +22 -0
  403. package/src/discovery.ts +139 -0
  404. package/src/empty-state.ts +4 -0
  405. package/src/experimental-collections.ts +87 -0
  406. package/src/experimental-effects.ts +146 -0
  407. package/src/experimental-platforms.ts +96 -0
  408. package/src/experimental-playback.ts +115 -0
  409. package/src/experimental-regions.ts +777 -0
  410. package/src/experimental-sensors.ts +50 -0
  411. package/src/experimental-surfaces.ts +124 -0
  412. package/src/experimental.ts +1102 -0
  413. package/src/files.ts +408 -0
  414. package/src/form.ts +190 -0
  415. package/src/grid.ts +19 -0
  416. package/src/icon.ts +30 -0
  417. package/src/icons.ts +2002 -0
  418. package/src/index.ts +93 -2
  419. package/src/input.ts +27 -0
  420. package/src/link.ts +91 -0
  421. package/src/list-item.ts +5 -0
  422. package/src/motion.ts +80 -0
  423. package/src/multi-select.ts +30 -0
  424. package/src/navigation-transition.ts +14 -0
  425. package/src/navigation.ts +61 -0
  426. package/src/number-input.ts +80 -0
  427. package/src/popover.ts +38 -0
  428. package/src/progress.ts +22 -0
  429. package/src/responsive.ts +61 -0
  430. package/src/section-scroll.ts +46 -0
  431. package/src/segmented.ts +39 -0
  432. package/src/sheet.ts +31 -0
  433. package/src/tabs.ts +35 -0
  434. package/src/theme/themes.ts +89 -12
  435. package/src/theme/types.ts +55 -2
  436. package/src/theme/typography.ts +84 -0
  437. package/src/time.ts +83 -0
  438. package/src/toast.ts +249 -0
  439. package/src/vue/button-content.ts +60 -0
  440. package/src/vue/cached-activity.ts +13 -0
  441. package/src/vue/carousel.ts +173 -0
  442. package/src/vue/chart.ts +338 -0
  443. package/src/vue/combobox.ts +238 -0
  444. package/src/vue/command-palette.ts +232 -0
  445. package/src/vue/component-props.ts +70 -0
  446. package/src/vue/configurator-props.ts +67 -0
  447. package/src/vue/configurator.ts +350 -0
  448. package/src/vue/contracts.ts +39 -0
  449. package/src/vue/data-table.ts +190 -0
  450. package/src/vue/date-calendar.ts +76 -0
  451. package/src/vue/date-picker.ts +410 -0
  452. package/src/vue/date-props.ts +89 -0
  453. package/src/vue/dialog.ts +63 -0
  454. package/src/vue/discovery-components.ts +60 -0
  455. package/src/vue/discovery-controls.ts +218 -0
  456. package/src/vue/discovery-props.ts +92 -0
  457. package/src/vue/files.ts +53 -0
  458. package/src/vue/forms.ts +20 -0
  459. package/src/vue/global-components.ts +248 -4
  460. package/src/vue/index.ts +97 -4
  461. package/src/vue/inline-content.ts +71 -0
  462. package/src/vue/layout-context.ts +10 -3
  463. package/src/vue/list-motion.ts +31 -0
  464. package/src/vue/loading-effect.ts +44 -0
  465. package/src/vue/menu.ts +100 -0
  466. package/src/vue/navigation-controls.ts +138 -0
  467. package/src/vue/navigation-props.ts +87 -0
  468. package/src/vue/navigation.ts +16 -0
  469. package/src/vue/platform.ts +73 -0
  470. package/src/vue/props.ts +348 -96
  471. package/src/vue/reveal-state.ts +83 -0
  472. package/src/vue/theme-provider.ts +74 -0
  473. package/src/vue/theme.ts +65 -3
  474. package/src/vue/time-picker.ts +227 -0
  475. package/src/vue/toast.ts +99 -0
  476. package/src/vue/tree-view.ts +220 -0
  477. package/src/vue/virtual-list.ts +28 -0
  478. package/src/vue/wayfinding-controls.ts +412 -0
  479. package/src/vue/wayfinding-props.ts +97 -0
  480. package/src/vue/workflow-props.ts +41 -0
  481. package/src/vue/workflows.ts +257 -0
  482. package/src/wayfinding.ts +85 -0
package/src/date.ts ADDED
@@ -0,0 +1,280 @@
1
+ /** A proleptic Gregorian civil date, never a timestamp. Runtime APIs validate YYYY-MM-DD. */
2
+ export type CivilDate = `${number}-${number}-${number}`
3
+ export type DateLocale = 'en-US' | 'pt-BR'
4
+ export interface DateRange {
5
+ start: CivilDate | null
6
+ end: CivilDate | null
7
+ }
8
+ export interface DateRangeDraft {
9
+ start: string
10
+ end: string
11
+ }
12
+ export interface DateConstraints {
13
+ min?: CivilDate
14
+ max?: CivilDate
15
+ unavailableDates?: readonly CivilDate[]
16
+ }
17
+ export type DateValidationReason =
18
+ | 'empty'
19
+ | 'partial'
20
+ | 'incomplete'
21
+ | 'invalid'
22
+ | 'before-min'
23
+ | 'after-max'
24
+ | 'unavailable'
25
+ | 'reversed'
26
+ | 'unavailable-range'
27
+ | null
28
+ export interface DateValidation {
29
+ /** Empty values and ranges with one empty endpoint are valid; required belongs to the app. */
30
+ valid: boolean
31
+ complete: boolean
32
+ reason: DateValidationReason
33
+ }
34
+ export interface CivilDateParts {
35
+ year: number
36
+ month: number
37
+ day: number
38
+ }
39
+
40
+ export function daysInMonth(year: number, month: number): number {
41
+ if (month === 2) return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0) ? 29 : 28
42
+ return [4, 6, 9, 11].includes(month) ? 30 : 31
43
+ }
44
+
45
+ export function parseCivilDate(value: unknown): CivilDateParts | null {
46
+ if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return null
47
+ const year = Number(value.slice(0, 4))
48
+ const month = Number(value.slice(5, 7))
49
+ const day = Number(value.slice(8, 10))
50
+ return year >= 1 && month >= 1 && month <= 12 && day >= 1 && day <= daysInMonth(year, month)
51
+ ? { year, month, day }
52
+ : null
53
+ }
54
+
55
+ export function isCivilDate(value: unknown): value is CivilDate {
56
+ return parseCivilDate(value) !== null
57
+ }
58
+
59
+ export function civilDate(value: string): CivilDate {
60
+ if (!isCivilDate(value))
61
+ throw new RangeError('A civil date must be Gregorian YYYY-MM-DD (0001–9999)')
62
+ return value
63
+ }
64
+
65
+ export function formatCivilDate({ year, month, day }: CivilDateParts): CivilDate {
66
+ return civilDate(
67
+ `${String(year).padStart(4, '0')}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`,
68
+ )
69
+ }
70
+
71
+ function daysBeforeYear(year: number) {
72
+ const previous = year - 1
73
+ return (
74
+ 365 * previous +
75
+ Math.floor(previous / 4) -
76
+ Math.floor(previous / 100) +
77
+ Math.floor(previous / 400)
78
+ )
79
+ }
80
+ function ordinal(value: CivilDate): number {
81
+ const parts = parseCivilDate(value)
82
+ if (!parts) throw new RangeError('Invalid civil date')
83
+ let result = daysBeforeYear(parts.year) + parts.day - 1
84
+ for (let month = 1; month < parts.month; month++) result += daysInMonth(parts.year, month)
85
+ return result
86
+ }
87
+
88
+ /** Sunday=0. Uses Gregorian arithmetic and is independent of host time zone and DST. */
89
+ export function civilWeekday(value: CivilDate): number {
90
+ return (ordinal(value) + 1) % 7
91
+ }
92
+
93
+ /** Calendar navigation clamps at the supported years, never wrapping to another era. */
94
+ export function addCivilDays(value: CivilDate, amount: number): CivilDate {
95
+ if (!Number.isSafeInteger(amount)) throw new RangeError('Day offset must be an integer')
96
+ const target = Math.max(0, Math.min(daysBeforeYear(10000) - 1, ordinal(value) + amount))
97
+ let low = 1
98
+ let high = 9999
99
+ while (low < high) {
100
+ const middle = Math.ceil((low + high) / 2)
101
+ if (daysBeforeYear(middle) <= target) low = middle
102
+ else high = middle - 1
103
+ }
104
+ let day = target - daysBeforeYear(low) + 1
105
+ let month = 1
106
+ while (day > daysInMonth(low, month)) day -= daysInMonth(low, month++)
107
+ return formatCivilDate({ year: low, month, day })
108
+ }
109
+
110
+ export function addCivilMonths(value: CivilDate, amount: number): CivilDate {
111
+ if (!Number.isSafeInteger(amount)) throw new RangeError('Month offset must be an integer')
112
+ const parts = parseCivilDate(value)
113
+ if (!parts) throw new RangeError('Invalid civil date')
114
+ const target = Math.max(
115
+ 0,
116
+ Math.min(9999 * 12 - 1, (parts.year - 1) * 12 + parts.month - 1 + amount),
117
+ )
118
+ const year = Math.floor(target / 12) + 1
119
+ const month = (target % 12) + 1
120
+ return formatCivilDate({ year, month, day: Math.min(parts.day, daysInMonth(year, month)) })
121
+ }
122
+
123
+ export function validateDateConstraints(options: DateConstraints) {
124
+ if (options.min !== undefined) civilDate(options.min)
125
+ if (options.max !== undefined) civilDate(options.max)
126
+ if (options.min && options.max && options.min > options.max)
127
+ throw new RangeError('Date min must not be after max')
128
+ for (const value of options.unavailableDates ?? []) civilDate(value)
129
+ }
130
+
131
+ export function dateAvailability(value: CivilDate, options: DateConstraints): DateValidationReason {
132
+ if (options.min && value < options.min) return 'before-min'
133
+ if (options.max && value > options.max) return 'after-max'
134
+ if (options.unavailableDates?.includes(value)) return 'unavailable'
135
+ return null
136
+ }
137
+
138
+ export function validateDateDraft(value: string, options: DateConstraints = {}): DateValidation {
139
+ validateDateConstraints(options)
140
+ if (value === '') return { valid: true, complete: false, reason: 'empty' }
141
+ if (!isCivilDate(value)) {
142
+ // Prefixes describe editing, not a second parsing grammar. No trimming or locale guessing.
143
+ const incomplete = /^\d{0,4}(-\d{0,2}(-\d{0,2})?)?$/.test(value) && value.length < 10
144
+ return { valid: false, complete: false, reason: incomplete ? 'incomplete' : 'invalid' }
145
+ }
146
+ const reason = dateAvailability(value, options)
147
+ return { valid: reason === null, complete: true, reason }
148
+ }
149
+
150
+ export function validateDateRangeDraft(
151
+ draft: DateRangeDraft,
152
+ options: DateConstraints = {},
153
+ ): DateValidation {
154
+ const start = validateDateDraft(draft.start, options)
155
+ const end = validateDateDraft(draft.end, options)
156
+ const complete = start.complete && end.complete
157
+ if (!start.valid) return { ...start, complete }
158
+ if (!end.valid) return { ...end, complete }
159
+ if (!draft.start || !draft.end)
160
+ return { valid: true, complete: false, reason: draft.start || draft.end ? 'partial' : 'empty' }
161
+ if (draft.start > draft.end) return { valid: false, complete: true, reason: 'reversed' }
162
+ if (options.unavailableDates?.some((date) => date >= draft.start && date <= draft.end))
163
+ return { valid: false, complete: true, reason: 'unavailable-range' }
164
+ return { valid: true, complete: true, reason: null }
165
+ }
166
+
167
+ export const dateLocales = {
168
+ 'en-US': {
169
+ months: [
170
+ 'January',
171
+ 'February',
172
+ 'March',
173
+ 'April',
174
+ 'May',
175
+ 'June',
176
+ 'July',
177
+ 'August',
178
+ 'September',
179
+ 'October',
180
+ 'November',
181
+ 'December',
182
+ ],
183
+ weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
184
+ shortWeekdays: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
185
+ firstDayOfWeek: 0,
186
+ calendar: 'Choose date',
187
+ previous: 'Previous month',
188
+ next: 'Next month',
189
+ clear: 'Clear dates',
190
+ selected: 'Selected',
191
+ close: 'Close',
192
+ start: 'Start',
193
+ end: 'End',
194
+ format: 'YYYY-MM-DD',
195
+ errors: {
196
+ incomplete: 'Enter a complete date as YYYY-MM-DD.',
197
+ invalid: 'Enter a valid Gregorian date as YYYY-MM-DD.',
198
+ 'before-min': 'This date is before the minimum.',
199
+ 'after-max': 'This date is after the maximum.',
200
+ unavailable: 'This date is unavailable.',
201
+ reversed: 'The end must be on or after the start.',
202
+ 'unavailable-range': 'This range includes an unavailable date.',
203
+ },
204
+ },
205
+ 'pt-BR': {
206
+ months: [
207
+ 'janeiro',
208
+ 'fevereiro',
209
+ 'março',
210
+ 'abril',
211
+ 'maio',
212
+ 'junho',
213
+ 'julho',
214
+ 'agosto',
215
+ 'setembro',
216
+ 'outubro',
217
+ 'novembro',
218
+ 'dezembro',
219
+ ],
220
+ weekdays: [
221
+ 'domingo',
222
+ 'segunda-feira',
223
+ 'terça-feira',
224
+ 'quarta-feira',
225
+ 'quinta-feira',
226
+ 'sexta-feira',
227
+ 'sábado',
228
+ ],
229
+ shortWeekdays: ['Do', 'Se', 'Te', 'Qu', 'Qu', 'Se', 'Sá'],
230
+ firstDayOfWeek: 0,
231
+ calendar: 'Escolher data',
232
+ previous: 'Mês anterior',
233
+ next: 'Próximo mês',
234
+ clear: 'Limpar datas',
235
+ selected: 'Selecionada',
236
+ close: 'Fechar',
237
+ start: 'Início',
238
+ end: 'Fim',
239
+ format: 'AAAA-MM-DD',
240
+ errors: {
241
+ incomplete: 'Informe a data completa no formato AAAA-MM-DD.',
242
+ invalid: 'Informe uma data gregoriana válida no formato AAAA-MM-DD.',
243
+ 'before-min': 'Esta data é anterior ao mínimo.',
244
+ 'after-max': 'Esta data é posterior ao máximo.',
245
+ unavailable: 'Esta data não está disponível.',
246
+ reversed: 'O fim deve ser igual ou posterior ao início.',
247
+ 'unavailable-range': 'Este intervalo inclui uma data indisponível.',
248
+ },
249
+ },
250
+ } as const
251
+
252
+ export function dateValidationMessage(validation: DateValidation, locale: DateLocale): string {
253
+ return validation.valid
254
+ ? ''
255
+ : dateLocales[locale].errors[validation.reason as keyof (typeof dateLocales)['en-US']['errors']]
256
+ }
257
+
258
+ export function calendarMonth(
259
+ value: CivilDate,
260
+ firstDayOfWeek: number,
261
+ ): readonly (CivilDate | null)[] {
262
+ const parts = parseCivilDate(value)
263
+ if (!parts) throw new RangeError('Invalid civil date')
264
+ if (!Number.isInteger(firstDayOfWeek) || firstDayOfWeek < 0 || firstDayOfWeek > 6)
265
+ throw new RangeError('firstDayOfWeek must be an integer from 0 to 6')
266
+ const first = formatCivilDate({ ...parts, day: 1 })
267
+ const offset = (civilWeekday(first) - firstDayOfWeek + 7) % 7
268
+ const count = daysInMonth(parts.year, parts.month)
269
+ return Array.from({ length: Math.ceil((offset + count) / 7) * 7 }, (_, index) => {
270
+ const day = index - offset + 1
271
+ return day > 0 && day <= count ? formatCivilDate({ ...parts, day }) : null
272
+ })
273
+ }
274
+
275
+ export function calendarDayLabel(value: CivilDate, locale: DateLocale): string {
276
+ const parts = parseCivilDate(value)
277
+ if (!parts) throw new RangeError('Invalid civil date')
278
+ const words = dateLocales[locale]
279
+ return `${words.weekdays[civilWeekday(value)]}, ${parts.day} ${words.months[parts.month - 1]} ${parts.year}`
280
+ }
package/src/dialog.ts ADDED
@@ -0,0 +1,22 @@
1
+ export type DialogCloseReason =
2
+ 'cancel' | 'backdrop' | 'escape' | 'back' | 'program' | 'navigation' | 'swipe'
3
+ export const dialogCloseReasons: readonly DialogCloseReason[] = [
4
+ 'cancel',
5
+ 'backdrop',
6
+ 'escape',
7
+ 'back',
8
+ 'program',
9
+ 'navigation',
10
+ 'swipe',
11
+ ]
12
+ export function checkDialogLabels(title: string, confirm: string, cancel: string, loading: string) {
13
+ for (const [name, value] of Object.entries({
14
+ title,
15
+ confirmLabel: confirm,
16
+ cancelLabel: cancel,
17
+ loadingLabel: loading,
18
+ })) {
19
+ if (typeof value !== 'string' || !value.trim())
20
+ throw new TypeError(`Dialog ${name} must be a non-empty string`)
21
+ }
22
+ }
@@ -0,0 +1,139 @@
1
+ import { choiceKey, type ChoiceValue } from './choice.js'
2
+ import { virtualKeys, type VirtualItemKey } from './collections.js'
3
+ import { sliderScale } from './slider.js'
4
+
5
+ export type RangeValue = readonly [number, number]
6
+ export function rangeValue(
7
+ value: RangeValue,
8
+ min: number,
9
+ max: number,
10
+ step: number,
11
+ ): [number, number] {
12
+ const scale = sliderScale(min, max, step)
13
+ if (!Array.isArray(value) || value.length !== 2 || value[0]! > value[1]!)
14
+ throw new RangeError('RangeSlider requires an ordered pair.')
15
+ return [scale.fromNative(scale.toNative(value[0]!)), scale.fromNative(scale.toNative(value[1]!))]
16
+ }
17
+ export function moveRange(
18
+ value: RangeValue,
19
+ thumb: 0 | 1,
20
+ next: number,
21
+ min: number,
22
+ max: number,
23
+ step: number,
24
+ ): [number, number] {
25
+ const pair = rangeValue(value, min, max, step)
26
+ const scale = sliderScale(min, max, step)
27
+ const snapped = scale.fromNative(scale.toNative(next))
28
+ pair[thumb] = thumb === 0 ? Math.min(snapped, pair[1]) : Math.max(snapped, pair[0])
29
+ return pair
30
+ }
31
+
32
+ export interface DataColumn<T = Record<string, unknown>> {
33
+ key: string
34
+ label: string
35
+ /** Display text; sorting remains an application-owned operation. */
36
+ value?: (item: T) => string | number | null | undefined
37
+ sortable?: boolean
38
+ width?: number
39
+ align?: 'start' | 'end'
40
+ }
41
+ export interface DataSort {
42
+ key: string
43
+ direction: 'ascending' | 'descending'
44
+ }
45
+ export interface DataCellSlot<T = Record<string, unknown>> {
46
+ item: T
47
+ itemKey: ChoiceValue
48
+ column: DataColumn<T>
49
+ value: string | number | null | undefined
50
+ index: number
51
+ }
52
+ export function validateColumns(columns: readonly DataColumn[]) {
53
+ const seen = new Set<string>()
54
+ if (!columns.length) throw new RangeError('DataTable requires at least one column.')
55
+ for (const column of columns) {
56
+ if (!column.key || !column.label.trim() || seen.has(column.key))
57
+ throw new TypeError('DataTable columns require unique keys and nonempty labels.')
58
+ if (column.width !== undefined && (!Number.isFinite(column.width) || column.width < 44))
59
+ throw new RangeError('Column width must be at least 44.')
60
+ seen.add(column.key)
61
+ }
62
+ }
63
+ export function nextDataSort(current: DataSort | null, key: string): DataSort | null {
64
+ return current?.key !== key
65
+ ? { key, direction: 'ascending' }
66
+ : current.direction === 'ascending'
67
+ ? { key, direction: 'descending' }
68
+ : null
69
+ }
70
+ /** Page selection preserves keys from other pages and does not mutate the input. */
71
+ export function selectPage(
72
+ selected: readonly ChoiceValue[],
73
+ page: readonly ChoiceValue[],
74
+ checked: boolean,
75
+ ) {
76
+ const pageIds = new Set(page.map(choiceKey))
77
+ const result = selected.filter((key) => !pageIds.has(choiceKey(key)))
78
+ return checked ? [...result, ...page] : result
79
+ }
80
+ export function collectionKeys<T>(items: readonly T[], itemKey: VirtualItemKey<T>) {
81
+ return virtualKeys(items, itemKey)
82
+ }
83
+
84
+ export interface TreeNode {
85
+ key: ChoiceValue
86
+ label: string
87
+ disabled?: boolean
88
+ children?: readonly TreeNode[]
89
+ /** True with undefined children requests loading on expansion. An empty array is loaded. */
90
+ hasChildren?: boolean
91
+ }
92
+ export interface TreeEntry {
93
+ node: TreeNode
94
+ parent: ChoiceValue | null
95
+ level: number
96
+ position: number
97
+ siblings: number
98
+ }
99
+ export function treeEntries(
100
+ nodes: readonly TreeNode[],
101
+ expanded: readonly ChoiceValue[],
102
+ ): TreeEntry[] {
103
+ const seen = new Set<string>()
104
+ const open = new Set(expanded.map(choiceKey))
105
+ const visible: TreeEntry[] = []
106
+ function visit(
107
+ children: readonly TreeNode[],
108
+ parent: ChoiceValue | null,
109
+ level: number,
110
+ show: boolean,
111
+ ) {
112
+ if (level > 100) throw new RangeError('TreeView depth exceeds 100 levels.')
113
+ for (const [index, node] of children.entries()) {
114
+ if (
115
+ (typeof node.key !== 'string' && typeof node.key !== 'number') ||
116
+ (typeof node.key === 'number' && !Number.isFinite(node.key)) ||
117
+ !node.label.trim()
118
+ )
119
+ throw new TypeError('Tree nodes require a finite key and label.')
120
+ const id = choiceKey(node.key)
121
+ if (seen.has(id)) throw new RangeError('Tree keys must be unique; cycles are not allowed.')
122
+ seen.add(id)
123
+ if (show)
124
+ visible.push({ node, parent, level, position: index + 1, siblings: children.length })
125
+ if (node.children) visit(node.children, node.key, level + 1, show && open.has(id))
126
+ }
127
+ }
128
+ visit(nodes, null, 1, true)
129
+ return visible
130
+ }
131
+ export function treeBranch(node: TreeNode) {
132
+ return node.children === undefined ? !!node.hasChildren : node.children.length > 0
133
+ }
134
+ export function ratingValue(value: number, max: number, step: number) {
135
+ if (!Number.isInteger(max) || max < 1 || max > 10 || (step !== 1 && step !== 0.5))
136
+ throw new RangeError('Rating requires max 1–10 and step 1 or 0.5.')
137
+ if (!Number.isFinite(value)) throw new RangeError('Rating must be finite.')
138
+ return Math.max(0, Math.min(max, Math.round(value / step) * step))
139
+ }
@@ -0,0 +1,4 @@
1
+ export function checkEmptyStateTitle(title: string) {
2
+ if (typeof title !== 'string' || !title.trim())
3
+ throw new TypeError('EmptyState needs a non-empty title.')
4
+ }
@@ -0,0 +1,87 @@
1
+ import type { MotionBinding, MotionSurface, MotionScrollSource } from './experimental.js'
2
+
3
+ export interface MotionCollectionItem<T = MotionSurface> {
4
+ key: string
5
+ target: T
6
+ handle?: T
7
+ }
8
+ export interface MotionRefreshContext {
9
+ readonly cancelled: boolean
10
+ commit(change: () => void | Promise<void>): Promise<boolean>
11
+ }
12
+ export interface MotionHeaderOptions<T = MotionSurface> {
13
+ header: T
14
+ artwork: T
15
+ title: T
16
+ toolbar: T
17
+ toolbarTitle: T
18
+ section: T
19
+ items(): readonly MotionCollectionItem<T>[]
20
+ expanded?: number
21
+ minimum?: number
22
+ parallax?: number
23
+ titleFade?: readonly [number, number]
24
+ toolbarFade?: readonly [number, number]
25
+ onRefresh?: (context: MotionRefreshContext) => void | Promise<void>
26
+ onRefreshError?: (error: unknown) => void
27
+ refreshThreshold?: number
28
+ }
29
+ export interface MotionHeader extends MotionBinding {
30
+ readonly ready: boolean
31
+ readonly state: { readonly offset: number; readonly refreshing: boolean }
32
+ refresh(): Promise<boolean>
33
+ cancelRefresh(): void
34
+ remeasure(): Promise<void>
35
+ preserveAnchor(change: () => void | Promise<void>): Promise<void>
36
+ scrollToItem(key: string, animated?: boolean): boolean
37
+ scrollToTop(animated?: boolean): void
38
+ pause(): void
39
+ play(): void
40
+ }
41
+ export interface MotionReorderMove {
42
+ key: string
43
+ beforeKey: string | null
44
+ fromIndex: number
45
+ toIndex: number
46
+ }
47
+ export interface MotionReorderOptions<T = MotionSurface, S = MotionScrollSource> {
48
+ container: T
49
+ items(): readonly MotionCollectionItem<T>[]
50
+ scroll: S
51
+ onCommit(move: MotionReorderMove): void
52
+ onStart?: (key: string) => void
53
+ onCancel?: (event: { key: string; reason: string }) => void
54
+ longPress?: number
55
+ edge?: { size?: number; speed?: number }
56
+ accessibility?: {
57
+ moveUp?: string
58
+ moveDown?: string
59
+ label?: (key: string) => string
60
+ announcement?: (
61
+ key: string,
62
+ position: number,
63
+ total: number,
64
+ phase: 'picked-up' | 'moved' | 'dropped' | 'cancelled',
65
+ ) => string
66
+ }
67
+ }
68
+ export interface MotionReorder extends MotionBinding {
69
+ readonly activeKey: string | undefined
70
+ move(key: string, beforeKey: string | null): boolean
71
+ moveUp(key: string): boolean
72
+ moveDown(key: string): boolean
73
+ refresh(): void
74
+ cancel(): void
75
+ pause(): void
76
+ play(): void
77
+ }
78
+ export function mapMotionItems<T, R>(
79
+ items: readonly MotionCollectionItem<T>[],
80
+ resolve: (target: T) => R,
81
+ ): MotionCollectionItem<R>[] {
82
+ return items.map((item) => ({
83
+ key: item.key,
84
+ target: resolve(item.target),
85
+ ...(item.handle ? { handle: resolve(item.handle) } : {}),
86
+ }))
87
+ }
@@ -0,0 +1,146 @@
1
+ import type {
2
+ MotionBinding,
3
+ MotionColor,
4
+ MotionOptions,
5
+ MotionPlayback,
6
+ MotionReadable,
7
+ } from './experimental.js'
8
+ import type { MotionSurfaceEffects, MotionSurfaceEffectsAdapter } from './experimental-surfaces.js'
9
+
10
+ /** Availability of the actual renderer backend; no simulated native fallback. */
11
+ export type MotionEffectKind =
12
+ | 'gradient'
13
+ | 'shimmer'
14
+ | 'loader'
15
+ | 'circular'
16
+ | 'text'
17
+ | 'particles'
18
+ | 'confetti'
19
+ | 'blur'
20
+ | 'shape'
21
+ | 'liquid'
22
+ | 'image'
23
+ | 'symbol'
24
+ | 'keyboard'
25
+ export interface MotionGradientValues {
26
+ colors?: readonly string[]
27
+ stops?: readonly number[]
28
+ angle?: number
29
+ center?: { x: number; y: number }
30
+ radius?: number
31
+ }
32
+ export interface MotionGradientOptions extends MotionGradientValues {
33
+ type: 'linear' | 'radial' | 'conic'
34
+ colors: readonly string[]
35
+ }
36
+ export interface MotionGradientBindings<N = MotionReadable, C = MotionColor> {
37
+ colors?: readonly (string | C)[]
38
+ stops?: readonly (number | N)[]
39
+ angle?: number | N
40
+ center?: { x?: number | N; y?: number | N }
41
+ radius?: number | N
42
+ }
43
+ export interface MotionGradient extends MotionBinding {
44
+ readonly type: MotionGradientOptions['type']
45
+ readonly suspended: boolean
46
+ animate(values: MotionGradientValues, options?: MotionOptions): MotionPlayback
47
+ set(values: MotionGradientValues): void
48
+ bind(values: MotionGradientBindings): MotionBinding
49
+ stop(): void
50
+ suspend(): void
51
+ resume(): void
52
+ }
53
+ export interface MotionLoadingEffect extends MotionBinding {
54
+ readonly supported: boolean
55
+ }
56
+ export interface MotionShimmerOptions {
57
+ duration?: number
58
+ }
59
+ export interface MotionLoaderOptions {
60
+ style?: 'dots' | 'bars' | 'ring'
61
+ color?: string
62
+ size?: number
63
+ duration?: number
64
+ }
65
+ export interface MotionCircularOptions {
66
+ /** Local CSS pixels on Web, DIPs on native. Omit to preserve a reversing circle. */
67
+ origin?: { x: number; y: number }
68
+ duration?: number
69
+ }
70
+ export interface MotionCircular extends MotionBinding {
71
+ readonly supported: boolean
72
+ /** Move focus outside interactive content before conceal; the resource owns inert state. */
73
+ conceal(options?: MotionCircularOptions): MotionPlayback
74
+ reveal(options?: MotionCircularOptions): MotionPlayback
75
+ }
76
+ export interface MotionTextOptions {
77
+ by?: 'letter' | 'word'
78
+ duration?: number
79
+ stagger?: number
80
+ delay?: number
81
+ y?: number
82
+ }
83
+ export interface MotionRollOptions {
84
+ format?: (value: number) => string
85
+ duration?: number
86
+ bounce?: number
87
+ stagger?: number
88
+ delay?: number
89
+ direction?: 'auto' | 'up' | 'down'
90
+ tabular?: boolean
91
+ }
92
+ export interface MotionVisualSurface extends MotionSurfaceEffects {
93
+ supports(effect: MotionEffectKind): boolean
94
+ gradient(options: MotionGradientOptions): MotionGradient
95
+ shimmer(options?: MotionShimmerOptions): MotionLoadingEffect
96
+ loader(options?: MotionLoaderOptions): MotionLoadingEffect
97
+ circular(): MotionCircular
98
+ /** Only explicit MText text targets; rich/slotted content is rejected. */
99
+ animateText(options?: MotionTextOptions): MotionPlayback
100
+ rollTo(value: number | string, options?: MotionRollOptions): MotionPlayback
101
+ }
102
+ type NumericSource = Pick<MotionReadable, 'get' | 'dispose'>
103
+ type ColorSource = Pick<MotionColor, 'get' | 'dispose'>
104
+ export interface MotionGradientAdapter extends Omit<MotionGradient, 'disposed' | 'bind'> {
105
+ bind(values: MotionGradientBindings<NumericSource, ColorSource>): { dispose(): void }
106
+ }
107
+ export interface MotionVisualAdapter
108
+ extends
109
+ MotionSurfaceEffectsAdapter,
110
+ Omit<
111
+ MotionVisualSurface,
112
+ 'gradient' | 'shimmer' | 'loader' | 'circular' | keyof MotionSurfaceEffects
113
+ > {
114
+ gradient(options: MotionGradientOptions): MotionGradientAdapter
115
+ shimmer(options?: MotionShimmerOptions): Omit<MotionLoadingEffect, 'disposed'>
116
+ loader(options?: MotionLoaderOptions): Omit<MotionLoadingEffect, 'disposed'>
117
+ circular(): Omit<MotionCircular, 'disposed'>
118
+ }
119
+
120
+ /** Structural translation only: validation, interpolation and scheduling stay in Jolt. */
121
+ export function mapGradientBindings<N, C, RN, RC>(
122
+ values: MotionGradientBindings<N, C>,
123
+ numeric: (value: N) => RN,
124
+ color: (value: C) => RC,
125
+ ): MotionGradientBindings<RN, RC> {
126
+ const number = (value: number | N) => (typeof value === 'number' ? value : numeric(value))
127
+ return {
128
+ ...values,
129
+ ...(values.colors === undefined
130
+ ? {}
131
+ : {
132
+ colors: values.colors.map((value) => (typeof value === 'string' ? value : color(value))),
133
+ }),
134
+ ...(values.stops === undefined ? {} : { stops: values.stops.map(number) }),
135
+ ...(values.angle === undefined ? {} : { angle: number(values.angle) }),
136
+ ...(values.radius === undefined ? {} : { radius: number(values.radius) }),
137
+ ...(values.center === undefined
138
+ ? {}
139
+ : {
140
+ center: {
141
+ ...(values.center.x === undefined ? {} : { x: number(values.center.x) }),
142
+ ...(values.center.y === undefined ? {} : { y: number(values.center.y) }),
143
+ },
144
+ }),
145
+ } as MotionGradientBindings<RN, RC>
146
+ }