@m3ui-vue/m3ui-vue 0.7.1 → 0.8.1
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 +14 -6
- package/dist/{MMenuItem-xQ1x6-DH.js → MMenuItem-CDWfeU4F.js} +331 -252
- package/dist/MMenuItem-CDWfeU4F.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/MButton.vue.d.ts +7 -0
- package/dist/components/MCalendar.vue.d.ts +0 -1
- package/dist/components/MCard.vue.d.ts +2 -0
- package/dist/components/MCarousel.vue.d.ts +12 -14
- package/dist/components/MChatBubble.vue.d.ts +0 -1
- 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/MDatePicker.vue.d.ts +1 -3
- package/dist/components/MDatePickerModal.vue.d.ts +0 -1
- package/dist/components/MDateRangePicker.vue.d.ts +1 -3
- package/dist/components/MDateRangePickerModal.vue.d.ts +0 -1
- package/dist/components/MDialog.vue.d.ts +23 -7
- package/dist/components/MFab.vue.d.ts +2 -2
- package/dist/components/MKanban.vue.d.ts +1 -0
- package/dist/components/MListItem.vue.d.ts +11 -6
- package/dist/components/MNavigationRail.vue.d.ts +17 -1
- package/dist/components/MScheduler.vue.d.ts +0 -1
- package/dist/components/MSelect.vue.d.ts +1 -0
- package/dist/components/MShape.vue.d.ts +51 -0
- package/dist/components/MShortNavigationBar.vue.d.ts +34 -0
- package/dist/components/MSimpleCarousel.vue.d.ts +45 -0
- package/dist/components/MSwitch.vue.d.ts +8 -0
- package/dist/components/MTabs.vue.d.ts +3 -0
- package/dist/components/MToggleButton.vue.d.ts +29 -0
- package/dist/components/MTree.vue.d.ts +0 -1
- package/dist/components/MTreeTable.vue.d.ts +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +4387 -2525
- 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 +1 -0
- package/dist/styles.css +1 -1
- package/package.json +16 -1
- package/src/__tests__/MCarousel.test.ts +33 -0
- package/src/__tests__/MShape.test.ts +36 -0
- package/src/__tests__/MToggleButton.test.ts +27 -0
- package/src/__tests__/useColorPalette.test.ts +2 -2
- package/src/code-editor.ts +1 -0
- package/src/components/MAutocomplete.vue +40 -27
- package/src/components/MBadge.vue +1 -1
- package/src/components/MBottomSheet.vue +4 -4
- package/src/components/MButton.vue +51 -21
- package/src/components/MButtonGroup.vue +2 -2
- package/src/components/MCalendar.vue +9 -5
- package/src/components/MCard.vue +76 -11
- package/src/components/MCarousel.vue +123 -173
- package/src/components/MChatBubble.vue +0 -1
- package/src/components/MCheckbox.vue +58 -13
- package/src/components/MChip.vue +26 -6
- package/src/components/MCircleProgressBar.vue +7 -4
- package/src/components/MCodeEditor.vue +60 -9
- 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 +27 -6
- package/src/components/MDatePicker.vue +23 -20
- package/src/components/MDatePickerModal.vue +14 -9
- package/src/components/MDateRangePicker.vue +24 -21
- package/src/components/MDateRangePickerModal.vue +12 -7
- package/src/components/MDialog.vue +103 -12
- package/src/components/MFab.vue +10 -7
- package/src/components/MFabMenu.vue +1 -1
- package/src/components/MIconButton.vue +41 -19
- package/src/components/MKanban.vue +5 -1
- 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 +32 -7
- package/src/components/MMenuItem.vue +2 -2
- package/src/components/MMultiAutocomplete.vue +46 -27
- package/src/components/MMultiSelect.vue +45 -23
- 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 +54 -12
- package/src/components/MScheduler.vue +10 -6
- package/src/components/MSearchBar.vue +8 -3
- package/src/components/MSegmentedButton.vue +14 -9
- package/src/components/MSelect.vue +49 -33
- package/src/components/MShape.vue +107 -0
- package/src/components/MShortNavigationBar.vue +113 -0
- package/src/components/MSideSheet.vue +1 -1
- package/src/components/MSimpleCarousel.vue +325 -0
- 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 +96 -18
- 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/MToggleButton.vue +188 -0
- package/src/components/MToolbar.vue +5 -3
- package/src/components/MTooltip.vue +4 -4
- package/src/components/MTopAppBar.vue +19 -7
- package/src/components/MTour.vue +1 -1
- package/src/components/MTree.vue +4 -2
- package/src/components/MTreeTable.vue +5 -1
- package/src/composables/useColorPalette.ts +10 -0
- package/src/index.ts +9 -1
- package/src/styles/palettes.css +659 -0
- package/src/styles/theme.css +1 -0
- package/dist/MMenuItem-xQ1x6-DH.js.map +0 -1
|
@@ -21,17 +21,28 @@ 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
|
-
<!-- Top row — 64dp per M3's TopAppBarSmall/collapsed-Medium/collapsed-Large tokens
|
|
28
|
-
|
|
33
|
+
<!-- Top row — 64dp per M3's TopAppBarSmall/collapsed-Medium/collapsed-Large tokens.
|
|
34
|
+
px-2: TopAppBarHorizontalPadding (4dp) + the 4dp IconButton() gets for free from
|
|
35
|
+
Modifier.minimumInteractiveComponentSize() centering its 40dp visible container inside
|
|
36
|
+
a 48dp touch target — MIconButton doesn't implement that invisible expansion, so it's
|
|
37
|
+
folded into this row padding instead to land the icon glyph at the real 16dp inset. -->
|
|
38
|
+
<div class="flex h-16 shrink-0 items-center gap-1 px-2">
|
|
29
39
|
<!-- Navigation -->
|
|
30
40
|
<slot name="navigation">
|
|
31
41
|
<MIconButton
|
|
32
42
|
v-if="navigationIcon"
|
|
33
43
|
:icon="navigationIcon"
|
|
34
44
|
:label="navigationLabel ?? locale.menu"
|
|
45
|
+
style="color: var(--color-on-surface)"
|
|
35
46
|
@click="$emit('navigation')"
|
|
36
47
|
/>
|
|
37
48
|
</slot>
|
|
@@ -56,11 +67,12 @@ const locale = useLocale()
|
|
|
56
67
|
|
|
57
68
|
<!-- Large title row for medium/large variants — total container height
|
|
58
69
|
112dp (medium) / 152dp (large) per M3's AppBarMedium/LargeTokens,
|
|
59
|
-
i.e. 48px / 88px added below the 64px top row.
|
|
70
|
+
i.e. 48px / 88px added below the 64px top row. Bottom padding is
|
|
71
|
+
MediumTitleBottomPadding=24dp / LargeTitleBottomPadding=28dp. -->
|
|
60
72
|
<div
|
|
61
73
|
v-if="variant === 'medium' || variant === 'large'"
|
|
62
|
-
class="flex items-end px-4
|
|
63
|
-
:class="variant === 'large' ? 'h-[88px]' : 'h-12'"
|
|
74
|
+
class="flex items-end px-4"
|
|
75
|
+
:class="variant === 'large' ? 'h-[88px] pb-7' : 'h-12 pb-6'"
|
|
64
76
|
>
|
|
65
77
|
<h1
|
|
66
78
|
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-scrim/
|
|
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 -->
|
package/src/components/MTree.vue
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed, provide, ref, type Ref } from 'vue'
|
|
3
3
|
import MTreeNode from './_MTreeNode.vue'
|
|
4
4
|
import MIcon from './MIcon.vue'
|
|
5
|
+
import { useLocale } from '../composables/useLocale'
|
|
5
6
|
|
|
6
7
|
// ── Public types ────────────────────────────────────────────────────────────
|
|
7
8
|
|
|
@@ -50,10 +51,11 @@ const props = withDefaults(
|
|
|
50
51
|
checked: () => [],
|
|
51
52
|
checkable: false,
|
|
52
53
|
defaultExpanded: 'none',
|
|
53
|
-
emptyText: 'Sin elementos',
|
|
54
54
|
},
|
|
55
55
|
)
|
|
56
56
|
|
|
57
|
+
const locale = useLocale()
|
|
58
|
+
|
|
57
59
|
const emit = defineEmits<{
|
|
58
60
|
'update:selected': [string | number | null]
|
|
59
61
|
'update:checked': [(string | number)[]]
|
|
@@ -158,7 +160,7 @@ defineExpose({ expandAll, collapseAll })
|
|
|
158
160
|
|
|
159
161
|
<div v-else class="flex flex-col items-center gap-2 py-10 text-on-surface-variant">
|
|
160
162
|
<MIcon name="account_tree" :size="32" class="opacity-30" />
|
|
161
|
-
<p class="text-body-medium">{{ emptyText }}</p>
|
|
163
|
+
<p class="text-body-medium">{{ emptyText ?? locale.noItems }}</p>
|
|
162
164
|
</div>
|
|
163
165
|
</div>
|
|
164
166
|
</template>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
3
|
import MIcon from './MIcon.vue'
|
|
4
|
+
import { useLocale } from '../composables/useLocale'
|
|
4
5
|
|
|
5
6
|
export interface TreeTableColumn {
|
|
6
7
|
key: string
|
|
@@ -21,6 +22,7 @@ const props = withDefaults(defineProps<{
|
|
|
21
22
|
defaultExpanded?: boolean
|
|
22
23
|
indent?: number
|
|
23
24
|
dense?: boolean
|
|
25
|
+
emptyText?: string
|
|
24
26
|
}>(), {
|
|
25
27
|
rowKey: 'id',
|
|
26
28
|
defaultExpanded: false,
|
|
@@ -28,6 +30,8 @@ const props = withDefaults(defineProps<{
|
|
|
28
30
|
dense: false,
|
|
29
31
|
})
|
|
30
32
|
|
|
33
|
+
const locale = useLocale()
|
|
34
|
+
|
|
31
35
|
const emit = defineEmits<{ rowClick: [TreeTableRow] }>()
|
|
32
36
|
|
|
33
37
|
const expanded = ref<Set<any>>(new Set(
|
|
@@ -149,7 +153,7 @@ function alignClass(a?: string) { return a === 'center' ? 'text-center' : a ===
|
|
|
149
153
|
<tr v-if="!flatRows.length">
|
|
150
154
|
<td :colspan="columns.length" class="border-t border-outline-variant px-4 py-10 text-center">
|
|
151
155
|
<MIcon name="account_tree" :size="36" class="mb-2 text-on-surface-variant opacity-30" />
|
|
152
|
-
<p class="text-body-medium text-on-surface-variant">
|
|
156
|
+
<p class="text-body-medium text-on-surface-variant">{{ emptyText ?? locale.noResults }}</p>
|
|
153
157
|
</td>
|
|
154
158
|
</tr>
|
|
155
159
|
</tbody>
|
|
@@ -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: '#000000' },
|
|
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
|
@@ -37,6 +37,7 @@ export type { ButtonGroupOption } from './components/MButtonGroup.vue'
|
|
|
37
37
|
export { default as MCalendar } from './components/MCalendar.vue'
|
|
38
38
|
export { default as MCard } from './components/MCard.vue'
|
|
39
39
|
export { default as MCarousel } from './components/MCarousel.vue'
|
|
40
|
+
export type { CarouselItem } from './components/MCarousel.vue'
|
|
40
41
|
export { default as MCenter } from './components/MCenter.vue'
|
|
41
42
|
// MChart — import from '@m3ui-vue/m3ui-vue/chart'
|
|
42
43
|
export { default as MChatBubble } from './components/MChatBubble.vue'
|
|
@@ -78,6 +79,7 @@ export { default as MIconButton } from './components/MIconButton.vue'
|
|
|
78
79
|
export { default as MInfiniteScroll } from './components/MInfiniteScroll.vue'
|
|
79
80
|
// MJsonEditor — import from '@m3ui-vue/m3ui-vue/code-editor'
|
|
80
81
|
export { default as MJsonViewer } from './components/MJsonViewer.vue'
|
|
82
|
+
export type { JsonViewerLabels } from './components/MJsonViewer.vue'
|
|
81
83
|
export { default as MKanban } from './components/MKanban.vue'
|
|
82
84
|
export { default as MKbd } from './components/MKbd.vue'
|
|
83
85
|
export { default as MLightbox } from './components/MLightbox.vue'
|
|
@@ -126,8 +128,14 @@ export { default as MSelect } from './components/MSelect.vue'
|
|
|
126
128
|
export type { SelectOption } from './components/MSelect.vue'
|
|
127
129
|
export { default as MShader } from './components/MShader.vue'
|
|
128
130
|
export type { ShaderRenderer, ShaderStatus } from './components/MShader.vue'
|
|
131
|
+
export { default as MShape, shapeNames } from './components/MShape.vue'
|
|
132
|
+
export type { ShapeName } from './components/MShape.vue'
|
|
133
|
+
export { default as MShortNavigationBar } from './components/MShortNavigationBar.vue'
|
|
134
|
+
export type { ShortNavBarItem } from './components/MShortNavigationBar.vue'
|
|
129
135
|
export { default as MSideSheet } from './components/MSideSheet.vue'
|
|
130
136
|
export { default as MSignaturePad } from './components/MSignaturePad.vue'
|
|
137
|
+
export { default as MSimpleCarousel } from './components/MSimpleCarousel.vue'
|
|
138
|
+
export type { SimpleCarouselItem } from './components/MSimpleCarousel.vue'
|
|
131
139
|
export { default as MSkeleton } from './components/MSkeleton.vue'
|
|
132
140
|
export { default as MSlider } from './components/MSlider.vue'
|
|
133
141
|
export { default as MSnackbar } from './components/MSnackbar.vue'
|
|
@@ -153,6 +161,7 @@ export { default as MTimeline } from './components/MTimeline.vue'
|
|
|
153
161
|
export { default as MTimePicker } from './components/MTimePicker.vue'
|
|
154
162
|
export { default as MTimePickerModal } from './components/MTimePickerModal.vue'
|
|
155
163
|
export { default as MTitle } from './components/MTitle.vue'
|
|
164
|
+
export { default as MToggleButton } from './components/MToggleButton.vue'
|
|
156
165
|
export { default as MTooltip } from './components/MTooltip.vue'
|
|
157
166
|
export { default as MToolbar } from './components/MToolbar.vue'
|
|
158
167
|
export { default as MTopAppBar } from './components/MTopAppBar.vue'
|
|
@@ -169,7 +178,6 @@ export { emojiCategories, allEmojis, randomEmoji } from './data/emojis'
|
|
|
169
178
|
export type { Placement } from './components/MAbsolute.vue'
|
|
170
179
|
export type { BadgePosition, BadgeOverlap } from './components/MBadge.vue'
|
|
171
180
|
export type { CalendarEvent } from './components/MCalendar.vue'
|
|
172
|
-
export type { CarouselItem } from './components/MCarousel.vue'
|
|
173
181
|
export type { DataTableColumn, DataTableFetchParams } from './components/MDataTable.vue'
|
|
174
182
|
export type { DateRange } from './components/MDateRangePicker.vue'
|
|
175
183
|
export type { DragDropItem } from './components/MDragDropList.vue'
|