@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
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { defineComponent, h, mergeProps, registerElement } from 'nativescript-vue'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
useButtonAction,
|
|
4
|
+
sliderProps,
|
|
5
|
+
useMavisTheme,
|
|
6
|
+
sliderEmits,
|
|
7
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
3
8
|
import { sliderScale } from '@getcortexlabs/mavis-core'
|
|
4
9
|
import { isAndroid, type PropertyChangeData } from '@nativescript/core'
|
|
5
|
-
import { MavisSlider } from '../../native/slider
|
|
10
|
+
import { MavisSlider } from '../../native/slider'
|
|
6
11
|
import { useNativeViewAttrs } from '../accessibility.js'
|
|
7
12
|
|
|
8
13
|
registerElement('MavisSlider', () => MavisSlider)
|
|
@@ -13,6 +18,7 @@ export const MSlider = defineComponent({
|
|
|
13
18
|
props: sliderProps,
|
|
14
19
|
emits: sliderEmits,
|
|
15
20
|
setup(props, { attrs, emit }) {
|
|
21
|
+
useButtonAction()
|
|
16
22
|
const { theme } = useMavisTheme()
|
|
17
23
|
const nativeAttrs = useNativeViewAttrs(props)
|
|
18
24
|
return () => {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { computed, defineComponent, h, mergeProps, provide, shallowRef } from 'nativescript-vue'
|
|
2
|
+
import type { EventData, View } from '@nativescript/core'
|
|
3
|
+
import { resolveSpace, stackLayout } from '@getcortexlabs/mavis-core'
|
|
4
|
+
import {
|
|
5
|
+
stackProps,
|
|
6
|
+
layoutDirection,
|
|
7
|
+
useLayoutShrink,
|
|
8
|
+
useMavisTheme,
|
|
9
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
10
|
+
import { boxStyle } from '../props.js'
|
|
11
|
+
import { useNativeViewAttrs } from '../accessibility.js'
|
|
12
|
+
import './layout.js'
|
|
13
|
+
|
|
14
|
+
const align = {
|
|
15
|
+
start: 'flex-start',
|
|
16
|
+
end: 'flex-end',
|
|
17
|
+
center: 'center',
|
|
18
|
+
stretch: 'stretch',
|
|
19
|
+
} as const
|
|
20
|
+
const justify = {
|
|
21
|
+
start: 'flex-start',
|
|
22
|
+
end: 'flex-end',
|
|
23
|
+
center: 'center',
|
|
24
|
+
between: 'space-between',
|
|
25
|
+
around: 'space-around',
|
|
26
|
+
} as const
|
|
27
|
+
|
|
28
|
+
export const MStack = defineComponent({
|
|
29
|
+
name: 'MStack',
|
|
30
|
+
inheritAttrs: false,
|
|
31
|
+
props: stackProps,
|
|
32
|
+
setup(props, { attrs, slots }) {
|
|
33
|
+
const { theme } = useMavisTheme()
|
|
34
|
+
const nativeAttrs = useNativeViewAttrs(props)
|
|
35
|
+
const shrink = useLayoutShrink()
|
|
36
|
+
const width = shallowRef<number>()
|
|
37
|
+
const layout = computed(() =>
|
|
38
|
+
stackLayout(
|
|
39
|
+
{
|
|
40
|
+
direction: props.direction,
|
|
41
|
+
gap: props.gap,
|
|
42
|
+
align: props.align,
|
|
43
|
+
justify: props.justify,
|
|
44
|
+
wrap: props.wrap,
|
|
45
|
+
},
|
|
46
|
+
props.responsive,
|
|
47
|
+
width.value,
|
|
48
|
+
),
|
|
49
|
+
)
|
|
50
|
+
const direction = computed(() => layout.value.direction ?? props.direction)
|
|
51
|
+
provide(layoutDirection, direction)
|
|
52
|
+
const measure = (event: EventData) => {
|
|
53
|
+
const view = event.object as View
|
|
54
|
+
const size = view.getActualSize().width
|
|
55
|
+
// The inner layout occupies the outer Box's content area, after padding.
|
|
56
|
+
if (size > 0 && size !== width.value) width.value = size
|
|
57
|
+
}
|
|
58
|
+
return () =>
|
|
59
|
+
h(
|
|
60
|
+
'MavisBox',
|
|
61
|
+
mergeProps({ style: boxStyle(theme.value, props, shrink.value) }, nativeAttrs(), attrs),
|
|
62
|
+
[
|
|
63
|
+
h(
|
|
64
|
+
'MavisFlexLayout',
|
|
65
|
+
{
|
|
66
|
+
onLayoutChanged: measure,
|
|
67
|
+
onUnloaded: () => {
|
|
68
|
+
width.value = undefined
|
|
69
|
+
},
|
|
70
|
+
style: {
|
|
71
|
+
flexDirection: direction.value,
|
|
72
|
+
alignItems: align[layout.value.align ?? props.align],
|
|
73
|
+
justifyContent: justify[layout.value.justify ?? props.justify],
|
|
74
|
+
flexWrap: layout.value.wrap ? 'wrap' : 'nowrap',
|
|
75
|
+
gap: resolveSpace(theme.value, layout.value.gap ?? 'none'),
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
slots.default?.(),
|
|
79
|
+
),
|
|
80
|
+
],
|
|
81
|
+
)
|
|
82
|
+
},
|
|
83
|
+
})
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { useChoicePaint } from '../use-choice-paint.js'
|
|
2
|
+
import { isAndroid } from '@nativescript/core'
|
|
3
|
+
import { defineComponent, h, mergeProps, nextTick, onBeforeUnmount } from 'nativescript-vue'
|
|
4
|
+
import type {
|
|
5
|
+
EventData,
|
|
6
|
+
PropertyChangeData,
|
|
7
|
+
Switch,
|
|
8
|
+
TouchGestureEventData,
|
|
9
|
+
} from '@nativescript/core'
|
|
10
|
+
import {
|
|
11
|
+
useButtonAction,
|
|
12
|
+
switchProps,
|
|
13
|
+
switchEmits,
|
|
14
|
+
useMavisTheme,
|
|
15
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
16
|
+
import { MRow, MColumn } from './layout.js'
|
|
17
|
+
import { MText } from './MText.js'
|
|
18
|
+
import { useNativeViewAttrs } from '../accessibility.js'
|
|
19
|
+
import { usePressFeedback } from '../use-press.js'
|
|
20
|
+
|
|
21
|
+
export const MSwitch = defineComponent({
|
|
22
|
+
name: 'MSwitch',
|
|
23
|
+
inheritAttrs: false,
|
|
24
|
+
props: switchProps,
|
|
25
|
+
emits: switchEmits,
|
|
26
|
+
setup(props, { attrs, emit }) {
|
|
27
|
+
useButtonAction()
|
|
28
|
+
const { theme } = useMavisTheme()
|
|
29
|
+
const nativeAttrs = useNativeViewAttrs(props)
|
|
30
|
+
const paint = useChoicePaint(
|
|
31
|
+
() => ({
|
|
32
|
+
backgroundColor: isAndroid ? theme.value.colors.primarySoft : theme.value.colors.primary,
|
|
33
|
+
}),
|
|
34
|
+
theme,
|
|
35
|
+
)
|
|
36
|
+
const feedback = usePressFeedback(() => !props.disabled, theme)
|
|
37
|
+
let control: Switch | undefined
|
|
38
|
+
let restoring = false
|
|
39
|
+
let revision = 0
|
|
40
|
+
let start: { x: number; y: number } | undefined
|
|
41
|
+
let verticalDrag = false
|
|
42
|
+
let touchEnd: ReturnType<typeof setTimeout> | undefined
|
|
43
|
+
|
|
44
|
+
function resetTouch() {
|
|
45
|
+
clearTimeout(touchEnd)
|
|
46
|
+
touchEnd = undefined
|
|
47
|
+
start = undefined
|
|
48
|
+
verticalDrag = false
|
|
49
|
+
}
|
|
50
|
+
function touch(data: EventData) {
|
|
51
|
+
const event = data as TouchGestureEventData
|
|
52
|
+
if (event.action === 'down') {
|
|
53
|
+
resetTouch()
|
|
54
|
+
start = { x: event.getX(), y: event.getY() }
|
|
55
|
+
} else {
|
|
56
|
+
if (start) {
|
|
57
|
+
const x = Math.abs(event.getX() - start.x)
|
|
58
|
+
const y = Math.abs(event.getY() - start.y)
|
|
59
|
+
if (y > 8 && y > x) verticalDrag = true
|
|
60
|
+
}
|
|
61
|
+
if (event.action === 'cancel') verticalDrag = true
|
|
62
|
+
if (event.action === 'up' || event.action === 'cancel') {
|
|
63
|
+
// UIKit can send valueChanged after touch-up in the same dispatch.
|
|
64
|
+
// Keep the decision until dispatch finishes, then allow keyboard/AT.
|
|
65
|
+
clearTimeout(touchEnd)
|
|
66
|
+
touchEnd = setTimeout(resetTouch, 0)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function release() {
|
|
72
|
+
resetTouch()
|
|
73
|
+
control?.off('touch', touch)
|
|
74
|
+
paint.onUnloaded()
|
|
75
|
+
control = undefined
|
|
76
|
+
revision++
|
|
77
|
+
}
|
|
78
|
+
onBeforeUnmount(release)
|
|
79
|
+
|
|
80
|
+
function change(event: PropertyChangeData) {
|
|
81
|
+
if (restoring) return
|
|
82
|
+
const view = event.object as Switch
|
|
83
|
+
const value = Boolean(event.value)
|
|
84
|
+
if (!props.disabled && !verticalDrag && value !== props.modelValue)
|
|
85
|
+
emit('update:modelValue', value)
|
|
86
|
+
const current = ++revision
|
|
87
|
+
// Native controls update themselves before Vue. Restore a rejected change,
|
|
88
|
+
// without treating that restoration as another user activation.
|
|
89
|
+
void nextTick(() => {
|
|
90
|
+
if (current !== revision || control !== view || view.checked === props.modelValue) return
|
|
91
|
+
restoring = true
|
|
92
|
+
try {
|
|
93
|
+
view.checked = props.modelValue
|
|
94
|
+
} finally {
|
|
95
|
+
restoring = false
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return () => {
|
|
101
|
+
const { colors } = theme.value
|
|
102
|
+
return h(
|
|
103
|
+
MRow,
|
|
104
|
+
mergeProps(
|
|
105
|
+
{
|
|
106
|
+
width: props.width,
|
|
107
|
+
grow: props.grow,
|
|
108
|
+
shrink: props.shrink,
|
|
109
|
+
gap: 'md',
|
|
110
|
+
justify: 'between',
|
|
111
|
+
style: { minHeight: 48, opacity: props.disabled ? 0.45 : 1 },
|
|
112
|
+
},
|
|
113
|
+
attrs,
|
|
114
|
+
{ accessibilityHidden: props.accessibilityHidden },
|
|
115
|
+
),
|
|
116
|
+
{
|
|
117
|
+
default: () => [
|
|
118
|
+
h(
|
|
119
|
+
MColumn,
|
|
120
|
+
{
|
|
121
|
+
gap: 'xs',
|
|
122
|
+
paddingY: 'sm',
|
|
123
|
+
justify: 'center',
|
|
124
|
+
style: { minHeight: 48 },
|
|
125
|
+
accessibilityHidden: true,
|
|
126
|
+
isUserInteractionEnabled: !props.disabled,
|
|
127
|
+
...feedback,
|
|
128
|
+
onTap: () => {
|
|
129
|
+
if (!props.disabled) emit('update:modelValue', !props.modelValue)
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
default: () => [
|
|
134
|
+
h(MText, {
|
|
135
|
+
text: props.label,
|
|
136
|
+
accessibilityHidden: true,
|
|
137
|
+
style: { fontWeight: '600' },
|
|
138
|
+
}),
|
|
139
|
+
props.helperText
|
|
140
|
+
? h(MText, {
|
|
141
|
+
text: props.helperText,
|
|
142
|
+
accessibilityHidden: true,
|
|
143
|
+
variant: 'caption',
|
|
144
|
+
tone: 'muted',
|
|
145
|
+
})
|
|
146
|
+
: null,
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
),
|
|
150
|
+
h(
|
|
151
|
+
MColumn,
|
|
152
|
+
{ width: 64, shrink: 0, align: 'center', justify: 'center' },
|
|
153
|
+
{
|
|
154
|
+
default: () =>
|
|
155
|
+
h('Switch', {
|
|
156
|
+
...nativeAttrs(),
|
|
157
|
+
checked: props.modelValue,
|
|
158
|
+
isEnabled: !props.disabled,
|
|
159
|
+
accessible: true,
|
|
160
|
+
accessibilityRole: 'switch',
|
|
161
|
+
accessibilityState: props.modelValue ? 'checked' : 'unchecked',
|
|
162
|
+
accessibilityLabel: props.label,
|
|
163
|
+
accessibilityHint: props.helperText || undefined,
|
|
164
|
+
// Android's thumb extends beyond the narrow track: a light
|
|
165
|
+
// thumb disappears against a light settings surface.
|
|
166
|
+
style: paint.style,
|
|
167
|
+
// Switch.color is a platform thumb tint, not Jolt's text-color channel.
|
|
168
|
+
color: isAndroid
|
|
169
|
+
? props.modelValue
|
|
170
|
+
? colors.primary
|
|
171
|
+
: colors.muted
|
|
172
|
+
: props.modelValue
|
|
173
|
+
? colors.onPrimary
|
|
174
|
+
: colors.surface,
|
|
175
|
+
offBackgroundColor: isAndroid ? colors.border : colors.muted,
|
|
176
|
+
margin: 0,
|
|
177
|
+
onCheckedChange: change,
|
|
178
|
+
onLoaded: (event: EventData) => {
|
|
179
|
+
release()
|
|
180
|
+
control = event.object as Switch
|
|
181
|
+
control.on('touch', touch)
|
|
182
|
+
paint.onLoaded(event)
|
|
183
|
+
// A retained page can unload before a pending restoration.
|
|
184
|
+
restoring = true
|
|
185
|
+
try {
|
|
186
|
+
control.checked = props.modelValue
|
|
187
|
+
} finally {
|
|
188
|
+
restoring = false
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
onUnloaded: release,
|
|
192
|
+
}),
|
|
193
|
+
},
|
|
194
|
+
),
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
})
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
KeepAlive,
|
|
4
|
+
defineComponent,
|
|
5
|
+
h,
|
|
6
|
+
mergeProps,
|
|
7
|
+
onBeforeUnmount,
|
|
8
|
+
ref,
|
|
9
|
+
registerElement,
|
|
10
|
+
watch,
|
|
11
|
+
type SlotsType,
|
|
12
|
+
} from 'nativescript-vue'
|
|
13
|
+
import type { EventData, ScrollView, View } from '@nativescript/core'
|
|
14
|
+
import { animate, onReducedMotion, set } from '@rafaelaugusto/jolt'
|
|
15
|
+
import {
|
|
16
|
+
canChoose,
|
|
17
|
+
choiceKey,
|
|
18
|
+
tabFocusTarget,
|
|
19
|
+
tabScrollOffset,
|
|
20
|
+
validateTabs,
|
|
21
|
+
type TabOption,
|
|
22
|
+
type TabPanelProps,
|
|
23
|
+
} from '@getcortexlabs/mavis-core'
|
|
24
|
+
import { useButtonAction, tabsProps, tabsEmits, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
|
|
25
|
+
import { MavisButton } from '../../native/button'
|
|
26
|
+
import { observeTab } from '../../native/tabs'
|
|
27
|
+
import { useNativeViewAttrs } from '../accessibility.js'
|
|
28
|
+
import { MColumn } from './layout.js'
|
|
29
|
+
|
|
30
|
+
registerElement('MavisTabButton', () => MavisButton)
|
|
31
|
+
|
|
32
|
+
export const MTabs = defineComponent({
|
|
33
|
+
name: 'MTabs',
|
|
34
|
+
inheritAttrs: false,
|
|
35
|
+
props: tabsProps,
|
|
36
|
+
emits: tabsEmits,
|
|
37
|
+
slots: Object as SlotsType<{ default: TabPanelProps }>,
|
|
38
|
+
setup(props, { attrs, emit, slots }) {
|
|
39
|
+
useButtonAction()
|
|
40
|
+
const { theme } = useMavisTheme()
|
|
41
|
+
const nativeAttrs = useNativeViewAttrs(props)
|
|
42
|
+
const controls = new Map<string, View>()
|
|
43
|
+
const observers = new Map<string, () => void>()
|
|
44
|
+
const focusKey = ref<string>()
|
|
45
|
+
const selected = computed(() => {
|
|
46
|
+
validateTabs(props.tabs, props.modelValue, props.label)
|
|
47
|
+
return props.tabs.find((tab) => tab.value === props.modelValue)
|
|
48
|
+
})
|
|
49
|
+
let scroll: ScrollView | undefined, row: View | undefined, indicator: View | undefined
|
|
50
|
+
let motion: ReturnType<typeof animate> | undefined
|
|
51
|
+
let timer: ReturnType<typeof setTimeout> | undefined
|
|
52
|
+
let reduced: (() => void) | undefined
|
|
53
|
+
let previous: { key: string; x: number; width: number } | undefined
|
|
54
|
+
let animateNext = false
|
|
55
|
+
function reveal(view: View) {
|
|
56
|
+
if (!scroll || !row) return
|
|
57
|
+
const point = view.getLocationRelativeTo(row)
|
|
58
|
+
if (!point) return
|
|
59
|
+
const offset = tabScrollOffset(
|
|
60
|
+
point.x,
|
|
61
|
+
view.getActualSize().width,
|
|
62
|
+
scroll.horizontalOffset,
|
|
63
|
+
scroll.getActualSize().width,
|
|
64
|
+
)
|
|
65
|
+
if (Math.abs(offset - scroll.horizontalOffset) > 0.5)
|
|
66
|
+
scroll.scrollToHorizontalOffset(offset, false)
|
|
67
|
+
}
|
|
68
|
+
function update() {
|
|
69
|
+
timer = undefined
|
|
70
|
+
if (!scroll || !row || !indicator) return
|
|
71
|
+
const active = selected.value
|
|
72
|
+
const key = active && choiceKey(active.value)
|
|
73
|
+
const button = key && controls.get(key)
|
|
74
|
+
const point = button && button.getLocationRelativeTo(row)
|
|
75
|
+
const width = button && button.getActualSize().width
|
|
76
|
+
if (!key || !button || !point || !width) {
|
|
77
|
+
motion?.stop()
|
|
78
|
+
motion = undefined
|
|
79
|
+
indicator.opacity = 0
|
|
80
|
+
previous = undefined
|
|
81
|
+
animateNext = false
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
const changed = !previous || previous.x !== point.x || previous.width !== width
|
|
85
|
+
if (changed) {
|
|
86
|
+
motion?.stop()
|
|
87
|
+
motion = undefined
|
|
88
|
+
indicator.width = width
|
|
89
|
+
indicator.opacity = 1
|
|
90
|
+
if (previous && animateNext)
|
|
91
|
+
motion = animate(indicator, { x: point.x }, { type: 'spring', duration: 240, bounce: 0 })
|
|
92
|
+
else set(indicator, { x: point.x })
|
|
93
|
+
}
|
|
94
|
+
previous = { key, x: point.x, width }
|
|
95
|
+
animateNext = false
|
|
96
|
+
reveal(button)
|
|
97
|
+
}
|
|
98
|
+
function schedule(animated = false) {
|
|
99
|
+
animateNext ||= animated
|
|
100
|
+
if (timer === undefined) timer = setTimeout(update, 0)
|
|
101
|
+
}
|
|
102
|
+
function release() {
|
|
103
|
+
clearTimeout(timer)
|
|
104
|
+
timer = undefined
|
|
105
|
+
motion?.stop()
|
|
106
|
+
motion = undefined
|
|
107
|
+
reduced?.()
|
|
108
|
+
reduced = undefined
|
|
109
|
+
for (const dispose of observers.values()) dispose()
|
|
110
|
+
observers.clear()
|
|
111
|
+
controls.clear()
|
|
112
|
+
scroll = undefined
|
|
113
|
+
row = indicator = undefined
|
|
114
|
+
previous = undefined
|
|
115
|
+
animateNext = false
|
|
116
|
+
focusKey.value = undefined
|
|
117
|
+
}
|
|
118
|
+
onBeforeUnmount(release)
|
|
119
|
+
watch(
|
|
120
|
+
() => props.modelValue,
|
|
121
|
+
() => schedule(true),
|
|
122
|
+
{ flush: 'post' },
|
|
123
|
+
)
|
|
124
|
+
watch(
|
|
125
|
+
() => [props.tabs, props.disabled],
|
|
126
|
+
() => schedule(),
|
|
127
|
+
{ deep: true, flush: 'post' },
|
|
128
|
+
)
|
|
129
|
+
function navigate(tab: TabOption, key: string) {
|
|
130
|
+
if (props.disabled || props.tabs.find((item) => item.value === tab.value)?.disabled) return
|
|
131
|
+
const next = tabFocusTarget(props.tabs, tab.value, key)
|
|
132
|
+
const button = next && controls.get(choiceKey(next.value))
|
|
133
|
+
if (button) {
|
|
134
|
+
button.focus()
|
|
135
|
+
reveal(button)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return () => {
|
|
139
|
+
const active = selected.value
|
|
140
|
+
const { colors, typography } = theme.value
|
|
141
|
+
return h(
|
|
142
|
+
MColumn,
|
|
143
|
+
mergeProps(attrs, {
|
|
144
|
+
id: props.id,
|
|
145
|
+
width: props.width,
|
|
146
|
+
grow: props.grow,
|
|
147
|
+
shrink: props.shrink,
|
|
148
|
+
gap: 'md',
|
|
149
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
150
|
+
}),
|
|
151
|
+
{
|
|
152
|
+
default: () => [
|
|
153
|
+
h(
|
|
154
|
+
'ScrollView',
|
|
155
|
+
{
|
|
156
|
+
orientation: 'horizontal',
|
|
157
|
+
scrollBarIndicatorVisible: false,
|
|
158
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
159
|
+
onLoaded: (event: EventData) => {
|
|
160
|
+
scroll = event.object as ScrollView
|
|
161
|
+
reduced?.()
|
|
162
|
+
reduced = onReducedMotion((value) => {
|
|
163
|
+
if (value && indicator && previous) {
|
|
164
|
+
motion?.stop()
|
|
165
|
+
motion = undefined
|
|
166
|
+
set(indicator, { x: previous.x })
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
schedule()
|
|
170
|
+
},
|
|
171
|
+
onLayoutChanged: () => schedule(),
|
|
172
|
+
onUnloaded: release,
|
|
173
|
+
},
|
|
174
|
+
[
|
|
175
|
+
h('MavisBox', { verticalAlignment: 'top' }, [
|
|
176
|
+
h(
|
|
177
|
+
'StackLayout',
|
|
178
|
+
{
|
|
179
|
+
orientation: 'horizontal',
|
|
180
|
+
horizontalAlignment: 'left',
|
|
181
|
+
borderBottomWidth: 1,
|
|
182
|
+
borderBottomColor: colors.border,
|
|
183
|
+
onLoaded: (event: EventData) => {
|
|
184
|
+
row = event.object as View
|
|
185
|
+
schedule()
|
|
186
|
+
},
|
|
187
|
+
onLayoutChanged: () => schedule(),
|
|
188
|
+
},
|
|
189
|
+
props.tabs.map((tab) => {
|
|
190
|
+
const key = choiceKey(tab.value),
|
|
191
|
+
chosen = active?.value === tab.value
|
|
192
|
+
const disabled = props.disabled || Boolean(tab.disabled)
|
|
193
|
+
return h('MavisTabButton', {
|
|
194
|
+
...nativeAttrs(),
|
|
195
|
+
id: undefined,
|
|
196
|
+
key,
|
|
197
|
+
text: tab.label,
|
|
198
|
+
textWrap: false,
|
|
199
|
+
accessible: true,
|
|
200
|
+
accessibilityRole: 'button',
|
|
201
|
+
accessibilityLabel: tab.label,
|
|
202
|
+
accessibilityHint: props.label,
|
|
203
|
+
accessibilityState: [chosen ? 'selected' : '', disabled ? 'disabled' : '']
|
|
204
|
+
.filter(Boolean)
|
|
205
|
+
.join(','),
|
|
206
|
+
isEnabled: !disabled,
|
|
207
|
+
iosAccessibilityAdjustsFontSize: true,
|
|
208
|
+
style: {
|
|
209
|
+
minHeight: 52,
|
|
210
|
+
minWidth: 48,
|
|
211
|
+
margin: 0,
|
|
212
|
+
paddingLeft: 20,
|
|
213
|
+
paddingRight: 20,
|
|
214
|
+
paddingTop: 14,
|
|
215
|
+
paddingBottom: 17,
|
|
216
|
+
fontSize: typography.body.fontSize,
|
|
217
|
+
fontWeight: '600',
|
|
218
|
+
textTransform: 'none',
|
|
219
|
+
color: chosen ? colors.primary : colors.muted,
|
|
220
|
+
backgroundColor:
|
|
221
|
+
focusKey.value === key ? colors.primarySoft : 'transparent',
|
|
222
|
+
borderWidth: 0,
|
|
223
|
+
borderRadius: 0,
|
|
224
|
+
opacity: disabled ? 0.4 : 1,
|
|
225
|
+
androidElevation: 0,
|
|
226
|
+
androidDynamicElevationOffset: 0,
|
|
227
|
+
},
|
|
228
|
+
onTap: () => {
|
|
229
|
+
if (canChoose(tab, props.modelValue, props.disabled))
|
|
230
|
+
emit('update:modelValue', tab.value)
|
|
231
|
+
},
|
|
232
|
+
onLoaded: (event: EventData) => {
|
|
233
|
+
const button = event.object as View
|
|
234
|
+
controls.set(key, button)
|
|
235
|
+
observers.get(key)?.()
|
|
236
|
+
observers.set(
|
|
237
|
+
key,
|
|
238
|
+
observeTab(
|
|
239
|
+
button,
|
|
240
|
+
(focused) => {
|
|
241
|
+
if (focused) focusKey.value = key
|
|
242
|
+
else if (focusKey.value === key) focusKey.value = undefined
|
|
243
|
+
},
|
|
244
|
+
(direction) => navigate(tab, direction),
|
|
245
|
+
),
|
|
246
|
+
)
|
|
247
|
+
schedule()
|
|
248
|
+
},
|
|
249
|
+
onUnloaded: () => {
|
|
250
|
+
observers.get(key)?.()
|
|
251
|
+
observers.delete(key)
|
|
252
|
+
controls.delete(key)
|
|
253
|
+
},
|
|
254
|
+
onLayoutChanged: () => schedule(),
|
|
255
|
+
})
|
|
256
|
+
}),
|
|
257
|
+
),
|
|
258
|
+
h('MavisBox', {
|
|
259
|
+
accessible: false,
|
|
260
|
+
accessibilityHidden: true,
|
|
261
|
+
isUserInteractionEnabled: false,
|
|
262
|
+
horizontalAlignment: 'left',
|
|
263
|
+
verticalAlignment: 'bottom',
|
|
264
|
+
width: 1,
|
|
265
|
+
height: 3,
|
|
266
|
+
borderRadius: 2,
|
|
267
|
+
backgroundColor: colors.primary,
|
|
268
|
+
opacity: 0,
|
|
269
|
+
onLoaded: (event: EventData) => {
|
|
270
|
+
indicator = event.object as View
|
|
271
|
+
schedule()
|
|
272
|
+
},
|
|
273
|
+
}),
|
|
274
|
+
]),
|
|
275
|
+
],
|
|
276
|
+
),
|
|
277
|
+
props.keepAlive
|
|
278
|
+
? props.tabs.map((tab) =>
|
|
279
|
+
h(
|
|
280
|
+
KeepAlive,
|
|
281
|
+
{ key: choiceKey(tab.value), max: 1 },
|
|
282
|
+
{
|
|
283
|
+
default: () =>
|
|
284
|
+
active?.value === tab.value
|
|
285
|
+
? h(MColumn, {}, { default: () => slots.default?.({ value: tab.value }) })
|
|
286
|
+
: null,
|
|
287
|
+
},
|
|
288
|
+
),
|
|
289
|
+
)
|
|
290
|
+
: active
|
|
291
|
+
? h(
|
|
292
|
+
MColumn,
|
|
293
|
+
{ key: choiceKey(active.value) },
|
|
294
|
+
{ default: () => slots.default?.({ value: active.value }) },
|
|
295
|
+
)
|
|
296
|
+
: null,
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
)
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
})
|
|
@@ -2,12 +2,14 @@ import { defineComponent, h, mergeProps, registerElement } from 'nativescript-vu
|
|
|
2
2
|
import {
|
|
3
3
|
textProps,
|
|
4
4
|
useMavisTheme,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
inlineContent,
|
|
6
|
+
useLayoutShrink,
|
|
7
7
|
} from '@getcortexlabs/mavis-core/vue'
|
|
8
|
-
import { nonNegative } from '@getcortexlabs/mavis-core'
|
|
9
|
-
import {
|
|
8
|
+
import { fontFamily, nonNegative, validateWeight } from '@getcortexlabs/mavis-core'
|
|
9
|
+
import { isAndroid } from '@nativescript/core'
|
|
10
|
+
import { MavisLabel } from '../../native/label'
|
|
10
11
|
import { useNativeViewAttrs } from '../accessibility.js'
|
|
12
|
+
import { useMotionSurface } from '../use-motion-surface.js'
|
|
11
13
|
|
|
12
14
|
registerElement('MavisLabel', () => MavisLabel)
|
|
13
15
|
|
|
@@ -18,29 +20,65 @@ export const MText = defineComponent({
|
|
|
18
20
|
setup(props, { attrs, slots }) {
|
|
19
21
|
const { theme } = useMavisTheme()
|
|
20
22
|
const nativeAttrs = useNativeViewAttrs(props)
|
|
21
|
-
const shrink =
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const shrink = useLayoutShrink()
|
|
24
|
+
const motion = useMotionSurface(
|
|
25
|
+
() => props.motionSurface,
|
|
26
|
+
() => true,
|
|
27
|
+
() => props.text !== undefined,
|
|
28
|
+
)
|
|
29
|
+
return () => {
|
|
30
|
+
const type = theme.value.typography[props.variant]
|
|
31
|
+
const runs =
|
|
32
|
+
props.text !== undefined ? [{ text: props.text }] : inlineContent(slots.default?.())
|
|
33
|
+
const text = runs.map((run) => run.text).join('')
|
|
34
|
+
const formatted = runs.some((run) => run.weight || run.tone || run.strong || run.italic)
|
|
35
|
+
return h(
|
|
24
36
|
'MavisLabel',
|
|
25
37
|
mergeProps(
|
|
26
38
|
{
|
|
27
|
-
text
|
|
39
|
+
text,
|
|
40
|
+
...(formatted ? {} : { formattedText: null }),
|
|
28
41
|
textWrap: props.wrap,
|
|
29
42
|
iosAccessibilityAdjustsFontSize: true,
|
|
43
|
+
dynamicTypeStyle: props.variant,
|
|
30
44
|
accessible: true,
|
|
31
45
|
accessibilityRole: /^h[1-6]$/.test(props.as) ? 'header' : 'text',
|
|
32
46
|
style: {
|
|
33
|
-
...
|
|
47
|
+
...type,
|
|
48
|
+
fontFamily: fontFamily(type.fontFamily, isAndroid ? 'android' : 'ios'),
|
|
49
|
+
fontWeight: props.weight ? validateWeight(props.weight) : type.fontWeight,
|
|
50
|
+
// Core's lineHeight is additional leading in device-independent units.
|
|
51
|
+
lineHeight: type.fontSize * (type.lineHeight - 1),
|
|
34
52
|
color: theme.value.colors[props.tone],
|
|
35
53
|
textAlignment: props.align,
|
|
36
54
|
flexGrow: nonNegative(props.grow, 'grow'),
|
|
37
|
-
flexShrink: nonNegative(props.shrink ?? shrink, 'shrink'),
|
|
55
|
+
flexShrink: nonNegative(props.shrink ?? shrink.value, 'shrink'),
|
|
38
56
|
minWidth: 0,
|
|
39
57
|
},
|
|
40
58
|
},
|
|
41
59
|
nativeAttrs(),
|
|
42
60
|
attrs,
|
|
61
|
+
{ onLoaded: motion.onLoaded, onUnloaded: motion.onUnloaded },
|
|
43
62
|
),
|
|
63
|
+
formatted
|
|
64
|
+
? [
|
|
65
|
+
h(
|
|
66
|
+
'FormattedString',
|
|
67
|
+
{},
|
|
68
|
+
runs.map((run) => {
|
|
69
|
+
if (run.tone && !(run.tone in theme.value.colors))
|
|
70
|
+
throw new RangeError(`Unknown text tone: ${run.tone}`)
|
|
71
|
+
return h('Span', {
|
|
72
|
+
text: run.text,
|
|
73
|
+
fontWeight: run.weight,
|
|
74
|
+
fontStyle: run.italic ? 'italic' : undefined,
|
|
75
|
+
color: run.tone ? theme.value.colors[run.tone] : undefined,
|
|
76
|
+
})
|
|
77
|
+
}),
|
|
78
|
+
),
|
|
79
|
+
]
|
|
80
|
+
: undefined,
|
|
44
81
|
)
|
|
82
|
+
}
|
|
45
83
|
},
|
|
46
84
|
})
|