@getcortexlabs/mavis 0.1.0-alpha.2 → 0.1.0-alpha.4

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 (413) hide show
  1. package/README.md +7 -5
  2. package/dist/native/avatar-image.d.ts +4 -0
  3. package/dist/native/avatar-image.d.ts.map +1 -0
  4. package/dist/native/avatar-image.js +12 -0
  5. package/dist/native/avatar-image.js.map +1 -0
  6. package/dist/native/avatar-label.android.d.ts +9 -0
  7. package/dist/native/avatar-label.android.d.ts.map +1 -0
  8. package/dist/native/avatar-label.android.js +9 -0
  9. package/dist/native/avatar-label.android.js.map +1 -0
  10. package/dist/native/avatar-label.d.ts +2 -0
  11. package/dist/native/avatar-label.d.ts.map +1 -0
  12. package/dist/native/avatar-label.js +2 -0
  13. package/dist/native/avatar-label.js.map +1 -0
  14. package/dist/native/box.ios.d.ts +4 -0
  15. package/dist/native/box.ios.d.ts.map +1 -1
  16. package/dist/native/box.ios.js +29 -1
  17. package/dist/native/box.ios.js.map +1 -1
  18. package/dist/native/button.ios.d.ts +13 -1
  19. package/dist/native/button.ios.d.ts.map +1 -1
  20. package/dist/native/button.ios.js +29 -1
  21. package/dist/native/button.ios.js.map +1 -1
  22. package/dist/native/checkbox.android.d.ts +7 -0
  23. package/dist/native/checkbox.android.d.ts.map +1 -0
  24. package/dist/native/checkbox.android.js +26 -0
  25. package/dist/native/checkbox.android.js.map +1 -0
  26. package/dist/native/checkbox.d.ts +7 -0
  27. package/dist/native/checkbox.d.ts.map +1 -0
  28. package/dist/native/checkbox.js +7 -0
  29. package/dist/native/checkbox.js.map +1 -0
  30. package/dist/native/composed-button.android.d.ts +4 -0
  31. package/dist/native/composed-button.android.d.ts.map +1 -0
  32. package/dist/native/composed-button.android.js +53 -0
  33. package/dist/native/composed-button.android.js.map +1 -0
  34. package/dist/native/composed-button.d.ts +3 -0
  35. package/dist/native/composed-button.d.ts.map +1 -0
  36. package/dist/native/composed-button.js +4 -0
  37. package/dist/native/composed-button.js.map +1 -0
  38. package/dist/native/dialog.android.d.ts +12 -0
  39. package/dist/native/dialog.android.d.ts.map +1 -0
  40. package/dist/native/dialog.android.js +46 -0
  41. package/dist/native/dialog.android.js.map +1 -0
  42. package/dist/native/dialog.d.ts +12 -0
  43. package/dist/native/dialog.d.ts.map +1 -0
  44. package/dist/native/dialog.ios.d.ts +12 -0
  45. package/dist/native/dialog.ios.d.ts.map +1 -0
  46. package/dist/native/dialog.ios.js +13 -0
  47. package/dist/native/dialog.ios.js.map +1 -0
  48. package/dist/native/dialog.js +4 -0
  49. package/dist/native/dialog.js.map +1 -0
  50. package/dist/native/dynamic-type.d.ts +15 -0
  51. package/dist/native/dynamic-type.d.ts.map +1 -0
  52. package/dist/native/dynamic-type.js +47 -0
  53. package/dist/native/dynamic-type.js.map +1 -0
  54. package/dist/native/flex-layout.ios.d.ts +10 -0
  55. package/dist/native/flex-layout.ios.d.ts.map +1 -1
  56. package/dist/native/flex-layout.ios.js +85 -0
  57. package/dist/native/flex-layout.ios.js.map +1 -1
  58. package/dist/native/input-action.d.ts +5 -0
  59. package/dist/native/input-action.d.ts.map +1 -0
  60. package/dist/native/input-action.js +13 -0
  61. package/dist/native/input-action.js.map +1 -0
  62. package/dist/native/keyboard-dismiss.android.d.ts +8 -0
  63. package/dist/native/keyboard-dismiss.android.d.ts.map +1 -0
  64. package/dist/native/keyboard-dismiss.android.js +9 -0
  65. package/dist/native/keyboard-dismiss.android.js.map +1 -0
  66. package/dist/native/keyboard-dismiss.d.ts +10 -0
  67. package/dist/native/keyboard-dismiss.d.ts.map +1 -0
  68. package/dist/native/keyboard-dismiss.ios.d.ts +8 -0
  69. package/dist/native/keyboard-dismiss.ios.d.ts.map +1 -0
  70. package/dist/native/keyboard-dismiss.ios.js +91 -0
  71. package/dist/native/keyboard-dismiss.ios.js.map +1 -0
  72. package/dist/native/keyboard-dismiss.js +6 -0
  73. package/dist/native/keyboard-dismiss.js.map +1 -0
  74. package/dist/native/label.android.d.ts +12 -0
  75. package/dist/native/label.android.d.ts.map +1 -0
  76. package/dist/native/label.android.js +19 -0
  77. package/dist/native/label.android.js.map +1 -0
  78. package/dist/native/label.ios.d.ts +14 -1
  79. package/dist/native/label.ios.d.ts.map +1 -1
  80. package/dist/native/label.ios.js +37 -1
  81. package/dist/native/label.ios.js.map +1 -1
  82. package/dist/native/measure-memo.d.ts +37 -0
  83. package/dist/native/measure-memo.d.ts.map +1 -0
  84. package/dist/native/measure-memo.js +82 -0
  85. package/dist/native/measure-memo.js.map +1 -0
  86. package/dist/native/motion-surface.d.ts +9 -0
  87. package/dist/native/motion-surface.d.ts.map +1 -0
  88. package/dist/native/motion-surface.js +119 -0
  89. package/dist/native/motion-surface.js.map +1 -0
  90. package/dist/native/press.d.ts +5 -2
  91. package/dist/native/press.d.ts.map +1 -1
  92. package/dist/native/press.js +52 -8
  93. package/dist/native/press.js.map +1 -1
  94. package/dist/native/progress.d.ts +7 -0
  95. package/dist/native/progress.d.ts.map +1 -0
  96. package/dist/native/progress.js +77 -0
  97. package/dist/native/progress.js.map +1 -0
  98. package/dist/native/screen.android.d.ts +6 -0
  99. package/dist/native/screen.android.d.ts.map +1 -0
  100. package/dist/native/screen.android.js +8 -0
  101. package/dist/native/screen.android.js.map +1 -0
  102. package/dist/native/screen.d.ts +2 -0
  103. package/dist/native/screen.d.ts.map +1 -0
  104. package/dist/native/screen.js +3 -0
  105. package/dist/native/screen.js.map +1 -0
  106. package/dist/native/scroll-motion.d.ts +11 -0
  107. package/dist/native/scroll-motion.d.ts.map +1 -0
  108. package/dist/native/scroll-motion.js +94 -0
  109. package/dist/native/scroll-motion.js.map +1 -0
  110. package/dist/native/segmented.d.ts +14 -0
  111. package/dist/native/segmented.d.ts.map +1 -0
  112. package/dist/native/segmented.js +86 -0
  113. package/dist/native/segmented.js.map +1 -0
  114. package/dist/native/sheet.android.d.ts +18 -0
  115. package/dist/native/sheet.android.d.ts.map +1 -0
  116. package/dist/native/sheet.android.js +16 -0
  117. package/dist/native/sheet.android.js.map +1 -0
  118. package/dist/native/sheet.d.ts +21 -0
  119. package/dist/native/sheet.d.ts.map +1 -0
  120. package/dist/native/sheet.ios.d.ts +19 -0
  121. package/dist/native/sheet.ios.d.ts.map +1 -0
  122. package/dist/native/sheet.ios.js +41 -0
  123. package/dist/native/sheet.ios.js.map +1 -0
  124. package/dist/native/sheet.js +17 -0
  125. package/dist/native/sheet.js.map +1 -0
  126. package/dist/native/tabs.android.d.ts +3 -0
  127. package/dist/native/tabs.android.d.ts.map +1 -0
  128. package/dist/native/tabs.android.js +29 -0
  129. package/dist/native/tabs.android.js.map +1 -0
  130. package/dist/native/tabs.d.ts +3 -0
  131. package/dist/native/tabs.d.ts.map +1 -0
  132. package/dist/native/tabs.js +4 -0
  133. package/dist/native/tabs.js.map +1 -0
  134. package/dist/native/text-field.android.d.ts +1 -0
  135. package/dist/native/text-field.android.d.ts.map +1 -1
  136. package/dist/native/text-field.android.js +13 -0
  137. package/dist/native/text-field.android.js.map +1 -1
  138. package/dist/native/text-field.ios.d.ts +9 -0
  139. package/dist/native/text-field.ios.d.ts.map +1 -0
  140. package/dist/native/text-field.ios.js +52 -0
  141. package/dist/native/text-field.ios.js.map +1 -0
  142. package/dist/native/text-view.ios.d.ts +7 -0
  143. package/dist/native/text-view.ios.d.ts.map +1 -0
  144. package/dist/native/text-view.ios.js +10 -0
  145. package/dist/native/text-view.ios.js.map +1 -0
  146. package/dist/native/toast.android.d.ts +4 -0
  147. package/dist/native/toast.android.d.ts.map +1 -0
  148. package/dist/native/toast.android.js +10 -0
  149. package/dist/native/toast.android.js.map +1 -0
  150. package/dist/native/toast.d.ts +4 -0
  151. package/dist/native/toast.d.ts.map +1 -0
  152. package/dist/native/toast.ios.d.ts +4 -0
  153. package/dist/native/toast.ios.d.ts.map +1 -0
  154. package/dist/native/toast.ios.js +8 -0
  155. package/dist/native/toast.ios.js.map +1 -0
  156. package/dist/native/toast.js +5 -0
  157. package/dist/native/toast.js.map +1 -0
  158. package/dist/vue/components/ChoiceControl.d.ts +101 -0
  159. package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
  160. package/dist/vue/components/ChoiceControl.js +196 -0
  161. package/dist/vue/components/ChoiceControl.js.map +1 -0
  162. package/dist/vue/components/MAccordion.d.ts +109 -0
  163. package/dist/vue/components/MAccordion.d.ts.map +1 -0
  164. package/dist/vue/components/MAccordion.js +83 -0
  165. package/dist/vue/components/MAccordion.js.map +1 -0
  166. package/dist/vue/components/MAlert.d.ts +99 -0
  167. package/dist/vue/components/MAlert.d.ts.map +1 -0
  168. package/dist/vue/components/MAlert.js +126 -0
  169. package/dist/vue/components/MAlert.js.map +1 -0
  170. package/dist/vue/components/MAvatar.d.ts +74 -0
  171. package/dist/vue/components/MAvatar.d.ts.map +1 -0
  172. package/dist/vue/components/MAvatar.js +86 -0
  173. package/dist/vue/components/MAvatar.js.map +1 -0
  174. package/dist/vue/components/MBadge.d.ts +64 -0
  175. package/dist/vue/components/MBadge.d.ts.map +1 -0
  176. package/dist/vue/components/MBadge.js +30 -0
  177. package/dist/vue/components/MBadge.js.map +1 -0
  178. package/dist/vue/components/MButton.d.ts +57 -5
  179. package/dist/vue/components/MButton.d.ts.map +1 -1
  180. package/dist/vue/components/MButton.js +129 -11
  181. package/dist/vue/components/MButton.js.map +1 -1
  182. package/dist/vue/components/MCard.d.ts +23 -5
  183. package/dist/vue/components/MCard.d.ts.map +1 -1
  184. package/dist/vue/components/MCard.js +14 -4
  185. package/dist/vue/components/MCard.js.map +1 -1
  186. package/dist/vue/components/MCheckbox.d.ts +93 -0
  187. package/dist/vue/components/MCheckbox.d.ts.map +1 -0
  188. package/dist/vue/components/MCheckbox.js +26 -0
  189. package/dist/vue/components/MCheckbox.js.map +1 -0
  190. package/dist/vue/components/MChip.d.ts +107 -0
  191. package/dist/vue/components/MChip.d.ts.map +1 -0
  192. package/dist/vue/components/MChip.js +120 -0
  193. package/dist/vue/components/MChip.js.map +1 -0
  194. package/dist/vue/components/MDialog.d.ts +95 -0
  195. package/dist/vue/components/MDialog.d.ts.map +1 -0
  196. package/dist/vue/components/MDialog.js +245 -0
  197. package/dist/vue/components/MDialog.js.map +1 -0
  198. package/dist/vue/components/MEmptyState.d.ts +107 -0
  199. package/dist/vue/components/MEmptyState.d.ts.map +1 -0
  200. package/dist/vue/components/MEmptyState.js +79 -0
  201. package/dist/vue/components/MEmptyState.js.map +1 -0
  202. package/dist/vue/components/MInput.d.ts +62 -7
  203. package/dist/vue/components/MInput.d.ts.map +1 -1
  204. package/dist/vue/components/MInput.js +88 -14
  205. package/dist/vue/components/MInput.js.map +1 -1
  206. package/dist/vue/components/MListItem.d.ts +92 -0
  207. package/dist/vue/components/MListItem.d.ts.map +1 -0
  208. package/dist/vue/components/MListItem.js +53 -0
  209. package/dist/vue/components/MListItem.js.map +1 -0
  210. package/dist/vue/components/MProgress.d.ts +112 -0
  211. package/dist/vue/components/MProgress.d.ts.map +1 -0
  212. package/dist/vue/components/MProgress.js +75 -0
  213. package/dist/vue/components/MProgress.js.map +1 -0
  214. package/dist/vue/components/MRadioGroup.d.ts +93 -0
  215. package/dist/vue/components/MRadioGroup.d.ts.map +1 -0
  216. package/dist/vue/components/MRadioGroup.js +57 -0
  217. package/dist/vue/components/MRadioGroup.js.map +1 -0
  218. package/dist/vue/components/MReveal.d.ts.map +1 -1
  219. package/dist/vue/components/MReveal.js +5 -7
  220. package/dist/vue/components/MReveal.js.map +1 -1
  221. package/dist/vue/components/MScreen.d.ts +18 -0
  222. package/dist/vue/components/MScreen.d.ts.map +1 -1
  223. package/dist/vue/components/MScreen.js +68 -5
  224. package/dist/vue/components/MScreen.js.map +1 -1
  225. package/dist/vue/components/MSegmentedControl.d.ts +85 -0
  226. package/dist/vue/components/MSegmentedControl.d.ts.map +1 -0
  227. package/dist/vue/components/MSegmentedControl.js +172 -0
  228. package/dist/vue/components/MSegmentedControl.js.map +1 -0
  229. package/dist/vue/components/MSelect.d.ts +130 -0
  230. package/dist/vue/components/MSelect.d.ts.map +1 -0
  231. package/dist/vue/components/MSelect.js +158 -0
  232. package/dist/vue/components/MSelect.js.map +1 -0
  233. package/dist/vue/components/MSeparator.d.ts +54 -0
  234. package/dist/vue/components/MSeparator.d.ts.map +1 -0
  235. package/dist/vue/components/MSeparator.js +36 -0
  236. package/dist/vue/components/MSeparator.js.map +1 -0
  237. package/dist/vue/components/MSheet.d.ts +101 -0
  238. package/dist/vue/components/MSheet.d.ts.map +1 -0
  239. package/dist/vue/components/MSheet.js +313 -0
  240. package/dist/vue/components/MSheet.js.map +1 -0
  241. package/dist/vue/components/MSkeleton.d.ts +70 -0
  242. package/dist/vue/components/MSkeleton.d.ts.map +1 -0
  243. package/dist/vue/components/MSkeleton.js +87 -0
  244. package/dist/vue/components/MSkeleton.js.map +1 -0
  245. package/dist/vue/components/MSlider.d.ts +1 -1
  246. package/dist/vue/components/MSlider.d.ts.map +1 -1
  247. package/dist/vue/components/MSlider.js +2 -1
  248. package/dist/vue/components/MSlider.js.map +1 -1
  249. package/dist/vue/components/MSwitch.d.ts +79 -0
  250. package/dist/vue/components/MSwitch.d.ts.map +1 -0
  251. package/dist/vue/components/MSwitch.js +163 -0
  252. package/dist/vue/components/MSwitch.js.map +1 -0
  253. package/dist/vue/components/MTabs.d.ts +91 -0
  254. package/dist/vue/components/MTabs.d.ts.map +1 -0
  255. package/dist/vue/components/MTabs.js +245 -0
  256. package/dist/vue/components/MTabs.js.map +1 -0
  257. package/dist/vue/components/MText.d.ts +16 -7
  258. package/dist/vue/components/MText.d.ts.map +1 -1
  259. package/dist/vue/components/MText.js +43 -17
  260. package/dist/vue/components/MText.js.map +1 -1
  261. package/dist/vue/components/MToast.d.ts +23 -0
  262. package/dist/vue/components/MToast.d.ts.map +1 -0
  263. package/dist/vue/components/MToast.js +242 -0
  264. package/dist/vue/components/MToast.js.map +1 -0
  265. package/dist/vue/index.d.ts +31 -4
  266. package/dist/vue/index.d.ts.map +1 -1
  267. package/dist/vue/index.js +48 -4
  268. package/dist/vue/index.js.map +1 -1
  269. package/dist/vue/layers.d.ts +19 -0
  270. package/dist/vue/layers.d.ts.map +1 -0
  271. package/dist/vue/layers.js +26 -0
  272. package/dist/vue/layers.js.map +1 -0
  273. package/dist/vue/native-view.d.ts +6 -0
  274. package/dist/vue/native-view.d.ts.map +1 -0
  275. package/dist/vue/native-view.js +5 -0
  276. package/dist/vue/native-view.js.map +1 -0
  277. package/dist/vue/props.d.ts +12 -11
  278. package/dist/vue/props.d.ts.map +1 -1
  279. package/dist/vue/props.js +25 -10
  280. package/dist/vue/props.js.map +1 -1
  281. package/dist/vue/reveal-motion.d.ts +13 -0
  282. package/dist/vue/reveal-motion.d.ts.map +1 -0
  283. package/dist/vue/reveal-motion.js +55 -0
  284. package/dist/vue/reveal-motion.js.map +1 -0
  285. package/dist/vue/system-back.d.ts +11 -0
  286. package/dist/vue/system-back.d.ts.map +1 -0
  287. package/dist/vue/system-back.js +2 -0
  288. package/dist/vue/system-back.js.map +1 -0
  289. package/dist/vue/use-motion-surface.d.ts +8 -0
  290. package/dist/vue/use-motion-surface.d.ts.map +1 -0
  291. package/dist/vue/use-motion-surface.js +75 -0
  292. package/dist/vue/use-motion-surface.js.map +1 -0
  293. package/dist/vue/use-press.d.ts +1 -1
  294. package/dist/vue/use-press.d.ts.map +1 -1
  295. package/dist/vue/use-press.js +12 -4
  296. package/dist/vue/use-press.js.map +1 -1
  297. package/dist/vue/use-scroll-motion.d.ts +7 -0
  298. package/dist/vue/use-scroll-motion.d.ts.map +1 -0
  299. package/dist/vue/use-scroll-motion.js +30 -0
  300. package/dist/vue/use-scroll-motion.js.map +1 -0
  301. package/package.json +3 -3
  302. package/platforms/android/java/com/mavis/ui/Box.java +38 -3
  303. package/platforms/android/java/com/mavis/ui/ContentWidth.java +77 -0
  304. package/platforms/android/java/com/mavis/ui/FlexLayout.java +80 -4
  305. package/platforms/android/java/com/mavis/ui/MeasureMemo.java +145 -0
  306. package/platforms/android/java/com/mavis/ui/Screen.java +108 -0
  307. package/src/native/avatar-image.ts +9 -0
  308. package/src/native/avatar-label.android.ts +14 -0
  309. package/src/native/avatar-label.ts +1 -0
  310. package/src/native/box.ios.ts +48 -1
  311. package/src/native/button.ios.ts +53 -1
  312. package/src/native/checkbox.android.ts +35 -0
  313. package/src/native/checkbox.ts +9 -0
  314. package/src/native/composed-button.android.ts +74 -0
  315. package/src/native/composed-button.ts +9 -0
  316. package/src/native/dialog.android.ts +56 -0
  317. package/src/native/dialog.ios.ts +23 -0
  318. package/src/native/dialog.ts +10 -0
  319. package/src/native/dynamic-type.ts +71 -0
  320. package/src/native/flex-layout.ios.ts +113 -0
  321. package/src/native/input-action.ts +15 -0
  322. package/src/native/keyboard-dismiss.android.ts +17 -0
  323. package/src/native/keyboard-dismiss.ios.ts +124 -0
  324. package/src/native/keyboard-dismiss.ts +14 -0
  325. package/src/native/label.android.ts +27 -0
  326. package/src/native/label.ios.ts +54 -1
  327. package/src/native/measure-memo.ts +116 -0
  328. package/src/native/motion-surface.ts +137 -0
  329. package/src/native/press.ts +52 -10
  330. package/src/native/progress.ts +78 -0
  331. package/src/native/screen.android.ts +12 -0
  332. package/src/native/screen.ts +2 -0
  333. package/src/native/scroll-motion.ts +101 -0
  334. package/src/native/segmented.ts +95 -0
  335. package/src/native/sheet.android.ts +24 -0
  336. package/src/native/sheet.ios.ts +52 -0
  337. package/src/native/sheet.ts +26 -0
  338. package/src/native/tabs.android.ts +58 -0
  339. package/src/native/tabs.ts +8 -0
  340. package/src/native/text-field.android.ts +19 -0
  341. package/src/native/text-field.ios.ts +53 -0
  342. package/src/native/text-view.ios.ts +10 -0
  343. package/src/native/toast.android.ts +9 -0
  344. package/src/native/toast.ios.ts +13 -0
  345. package/src/native/toast.ts +6 -0
  346. package/src/vue/components/ChoiceControl.ts +238 -0
  347. package/src/vue/components/MAccordion.ts +123 -0
  348. package/src/vue/components/MAlert.ts +156 -0
  349. package/src/vue/components/MAvatar.ts +103 -0
  350. package/src/vue/components/MBadge.ts +34 -0
  351. package/src/vue/components/MButton.ts +176 -9
  352. package/src/vue/components/MCard.ts +23 -3
  353. package/src/vue/components/MCheckbox.ts +25 -0
  354. package/src/vue/components/MChip.ts +134 -0
  355. package/src/vue/components/MDialog.ts +312 -0
  356. package/src/vue/components/MEmptyState.ts +96 -0
  357. package/src/vue/components/MInput.ts +96 -12
  358. package/src/vue/components/MListItem.ts +66 -0
  359. package/src/vue/components/MProgress.ts +94 -0
  360. package/src/vue/components/MRadioGroup.ts +64 -0
  361. package/src/vue/components/MReveal.ts +6 -7
  362. package/src/vue/components/MScreen.ts +93 -5
  363. package/src/vue/components/MSegmentedControl.ts +214 -0
  364. package/src/vue/components/MSelect.ts +185 -0
  365. package/src/vue/components/MSeparator.ts +40 -0
  366. package/src/vue/components/MSheet.ts +375 -0
  367. package/src/vue/components/MSkeleton.ts +100 -0
  368. package/src/vue/components/MSlider.ts +7 -1
  369. package/src/vue/components/MSwitch.ts +187 -0
  370. package/src/vue/components/MTabs.ts +302 -0
  371. package/src/vue/components/MText.ts +37 -6
  372. package/src/vue/components/MToast.ts +289 -0
  373. package/src/vue/index.ts +90 -4
  374. package/src/vue/layers.ts +48 -0
  375. package/src/vue/native-view.ts +6 -0
  376. package/src/vue/props.ts +37 -12
  377. package/src/vue/reveal-motion.ts +61 -0
  378. package/src/vue/system-back.ts +12 -0
  379. package/src/vue/use-motion-surface.ts +77 -0
  380. package/src/vue/use-press.ts +12 -4
  381. package/src/vue/use-scroll-motion.ts +31 -0
  382. package/dist/native/input-description.android.d.ts +0 -4
  383. package/dist/native/input-description.android.d.ts.map +0 -1
  384. package/dist/native/input-description.android.js +0 -18
  385. package/dist/native/input-description.android.js.map +0 -1
  386. package/dist/theme/resolve.d.ts +0 -3
  387. package/dist/theme/resolve.d.ts.map +0 -1
  388. package/dist/theme/resolve.js +0 -8
  389. package/dist/theme/resolve.js.map +0 -1
  390. package/dist/theme/themes.d.ts +0 -6
  391. package/dist/theme/themes.d.ts.map +0 -1
  392. package/dist/theme/themes.js +0 -83
  393. package/dist/theme/themes.js.map +0 -1
  394. package/dist/theme/types.d.ts +0 -50
  395. package/dist/theme/types.d.ts.map +0 -1
  396. package/dist/theme/types.js +0 -2
  397. package/dist/theme/types.js.map +0 -1
  398. package/dist/vue/global-components.d.ts +0 -21
  399. package/dist/vue/global-components.d.ts.map +0 -1
  400. package/dist/vue/global-components.js +0 -2
  401. package/dist/vue/global-components.js.map +0 -1
  402. package/dist/vue/layout-context.d.ts +0 -5
  403. package/dist/vue/layout-context.d.ts.map +0 -1
  404. package/dist/vue/layout-context.js +0 -7
  405. package/dist/vue/layout-context.js.map +0 -1
  406. package/dist/vue/text-content.d.ts +0 -4
  407. package/dist/vue/text-content.d.ts.map +0 -1
  408. package/dist/vue/text-content.js +0 -17
  409. package/dist/vue/text-content.js.map +0 -1
  410. package/dist/vue/theme.d.ts +0 -177
  411. package/dist/vue/theme.d.ts.map +0 -1
  412. package/dist/vue/theme.js +0 -17
  413. package/dist/vue/theme.js.map +0 -1
@@ -12,6 +12,11 @@ const NO_EXTRACT_UI = 0x10000000
12
12
  const setReturnKey = (TextField.prototype as unknown as Record<symbol, (value: string) => void>)[
13
13
  returnKeyTypeProperty.setNative
14
14
  ]!
15
+ const setInputType = (
16
+ TextField.prototype as unknown as {
17
+ _setInputType(this: TextField, value: number): void
18
+ }
19
+ )._setInputType
15
20
  interface KeyEvent {
16
21
  getKeyCode(): number
17
22
  getAction(): number
@@ -19,6 +24,20 @@ interface KeyEvent {
19
24
 
20
25
  /** Keep editing in the screen and let the application own focus after submit. */
21
26
  export class MavisTextField extends TextField {
27
+ _setInputType(value: number) {
28
+ const field = this.android
29
+ const start = field.getSelectionStart(),
30
+ end = field.getSelectionEnd()
31
+ const typeface = field.getTypeface()
32
+ setInputType.call(this, value)
33
+ // Android resets selection and may substitute a monospace face for passwords.
34
+ field.setTypeface(typeface)
35
+ if (start >= 0 && end >= 0) {
36
+ const length = field.getText().length()
37
+ field.setSelection(Math.min(start, length), Math.min(end, length))
38
+ }
39
+ }
40
+
22
41
  [editableProperty.setNative](value: boolean) {
23
42
  setInputEditable(this, value)
24
43
  }
@@ -0,0 +1,53 @@
1
+ import { TextField } from '@nativescript/core'
2
+ import { secureProperty } from '@nativescript/core/ui/text-field/text-field-common'
3
+ import { fontScaleInternalProperty } from '@nativescript/core/ui/styling/style-properties'
4
+ import { applyDynamicType } from './dynamic-type'
5
+
6
+ const setSecure = (TextField.prototype as unknown as Record<symbol, (value: boolean) => void>)[
7
+ secureProperty.setNative
8
+ ]!
9
+
10
+ /** Follows the system text size with the iOS body curve instead of Core's table. */
11
+ export class MavisTextField extends TextField {
12
+ [secureProperty.setNative](value: boolean) {
13
+ const field = this.ios
14
+ const text = field.text
15
+ const selection = field.selectedTextRange
16
+ const start = selection
17
+ ? field.offsetFromPositionToPosition(field.beginningOfDocument, selection.start)
18
+ : null
19
+ const end = selection
20
+ ? field.offsetFromPositionToPosition(field.beginningOfDocument, selection.end)
21
+ : null
22
+ setSecure.call(this, value)
23
+ if (field.isFirstResponder) {
24
+ // Core treats the first secure keystroke as replacing the whole value. This is
25
+ // an existing edit switching visibility, so its next keystroke must use the selection.
26
+ const state = this as unknown as { _firstEdit: boolean }
27
+ state._firstEdit = false
28
+ }
29
+ if (field.isFirstResponder && value && text) {
30
+ // UIKit otherwise clears the secure buffer on the next insertion. Reinsert
31
+ // the existing value without treating it as a new edit in Core's delegate.
32
+ const delegate = field.delegate
33
+ try {
34
+ field.delegate = null
35
+ field.text = ''
36
+ field.insertText(text)
37
+ } finally {
38
+ field.delegate = delegate
39
+ }
40
+ } else {
41
+ field.text = text
42
+ }
43
+ if (start !== null && end !== null) {
44
+ const from = field.positionFromPositionOffset(field.beginningOfDocument, start)
45
+ const to = field.positionFromPositionOffset(field.beginningOfDocument, end)
46
+ if (from && to) field.selectedTextRange = field.textRangeFromPositionToPosition(from, to)
47
+ }
48
+ }
49
+
50
+ [fontScaleInternalProperty.setNative]() {
51
+ applyDynamicType(this)
52
+ }
53
+ }
@@ -0,0 +1,10 @@
1
+ import { TextView } from '@nativescript/core'
2
+ import { fontScaleInternalProperty } from '@nativescript/core/ui/styling/style-properties'
3
+ import { applyDynamicType } from './dynamic-type'
4
+
5
+ /** Follows the system text size with the iOS body curve instead of Core's table. */
6
+ export class MavisTextView extends TextView {
7
+ [fontScaleInternalProperty.setNative]() {
8
+ applyDynamicType(this)
9
+ }
10
+ }
@@ -0,0 +1,9 @@
1
+ import { Application, type View } from '@nativescript/core'
2
+
3
+ export function toastReaderActive(): boolean {
4
+ const manager = Application.android.context?.getSystemService('accessibility')
5
+ return Boolean(manager?.isTouchExplorationEnabled())
6
+ }
7
+ export function announceToast(view: View, message: string) {
8
+ if (view.isLoaded && toastReaderActive()) view.android?.announceForAccessibility(message)
9
+ }
@@ -0,0 +1,13 @@
1
+ import type { View } from '@nativescript/core'
2
+
3
+ declare function UIAccessibilityIsVoiceOverRunning(): boolean
4
+ declare const UIAccessibilityAnnouncementNotification: number
5
+ declare function UIAccessibilityPostNotification(notification: number, argument: unknown): void
6
+
7
+ export function toastReaderActive() {
8
+ return UIAccessibilityIsVoiceOverRunning()
9
+ }
10
+ export function announceToast(view: View, message: string) {
11
+ if (view.isLoaded && toastReaderActive())
12
+ UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, message)
13
+ }
@@ -0,0 +1,6 @@
1
+ import type { View } from '@nativescript/core'
2
+
3
+ export function announceToast(_view: View, _message: string) {}
4
+ export function toastReaderActive(): boolean {
5
+ return false
6
+ }
@@ -0,0 +1,238 @@
1
+ import {
2
+ defineComponent,
3
+ h,
4
+ mergeProps,
5
+ onBeforeUnmount,
6
+ ref,
7
+ registerElement,
8
+ watch,
9
+ } from 'nativescript-vue'
10
+ import type { EventData, TouchGestureEventData, View } from '@nativescript/core'
11
+ import { animate } from '@rafaelaugusto/jolt'
12
+ import { checkboxProps, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
13
+ import { MavisButton } from '../../native/button'
14
+ import { mixedValue, observeCheckbox } from '../../native/checkbox'
15
+ import { MBox, MRow, MColumn } from './layout.js'
16
+ import { MText } from './MText.js'
17
+ import { useNativeViewAttrs } from '../accessibility.js'
18
+
19
+ registerElement('MavisCheckboxButton', () => MavisButton)
20
+ registerElement('MavisRadioButton', () => MavisButton)
21
+
22
+ export const ChoiceControl = defineComponent({
23
+ name: 'ChoiceControl',
24
+ inheritAttrs: false,
25
+ props: { ...checkboxProps, radio: Boolean, pressFeedback: { type: Boolean, default: true } },
26
+ emits: ['activate'],
27
+ setup(props, { attrs, emit }) {
28
+ const { theme } = useMavisTheme()
29
+ const nativeAttrs = useNativeViewAttrs(props)
30
+ const focused = ref(false)
31
+ let mark: View | undefined
32
+ let motion: ReturnType<typeof animate> | undefined
33
+ let observer: ReturnType<typeof observeCheckbox> | undefined
34
+
35
+ function restore() {
36
+ motion?.stop()
37
+ motion = undefined
38
+ if (mark) {
39
+ mark.scaleX = 1
40
+ mark.scaleY = 1
41
+ }
42
+ }
43
+ function unload() {
44
+ restore()
45
+ observer?.dispose()
46
+ observer = undefined
47
+ }
48
+ onBeforeUnmount(unload)
49
+ watch(
50
+ () => props.disabled,
51
+ (disabled) => {
52
+ if (disabled) restore()
53
+ },
54
+ )
55
+ watch(
56
+ [() => props.indeterminate, () => props.indeterminateLabel],
57
+ () => {
58
+ observer?.setMixed(props.indeterminate ? props.indeterminateLabel : undefined)
59
+ },
60
+ { flush: 'post' },
61
+ )
62
+
63
+ function touch(event: TouchGestureEventData) {
64
+ if (!mark || props.disabled) return
65
+ if (!['down', 'up', 'cancel'].includes(event.action)) return
66
+ motion?.stop()
67
+ const scale = event.action === 'down' ? 0.9 : 1
68
+ motion = animate(
69
+ mark,
70
+ { scaleX: scale, scaleY: scale },
71
+ {
72
+ type: 'spring',
73
+ duration: 180,
74
+ bounce: 0,
75
+ },
76
+ )
77
+ }
78
+
79
+ return () => {
80
+ const { colors } = theme.value
81
+ const selected = props.indeterminate || props.modelValue
82
+ return h(
83
+ MBox,
84
+ mergeProps(
85
+ {
86
+ width: props.width,
87
+ grow: props.grow,
88
+ shrink: props.shrink,
89
+ style: {
90
+ minHeight: 48,
91
+ borderWidth: 2,
92
+ borderRadius: 10,
93
+ borderColor: focused.value && !props.disabled ? colors.primary : 'transparent',
94
+ opacity: props.disabled ? 0.45 : 1,
95
+ },
96
+ },
97
+ attrs,
98
+ { accessibilityHidden: props.accessibilityHidden },
99
+ ),
100
+ {
101
+ default: () => [
102
+ h(props.radio ? 'MavisRadioButton' : 'MavisCheckboxButton', {
103
+ ...nativeAttrs(),
104
+ text: '',
105
+ isEnabled: !props.disabled,
106
+ accessible: true,
107
+ accessibilityRole: props.radio ? 'radioButton' : 'checkbox',
108
+ accessibilityState:
109
+ props.modelValue && !props.indeterminate ? 'checked' : 'unchecked',
110
+ accessibilityLabel: props.label,
111
+ accessibilityHint: props.helperText || '',
112
+ accessibilityValue: mixedValue(props.indeterminate, props.indeterminateLabel),
113
+ style: {
114
+ minHeight: 48,
115
+ minWidth: 0,
116
+ margin: 0,
117
+ padding: 0,
118
+ borderWidth: 0,
119
+ backgroundColor: 'transparent',
120
+ androidElevation: 0,
121
+ androidDynamicElevationOffset: 0,
122
+ },
123
+ onTap: () => {
124
+ if (!props.disabled) emit('activate')
125
+ },
126
+ onTouch: props.pressFeedback ? touch : undefined,
127
+ onLoaded: (event: EventData) => {
128
+ unload()
129
+ observer = observeCheckbox(event.object as View, (value) => {
130
+ focused.value = value
131
+ })
132
+ observer.setMixed(props.indeterminate ? props.indeterminateLabel : undefined)
133
+ },
134
+ onUnloaded: unload,
135
+ }),
136
+ h(
137
+ MRow,
138
+ {
139
+ gap: 'md',
140
+ paddingY: 'sm',
141
+ isUserInteractionEnabled: false,
142
+ accessibilityHidden: true,
143
+ },
144
+ {
145
+ default: () => [
146
+ h(
147
+ MBox,
148
+ {
149
+ width: 24,
150
+ height: 24,
151
+ shrink: 0,
152
+ radius: props.radio ? 12 : 7,
153
+ isUserInteractionEnabled: false,
154
+ accessibilityHidden: true,
155
+ style: {
156
+ borderWidth: 2,
157
+ borderColor: selected ? colors.primary : colors.muted,
158
+ backgroundColor: !props.radio && selected ? colors.primary : 'transparent',
159
+ },
160
+ onLoaded: (event: EventData) => {
161
+ mark = event.object as View
162
+ },
163
+ onUnloaded: () => {
164
+ restore()
165
+ mark = undefined
166
+ },
167
+ },
168
+ {
169
+ default: () =>
170
+ selected
171
+ ? h(MBox, {
172
+ width: 12,
173
+ height: props.radio ? 12 : props.indeterminate ? 2 : 7,
174
+ isUserInteractionEnabled: false,
175
+ accessibilityHidden: true,
176
+ style: props.radio
177
+ ? {
178
+ backgroundColor: colors.primary,
179
+ borderRadius: 6,
180
+ horizontalAlignment: 'center',
181
+ verticalAlignment: 'middle',
182
+ }
183
+ : props.indeterminate
184
+ ? {
185
+ backgroundColor: colors.onPrimary,
186
+ borderRadius: 1,
187
+ horizontalAlignment: 'center',
188
+ verticalAlignment: 'middle',
189
+ }
190
+ : {
191
+ borderLeftWidth: 2,
192
+ borderBottomWidth: 2,
193
+ borderColor: colors.onPrimary,
194
+ rotate: -45,
195
+ translateY: -1,
196
+ horizontalAlignment: 'center',
197
+ verticalAlignment: 'middle',
198
+ },
199
+ })
200
+ : null,
201
+ },
202
+ ),
203
+ h(
204
+ MColumn,
205
+ {
206
+ gap: 'xs',
207
+ isUserInteractionEnabled: false,
208
+ accessibilityHidden: true,
209
+ },
210
+ {
211
+ default: () => [
212
+ h(MText, {
213
+ text: props.label,
214
+ accessibilityHidden: true,
215
+ isUserInteractionEnabled: false,
216
+ style: { fontWeight: '600' },
217
+ }),
218
+ props.helperText
219
+ ? h(MText, {
220
+ text: props.helperText,
221
+ variant: 'caption',
222
+ tone: 'muted',
223
+ accessibilityHidden: true,
224
+ isUserInteractionEnabled: false,
225
+ })
226
+ : null,
227
+ ],
228
+ },
229
+ ),
230
+ ],
231
+ },
232
+ ),
233
+ ],
234
+ },
235
+ )
236
+ }
237
+ },
238
+ })
@@ -0,0 +1,123 @@
1
+ import { defineComponent, h, mergeProps, type SlotsType } from 'nativescript-vue'
2
+ import {
3
+ useButtonAction,
4
+ accordionProps,
5
+ accordionEmits,
6
+ useMavisTheme,
7
+ } from '@getcortexlabs/mavis-core/vue'
8
+ import {
9
+ choiceKey,
10
+ validateAccordion,
11
+ toggleAccordion,
12
+ type AccordionPanelProps,
13
+ } from '@getcortexlabs/mavis-core'
14
+ import { MColumn } from './layout.js'
15
+ import { MListItem } from './MListItem.js'
16
+ import { MIcon } from './MIcon.js'
17
+ import { MReveal } from './MReveal.js'
18
+ import { MSeparator } from './MSeparator.js'
19
+
20
+ export const MAccordion = defineComponent({
21
+ name: 'MAccordion',
22
+ inheritAttrs: false,
23
+ props: accordionProps,
24
+ emits: accordionEmits,
25
+ slots: Object as SlotsType<{ default: AccordionPanelProps }>,
26
+ setup(props, { attrs, emit, slots }) {
27
+ useButtonAction()
28
+ const { theme } = useMavisTheme()
29
+ return () => {
30
+ validateAccordion(
31
+ props.items,
32
+ props.modelValue,
33
+ props.multiple,
34
+ props.label,
35
+ props.expandedLabel,
36
+ props.collapsedLabel,
37
+ )
38
+ const { colors } = theme.value
39
+ return h(
40
+ MColumn,
41
+ mergeProps(attrs, {
42
+ id: props.id,
43
+ width: props.width,
44
+ grow: props.grow,
45
+ shrink: props.shrink,
46
+ accessibilityHidden: props.accessibilityHidden,
47
+ gap: 'sm',
48
+ }),
49
+ {
50
+ default: () =>
51
+ props.items.map((item) => {
52
+ const expanded = props.modelValue.includes(item.value)
53
+ return h(
54
+ MColumn,
55
+ {
56
+ key: choiceKey(item.value),
57
+ radius: 'md',
58
+ backgroundColor: colors.surface,
59
+ style: {
60
+ borderWidth: 1,
61
+ borderColor: expanded ? colors.primarySoft : colors.border,
62
+ },
63
+ },
64
+ {
65
+ default: () => [
66
+ h(
67
+ MListItem,
68
+ {
69
+ title: item.title,
70
+ description: item.description,
71
+ interactive: true,
72
+ disabled: props.disabled || item.disabled,
73
+ accessibilityHidden: props.accessibilityHidden,
74
+ accessibilityHint: props.label,
75
+ accessibilityValue: expanded ? props.expandedLabel : props.collapsedLabel,
76
+ onClick() {
77
+ const next = toggleAccordion(
78
+ item,
79
+ props.modelValue,
80
+ props.multiple,
81
+ props.disabled,
82
+ )
83
+ if (next) emit('update:modelValue', next)
84
+ },
85
+ },
86
+ {
87
+ ...(item.icon
88
+ ? {
89
+ leading: () =>
90
+ h(MIcon, {
91
+ name: item.icon!,
92
+ tone: expanded ? 'primary' : 'muted',
93
+ }),
94
+ }
95
+ : {}),
96
+ trailing: () =>
97
+ h(MIcon, {
98
+ name: expanded ? 'chevron-up' : 'chevron-down',
99
+ size: 'sm',
100
+ tone: expanded ? 'primary' : 'muted',
101
+ }),
102
+ },
103
+ ),
104
+ h(
105
+ MReveal,
106
+ {
107
+ show: expanded,
108
+ padding: 'md',
109
+ gap: 'md',
110
+ style: { paddingTop: 0 },
111
+ accessibilityHidden: props.accessibilityHidden,
112
+ },
113
+ { default: () => [h(MSeparator), slots.default?.({ item })] },
114
+ ),
115
+ ],
116
+ },
117
+ )
118
+ }),
119
+ },
120
+ )
121
+ }
122
+ },
123
+ })
@@ -0,0 +1,156 @@
1
+ import { defineComponent, h, mergeProps, onBeforeUnmount, watch } from 'nativescript-vue'
2
+ import type { EventData, View } from '@nativescript/core'
3
+ import { alertProps, alertEmits, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
4
+ import { alertAppearance, checkAlertLabels } from '@getcortexlabs/mavis-core'
5
+ import { announceToast as announceMessage } from '../../native/toast'
6
+ import { ActionChildren, useNativeViewAttrs } from '../accessibility.js'
7
+ import { MBox, MColumn, MRow } from './layout.js'
8
+ import { MText } from './MText.js'
9
+ import { MIcon } from './MIcon.js'
10
+ import { MButton } from './MButton.js'
11
+
12
+ export const MAlert = defineComponent({
13
+ name: 'MAlert',
14
+ inheritAttrs: false,
15
+ props: alertProps,
16
+ emits: alertEmits,
17
+ setup(props, { attrs, slots, emit }) {
18
+ const { theme } = useMavisTheme()
19
+ const nativeAttrs = useNativeViewAttrs(props)
20
+ let content: View | undefined
21
+ let pending: ReturnType<typeof setTimeout> | undefined
22
+ let announced = ''
23
+ const message = () => [props.title, props.description].filter(Boolean).join('\n')
24
+ function announce() {
25
+ clearTimeout(pending)
26
+ if (!props.announce) {
27
+ announced = ''
28
+ return
29
+ }
30
+ pending = setTimeout(() => {
31
+ pending = undefined
32
+ if (!content?.isLoaded || nativeAttrs().accessibilityHidden) return
33
+ const text = message()
34
+ if (text === announced) return
35
+ announceMessage(content, text)
36
+ announced = text
37
+ }, 0)
38
+ }
39
+ function release() {
40
+ clearTimeout(pending)
41
+ pending = undefined
42
+ content = undefined
43
+ }
44
+ watch(
45
+ () => [props.announce, props.title, props.description, nativeAttrs().accessibilityHidden],
46
+ announce,
47
+ { flush: 'post' },
48
+ )
49
+ onBeforeUnmount(release)
50
+ return () => {
51
+ checkAlertLabels(props.title, props.dismissible, props.closeLabel)
52
+ const { colors } = theme.value
53
+ const appearance = alertAppearance[props.tone]
54
+ return h(
55
+ MColumn,
56
+ mergeProps(
57
+ {
58
+ width: props.width,
59
+ grow: props.grow,
60
+ shrink: props.shrink,
61
+ padding: 'md',
62
+ gap: 'md',
63
+ radius: 'md',
64
+ backgroundColor: colors.surface,
65
+ style: {
66
+ borderWidth: 1,
67
+ borderColor: colors[appearance.tone],
68
+ },
69
+ },
70
+ attrs,
71
+ nativeAttrs(),
72
+ { accessible: false },
73
+ ),
74
+ {
75
+ default: () => [
76
+ h(
77
+ MRow,
78
+ { gap: 'sm', align: 'start' },
79
+ {
80
+ default: () => [
81
+ h(
82
+ MBox,
83
+ {
84
+ width: 32,
85
+ height: 32,
86
+ radius: 'sm',
87
+ shrink: 0,
88
+ backgroundColor: colors.elevated,
89
+ },
90
+ {
91
+ default: () =>
92
+ h(MIcon, {
93
+ name: appearance.icon,
94
+ tone: appearance.tone,
95
+ size: 20,
96
+ horizontalAlignment: 'center',
97
+ verticalAlignment: 'middle',
98
+ }),
99
+ },
100
+ ),
101
+ h(
102
+ MColumn,
103
+ {
104
+ width: 0,
105
+ grow: 1,
106
+ gap: 'xs',
107
+ accessible: true,
108
+ accessibilityRole: 'text',
109
+ accessibilityLabel: message(),
110
+ accessibilityHidden: nativeAttrs().accessibilityHidden,
111
+ onLoaded: (event: EventData) => {
112
+ content = event.object as View
113
+ announce()
114
+ },
115
+ onUnloaded: release,
116
+ },
117
+ {
118
+ default: () =>
119
+ h(
120
+ ActionChildren,
121
+ { hidden: true },
122
+ {
123
+ default: () => [
124
+ h(MText, { text: props.title, style: { fontWeight: '600' } }),
125
+ props.description
126
+ ? h(MText, { text: props.description, tone: 'muted' })
127
+ : null,
128
+ ],
129
+ },
130
+ ),
131
+ },
132
+ ),
133
+ props.dismissible
134
+ ? h(MButton, {
135
+ icon: 'x',
136
+ variant: 'ghost',
137
+ size: 'sm',
138
+ accessibilityLabel: props.closeLabel,
139
+ width: 44,
140
+ shrink: 0,
141
+ style: { paddingLeft: 0, paddingRight: 0 },
142
+ onClick: () => emit('close'),
143
+ })
144
+ : null,
145
+ ],
146
+ },
147
+ ),
148
+ slots.actions
149
+ ? h(MRow, { gap: 'sm', wrap: true, align: 'start' }, { default: slots.actions })
150
+ : null,
151
+ ],
152
+ },
153
+ )
154
+ }
155
+ },
156
+ })