@m3ui-vue/m3ui-vue 0.7.0 → 0.8.0
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/{MMenuItem-B_5um6tj.js → MMenuItem-vSLbJGqe.js} +314 -230
- package/dist/MMenuItem-vSLbJGqe.js.map +1 -0
- package/dist/code-editor.d.ts +1 -0
- package/dist/code-editor.js +22 -7
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MCard.vue.d.ts +2 -0
- package/dist/components/MChatBubble.vue.d.ts +0 -1
- package/dist/components/MCheckbox.vue.d.ts +2 -0
- package/dist/components/MCircleProgressBar.vue.d.ts +0 -1
- package/dist/components/MCodeEditor.vue.d.ts +1 -1
- package/dist/components/MConfirmDialog.vue.d.ts +3 -0
- package/dist/components/MDialog.vue.d.ts +23 -7
- package/dist/components/MFab.vue.d.ts +2 -2
- package/dist/components/MListItem.vue.d.ts +11 -6
- package/dist/components/MNavigationRail.vue.d.ts +17 -1
- package/dist/components/MSelect.vue.d.ts +1 -0
- package/dist/components/MSwitch.vue.d.ts +10 -0
- package/dist/components/MTabs.vue.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +2393 -2005
- package/dist/m3ui.js.map +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/styles/palettes.css +659 -0
- package/dist/styles/theme.css +2 -0
- package/dist/styles.css +1 -1
- package/package.json +13 -1
- package/src/__tests__/useColorPalette.test.ts +2 -2
- package/src/code-editor.ts +1 -0
- package/src/components/MAutocomplete.vue +35 -26
- package/src/components/MBadge.vue +1 -1
- package/src/components/MBottomSheet.vue +4 -4
- package/src/components/MButton.vue +48 -15
- package/src/components/MButtonGroup.vue +2 -2
- package/src/components/MCard.vue +83 -9
- package/src/components/MChatBubble.vue +0 -1
- package/src/components/MCheckbox.vue +78 -18
- package/src/components/MChip.vue +33 -4
- package/src/components/MCircleProgressBar.vue +7 -4
- package/src/components/MCodeEditor.vue +54 -8
- package/src/components/MColorPicker.vue +9 -8
- package/src/components/MColorPickerModal.vue +2 -2
- package/src/components/MCommandPalette.vue +1 -1
- package/src/components/MConfirmDialog.vue +4 -0
- package/src/components/MContextMenu.vue +23 -2
- package/src/components/MDatePicker.vue +11 -11
- package/src/components/MDatePickerModal.vue +5 -5
- package/src/components/MDateRangePicker.vue +12 -12
- package/src/components/MDateRangePickerModal.vue +3 -3
- package/src/components/MDialog.vue +103 -12
- package/src/components/MFab.vue +13 -8
- package/src/components/MFabMenu.vue +1 -1
- package/src/components/MIconButton.vue +50 -14
- package/src/components/MListItem.vue +35 -17
- package/src/components/MLoadingIndicator.vue +14 -7
- package/src/components/MMaskField.vue +14 -6
- package/src/components/MMenu.vue +28 -3
- package/src/components/MMenuItem.vue +2 -2
- package/src/components/MMultiAutocomplete.vue +41 -26
- package/src/components/MMultiSelect.vue +40 -22
- package/src/components/MNavigationBar.vue +5 -10
- package/src/components/MNavigationDrawer.vue +10 -9
- package/src/components/MNavigationRail.vue +335 -22
- package/src/components/MNumberField.vue +14 -6
- package/src/components/MOverlay.vue +1 -1
- package/src/components/MPinInput.vue +7 -4
- package/src/components/MProgressBar.vue +16 -10
- package/src/components/MRadio.vue +74 -30
- package/src/components/MSearchBar.vue +3 -2
- package/src/components/MSegmentedButton.vue +14 -9
- package/src/components/MSelect.vue +44 -32
- package/src/components/MSideSheet.vue +1 -1
- package/src/components/MSlider.vue +42 -20
- package/src/components/MSnackbar.vue +4 -4
- package/src/components/MSplitButton.vue +32 -17
- package/src/components/MSpotlightSearch.vue +1 -1
- package/src/components/MSwitch.vue +138 -33
- package/src/components/MTabs.vue +16 -12
- package/src/components/MTagInput.vue +33 -22
- package/src/components/MTextField.vue +14 -6
- package/src/components/MTimePicker.vue +9 -9
- package/src/components/MTimePickerModal.vue +16 -16
- package/src/components/MToolbar.vue +5 -3
- package/src/components/MTooltip.vue +4 -4
- package/src/components/MTopAppBar.vue +14 -6
- package/src/components/MTour.vue +1 -1
- package/src/composables/useColorPalette.ts +10 -0
- package/src/index.ts +1 -0
- package/src/styles/palettes.css +659 -0
- package/src/styles/theme.css +2 -0
- package/dist/MMenuItem-B_5um6tj.js.map +0 -1
|
@@ -60,7 +60,7 @@ function reposition() {
|
|
|
60
60
|
if (!triggerEl.value || !tipEl.value) return
|
|
61
61
|
const tr = triggerEl.value.getBoundingClientRect()
|
|
62
62
|
const tt = tipEl.value.getBoundingClientRect()
|
|
63
|
-
const GAP =
|
|
63
|
+
const GAP = 4
|
|
64
64
|
|
|
65
65
|
let top = 0, left = 0
|
|
66
66
|
switch (props.placement) {
|
|
@@ -107,7 +107,7 @@ onUnmounted(() => {
|
|
|
107
107
|
<div
|
|
108
108
|
v-if="visible && !rich && text"
|
|
109
109
|
ref="tipEl"
|
|
110
|
-
class="pointer-events-none fixed z-400 max-w-[
|
|
110
|
+
class="pointer-events-none fixed z-400 min-h-6 min-w-10 max-w-[200px] rounded bg-inverse-surface px-2 py-1 text-body-small text-inverse-on-surface"
|
|
111
111
|
:style="tipStyle"
|
|
112
112
|
role="tooltip"
|
|
113
113
|
>
|
|
@@ -118,13 +118,13 @@ onUnmounted(() => {
|
|
|
118
118
|
<div
|
|
119
119
|
v-else-if="visible && rich"
|
|
120
120
|
ref="tipEl"
|
|
121
|
-
class="fixed z-400 max-w-[320px] rounded-xl bg-surface-container shadow-elevation-
|
|
121
|
+
class="fixed z-400 max-w-[320px] rounded-xl bg-surface-container shadow-elevation-2"
|
|
122
122
|
:style="tipStyle"
|
|
123
123
|
role="tooltip"
|
|
124
124
|
@mouseenter="onTipEnter"
|
|
125
125
|
@mouseleave="onTipLeave"
|
|
126
126
|
>
|
|
127
|
-
<div v-if="text" class="px-4 pt-3 pb-1 text-title-small font-medium text-on-surface">
|
|
127
|
+
<div v-if="text" class="px-4 pt-3 pb-1 text-title-small font-medium text-on-surface-variant">
|
|
128
128
|
{{ text }}
|
|
129
129
|
</div>
|
|
130
130
|
<div class="px-4 py-2 text-body-medium text-on-surface-variant">
|
|
@@ -21,17 +21,24 @@ const locale = useLocale()
|
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
23
|
<header
|
|
24
|
-
class="flex w-full flex-col
|
|
25
|
-
:class="[
|
|
24
|
+
class="flex w-full flex-col transition-[background-color,box-shadow]"
|
|
25
|
+
:class="[
|
|
26
|
+
// AppBarTokens: ContainerColor=Surface/Elevation=Level0 at rest, but
|
|
27
|
+
// OnScrollContainerColor=SurfaceContainer/OnScrollContainerElevation=Level2 together once
|
|
28
|
+
// scrolled — `elevated` swaps both, not just the shadow.
|
|
29
|
+
elevated ? 'bg-surface-container shadow-elevation-2' : 'bg-surface',
|
|
30
|
+
bordered ? 'border-b border-outline-variant' : '',
|
|
31
|
+
]"
|
|
26
32
|
>
|
|
27
33
|
<!-- Top row — 64dp per M3's TopAppBarSmall/collapsed-Medium/collapsed-Large tokens -->
|
|
28
|
-
<div class="flex h-16 shrink-0 items-center gap-1 px-
|
|
34
|
+
<div class="flex h-16 shrink-0 items-center gap-1 px-1">
|
|
29
35
|
<!-- Navigation -->
|
|
30
36
|
<slot name="navigation">
|
|
31
37
|
<MIconButton
|
|
32
38
|
v-if="navigationIcon"
|
|
33
39
|
:icon="navigationIcon"
|
|
34
40
|
:label="navigationLabel ?? locale.menu"
|
|
41
|
+
style="color: var(--color-on-surface)"
|
|
35
42
|
@click="$emit('navigation')"
|
|
36
43
|
/>
|
|
37
44
|
</slot>
|
|
@@ -56,11 +63,12 @@ const locale = useLocale()
|
|
|
56
63
|
|
|
57
64
|
<!-- Large title row for medium/large variants — total container height
|
|
58
65
|
112dp (medium) / 152dp (large) per M3's AppBarMedium/LargeTokens,
|
|
59
|
-
i.e. 48px / 88px added below the 64px top row.
|
|
66
|
+
i.e. 48px / 88px added below the 64px top row. Bottom padding is
|
|
67
|
+
MediumTitleBottomPadding=24dp / LargeTitleBottomPadding=28dp. -->
|
|
60
68
|
<div
|
|
61
69
|
v-if="variant === 'medium' || variant === 'large'"
|
|
62
|
-
class="flex items-end px-4
|
|
63
|
-
:class="variant === 'large' ? 'h-[88px]' : 'h-12'"
|
|
70
|
+
class="flex items-end px-4"
|
|
71
|
+
:class="variant === 'large' ? 'h-[88px] pb-7' : 'h-12 pb-6'"
|
|
64
72
|
>
|
|
65
73
|
<h1
|
|
66
74
|
class="truncate text-on-surface"
|
package/src/components/MTour.vue
CHANGED
|
@@ -193,7 +193,7 @@ onBeforeUnmount(() => { stopListeners(); clearHighlight() })
|
|
|
193
193
|
<Teleport to="body">
|
|
194
194
|
<!-- Overlay -->
|
|
195
195
|
<Transition name="m3-tour">
|
|
196
|
-
<div v-if="modelValue && step" class="fixed inset-0 z-200 bg-
|
|
196
|
+
<div v-if="modelValue && step" class="fixed inset-0 z-200 bg-scrim/32" @click="close" />
|
|
197
197
|
</Transition>
|
|
198
198
|
|
|
199
199
|
<!-- Tooltip -->
|
|
@@ -37,6 +37,16 @@ export const palettes: Palette[] = [
|
|
|
37
37
|
{ id: 'smoke', label: 'Smoke', seed: '#4D5C66' },
|
|
38
38
|
{ id: 'stone', label: 'Stone', seed: '#68635A' },
|
|
39
39
|
{ id: 'zinc', label: 'Zinc', seed: '#585B5E' },
|
|
40
|
+
{ id: 'monochrome', label: 'Monochrome', seed: '#1A1A1A' },
|
|
41
|
+
{ id: 'rust', label: 'Rust', seed: '#9C441E' },
|
|
42
|
+
{ id: 'gold', label: 'Gold', seed: '#715C00' },
|
|
43
|
+
{ id: 'emerald', label: 'Emerald', seed: '#006D39' },
|
|
44
|
+
{ id: 'turquoise', label: 'Turquoise', seed: '#006A68' },
|
|
45
|
+
{ id: 'cobalt', label: 'Cobalt', seed: '#006684' },
|
|
46
|
+
{ id: 'sapphire', label: 'Sapphire', seed: '#006399' },
|
|
47
|
+
{ id: 'amethyst', label: 'Amethyst', seed: '#5953AC' },
|
|
48
|
+
{ id: 'magenta', label: 'Magenta', seed: '#8D3F92' },
|
|
49
|
+
{ id: 'mauve', label: 'Mauve', seed: '#914277' },
|
|
40
50
|
]
|
|
41
51
|
|
|
42
52
|
const current = ref(localStorage.getItem('m3-palette') ?? 'purple')
|
package/src/index.ts
CHANGED
|
@@ -78,6 +78,7 @@ export { default as MIconButton } from './components/MIconButton.vue'
|
|
|
78
78
|
export { default as MInfiniteScroll } from './components/MInfiniteScroll.vue'
|
|
79
79
|
// MJsonEditor — import from '@m3ui-vue/m3ui-vue/code-editor'
|
|
80
80
|
export { default as MJsonViewer } from './components/MJsonViewer.vue'
|
|
81
|
+
export type { JsonViewerLabels } from './components/MJsonViewer.vue'
|
|
81
82
|
export { default as MKanban } from './components/MKanban.vue'
|
|
82
83
|
export { default as MKbd } from './components/MKbd.vue'
|
|
83
84
|
export { default as MLightbox } from './components/MLightbox.vue'
|