@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
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { MotionRows } from './MotionRows.js'
|
|
2
|
+
import { h } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
createDiscoveryControls,
|
|
5
|
+
createCarousel,
|
|
6
|
+
createTreeView,
|
|
7
|
+
createDataTable,
|
|
8
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
9
|
+
import type { DataColumn } from '@getcortexlabs/mavis-core'
|
|
10
|
+
import { MRow, MColumn, MBox } from './layout.js'
|
|
11
|
+
import { MText } from './MText.js'
|
|
12
|
+
import { MButton } from './MButton.js'
|
|
13
|
+
import { MIcon } from './MIcon.js'
|
|
14
|
+
import { MSlider } from './MSlider.js'
|
|
15
|
+
import { MCheckbox } from './MCheckbox.js'
|
|
16
|
+
import { MProgress } from './MProgress.js'
|
|
17
|
+
import { MReveal } from './MReveal.js'
|
|
18
|
+
import { DateCalendar } from './DateCalendar.js'
|
|
19
|
+
|
|
20
|
+
const ui = {
|
|
21
|
+
Row: MRow,
|
|
22
|
+
Column: MColumn,
|
|
23
|
+
Box: MBox,
|
|
24
|
+
Text: MText,
|
|
25
|
+
Button: MButton,
|
|
26
|
+
Icon: MIcon,
|
|
27
|
+
Slider: MSlider,
|
|
28
|
+
Checkbox: MCheckbox,
|
|
29
|
+
Progress: MProgress,
|
|
30
|
+
Reveal: MReveal,
|
|
31
|
+
Calendar: DateCalendar,
|
|
32
|
+
}
|
|
33
|
+
export const { MCalendar, MRating } = createDiscoveryControls(ui, 'web')
|
|
34
|
+
export const MTreeView = createTreeView(
|
|
35
|
+
{
|
|
36
|
+
...ui,
|
|
37
|
+
focus: (id) => document.getElementById(id)?.focus(),
|
|
38
|
+
containsFocus: (id) => !!document.getElementById(id)?.contains(document.activeElement),
|
|
39
|
+
},
|
|
40
|
+
'web',
|
|
41
|
+
)
|
|
42
|
+
export const MCarousel = createCarousel(
|
|
43
|
+
{
|
|
44
|
+
...ui,
|
|
45
|
+
gestures: (move, direction) => ({
|
|
46
|
+
tabindex: 0,
|
|
47
|
+
onPointerdownCapture: (event: PointerEvent) => {
|
|
48
|
+
const host = event.currentTarget as HTMLElement
|
|
49
|
+
direction.value = getComputedStyle(host).direction === 'rtl' ? -1 : 1
|
|
50
|
+
if (event.defaultPrevented || !event.isPrimary || event.button !== 0) return
|
|
51
|
+
for (const node of event.composedPath()) {
|
|
52
|
+
if (node === host) break
|
|
53
|
+
if (
|
|
54
|
+
node instanceof Element &&
|
|
55
|
+
node.matches(
|
|
56
|
+
'button, a[href], input, select, textarea, [contenteditable], [role="button"]',
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
// Default pointer focus may scroll a tall slide and cancel Jolt's active drag.
|
|
62
|
+
// Keep keyboard navigation available without changing the viewport or consuming input.
|
|
63
|
+
host.focus({ preventScroll: true })
|
|
64
|
+
},
|
|
65
|
+
onKeydown: (event: KeyboardEvent) => {
|
|
66
|
+
if (event.target !== event.currentTarget || event.altKey || event.ctrlKey || event.metaKey)
|
|
67
|
+
return
|
|
68
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {
|
|
69
|
+
event.preventDefault()
|
|
70
|
+
direction.value =
|
|
71
|
+
getComputedStyle(event.currentTarget as HTMLElement).direction === 'rtl' ? -1 : 1
|
|
72
|
+
move((event.key === 'ArrowRight' ? 1 : -1) * direction.value)
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
'web',
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
// Theme access must happen in setup, not in the render callback supplied to the factory.
|
|
81
|
+
export const MDataTable = createDataTable(
|
|
82
|
+
{
|
|
83
|
+
...ui,
|
|
84
|
+
table: (columns, header, rows, label, busy) => {
|
|
85
|
+
const cell = (column: DataColumn) => ({
|
|
86
|
+
padding: '12px 16px',
|
|
87
|
+
minWidth: `${column.width ?? 144}px`,
|
|
88
|
+
width: column.width ? `${column.width}px` : undefined,
|
|
89
|
+
textAlign: column.align === 'end' ? ('end' as const) : ('start' as const),
|
|
90
|
+
verticalAlign: 'middle',
|
|
91
|
+
})
|
|
92
|
+
return h(
|
|
93
|
+
'div',
|
|
94
|
+
{
|
|
95
|
+
class: 'm-data-table-scroll',
|
|
96
|
+
tabindex: 0,
|
|
97
|
+
role: 'region',
|
|
98
|
+
'aria-label': label,
|
|
99
|
+
style: { overflowX: 'auto', borderRadius: 'inherit' },
|
|
100
|
+
},
|
|
101
|
+
[
|
|
102
|
+
h(
|
|
103
|
+
'table',
|
|
104
|
+
{
|
|
105
|
+
'aria-label': label,
|
|
106
|
+
'aria-busy': busy,
|
|
107
|
+
style: { width: '100%', borderCollapse: 'collapse' },
|
|
108
|
+
},
|
|
109
|
+
[
|
|
110
|
+
h('thead', [
|
|
111
|
+
h(
|
|
112
|
+
'tr',
|
|
113
|
+
columns.map((column, index) =>
|
|
114
|
+
h(
|
|
115
|
+
'th',
|
|
116
|
+
{
|
|
117
|
+
key: column.key,
|
|
118
|
+
scope: 'col',
|
|
119
|
+
'aria-sort': (column as DataColumn & { sort?: string }).sort,
|
|
120
|
+
style: cell(column),
|
|
121
|
+
},
|
|
122
|
+
[header[index]],
|
|
123
|
+
),
|
|
124
|
+
),
|
|
125
|
+
),
|
|
126
|
+
]),
|
|
127
|
+
h(MotionRows, {
|
|
128
|
+
nodes: rows.map((row) =>
|
|
129
|
+
h(
|
|
130
|
+
'tr',
|
|
131
|
+
{ key: row.key, 'data-selected': row.selected },
|
|
132
|
+
row.cells.map((content, index) =>
|
|
133
|
+
h('td', { key: columns[index]!.key, style: cell(columns[index]!) }, [
|
|
134
|
+
content,
|
|
135
|
+
]),
|
|
136
|
+
),
|
|
137
|
+
),
|
|
138
|
+
),
|
|
139
|
+
}),
|
|
140
|
+
],
|
|
141
|
+
),
|
|
142
|
+
],
|
|
143
|
+
)
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
'web',
|
|
147
|
+
)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent, h, ref } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
createNumberFlow,
|
|
4
|
+
createSortableList,
|
|
5
|
+
createSwipeActions,
|
|
6
|
+
sortableScrollProps,
|
|
7
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
8
|
+
import { useScrollMotion } from '../scroll-motion.js'
|
|
9
|
+
import { MBox, MColumn, MRow } from './layout.js'
|
|
10
|
+
import { MText } from './MText.js'
|
|
11
|
+
import { MButton } from './MButton.js'
|
|
12
|
+
import { MMenu } from './navigation.js'
|
|
13
|
+
|
|
14
|
+
const SortableScroll = defineComponent({
|
|
15
|
+
name: 'MSortableScroll',
|
|
16
|
+
props: sortableScrollProps,
|
|
17
|
+
setup(props, { slots }) {
|
|
18
|
+
const element = ref<HTMLElement>()
|
|
19
|
+
useScrollMotion(
|
|
20
|
+
element,
|
|
21
|
+
() => props.source,
|
|
22
|
+
() => true,
|
|
23
|
+
)
|
|
24
|
+
return () =>
|
|
25
|
+
h(
|
|
26
|
+
'div',
|
|
27
|
+
{
|
|
28
|
+
ref: element,
|
|
29
|
+
style: { height: `${props.height}px`, overflowY: 'auto', overscrollBehavior: 'contain' },
|
|
30
|
+
},
|
|
31
|
+
slots.default?.(),
|
|
32
|
+
)
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
const ui = { Box: MBox, Column: MColumn, Row: MRow, Text: MText, Button: MButton, Menu: MMenu }
|
|
36
|
+
export const MNumberFlow = createNumberFlow(MText, 'web')
|
|
37
|
+
export const MSortableList = createSortableList(
|
|
38
|
+
{
|
|
39
|
+
...ui,
|
|
40
|
+
Scroll: SortableScroll,
|
|
41
|
+
ListBody: MBox,
|
|
42
|
+
input: (fresh) => ({
|
|
43
|
+
onPointerdownCapture: (event: PointerEvent) => {
|
|
44
|
+
if (
|
|
45
|
+
event.isPrimary &&
|
|
46
|
+
event.button === 0 &&
|
|
47
|
+
event.target instanceof Element &&
|
|
48
|
+
!event.target.closest('[data-sort-handle]')
|
|
49
|
+
)
|
|
50
|
+
fresh()
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
'web',
|
|
55
|
+
)
|
|
56
|
+
export const MSwipeActions = createSwipeActions(ui, 'web')
|
|
57
|
+
export { MResizablePanels } from './MResizablePanels.js'
|
|
58
|
+
export { MImageCompare } from './MImageCompare.js'
|
|
59
|
+
|
|
60
|
+
export { MImageViewer } from './MImageViewer.js'
|
package/src/components/layout.ts
CHANGED
|
@@ -35,6 +35,7 @@ export function createLayout(name: string, direction: 'row' | 'column', tag = 'd
|
|
|
35
35
|
inheritAttrs: false,
|
|
36
36
|
props: direction === 'row' ? rowProps : columnProps,
|
|
37
37
|
setup(props, { attrs, slots }) {
|
|
38
|
+
const region = useMotionRegion(() => props.motionRegion)
|
|
38
39
|
const { theme } = useMavisTheme()
|
|
39
40
|
const shrink = useLayoutShrink()
|
|
40
41
|
provide(layoutDirection, direction)
|
|
@@ -54,6 +55,7 @@ export function createLayout(name: string, direction: 'row' | 'column', tag = 'd
|
|
|
54
55
|
},
|
|
55
56
|
},
|
|
56
57
|
webAttrs({ ...attrs, ...viewAttrs(props) }),
|
|
58
|
+
region,
|
|
57
59
|
),
|
|
58
60
|
slots.default?.(),
|
|
59
61
|
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createMenu, createNavigationControls } from '@getcortexlabs/mavis-core/vue'
|
|
2
|
+
import { MPopover } from './MPopover.js'
|
|
3
|
+
import { MRow, MColumn, MBox } from './layout.js'
|
|
4
|
+
import { MButton } from './MButton.js'
|
|
5
|
+
import { MText } from './MText.js'
|
|
6
|
+
import { MBadge } from './MBadge.js'
|
|
7
|
+
import { MSeparator } from './MSeparator.js'
|
|
8
|
+
|
|
9
|
+
export const { MAppBar, MTabBar } = createNavigationControls(
|
|
10
|
+
{ Box: MBox, Row: MRow, Column: MColumn, Text: MText, Button: MButton, Badge: MBadge },
|
|
11
|
+
'web',
|
|
12
|
+
)
|
|
13
|
+
export const MMenu = createMenu(
|
|
14
|
+
{ Popover: MPopover, Column: MColumn, Text: MText, Button: MButton, Separator: MSeparator },
|
|
15
|
+
(input) => {
|
|
16
|
+
const event = input as KeyboardEvent
|
|
17
|
+
const root = event.currentTarget as HTMLElement
|
|
18
|
+
const items = [...root.querySelectorAll<HTMLElement>('[role="menuitem"]:not(:disabled)')]
|
|
19
|
+
const current = items.indexOf(document.activeElement as HTMLElement)
|
|
20
|
+
let next = current
|
|
21
|
+
if (event.key === 'ArrowDown') next = (current + 1) % items.length
|
|
22
|
+
else if (event.key === 'ArrowUp') next = (current + items.length - 1) % items.length
|
|
23
|
+
else if (event.key === 'Home') next = 0
|
|
24
|
+
else if (event.key === 'End') next = items.length - 1
|
|
25
|
+
else if (
|
|
26
|
+
event.key.length === 1 &&
|
|
27
|
+
!event.ctrlKey &&
|
|
28
|
+
!event.metaKey &&
|
|
29
|
+
!event.altKey &&
|
|
30
|
+
event.key !== ' '
|
|
31
|
+
) {
|
|
32
|
+
const order = [...items.slice(current + 1), ...items.slice(0, current + 1)]
|
|
33
|
+
const match = order.find((item) =>
|
|
34
|
+
(item.getAttribute('aria-label') ?? item.textContent ?? '')
|
|
35
|
+
.trim()
|
|
36
|
+
.toLocaleLowerCase()
|
|
37
|
+
.startsWith(event.key.toLocaleLowerCase()),
|
|
38
|
+
)
|
|
39
|
+
if (match) next = items.indexOf(match)
|
|
40
|
+
} else return
|
|
41
|
+
event.preventDefault()
|
|
42
|
+
items[next]?.focus()
|
|
43
|
+
},
|
|
44
|
+
)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineComponent, h, mergeProps, ref } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
createAnimatedText,
|
|
4
|
+
createComposer,
|
|
5
|
+
createSpeedDial,
|
|
6
|
+
createScrollComponents,
|
|
7
|
+
scrollFrameHostProps,
|
|
8
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
9
|
+
import { useMotionRegion } from '../motion-region.js'
|
|
10
|
+
import { useScrollMotion } from '../scroll-motion.js'
|
|
11
|
+
import { MBox, MColumn, MRow } from './layout.js'
|
|
12
|
+
import { MCard } from './MCard.js'
|
|
13
|
+
import { MText } from './MText.js'
|
|
14
|
+
import { MInput } from './MInput.js'
|
|
15
|
+
import { MImage } from './MImage.js'
|
|
16
|
+
import { MButton } from './MButton.js'
|
|
17
|
+
import { MChip } from './MChip.js'
|
|
18
|
+
import { MPopover } from './MPopover.js'
|
|
19
|
+
|
|
20
|
+
const Frame = defineComponent({
|
|
21
|
+
name: 'MScrollFrameHost',
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
props: scrollFrameHostProps,
|
|
24
|
+
setup(props, { attrs, slots }) {
|
|
25
|
+
const motion = useMotionRegion(() => props.region)
|
|
26
|
+
const scroll = ref<HTMLElement>()
|
|
27
|
+
useScrollMotion(
|
|
28
|
+
scroll,
|
|
29
|
+
() => props.source,
|
|
30
|
+
() => true,
|
|
31
|
+
)
|
|
32
|
+
return () =>
|
|
33
|
+
h(
|
|
34
|
+
'div',
|
|
35
|
+
mergeProps(attrs, motion, {
|
|
36
|
+
class: 'm-scroll-frame',
|
|
37
|
+
style: {
|
|
38
|
+
position: 'relative',
|
|
39
|
+
height: `${props.height}px`,
|
|
40
|
+
minWidth: 0,
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
isolation: 'isolate',
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
[
|
|
46
|
+
h(
|
|
47
|
+
'div',
|
|
48
|
+
{
|
|
49
|
+
ref: scroll,
|
|
50
|
+
role: 'region',
|
|
51
|
+
'aria-label': props.label,
|
|
52
|
+
tabindex: 0,
|
|
53
|
+
class: 'm-scroll-frame-content',
|
|
54
|
+
style: {
|
|
55
|
+
height: '100%',
|
|
56
|
+
overflowY: 'auto',
|
|
57
|
+
overscrollBehaviorY: 'contain',
|
|
58
|
+
display: 'flex',
|
|
59
|
+
flexDirection: 'column',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
[h(MColumn, {}, { default: () => slots.default?.() })],
|
|
63
|
+
),
|
|
64
|
+
slots.overlay?.(),
|
|
65
|
+
],
|
|
66
|
+
)
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
const ui = {
|
|
70
|
+
Box: MBox,
|
|
71
|
+
Card: MCard,
|
|
72
|
+
Column: MColumn,
|
|
73
|
+
Row: MRow,
|
|
74
|
+
Text: MText,
|
|
75
|
+
Input: MInput,
|
|
76
|
+
Button: MButton,
|
|
77
|
+
Chip: MChip,
|
|
78
|
+
Image: MImage,
|
|
79
|
+
Popover: MPopover,
|
|
80
|
+
Frame,
|
|
81
|
+
}
|
|
82
|
+
export const MAnimatedText = createAnimatedText(MText)
|
|
83
|
+
export const MComposer = createComposer(ui, 'web')
|
|
84
|
+
export const MSpeedDial = createSpeedDial(ui)
|
|
85
|
+
export const { MCollapsibleHeader, MRefreshControl } = createScrollComponents(ui, 'web')
|
|
86
|
+
export { MPinInput } from './MPinInput.js'
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useComponentWidth } from '../component-width.js'
|
|
2
|
+
import {
|
|
3
|
+
createChart,
|
|
4
|
+
createCommandPalette,
|
|
5
|
+
createWayfindingControls,
|
|
6
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
7
|
+
import { MRow, MColumn, MBox } from './layout.js'
|
|
8
|
+
import { MText } from './MText.js'
|
|
9
|
+
import { MButton } from './MButton.js'
|
|
10
|
+
import { MLink } from './MLink.js'
|
|
11
|
+
import { MIcon } from './MIcon.js'
|
|
12
|
+
import { MBadge } from './MBadge.js'
|
|
13
|
+
import { MSeparator } from './MSeparator.js'
|
|
14
|
+
import { MSheet } from './MSheet.js'
|
|
15
|
+
import { MInput } from './MInput.js'
|
|
16
|
+
import { MSelect } from './MSelect.js'
|
|
17
|
+
import { MReveal } from './MReveal.js'
|
|
18
|
+
import { ChartPlot } from './ChartPlot.js'
|
|
19
|
+
const ui = {
|
|
20
|
+
railWidth: useComponentWidth,
|
|
21
|
+
focus: (component: unknown) => (component as { $el?: HTMLElement } | undefined)?.$el?.focus(),
|
|
22
|
+
Row: MRow,
|
|
23
|
+
Column: MColumn,
|
|
24
|
+
Box: MBox,
|
|
25
|
+
Text: MText,
|
|
26
|
+
Button: MButton,
|
|
27
|
+
Link: MLink,
|
|
28
|
+
Icon: MIcon,
|
|
29
|
+
Badge: MBadge,
|
|
30
|
+
Separator: MSeparator,
|
|
31
|
+
Sheet: MSheet,
|
|
32
|
+
Input: MInput,
|
|
33
|
+
Select: MSelect,
|
|
34
|
+
Reveal: MReveal,
|
|
35
|
+
Plot: ChartPlot,
|
|
36
|
+
}
|
|
37
|
+
export const { MNavigationRail, MBreadcrumb, MTimeline } = createWayfindingControls(ui, 'web')
|
|
38
|
+
export const MChart = createChart(ui, 'web')
|
|
39
|
+
export const MCommandPalette = createCommandPalette(
|
|
40
|
+
{
|
|
41
|
+
...ui,
|
|
42
|
+
focus: (component) => (component as { $el?: HTMLElement } | undefined)?.$el?.focus(),
|
|
43
|
+
shortcut: (callback, enabled) => {
|
|
44
|
+
const handler = (event: KeyboardEvent) => {
|
|
45
|
+
if (
|
|
46
|
+
!enabled() ||
|
|
47
|
+
event.defaultPrevented ||
|
|
48
|
+
event.repeat ||
|
|
49
|
+
event.isComposing ||
|
|
50
|
+
event.altKey ||
|
|
51
|
+
!(event.metaKey || event.ctrlKey) ||
|
|
52
|
+
event.key.toLowerCase() !== 'k'
|
|
53
|
+
)
|
|
54
|
+
return
|
|
55
|
+
const target = event.target as HTMLElement | null
|
|
56
|
+
if (
|
|
57
|
+
target?.closest(
|
|
58
|
+
'input,textarea,select,[contenteditable=""],[contenteditable="true"],dialog[open],[role="dialog"]',
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
return
|
|
62
|
+
event.preventDefault()
|
|
63
|
+
callback()
|
|
64
|
+
}
|
|
65
|
+
document.addEventListener('keydown', handler)
|
|
66
|
+
return () => document.removeEventListener('keydown', handler)
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
'web',
|
|
70
|
+
)
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MKanban,
|
|
3
|
+
MDonutChart,
|
|
4
|
+
MSparkline,
|
|
5
|
+
MGradientBackground,
|
|
6
|
+
MParticleField,
|
|
7
|
+
MConfetti,
|
|
8
|
+
} from './components/dashboard.js'
|
|
9
|
+
import {
|
|
10
|
+
MColorPicker,
|
|
11
|
+
MSwipeDeck,
|
|
12
|
+
MGauge,
|
|
13
|
+
MTour,
|
|
14
|
+
MTourTarget,
|
|
15
|
+
MTransferList,
|
|
16
|
+
MMarquee,
|
|
17
|
+
} from './components/creative.js'
|
|
18
|
+
import {
|
|
19
|
+
MCollapsibleHeader,
|
|
20
|
+
MRefreshControl,
|
|
21
|
+
MComposer,
|
|
22
|
+
MSpeedDial,
|
|
23
|
+
MPinInput,
|
|
24
|
+
MAnimatedText,
|
|
25
|
+
} from './components/screen-components.js'
|
|
26
|
+
import {
|
|
27
|
+
MImageViewer,
|
|
28
|
+
MNumberFlow,
|
|
29
|
+
MSortableList,
|
|
30
|
+
MSwipeActions,
|
|
31
|
+
MResizablePanels,
|
|
32
|
+
MImageCompare,
|
|
33
|
+
} from './components/interactive.js'
|
|
34
|
+
import {
|
|
35
|
+
MCommandPalette,
|
|
36
|
+
MNavigationRail,
|
|
37
|
+
MBreadcrumb,
|
|
38
|
+
MTimeline,
|
|
39
|
+
MChart,
|
|
40
|
+
} from './components/wayfinding.js'
|
|
41
|
+
import { MTooltip } from './components/MTooltip.js'
|
|
42
|
+
import { MDataTable, MCarousel, MCalendar, MRating, MTreeView } from './components/discovery.js'
|
|
43
|
+
import { MRangeSlider } from './components/MRangeSlider.js'
|
|
44
|
+
import { MPopover } from './components/MPopover.js'
|
|
45
|
+
import { MMenu, MAppBar, MTabBar } from './components/navigation.js'
|
|
46
|
+
import { MTimePicker } from './components/MTimePicker.js'
|
|
47
|
+
import { MVirtualList } from './components/MVirtualList.js'
|
|
1
48
|
import { MNumberInput, MMultiSelect } from './components/configurator.js'
|
|
2
49
|
import { MImage } from './components/MImage.js'
|
|
3
50
|
import { MStack } from './components/MStack.js'
|
|
@@ -14,7 +61,7 @@ import type { App, Component } from 'vue'
|
|
|
14
61
|
import { createMavisServices, type MavisServiceOptions } from './services.js'
|
|
15
62
|
export { createMavisServices } from './services.js'
|
|
16
63
|
export type { MavisServiceOptions, MavisIconOptions } from './services.js'
|
|
17
|
-
import { MThemeProvider, MSpan } from '@getcortexlabs/mavis-core/vue'
|
|
64
|
+
import { MThemeProvider, MSpan, MPlatform } from '@getcortexlabs/mavis-core/vue'
|
|
18
65
|
import { MScreen } from './components/MScreen.js'
|
|
19
66
|
import { MBox, MRow, MColumn } from './components/layout.js'
|
|
20
67
|
import { MCard } from './components/MCard.js'
|
|
@@ -43,7 +90,33 @@ import { MReveal } from './components/MReveal.js'
|
|
|
43
90
|
import { MSheet } from './components/MSheet.js'
|
|
44
91
|
|
|
45
92
|
export {
|
|
93
|
+
MKanban,
|
|
94
|
+
MDonutChart,
|
|
95
|
+
MSparkline,
|
|
96
|
+
MGradientBackground,
|
|
97
|
+
MParticleField,
|
|
98
|
+
MConfetti,
|
|
99
|
+
MColorPicker,
|
|
100
|
+
MSwipeDeck,
|
|
101
|
+
MGauge,
|
|
102
|
+
MTour,
|
|
103
|
+
MTourTarget,
|
|
104
|
+
MTransferList,
|
|
105
|
+
MMarquee,
|
|
106
|
+
MCollapsibleHeader,
|
|
107
|
+
MRefreshControl,
|
|
108
|
+
MComposer,
|
|
109
|
+
MSpeedDial,
|
|
110
|
+
MPinInput,
|
|
111
|
+
MAnimatedText,
|
|
112
|
+
MImageViewer,
|
|
113
|
+
MNumberFlow,
|
|
114
|
+
MSortableList,
|
|
115
|
+
MSwipeActions,
|
|
116
|
+
MResizablePanels,
|
|
117
|
+
MImageCompare,
|
|
46
118
|
MThemeProvider,
|
|
119
|
+
MPlatform,
|
|
47
120
|
MSpan,
|
|
48
121
|
MScreen,
|
|
49
122
|
MBox,
|
|
@@ -89,9 +162,29 @@ export {
|
|
|
89
162
|
MFormErrors,
|
|
90
163
|
MSteps,
|
|
91
164
|
MPagination,
|
|
165
|
+
MPopover,
|
|
166
|
+
MMenu,
|
|
167
|
+
MAppBar,
|
|
168
|
+
MTabBar,
|
|
169
|
+
MTimePicker,
|
|
170
|
+
MVirtualList,
|
|
171
|
+
MDataTable,
|
|
172
|
+
MCarousel,
|
|
173
|
+
MRangeSlider,
|
|
174
|
+
MCalendar,
|
|
175
|
+
MRating,
|
|
176
|
+
MTreeView,
|
|
177
|
+
MCommandPalette,
|
|
178
|
+
MNavigationRail,
|
|
179
|
+
MBreadcrumb,
|
|
180
|
+
MTooltip,
|
|
181
|
+
MTimeline,
|
|
182
|
+
MChart,
|
|
92
183
|
}
|
|
93
184
|
export {
|
|
94
185
|
useMavisTheme,
|
|
186
|
+
useMavisPlatform,
|
|
187
|
+
useMavisListMotion,
|
|
95
188
|
useToast,
|
|
96
189
|
useFormController,
|
|
97
190
|
useFormField,
|
|
@@ -100,6 +193,9 @@ export {
|
|
|
100
193
|
} from '@getcortexlabs/mavis-core/vue'
|
|
101
194
|
export type {
|
|
102
195
|
MavisThemeContext,
|
|
196
|
+
MavisPlatform,
|
|
197
|
+
MavisPlatformTarget,
|
|
198
|
+
MavisPlatformContext,
|
|
103
199
|
Appearance,
|
|
104
200
|
AppearanceMode,
|
|
105
201
|
AppearanceSource,
|
|
@@ -118,7 +214,34 @@ export function createMavis(options: MavisOptions = {}) {
|
|
|
118
214
|
if (components === false) return
|
|
119
215
|
for (const [name, component] of Object.entries(
|
|
120
216
|
components ?? {
|
|
217
|
+
MKanban,
|
|
218
|
+
MDonutChart,
|
|
219
|
+
MSparkline,
|
|
220
|
+
MGradientBackground,
|
|
221
|
+
MParticleField,
|
|
222
|
+
MConfetti,
|
|
223
|
+
MColorPicker,
|
|
224
|
+
MSwipeDeck,
|
|
225
|
+
MGauge,
|
|
226
|
+
MTour,
|
|
227
|
+
MTourTarget,
|
|
228
|
+
MTransferList,
|
|
229
|
+
MMarquee,
|
|
230
|
+
MCollapsibleHeader,
|
|
231
|
+
MRefreshControl,
|
|
232
|
+
MComposer,
|
|
233
|
+
MSpeedDial,
|
|
234
|
+
MPinInput,
|
|
235
|
+
MAnimatedText,
|
|
236
|
+
|
|
237
|
+
MImageViewer,
|
|
238
|
+
MNumberFlow,
|
|
239
|
+
MSortableList,
|
|
240
|
+
MSwipeActions,
|
|
241
|
+
MResizablePanels,
|
|
242
|
+
MImageCompare,
|
|
121
243
|
MThemeProvider,
|
|
244
|
+
MPlatform,
|
|
122
245
|
MSpan,
|
|
123
246
|
MScreen,
|
|
124
247
|
MBox,
|
|
@@ -164,6 +287,24 @@ export function createMavis(options: MavisOptions = {}) {
|
|
|
164
287
|
MFormErrors,
|
|
165
288
|
MSteps,
|
|
166
289
|
MPagination,
|
|
290
|
+
MPopover,
|
|
291
|
+
MMenu,
|
|
292
|
+
MAppBar,
|
|
293
|
+
MTabBar,
|
|
294
|
+
MTimePicker,
|
|
295
|
+
MVirtualList,
|
|
296
|
+
MDataTable,
|
|
297
|
+
MCarousel,
|
|
298
|
+
MRangeSlider,
|
|
299
|
+
MCalendar,
|
|
300
|
+
MRating,
|
|
301
|
+
MTreeView,
|
|
302
|
+
MCommandPalette,
|
|
303
|
+
MNavigationRail,
|
|
304
|
+
MBreadcrumb,
|
|
305
|
+
MTooltip,
|
|
306
|
+
MTimeline,
|
|
307
|
+
MChart,
|
|
167
308
|
},
|
|
168
309
|
)) {
|
|
169
310
|
app.component(name, component)
|
|
@@ -174,3 +315,6 @@ export function createMavis(options: MavisOptions = {}) {
|
|
|
174
315
|
|
|
175
316
|
export * from './files.js'
|
|
176
317
|
export { formatDateTime, dateTimeToCivilDate } from './date-format.js'
|
|
318
|
+
|
|
319
|
+
export { createMavisNavigation } from './router-navigation.js'
|
|
320
|
+
export { createNuxtMavisNavigation } from './nuxt-navigation.js'
|
package/src/motion-region.ts
CHANGED
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
type MotionRegion,
|
|
5
5
|
type MotionRegionAdapter,
|
|
6
6
|
} from '@getcortexlabs/mavis-core/experimental'
|
|
7
|
-
import { createMotionContext, motionContextKey } from './motion-context.js'
|
|
7
|
+
import { createMotionContext, motionContextKey, useMotionContext } from './motion-context.js'
|
|
8
|
+
import { isComponentMotionRegion } from '@getcortexlabs/mavis-core/vue'
|
|
8
9
|
import { webSurfaceTarget } from './motion-surface.js'
|
|
9
10
|
import { webScrollElement } from './scroll-motion.js'
|
|
10
11
|
import type { WebRuntime } from '@rafaelaugusto/jolt/web'
|
|
@@ -41,6 +42,8 @@ function regionAdapter(runtime: WebRuntime, target: HTMLElement): MotionRegionAd
|
|
|
41
42
|
: ([resolve(step[0]), step[1], step[2]] as const),
|
|
42
43
|
)
|
|
43
44
|
const adapter: MotionRegionAdapter = {
|
|
45
|
+
animateLayout: (change, { transition, ...options }) =>
|
|
46
|
+
runtime.animateLayout(target, change, { ...transition, ...options }),
|
|
44
47
|
...webPlatformMotion(runtime, target, resolve),
|
|
45
48
|
...webCollectionMotion(runtime, target, resolve),
|
|
46
49
|
sequence: (items) =>
|
|
@@ -158,7 +161,7 @@ export function useMotionRegion(reference: () => MotionRegion | undefined) {
|
|
|
158
161
|
})
|
|
159
162
|
return {}
|
|
160
163
|
}
|
|
161
|
-
const context = createMotionContext()
|
|
164
|
+
const context = isComponentMotionRegion(reference()!) ? useMotionContext() : createMotionContext()
|
|
162
165
|
provide(motionContextKey, context)
|
|
163
166
|
const element = shallowRef<HTMLElement>()
|
|
164
167
|
let release: (() => void) | undefined
|
package/src/motion-surface.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { webScrollElement } from './scroll-motion.js'
|
|
2
|
+
import { webSectionScroll } from './section-scroll.js'
|
|
2
3
|
import type {
|
|
3
4
|
WebReadableValue,
|
|
4
5
|
WebRuntime,
|
|
@@ -139,6 +140,15 @@ export function webMotionSurface(
|
|
|
139
140
|
}
|
|
140
141
|
},
|
|
141
142
|
refresh: () => runtime.refresh(target),
|
|
143
|
+
scrollSection: (source, section, frames, options) =>
|
|
144
|
+
webSectionScroll(
|
|
145
|
+
owner,
|
|
146
|
+
webScrollElement(source),
|
|
147
|
+
webRegion(section).target,
|
|
148
|
+
target,
|
|
149
|
+
frames,
|
|
150
|
+
options,
|
|
151
|
+
),
|
|
142
152
|
scrollLinked: (source, frames, options) =>
|
|
143
153
|
owner.scrollLinked(webScrollElement(source), target, frames, options),
|
|
144
154
|
map(source, input, output, options) {
|
package/src/motion.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { webMotionSurface } from './motion-surface.js'
|
|
|
6
6
|
import { useMotionContext } from './motion-context.js'
|
|
7
7
|
import { useConnectedMotion } from './connected-motion.js'
|
|
8
8
|
|
|
9
|
-
// Chip
|
|
9
|
+
// Selectable Chip uses the same input and lifecycle contract.
|
|
10
10
|
export function pressStyle(scale: number) {
|
|
11
11
|
return { '--m-press-scale': scale, '--m-press-duration': '120ms', '--m-press-ease': 'ease-out' }
|
|
12
12
|
}
|