@getcortexlabs/mavis-web 0.1.0-alpha.9 → 0.1.0-rc.12
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 +5 -5
- package/dist/animated-number.d.ts +3 -0
- package/dist/animated-number.d.ts.map +1 -0
- package/dist/animated-number.js +61 -0
- package/dist/animated-number.js.map +1 -0
- package/dist/component-motion.d.ts +18 -0
- package/dist/component-motion.d.ts.map +1 -0
- package/dist/component-motion.js +156 -0
- package/dist/component-motion.js.map +1 -0
- package/dist/component-width.d.ts +6 -0
- package/dist/component-width.d.ts.map +1 -0
- package/dist/component-width.js +30 -0
- package/dist/component-width.js.map +1 -0
- package/dist/components/ChartPlot.d.ts +66 -0
- package/dist/components/ChartPlot.d.ts.map +1 -0
- package/dist/components/ChartPlot.js +254 -0
- package/dist/components/ChartPlot.js.map +1 -0
- package/dist/components/DateCalendar.d.ts +15 -0
- package/dist/components/DateCalendar.d.ts.map +1 -1
- package/dist/components/DateCalendar.js +58 -12
- package/dist/components/DateCalendar.js.map +1 -1
- package/dist/components/LoadingDecoration.d.ts +4 -4
- package/dist/components/MAccordion.d.ts +1 -1
- package/dist/components/MAlert.d.ts +4 -4
- package/dist/components/MAlert.d.ts.map +1 -1
- package/dist/components/MAlert.js +3 -0
- package/dist/components/MAlert.js.map +1 -1
- package/dist/components/MAvatar.d.ts +1 -1
- package/dist/components/MAvatar.d.ts.map +1 -1
- package/dist/components/MAvatar.js +4 -0
- package/dist/components/MAvatar.js.map +1 -1
- package/dist/components/MBadge.d.ts +1 -1
- package/dist/components/MBadge.d.ts.map +1 -1
- package/dist/components/MBadge.js +5 -1
- package/dist/components/MBadge.js.map +1 -1
- package/dist/components/MButton.d.ts +5 -5
- package/dist/components/MCard.d.ts +7 -7
- package/dist/components/MCheckbox.d.ts +1 -1
- package/dist/components/MChip.d.ts +3 -3
- package/dist/components/MChip.d.ts.map +1 -1
- package/dist/components/MChip.js +4 -2
- package/dist/components/MChip.js.map +1 -1
- package/dist/components/MCombobox.d.ts +6 -6
- package/dist/components/MCombobox.d.ts.map +1 -1
- package/dist/components/MCombobox.js +121 -92
- package/dist/components/MCombobox.js.map +1 -1
- package/dist/components/MDatePicker.d.ts +16 -16
- package/dist/components/MDialog.d.ts +2 -2
- package/dist/components/MDialog.d.ts.map +1 -1
- package/dist/components/MDialog.js +9 -4
- package/dist/components/MDialog.js.map +1 -1
- package/dist/components/MEmptyState.d.ts +2 -2
- package/dist/components/MEmptyState.d.ts.map +1 -1
- package/dist/components/MEmptyState.js +3 -0
- package/dist/components/MEmptyState.js.map +1 -1
- package/dist/components/MFilePicker.d.ts +3 -3
- package/dist/components/MFilePicker.d.ts.map +1 -1
- package/dist/components/MFilePicker.js +3 -1
- package/dist/components/MFilePicker.js.map +1 -1
- package/dist/components/MGrid.d.ts +16 -5
- package/dist/components/MGrid.d.ts.map +1 -1
- package/dist/components/MGrid.js +12 -2
- package/dist/components/MGrid.js.map +1 -1
- package/dist/components/MIcon.d.ts +2 -2
- package/dist/components/MImage.d.ts +5 -5
- package/dist/components/MImage.d.ts.map +1 -1
- package/dist/components/MImage.js +8 -1
- package/dist/components/MImage.js.map +1 -1
- package/dist/components/MImageCompare.d.ts +92 -0
- package/dist/components/MImageCompare.d.ts.map +1 -0
- package/dist/components/MImageCompare.js +177 -0
- package/dist/components/MImageCompare.js.map +1 -0
- package/dist/components/MImageViewer.d.ts +121 -0
- package/dist/components/MImageViewer.d.ts.map +1 -0
- package/dist/components/MImageViewer.js +490 -0
- package/dist/components/MImageViewer.js.map +1 -0
- package/dist/components/MInput.d.ts +7 -7
- package/dist/components/MInput.d.ts.map +1 -1
- package/dist/components/MInput.js +5 -0
- package/dist/components/MInput.js.map +1 -1
- package/dist/components/MLink.d.ts +1 -1
- package/dist/components/MListItem.d.ts +1 -1
- package/dist/components/MPinInput.d.ts +57 -0
- package/dist/components/MPinInput.d.ts.map +1 -0
- package/dist/components/MPinInput.js +159 -0
- package/dist/components/MPinInput.js.map +1 -0
- package/dist/components/MPopover.d.ts +105 -0
- package/dist/components/MPopover.d.ts.map +1 -0
- package/dist/components/MPopover.js +266 -0
- package/dist/components/MPopover.js.map +1 -0
- package/dist/components/MProgress.d.ts +3 -3
- package/dist/components/MProgress.d.ts.map +1 -1
- package/dist/components/MProgress.js +34 -11
- package/dist/components/MProgress.js.map +1 -1
- package/dist/components/MRadioGroup.d.ts +1 -1
- package/dist/components/MRangeSlider.d.ts +104 -0
- package/dist/components/MRangeSlider.d.ts.map +1 -0
- package/dist/components/MRangeSlider.js +125 -0
- package/dist/components/MRangeSlider.js.map +1 -0
- package/dist/components/MResizablePanels.d.ts +137 -0
- package/dist/components/MResizablePanels.d.ts.map +1 -0
- package/dist/components/MResizablePanels.js +174 -0
- package/dist/components/MResizablePanels.js.map +1 -0
- package/dist/components/MReveal.d.ts +14 -14
- package/dist/components/MSegmentedControl.d.ts +1 -1
- package/dist/components/MSegmentedControl.d.ts.map +1 -1
- package/dist/components/MSegmentedControl.js +6 -2
- package/dist/components/MSegmentedControl.js.map +1 -1
- package/dist/components/MSelect.d.ts +3 -3
- package/dist/components/MSeparator.d.ts +1 -1
- package/dist/components/MSheet.d.ts +6 -6
- package/dist/components/MSkeleton.d.ts +2 -2
- package/dist/components/MStack.d.ts +31 -20
- package/dist/components/MStack.d.ts.map +1 -1
- package/dist/components/MStack.js +5 -1
- package/dist/components/MStack.js.map +1 -1
- package/dist/components/MSwitch.d.ts +1 -1
- package/dist/components/MTabs.d.ts +1 -1
- package/dist/components/MTabs.d.ts.map +1 -1
- package/dist/components/MTabs.js +6 -3
- package/dist/components/MTabs.js.map +1 -1
- package/dist/components/MText.d.ts +3 -3
- package/dist/components/MTimePicker.d.ts +655 -0
- package/dist/components/MTimePicker.d.ts.map +1 -0
- package/dist/components/MTimePicker.js +81 -0
- package/dist/components/MTimePicker.js.map +1 -0
- package/dist/components/MToast.d.ts.map +1 -1
- package/dist/components/MToast.js +5 -1
- package/dist/components/MToast.js.map +1 -1
- package/dist/components/MTooltip.d.ts +65 -0
- package/dist/components/MTooltip.d.ts.map +1 -0
- package/dist/components/MTooltip.js +256 -0
- package/dist/components/MTooltip.js.map +1 -0
- package/dist/components/MVirtualList.d.ts +3 -0
- package/dist/components/MVirtualList.d.ts.map +1 -0
- package/dist/components/MVirtualList.js +118 -0
- package/dist/components/MVirtualList.js.map +1 -0
- package/dist/components/MotionRows.d.ts +26 -0
- package/dist/components/MotionRows.d.ts.map +1 -0
- package/dist/components/MotionRows.js +16 -0
- package/dist/components/MotionRows.js.map +1 -0
- package/dist/components/RangeHalo.d.ts +19 -0
- package/dist/components/RangeHalo.d.ts.map +1 -0
- package/dist/components/RangeHalo.js +29 -0
- package/dist/components/RangeHalo.js.map +1 -0
- package/dist/components/configurator.d.ts +2 -2
- package/dist/components/creative.d.ts +614 -0
- package/dist/components/creative.d.ts.map +1 -0
- package/dist/components/creative.js +191 -0
- package/dist/components/creative.js.map +1 -0
- package/dist/components/dashboard.d.ts +474 -0
- package/dist/components/dashboard.d.ts.map +1 -0
- package/dist/components/dashboard.js +286 -0
- package/dist/components/dashboard.js.map +1 -0
- package/dist/components/discovery.d.ts +282 -0
- package/dist/components/discovery.d.ts.map +1 -0
- package/dist/components/discovery.js +104 -0
- package/dist/components/discovery.js.map +1 -0
- package/dist/components/interactive.d.ts +163 -0
- package/dist/components/interactive.d.ts.map +1 -0
- package/dist/components/interactive.js +40 -0
- package/dist/components/interactive.js.map +1 -0
- package/dist/components/layout.d.ts +81 -48
- package/dist/components/layout.d.ts.map +1 -1
- package/dist/components/layout.js +2 -1
- package/dist/components/layout.js.map +1 -1
- package/dist/components/navigation.d.ts +225 -0
- package/dist/components/navigation.d.ts.map +1 -0
- package/dist/components/navigation.js +41 -0
- package/dist/components/navigation.js.map +1 -0
- package/dist/components/screen-components.d.ts +502 -0
- package/dist/components/screen-components.d.ts.map +1 -0
- package/dist/components/screen-components.js +67 -0
- package/dist/components/screen-components.js.map +1 -0
- package/dist/components/wayfinding.d.ts +441 -0
- package/dist/components/wayfinding.d.ts.map +1 -0
- package/dist/components/wayfinding.js +58 -0
- package/dist/components/wayfinding.js.map +1 -0
- package/dist/components/workflows.d.ts +2 -2
- package/dist/index.d.ts +18 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -3
- package/dist/index.js.map +1 -1
- package/dist/motion-region.d.ts.map +1 -1
- package/dist/motion-region.js +4 -2
- package/dist/motion-region.js.map +1 -1
- package/dist/motion-surface.d.ts.map +1 -1
- package/dist/motion-surface.js +2 -0
- package/dist/motion-surface.js.map +1 -1
- package/dist/motion.js +1 -1
- package/dist/motion.js.map +1 -1
- package/dist/nuxt-navigation.d.ts +18 -0
- package/dist/nuxt-navigation.d.ts.map +1 -0
- package/dist/nuxt-navigation.js +23 -0
- package/dist/nuxt-navigation.js.map +1 -0
- package/dist/partition-pointer.d.ts +19 -0
- package/dist/partition-pointer.d.ts.map +1 -0
- package/dist/partition-pointer.js +78 -0
- package/dist/partition-pointer.js.map +1 -0
- package/dist/router-navigation.d.ts +31 -0
- package/dist/router-navigation.d.ts.map +1 -0
- package/dist/router-navigation.js +215 -0
- package/dist/router-navigation.js.map +1 -0
- package/dist/screen-viewport.d.ts.map +1 -1
- package/dist/screen-viewport.js +6 -4
- package/dist/screen-viewport.js.map +1 -1
- package/dist/section-scroll.d.ts +8 -0
- package/dist/section-scroll.d.ts.map +1 -0
- package/dist/section-scroll.js +79 -0
- package/dist/section-scroll.js.map +1 -0
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +6 -2
- package/dist/services.js.map +1 -1
- package/dist/use-motion-surface.d.ts.map +1 -1
- package/dist/use-motion-surface.js +27 -8
- package/dist/use-motion-surface.js.map +1 -1
- package/package.json +4 -4
- package/src/animated-number.ts +59 -0
- package/src/base.css +126 -17
- package/src/component-motion.ts +176 -0
- package/src/component-width.ts +34 -0
- package/src/components/ChartPlot.ts +277 -0
- package/src/components/DateCalendar.ts +71 -11
- package/src/components/MAlert.ts +3 -0
- package/src/components/MAvatar.ts +4 -0
- package/src/components/MBadge.ts +10 -1
- package/src/components/MChip.ts +4 -2
- package/src/components/MCombobox.ts +136 -101
- package/src/components/MDialog.ts +9 -4
- package/src/components/MEmptyState.ts +3 -0
- package/src/components/MFilePicker.ts +3 -1
- package/src/components/MGrid.ts +25 -1
- package/src/components/MImage.ts +10 -1
- package/src/components/MImageCompare.ts +218 -0
- package/src/components/MImageViewer.ts +560 -0
- package/src/components/MInput.ts +5 -0
- package/src/components/MPinInput.ts +194 -0
- package/src/components/MPopover.ts +314 -0
- package/src/components/MProgress.ts +36 -11
- package/src/components/MRangeSlider.ts +144 -0
- package/src/components/MResizablePanels.ts +208 -0
- package/src/components/MSegmentedControl.ts +6 -2
- package/src/components/MStack.ts +5 -0
- package/src/components/MTabs.ts +9 -3
- package/src/components/MTimePicker.ts +124 -0
- package/src/components/MToast.ts +5 -1
- package/src/components/MTooltip.ts +291 -0
- package/src/components/MVirtualList.ts +155 -0
- package/src/components/MotionRows.ts +16 -0
- package/src/components/RangeHalo.ts +34 -0
- package/src/components/creative.ts +240 -0
- package/src/components/dashboard.ts +353 -0
- package/src/components/discovery.ts +147 -0
- package/src/components/interactive.ts +60 -0
- package/src/components/layout.ts +2 -0
- package/src/components/navigation.ts +44 -0
- package/src/components/screen-components.ts +86 -0
- package/src/components/wayfinding.ts +70 -0
- package/src/index.ts +145 -1
- package/src/motion-region.ts +5 -2
- package/src/motion-surface.ts +10 -0
- package/src/motion.ts +1 -1
- package/src/nuxt-navigation.ts +29 -0
- package/src/partition-pointer.ts +88 -0
- package/src/router-navigation.ts +249 -0
- package/src/screen-viewport.ts +8 -4
- package/src/section-scroll.ts +101 -0
- package/src/services.ts +7 -1
- package/src/use-motion-surface.ts +40 -15
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Mavis for Vue Web
|
|
2
2
|
|
|
3
|
-
Vue Web components and themes for Mavis UI, version `0.1.0-
|
|
3
|
+
Vue Web components and themes for Mavis UI, version `0.1.0-rc.12`. Experimental prerelease for testing in real apps; the API can change between prerelease versions. Licensed under MIT.
|
|
4
4
|
|
|
5
5
|
In an existing Vue application:
|
|
6
6
|
|
|
7
7
|
Alpha.9 includes `createMavisServices` from `@getcortexlabs/mavis-web/services` for local component imports, selective SVG icons and `base.css` without the icon font. See the [modular installation guide](https://mavis-ui.getcortexlabs.com/guide/modular).
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
npm install @getcortexlabs/mavis-web@0.1.0-
|
|
10
|
+
npm install @getcortexlabs/mavis-web@0.1.0-rc.12 @rafaelaugusto/jolt@0.1.0-rc.11.1
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```ts
|
|
@@ -21,10 +21,10 @@ createApp(App).use(createMavis()).mount('#app')
|
|
|
21
21
|
|
|
22
22
|
The stylesheet supplies focus indicators, box overlays, and motion. The plugin registers the layout, typography, form, selection, feedback and overlay components, including scoped themes and inline text. Vue also accepts their `m-*` spellings. See the [component reference](https://mavis-ui.getcortexlabs.com/components/) for the full catalog.
|
|
23
23
|
|
|
24
|
-
Themes and Vue context come from `@getcortexlabs/mavis-core`. This source checkout requires Jolt 0.1.0-rc.
|
|
24
|
+
Themes and Vue context come from `@getcortexlabs/mavis-core`. This source checkout requires Jolt 0.1.0-rc.11.1 as a peer for component motion and deferred DOM attachment. Browser consumers do not install NativeScript; Mavis uses only Jolt /web and /web/vue. See the [motion guide](https://mavis-ui.getcortexlabs.com/guide/motion).
|
|
25
25
|
|
|
26
26
|
Use `MText.as` for HTML heading semantics. Buttons emit a payload-free `click` and retain native HTML keyboard activation. Sliders expose semantic values to accessibility APIs, including fractional steps. Theme state belongs to each app. The package is safe to import during server rendering.
|
|
27
27
|
|
|
28
|
-
Tested with Vue 3.5.42, Vite 6.4.5, TypeScript 6.0.3 and vue-tsc 3.3.13. See the [Web guide](https://mavis-ui.getcortexlabs.com/guide/web) for setup and portability limits, and the [release notes](https://github.com/getcortexlabs/mavis-ui/blob/main/CHANGELOG.md) for the
|
|
28
|
+
Tested with Vue 3.5.42, Vite 6.4.5, TypeScript 6.0.3 and vue-tsc 3.3.13. See the [Web guide](https://mavis-ui.getcortexlabs.com/guide/web) for setup and portability limits, and the [release notes](https://github.com/getcortexlabs/mavis-ui/blob/main/CHANGELOG.md) for the prerelease scope.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
This release requires Jolt **0.1.0-rc.11.1** for the experimental visual effects, retained collections, platform motion and sensor integrations. Keep the Mavis packages at the same version. Rebuild native applications after upgrading Jolt.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-number.d.ts","sourceRoot":"","sources":["../src/animated-number.ts"],"names":[],"mappings":"AAGA,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,qCAsD1E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { onMounted, onBeforeUnmount, onActivated, onDeactivated, ref, watch } from 'vue';
|
|
2
|
+
import { useMotionContext } from './motion-context.js';
|
|
3
|
+
/** Jolt owns timing; this adapter writes a numeric layout/clip value at the renderer boundary. */
|
|
4
|
+
export function useAnimatedNumber(read, direct) {
|
|
5
|
+
const shown = ref(read());
|
|
6
|
+
const context = useMotionContext();
|
|
7
|
+
let lease;
|
|
8
|
+
let value;
|
|
9
|
+
let off;
|
|
10
|
+
let preference;
|
|
11
|
+
const settle = () => {
|
|
12
|
+
if (!value || !lease) {
|
|
13
|
+
shown.value = read();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
lease.runtime.stop(value);
|
|
17
|
+
lease.runtime.set(value, read());
|
|
18
|
+
shown.value = read();
|
|
19
|
+
};
|
|
20
|
+
const reduced = () => {
|
|
21
|
+
if (preference?.matches)
|
|
22
|
+
settle();
|
|
23
|
+
};
|
|
24
|
+
const update = () => {
|
|
25
|
+
if (!lease || !value || direct() || preference?.matches) {
|
|
26
|
+
settle();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
lease.runtime.animate(value, read(), { type: 'spring', duration: 340, bounce: 0.08 });
|
|
30
|
+
};
|
|
31
|
+
const attach = () => {
|
|
32
|
+
if (lease)
|
|
33
|
+
return;
|
|
34
|
+
lease = context.acquire(document);
|
|
35
|
+
value = lease.runtime.motionValue(read());
|
|
36
|
+
off = value.subscribe((next) => {
|
|
37
|
+
shown.value = next;
|
|
38
|
+
});
|
|
39
|
+
preference = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
40
|
+
preference.addEventListener('change', reduced);
|
|
41
|
+
shown.value = read();
|
|
42
|
+
};
|
|
43
|
+
const detach = () => {
|
|
44
|
+
preference?.removeEventListener('change', reduced);
|
|
45
|
+
preference = undefined;
|
|
46
|
+
off?.();
|
|
47
|
+
off = undefined;
|
|
48
|
+
value?.dispose();
|
|
49
|
+
value = undefined;
|
|
50
|
+
lease?.release();
|
|
51
|
+
lease = undefined;
|
|
52
|
+
shown.value = read();
|
|
53
|
+
};
|
|
54
|
+
watch([read, direct], update, { flush: 'sync' });
|
|
55
|
+
onMounted(attach);
|
|
56
|
+
onActivated(attach);
|
|
57
|
+
onDeactivated(detach);
|
|
58
|
+
onBeforeUnmount(detach);
|
|
59
|
+
return shown;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=animated-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-number.js","sourceRoot":"","sources":["../src/animated-number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,kGAAkG;AAClG,MAAM,UAAU,iBAAiB,CAAC,IAAkB,EAAE,MAAqB;IACzE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,C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AC,IAAI,EAAE,EAAE;YAC7B,KAAK,CAAC,KAAK,GAAG,IAAI,CAAA;QACpB,CAAC,CAAC,CAAA;QACF,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAA;QAClE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAC9C,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,CAAA;IACtB,CAAC,CAAA;IACD,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,UAAU,EAAE,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAClD,UAAU,GAAG,SAAS,CAAA;QACtB,GAAG,EAAE,EAAE,CAAA;QACP,GAAG,GAAG,SAAS,CAAA;QACf,KAAK,EAAE,OAAO,EAAE,CAAA;QAChB,KAAK,GAAG,SAAS,CAAA;QACjB,KAAK,EAAE,OAAO,EAAE,CAAA;QAChB,KAAK,GAAG,SAAS,CAAA;QACjB,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,CAAA;IACtB,CAAC,CAAA;IACD,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;IAChD,SAAS,CAAC,MAAM,CAAC,CAAA;IACjB,WAAW,CAAC,MAAM,CAAC,CAAA;IACnB,aAAa,CAAC,MAAM,CAAC,CAAA;IACrB,eAAe,CAAC,MAAM,CAAC,CAAA;IACvB,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import { type ComponentMotion } from '@getcortexlabs/mavis-core';
|
|
3
|
+
import type { Keyframes } from '@rafaelaugusto/jolt/web';
|
|
4
|
+
/** Private presentation targets only: application transforms remain on their own surface. */
|
|
5
|
+
export declare function useComponentPaint(element: Ref<HTMLElement | undefined>, values: () => Keyframes, kind?: ComponentMotion): void;
|
|
6
|
+
/** Vue transition hooks share one presentation per element, including cancelled leaves. */
|
|
7
|
+
export declare function useComponentTransition(offset?: number): {
|
|
8
|
+
css: boolean;
|
|
9
|
+
appear: boolean;
|
|
10
|
+
onEnter: (element: Element, done: () => void) => void;
|
|
11
|
+
onLeave: (element: Element, done: () => void) => void;
|
|
12
|
+
onAfterLeave: (element: Element) => void;
|
|
13
|
+
onEnterCancelled: (element: Element) => void;
|
|
14
|
+
onLeaveCancelled: (element: Element) => void;
|
|
15
|
+
};
|
|
16
|
+
/** Fixed base geometry avoids feedback between an animated marker and its ResizeObserver. */
|
|
17
|
+
export declare function useSelectionIndicator(read: () => HTMLElement | undefined): Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
18
|
+
//# sourceMappingURL=component-motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-motion.d.ts","sourceRoot":"","sources":["../src/component-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,GAAG,EACT,MAAM,KAAK,CAAA;AACZ,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEjF,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAIpE,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EACrC,MAAM,EAAE,MAAM,SAAS,EACvB,IAAI,GAAE,eAA6B,QAkBpC;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,MAAM,SAAI;;;uBAkD1B,OAAO,QAAQ,MAAM,IAAI;uBACzB,OAAO,QAAQ,MAAM,IAAI;4BAxCpB,OAAO;gCA0CH,OAAO;gCAIP,OAAO;EAKtC;AAED,6FAA6F;AAC7F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,WAAW,GAAG,SAAS,yDAqExE"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { watch, onScopeDispose, onMounted, onUpdated, onActivated, onDeactivated, ref, } from 'vue';
|
|
2
|
+
import { componentMotion } from '@getcortexlabs/mavis-core';
|
|
3
|
+
import { useMavisTheme } from '@getcortexlabs/mavis-core/vue';
|
|
4
|
+
import { useConnectedMotion } from './connected-motion.js';
|
|
5
|
+
import { useMotionContext } from './motion-context.js';
|
|
6
|
+
/** Private presentation targets only: application transforms remain on their own surface. */
|
|
7
|
+
export function useComponentPaint(element, values, kind = 'selection') {
|
|
8
|
+
const { theme } = useMavisTheme();
|
|
9
|
+
useConnectedMotion(element, useMotionContext(), (runtime, target) => {
|
|
10
|
+
let playback = runtime.animate(target, values(), { duration: 0 });
|
|
11
|
+
const off = watch(values, () => {
|
|
12
|
+
playback = runtime.animate(target, values(), componentMotion(theme.value, kind));
|
|
13
|
+
}, { deep: true, flush: 'post' });
|
|
14
|
+
return () => {
|
|
15
|
+
off();
|
|
16
|
+
playback.stop();
|
|
17
|
+
runtime.release(target);
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** Vue transition hooks share one presentation per element, including cancelled leaves. */
|
|
22
|
+
export function useComponentTransition(offset = 6) {
|
|
23
|
+
const { theme } = useMavisTheme();
|
|
24
|
+
const context = useMotionContext();
|
|
25
|
+
const entries = new Map();
|
|
26
|
+
function release(element) {
|
|
27
|
+
const entry = entries.get(element);
|
|
28
|
+
if (!entry)
|
|
29
|
+
return;
|
|
30
|
+
entries.delete(element);
|
|
31
|
+
entry.generation++;
|
|
32
|
+
entry.playback?.stop();
|
|
33
|
+
entry.lease.runtime.release(element);
|
|
34
|
+
entry.lease.release();
|
|
35
|
+
}
|
|
36
|
+
function play(element, done, entering) {
|
|
37
|
+
let entry = entries.get(element);
|
|
38
|
+
const fresh = !entry;
|
|
39
|
+
if (!entry) {
|
|
40
|
+
entry = { lease: context.acquire(element.ownerDocument), generation: 0 };
|
|
41
|
+
entries.set(element, entry);
|
|
42
|
+
}
|
|
43
|
+
const token = ++entry.generation;
|
|
44
|
+
const target = element;
|
|
45
|
+
if (entering && fresh)
|
|
46
|
+
entry.lease.runtime.animate(target, { opacity: 0, y: offset }, { duration: 0 });
|
|
47
|
+
entry.playback = entry.lease.runtime.animate(target, entering ? { opacity: 1, y: 0 } : { opacity: 0, y: offset / 2 }, entering
|
|
48
|
+
? componentMotion(theme.value, 'overlay')
|
|
49
|
+
: { duration: theme.value.motion.exitDuration });
|
|
50
|
+
void entry.playback.finished.then(() => {
|
|
51
|
+
if (entries.get(element) !== entry || entry.generation !== token)
|
|
52
|
+
return;
|
|
53
|
+
done();
|
|
54
|
+
if (!entering)
|
|
55
|
+
release(element);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
onScopeDispose(() => {
|
|
59
|
+
for (const element of entries.keys())
|
|
60
|
+
release(element);
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
css: false,
|
|
64
|
+
appear: true,
|
|
65
|
+
onEnter: (element, done) => play(element, done, true),
|
|
66
|
+
onLeave: (element, done) => play(element, done, false),
|
|
67
|
+
onAfterLeave: release,
|
|
68
|
+
onEnterCancelled: (element) => {
|
|
69
|
+
const entry = entries.get(element);
|
|
70
|
+
if (entry)
|
|
71
|
+
entry.generation++;
|
|
72
|
+
},
|
|
73
|
+
onLeaveCancelled: (element) => {
|
|
74
|
+
const entry = entries.get(element);
|
|
75
|
+
if (entry)
|
|
76
|
+
entry.generation++;
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** Fixed base geometry avoids feedback between an animated marker and its ResizeObserver. */
|
|
81
|
+
export function useSelectionIndicator(read) {
|
|
82
|
+
const marker = ref();
|
|
83
|
+
const bounds = ref({ x: 0, width: 0 });
|
|
84
|
+
useComponentPaint(marker, () => ({
|
|
85
|
+
x: bounds.value.x,
|
|
86
|
+
scaleX: Math.max(0.0001, bounds.value.width / 100),
|
|
87
|
+
opacity: bounds.value.width ? 1 : 0,
|
|
88
|
+
}));
|
|
89
|
+
let observer;
|
|
90
|
+
let mutations;
|
|
91
|
+
let parent;
|
|
92
|
+
const measured = new Set();
|
|
93
|
+
function measure() {
|
|
94
|
+
if (!observer)
|
|
95
|
+
return;
|
|
96
|
+
const target = read();
|
|
97
|
+
const next = target ? { x: target.offsetLeft, width: target.offsetWidth } : { x: 0, width: 0 };
|
|
98
|
+
if (next.x !== bounds.value.x || next.width !== bounds.value.width)
|
|
99
|
+
bounds.value = next;
|
|
100
|
+
}
|
|
101
|
+
function observe() {
|
|
102
|
+
if (!observer)
|
|
103
|
+
return;
|
|
104
|
+
const nextParent = marker.value?.parentElement;
|
|
105
|
+
if (parent !== nextParent) {
|
|
106
|
+
mutations?.disconnect();
|
|
107
|
+
parent = nextParent;
|
|
108
|
+
// Direction can change on any ancestor without resizing the selected control.
|
|
109
|
+
for (let node = parent; node; node = node.parentElement)
|
|
110
|
+
mutations?.observe(node, {
|
|
111
|
+
attributes: true,
|
|
112
|
+
attributeFilter: ['dir', 'class', 'style'],
|
|
113
|
+
childList: node === parent,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// Earlier siblings can resize/reorder while the selected control keeps its dimensions.
|
|
117
|
+
// Never observe the animated marker itself.
|
|
118
|
+
const next = new Set(parent ? [parent, ...parent.children] : []);
|
|
119
|
+
if (marker.value)
|
|
120
|
+
next.delete(marker.value);
|
|
121
|
+
for (const element of measured)
|
|
122
|
+
if (!next.has(element)) {
|
|
123
|
+
observer.unobserve(element);
|
|
124
|
+
measured.delete(element);
|
|
125
|
+
}
|
|
126
|
+
for (const element of next)
|
|
127
|
+
if (!measured.has(element)) {
|
|
128
|
+
observer.observe(element);
|
|
129
|
+
measured.add(element);
|
|
130
|
+
}
|
|
131
|
+
measure();
|
|
132
|
+
}
|
|
133
|
+
function start() {
|
|
134
|
+
if (observer)
|
|
135
|
+
return;
|
|
136
|
+
observer = new ResizeObserver(measure);
|
|
137
|
+
mutations = new MutationObserver(observe);
|
|
138
|
+
observe();
|
|
139
|
+
}
|
|
140
|
+
function stop() {
|
|
141
|
+
observer?.disconnect();
|
|
142
|
+
observer = undefined;
|
|
143
|
+
mutations?.disconnect();
|
|
144
|
+
mutations = undefined;
|
|
145
|
+
parent = undefined;
|
|
146
|
+
measured.clear();
|
|
147
|
+
}
|
|
148
|
+
watch(read, observe, { flush: 'post' });
|
|
149
|
+
onMounted(start);
|
|
150
|
+
onUpdated(observe);
|
|
151
|
+
onActivated(start);
|
|
152
|
+
onDeactivated(stop);
|
|
153
|
+
onScopeDispose(stop);
|
|
154
|
+
return marker;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=component-motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-motion.js","sourceRoot":"","sources":["../src/component-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,EACX,aAAa,EACb,GAAG,GAEJ,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,eAAe,EAAwB,MAAM,2BAA2B,CAAA;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,6FAA6F;AAC7F,MAAM,UAAU,iBAAiB,CAC/B,OAAqC,EACrC,MAAuB,EACvB,OAAwB,WAAW;IAEnC,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,EAAE,CAAA;IACjC,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAClE,IAAI,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAA;QACjE,MAAM,GAAG,GAAG,KAAK,CACf,MAAM,EACN,GAAG,EAAE;YACH,QAAQ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A;IACvC,SAAS,CAAC,KAAK,CAAC,CAAA;IAChB,SAAS,CAAC,OAAO,CAAC,CAAA;IAClB,WAAW,CAAC,KAAK,CAAC,CAAA;IAClB,aAAa,CAAC,IAAI,CAAC,CAAA;IACnB,cAAc,CAAC,IAAI,CAAC,CAAA;IACpB,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-width.d.ts","sourceRoot":"","sources":["../src/component-width.ts"],"names":[],"mappings":"AAMA,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,MAAM;;qBAsB/B,OAAO;EAI3B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ref, watch } from 'vue';
|
|
2
|
+
import { componentMotion } from '@getcortexlabs/mavis-core';
|
|
3
|
+
import { useMavisTheme } from '@getcortexlabs/mavis-core/vue';
|
|
4
|
+
import { useConnectedMotion } from './connected-motion.js';
|
|
5
|
+
import { useMotionContext } from './motion-context.js';
|
|
6
|
+
/** The rail owns its width; labels and focus targets retain their natural geometry. */
|
|
7
|
+
export function useComponentWidth(read) {
|
|
8
|
+
const initial = read();
|
|
9
|
+
const element = ref();
|
|
10
|
+
const { theme } = useMavisTheme();
|
|
11
|
+
useConnectedMotion(element, useMotionContext(), (runtime, target) => {
|
|
12
|
+
target.style.width = `${read()}px`;
|
|
13
|
+
let playback;
|
|
14
|
+
const off = watch(read, (width) => {
|
|
15
|
+
playback = runtime.animateSize(target, { width }, componentMotion(theme.value, 'layout'));
|
|
16
|
+
}, { flush: 'post' });
|
|
17
|
+
return () => {
|
|
18
|
+
off();
|
|
19
|
+
playback?.stop({ restore: true });
|
|
20
|
+
target.style.width = `${read()}px`;
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
width: initial,
|
|
25
|
+
ref: (component) => {
|
|
26
|
+
element.value = component?.$el;
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=component-width.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-width.js","sourceRoot":"","sources":["../src/component-width.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,uFAAuF;AACvF,MAAM,UAAU,iBAAiB,CAAC,IAAkB;IAClD,MAAM,OAAO,GAAG,IAAI,EAAE,CAAA;IACtB,MAAM,OAAO,GAAG,GAAG,EAAe,CAAA;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,EAAE,CAAA;IACjC,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAClE,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,EAAE,IAAI,CAAA;QAClC,IAAI,QAA4D,CAAA;QAChE,MAAM,GAAG,GAAG,KAAK,CACf,IAAI,EACJ,CAAC,KAAK,EAAE,EAAE;YACR,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAA;QAC3F,CAAC,EACD,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAA;QACD,OAAO,GAAG,EAAE;YACV,GAAG,EAAE,CAAA;YACL,QAAQ,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;YACjC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,EAAE,IAAI,CAAA;QACpC,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;IACF,OAAO;QACL,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,CAAC,SAAkB,EAAE,EAAE;YAC1B,OAAO,CAAC,KAAK,GAAI,SAA0C,EAAE,GAAG,CAAA;QAClE,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ChartGeometry } from '@getcortexlabs/mavis-core';
|
|
2
|
+
/** SVG is presentation only; the shared selects and data list own assistive interaction. */
|
|
3
|
+
export declare const ChartPlot: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
geometry: {
|
|
5
|
+
type: import("vue").PropType<ChartGeometry>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
colors: {
|
|
9
|
+
type: import("vue").PropType<readonly string[]>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
type: {
|
|
13
|
+
type: import("vue").PropType<"line" | "bar">;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
height: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
selected: {
|
|
21
|
+
type: import("vue").PropType<{
|
|
22
|
+
category: number;
|
|
23
|
+
series: number;
|
|
24
|
+
} | null>;
|
|
25
|
+
default: null;
|
|
26
|
+
};
|
|
27
|
+
disabled: BooleanConstructor;
|
|
28
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
+
select: (_category: number, _series: number) => true;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
geometry: {
|
|
34
|
+
type: import("vue").PropType<ChartGeometry>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
colors: {
|
|
38
|
+
type: import("vue").PropType<readonly string[]>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
type: {
|
|
42
|
+
type: import("vue").PropType<"line" | "bar">;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
height: {
|
|
46
|
+
type: NumberConstructor;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
selected: {
|
|
50
|
+
type: import("vue").PropType<{
|
|
51
|
+
category: number;
|
|
52
|
+
series: number;
|
|
53
|
+
} | null>;
|
|
54
|
+
default: null;
|
|
55
|
+
};
|
|
56
|
+
disabled: BooleanConstructor;
|
|
57
|
+
}>> & Readonly<{
|
|
58
|
+
onSelect?: ((_category: number, _series: number) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
selected: {
|
|
62
|
+
category: number;
|
|
63
|
+
series: number;
|
|
64
|
+
} | null;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
//# sourceMappingURL=ChartPlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartPlot.d.ts","sourceRoot":"","sources":["../../src/components/ChartPlot.ts"],"names":[],"mappings":"AAYA,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,2BAA2B,CAAA;AAElC,4FAA4F;AAC5F,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAGS,MAAM,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EA4PpD,CAAA"}
|