@m3ui-vue/m3ui-vue 0.7.1 → 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-xQ1x6-DH.js → MMenuItem-vSLbJGqe.js} +299 -232
- 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/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 +8 -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 +1798 -1432
- 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 +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 +36 -19
- package/src/components/MButtonGroup.vue +2 -2
- package/src/components/MCard.vue +76 -11
- 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 +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 +10 -7
- package/src/components/MFabMenu.vue +1 -1
- package/src/components/MIconButton.vue +41 -19
- 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 +54 -12
- 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/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/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 +1 -0
- package/dist/MMenuItem-xQ1x6-DH.js.map +0 -1
|
@@ -116,29 +116,30 @@ function focusInput() {
|
|
|
116
116
|
|
|
117
117
|
const triggerClasses = computed(() => {
|
|
118
118
|
const base = [
|
|
119
|
-
'flex min-h-[56px] w-full
|
|
119
|
+
'flex min-h-[56px] w-full items-center gap-1.5 flex-wrap',
|
|
120
120
|
'transition-[border-color,border-width] duration-150',
|
|
121
|
+
props.disabled ? 'cursor-not-allowed' : 'cursor-text',
|
|
121
122
|
props.leadingIcon ? 'pl-12 pr-10' : 'pl-4 pr-10',
|
|
122
123
|
]
|
|
123
124
|
|
|
124
125
|
if (props.variant === 'outlined') {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
focused.value
|
|
126
|
+
const border = props.disabled
|
|
127
|
+
? 'border-on-surface/12'
|
|
128
|
+
: focused.value
|
|
129
129
|
? (props.error ? 'border-2 border-error' : 'border-2 border-primary')
|
|
130
|
-
: (props.error ? 'border-error' : 'border-outline hover:border-on-surface')
|
|
131
|
-
].join(' ')
|
|
130
|
+
: (props.error ? 'border-error' : 'border-outline hover:border-on-surface')
|
|
131
|
+
return [...base, 'rounded-xs border bg-transparent py-2', border].join(' ')
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
hasValue.value || focused.value ? 'pt-7' : 'pt-4',
|
|
138
|
-
focused.value
|
|
134
|
+
const border = props.disabled
|
|
135
|
+
? 'border-on-surface/38'
|
|
136
|
+
: focused.value
|
|
139
137
|
? (props.error ? 'border-b-2 border-error' : 'border-b-2 border-primary')
|
|
140
|
-
: (props.error ? 'border-error' : 'border-on-surface-variant hover:border-on-surface')
|
|
141
|
-
|
|
138
|
+
: (props.error ? 'border-error' : 'border-on-surface-variant hover:border-on-surface')
|
|
139
|
+
const bg = props.disabled
|
|
140
|
+
? 'bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]'
|
|
141
|
+
: 'bg-surface-container-highest'
|
|
142
|
+
return [...base, 'rounded-t-xs border-b pb-2', hasValue.value || focused.value ? 'pt-7' : 'pt-4', bg, border].join(' ')
|
|
142
143
|
})
|
|
143
144
|
|
|
144
145
|
const labelClasses = computed(() => {
|
|
@@ -159,9 +160,11 @@ const labelClasses = computed(() => {
|
|
|
159
160
|
'pointer-events-none absolute right-10 truncate transition-all duration-200',
|
|
160
161
|
left,
|
|
161
162
|
active ? floated : unFloated,
|
|
162
|
-
|
|
163
|
-
?
|
|
164
|
-
:
|
|
163
|
+
props.disabled
|
|
164
|
+
? 'text-on-surface/38'
|
|
165
|
+
: focused.value
|
|
166
|
+
? (props.error ? 'text-error' : 'text-primary')
|
|
167
|
+
: (props.error ? 'text-error' : 'text-on-surface-variant'),
|
|
165
168
|
].join(' ')
|
|
166
169
|
})
|
|
167
170
|
</script>
|
|
@@ -176,10 +179,13 @@ const labelClasses = computed(() => {
|
|
|
176
179
|
>
|
|
177
180
|
<div
|
|
178
181
|
v-if="leadingIcon"
|
|
179
|
-
class="pointer-events-none absolute left-3.5
|
|
180
|
-
:class="
|
|
182
|
+
class="pointer-events-none absolute left-3.5"
|
|
183
|
+
:class="[
|
|
184
|
+
variant === 'filled' ? 'top-4.5' : 'top-4',
|
|
185
|
+
disabled ? 'text-on-surface/38' : 'text-on-surface-variant',
|
|
186
|
+
]"
|
|
181
187
|
>
|
|
182
|
-
<MIcon :name="leadingIcon" :size="
|
|
188
|
+
<MIcon :name="leadingIcon" :size="24" />
|
|
183
189
|
</div>
|
|
184
190
|
|
|
185
191
|
<!-- Trigger field -->
|
|
@@ -191,7 +197,8 @@ const labelClasses = computed(() => {
|
|
|
191
197
|
<span
|
|
192
198
|
v-for="(tag, i) in modelValue"
|
|
193
199
|
:key="i"
|
|
194
|
-
class="inline-flex items-center gap-1 rounded-full
|
|
200
|
+
class="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-label-small"
|
|
201
|
+
:class="disabled ? 'bg-on-surface/12 text-on-surface/38' : 'bg-secondary-container text-on-secondary-container'"
|
|
195
202
|
>
|
|
196
203
|
{{ tag }}
|
|
197
204
|
<button
|
|
@@ -210,7 +217,11 @@ const labelClasses = computed(() => {
|
|
|
210
217
|
type="text"
|
|
211
218
|
enterkeyhint="done"
|
|
212
219
|
autocomplete="off"
|
|
213
|
-
class="
|
|
220
|
+
:class="[
|
|
221
|
+
'min-w-[60px] flex-1 bg-transparent text-body-large outline-none placeholder:text-on-surface-variant',
|
|
222
|
+
error ? 'caret-error' : 'caret-primary',
|
|
223
|
+
disabled ? 'text-on-surface/38' : 'text-on-surface',
|
|
224
|
+
]"
|
|
214
225
|
:placeholder="!hasValue && (!label || focused) ? placeholder : ''"
|
|
215
226
|
:disabled="disabled"
|
|
216
227
|
:readonly="!canAddMore"
|
|
@@ -52,7 +52,8 @@ const inputClasses = computed(() => {
|
|
|
52
52
|
const base = [
|
|
53
53
|
"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
|
|
54
54
|
"transition-[border-color,border-width] duration-150",
|
|
55
|
-
"disabled:cursor-not-allowed disabled:
|
|
55
|
+
"disabled:cursor-not-allowed disabled:text-on-surface/38",
|
|
56
|
+
props.error ? "caret-error" : "caret-primary",
|
|
56
57
|
size,
|
|
57
58
|
pl,
|
|
58
59
|
pr,
|
|
@@ -61,19 +62,21 @@ const inputClasses = computed(() => {
|
|
|
61
62
|
if (props.variant === "outlined") {
|
|
62
63
|
return [
|
|
63
64
|
...base,
|
|
64
|
-
"rounded-
|
|
65
|
+
"rounded-xs border bg-transparent py-4",
|
|
65
66
|
props.error
|
|
66
67
|
? "border-error focus:border-2 focus:border-error"
|
|
67
68
|
: "border-outline hover:border-on-surface focus:border-2 focus:border-primary",
|
|
69
|
+
"disabled:border-on-surface/12",
|
|
68
70
|
].join(" ");
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
return [
|
|
72
74
|
...base,
|
|
73
|
-
"rounded-t-
|
|
75
|
+
"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2",
|
|
74
76
|
props.error
|
|
75
77
|
? "border-error focus:border-b-2 focus:border-error"
|
|
76
78
|
: "border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary",
|
|
79
|
+
"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]",
|
|
77
80
|
].join(" ");
|
|
78
81
|
});
|
|
79
82
|
|
|
@@ -106,6 +109,7 @@ const labelClasses = computed(() => {
|
|
|
106
109
|
props.error
|
|
107
110
|
? "text-error peer-focus:text-error"
|
|
108
111
|
: "text-on-surface-variant peer-focus:text-primary",
|
|
112
|
+
"peer-disabled:text-on-surface/38",
|
|
109
113
|
].join(" ");
|
|
110
114
|
}
|
|
111
115
|
|
|
@@ -117,6 +121,7 @@ const labelClasses = computed(() => {
|
|
|
117
121
|
props.error
|
|
118
122
|
? "text-error peer-focus:text-error"
|
|
119
123
|
: "text-on-surface-variant peer-focus:text-primary",
|
|
124
|
+
"peer-disabled:text-on-surface/38",
|
|
120
125
|
].join(" ");
|
|
121
126
|
});
|
|
122
127
|
|
|
@@ -142,10 +147,13 @@ function onInput(event: Event) {
|
|
|
142
147
|
>
|
|
143
148
|
<div
|
|
144
149
|
v-if="leadingIcon"
|
|
145
|
-
class="pointer-events-none absolute left-3.5
|
|
146
|
-
:class="
|
|
150
|
+
class="pointer-events-none absolute left-3.5"
|
|
151
|
+
:class="[
|
|
152
|
+
multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',
|
|
153
|
+
disabled ? 'text-on-surface/38' : 'text-on-surface-variant',
|
|
154
|
+
]"
|
|
147
155
|
>
|
|
148
|
-
<MIcon :name="leadingIcon" :size="
|
|
156
|
+
<MIcon :name="leadingIcon" :size="24" />
|
|
149
157
|
</div>
|
|
150
158
|
|
|
151
159
|
<textarea
|
|
@@ -121,18 +121,18 @@ onUnmounted(() => {
|
|
|
121
121
|
<div ref="triggerEl" class="relative mt-2" :style="{ '--field-bg': resolvedFieldBg }">
|
|
122
122
|
<button
|
|
123
123
|
type="button"
|
|
124
|
-
class="flex h-14 w-full items-center gap-2 rounded-
|
|
124
|
+
class="flex h-14 w-full items-center gap-2 rounded-xs border bg-transparent px-4 text-left text-body-large transition-[border-color,border-width] duration-150"
|
|
125
125
|
:class="[
|
|
126
|
-
disabled ? 'pointer-events-none
|
|
127
|
-
open
|
|
126
|
+
disabled ? 'pointer-events-none cursor-not-allowed border-on-surface/12' : 'cursor-pointer',
|
|
127
|
+
!disabled && (open
|
|
128
128
|
? error ? 'border-2 border-error' : 'border-2 border-primary'
|
|
129
|
-
: error ? 'border-error' : 'border-outline hover:border-on-surface',
|
|
129
|
+
: error ? 'border-error' : 'border-outline hover:border-on-surface'),
|
|
130
130
|
]"
|
|
131
131
|
@click="!disabled && (open = !open)"
|
|
132
132
|
>
|
|
133
|
-
<MIcon name="schedule" :size="
|
|
134
|
-
<span v-if="displayValue" class="flex-1 font-mono text-on-surface">{{ displayValue }}</span>
|
|
135
|
-
<span v-else class="flex-1 text-on-surface-variant">{{ label || placeholder || locale.selectTime }}</span>
|
|
133
|
+
<MIcon name="schedule" :size="24" class="shrink-0" :class="disabled ? 'text-on-surface/38' : 'text-on-surface-variant'" />
|
|
134
|
+
<span v-if="displayValue" class="flex-1 font-mono" :class="disabled ? 'text-on-surface/38' : 'text-on-surface'">{{ displayValue }}</span>
|
|
135
|
+
<span v-else class="flex-1" :class="disabled ? 'text-on-surface/38' : 'text-on-surface-variant'">{{ label || placeholder || locale.selectTime }}</span>
|
|
136
136
|
<MIcon
|
|
137
137
|
v-if="modelValue"
|
|
138
138
|
name="close"
|
|
@@ -144,7 +144,7 @@ onUnmounted(() => {
|
|
|
144
144
|
<label
|
|
145
145
|
v-if="label"
|
|
146
146
|
class="pointer-events-none absolute -top-2.5 left-3 bg-(--field-bg) px-1 text-label-small transition-colors"
|
|
147
|
-
:class="open ? (error ? 'text-error' : 'text-primary') : error ? 'text-error' : 'text-on-surface-variant'"
|
|
147
|
+
:class="disabled ? 'text-on-surface/38' : open ? (error ? 'text-error' : 'text-primary') : error ? 'text-error' : 'text-on-surface-variant'"
|
|
148
148
|
>
|
|
149
149
|
{{ label }}
|
|
150
150
|
</label>
|
|
@@ -163,7 +163,7 @@ onUnmounted(() => {
|
|
|
163
163
|
<div
|
|
164
164
|
v-if="open"
|
|
165
165
|
ref="panelEl"
|
|
166
|
-
class="fixed z-500 w-[280px] rounded-
|
|
166
|
+
class="fixed z-500 w-[280px] rounded-[28px] bg-surface-container-high shadow-elevation-3"
|
|
167
167
|
:style="dropPos"
|
|
168
168
|
>
|
|
169
169
|
<!-- Display -->
|
|
@@ -65,7 +65,7 @@ const SIZE = 256
|
|
|
65
65
|
const CX = SIZE / 2
|
|
66
66
|
const OUTER_R = 100
|
|
67
67
|
const INNER_R = 64
|
|
68
|
-
const NUM_R =
|
|
68
|
+
const NUM_R = 24
|
|
69
69
|
|
|
70
70
|
function posAt(idx: number, of: number, r: number) {
|
|
71
71
|
const a = (idx / of) * Math.PI * 2 - Math.PI / 2
|
|
@@ -237,7 +237,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
237
237
|
<Transition name="m3-tp-modal">
|
|
238
238
|
<div
|
|
239
239
|
v-if="show"
|
|
240
|
-
class="fixed inset-0 z-50 flex items-center justify-center bg-scrim/
|
|
240
|
+
class="fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4"
|
|
241
241
|
@click.self="cancel"
|
|
242
242
|
>
|
|
243
243
|
<div class="tp-box w-[328px] rounded-[28px] bg-surface-container-high px-6 pt-6 pb-4 shadow-elevation-3">
|
|
@@ -252,7 +252,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
252
252
|
<div class="mb-5 flex items-center justify-center gap-2">
|
|
253
253
|
<button
|
|
254
254
|
type="button"
|
|
255
|
-
class="flex h-
|
|
255
|
+
class="flex h-20 min-w-[96px] items-center justify-center rounded-sm text-display-large transition-colors"
|
|
256
256
|
:class="
|
|
257
257
|
step === 'hour'
|
|
258
258
|
? 'bg-primary-container text-on-primary-container'
|
|
@@ -263,11 +263,11 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
263
263
|
{{ pad(selectedHour) }}
|
|
264
264
|
</button>
|
|
265
265
|
|
|
266
|
-
<span class="text-display-
|
|
266
|
+
<span class="text-display-large text-on-surface">:</span>
|
|
267
267
|
|
|
268
268
|
<button
|
|
269
269
|
type="button"
|
|
270
|
-
class="flex h-
|
|
270
|
+
class="flex h-20 min-w-[96px] items-center justify-center rounded-sm text-display-large transition-colors"
|
|
271
271
|
:class="
|
|
272
272
|
step === 'minute'
|
|
273
273
|
? 'bg-primary-container text-on-primary-container'
|
|
@@ -281,11 +281,11 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
281
281
|
<!-- AM / PM toggle -->
|
|
282
282
|
<div
|
|
283
283
|
v-if="!use24h"
|
|
284
|
-
class="ml-2 flex h-
|
|
284
|
+
class="ml-2 flex h-20 flex-col overflow-hidden rounded-sm border border-outline"
|
|
285
285
|
>
|
|
286
286
|
<button
|
|
287
287
|
type="button"
|
|
288
|
-
class="flex flex-1 items-center justify-center px-3 text-
|
|
288
|
+
class="flex flex-1 items-center justify-center px-3 text-title-medium transition-colors"
|
|
289
289
|
:class="
|
|
290
290
|
period === 'AM'
|
|
291
291
|
? 'bg-tertiary-container text-on-tertiary-container'
|
|
@@ -296,7 +296,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
296
296
|
<div class="h-px bg-outline" />
|
|
297
297
|
<button
|
|
298
298
|
type="button"
|
|
299
|
-
class="flex flex-1 items-center justify-center px-3 text-
|
|
299
|
+
class="flex flex-1 items-center justify-center px-3 text-title-medium transition-colors"
|
|
300
300
|
:class="
|
|
301
301
|
period === 'PM'
|
|
302
302
|
? 'bg-tertiary-container text-on-tertiary-container'
|
|
@@ -331,7 +331,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
331
331
|
v-for="item in hourItems"
|
|
332
332
|
:key="'h' + item.value"
|
|
333
333
|
type="button"
|
|
334
|
-
class="pointer-events-auto absolute flex h-10 w-10 items-center justify-center rounded-full text-body-
|
|
334
|
+
class="pointer-events-auto absolute flex h-10 w-10 items-center justify-center rounded-full text-body-large transition-colors"
|
|
335
335
|
:class="
|
|
336
336
|
item.value === selectedHour
|
|
337
337
|
? 'text-on-primary font-medium'
|
|
@@ -353,7 +353,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
353
353
|
v-for="item in minuteItems"
|
|
354
354
|
:key="'m' + item.value"
|
|
355
355
|
type="button"
|
|
356
|
-
class="pointer-events-auto absolute flex h-10 w-10 items-center justify-center rounded-full text-body-
|
|
356
|
+
class="pointer-events-auto absolute flex h-10 w-10 items-center justify-center rounded-full text-body-large transition-colors"
|
|
357
357
|
:class="
|
|
358
358
|
item.value === selectedMinute
|
|
359
359
|
? 'text-on-primary font-medium'
|
|
@@ -379,26 +379,26 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
379
379
|
v-model="inputHour"
|
|
380
380
|
type="text"
|
|
381
381
|
maxlength="2"
|
|
382
|
-
class="h-
|
|
382
|
+
class="h-20 w-[96px] rounded-sm border border-outline bg-surface-container-highest text-center text-display-large text-on-surface outline-none transition-colors focus:border-2 focus:border-primary"
|
|
383
383
|
@blur="clampInput"
|
|
384
384
|
/>
|
|
385
|
-
<span class="text-display-
|
|
385
|
+
<span class="text-display-large text-on-surface">:</span>
|
|
386
386
|
<input
|
|
387
387
|
ref="inputMinuteEl"
|
|
388
388
|
v-model="inputMinute"
|
|
389
389
|
type="text"
|
|
390
390
|
maxlength="2"
|
|
391
|
-
class="h-
|
|
391
|
+
class="h-20 w-[96px] rounded-sm border border-outline bg-surface-container-highest text-center text-display-large text-on-surface outline-none transition-colors focus:border-2 focus:border-primary"
|
|
392
392
|
@blur="clampInput"
|
|
393
393
|
/>
|
|
394
394
|
<!-- AM / PM toggle -->
|
|
395
395
|
<div
|
|
396
396
|
v-if="!use24h"
|
|
397
|
-
class="ml-2 flex h-
|
|
397
|
+
class="ml-2 flex h-20 flex-col overflow-hidden rounded-sm border border-outline"
|
|
398
398
|
>
|
|
399
399
|
<button
|
|
400
400
|
type="button"
|
|
401
|
-
class="flex flex-1 items-center justify-center px-3 text-
|
|
401
|
+
class="flex flex-1 items-center justify-center px-3 text-title-medium transition-colors"
|
|
402
402
|
:class="
|
|
403
403
|
period === 'AM'
|
|
404
404
|
? 'bg-tertiary-container text-on-tertiary-container'
|
|
@@ -409,7 +409,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
409
409
|
<div class="h-px bg-outline" />
|
|
410
410
|
<button
|
|
411
411
|
type="button"
|
|
412
|
-
class="flex flex-1 items-center justify-center px-3 text-
|
|
412
|
+
class="flex flex-1 items-center justify-center px-3 text-title-medium transition-colors"
|
|
413
413
|
:class="
|
|
414
414
|
period === 'PM'
|
|
415
415
|
? 'bg-tertiary-container text-on-tertiary-container'
|
|
@@ -56,12 +56,14 @@ const isVertical = computed(() => props.orientation === 'vertical')
|
|
|
56
56
|
<div
|
|
57
57
|
class="flex items-center gap-1"
|
|
58
58
|
:class="[
|
|
59
|
-
isVertical ? 'flex-col
|
|
59
|
+
isVertical ? 'flex-col w-16' : 'flex-row h-16',
|
|
60
|
+
isVertical ? (variant === 'floating' ? 'py-2' : 'py-4') : (variant === 'floating' ? 'px-2' : 'px-4'),
|
|
60
61
|
alignClass,
|
|
61
62
|
colorClasses,
|
|
62
|
-
variant === 'floating' ? 'rounded-
|
|
63
|
+
variant === 'floating' ? 'rounded-full' : '',
|
|
64
|
+
variant === 'floating' && fabPosition !== 'none' ? 'shadow-elevation-1' : '',
|
|
63
65
|
variant === 'docked' ? 'w-full border-t border-outline-variant' : '',
|
|
64
|
-
variant === 'docked' && isVertical ? 'h-full w-
|
|
66
|
+
variant === 'docked' && isVertical ? 'h-full w-16 border-t-0 border-r border-outline-variant' : '',
|
|
65
67
|
]"
|
|
66
68
|
>
|
|
67
69
|
<slot />
|
|
@@ -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-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 -->
|
|
@@ -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'
|