@getcortexlabs/mavis 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.
- package/README.md +9 -5
- package/dist/app-icons.d.ts +26 -0
- package/dist/app-icons.d.ts.map +1 -0
- package/dist/app-icons.js +9 -0
- package/dist/app-icons.js.map +1 -0
- package/dist/date-format.d.ts +3 -0
- package/dist/date-format.d.ts.map +1 -0
- package/dist/date-format.js +2 -0
- package/dist/date-format.js.map +1 -0
- package/dist/files.d.ts +4 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +3 -0
- package/dist/files.js.map +1 -0
- package/dist/native/app-icons.android.d.ts +4 -0
- package/dist/native/app-icons.android.d.ts.map +1 -0
- package/dist/native/app-icons.android.js +67 -0
- package/dist/native/app-icons.android.js.map +1 -0
- package/dist/native/app-icons.d.ts +4 -0
- package/dist/native/app-icons.d.ts.map +1 -0
- package/dist/native/app-icons.ios.d.ts +4 -0
- package/dist/native/app-icons.ios.d.ts.map +1 -0
- package/dist/native/app-icons.ios.js +45 -0
- package/dist/native/app-icons.ios.js.map +1 -0
- package/dist/native/app-icons.js +9 -0
- package/dist/native/app-icons.js.map +1 -0
- package/dist/native/appearance.android.d.ts +4 -0
- package/dist/native/appearance.android.d.ts.map +1 -0
- package/dist/native/appearance.android.js +55 -0
- package/dist/native/appearance.android.js.map +1 -0
- package/dist/native/appearance.d.ts +4 -0
- package/dist/native/appearance.d.ts.map +1 -0
- package/dist/native/appearance.js +31 -0
- package/dist/native/appearance.js.map +1 -0
- package/dist/native/avatar-image.d.ts +4 -0
- package/dist/native/avatar-image.d.ts.map +1 -0
- package/dist/native/avatar-image.js +12 -0
- package/dist/native/avatar-image.js.map +1 -0
- package/dist/native/avatar-label.android.d.ts +9 -0
- package/dist/native/avatar-label.android.d.ts.map +1 -0
- package/dist/native/avatar-label.android.js +9 -0
- package/dist/native/avatar-label.android.js.map +1 -0
- package/dist/native/avatar-label.d.ts +2 -0
- package/dist/native/avatar-label.d.ts.map +1 -0
- package/dist/native/avatar-label.js +2 -0
- package/dist/native/avatar-label.js.map +1 -0
- package/dist/native/box.android.d.ts +5 -0
- package/dist/native/box.android.d.ts.map +1 -0
- package/dist/native/box.android.js +7 -0
- package/dist/native/box.android.js.map +1 -0
- package/dist/native/box.d.ts +2 -0
- package/dist/native/box.d.ts.map +1 -0
- package/dist/native/box.ios.d.ts +10 -0
- package/dist/native/box.ios.d.ts.map +1 -0
- package/dist/native/box.ios.js +40 -0
- package/dist/native/box.ios.js.map +1 -0
- package/dist/native/box.js +3 -0
- package/dist/native/box.js.map +1 -0
- package/dist/native/button.android.d.ts +11 -0
- package/dist/native/button.android.d.ts.map +1 -0
- package/dist/native/button.android.js +31 -0
- package/dist/native/button.android.js.map +1 -0
- package/dist/native/button.ios.d.ts +13 -1
- package/dist/native/button.ios.d.ts.map +1 -1
- package/dist/native/button.ios.js +29 -1
- package/dist/native/button.ios.js.map +1 -1
- package/dist/native/checkbox.android.d.ts +7 -0
- package/dist/native/checkbox.android.d.ts.map +1 -0
- package/dist/native/checkbox.android.js +26 -0
- package/dist/native/checkbox.android.js.map +1 -0
- package/dist/native/checkbox.d.ts +7 -0
- package/dist/native/checkbox.d.ts.map +1 -0
- package/dist/native/checkbox.js +7 -0
- package/dist/native/checkbox.js.map +1 -0
- package/dist/native/collection-motion.d.ts +5 -0
- package/dist/native/collection-motion.d.ts.map +1 -0
- package/dist/native/collection-motion.js +157 -0
- package/dist/native/collection-motion.js.map +1 -0
- package/dist/native/combobox-editor.android.d.ts +3 -0
- package/dist/native/combobox-editor.android.d.ts.map +1 -0
- package/dist/native/combobox-editor.android.js +5 -0
- package/dist/native/combobox-editor.android.js.map +1 -0
- package/dist/native/combobox-editor.d.ts +4 -0
- package/dist/native/combobox-editor.d.ts.map +1 -0
- package/dist/native/combobox-editor.js +5 -0
- package/dist/native/combobox-editor.js.map +1 -0
- package/dist/native/composed-button.android.d.ts +4 -0
- package/dist/native/composed-button.android.d.ts.map +1 -0
- package/dist/native/composed-button.android.js +53 -0
- package/dist/native/composed-button.android.js.map +1 -0
- package/dist/native/composed-button.d.ts +3 -0
- package/dist/native/composed-button.d.ts.map +1 -0
- package/dist/native/composed-button.js +4 -0
- package/dist/native/composed-button.js.map +1 -0
- package/dist/native/date-format.android.d.ts +5 -0
- package/dist/native/date-format.android.d.ts.map +1 -0
- package/dist/native/date-format.android.js +39 -0
- package/dist/native/date-format.android.js.map +1 -0
- package/dist/native/date-format.d.ts +6 -0
- package/dist/native/date-format.d.ts.map +1 -0
- package/dist/native/date-format.ios.d.ts +5 -0
- package/dist/native/date-format.ios.d.ts.map +1 -0
- package/dist/native/date-format.ios.js +29 -0
- package/dist/native/date-format.ios.js.map +1 -0
- package/dist/native/date-format.js +8 -0
- package/dist/native/date-format.js.map +1 -0
- package/dist/native/dialog.android.d.ts +12 -0
- package/dist/native/dialog.android.d.ts.map +1 -0
- package/dist/native/dialog.android.js +46 -0
- package/dist/native/dialog.android.js.map +1 -0
- package/dist/native/dialog.d.ts +12 -0
- package/dist/native/dialog.d.ts.map +1 -0
- package/dist/native/dialog.ios.d.ts +12 -0
- package/dist/native/dialog.ios.d.ts.map +1 -0
- package/dist/native/dialog.ios.js +13 -0
- package/dist/native/dialog.ios.js.map +1 -0
- package/dist/native/dialog.js +4 -0
- package/dist/native/dialog.js.map +1 -0
- package/dist/native/dynamic-type.d.ts +15 -0
- package/dist/native/dynamic-type.d.ts.map +1 -0
- package/dist/native/dynamic-type.js +47 -0
- package/dist/native/dynamic-type.js.map +1 -0
- package/dist/native/file-access.d.ts +23 -0
- package/dist/native/file-access.d.ts.map +1 -0
- package/dist/native/file-access.js +55 -0
- package/dist/native/file-access.js.map +1 -0
- package/dist/native/file-picker.android.d.ts +3 -0
- package/dist/native/file-picker.android.d.ts.map +1 -0
- package/dist/native/file-picker.android.js +147 -0
- package/dist/native/file-picker.android.js.map +1 -0
- package/dist/native/file-picker.d.ts +4 -0
- package/dist/native/file-picker.d.ts.map +1 -0
- package/dist/native/file-picker.ios.d.ts +3 -0
- package/dist/native/file-picker.ios.d.ts.map +1 -0
- package/dist/native/file-picker.ios.js +152 -0
- package/dist/native/file-picker.ios.js.map +1 -0
- package/dist/native/file-picker.js +7 -0
- package/dist/native/file-picker.js.map +1 -0
- package/dist/native/flex-children.d.ts +4 -0
- package/dist/native/flex-children.d.ts.map +1 -0
- package/dist/native/flex-children.js +12 -0
- package/dist/native/flex-children.js.map +1 -0
- package/dist/native/flex-layout.android.d.ts +3 -1
- package/dist/native/flex-layout.android.d.ts.map +1 -1
- package/dist/native/flex-layout.android.js +9 -0
- package/dist/native/flex-layout.android.js.map +1 -1
- package/dist/native/flex-layout.ios.d.ts +14 -1
- package/dist/native/flex-layout.ios.d.ts.map +1 -1
- package/dist/native/flex-layout.ios.js +113 -0
- package/dist/native/flex-layout.ios.js.map +1 -1
- package/dist/native/image-effects.d.ts +11 -0
- package/dist/native/image-effects.d.ts.map +1 -0
- package/dist/native/image-effects.js +61 -0
- package/dist/native/image-effects.js.map +1 -0
- package/dist/native/input-action.d.ts +5 -0
- package/dist/native/input-action.d.ts.map +1 -0
- package/dist/native/input-action.js +13 -0
- package/dist/native/input-action.js.map +1 -0
- package/dist/native/keyboard-dismiss.android.d.ts +8 -0
- package/dist/native/keyboard-dismiss.android.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.android.js +9 -0
- package/dist/native/keyboard-dismiss.android.js.map +1 -0
- package/dist/native/keyboard-dismiss.d.ts +10 -0
- package/dist/native/keyboard-dismiss.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.ios.d.ts +8 -0
- package/dist/native/keyboard-dismiss.ios.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.ios.js +91 -0
- package/dist/native/keyboard-dismiss.ios.js.map +1 -0
- package/dist/native/keyboard-dismiss.js +6 -0
- package/dist/native/keyboard-dismiss.js.map +1 -0
- package/dist/native/label.android.d.ts +12 -0
- package/dist/native/label.android.d.ts.map +1 -0
- package/dist/native/label.android.js +19 -0
- package/dist/native/label.android.js.map +1 -0
- package/dist/native/label.ios.d.ts +14 -1
- package/dist/native/label.ios.d.ts.map +1 -1
- package/dist/native/label.ios.js +37 -1
- package/dist/native/label.ios.js.map +1 -1
- package/dist/native/measure-memo.d.ts +37 -0
- package/dist/native/measure-memo.d.ts.map +1 -0
- package/dist/native/measure-memo.js +82 -0
- package/dist/native/measure-memo.js.map +1 -0
- package/dist/native/motion-owner.d.ts +5 -0
- package/dist/native/motion-owner.d.ts.map +1 -0
- package/dist/native/motion-owner.js +58 -0
- package/dist/native/motion-owner.js.map +1 -0
- package/dist/native/motion-region.d.ts +7 -0
- package/dist/native/motion-region.d.ts.map +1 -0
- package/dist/native/motion-region.js +249 -0
- package/dist/native/motion-region.js.map +1 -0
- package/dist/native/motion-surface.d.ts +9 -0
- package/dist/native/motion-surface.d.ts.map +1 -0
- package/dist/native/motion-surface.js +229 -0
- package/dist/native/motion-surface.js.map +1 -0
- package/dist/native/platform-motion.d.ts +5 -0
- package/dist/native/platform-motion.d.ts.map +1 -0
- package/dist/native/platform-motion.js +90 -0
- package/dist/native/platform-motion.js.map +1 -0
- package/dist/native/press.d.ts +8 -2
- package/dist/native/press.d.ts.map +1 -1
- package/dist/native/press.js +58 -8
- package/dist/native/press.js.map +1 -1
- package/dist/native/progress.d.ts +7 -0
- package/dist/native/progress.d.ts.map +1 -0
- package/dist/native/progress.js +77 -0
- package/dist/native/progress.js.map +1 -0
- package/dist/native/screen.android.d.ts +6 -0
- package/dist/native/screen.android.d.ts.map +1 -0
- package/dist/native/screen.android.js +8 -0
- package/dist/native/screen.android.js.map +1 -0
- package/dist/native/screen.d.ts +2 -0
- package/dist/native/screen.d.ts.map +1 -0
- package/dist/native/screen.js +3 -0
- package/dist/native/screen.js.map +1 -0
- package/dist/native/scroll-motion.d.ts +12 -0
- package/dist/native/scroll-motion.d.ts.map +1 -0
- package/dist/native/scroll-motion.js +100 -0
- package/dist/native/scroll-motion.js.map +1 -0
- package/dist/native/section-scroll.d.ts +9 -0
- package/dist/native/section-scroll.d.ts.map +1 -0
- package/dist/native/section-scroll.js +69 -0
- package/dist/native/section-scroll.js.map +1 -0
- package/dist/native/segmented.d.ts +14 -0
- package/dist/native/segmented.d.ts.map +1 -0
- package/dist/native/segmented.js +86 -0
- package/dist/native/segmented.js.map +1 -0
- package/dist/native/sheet.android.d.ts +18 -0
- package/dist/native/sheet.android.d.ts.map +1 -0
- package/dist/native/sheet.android.js +16 -0
- package/dist/native/sheet.android.js.map +1 -0
- package/dist/native/sheet.d.ts +21 -0
- package/dist/native/sheet.d.ts.map +1 -0
- package/dist/native/sheet.ios.d.ts +19 -0
- package/dist/native/sheet.ios.d.ts.map +1 -0
- package/dist/native/sheet.ios.js +41 -0
- package/dist/native/sheet.ios.js.map +1 -0
- package/dist/native/sheet.js +17 -0
- package/dist/native/sheet.js.map +1 -0
- package/dist/native/surface-effects.d.ts +4 -0
- package/dist/native/surface-effects.d.ts.map +1 -0
- package/dist/native/surface-effects.js +31 -0
- package/dist/native/surface-effects.js.map +1 -0
- package/dist/native/tabs.android.d.ts +3 -0
- package/dist/native/tabs.android.d.ts.map +1 -0
- package/dist/native/tabs.android.js +29 -0
- package/dist/native/tabs.android.js.map +1 -0
- package/dist/native/tabs.d.ts +3 -0
- package/dist/native/tabs.d.ts.map +1 -0
- package/dist/native/tabs.js +4 -0
- package/dist/native/tabs.js.map +1 -0
- package/dist/native/text-field.android.d.ts +1 -0
- package/dist/native/text-field.android.d.ts.map +1 -1
- package/dist/native/text-field.android.js +13 -0
- package/dist/native/text-field.android.js.map +1 -1
- package/dist/native/text-field.ios.d.ts +9 -0
- package/dist/native/text-field.ios.d.ts.map +1 -0
- package/dist/native/text-field.ios.js +52 -0
- package/dist/native/text-field.ios.js.map +1 -0
- package/dist/native/text-view.ios.d.ts +7 -0
- package/dist/native/text-view.ios.d.ts.map +1 -0
- package/dist/native/text-view.ios.js +10 -0
- package/dist/native/text-view.ios.js.map +1 -0
- package/dist/native/toast.android.d.ts +4 -0
- package/dist/native/toast.android.d.ts.map +1 -0
- package/dist/native/toast.android.js +10 -0
- package/dist/native/toast.android.js.map +1 -0
- package/dist/native/toast.d.ts +4 -0
- package/dist/native/toast.d.ts.map +1 -0
- package/dist/native/toast.ios.d.ts +4 -0
- package/dist/native/toast.ios.d.ts.map +1 -0
- package/dist/native/toast.ios.js +8 -0
- package/dist/native/toast.ios.js.map +1 -0
- package/dist/native/toast.js +5 -0
- package/dist/native/toast.js.map +1 -0
- package/dist/native/visual-effects.d.ts +5 -0
- package/dist/native/visual-effects.d.ts.map +1 -0
- package/dist/native/visual-effects.js +126 -0
- package/dist/native/visual-effects.js.map +1 -0
- package/dist/vue/components/ChoiceControl.d.ts +111 -0
- package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
- package/dist/vue/components/ChoiceControl.js +211 -0
- package/dist/vue/components/ChoiceControl.js.map +1 -0
- package/dist/vue/components/DateCalendar.d.ts +94 -0
- package/dist/vue/components/DateCalendar.d.ts.map +1 -0
- package/dist/vue/components/DateCalendar.js +96 -0
- package/dist/vue/components/DateCalendar.js.map +1 -0
- package/dist/vue/components/LoadingDecoration.d.ts +116 -0
- package/dist/vue/components/LoadingDecoration.d.ts.map +1 -0
- package/dist/vue/components/LoadingDecoration.js +34 -0
- package/dist/vue/components/LoadingDecoration.js.map +1 -0
- package/dist/vue/components/MAccordion.d.ts +119 -0
- package/dist/vue/components/MAccordion.d.ts.map +1 -0
- package/dist/vue/components/MAccordion.js +83 -0
- package/dist/vue/components/MAccordion.js.map +1 -0
- package/dist/vue/components/MAlert.d.ts +109 -0
- package/dist/vue/components/MAlert.d.ts.map +1 -0
- package/dist/vue/components/MAlert.js +126 -0
- package/dist/vue/components/MAlert.js.map +1 -0
- package/dist/vue/components/MAvatar.d.ts +80 -0
- package/dist/vue/components/MAvatar.d.ts.map +1 -0
- package/dist/vue/components/MAvatar.js +86 -0
- package/dist/vue/components/MAvatar.js.map +1 -0
- package/dist/vue/components/MBadge.d.ts +70 -0
- package/dist/vue/components/MBadge.d.ts.map +1 -0
- package/dist/vue/components/MBadge.js +30 -0
- package/dist/vue/components/MBadge.js.map +1 -0
- package/dist/vue/components/MButton.d.ts +212 -32
- package/dist/vue/components/MButton.d.ts.map +1 -1
- package/dist/vue/components/MButton.js +192 -20
- package/dist/vue/components/MButton.js.map +1 -1
- package/dist/vue/components/MCard.d.ts +113 -21
- package/dist/vue/components/MCard.d.ts.map +1 -1
- package/dist/vue/components/MCard.js +24 -6
- package/dist/vue/components/MCard.js.map +1 -1
- package/dist/vue/components/MCheckbox.d.ts +103 -0
- package/dist/vue/components/MCheckbox.d.ts.map +1 -0
- package/dist/vue/components/MCheckbox.js +26 -0
- package/dist/vue/components/MCheckbox.js.map +1 -0
- package/dist/vue/components/MChip.d.ts +117 -0
- package/dist/vue/components/MChip.d.ts.map +1 -0
- package/dist/vue/components/MChip.js +120 -0
- package/dist/vue/components/MChip.js.map +1 -0
- package/dist/vue/components/MCombobox.d.ts +279 -0
- package/dist/vue/components/MCombobox.d.ts.map +1 -0
- package/dist/vue/components/MCombobox.js +234 -0
- package/dist/vue/components/MCombobox.js.map +1 -0
- package/dist/vue/components/MDatePicker.d.ts +1350 -0
- package/dist/vue/components/MDatePicker.d.ts.map +1 -0
- package/dist/vue/components/MDatePicker.js +25 -0
- package/dist/vue/components/MDatePicker.js.map +1 -0
- package/dist/vue/components/MDialog.d.ts +100 -0
- package/dist/vue/components/MDialog.d.ts.map +1 -0
- package/dist/vue/components/MDialog.js +245 -0
- package/dist/vue/components/MDialog.js.map +1 -0
- package/dist/vue/components/MEmptyState.d.ts +117 -0
- package/dist/vue/components/MEmptyState.d.ts.map +1 -0
- package/dist/vue/components/MEmptyState.js +79 -0
- package/dist/vue/components/MEmptyState.js.map +1 -0
- package/dist/vue/components/MFilePicker.d.ts +112 -0
- package/dist/vue/components/MFilePicker.d.ts.map +1 -0
- package/dist/vue/components/MFilePicker.js +196 -0
- package/dist/vue/components/MFilePicker.js.map +1 -0
- package/dist/vue/components/MGrid.d.ts +165 -0
- package/dist/vue/components/MGrid.d.ts.map +1 -0
- package/dist/vue/components/MGrid.js +52 -0
- package/dist/vue/components/MGrid.js.map +1 -0
- package/dist/vue/components/MIcon.d.ts +75 -0
- package/dist/vue/components/MIcon.d.ts.map +1 -0
- package/dist/vue/components/MIcon.js +45 -0
- package/dist/vue/components/MIcon.js.map +1 -0
- package/dist/vue/components/MImage.d.ts +248 -0
- package/dist/vue/components/MImage.d.ts.map +1 -0
- package/dist/vue/components/MImage.js +157 -0
- package/dist/vue/components/MImage.js.map +1 -0
- package/dist/vue/components/MInput.d.ts +195 -50
- package/dist/vue/components/MInput.d.ts.map +1 -1
- package/dist/vue/components/MInput.js +134 -20
- package/dist/vue/components/MInput.js.map +1 -1
- package/dist/vue/components/MLink.d.ts +120 -0
- package/dist/vue/components/MLink.d.ts.map +1 -0
- package/dist/vue/components/MLink.js +76 -0
- package/dist/vue/components/MLink.js.map +1 -0
- package/dist/vue/components/MListItem.d.ts +106 -0
- package/dist/vue/components/MListItem.d.ts.map +1 -0
- package/dist/vue/components/MListItem.js +53 -0
- package/dist/vue/components/MListItem.js.map +1 -0
- package/dist/vue/components/MPopover.d.ts +106 -0
- package/dist/vue/components/MPopover.d.ts.map +1 -0
- package/dist/vue/components/MPopover.js +209 -0
- package/dist/vue/components/MPopover.js.map +1 -0
- package/dist/vue/components/MProgress.d.ts +122 -0
- package/dist/vue/components/MProgress.d.ts.map +1 -0
- package/dist/vue/components/MProgress.js +75 -0
- package/dist/vue/components/MProgress.js.map +1 -0
- package/dist/vue/components/MRadioGroup.d.ts +103 -0
- package/dist/vue/components/MRadioGroup.d.ts.map +1 -0
- package/dist/vue/components/MRadioGroup.js +57 -0
- package/dist/vue/components/MRadioGroup.js.map +1 -0
- package/dist/vue/components/MReveal.d.ts +73 -37
- package/dist/vue/components/MReveal.d.ts.map +1 -1
- package/dist/vue/components/MReveal.js +80 -37
- package/dist/vue/components/MReveal.js.map +1 -1
- package/dist/vue/components/MScreen.d.ts +42 -8
- package/dist/vue/components/MScreen.d.ts.map +1 -1
- package/dist/vue/components/MScreen.js +91 -6
- package/dist/vue/components/MScreen.js.map +1 -1
- package/dist/vue/components/MSegmentedControl.d.ts +95 -0
- package/dist/vue/components/MSegmentedControl.d.ts.map +1 -0
- package/dist/vue/components/MSegmentedControl.js +172 -0
- package/dist/vue/components/MSegmentedControl.js.map +1 -0
- package/dist/vue/components/MSelect.d.ts +140 -0
- package/dist/vue/components/MSelect.d.ts.map +1 -0
- package/dist/vue/components/MSelect.js +158 -0
- package/dist/vue/components/MSelect.js.map +1 -0
- package/dist/vue/components/MSeparator.d.ts +56 -0
- package/dist/vue/components/MSeparator.d.ts.map +1 -0
- package/dist/vue/components/MSeparator.js +36 -0
- package/dist/vue/components/MSeparator.js.map +1 -0
- package/dist/vue/components/MSheet.d.ts +116 -0
- package/dist/vue/components/MSheet.d.ts.map +1 -0
- package/dist/vue/components/MSheet.js +313 -0
- package/dist/vue/components/MSheet.js.map +1 -0
- package/dist/vue/components/MSkeleton.d.ts +89 -0
- package/dist/vue/components/MSkeleton.d.ts.map +1 -0
- package/dist/vue/components/MSkeleton.js +89 -0
- package/dist/vue/components/MSkeleton.js.map +1 -0
- package/dist/vue/components/MSlider.d.ts +8 -4
- package/dist/vue/components/MSlider.d.ts.map +1 -1
- package/dist/vue/components/MSlider.js +3 -2
- package/dist/vue/components/MSlider.js.map +1 -1
- package/dist/vue/components/MStack.d.ts +199 -0
- package/dist/vue/components/MStack.d.ts.map +1 -0
- package/dist/vue/components/MStack.js +62 -0
- package/dist/vue/components/MStack.js.map +1 -0
- package/dist/vue/components/MSwitch.d.ts +89 -0
- package/dist/vue/components/MSwitch.d.ts.map +1 -0
- package/dist/vue/components/MSwitch.js +173 -0
- package/dist/vue/components/MSwitch.js.map +1 -0
- package/dist/vue/components/MTabs.d.ts +101 -0
- package/dist/vue/components/MTabs.d.ts.map +1 -0
- package/dist/vue/components/MTabs.js +245 -0
- package/dist/vue/components/MTabs.js.map +1 -0
- package/dist/vue/components/MText.d.ts +61 -25
- package/dist/vue/components/MText.d.ts.map +1 -1
- package/dist/vue/components/MText.js +47 -19
- package/dist/vue/components/MText.js.map +1 -1
- package/dist/vue/components/MTimePicker.d.ts +655 -0
- package/dist/vue/components/MTimePicker.d.ts.map +1 -0
- package/dist/vue/components/MTimePicker.js +50 -0
- package/dist/vue/components/MTimePicker.js.map +1 -0
- package/dist/vue/components/MToast.d.ts +23 -0
- package/dist/vue/components/MToast.d.ts.map +1 -0
- package/dist/vue/components/MToast.js +242 -0
- package/dist/vue/components/MToast.js.map +1 -0
- package/dist/vue/components/MVirtualList.d.ts +3 -0
- package/dist/vue/components/MVirtualList.d.ts.map +1 -0
- package/dist/vue/components/MVirtualList.js +88 -0
- package/dist/vue/components/MVirtualList.js.map +1 -0
- package/dist/vue/components/configurator.d.ts +541 -0
- package/dist/vue/components/configurator.d.ts.map +1 -0
- package/dist/vue/components/configurator.js +24 -0
- package/dist/vue/components/configurator.js.map +1 -0
- package/dist/vue/components/layout.d.ts +230 -88
- package/dist/vue/components/layout.d.ts.map +1 -1
- package/dist/vue/components/layout.js +16 -9
- package/dist/vue/components/layout.js.map +1 -1
- package/dist/vue/components/navigation.d.ts +225 -0
- package/dist/vue/components/navigation.d.ts.map +1 -0
- package/dist/vue/components/navigation.js +16 -0
- package/dist/vue/components/navigation.js.map +1 -0
- package/dist/vue/components/workflows.d.ts +251 -0
- package/dist/vue/components/workflows.d.ts.map +1 -0
- package/dist/vue/components/workflows.js +35 -0
- package/dist/vue/components/workflows.js.map +1 -0
- package/dist/vue/index.d.ts +50 -9
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +89 -7
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/layers.d.ts +19 -0
- package/dist/vue/layers.d.ts.map +1 -0
- package/dist/vue/layers.js +26 -0
- package/dist/vue/layers.js.map +1 -0
- package/dist/vue/native-view.d.ts +6 -0
- package/dist/vue/native-view.d.ts.map +1 -0
- package/dist/vue/native-view.js +5 -0
- package/dist/vue/native-view.js.map +1 -0
- package/dist/vue/navigation.d.ts +4 -0
- package/dist/vue/navigation.d.ts.map +1 -0
- package/dist/vue/navigation.js +16 -0
- package/dist/vue/navigation.js.map +1 -0
- package/dist/vue/props.d.ts +12 -11
- package/dist/vue/props.d.ts.map +1 -1
- package/dist/vue/props.js +25 -10
- package/dist/vue/props.js.map +1 -1
- package/dist/vue/router-navigation.d.ts +25 -0
- package/dist/vue/router-navigation.d.ts.map +1 -0
- package/dist/vue/router-navigation.js +15 -0
- package/dist/vue/router-navigation.js.map +1 -0
- package/dist/vue/services.d.ts +16 -0
- package/dist/vue/services.d.ts.map +1 -0
- package/dist/vue/services.js +23 -0
- package/dist/vue/services.js.map +1 -0
- package/dist/vue/system-back.d.ts +11 -0
- package/dist/vue/system-back.d.ts.map +1 -0
- package/dist/vue/system-back.js +2 -0
- package/dist/vue/system-back.js.map +1 -0
- package/dist/vue/use-choice-paint.d.ts +9 -0
- package/dist/vue/use-choice-paint.d.ts.map +1 -0
- package/dist/vue/use-choice-paint.js +32 -0
- package/dist/vue/use-choice-paint.js.map +1 -0
- package/dist/vue/use-motion-region.d.ts +7 -0
- package/dist/vue/use-motion-region.d.ts.map +1 -0
- package/dist/vue/use-motion-region.js +28 -0
- package/dist/vue/use-motion-region.js.map +1 -0
- package/dist/vue/use-motion-surface.d.ts +8 -0
- package/dist/vue/use-motion-surface.d.ts.map +1 -0
- package/dist/vue/use-motion-surface.js +105 -0
- package/dist/vue/use-motion-surface.js.map +1 -0
- package/dist/vue/use-press.d.ts +1 -1
- package/dist/vue/use-press.d.ts.map +1 -1
- package/dist/vue/use-press.js +13 -5
- package/dist/vue/use-press.js.map +1 -1
- package/dist/vue/use-scroll-motion.d.ts +7 -0
- package/dist/vue/use-scroll-motion.d.ts.map +1 -0
- package/dist/vue/use-scroll-motion.js +30 -0
- package/dist/vue/use-scroll-motion.js.map +1 -0
- package/fonts/LICENSE +45 -0
- package/fonts/lucide.ttf +0 -0
- package/package.json +20 -4
- package/platforms/android/java/com/mavis/ui/Box.java +65 -0
- package/platforms/android/java/com/mavis/ui/ContentWidth.java +77 -0
- package/platforms/android/java/com/mavis/ui/FlexLayout.java +101 -4
- package/platforms/android/java/com/mavis/ui/MeasureMemo.java +145 -0
- package/platforms/android/java/com/mavis/ui/Screen.java +108 -0
- package/src/app-icons.ts +21 -0
- package/src/date-format.ts +2 -0
- package/src/files.ts +3 -0
- package/src/native/app-icons.android.ts +95 -0
- package/src/native/app-icons.ios.ts +74 -0
- package/src/native/app-icons.ts +12 -0
- package/src/native/appearance.android.ts +75 -0
- package/src/native/appearance.ts +33 -0
- package/src/native/avatar-image.ts +9 -0
- package/src/native/avatar-label.android.ts +14 -0
- package/src/native/avatar-label.ts +1 -0
- package/src/native/box.android.ts +11 -0
- package/src/native/box.ios.ts +61 -0
- package/src/native/box.ts +2 -0
- package/src/native/button.android.ts +38 -0
- package/src/native/button.ios.ts +53 -1
- package/src/native/checkbox.android.ts +35 -0
- package/src/native/checkbox.ts +9 -0
- package/src/native/collection-motion.ts +166 -0
- package/src/native/combobox-editor.android.ts +11 -0
- package/src/native/combobox-editor.ts +6 -0
- package/src/native/composed-button.android.ts +74 -0
- package/src/native/composed-button.ts +9 -0
- package/src/native/date-format.android.ts +72 -0
- package/src/native/date-format.ios.ts +54 -0
- package/src/native/date-format.ts +17 -0
- package/src/native/dialog.android.ts +56 -0
- package/src/native/dialog.ios.ts +23 -0
- package/src/native/dialog.ts +10 -0
- package/src/native/dynamic-type.ts +71 -0
- package/src/native/file-access.ts +71 -0
- package/src/native/file-picker.android.ts +191 -0
- package/src/native/file-picker.ios.ts +230 -0
- package/src/native/file-picker.ts +8 -0
- package/src/native/flex-children.ts +12 -0
- package/src/native/flex-layout.android.ts +12 -1
- package/src/native/flex-layout.ios.ts +148 -1
- package/src/native/image-effects.ts +71 -0
- package/src/native/input-action.ts +15 -0
- package/src/native/keyboard-dismiss.android.ts +17 -0
- package/src/native/keyboard-dismiss.ios.ts +124 -0
- package/src/native/keyboard-dismiss.ts +14 -0
- package/src/native/label.android.ts +27 -0
- package/src/native/label.ios.ts +54 -1
- package/src/native/measure-memo.ts +116 -0
- package/src/native/motion-owner.ts +66 -0
- package/src/native/motion-region.ts +293 -0
- package/src/native/motion-surface.ts +273 -0
- package/src/native/platform-motion.ts +103 -0
- package/src/native/press.ts +58 -10
- package/src/native/progress.ts +78 -0
- package/src/native/screen.android.ts +12 -0
- package/src/native/screen.ts +2 -0
- package/src/native/scroll-motion.ts +106 -0
- package/src/native/section-scroll.ts +81 -0
- package/src/native/segmented.ts +95 -0
- package/src/native/sheet.android.ts +24 -0
- package/src/native/sheet.ios.ts +52 -0
- package/src/native/sheet.ts +26 -0
- package/src/native/surface-effects.ts +33 -0
- package/src/native/tabs.android.ts +58 -0
- package/src/native/tabs.ts +8 -0
- package/src/native/text-field.android.ts +19 -0
- package/src/native/text-field.ios.ts +53 -0
- package/src/native/text-view.ios.ts +10 -0
- package/src/native/toast.android.ts +9 -0
- package/src/native/toast.ios.ts +13 -0
- package/src/native/toast.ts +6 -0
- package/src/native/visual-effects.ts +147 -0
- package/src/vue/components/ChoiceControl.ts +258 -0
- package/src/vue/components/DateCalendar.ts +117 -0
- package/src/vue/components/LoadingDecoration.ts +38 -0
- package/src/vue/components/MAccordion.ts +123 -0
- package/src/vue/components/MAlert.ts +156 -0
- package/src/vue/components/MAvatar.ts +103 -0
- package/src/vue/components/MBadge.ts +34 -0
- package/src/vue/components/MButton.ts +255 -18
- package/src/vue/components/MCard.ts +44 -5
- package/src/vue/components/MCheckbox.ts +25 -0
- package/src/vue/components/MChip.ts +134 -0
- package/src/vue/components/MCombobox.ts +257 -0
- package/src/vue/components/MDatePicker.ts +25 -0
- package/src/vue/components/MDialog.ts +312 -0
- package/src/vue/components/MEmptyState.ts +96 -0
- package/src/vue/components/MFilePicker.ts +226 -0
- package/src/vue/components/MGrid.ts +86 -0
- package/src/vue/components/MIcon.ts +53 -0
- package/src/vue/components/MImage.ts +181 -0
- package/src/vue/components/MInput.ts +143 -21
- package/src/vue/components/MLink.ts +99 -0
- package/src/vue/components/MListItem.ts +66 -0
- package/src/vue/components/MPopover.ts +254 -0
- package/src/vue/components/MProgress.ts +94 -0
- package/src/vue/components/MRadioGroup.ts +64 -0
- package/src/vue/components/MReveal.ts +89 -48
- package/src/vue/components/MScreen.ts +122 -6
- package/src/vue/components/MSegmentedControl.ts +214 -0
- package/src/vue/components/MSelect.ts +185 -0
- package/src/vue/components/MSeparator.ts +40 -0
- package/src/vue/components/MSheet.ts +375 -0
- package/src/vue/components/MSkeleton.ts +102 -0
- package/src/vue/components/MSlider.ts +8 -2
- package/src/vue/components/MStack.ts +83 -0
- package/src/vue/components/MSwitch.ts +200 -0
- package/src/vue/components/MTabs.ts +302 -0
- package/src/vue/components/MText.ts +48 -10
- package/src/vue/components/MTimePicker.ts +57 -0
- package/src/vue/components/MToast.ts +289 -0
- package/src/vue/components/MVirtualList.ts +120 -0
- package/src/vue/components/configurator.ts +27 -0
- package/src/vue/components/layout.ts +24 -9
- package/src/vue/components/navigation.ts +19 -0
- package/src/vue/components/workflows.ts +38 -0
- package/src/vue/index.ts +183 -22
- package/src/vue/layers.ts +48 -0
- package/src/vue/native-view.ts +6 -0
- package/src/vue/navigation.ts +15 -0
- package/src/vue/props.ts +37 -12
- package/src/vue/router-navigation.ts +39 -0
- package/src/vue/services.ts +39 -0
- package/src/vue/system-back.ts +12 -0
- package/src/vue/use-choice-paint.ts +39 -0
- package/src/vue/use-motion-region.ts +29 -0
- package/src/vue/use-motion-surface.ts +115 -0
- package/src/vue/use-press.ts +13 -5
- package/src/vue/use-scroll-motion.ts +31 -0
- package/dist/native/input-description.android.d.ts +0 -4
- package/dist/native/input-description.android.d.ts.map +0 -1
- package/dist/native/input-description.android.js +0 -18
- package/dist/native/input-description.android.js.map +0 -1
- package/dist/theme/resolve.d.ts +0 -3
- package/dist/theme/resolve.d.ts.map +0 -1
- package/dist/theme/resolve.js +0 -8
- package/dist/theme/resolve.js.map +0 -1
- package/dist/theme/themes.d.ts +0 -6
- package/dist/theme/themes.d.ts.map +0 -1
- package/dist/theme/themes.js +0 -83
- package/dist/theme/themes.js.map +0 -1
- package/dist/theme/types.d.ts +0 -50
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/types.js +0 -2
- package/dist/theme/types.js.map +0 -1
- package/dist/vue/global-components.d.ts +0 -21
- package/dist/vue/global-components.d.ts.map +0 -1
- package/dist/vue/global-components.js +0 -2
- package/dist/vue/global-components.js.map +0 -1
- package/dist/vue/layout-context.d.ts +0 -5
- package/dist/vue/layout-context.d.ts.map +0 -1
- package/dist/vue/layout-context.js +0 -7
- package/dist/vue/layout-context.js.map +0 -1
- package/dist/vue/text-content.d.ts +0 -4
- package/dist/vue/text-content.d.ts.map +0 -1
- package/dist/vue/text-content.js +0 -17
- package/dist/vue/text-content.js.map +0 -1
- package/dist/vue/theme.d.ts +0 -177
- package/dist/vue/theme.d.ts.map +0 -1
- package/dist/vue/theme.js +0 -17
- package/dist/vue/theme.js.map +0 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
mergeProps,
|
|
6
|
+
onBeforeUnmount,
|
|
7
|
+
ref,
|
|
8
|
+
watch,
|
|
9
|
+
} from 'nativescript-vue'
|
|
10
|
+
import { Utils, isAndroid, type EventData, type View } from '@nativescript/core'
|
|
11
|
+
import { canChoose, choiceKey, validateChoices, type ChoiceOption } from '@getcortexlabs/mavis-core'
|
|
12
|
+
import {
|
|
13
|
+
useButtonAction,
|
|
14
|
+
selectProps,
|
|
15
|
+
selectEmits,
|
|
16
|
+
useMavisTheme,
|
|
17
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
18
|
+
import { observeCheckbox } from '../../native/checkbox'
|
|
19
|
+
import { MColumn, MBox } from './layout.js'
|
|
20
|
+
import { MText } from './MText.js'
|
|
21
|
+
import { MButton } from './MButton.js'
|
|
22
|
+
import { MIcon } from './MIcon.js'
|
|
23
|
+
import { MSheet } from './MSheet.js'
|
|
24
|
+
import { ChoiceControl } from './ChoiceControl.js'
|
|
25
|
+
|
|
26
|
+
export const MSelect = defineComponent({
|
|
27
|
+
name: 'MSelect',
|
|
28
|
+
inheritAttrs: false,
|
|
29
|
+
props: selectProps,
|
|
30
|
+
emits: selectEmits,
|
|
31
|
+
setup(props, { attrs, emit }) {
|
|
32
|
+
useButtonAction()
|
|
33
|
+
const { theme } = useMavisTheme()
|
|
34
|
+
const open = ref(false)
|
|
35
|
+
const focused = ref(false)
|
|
36
|
+
let observer: ReturnType<typeof observeCheckbox> | undefined
|
|
37
|
+
const options = computed(() => {
|
|
38
|
+
validateChoices(props.options, props.modelValue)
|
|
39
|
+
return props.options
|
|
40
|
+
})
|
|
41
|
+
function unload() {
|
|
42
|
+
open.value = false
|
|
43
|
+
observer?.dispose()
|
|
44
|
+
observer = undefined
|
|
45
|
+
focused.value = false
|
|
46
|
+
}
|
|
47
|
+
onBeforeUnmount(unload)
|
|
48
|
+
watch(
|
|
49
|
+
() => props.disabled,
|
|
50
|
+
(disabled) => {
|
|
51
|
+
if (disabled) open.value = false
|
|
52
|
+
},
|
|
53
|
+
)
|
|
54
|
+
function show() {
|
|
55
|
+
if (props.disabled || open.value) return
|
|
56
|
+
Utils.dismissKeyboard()
|
|
57
|
+
open.value = true
|
|
58
|
+
}
|
|
59
|
+
function choose(option: ChoiceOption) {
|
|
60
|
+
// Resolve the live option again: removal or disabling while open must win over an old tap.
|
|
61
|
+
const current = options.value.find((item) => item.value === option.value)
|
|
62
|
+
if (!open.value || props.disabled || !current || current.disabled) return
|
|
63
|
+
if (canChoose(current, props.modelValue)) emit('update:modelValue', current.value)
|
|
64
|
+
open.value = false
|
|
65
|
+
}
|
|
66
|
+
return () => {
|
|
67
|
+
const { colors, typography } = theme.value
|
|
68
|
+
const selected = options.value.find((option) => option.value === props.modelValue)
|
|
69
|
+
const message = props.error || props.helperText
|
|
70
|
+
const active = open.value || focused.value
|
|
71
|
+
return h(
|
|
72
|
+
MColumn,
|
|
73
|
+
mergeProps(attrs, {
|
|
74
|
+
width: props.width,
|
|
75
|
+
grow: props.grow,
|
|
76
|
+
shrink: props.shrink,
|
|
77
|
+
gap: 'sm',
|
|
78
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
79
|
+
onUnloaded: unload,
|
|
80
|
+
}),
|
|
81
|
+
{
|
|
82
|
+
default: () => [
|
|
83
|
+
h(MText, {
|
|
84
|
+
text: props.label,
|
|
85
|
+
variant: 'caption',
|
|
86
|
+
style: { fontWeight: '600' },
|
|
87
|
+
accessibilityHidden: true,
|
|
88
|
+
onTap: show,
|
|
89
|
+
}),
|
|
90
|
+
h(
|
|
91
|
+
MBox,
|
|
92
|
+
{},
|
|
93
|
+
{
|
|
94
|
+
default: () => [
|
|
95
|
+
h(MButton, {
|
|
96
|
+
id: props.id,
|
|
97
|
+
text: selected?.label ?? props.placeholder,
|
|
98
|
+
variant: 'secondary',
|
|
99
|
+
disabled: props.disabled,
|
|
100
|
+
accessibilityLabel: props.label,
|
|
101
|
+
accessibilityHint: message,
|
|
102
|
+
style: {
|
|
103
|
+
textAlignment: 'left',
|
|
104
|
+
fontSize: typography.body.fontSize,
|
|
105
|
+
fontWeight: '400',
|
|
106
|
+
paddingLeft: 16,
|
|
107
|
+
paddingRight: 48,
|
|
108
|
+
paddingTop: 14,
|
|
109
|
+
paddingBottom: 14,
|
|
110
|
+
backgroundColor: colors.surface,
|
|
111
|
+
color: selected ? colors.text : colors.muted,
|
|
112
|
+
borderWidth: 2,
|
|
113
|
+
borderColor: props.error
|
|
114
|
+
? colors.danger
|
|
115
|
+
: active
|
|
116
|
+
? colors.primary
|
|
117
|
+
: colors.border,
|
|
118
|
+
},
|
|
119
|
+
onClick: show,
|
|
120
|
+
onLoaded: (event: EventData) => {
|
|
121
|
+
observer?.dispose()
|
|
122
|
+
observer = observeCheckbox(event.object as View, (value) => {
|
|
123
|
+
focused.value = value
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
onUnloaded: unload,
|
|
127
|
+
}),
|
|
128
|
+
h(MIcon, {
|
|
129
|
+
name: 'chevron-down',
|
|
130
|
+
tone: props.error ? 'danger' : active ? 'primary' : 'muted',
|
|
131
|
+
isUserInteractionEnabled: false,
|
|
132
|
+
style: {
|
|
133
|
+
horizontalAlignment: 'right',
|
|
134
|
+
verticalAlignment: 'middle',
|
|
135
|
+
marginRight: 16,
|
|
136
|
+
opacity: props.disabled ? 0.45 : 1,
|
|
137
|
+
},
|
|
138
|
+
}),
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
),
|
|
142
|
+
message
|
|
143
|
+
? h(MText, {
|
|
144
|
+
text: message,
|
|
145
|
+
variant: 'caption',
|
|
146
|
+
tone: props.error ? 'danger' : 'muted',
|
|
147
|
+
})
|
|
148
|
+
: null,
|
|
149
|
+
h(
|
|
150
|
+
MSheet,
|
|
151
|
+
{
|
|
152
|
+
open: open.value,
|
|
153
|
+
title: props.label,
|
|
154
|
+
closeLabel: props.closeLabel,
|
|
155
|
+
gap: 'sm',
|
|
156
|
+
'onUpdate:open': (value: boolean) => {
|
|
157
|
+
open.value = value && !props.disabled
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
default: () =>
|
|
162
|
+
options.value.length
|
|
163
|
+
? options.value.map((option) =>
|
|
164
|
+
h(ChoiceControl, {
|
|
165
|
+
key: choiceKey(option.value),
|
|
166
|
+
radio: true,
|
|
167
|
+
// Mark feedback blocks drags from reaching the nested Android ScrollView.
|
|
168
|
+
// Keep the native button gesture there; the field and Sheet still animate.
|
|
169
|
+
pressFeedback: !isAndroid,
|
|
170
|
+
label: option.label,
|
|
171
|
+
helperText: option.helperText,
|
|
172
|
+
modelValue: option.value === props.modelValue,
|
|
173
|
+
disabled: props.disabled || option.disabled,
|
|
174
|
+
onActivate: () => choose(option),
|
|
175
|
+
}),
|
|
176
|
+
)
|
|
177
|
+
: h(MText, { text: props.emptyText, tone: 'muted' }),
|
|
178
|
+
},
|
|
179
|
+
),
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineComponent, h, mergeProps } from 'nativescript-vue'
|
|
2
|
+
import { separatorProps, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
|
|
3
|
+
import { resolveSpace } from '@getcortexlabs/mavis-core'
|
|
4
|
+
import { MBox } from './layout.js'
|
|
5
|
+
|
|
6
|
+
export const MSeparator = defineComponent({
|
|
7
|
+
name: 'MSeparator',
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
props: separatorProps,
|
|
10
|
+
setup(props, { attrs }) {
|
|
11
|
+
const { theme } = useMavisTheme()
|
|
12
|
+
return () => {
|
|
13
|
+
const vertical = props.orientation === 'vertical'
|
|
14
|
+
const spacing = resolveSpace(theme.value, props.spacing)
|
|
15
|
+
const inset = resolveSpace(theme.value, props.inset)
|
|
16
|
+
const x = vertical ? spacing : inset,
|
|
17
|
+
y = vertical ? inset : spacing
|
|
18
|
+
return h(
|
|
19
|
+
MBox,
|
|
20
|
+
mergeProps(attrs, {
|
|
21
|
+
id: props.id,
|
|
22
|
+
width: vertical ? 1 : props.length,
|
|
23
|
+
height: vertical ? props.length : 1,
|
|
24
|
+
shrink: 0,
|
|
25
|
+
backgroundColor: theme.value.colors.border,
|
|
26
|
+
accessible: false,
|
|
27
|
+
accessibilityHidden: true,
|
|
28
|
+
isUserInteractionEnabled: false,
|
|
29
|
+
style: {
|
|
30
|
+
alignSelf: props.length === undefined ? 'stretch' : 'center',
|
|
31
|
+
marginLeft: x,
|
|
32
|
+
marginRight: x,
|
|
33
|
+
marginTop: y,
|
|
34
|
+
marginBottom: y,
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
})
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { computed } from 'nativescript-vue'
|
|
2
|
+
import { useButtonAction, useCachedActivity } from '@getcortexlabs/mavis-core/vue'
|
|
3
|
+
import {
|
|
4
|
+
defineComponent,
|
|
5
|
+
getCurrentInstance,
|
|
6
|
+
h,
|
|
7
|
+
inject,
|
|
8
|
+
onBeforeUnmount,
|
|
9
|
+
onMounted,
|
|
10
|
+
provide,
|
|
11
|
+
ref,
|
|
12
|
+
registerElement,
|
|
13
|
+
shallowRef,
|
|
14
|
+
watch,
|
|
15
|
+
type ExtractPropTypes,
|
|
16
|
+
type PropType,
|
|
17
|
+
type Ref,
|
|
18
|
+
type VNodeChild,
|
|
19
|
+
} from 'nativescript-vue'
|
|
20
|
+
import { bottomSheet, GestureSurface, type BottomSheet } from '@rafaelaugusto/jolt/bottom-sheet'
|
|
21
|
+
import {
|
|
22
|
+
sheetProps,
|
|
23
|
+
sheetEmits,
|
|
24
|
+
useMavisTheme,
|
|
25
|
+
type MavisThemeContext,
|
|
26
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
27
|
+
import { checkSheetName, type SheetName, type SheetCloseReason } from '@getcortexlabs/mavis-core'
|
|
28
|
+
import { isAndroid, type EventData, type ScrollView, type View } from '@nativescript/core'
|
|
29
|
+
import { MRow, MColumn, MBox } from './layout.js'
|
|
30
|
+
import { MText } from './MText.js'
|
|
31
|
+
import { MButton } from './MButton.js'
|
|
32
|
+
import { useLayerHost } from '../layers.js'
|
|
33
|
+
import { nativeViewOf } from '../native-view.js'
|
|
34
|
+
import { systemBackKey } from '../system-back.js'
|
|
35
|
+
import { watchBack, setModal, safeAreaOf, contentInsets } from '../../native/sheet'
|
|
36
|
+
import { notifyAccessibilityLayout } from '../../native/accessibility-layout'
|
|
37
|
+
|
|
38
|
+
registerElement('MavisSheetPanel', () => GestureSurface, { viewFlags: 4 })
|
|
39
|
+
|
|
40
|
+
type SheetState = ExtractPropTypes<typeof sheetProps>
|
|
41
|
+
type Element<T extends View = View> = { nativeView: T }
|
|
42
|
+
|
|
43
|
+
interface Bridge {
|
|
44
|
+
context: MavisThemeContext
|
|
45
|
+
state: SheetState
|
|
46
|
+
content: () => VNodeChild
|
|
47
|
+
provides: Record<PropertyKey, unknown>
|
|
48
|
+
presented: Ref<boolean>
|
|
49
|
+
requestClose(reason: SheetCloseReason): void
|
|
50
|
+
dismissed(reason: SheetCloseReason): void
|
|
51
|
+
reopened(): void
|
|
52
|
+
settled(): void
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Content rendered by the Screen still resolves injections from the sheet's own position. */
|
|
56
|
+
function bridgeProvides(source: Record<PropertyKey, unknown>) {
|
|
57
|
+
const seen = new Set<PropertyKey>()
|
|
58
|
+
for (
|
|
59
|
+
let chain: object | null = source;
|
|
60
|
+
chain && chain !== Object.prototype;
|
|
61
|
+
chain = Object.getPrototypeOf(chain)
|
|
62
|
+
) {
|
|
63
|
+
for (const key of [
|
|
64
|
+
...Object.getOwnPropertyNames(chain),
|
|
65
|
+
...Object.getOwnPropertySymbols(chain),
|
|
66
|
+
]) {
|
|
67
|
+
if (seen.has(key)) continue
|
|
68
|
+
seen.add(key)
|
|
69
|
+
provide(key as string | symbol, (chain as Record<PropertyKey, unknown>)[key])
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function focusAccessibility(view: View | undefined) {
|
|
75
|
+
if (!view?.isLoaded) return
|
|
76
|
+
if (isAndroid) view.android.performAccessibilityAction(64, null)
|
|
77
|
+
else notifyAccessibilityLayout(view)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const SheetLayer = defineComponent({
|
|
81
|
+
name: 'MSheetLayer',
|
|
82
|
+
props: { bridge: { type: Object as PropType<Bridge>, required: true } },
|
|
83
|
+
setup(props) {
|
|
84
|
+
useButtonAction()
|
|
85
|
+
const bridge = props.bridge
|
|
86
|
+
bridgeProvides(bridge.provides)
|
|
87
|
+
const { theme } = bridge.context
|
|
88
|
+
const claimSystemBack = inject(systemBackKey, undefined)
|
|
89
|
+
const panel = shallowRef<Element<GestureSurface>>()
|
|
90
|
+
const handle = shallowRef<Element>()
|
|
91
|
+
const scroll = shallowRef<Element<ScrollView>>()
|
|
92
|
+
const backdrop = shallowRef<Element>()
|
|
93
|
+
// The surface covers the window edges; content clears the home indicator and landscape notch.
|
|
94
|
+
const insets = ref({ left: 0, right: 0, bottom: 0 })
|
|
95
|
+
let title: View | undefined
|
|
96
|
+
let sheet: BottomSheet | undefined
|
|
97
|
+
let pending: SheetCloseReason | undefined
|
|
98
|
+
let requested = false
|
|
99
|
+
let releaseBack = () => {}
|
|
100
|
+
let releaseClaim = () => {}
|
|
101
|
+
|
|
102
|
+
function updateInsets() {
|
|
103
|
+
const host = nativeViewOf(panel.value)?.parent as View | undefined
|
|
104
|
+
if (!host) return
|
|
105
|
+
const next = contentInsets(host)
|
|
106
|
+
const current = insets.value
|
|
107
|
+
if (
|
|
108
|
+
next.left !== current.left ||
|
|
109
|
+
next.right !== current.right ||
|
|
110
|
+
next.bottom !== current.bottom
|
|
111
|
+
)
|
|
112
|
+
insets.value = next
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function dispose() {
|
|
116
|
+
releaseBack()
|
|
117
|
+
releaseClaim()
|
|
118
|
+
releaseBack = releaseClaim = () => {}
|
|
119
|
+
const current = sheet
|
|
120
|
+
sheet = undefined
|
|
121
|
+
current?.dispose()
|
|
122
|
+
}
|
|
123
|
+
function present() {
|
|
124
|
+
const views = {
|
|
125
|
+
panel: nativeViewOf(panel.value),
|
|
126
|
+
handle: nativeViewOf(handle.value),
|
|
127
|
+
scroll: nativeViewOf(scroll.value),
|
|
128
|
+
backdrop: nativeViewOf(backdrop.value),
|
|
129
|
+
}
|
|
130
|
+
if (sheet || !views.panel || !views.handle || !views.scroll || !views.backdrop) return
|
|
131
|
+
const state = bridge.state
|
|
132
|
+
const host = views.panel.parent as View
|
|
133
|
+
updateInsets()
|
|
134
|
+
pending = undefined
|
|
135
|
+
requested = false
|
|
136
|
+
const back = () => {
|
|
137
|
+
if (!sheet?.isOpen) return
|
|
138
|
+
if (!state.dismissible) return
|
|
139
|
+
pending = 'back'
|
|
140
|
+
sheet.dismiss()
|
|
141
|
+
}
|
|
142
|
+
// Core's own navigation honors the cancelled event; a router that owns back asks the claimant first.
|
|
143
|
+
releaseBack = watchBack((event) => {
|
|
144
|
+
if (sheet?.isOpen) event.cancel = true
|
|
145
|
+
back()
|
|
146
|
+
})
|
|
147
|
+
releaseClaim = claimSystemBack?.({ owns: () => Boolean(sheet?.isOpen), back }) ?? (() => {})
|
|
148
|
+
setModal(views.panel, true)
|
|
149
|
+
let opened = false
|
|
150
|
+
sheet = bottomSheet(views.panel, {
|
|
151
|
+
handle: views.handle,
|
|
152
|
+
scrollView: views.scroll,
|
|
153
|
+
backdrop: views.backdrop,
|
|
154
|
+
safeArea: safeAreaOf(host),
|
|
155
|
+
snap: [state.fullscreen ? '100%' : 'content'],
|
|
156
|
+
dismissible: state.dismissible,
|
|
157
|
+
accessibility: {
|
|
158
|
+
label: checkSheetName(state.title, state.accessibilityLabel),
|
|
159
|
+
dismiss: state.closeLabel,
|
|
160
|
+
},
|
|
161
|
+
onChange(point) {
|
|
162
|
+
if (point === null) {
|
|
163
|
+
if (!requested) bridge.dismissed(pending ?? 'swipe')
|
|
164
|
+
pending = undefined
|
|
165
|
+
opened = false
|
|
166
|
+
return
|
|
167
|
+
}
|
|
168
|
+
requested = false
|
|
169
|
+
bridge.reopened()
|
|
170
|
+
if (!opened) focusAccessibility(title)
|
|
171
|
+
opened = true
|
|
172
|
+
},
|
|
173
|
+
onDismiss: () => bridge.settled(),
|
|
174
|
+
})
|
|
175
|
+
sheet.open()
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
onMounted(() => {
|
|
179
|
+
if (bridge.presented.value) present()
|
|
180
|
+
})
|
|
181
|
+
watch(
|
|
182
|
+
() => bridge.presented.value,
|
|
183
|
+
(presented) => {
|
|
184
|
+
if (presented) present()
|
|
185
|
+
},
|
|
186
|
+
{ flush: 'post' },
|
|
187
|
+
)
|
|
188
|
+
watch(
|
|
189
|
+
() => bridge.presented.value,
|
|
190
|
+
(presented) => {
|
|
191
|
+
if (!presented) dispose()
|
|
192
|
+
},
|
|
193
|
+
)
|
|
194
|
+
watch(
|
|
195
|
+
() => bridge.state.open,
|
|
196
|
+
(open) => {
|
|
197
|
+
if (!open && sheet) {
|
|
198
|
+
requested = true
|
|
199
|
+
sheet.dismiss()
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
)
|
|
203
|
+
onBeforeUnmount(dispose)
|
|
204
|
+
|
|
205
|
+
return () => {
|
|
206
|
+
if (!bridge.presented.value) return null
|
|
207
|
+
const state = bridge.state
|
|
208
|
+
const { colors, radius } = theme.value
|
|
209
|
+
const name = checkSheetName(state.title, state.accessibilityLabel)
|
|
210
|
+
const heading = state.title?.trim()
|
|
211
|
+
const header =
|
|
212
|
+
heading || state.dismissible
|
|
213
|
+
? h(
|
|
214
|
+
MRow,
|
|
215
|
+
{ row: 1, paddingX: 'lg', paddingY: 'sm', gap: 'sm', justify: 'between' },
|
|
216
|
+
{
|
|
217
|
+
default: () => [
|
|
218
|
+
heading
|
|
219
|
+
? h(MText, {
|
|
220
|
+
as: 'h2',
|
|
221
|
+
variant: 'heading',
|
|
222
|
+
grow: 1,
|
|
223
|
+
text: heading,
|
|
224
|
+
onLoaded: (event: EventData) => {
|
|
225
|
+
title = event.object as View
|
|
226
|
+
},
|
|
227
|
+
})
|
|
228
|
+
: h(MBox, { grow: 1 }),
|
|
229
|
+
state.dismissible
|
|
230
|
+
? h(MButton, {
|
|
231
|
+
variant: 'ghost',
|
|
232
|
+
size: 'sm',
|
|
233
|
+
icon: 'x',
|
|
234
|
+
shrink: 0,
|
|
235
|
+
accessibilityLabel: state.closeLabel,
|
|
236
|
+
onClick: () => bridge.requestClose('button'),
|
|
237
|
+
})
|
|
238
|
+
: null,
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
)
|
|
242
|
+
: null
|
|
243
|
+
return [
|
|
244
|
+
h('MavisBox', {
|
|
245
|
+
ref: backdrop,
|
|
246
|
+
backgroundColor: '#000000',
|
|
247
|
+
accessible: false,
|
|
248
|
+
accessibilityHidden: true,
|
|
249
|
+
onTap: () => {
|
|
250
|
+
if (state.dismissible) pending = 'backdrop'
|
|
251
|
+
},
|
|
252
|
+
}),
|
|
253
|
+
h(
|
|
254
|
+
'MavisSheetPanel',
|
|
255
|
+
{
|
|
256
|
+
ref: panel,
|
|
257
|
+
id: state.id,
|
|
258
|
+
accessibilityLabel: name,
|
|
259
|
+
onLayoutChanged: updateInsets,
|
|
260
|
+
style: {
|
|
261
|
+
backgroundColor: colors.surface,
|
|
262
|
+
borderTopLeftRadius: radius.lg,
|
|
263
|
+
borderTopRightRadius: radius.lg,
|
|
264
|
+
paddingLeft: insets.value.left,
|
|
265
|
+
paddingRight: insets.value.right,
|
|
266
|
+
paddingBottom: insets.value.bottom,
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
[
|
|
270
|
+
h('GridLayout', { rows: 'auto,auto,*' }, [
|
|
271
|
+
h('GridLayout', { ref: handle, accessibilityLabel: name, row: 0, height: 24 }, [
|
|
272
|
+
h('MavisBox', {
|
|
273
|
+
width: 36,
|
|
274
|
+
height: 5,
|
|
275
|
+
borderRadius: 3,
|
|
276
|
+
backgroundColor: colors.border,
|
|
277
|
+
horizontalAlignment: 'center',
|
|
278
|
+
verticalAlignment: 'middle',
|
|
279
|
+
}),
|
|
280
|
+
]),
|
|
281
|
+
header,
|
|
282
|
+
// Reserve the handle/header before measuring the viewport. A flex child's
|
|
283
|
+
// initial measurement can otherwise retain the full panel height on Android.
|
|
284
|
+
h('ScrollView', { ref: scroll, row: 2 }, [
|
|
285
|
+
h(
|
|
286
|
+
MColumn,
|
|
287
|
+
{ padding: state.padding, gap: state.gap, align: state.align },
|
|
288
|
+
{ default: () => bridge.content() },
|
|
289
|
+
),
|
|
290
|
+
]),
|
|
291
|
+
]),
|
|
292
|
+
],
|
|
293
|
+
),
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
const Sheet = defineComponent({
|
|
300
|
+
name: 'MSheet',
|
|
301
|
+
inheritAttrs: false,
|
|
302
|
+
props: sheetProps,
|
|
303
|
+
emits: sheetEmits,
|
|
304
|
+
setup(props, { slots, emit }) {
|
|
305
|
+
const host = useLayerHost('MSheet')
|
|
306
|
+
const active = useCachedActivity()
|
|
307
|
+
checkSheetName(props.title, props.accessibilityLabel)
|
|
308
|
+
// Vue keeps the injection chain on the instance without declaring it in its public types.
|
|
309
|
+
const provides =
|
|
310
|
+
(getCurrentInstance() as { provides?: Record<PropertyKey, unknown> } | null)?.provides ?? {}
|
|
311
|
+
const presented = ref(false)
|
|
312
|
+
let closing: SheetCloseReason | undefined
|
|
313
|
+
const announce = (reason: SheetCloseReason) => {
|
|
314
|
+
closing = reason
|
|
315
|
+
emit('update:open', false)
|
|
316
|
+
emit('close', reason)
|
|
317
|
+
}
|
|
318
|
+
watch(active, (value) => {
|
|
319
|
+
if (!value) {
|
|
320
|
+
presented.value = false
|
|
321
|
+
if (props.open) announce('program')
|
|
322
|
+
}
|
|
323
|
+
})
|
|
324
|
+
const bridge: Bridge = {
|
|
325
|
+
context: useMavisTheme(),
|
|
326
|
+
state: props,
|
|
327
|
+
content: () => slots.default?.(),
|
|
328
|
+
provides,
|
|
329
|
+
presented,
|
|
330
|
+
requestClose(reason) {
|
|
331
|
+
if (props.open && !closing) announce(reason)
|
|
332
|
+
},
|
|
333
|
+
dismissed(reason) {
|
|
334
|
+
if (!closing) announce(reason)
|
|
335
|
+
},
|
|
336
|
+
reopened() {
|
|
337
|
+
closing = undefined
|
|
338
|
+
if (!props.open) emit('update:open', true)
|
|
339
|
+
},
|
|
340
|
+
settled() {
|
|
341
|
+
presented.value = false
|
|
342
|
+
closing = undefined
|
|
343
|
+
},
|
|
344
|
+
}
|
|
345
|
+
watch(
|
|
346
|
+
() => props.open,
|
|
347
|
+
(open) => {
|
|
348
|
+
if (open) {
|
|
349
|
+
closing = undefined
|
|
350
|
+
presented.value = true
|
|
351
|
+
} else if (presented.value && !closing) {
|
|
352
|
+
closing = 'program'
|
|
353
|
+
emit('close', 'program')
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{ immediate: true },
|
|
357
|
+
)
|
|
358
|
+
onBeforeUnmount(
|
|
359
|
+
host.add({
|
|
360
|
+
component: SheetLayer,
|
|
361
|
+
props: { bridge },
|
|
362
|
+
presented: computed(() => active.value && presented.value),
|
|
363
|
+
}),
|
|
364
|
+
)
|
|
365
|
+
return () => {
|
|
366
|
+
// An unnamed sheet fails where it is declared, not in the Screen's render.
|
|
367
|
+
checkSheetName(props.title, props.accessibilityLabel)
|
|
368
|
+
return null
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
export const MSheet = Sheet as typeof Sheet & {
|
|
374
|
+
new (): InstanceType<typeof Sheet> & { $props: SheetName }
|
|
375
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineComponent, h, mergeProps, onBeforeUnmount, watch } from 'nativescript-vue'
|
|
2
|
+
import { Application, type EventData, type View } from '@nativescript/core'
|
|
3
|
+
import { animate, onReducedMotion, reducedMotion, set } from '@rafaelaugusto/jolt'
|
|
4
|
+
import { skeletonProps, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
|
|
5
|
+
import { MBox } from './layout.js'
|
|
6
|
+
import { LoadingDecoration } from './LoadingDecoration.js'
|
|
7
|
+
|
|
8
|
+
export const MSkeleton = defineComponent({
|
|
9
|
+
name: 'MSkeleton',
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
props: skeletonProps,
|
|
12
|
+
setup(props, { attrs }) {
|
|
13
|
+
const { theme } = useMavisTheme()
|
|
14
|
+
let view: View | undefined
|
|
15
|
+
let motion: ReturnType<typeof animate> | undefined
|
|
16
|
+
let pending: ReturnType<typeof setTimeout> | undefined
|
|
17
|
+
let offMotion: (() => void) | undefined
|
|
18
|
+
let suspended = Application.suspended
|
|
19
|
+
|
|
20
|
+
function stop() {
|
|
21
|
+
clearTimeout(pending)
|
|
22
|
+
pending = undefined
|
|
23
|
+
motion?.stop()
|
|
24
|
+
motion = undefined
|
|
25
|
+
if (view) set(view, { opacity: 1 })
|
|
26
|
+
}
|
|
27
|
+
function update() {
|
|
28
|
+
if (!view || suspended || !props.animated || reducedMotion()) {
|
|
29
|
+
stop()
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
if (motion || pending !== undefined) return
|
|
33
|
+
// Let loaded finish syncing native styles before attaching the opacity animation.
|
|
34
|
+
pending = setTimeout(() => {
|
|
35
|
+
pending = undefined
|
|
36
|
+
if (!view || suspended || !props.animated || reducedMotion()) return
|
|
37
|
+
motion = animate(
|
|
38
|
+
view,
|
|
39
|
+
{ opacity: [1, 0.45, 1] },
|
|
40
|
+
{ duration: 1600, ease: 'easeInOut', repeat: Infinity },
|
|
41
|
+
)
|
|
42
|
+
}, 0)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function suspend() {
|
|
46
|
+
suspended = true
|
|
47
|
+
stop()
|
|
48
|
+
}
|
|
49
|
+
function resume() {
|
|
50
|
+
suspended = false
|
|
51
|
+
update()
|
|
52
|
+
}
|
|
53
|
+
function release() {
|
|
54
|
+
stop()
|
|
55
|
+
offMotion?.()
|
|
56
|
+
offMotion = undefined
|
|
57
|
+
Application.off(Application.suspendEvent, suspend)
|
|
58
|
+
Application.off(Application.resumeEvent, resume)
|
|
59
|
+
view = undefined
|
|
60
|
+
}
|
|
61
|
+
function loaded(event: EventData) {
|
|
62
|
+
release()
|
|
63
|
+
view = event.object as View
|
|
64
|
+
suspended = Application.suspended
|
|
65
|
+
offMotion = onReducedMotion(update)
|
|
66
|
+
Application.on(Application.suspendEvent, suspend)
|
|
67
|
+
Application.on(Application.resumeEvent, resume)
|
|
68
|
+
update()
|
|
69
|
+
}
|
|
70
|
+
watch(() => props.animated, update, { flush: 'post' })
|
|
71
|
+
onBeforeUnmount(release)
|
|
72
|
+
|
|
73
|
+
return () =>
|
|
74
|
+
h(
|
|
75
|
+
props.effect === 'shimmer' ? LoadingDecoration : MBox,
|
|
76
|
+
mergeProps(
|
|
77
|
+
{
|
|
78
|
+
style: {
|
|
79
|
+
alignSelf:
|
|
80
|
+
props.width === undefined || props.width === 'auto' ? 'stretch' : 'flex-start',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
attrs,
|
|
84
|
+
{
|
|
85
|
+
id: props.id,
|
|
86
|
+
width: props.width,
|
|
87
|
+
height: props.height,
|
|
88
|
+
radius: props.radius,
|
|
89
|
+
grow: props.grow,
|
|
90
|
+
shrink: props.shrink,
|
|
91
|
+
backgroundColor: theme.value.colors.border,
|
|
92
|
+
accessible: false,
|
|
93
|
+
accessibilityHidden: true,
|
|
94
|
+
isUserInteractionEnabled: false,
|
|
95
|
+
...(props.effect === 'shimmer'
|
|
96
|
+
? { kind: 'shimmer', animated: props.animated }
|
|
97
|
+
: { onLoaded: loaded, onUnloaded: release }),
|
|
98
|
+
},
|
|
99
|
+
),
|
|
100
|
+
)
|
|
101
|
+
},
|
|
102
|
+
})
|