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

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 (417) 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 +168 -0
  25. package/dist/capabilities.js.map +1 -0
  26. package/dist/chip.d.ts +9 -0
  27. package/dist/chip.d.ts.map +1 -0
  28. package/dist/chip.js +16 -0
  29. package/dist/chip.js.map +1 -0
  30. package/dist/choice-motion.d.ts +14 -0
  31. package/dist/choice-motion.d.ts.map +1 -0
  32. package/dist/choice-motion.js +5 -0
  33. package/dist/choice-motion.js.map +1 -0
  34. package/dist/choice.d.ts +15 -0
  35. package/dist/choice.d.ts.map +1 -0
  36. package/dist/choice.js +27 -0
  37. package/dist/choice.js.map +1 -0
  38. package/dist/collections.d.ts +46 -0
  39. package/dist/collections.d.ts.map +1 -0
  40. package/dist/collections.js +48 -0
  41. package/dist/collections.js.map +1 -0
  42. package/dist/combobox.d.ts +42 -0
  43. package/dist/combobox.d.ts.map +1 -0
  44. package/dist/combobox.js +159 -0
  45. package/dist/combobox.js.map +1 -0
  46. package/dist/contracts.d.ts +1321 -0
  47. package/dist/contracts.d.ts.map +1 -0
  48. package/dist/contracts.js +268 -0
  49. package/dist/contracts.js.map +1 -0
  50. package/dist/date-input.d.ts +10 -0
  51. package/dist/date-input.d.ts.map +1 -0
  52. package/dist/date-input.js +58 -0
  53. package/dist/date-input.js.map +1 -0
  54. package/dist/date-time.d.ts +19 -0
  55. package/dist/date-time.d.ts.map +1 -0
  56. package/dist/date-time.js +27 -0
  57. package/dist/date-time.js.map +1 -0
  58. package/dist/date.d.ts +96 -0
  59. package/dist/date.d.ts.map +1 -0
  60. package/dist/date.js +235 -0
  61. package/dist/date.js.map +1 -0
  62. package/dist/dialog.d.ts +4 -0
  63. package/dist/dialog.d.ts.map +1 -0
  64. package/dist/dialog.js +21 -0
  65. package/dist/dialog.js.map +1 -0
  66. package/dist/empty-state.d.ts +2 -0
  67. package/dist/empty-state.d.ts.map +1 -0
  68. package/dist/empty-state.js +5 -0
  69. package/dist/empty-state.js.map +1 -0
  70. package/dist/experimental-collections.d.ts +82 -0
  71. package/dist/experimental-collections.d.ts.map +1 -0
  72. package/dist/experimental-collections.js +8 -0
  73. package/dist/experimental-collections.js.map +1 -0
  74. package/dist/experimental-effects.d.ts +107 -0
  75. package/dist/experimental-effects.d.ts.map +1 -0
  76. package/dist/experimental-effects.js +24 -0
  77. package/dist/experimental-effects.js.map +1 -0
  78. package/dist/experimental-platforms.d.ts +94 -0
  79. package/dist/experimental-platforms.d.ts.map +1 -0
  80. package/dist/experimental-platforms.js +2 -0
  81. package/dist/experimental-platforms.js.map +1 -0
  82. package/dist/experimental-playback.d.ts +63 -0
  83. package/dist/experimental-playback.d.ts.map +1 -0
  84. package/dist/experimental-playback.js +46 -0
  85. package/dist/experimental-playback.js.map +1 -0
  86. package/dist/experimental-regions.d.ts +179 -0
  87. package/dist/experimental-regions.d.ts.map +1 -0
  88. package/dist/experimental-regions.js +554 -0
  89. package/dist/experimental-regions.js.map +1 -0
  90. package/dist/experimental-sensors.d.ts +42 -0
  91. package/dist/experimental-sensors.d.ts.map +1 -0
  92. package/dist/experimental-sensors.js +2 -0
  93. package/dist/experimental-sensors.js.map +1 -0
  94. package/dist/experimental-surfaces.d.ts +127 -0
  95. package/dist/experimental-surfaces.d.ts.map +1 -0
  96. package/dist/experimental-surfaces.js +2 -0
  97. package/dist/experimental-surfaces.js.map +1 -0
  98. package/dist/experimental.d.ts +197 -0
  99. package/dist/experimental.d.ts.map +1 -0
  100. package/dist/experimental.js +855 -0
  101. package/dist/experimental.js.map +1 -0
  102. package/dist/files.d.ts +87 -0
  103. package/dist/files.d.ts.map +1 -0
  104. package/dist/files.js +328 -0
  105. package/dist/files.js.map +1 -0
  106. package/dist/form.d.ts +39 -0
  107. package/dist/form.d.ts.map +1 -0
  108. package/dist/form.js +170 -0
  109. package/dist/form.js.map +1 -0
  110. package/dist/grid.d.ts +3 -0
  111. package/dist/grid.d.ts.map +1 -0
  112. package/dist/grid.js +16 -0
  113. package/dist/grid.js.map +1 -0
  114. package/dist/icon.d.ts +15 -0
  115. package/dist/icon.d.ts.map +1 -0
  116. package/dist/icon.js +28 -0
  117. package/dist/icon.js.map +1 -0
  118. package/dist/icons.d.ts +2002 -0
  119. package/dist/icons.d.ts.map +1 -0
  120. package/dist/icons.js +2003 -0
  121. package/dist/icons.js.map +1 -0
  122. package/dist/index.d.ts +56 -3
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +39 -1
  125. package/dist/index.js.map +1 -1
  126. package/dist/input.d.ts +14 -0
  127. package/dist/input.d.ts.map +1 -1
  128. package/dist/input.js +12 -0
  129. package/dist/input.js.map +1 -1
  130. package/dist/link.d.ts +36 -0
  131. package/dist/link.d.ts.map +1 -0
  132. package/dist/link.js +60 -0
  133. package/dist/link.js.map +1 -0
  134. package/dist/list-item.d.ts +3 -0
  135. package/dist/list-item.d.ts.map +1 -0
  136. package/dist/list-item.js +7 -0
  137. package/dist/list-item.js.map +1 -0
  138. package/dist/motion.d.ts +58 -0
  139. package/dist/motion.d.ts.map +1 -0
  140. package/dist/motion.js +73 -0
  141. package/dist/motion.js.map +1 -0
  142. package/dist/multi-select.d.ts +4 -0
  143. package/dist/multi-select.d.ts.map +1 -0
  144. package/dist/multi-select.js +23 -0
  145. package/dist/multi-select.js.map +1 -0
  146. package/dist/navigation-transition.d.ts +10 -0
  147. package/dist/navigation-transition.d.ts.map +1 -0
  148. package/dist/navigation-transition.js +10 -0
  149. package/dist/navigation-transition.js.map +1 -0
  150. package/dist/navigation.d.ts +22 -0
  151. package/dist/navigation.d.ts.map +1 -0
  152. package/dist/navigation.js +54 -0
  153. package/dist/navigation.js.map +1 -0
  154. package/dist/number-input.d.ts +21 -0
  155. package/dist/number-input.d.ts.map +1 -0
  156. package/dist/number-input.js +63 -0
  157. package/dist/number-input.js.map +1 -0
  158. package/dist/popover.d.ts +17 -0
  159. package/dist/popover.d.ts.map +1 -0
  160. package/dist/popover.js +19 -0
  161. package/dist/popover.js.map +1 -0
  162. package/dist/progress.d.ts +19 -0
  163. package/dist/progress.d.ts.map +1 -0
  164. package/dist/progress.js +19 -0
  165. package/dist/progress.js.map +1 -0
  166. package/dist/responsive.d.ts +18 -0
  167. package/dist/responsive.d.ts.map +1 -0
  168. package/dist/responsive.js +35 -0
  169. package/dist/responsive.js.map +1 -0
  170. package/dist/section-scroll.d.ts +14 -0
  171. package/dist/section-scroll.d.ts.map +1 -0
  172. package/dist/section-scroll.js +28 -0
  173. package/dist/section-scroll.js.map +1 -0
  174. package/dist/segmented.d.ts +11 -0
  175. package/dist/segmented.d.ts.map +1 -0
  176. package/dist/segmented.js +30 -0
  177. package/dist/segmented.js.map +1 -0
  178. package/dist/sheet.d.ts +19 -0
  179. package/dist/sheet.d.ts.map +1 -0
  180. package/dist/sheet.js +15 -0
  181. package/dist/sheet.js.map +1 -0
  182. package/dist/tabs.d.ts +11 -0
  183. package/dist/tabs.d.ts.map +1 -0
  184. package/dist/tabs.js +28 -0
  185. package/dist/tabs.js.map +1 -0
  186. package/dist/theme/themes.d.ts.map +1 -1
  187. package/dist/theme/themes.js +85 -12
  188. package/dist/theme/themes.js.map +1 -1
  189. package/dist/theme/types.d.ts +64 -4
  190. package/dist/theme/types.d.ts.map +1 -1
  191. package/dist/theme/typography.d.ts +10 -0
  192. package/dist/theme/typography.d.ts.map +1 -0
  193. package/dist/theme/typography.js +90 -0
  194. package/dist/theme/typography.js.map +1 -0
  195. package/dist/time.d.ts +34 -0
  196. package/dist/time.d.ts.map +1 -0
  197. package/dist/time.js +78 -0
  198. package/dist/time.js.map +1 -0
  199. package/dist/toast.d.ts +43 -0
  200. package/dist/toast.d.ts.map +1 -0
  201. package/dist/toast.js +228 -0
  202. package/dist/toast.js.map +1 -0
  203. package/dist/vue/button-content.d.ts +10 -0
  204. package/dist/vue/button-content.d.ts.map +1 -0
  205. package/dist/vue/button-content.js +54 -0
  206. package/dist/vue/button-content.js.map +1 -0
  207. package/dist/vue/cached-activity.d.ts +3 -0
  208. package/dist/vue/cached-activity.d.ts.map +1 -0
  209. package/dist/vue/cached-activity.js +13 -0
  210. package/dist/vue/cached-activity.js.map +1 -0
  211. package/dist/vue/combobox.d.ts +155 -0
  212. package/dist/vue/combobox.d.ts.map +1 -0
  213. package/dist/vue/combobox.js +195 -0
  214. package/dist/vue/combobox.js.map +1 -0
  215. package/dist/vue/component-props.d.ts +2853 -0
  216. package/dist/vue/component-props.d.ts.map +1 -0
  217. package/dist/vue/component-props.js +29 -0
  218. package/dist/vue/component-props.js.map +1 -0
  219. package/dist/vue/configurator-props.d.ts +277 -0
  220. package/dist/vue/configurator-props.d.ts.map +1 -0
  221. package/dist/vue/configurator-props.js +63 -0
  222. package/dist/vue/configurator-props.js.map +1 -0
  223. package/dist/vue/configurator.d.ts +403 -0
  224. package/dist/vue/configurator.d.ts.map +1 -0
  225. package/dist/vue/configurator.js +287 -0
  226. package/dist/vue/configurator.js.map +1 -0
  227. package/dist/vue/contracts.d.ts +18 -0
  228. package/dist/vue/contracts.d.ts.map +1 -0
  229. package/dist/vue/contracts.js +24 -0
  230. package/dist/vue/contracts.js.map +1 -0
  231. package/dist/vue/date-calendar.d.ts +64 -0
  232. package/dist/vue/date-calendar.d.ts.map +1 -0
  233. package/dist/vue/date-calendar.js +65 -0
  234. package/dist/vue/date-calendar.js.map +1 -0
  235. package/dist/vue/date-picker.d.ts +1000 -0
  236. package/dist/vue/date-picker.d.ts.map +1 -0
  237. package/dist/vue/date-picker.js +334 -0
  238. package/dist/vue/date-picker.js.map +1 -0
  239. package/dist/vue/date-props.d.ts +272 -0
  240. package/dist/vue/date-props.d.ts.map +1 -0
  241. package/dist/vue/date-props.js +78 -0
  242. package/dist/vue/date-props.js.map +1 -0
  243. package/dist/vue/dialog.d.ts +21 -0
  244. package/dist/vue/dialog.d.ts.map +1 -0
  245. package/dist/vue/dialog.js +58 -0
  246. package/dist/vue/dialog.js.map +1 -0
  247. package/dist/vue/files.d.ts +53 -0
  248. package/dist/vue/files.d.ts.map +1 -0
  249. package/dist/vue/files.js +40 -0
  250. package/dist/vue/files.js.map +1 -0
  251. package/dist/vue/forms.d.ts +4 -0
  252. package/dist/vue/forms.d.ts.map +1 -0
  253. package/dist/vue/forms.js +15 -0
  254. package/dist/vue/forms.js.map +1 -0
  255. package/dist/vue/global-components.d.ts +198 -3
  256. package/dist/vue/global-components.d.ts.map +1 -1
  257. package/dist/vue/index.d.ts +44 -4
  258. package/dist/vue/index.d.ts.map +1 -1
  259. package/dist/vue/index.js +36 -2
  260. package/dist/vue/index.js.map +1 -1
  261. package/dist/vue/inline-content.d.ts +54 -0
  262. package/dist/vue/inline-content.d.ts.map +1 -0
  263. package/dist/vue/inline-content.js +64 -0
  264. package/dist/vue/inline-content.js.map +1 -0
  265. package/dist/vue/layout-context.d.ts +4 -2
  266. package/dist/vue/layout-context.d.ts.map +1 -1
  267. package/dist/vue/layout-context.js +7 -2
  268. package/dist/vue/layout-context.js.map +1 -1
  269. package/dist/vue/list-motion.d.ts +7 -0
  270. package/dist/vue/list-motion.d.ts.map +1 -0
  271. package/dist/vue/list-motion.js +28 -0
  272. package/dist/vue/list-motion.js.map +1 -0
  273. package/dist/vue/loading-effect.d.ts +7 -0
  274. package/dist/vue/loading-effect.d.ts.map +1 -0
  275. package/dist/vue/loading-effect.js +32 -0
  276. package/dist/vue/loading-effect.js.map +1 -0
  277. package/dist/vue/menu.d.ts +122 -0
  278. package/dist/vue/menu.d.ts.map +1 -0
  279. package/dist/vue/menu.js +79 -0
  280. package/dist/vue/menu.js.map +1 -0
  281. package/dist/vue/navigation-controls.d.ts +124 -0
  282. package/dist/vue/navigation-controls.d.ts.map +1 -0
  283. package/dist/vue/navigation-controls.js +117 -0
  284. package/dist/vue/navigation-controls.js.map +1 -0
  285. package/dist/vue/navigation-props.d.ts +283 -0
  286. package/dist/vue/navigation-props.d.ts.map +1 -0
  287. package/dist/vue/navigation-props.js +82 -0
  288. package/dist/vue/navigation-props.js.map +1 -0
  289. package/dist/vue/navigation.d.ts +7 -0
  290. package/dist/vue/navigation.d.ts.map +1 -0
  291. package/dist/vue/navigation.js +15 -0
  292. package/dist/vue/navigation.js.map +1 -0
  293. package/dist/vue/platform.d.ts +37 -0
  294. package/dist/vue/platform.d.ts.map +1 -0
  295. package/dist/vue/platform.js +46 -0
  296. package/dist/vue/platform.js.map +1 -0
  297. package/dist/vue/props.d.ts +3326 -510
  298. package/dist/vue/props.d.ts.map +1 -1
  299. package/dist/vue/props.js +314 -83
  300. package/dist/vue/props.js.map +1 -1
  301. package/dist/vue/reveal-state.d.ts +18 -0
  302. package/dist/vue/reveal-state.d.ts.map +1 -0
  303. package/dist/vue/reveal-state.js +76 -0
  304. package/dist/vue/reveal-state.js.map +1 -0
  305. package/dist/vue/theme-provider.d.ts +58 -0
  306. package/dist/vue/theme-provider.d.ts.map +1 -0
  307. package/dist/vue/theme-provider.js +69 -0
  308. package/dist/vue/theme-provider.js.map +1 -0
  309. package/dist/vue/theme.d.ts +1029 -19
  310. package/dist/vue/theme.d.ts.map +1 -1
  311. package/dist/vue/theme.js +47 -2
  312. package/dist/vue/theme.js.map +1 -1
  313. package/dist/vue/time-picker.d.ts +488 -0
  314. package/dist/vue/time-picker.d.ts.map +1 -0
  315. package/dist/vue/time-picker.js +190 -0
  316. package/dist/vue/time-picker.js.map +1 -0
  317. package/dist/vue/toast.d.ts +29 -0
  318. package/dist/vue/toast.d.ts.map +1 -0
  319. package/dist/vue/toast.js +79 -0
  320. package/dist/vue/toast.js.map +1 -0
  321. package/dist/vue/virtual-list.d.ts +26 -0
  322. package/dist/vue/virtual-list.d.ts.map +1 -0
  323. package/dist/vue/virtual-list.js +2 -0
  324. package/dist/vue/virtual-list.js.map +1 -0
  325. package/dist/vue/workflow-props.d.ts +110 -0
  326. package/dist/vue/workflow-props.d.ts.map +1 -0
  327. package/dist/vue/workflow-props.js +37 -0
  328. package/dist/vue/workflow-props.js.map +1 -0
  329. package/dist/vue/workflows.d.ts +267 -0
  330. package/dist/vue/workflows.d.ts.map +1 -0
  331. package/dist/vue/workflows.js +200 -0
  332. package/dist/vue/workflows.js.map +1 -0
  333. package/package.json +5 -1
  334. package/src/accordion.ts +66 -0
  335. package/src/alert.ts +16 -0
  336. package/src/app-icons.ts +57 -0
  337. package/src/avatar.ts +11 -0
  338. package/src/badge.ts +11 -0
  339. package/src/capabilities.ts +171 -0
  340. package/src/chip.ts +20 -0
  341. package/src/choice-motion.ts +12 -0
  342. package/src/choice.ts +41 -0
  343. package/src/collections.ts +87 -0
  344. package/src/combobox.ts +198 -0
  345. package/src/contracts.ts +324 -0
  346. package/src/date-input.ts +87 -0
  347. package/src/date-time.ts +37 -0
  348. package/src/date.ts +280 -0
  349. package/src/dialog.ts +22 -0
  350. package/src/empty-state.ts +4 -0
  351. package/src/experimental-collections.ts +87 -0
  352. package/src/experimental-effects.ts +146 -0
  353. package/src/experimental-platforms.ts +96 -0
  354. package/src/experimental-playback.ts +115 -0
  355. package/src/experimental-regions.ts +777 -0
  356. package/src/experimental-sensors.ts +50 -0
  357. package/src/experimental-surfaces.ts +124 -0
  358. package/src/experimental.ts +1102 -0
  359. package/src/files.ts +408 -0
  360. package/src/form.ts +190 -0
  361. package/src/grid.ts +19 -0
  362. package/src/icon.ts +30 -0
  363. package/src/icons.ts +2002 -0
  364. package/src/index.ts +88 -2
  365. package/src/input.ts +27 -0
  366. package/src/link.ts +91 -0
  367. package/src/list-item.ts +5 -0
  368. package/src/motion.ts +80 -0
  369. package/src/multi-select.ts +30 -0
  370. package/src/navigation-transition.ts +14 -0
  371. package/src/navigation.ts +61 -0
  372. package/src/number-input.ts +80 -0
  373. package/src/popover.ts +38 -0
  374. package/src/progress.ts +22 -0
  375. package/src/responsive.ts +61 -0
  376. package/src/section-scroll.ts +46 -0
  377. package/src/segmented.ts +39 -0
  378. package/src/sheet.ts +31 -0
  379. package/src/tabs.ts +35 -0
  380. package/src/theme/themes.ts +89 -12
  381. package/src/theme/types.ts +55 -2
  382. package/src/theme/typography.ts +84 -0
  383. package/src/time.ts +83 -0
  384. package/src/toast.ts +249 -0
  385. package/src/vue/button-content.ts +60 -0
  386. package/src/vue/cached-activity.ts +13 -0
  387. package/src/vue/combobox.ts +238 -0
  388. package/src/vue/component-props.ts +42 -0
  389. package/src/vue/configurator-props.ts +67 -0
  390. package/src/vue/configurator.ts +350 -0
  391. package/src/vue/contracts.ts +39 -0
  392. package/src/vue/date-calendar.ts +76 -0
  393. package/src/vue/date-picker.ts +410 -0
  394. package/src/vue/date-props.ts +86 -0
  395. package/src/vue/dialog.ts +63 -0
  396. package/src/vue/files.ts +53 -0
  397. package/src/vue/forms.ts +20 -0
  398. package/src/vue/global-components.ts +182 -4
  399. package/src/vue/index.ts +84 -4
  400. package/src/vue/inline-content.ts +71 -0
  401. package/src/vue/layout-context.ts +10 -3
  402. package/src/vue/list-motion.ts +31 -0
  403. package/src/vue/loading-effect.ts +44 -0
  404. package/src/vue/menu.ts +100 -0
  405. package/src/vue/navigation-controls.ts +138 -0
  406. package/src/vue/navigation-props.ts +87 -0
  407. package/src/vue/navigation.ts +16 -0
  408. package/src/vue/platform.ts +73 -0
  409. package/src/vue/props.ts +348 -96
  410. package/src/vue/reveal-state.ts +83 -0
  411. package/src/vue/theme-provider.ts +74 -0
  412. package/src/vue/theme.ts +65 -3
  413. package/src/vue/time-picker.ts +227 -0
  414. package/src/vue/toast.ts +99 -0
  415. package/src/vue/virtual-list.ts +28 -0
  416. package/src/vue/workflow-props.ts +41 -0
  417. package/src/vue/workflows.ts +257 -0
@@ -0,0 +1,46 @@
1
+ export type ScrollEdge = 'start' | 'center' | 'end'
2
+ export interface SectionScrollOptions {
3
+ /** [section edge, viewport edge]. Default: ['start', 'end']. */
4
+ start?: readonly [ScrollEdge, ScrollEdge]
5
+ /** [section edge, viewport edge]. Default: ['end', 'start']. */
6
+ end?: readonly [ScrollEdge, ScrollEdge]
7
+ }
8
+ const edge = { start: 0, center: 0.5, end: 1 } as const
9
+ export function validateSectionScroll(options: SectionScrollOptions) {
10
+ for (const value of [options.start, options.end])
11
+ if (
12
+ value !== undefined &&
13
+ (!Array.isArray(value) ||
14
+ value.length !== 2 ||
15
+ value.some((part) => !Object.hasOwn(edge, part)))
16
+ )
17
+ throw new TypeError(
18
+ 'Section points must pair start, center or end for the section and viewport.',
19
+ )
20
+ }
21
+ /** Renderer geometry only; Jolt owns interpolation, scheduling and reduced motion. */
22
+ export function sectionScrollRange(
23
+ top: number,
24
+ height: number,
25
+ viewport: number,
26
+ maximum: number,
27
+ options: SectionScrollOptions,
28
+ ) {
29
+ validateSectionScroll(options)
30
+ if (
31
+ ![top, height, viewport, maximum].every(Number.isFinite) ||
32
+ height < 0 ||
33
+ viewport < 0 ||
34
+ maximum < 0
35
+ )
36
+ throw new RangeError('Section geometry must be finite.')
37
+ const position = ([section, screen]: readonly [ScrollEdge, ScrollEdge]) =>
38
+ top + height * edge[section] - viewport * edge[screen]
39
+ const start = position(options.start ?? ['start', 'end'])
40
+ const end = position(options.end ?? ['end', 'start'])
41
+ if (end < start) throw new RangeError('Section end must follow its start.')
42
+ const clamp = (value: number) => Math.max(0, Math.min(maximum, value))
43
+ const range = [clamp(start), clamp(end)] as const
44
+ // A section with no traversable range settles; never divide by zero or add a clock.
45
+ return { range: range[1] > range[0] ? range : ([0, 1] as const), settled: range[1] <= range[0] }
46
+ }
@@ -0,0 +1,39 @@
1
+ import { validateChoices, type ChoiceOption, type ChoiceValue } from './choice.js'
2
+
3
+ export type SegmentedOption = Pick<ChoiceOption, 'value' | 'label' | 'disabled'>
4
+ export const segmentedMotion = Object.freeze({
5
+ duration: 180,
6
+ ease: 'easeOut',
7
+ cssEase: 'ease-out',
8
+ } as const)
9
+
10
+ export function validateSegments(
11
+ options: readonly SegmentedOption[],
12
+ value: ChoiceValue | null,
13
+ label: string,
14
+ ) {
15
+ validateChoices(options, value)
16
+ if (typeof label !== 'string' || !label.trim())
17
+ throw new TypeError('SegmentedControl needs a non-empty label.')
18
+ }
19
+
20
+ /** A segmented choice follows radio behavior: arrows both focus and request selection. */
21
+ export function segmentedFocusTarget(
22
+ options: readonly SegmentedOption[],
23
+ value: ChoiceValue,
24
+ key: string,
25
+ rtl = false,
26
+ ): SegmentedOption | undefined {
27
+ const enabled = options.filter((option) => !option.disabled)
28
+ if (key === 'Home') return enabled[0]
29
+ if (key === 'End') return enabled[enabled.length - 1]
30
+ const direction = {
31
+ ArrowRight: rtl ? -1 : 1,
32
+ ArrowLeft: rtl ? 1 : -1,
33
+ ArrowDown: 1,
34
+ ArrowUp: -1,
35
+ }[key]
36
+ if (!direction) return
37
+ const index = enabled.findIndex((option) => option.value === value)
38
+ return enabled[(index + direction + enabled.length) % enabled.length]
39
+ }
package/src/sheet.ts ADDED
@@ -0,0 +1,31 @@
1
+ /** Why a sheet closed: the component's own control, a platform dismissal, or `open` set to false. */
2
+ export type SheetCloseReason = 'button' | 'backdrop' | 'escape' | 'back' | 'swipe' | 'program'
3
+
4
+ export type SheetName =
5
+ { title: string; accessibilityLabel?: string } | { title?: string; accessibilityLabel: string }
6
+
7
+ export const sheetCloseReasons: readonly SheetCloseReason[] = [
8
+ 'button',
9
+ 'backdrop',
10
+ 'escape',
11
+ 'back',
12
+ 'swipe',
13
+ 'program',
14
+ ]
15
+
16
+ export function checkSheetName(title: string | undefined, label: string | undefined) {
17
+ const name = title?.trim() || label?.trim()
18
+ if (!name) throw new RangeError('A sheet needs a nonempty title or accessibilityLabel')
19
+ return name
20
+ }
21
+
22
+ /** Web focus destination, resolved after the native dialog close event. A string is an element ID. */
23
+ export type SheetReturnFocus =
24
+ | string
25
+ | false
26
+ | ((
27
+ reason: SheetCloseReason,
28
+ ) =>
29
+ | { readonly isConnected: boolean; focus(options?: { preventScroll?: boolean }): unknown }
30
+ | null
31
+ | undefined)
package/src/tabs.ts ADDED
@@ -0,0 +1,35 @@
1
+ import { validateChoices, type ChoiceOption, type ChoiceValue } from './choice.js'
2
+
3
+ export type TabOption = Pick<ChoiceOption, 'value' | 'label' | 'disabled'>
4
+ export interface TabPanelProps {
5
+ value: ChoiceValue
6
+ }
7
+
8
+ export function validateTabs(tabs: readonly TabOption[], value: ChoiceValue | null, label: string) {
9
+ validateChoices(tabs, value)
10
+ if (typeof label !== 'string' || !label.trim())
11
+ throw new TypeError('Tabs need a non-empty label.')
12
+ }
13
+
14
+ /** Keyboard navigation moves focus; activation remains an explicit action. */
15
+ export function tabFocusTarget(
16
+ tabs: readonly TabOption[],
17
+ value: ChoiceValue,
18
+ key: string,
19
+ rtl = false,
20
+ ): TabOption | undefined {
21
+ const enabled = tabs.filter((tab) => !tab.disabled)
22
+ if (key === 'Home') return enabled[0]
23
+ if (key === 'End') return enabled[enabled.length - 1]
24
+ if (key !== 'ArrowLeft' && key !== 'ArrowRight') return
25
+ const step = (key === 'ArrowRight' ? 1 : -1) * (rtl ? -1 : 1)
26
+ const index = enabled.findIndex((tab) => tab.value === value)
27
+ return enabled[(index + step + enabled.length) % enabled.length]
28
+ }
29
+
30
+ /** Reveal the nearest edge without changing a surrounding vertical scroll view. */
31
+ export function tabScrollOffset(left: number, width: number, offset: number, viewport: number) {
32
+ if (left < offset || width >= viewport) return Math.max(0, left)
33
+ if (left + width > offset + viewport) return Math.max(0, left + width - viewport)
34
+ return offset
35
+ }
@@ -1,4 +1,11 @@
1
1
  import type { MavisTheme, ThemeOptions } from './types.js'
2
+ import {
3
+ validateTypography,
4
+ validateComponentTheme,
5
+ validateShadow,
6
+ freezeFamily,
7
+ } from './typography.js'
8
+ import { defaultMotion, validateMotion } from '../motion.js'
2
9
 
3
10
  const foundation: MavisTheme = {
4
11
  name: 'mavis',
@@ -16,40 +23,105 @@ const foundation: MavisTheme = {
16
23
  onAccent: '#FFFFFF',
17
24
  accentSoft: '#E8EEFF',
18
25
  border: '#EAE3ED',
26
+ warning: '#9A5A10',
19
27
  success: '#237354',
20
28
  danger: '#B33545',
21
29
  },
22
30
  space: { none: 0, xs: 4, sm: 8, md: 16, lg: 24, xl: 32, '2xl': 48 },
23
31
  radius: { none: 0, sm: 10, md: 16, lg: 24, full: 999 },
24
32
  typography: {
25
- display: { fontSize: 56, fontWeight: '600', letterSpacing: -0.04 },
26
- title: { fontSize: 34, fontWeight: '600', letterSpacing: -0.035 },
27
- heading: { fontSize: 20, fontWeight: '600', letterSpacing: -0.02 },
28
- body: { fontSize: 16, fontWeight: 'normal', letterSpacing: 0 },
29
- caption: { fontSize: 13, fontWeight: 'normal', letterSpacing: 0 },
30
- overline: { fontSize: 11, fontWeight: '600', letterSpacing: 0.12 },
33
+ display: {
34
+ fontSize: 56,
35
+ fontWeight: '600',
36
+ letterSpacing: -0.04,
37
+ fontFamily: 'system',
38
+ lineHeight: 1.3,
39
+ },
40
+ title: {
41
+ fontSize: 34,
42
+ fontWeight: '600',
43
+ letterSpacing: -0.035,
44
+ fontFamily: 'system',
45
+ lineHeight: 1.3,
46
+ },
47
+ heading: {
48
+ fontSize: 20,
49
+ fontWeight: '600',
50
+ letterSpacing: -0.02,
51
+ fontFamily: 'system',
52
+ lineHeight: 1.3,
53
+ },
54
+ body: {
55
+ fontSize: 16,
56
+ fontWeight: 'normal',
57
+ letterSpacing: 0,
58
+ fontFamily: 'system',
59
+ lineHeight: 1.3,
60
+ },
61
+ caption: {
62
+ fontSize: 13,
63
+ fontWeight: 'normal',
64
+ letterSpacing: 0,
65
+ fontFamily: 'system',
66
+ lineHeight: 1.3,
67
+ },
68
+ overline: {
69
+ fontSize: 11,
70
+ fontWeight: '600',
71
+ letterSpacing: 0.12,
72
+ fontFamily: 'system',
73
+ lineHeight: 1.3,
74
+ },
31
75
  },
32
76
  control: {
33
77
  sm: { height: 44, fontSize: 14, padding: 16 },
34
78
  md: { height: 52, fontSize: 16, padding: 20 },
35
79
  lg: { height: 60, fontSize: 17, padding: 24 },
36
80
  },
37
- motion: { pressScale: 0.97 },
81
+ elevation: {
82
+ none: { x: 0, y: 0, blur: 0, spread: 0, color: 'transparent' },
83
+ sm: { x: 0, y: 2, blur: 6, spread: 0, color: 'rgba(37, 30, 50, 0.10)' },
84
+ md: { x: 0, y: 8, blur: 24, spread: 0, color: 'rgba(37, 30, 50, 0.14)' },
85
+ lg: { x: 0, y: 16, blur: 40, spread: 0, color: 'rgba(37, 30, 50, 0.20)' },
86
+ },
87
+ components: {
88
+ button: { fontWeight: '600', lineHeight: 1.3, paddingY: 12, radius: 'md', elevation: 'none' },
89
+ input: { fontWeight: 'normal', lineHeight: 1.5, paddingX: 16, paddingY: 14, radius: 'md' },
90
+ card: { padding: 'lg', radius: 'lg', elevation: 'none' },
91
+ },
92
+ motion: defaultMotion,
38
93
  }
39
94
 
40
95
  /** Derive a complete theme without changing the original. */
41
96
  export function defineTheme(options: ThemeOptions, base: MavisTheme = foundation): MavisTheme {
42
97
  const typography = { ...base.typography }
43
98
  for (const variant of Object.keys(typography) as (keyof typeof typography)[]) {
44
- typography[variant] = Object.freeze({
99
+ const type = {
45
100
  ...typography[variant],
46
101
  ...options.typography?.[variant],
47
- })
102
+ }
103
+ validateTypography(type)
104
+ typography[variant] = Object.freeze({ ...type, fontFamily: freezeFamily(type.fontFamily) })
48
105
  }
49
106
  const control = { ...base.control }
50
107
  for (const size of Object.keys(control) as (keyof typeof control)[]) {
51
108
  control[size] = Object.freeze({ ...control[size], ...options.control?.[size] })
52
109
  }
110
+ const elevation = { ...base.elevation }
111
+ for (const level of Object.keys(elevation) as (keyof typeof elevation)[]) {
112
+ const shadow = { ...elevation[level], ...options.elevation?.[level] }
113
+ validateShadow(shadow)
114
+ elevation[level] = Object.freeze(shadow)
115
+ }
116
+ const components = {
117
+ button: { ...base.components.button, ...options.components?.button },
118
+ input: { ...base.components.input, ...options.components?.input },
119
+ card: { ...base.components.card, ...options.components?.card },
120
+ }
121
+ validateComponentTheme(components)
122
+ for (const component of [components.button, components.input]) {
123
+ if (component.fontFamily) component.fontFamily = freezeFamily(component.fontFamily)
124
+ }
53
125
  const theme: MavisTheme = {
54
126
  name: options.name,
55
127
  appearance: options.appearance ?? base.appearance,
@@ -58,14 +130,18 @@ export function defineTheme(options: ThemeOptions, base: MavisTheme = foundation
58
130
  radius: Object.freeze({ ...base.radius, ...options.radius }),
59
131
  typography: Object.freeze(typography),
60
132
  control: Object.freeze(control),
133
+ elevation: Object.freeze(elevation),
134
+ components: Object.freeze({
135
+ button: Object.freeze(components.button),
136
+ input: Object.freeze(components.input),
137
+ card: Object.freeze(components.card),
138
+ }),
61
139
  motion: Object.freeze({ ...base.motion, ...options.motion }),
62
140
  }
63
141
  for (const [key, value] of [...Object.entries(theme.space), ...Object.entries(theme.radius)]) {
64
142
  if (!Number.isFinite(value) || value < 0) throw new RangeError(`Invalid theme token: ${key}`)
65
143
  }
66
- if (!(theme.motion.pressScale > 0 && theme.motion.pressScale <= 1)) {
67
- throw new RangeError('pressScale must be greater than 0 and at most 1')
68
- }
144
+ validateMotion(theme.motion)
69
145
  return Object.freeze(theme)
70
146
  }
71
147
 
@@ -87,6 +163,7 @@ export const midnight = defineTheme({
87
163
  onAccent: '#172247',
88
164
  accentSoft: '#242E4A',
89
165
  border: '#3C3046',
166
+ warning: '#F4C579',
90
167
  success: '#9FD5BE',
91
168
  danger: '#FFA8A8',
92
169
  },
@@ -18,16 +18,65 @@ export interface Palette {
18
18
  onAccent: string
19
19
  accentSoft: string
20
20
  border: string
21
+ warning: string
21
22
  success: string
22
23
  danger: string
23
24
  }
24
25
 
26
+ export type FontWeight =
27
+ 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'
28
+ /** A shared installed family, or explicit platform names/stacks. Empty native names use the system font. */
29
+ export type FontFamily = string | Readonly<{ web: string; ios: string; android: string }>
30
+ export type Elevation = 'none' | 'sm' | 'md' | 'lg'
31
+ export interface Shadow {
32
+ x: number
33
+ y: number
34
+ blur: number
35
+ spread: number
36
+ color: string
37
+ }
38
+ export interface ComponentTheme {
39
+ button: {
40
+ fontFamily?: FontFamily
41
+ fontWeight: FontWeight
42
+ lineHeight: number
43
+ paddingY: number
44
+ radius: Radius | number
45
+ elevation: Elevation
46
+ }
47
+ input: {
48
+ fontFamily?: FontFamily
49
+ fontSize?: number
50
+ fontWeight: FontWeight
51
+ lineHeight: number
52
+ paddingX: number
53
+ paddingY: number
54
+ radius: Radius | number
55
+ }
56
+ card: { padding: Spacing; radius: Radius | number; elevation: Elevation }
57
+ }
58
+
25
59
  export interface Typography {
26
60
  fontSize: number
27
- fontWeight: 'normal' | '500' | '600' | 'bold'
61
+ fontWeight: FontWeight
62
+ fontFamily: FontFamily
63
+ /** Unitless line rhythm, at least 1; native renderers add leading to font metrics. */
64
+ lineHeight: number
28
65
  letterSpacing: number
29
66
  }
30
67
 
68
+ export type MotionEase = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut'
69
+ export interface MotionTheme {
70
+ pressScale: number
71
+ pressDuration: number
72
+ releaseDuration: number
73
+ releaseBounce: number
74
+ enterDuration: number
75
+ exitDuration: number
76
+ enterOffset: number
77
+ ease: MotionEase
78
+ }
79
+
31
80
  export interface MavisTheme {
32
81
  readonly name: string
33
82
  readonly appearance: 'light' | 'dark'
@@ -38,7 +87,9 @@ export interface MavisTheme {
38
87
  readonly control: Readonly<
39
88
  Record<Size, Readonly<{ height: number; fontSize: number; padding: number }>>
40
89
  >
41
- readonly motion: Readonly<{ pressScale: number }>
90
+ readonly elevation: Readonly<Record<Elevation, Readonly<Shadow>>>
91
+ readonly components: { readonly [K in keyof ComponentTheme]: Readonly<ComponentTheme[K]> }
92
+ readonly motion: Readonly<MotionTheme>
42
93
  }
43
94
 
44
95
  export interface ThemeOptions {
@@ -49,5 +100,7 @@ export interface ThemeOptions {
49
100
  radius?: Partial<MavisTheme['radius']>
50
101
  typography?: Partial<Record<TextVariant, Partial<Typography>>>
51
102
  control?: Partial<Record<Size, Partial<MavisTheme['control'][Size]>>>
103
+ elevation?: Partial<Record<Elevation, Partial<Shadow>>>
104
+ components?: { [K in keyof ComponentTheme]?: Partial<ComponentTheme[K]> }
52
105
  motion?: Partial<MavisTheme['motion']>
53
106
  }
@@ -0,0 +1,84 @@
1
+ import type { ComponentTheme, FontFamily, FontWeight, Shadow, Typography } from './types.js'
2
+
3
+ export const fontWeights: readonly FontWeight[] = [
4
+ 'normal',
5
+ 'bold',
6
+ '100',
7
+ '200',
8
+ '300',
9
+ '400',
10
+ '500',
11
+ '600',
12
+ '700',
13
+ '800',
14
+ '900',
15
+ ]
16
+ export function validateWeight(value: FontWeight) {
17
+ if (!fontWeights.includes(value)) throw new RangeError(`Invalid font weight: ${String(value)}`)
18
+ return value
19
+ }
20
+ export function freezeFamily(value: FontFamily): FontFamily {
21
+ if (typeof value === 'string') {
22
+ if (!value.trim()) throw new RangeError('A font family must not be blank')
23
+ return value
24
+ }
25
+ if (
26
+ !value ||
27
+ typeof value.web !== 'string' ||
28
+ !value.web.trim() ||
29
+ typeof value.ios !== 'string' ||
30
+ typeof value.android !== 'string'
31
+ ) {
32
+ throw new TypeError('A font family needs web, ios and android names')
33
+ }
34
+ return Object.freeze({ ...value })
35
+ }
36
+ export function fontFamily(value: FontFamily, platform: 'web' | 'ios' | 'android') {
37
+ if (value === 'system')
38
+ return platform === 'web'
39
+ ? 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
40
+ : ''
41
+ return typeof value === 'string' ? value : value[platform]
42
+ }
43
+ function finite(value: number, name: string, minimum = 0) {
44
+ if (!Number.isFinite(value) || value < minimum) throw new RangeError(`Invalid ${name}: ${value}`)
45
+ }
46
+ export function validateTypography(value: Typography) {
47
+ finite(value.fontSize, 'fontSize', Number.EPSILON)
48
+ finite(value.lineHeight, 'lineHeight', 1)
49
+ if (!Number.isFinite(value.letterSpacing)) throw new RangeError('Invalid letterSpacing')
50
+ validateWeight(value.fontWeight)
51
+ freezeFamily(value.fontFamily)
52
+ }
53
+ export function validateShadow(value: Shadow) {
54
+ for (const key of ['x', 'y', 'spread'] as const) finite(value[key], `shadow ${key}`, -Infinity)
55
+ finite(value.blur, 'shadow blur')
56
+ if (typeof value.color !== 'string' || !value.color.trim())
57
+ throw new RangeError('A shadow needs a color')
58
+ }
59
+ export function validateComponentTheme(value: ComponentTheme) {
60
+ for (const component of [value.button, value.input]) {
61
+ validateWeight(component.fontWeight)
62
+ finite(component.lineHeight, 'lineHeight', 1)
63
+ finite(component.paddingY, 'paddingY')
64
+ if (component.fontFamily !== undefined) freezeFamily(component.fontFamily)
65
+ }
66
+ finite(value.input.paddingX, 'paddingX')
67
+ if (value.input.fontSize !== undefined) finite(value.input.fontSize, 'fontSize', Number.EPSILON)
68
+ for (const component of [value.button, value.input, value.card]) {
69
+ if (typeof component.radius === 'number') finite(component.radius, 'radius')
70
+ else if (!['none', 'sm', 'md', 'lg', 'full'].includes(component.radius))
71
+ throw new RangeError('Invalid component radius')
72
+ }
73
+ for (const component of [value.button, value.card]) {
74
+ if (!['none', 'sm', 'md', 'lg'].includes(component.elevation))
75
+ throw new RangeError('Invalid elevation')
76
+ }
77
+ if (typeof value.card.padding === 'number') finite(value.card.padding, 'padding')
78
+ else if (!['none', 'xs', 'sm', 'md', 'lg', 'xl', '2xl'].includes(value.card.padding))
79
+ throw new RangeError('Invalid card padding')
80
+ }
81
+ export function shadowStyle(value: Shadow, platform: 'web' | 'native' = 'web') {
82
+ const unit = platform === 'web' ? 'px' : 'dip'
83
+ return `${value.x}${unit} ${value.y}${unit} ${value.blur}${unit} ${value.spread}${unit} ${value.color}`
84
+ }
package/src/time.ts ADDED
@@ -0,0 +1,83 @@
1
+ /** A wall-clock time, independent of date, timezone and daylight-saving transitions. */
2
+ export type LocalTime = string
3
+ export type TimeLocale = 'en-US' | 'pt-BR'
4
+ export type HourCycle = 'h12' | 'h23'
5
+ export interface TimeOptions {
6
+ locale?: TimeLocale
7
+ hourCycle?: HourCycle
8
+ min?: LocalTime
9
+ max?: LocalTime
10
+ minuteStep?: number
11
+ }
12
+ export type TimeValidation =
13
+ | { status: 'empty'; value: null }
14
+ | { status: 'valid'; value: LocalTime }
15
+ | { status: 'incomplete' | 'invalid' | 'range' | 'step'; value: null }
16
+
17
+ export function timeMinutes(value: LocalTime): number {
18
+ if (!/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(value))
19
+ throw new RangeError('Time must use HH:mm between 00:00 and 23:59.')
20
+ return Number(value.slice(0, 2)) * 60 + Number(value.slice(3))
21
+ }
22
+ export function localTime(minutes: number): LocalTime {
23
+ if (!Number.isInteger(minutes) || minutes < 0 || minutes >= 1440)
24
+ throw new RangeError('Time requires an integer minute within one day.')
25
+ return `${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}`
26
+ }
27
+ export function timeOptions(options: TimeOptions = {}) {
28
+ const min = options.min === undefined ? 0 : timeMinutes(options.min)
29
+ const max = options.max === undefined ? 1439 : timeMinutes(options.max)
30
+ const step = options.minuteStep ?? 1
31
+ if (min > max)
32
+ throw new RangeError('Time min must not exceed max; overnight ranges are not supported.')
33
+ if (!Number.isInteger(step) || step < 1 || step > 30 || 60 % step)
34
+ throw new RangeError('minuteStep must be a divisor of 60 between 1 and 30.')
35
+ if (Math.ceil(min / step) * step > max)
36
+ throw new RangeError('Time bounds contain no selectable time.')
37
+ const locale = options.locale ?? 'en-US'
38
+ const cycle = options.hourCycle ?? (locale === 'pt-BR' ? 'h23' : 'h12')
39
+ if (!['en-US', 'pt-BR'].includes(locale) || !['h12', 'h23'].includes(cycle))
40
+ throw new RangeError('Unsupported time locale or hour cycle.')
41
+ return { min, max, step, cycle }
42
+ }
43
+ export function validateTime(value: LocalTime | null, options: TimeOptions = {}): TimeValidation {
44
+ const { min, max, step } = timeOptions(options)
45
+ if (value === null) return { status: 'empty', value: null }
46
+ let minutes: number
47
+ try {
48
+ minutes = timeMinutes(value)
49
+ } catch {
50
+ return { status: 'invalid', value: null }
51
+ }
52
+ if (minutes < min || minutes > max) return { status: 'range', value: null }
53
+ if (minutes % step) return { status: 'step', value: null }
54
+ return { status: 'valid', value }
55
+ }
56
+ /** Deterministic during SSR and on native runtimes without Intl. Never constructs a Date. */
57
+ export function formatTime(value: LocalTime | null, options: TimeOptions = {}): string {
58
+ const { cycle } = timeOptions(options)
59
+ if (value === null) return ''
60
+ const minutes = timeMinutes(value)
61
+ if (cycle === 'h23') return value
62
+ const hour = Math.floor(minutes / 60)
63
+ return `${hour % 12 || 12}:${value.slice(3)} ${hour < 12 ? 'AM' : 'PM'}`
64
+ }
65
+ export function parseTime(draft: string, options: TimeOptions = {}): TimeValidation {
66
+ const { cycle } = timeOptions(options)
67
+ const text = draft.trim()
68
+ if (!text) return { status: 'empty', value: null }
69
+ const match =
70
+ cycle === 'h23' ? /^(\d{1,2}):(\d{2})$/.exec(text) : /^(\d{1,2}):(\d{2})\s*(AM|PM)$/i.exec(text)
71
+ if (!match)
72
+ return {
73
+ status: /^\d{0,2}(?::\d{0,2})?\s*[apm]{0,2}$/i.test(text) ? 'incomplete' : 'invalid',
74
+ value: null,
75
+ }
76
+ let hour = Number(match[1])
77
+ if (Number(match[2]) > 59) return { status: 'invalid', value: null }
78
+ if (cycle === 'h12') {
79
+ if (hour < 1 || hour > 12) return { status: 'invalid', value: null }
80
+ hour = (hour % 12) + (match[3]!.toUpperCase() === 'PM' ? 12 : 0)
81
+ } else if (hour > 23) return { status: 'invalid', value: null }
82
+ return validateTime(localTime(hour * 60 + Number(match[2])), options)
83
+ }