@getcortexlabs/mavis-core 0.1.0-alpha.4 → 0.1.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +2 -2
  2. package/dist/capabilities.d.ts +119 -0
  3. package/dist/capabilities.d.ts.map +1 -0
  4. package/dist/capabilities.js +142 -0
  5. package/dist/capabilities.js.map +1 -0
  6. package/dist/combobox.d.ts +42 -0
  7. package/dist/combobox.d.ts.map +1 -0
  8. package/dist/combobox.js +159 -0
  9. package/dist/combobox.js.map +1 -0
  10. package/dist/contracts.d.ts +1201 -0
  11. package/dist/contracts.d.ts.map +1 -0
  12. package/dist/contracts.js +242 -0
  13. package/dist/contracts.js.map +1 -0
  14. package/dist/date.d.ts +96 -0
  15. package/dist/date.d.ts.map +1 -0
  16. package/dist/date.js +235 -0
  17. package/dist/date.js.map +1 -0
  18. package/dist/experimental-regions.d.ts +142 -0
  19. package/dist/experimental-regions.d.ts.map +1 -0
  20. package/dist/experimental-regions.js +315 -0
  21. package/dist/experimental-regions.js.map +1 -0
  22. package/dist/experimental.d.ts +13 -1
  23. package/dist/experimental.d.ts.map +1 -1
  24. package/dist/experimental.js +153 -23
  25. package/dist/experimental.js.map +1 -1
  26. package/dist/files.d.ts +87 -0
  27. package/dist/files.d.ts.map +1 -0
  28. package/dist/files.js +328 -0
  29. package/dist/files.js.map +1 -0
  30. package/dist/form.d.ts +39 -0
  31. package/dist/form.d.ts.map +1 -0
  32. package/dist/form.js +170 -0
  33. package/dist/form.js.map +1 -0
  34. package/dist/index.d.ts +9 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +7 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/navigation.d.ts +22 -0
  39. package/dist/navigation.d.ts.map +1 -0
  40. package/dist/navigation.js +54 -0
  41. package/dist/navigation.js.map +1 -0
  42. package/dist/vue/combobox.d.ts +155 -0
  43. package/dist/vue/combobox.d.ts.map +1 -0
  44. package/dist/vue/combobox.js +195 -0
  45. package/dist/vue/combobox.js.map +1 -0
  46. package/dist/vue/component-props.d.ts +1989 -0
  47. package/dist/vue/component-props.d.ts.map +1 -0
  48. package/dist/vue/component-props.js +18 -0
  49. package/dist/vue/component-props.js.map +1 -0
  50. package/dist/vue/contracts.d.ts +18 -0
  51. package/dist/vue/contracts.d.ts.map +1 -0
  52. package/dist/vue/contracts.js +18 -0
  53. package/dist/vue/contracts.js.map +1 -0
  54. package/dist/vue/date-calendar.d.ts +64 -0
  55. package/dist/vue/date-calendar.d.ts.map +1 -0
  56. package/dist/vue/date-calendar.js +65 -0
  57. package/dist/vue/date-calendar.js.map +1 -0
  58. package/dist/vue/date-picker.d.ts +927 -0
  59. package/dist/vue/date-picker.d.ts.map +1 -0
  60. package/dist/vue/date-picker.js +319 -0
  61. package/dist/vue/date-picker.js.map +1 -0
  62. package/dist/vue/date-props.d.ts +254 -0
  63. package/dist/vue/date-props.d.ts.map +1 -0
  64. package/dist/vue/date-props.js +74 -0
  65. package/dist/vue/date-props.js.map +1 -0
  66. package/dist/vue/files.d.ts +53 -0
  67. package/dist/vue/files.d.ts.map +1 -0
  68. package/dist/vue/files.js +40 -0
  69. package/dist/vue/files.js.map +1 -0
  70. package/dist/vue/forms.d.ts +4 -0
  71. package/dist/vue/forms.d.ts.map +1 -0
  72. package/dist/vue/forms.js +15 -0
  73. package/dist/vue/forms.js.map +1 -0
  74. package/dist/vue/global-components.d.ts +35 -2
  75. package/dist/vue/global-components.d.ts.map +1 -1
  76. package/dist/vue/index.d.ts +12 -2
  77. package/dist/vue/index.d.ts.map +1 -1
  78. package/dist/vue/index.js +10 -1
  79. package/dist/vue/index.js.map +1 -1
  80. package/dist/vue/inline-content.d.ts +3 -1
  81. package/dist/vue/inline-content.d.ts.map +1 -1
  82. package/dist/vue/props.d.ts +1026 -495
  83. package/dist/vue/props.d.ts.map +1 -1
  84. package/dist/vue/props.js +17 -118
  85. package/dist/vue/props.js.map +1 -1
  86. package/dist/vue/workflow-props.d.ts +110 -0
  87. package/dist/vue/workflow-props.d.ts.map +1 -0
  88. package/dist/vue/workflow-props.js +37 -0
  89. package/dist/vue/workflow-props.js.map +1 -0
  90. package/dist/vue/workflows.d.ts +267 -0
  91. package/dist/vue/workflows.d.ts.map +1 -0
  92. package/dist/vue/workflows.js +200 -0
  93. package/dist/vue/workflows.js.map +1 -0
  94. package/package.json +1 -1
  95. package/src/capabilities.ts +145 -0
  96. package/src/combobox.ts +198 -0
  97. package/src/contracts.ts +295 -0
  98. package/src/date.ts +280 -0
  99. package/src/experimental-regions.ts +463 -0
  100. package/src/experimental.ts +158 -16
  101. package/src/files.ts +408 -0
  102. package/src/form.ts +190 -0
  103. package/src/index.ts +17 -0
  104. package/src/navigation.ts +61 -0
  105. package/src/vue/combobox.ts +238 -0
  106. package/src/vue/component-props.ts +24 -0
  107. package/src/vue/contracts.ts +33 -0
  108. package/src/vue/date-calendar.ts +76 -0
  109. package/src/vue/date-picker.ts +387 -0
  110. package/src/vue/date-props.ts +81 -0
  111. package/src/vue/files.ts +53 -0
  112. package/src/vue/forms.ts +20 -0
  113. package/src/vue/global-components.ts +44 -2
  114. package/src/vue/index.ts +13 -2
  115. package/src/vue/props.ts +34 -130
  116. package/src/vue/workflow-props.ts +41 -0
  117. package/src/vue/workflows.ts +257 -0
@@ -0,0 +1,267 @@
1
+ import { type Component } from '@vue/runtime-core';
2
+ import { type ChoiceValue } from '../choice.js';
3
+ interface Primitives {
4
+ Column: Component;
5
+ Row: Component;
6
+ Text: Component;
7
+ Button: Component;
8
+ preserveFocus?: (root: unknown, currentId: string) => () => void;
9
+ }
10
+ /** Composed controls share behavior; each supplied primitive owns its platform rendering. */
11
+ export declare function createWorkflows(ui: Primitives, platform: 'web' | 'native'): {
12
+ MFormGroup: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
13
+ label: {
14
+ type: StringConstructor;
15
+ required: true;
16
+ };
17
+ description: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ id: {
22
+ type: StringConstructor;
23
+ default: undefined;
24
+ };
25
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
26
+ [key: string]: any;
27
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
28
+ label: {
29
+ type: StringConstructor;
30
+ required: true;
31
+ };
32
+ description: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
36
+ id: {
37
+ type: StringConstructor;
38
+ default: undefined;
39
+ };
40
+ }>> & Readonly<{}>, {
41
+ id: string;
42
+ description: string;
43
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
44
+ MFormErrors: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
45
+ form: {
46
+ type: import("@vue/runtime-core").PropType<import("../form.js").FormController>;
47
+ required: true;
48
+ };
49
+ title: {
50
+ type: StringConstructor;
51
+ default: string;
52
+ };
53
+ announce: BooleanConstructor;
54
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
55
+ [key: string]: any;
56
+ }> | null, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
57
+ focus: (_field: string, _focused: boolean) => true;
58
+ }, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
59
+ form: {
60
+ type: import("@vue/runtime-core").PropType<import("../form.js").FormController>;
61
+ required: true;
62
+ };
63
+ title: {
64
+ type: StringConstructor;
65
+ default: string;
66
+ };
67
+ announce: BooleanConstructor;
68
+ }>> & Readonly<{
69
+ onFocus?: ((_field: string, _focused: boolean) => any) | undefined;
70
+ }>, {
71
+ title: string;
72
+ announce: boolean;
73
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
74
+ MSteps: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
75
+ steps: {
76
+ type: import("@vue/runtime-core").PropType<readonly import("../navigation.js").StepOption[]>;
77
+ required: true;
78
+ };
79
+ modelValue: {
80
+ type: import("@vue/runtime-core").PropType<ChoiceValue | null>;
81
+ default: null;
82
+ };
83
+ label: {
84
+ type: StringConstructor;
85
+ required: true;
86
+ };
87
+ disabled: BooleanConstructor;
88
+ loading: BooleanConstructor;
89
+ currentLabel: {
90
+ type: StringConstructor;
91
+ default: string;
92
+ };
93
+ completeLabel: {
94
+ type: StringConstructor;
95
+ default: string;
96
+ };
97
+ errorLabel: {
98
+ type: StringConstructor;
99
+ default: string;
100
+ };
101
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
102
+ [key: string]: any;
103
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
104
+ 'update:modelValue': (_value: ChoiceValue) => true;
105
+ }, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
106
+ steps: {
107
+ type: import("@vue/runtime-core").PropType<readonly import("../navigation.js").StepOption[]>;
108
+ required: true;
109
+ };
110
+ modelValue: {
111
+ type: import("@vue/runtime-core").PropType<ChoiceValue | null>;
112
+ default: null;
113
+ };
114
+ label: {
115
+ type: StringConstructor;
116
+ required: true;
117
+ };
118
+ disabled: BooleanConstructor;
119
+ loading: BooleanConstructor;
120
+ currentLabel: {
121
+ type: StringConstructor;
122
+ default: string;
123
+ };
124
+ completeLabel: {
125
+ type: StringConstructor;
126
+ default: string;
127
+ };
128
+ errorLabel: {
129
+ type: StringConstructor;
130
+ default: string;
131
+ };
132
+ }>> & Readonly<{
133
+ "onUpdate:modelValue"?: ((_value: ChoiceValue) => any) | undefined;
134
+ }>, {
135
+ loading: boolean;
136
+ disabled: boolean;
137
+ modelValue: ChoiceValue | null;
138
+ currentLabel: string;
139
+ completeLabel: string;
140
+ errorLabel: string;
141
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
142
+ MPagination: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
143
+ modelValue: {
144
+ type: NumberConstructor;
145
+ default: number;
146
+ };
147
+ total: {
148
+ type: NumberConstructor;
149
+ required: true;
150
+ };
151
+ pageSize: {
152
+ type: NumberConstructor;
153
+ default: number;
154
+ };
155
+ siblingCount: {
156
+ type: NumberConstructor;
157
+ default: number;
158
+ };
159
+ label: {
160
+ type: StringConstructor;
161
+ default: string;
162
+ };
163
+ previousLabel: {
164
+ type: StringConstructor;
165
+ default: string;
166
+ };
167
+ nextLabel: {
168
+ type: StringConstructor;
169
+ default: string;
170
+ };
171
+ pageLabel: {
172
+ type: StringConstructor;
173
+ default: string;
174
+ };
175
+ currentLabel: {
176
+ type: StringConstructor;
177
+ default: string;
178
+ };
179
+ statusText: {
180
+ type: StringConstructor;
181
+ default: string;
182
+ };
183
+ emptyLabel: {
184
+ type: StringConstructor;
185
+ default: string;
186
+ };
187
+ invalidPageLabel: {
188
+ type: StringConstructor;
189
+ default: string;
190
+ };
191
+ loading: BooleanConstructor;
192
+ disabled: BooleanConstructor;
193
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
194
+ [key: string]: any;
195
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
196
+ 'update:modelValue': (_page: number) => true;
197
+ }, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
198
+ modelValue: {
199
+ type: NumberConstructor;
200
+ default: number;
201
+ };
202
+ total: {
203
+ type: NumberConstructor;
204
+ required: true;
205
+ };
206
+ pageSize: {
207
+ type: NumberConstructor;
208
+ default: number;
209
+ };
210
+ siblingCount: {
211
+ type: NumberConstructor;
212
+ default: number;
213
+ };
214
+ label: {
215
+ type: StringConstructor;
216
+ default: string;
217
+ };
218
+ previousLabel: {
219
+ type: StringConstructor;
220
+ default: string;
221
+ };
222
+ nextLabel: {
223
+ type: StringConstructor;
224
+ default: string;
225
+ };
226
+ pageLabel: {
227
+ type: StringConstructor;
228
+ default: string;
229
+ };
230
+ currentLabel: {
231
+ type: StringConstructor;
232
+ default: string;
233
+ };
234
+ statusText: {
235
+ type: StringConstructor;
236
+ default: string;
237
+ };
238
+ emptyLabel: {
239
+ type: StringConstructor;
240
+ default: string;
241
+ };
242
+ invalidPageLabel: {
243
+ type: StringConstructor;
244
+ default: string;
245
+ };
246
+ loading: BooleanConstructor;
247
+ disabled: BooleanConstructor;
248
+ }>> & Readonly<{
249
+ "onUpdate:modelValue"?: ((_page: number) => any) | undefined;
250
+ }>, {
251
+ label: string;
252
+ loading: boolean;
253
+ disabled: boolean;
254
+ modelValue: number;
255
+ emptyLabel: string;
256
+ currentLabel: string;
257
+ pageSize: number;
258
+ siblingCount: number;
259
+ previousLabel: string;
260
+ nextLabel: string;
261
+ pageLabel: string;
262
+ statusText: string;
263
+ invalidPageLabel: string;
264
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
265
+ };
266
+ export {};
267
+ //# sourceMappingURL=workflows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/vue/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAK1D,UAAU,UAAU;IAClB,MAAM,EAAE,SAAS,CAAA;IACjB,GAAG,EAAE,SAAS,CAAA;IACd,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,SAAS,CAAA;IACjB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,IAAI,CAAA;CACjE;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,GAAG,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsC7C,MAAM,YAAY,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAuDX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAuDZ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiF/C"}
@@ -0,0 +1,200 @@
1
+ import { defineComponent, h, mergeProps, shallowRef, watch, onScopeDispose, onBeforeUpdate, onUpdated, nextTick, useId, } from '@vue/runtime-core';
2
+ import { choiceKey } from '../choice.js';
3
+ import { pagination, validateSteps } from '../navigation.js';
4
+ import { formErrorsProps, formGroupProps, stepsProps, paginationProps } from './workflow-props.js';
5
+ import { useMavisTheme } from './theme.js';
6
+ /** Composed controls share behavior; each supplied primitive owns its platform rendering. */
7
+ export function createWorkflows(ui, platform) {
8
+ const MFormGroup = defineComponent({
9
+ name: 'MFormGroup',
10
+ inheritAttrs: false,
11
+ props: formGroupProps,
12
+ setup(props, { attrs, slots }) {
13
+ const generatedId = `m-form-group-${useId()}`;
14
+ return () => {
15
+ if (!props.label.trim())
16
+ throw new TypeError('Form groups require a visible label.');
17
+ const id = props.id ?? generatedId;
18
+ return h(ui.Column, mergeProps({ gap: 'md', id }, attrs, platform === 'web'
19
+ ? {
20
+ role: 'group',
21
+ 'aria-labelledby': `${id}-label`,
22
+ 'aria-describedby': props.description ? `${id}-description` : undefined,
23
+ }
24
+ : {}), () => [
25
+ h(ui.Text, { id: `${id}-label`, as: 'h2', variant: 'heading', text: props.label }),
26
+ props.description
27
+ ? h(ui.Text, { id: `${id}-description`, tone: 'muted', text: props.description })
28
+ : null,
29
+ slots.default?.(),
30
+ ]);
31
+ };
32
+ },
33
+ });
34
+ const MFormErrors = defineComponent({
35
+ name: 'MFormErrors',
36
+ inheritAttrs: false,
37
+ props: formErrorsProps,
38
+ emits: { focus: (_field, _focused) => true },
39
+ setup(props, { attrs, emit }) {
40
+ const { theme } = useMavisTheme();
41
+ const id = `m-form-errors-${useId()}`;
42
+ const revision = shallowRef(0);
43
+ let release;
44
+ watch(() => props.form, (form) => {
45
+ release?.();
46
+ release = form.subscribe(() => {
47
+ revision.value++;
48
+ });
49
+ revision.value++;
50
+ }, { immediate: true });
51
+ onScopeDispose(() => release?.());
52
+ return () => {
53
+ void revision.value;
54
+ const { errors } = props.form.state;
55
+ if (!errors.length)
56
+ return null;
57
+ return h(ui.Column, mergeProps({ gap: 'sm', padding: 'md', radius: 'md', backgroundColor: theme.value.colors.surface }, attrs, platform === 'web'
58
+ ? { role: props.announce ? 'alert' : 'region', 'aria-labelledby': id }
59
+ : {}), () => [
60
+ h(ui.Text, { id, as: 'h2', variant: 'heading', tone: 'danger', text: props.title }),
61
+ ...errors.map((error, index) => h(ui.Button, {
62
+ key: `${error.field}:${index}`,
63
+ variant: 'ghost',
64
+ disabled: !props.form.has(error.field),
65
+ text: props.form.label(error.field)
66
+ ? `${props.form.label(error.field)}: ${error.message}`
67
+ : error.message,
68
+ onClick: async () => {
69
+ emit('focus', error.field, await props.form.focusError(error.field));
70
+ },
71
+ })),
72
+ ]);
73
+ };
74
+ },
75
+ });
76
+ const MSteps = defineComponent({
77
+ name: 'MSteps',
78
+ inheritAttrs: false,
79
+ props: stepsProps,
80
+ emits: { 'update:modelValue': (_value) => true },
81
+ setup(props, { attrs, emit }) {
82
+ return () => {
83
+ if (!props.label.trim())
84
+ throw new TypeError('Steps require a navigation label.');
85
+ validateSteps(props.steps, props.modelValue);
86
+ return h(ui.Row, mergeProps({ gap: 'sm', wrap: true }, attrs, platform === 'web' ? { role: 'navigation', 'aria-label': props.label } : {}), () => props.steps.map((step, index) => {
87
+ const current = step.value === props.modelValue;
88
+ const status = [
89
+ current ? props.currentLabel : '',
90
+ step.status === 'error'
91
+ ? props.errorLabel
92
+ : step.status === 'complete'
93
+ ? props.completeLabel
94
+ : '',
95
+ ]
96
+ .filter(Boolean)
97
+ .join(' · ');
98
+ return h(ui.Column, { key: choiceKey(step.value), gap: 'xs', grow: 1 }, () => [
99
+ h(ui.Button, {
100
+ text: `${index + 1}. ${step.label}`,
101
+ variant: current ? 'primary' : 'secondary',
102
+ disabled: props.disabled || step.disabled || (props.loading && !current),
103
+ loading: props.loading && current,
104
+ accessibilityLabel: `${index + 1}. ${step.label}${status ? `. ${status}` : ''}`,
105
+ ...(platform === 'web' ? { 'aria-current': current ? 'step' : undefined } : {}),
106
+ onClick: () => {
107
+ if (!props.disabled && !props.loading && !step.disabled && !current)
108
+ emit('update:modelValue', step.value);
109
+ },
110
+ }),
111
+ status
112
+ ? h(ui.Text, {
113
+ variant: 'caption',
114
+ tone: step.status === 'error' ? 'danger' : 'muted',
115
+ text: status,
116
+ })
117
+ : null,
118
+ ]);
119
+ }));
120
+ };
121
+ },
122
+ });
123
+ const MPagination = defineComponent({
124
+ name: 'MPagination',
125
+ inheritAttrs: false,
126
+ props: paginationProps,
127
+ emits: { 'update:modelValue': (_page) => true },
128
+ setup(props, { attrs, emit }) {
129
+ const root = shallowRef();
130
+ const id = `m-pagination-${useId()}`;
131
+ let restore = () => { };
132
+ onBeforeUpdate(() => {
133
+ restore = ui.preserveFocus?.(root.value, `${id}-page-${props.modelValue}`) ?? (() => { });
134
+ });
135
+ onUpdated(() => {
136
+ const apply = restore;
137
+ void nextTick(apply);
138
+ });
139
+ const request = (page) => {
140
+ if (page !== null && page !== props.modelValue && !props.disabled && !props.loading)
141
+ emit('update:modelValue', page);
142
+ };
143
+ return () => {
144
+ if (!props.label.trim())
145
+ throw new TypeError('Pagination requires a navigation label.');
146
+ const state = pagination(props.total, props.pageSize, props.modelValue, props.siblingCount);
147
+ return h(ui.Column, mergeProps({ gap: 'sm', ref: root }, attrs, platform === 'web' ? { role: 'navigation', 'aria-label': props.label } : {}), () => [
148
+ props.statusText
149
+ ? h(ui.Text, {
150
+ text: props.statusText,
151
+ variant: 'caption',
152
+ tone: 'muted',
153
+ ...(platform === 'web'
154
+ ? { role: 'status', 'aria-live': 'polite', 'aria-atomic': 'true' }
155
+ : { accessibilityLiveRegion: 'polite' }),
156
+ })
157
+ : null,
158
+ state.count === 0 ? h(ui.Text, { tone: 'muted', text: props.emptyLabel }) : null,
159
+ state.outOfRange ? h(ui.Text, { tone: 'danger', text: props.invalidPageLabel }) : null,
160
+ h(ui.Row, { gap: 'sm', wrap: true }, () => [
161
+ h(ui.Button, {
162
+ variant: 'secondary',
163
+ text: props.previousLabel,
164
+ disabled: props.disabled || state.previous === null,
165
+ loading: props.loading,
166
+ loadingText: props.previousLabel,
167
+ onClick: () => request(state.previous),
168
+ }),
169
+ ...state.items.map((item) => item.kind === 'gap'
170
+ ? h(ui.Text, { key: item.key, text: '…', accessibilityHidden: true })
171
+ : h(ui.Button, {
172
+ key: item.page,
173
+ text: String(item.page),
174
+ accessibilityLabel: `${props.pageLabel} ${item.page}${platform === 'native' && item.page === props.modelValue ? `. ${props.currentLabel}` : ''}`,
175
+ variant: item.page === props.modelValue ? 'primary' : 'ghost',
176
+ id: `${id}-page-${item.page}`,
177
+ disabled: props.disabled,
178
+ loading: props.loading,
179
+ loadingText: String(item.page),
180
+ ...(platform === 'web'
181
+ ? { 'aria-current': item.page === props.modelValue ? 'page' : undefined }
182
+ : {}),
183
+ onClick: () => request(item.page),
184
+ })),
185
+ h(ui.Button, {
186
+ variant: 'secondary',
187
+ text: props.nextLabel,
188
+ disabled: props.disabled || state.next === null,
189
+ loading: props.loading,
190
+ loadingText: props.nextLabel,
191
+ onClick: () => request(state.next),
192
+ }),
193
+ ]),
194
+ ]);
195
+ };
196
+ },
197
+ });
198
+ return { MFormGroup, MFormErrors, MSteps, MPagination };
199
+ }
200
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/vue/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,CAAC,EACD,UAAU,EACV,UAAU,EACV,KAAK,EACL,cAAc,EACd,cAAc,EACd,SAAS,EACT,QAAQ,EACR,KAAK,GAEN,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAU1C,6FAA6F;AAC7F,MAAM,UAAU,eAAe,CAAC,EAAc,EAAE,QAA0B;IACxE,MAAM,UAAU,GAAG,eAAe,CAAC;QACjC,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,cAAc;QACrB,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;YAC3B,MAAM,WAAW,GAAG,gBAAgB,KAAK,EAAE,EAAE,CAAA;YAC7C,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;oBAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAA;gBACpF,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,WAAW,CAAA;gBAClC,OAAO,CAAC,CACN,EAAE,CAAC,MAAM,EACT,UAAU,CACR,EAAE,GAAG,EAAE,IAAI,EAAE,E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G,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;6BAClC,CAAC,CACP;wBACD,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE;4BACX,OAAO,EAAE,WAAW;4BACpB,IAAI,EAAE,KAAK,CAAC,SAAS;4BACrB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;4BAC/C,OAAO,EAAE,KAAK,CAAC,OAAO;4BACtB,WAAW,EAAE,KAAK,CAAC,SAAS;4BAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;yBACnC,CAAC;qBACH,CAAC;iBACH,CACF,CAAA;YACH,CAAC,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IACF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,CAAA;AACzD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getcortexlabs/mavis-core",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.5",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Shared Mavis themes and component contracts.",
@@ -0,0 +1,145 @@
1
+ /** Source capabilities, not a promise that every feature is in the last npm release. */
2
+ export const componentNames = [
3
+ 'MScreen',
4
+ 'MRow',
5
+ 'MColumn',
6
+ 'MBox',
7
+ 'MCard',
8
+ 'MText',
9
+ 'MSpan',
10
+ 'MThemeProvider',
11
+ 'MIcon',
12
+ 'MButton',
13
+ 'MInput',
14
+ 'MSlider',
15
+ 'MSwitch',
16
+ 'MCheckbox',
17
+ 'MRadioGroup',
18
+ 'MSelect',
19
+ 'MSheet',
20
+ 'MDialog',
21
+ 'MToast',
22
+ 'MTabs',
23
+ 'MChip',
24
+ 'MEmptyState',
25
+ 'MAccordion',
26
+ 'MSegmentedControl',
27
+ 'MSkeleton',
28
+ 'MProgress',
29
+ 'MAlert',
30
+ 'MAvatar',
31
+ 'MBadge',
32
+ 'MListItem',
33
+ 'MSeparator',
34
+ 'MReveal',
35
+ 'MDatePicker',
36
+ 'MDateRangePicker',
37
+ 'MCombobox',
38
+ 'MFilePicker',
39
+ 'MFormGroup',
40
+ 'MFormErrors',
41
+ 'MSteps',
42
+ 'MPagination',
43
+ ] as const
44
+ export type ComponentName = (typeof componentNames)[number]
45
+ export type CapabilityStatus = 'experimental' | 'planned' | 'unsupported' | 'unverified'
46
+
47
+ export const targetCapabilities = {
48
+ version: 1,
49
+ source: 'repository',
50
+ publishedBaseline: '0.1.0-alpha.4',
51
+ targets: [
52
+ {
53
+ id: 'vue-web',
54
+ framework: 'vue',
55
+ renderer: 'dom',
56
+ status: 'experimental',
57
+ components: componentNames,
58
+ rendering: {
59
+ client: 'experimental',
60
+ serverImport: 'experimental',
61
+ serverHTML: 'experimental',
62
+ hydration: 'experimental',
63
+ ssg: 'experimental',
64
+ streaming: 'unverified',
65
+ rsc: 'unsupported',
66
+ },
67
+ motion: { engine: 'jolt', minimum: '0.1.0-rc.6', start: 'client-mount' },
68
+ ssr: {
69
+ availability: 'unreleased',
70
+ host: 'nuxt',
71
+ hostVersion: '4.6.3',
72
+ vueVersion: '3.5.44',
73
+ nodeVersion: '22.23.3',
74
+ preset: 'node-server',
75
+ deferred: [
76
+ 'sheet-dialog-presentation',
77
+ 'select-popup',
78
+ 'date-calendar',
79
+ 'combobox-results',
80
+ 'file-selection',
81
+ 'toast-presentation',
82
+ 'motion-measurement',
83
+ ],
84
+ preHydrationEditors: [
85
+ 'MInput',
86
+ 'MCheckbox',
87
+ 'MRadioGroup',
88
+ 'MSlider',
89
+ 'MDatePicker',
90
+ 'MDateRangePicker',
91
+ 'MCombobox',
92
+ ],
93
+ },
94
+ },
95
+ {
96
+ id: 'vue-nativescript',
97
+ framework: 'vue',
98
+ renderer: 'nativescript',
99
+ status: 'experimental',
100
+ components: componentNames,
101
+ rendering: {
102
+ client: 'experimental',
103
+ serverImport: 'unsupported',
104
+ serverHTML: 'unsupported',
105
+ hydration: 'unsupported',
106
+ ssg: 'unsupported',
107
+ streaming: 'unsupported',
108
+ rsc: 'unsupported',
109
+ },
110
+ motion: { engine: 'jolt', minimum: '0.1.0-rc.6', start: 'native-loaded' },
111
+ },
112
+ ],
113
+ planned: [
114
+ { id: 'react-web', issue: 145 },
115
+ { id: 'next', issue: 159 },
116
+ { id: 'angular-web', issue: 152 },
117
+ { id: 'svelte-web', issue: 153 },
118
+ { id: 'solid-web', issue: 154 },
119
+ { id: 'react-nativescript', issue: 35 },
120
+ { id: 'angular-nativescript', issue: 36 },
121
+ { id: 'svelte-nativescript', issue: 37 },
122
+ { id: 'solid-nativescript', issue: 38 },
123
+ { id: 'typescript-nativescript', issue: 39 },
124
+ ],
125
+ research: [
126
+ { id: 'react-native', issue: 40 },
127
+ { id: 'flutter', issue: 41 },
128
+ { id: 'swiftui-compose', issue: 42 },
129
+ ],
130
+ } as const
131
+
132
+ export const themeContract = {
133
+ version: 1,
134
+ units: {
135
+ layout: { web: 'css-px', nativescript: 'dip' },
136
+ dimension: ['layout-number', 'percent', 'auto'],
137
+ fontSize: 'layout',
138
+ lineHeight: 'ratio',
139
+ letterSpacing: 'em',
140
+ pressScale: 'multiplier',
141
+ },
142
+ tokens: ['colors', 'space', 'radius', 'typography', 'components', 'elevation', 'motion'],
143
+ fontFamily: ['system', 'shared-family-name', 'platform-family-record'],
144
+ ownership: 'application-or-controlled-scope',
145
+ } as const