@getcortexlabs/mavis-web 0.1.0-alpha.6 → 0.1.0-alpha.7
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 +4 -4
- package/dist/components/ChoicePaint.d.ts +17 -0
- package/dist/components/ChoicePaint.d.ts.map +1 -0
- package/dist/components/ChoicePaint.js +81 -0
- package/dist/components/ChoicePaint.js.map +1 -0
- package/dist/components/DateCalendar.d.ts +3 -3
- package/dist/components/MBadge.d.ts +1 -1
- package/dist/components/MButton.d.ts +6 -6
- package/dist/components/MCard.d.ts +6 -5
- package/dist/components/MCard.d.ts.map +1 -1
- package/dist/components/MCard.js +9 -2
- package/dist/components/MCard.js.map +1 -1
- package/dist/components/MCheckbox.d.ts.map +1 -1
- package/dist/components/MCheckbox.js +8 -3
- package/dist/components/MCheckbox.js.map +1 -1
- package/dist/components/MChip.d.ts +2 -2
- package/dist/components/MDatePicker.d.ts +16 -16
- package/dist/components/MDialog.d.ts +1 -1
- package/dist/components/MEmptyState.d.ts +1 -1
- package/dist/components/MFilePicker.d.ts +2 -2
- package/dist/components/MIcon.d.ts +1 -1
- package/dist/components/MImage.d.ts +192 -0
- package/dist/components/MImage.d.ts.map +1 -0
- package/dist/components/MImage.js +97 -0
- package/dist/components/MImage.js.map +1 -0
- package/dist/components/MInput.d.ts +2 -2
- package/dist/components/MLink.d.ts +1 -1
- package/dist/components/MProgress.d.ts +2 -2
- package/dist/components/MRadioGroup.d.ts.map +1 -1
- package/dist/components/MRadioGroup.js +5 -3
- package/dist/components/MRadioGroup.js.map +1 -1
- package/dist/components/MReveal.d.ts +1 -1
- package/dist/components/MSeparator.d.ts +1 -1
- package/dist/components/MSheet.d.ts +1 -1
- package/dist/components/MStack.d.ts +3 -3
- package/dist/components/MSwitch.d.ts.map +1 -1
- package/dist/components/MSwitch.js +9 -2
- package/dist/components/MSwitch.js.map +1 -1
- package/dist/components/MText.d.ts +5 -5
- package/dist/components/configurator.d.ts +541 -0
- package/dist/components/configurator.d.ts.map +1 -0
- package/dist/components/configurator.js +20 -0
- package/dist/components/configurator.js.map +1 -0
- package/dist/components/layout.d.ts +3 -3
- package/dist/components/workflows.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/motion-surface.d.ts +4 -0
- package/dist/motion-surface.d.ts.map +1 -1
- package/dist/motion-surface.js +62 -2
- package/dist/motion-surface.js.map +1 -1
- package/dist/scroll-motion.d.ts.map +1 -1
- package/dist/scroll-motion.js +17 -4
- package/dist/scroll-motion.js.map +1 -1
- package/package.json +3 -3
- package/src/components/ChoicePaint.ts +96 -0
- package/src/components/MCard.ts +9 -1
- package/src/components/MCheckbox.ts +14 -3
- package/src/components/MImage.ts +108 -0
- package/src/components/MRadioGroup.ts +9 -3
- package/src/components/MSwitch.ts +14 -3
- package/src/components/configurator.ts +24 -0
- package/src/index.ts +8 -0
- package/src/motion-surface.ts +60 -3
- package/src/scroll-motion.ts +15 -3
- package/src/style.css +7 -10
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Mavis for Vue Web
|
|
2
2
|
|
|
3
|
-
Vue Web components and themes for Mavis UI, version `0.1.0-alpha.
|
|
3
|
+
Vue Web components and themes for Mavis UI, version `0.1.0-alpha.7`. Experimental prerelease for testing in real apps; the API can change between alpha versions. Licensed under MIT.
|
|
4
4
|
|
|
5
5
|
In an existing Vue application:
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install @getcortexlabs/mavis-web@0.1.0-alpha.
|
|
8
|
+
npm install @getcortexlabs/mavis-web@0.1.0-alpha.7 @rafaelaugusto/jolt@0.1.0-rc.9
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
```ts
|
|
@@ -19,10 +19,10 @@ createApp(App).use(createMavis()).mount('#app')
|
|
|
19
19
|
|
|
20
20
|
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.
|
|
21
21
|
|
|
22
|
-
Themes and Vue context come from `@getcortexlabs/mavis-core`. This source checkout requires Jolt 0.1.0-rc.
|
|
22
|
+
Themes and Vue context come from `@getcortexlabs/mavis-core`. This source checkout requires Jolt 0.1.0-rc.9 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).
|
|
23
23
|
|
|
24
24
|
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.
|
|
25
25
|
|
|
26
26
|
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 alpha boundary.
|
|
27
27
|
|
|
28
|
-
Alpha.
|
|
28
|
+
Alpha.7 requires Jolt **0.1.0-rc.9** for orchestration, deferred Web attachment, keyed items and horizontal scroll. Keep the Mavis packages at the same version. Rebuild native applications after upgrading Jolt.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type ChoicePaint } from '@getcortexlabs/mavis-core';
|
|
3
|
+
/** One paint owner per decorative surface; native control semantics remain in the parent. */
|
|
4
|
+
export declare const ChoicePaintSurface: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
paint: {
|
|
6
|
+
type: PropType<ChoicePaint>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
paint: {
|
|
13
|
+
type: PropType<ChoicePaint>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
//# sourceMappingURL=ChoicePaint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChoicePaint.d.ts","sourceRoot":"","sources":["../../src/components/ChoicePaint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnE,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAK1E,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB;;cAGK,QAAQ,CAAC,WAAW,CAAC;;;;;;;cAArB,QAAQ,CAAC,WAAW,CAAC;;;iGAqFvD,CAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent, h, ref, watch } from 'vue';
|
|
2
|
+
import { choiceMotion } 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
|
+
/** One paint owner per decorative surface; native control semantics remain in the parent. */
|
|
7
|
+
export const ChoicePaintSurface = defineComponent({
|
|
8
|
+
name: 'MavisChoicePaint',
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
props: { paint: { type: Object, required: true } },
|
|
11
|
+
setup(props, { slots, attrs }) {
|
|
12
|
+
const element = ref();
|
|
13
|
+
const { theme } = useMavisTheme();
|
|
14
|
+
const forcedColors = ref(false);
|
|
15
|
+
const initial = {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
inset: 'calc(-1 * var(--m-choice-border, 0px))',
|
|
18
|
+
border: 'inherit',
|
|
19
|
+
borderRadius: 'inherit',
|
|
20
|
+
boxSizing: 'border-box',
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
...props.paint,
|
|
25
|
+
};
|
|
26
|
+
useConnectedMotion(element, useMotionContext(), (runtime, target) => {
|
|
27
|
+
const forced = target.ownerDocument.defaultView.matchMedia('(forced-colors: active)');
|
|
28
|
+
let playback;
|
|
29
|
+
let geometry;
|
|
30
|
+
function update(instant = false) {
|
|
31
|
+
forcedColors.value = forced.matches;
|
|
32
|
+
if (forced.matches) {
|
|
33
|
+
playback?.stop();
|
|
34
|
+
playback = undefined;
|
|
35
|
+
runtime.release(target);
|
|
36
|
+
geometry?.dispose();
|
|
37
|
+
geometry = undefined;
|
|
38
|
+
for (const key of ['background-color', 'border-color', 'color'])
|
|
39
|
+
target.style.removeProperty(key);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (!geometry) {
|
|
43
|
+
runtime.set(target, props.paint);
|
|
44
|
+
geometry = runtime.observeGeometry(target);
|
|
45
|
+
}
|
|
46
|
+
const previous = playback;
|
|
47
|
+
playback = runtime.animate(target, props.paint, instant ? { duration: 0 } : choiceMotion(theme.value));
|
|
48
|
+
previous?.stop();
|
|
49
|
+
}
|
|
50
|
+
const changed = () => update(true);
|
|
51
|
+
forced.addEventListener('change', changed);
|
|
52
|
+
update(true);
|
|
53
|
+
const unwatch = watch(() => [props.paint, theme.value.motion], () => update(), { deep: true, flush: 'post' });
|
|
54
|
+
return () => {
|
|
55
|
+
unwatch();
|
|
56
|
+
forced.removeEventListener('change', changed);
|
|
57
|
+
playback?.stop();
|
|
58
|
+
runtime.release(target);
|
|
59
|
+
geometry?.dispose();
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
return () => h('span', { ...attrs, 'aria-hidden': 'true' }, [
|
|
63
|
+
h('span', {
|
|
64
|
+
ref: element,
|
|
65
|
+
style: {
|
|
66
|
+
...initial,
|
|
67
|
+
// Vue patches style objects on slot updates. Preserve the paint written by Jolt.
|
|
68
|
+
...Object.fromEntries(Object.keys(props.paint).map((key) => [
|
|
69
|
+
key,
|
|
70
|
+
forcedColors.value
|
|
71
|
+
? undefined
|
|
72
|
+
: element.value?.style?.[key] ||
|
|
73
|
+
initial[key],
|
|
74
|
+
])),
|
|
75
|
+
},
|
|
76
|
+
'data-m-choice-paint': '',
|
|
77
|
+
}, slots.default?.()),
|
|
78
|
+
]);
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=ChoicePaint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChoicePaint.js","sourceRoot":"","sources":["../../src/components/ChoicePaint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAiB,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,YAAY,EAAoB,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;IAChD,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAA+B,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;IAC3E,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QAC3B,MAAM,OAAO,GAAG,GAAG,EAAe,CAAA;QAClC,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,EAAE,CAAA;Q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AAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;wBACpC,GAAG;wBACH,YAAY,CAAC,KAAK;4BAChB,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,GAAwB,CAAC;gCAChD,OAAO,CAAC,GAA2B,CAAC;qBACzC,CAAC,CACH;iBACF;gBACD,qBAAqB,EAAE,EAAE;aAC1B,EACD,KAAK,CAAC,OAAO,EAAE,EAAE,CAClB;SACF,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -83,13 +83,13 @@ export declare const DateCalendar: import("vue").DefineComponent<import("vue").E
|
|
|
83
83
|
onSelect?: ((value: `${number}-${number}-${number}`) => any) | undefined;
|
|
84
84
|
"onUpdate:activeDate"?: ((value: `${number}-${number}-${number}`) => any) | undefined;
|
|
85
85
|
}>, {
|
|
86
|
+
min: `${number}-${number}-${number}`;
|
|
87
|
+
max: `${number}-${number}-${number}`;
|
|
88
|
+
locale: import("@getcortexlabs/mavis-core").DateLocale;
|
|
86
89
|
selected: `${number}-${number}-${number}` | null;
|
|
87
90
|
rangeStart: `${number}-${number}-${number}` | null;
|
|
88
91
|
rangeEnd: `${number}-${number}-${number}` | null;
|
|
89
|
-
min: `${number}-${number}-${number}`;
|
|
90
|
-
max: `${number}-${number}-${number}`;
|
|
91
92
|
unavailableDates: readonly `${number}-${number}-${number}`[];
|
|
92
|
-
locale: import("@getcortexlabs/mavis-core").DateLocale;
|
|
93
93
|
firstDayOfWeek: number;
|
|
94
94
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
95
95
|
//# sourceMappingURL=DateCalendar.d.ts.map
|
|
@@ -64,7 +64,7 @@ export declare const MBadge: import("vue").DefineComponent<import("vue").Extract
|
|
|
64
64
|
id: string;
|
|
65
65
|
accessibilityLabel: string;
|
|
66
66
|
accessibilityHidden: boolean;
|
|
67
|
-
size: "sm" | "md";
|
|
68
67
|
tone: "primary" | "accent" | "warning" | "success" | "danger" | "neutral";
|
|
68
|
+
size: "sm" | "md";
|
|
69
69
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
70
70
|
//# sourceMappingURL=MBadge.d.ts.map
|