@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.
Files changed (90) hide show
  1. package/README.md +5 -5
  2. package/dist/{MMenuItem-xQ1x6-DH.js → MMenuItem-vSLbJGqe.js} +299 -232
  3. package/dist/MMenuItem-vSLbJGqe.js.map +1 -0
  4. package/dist/code-editor.d.ts +1 -0
  5. package/dist/code-editor.js +22 -7
  6. package/dist/code-editor.js.map +1 -1
  7. package/dist/components/MCard.vue.d.ts +2 -0
  8. package/dist/components/MChatBubble.vue.d.ts +0 -1
  9. package/dist/components/MCircleProgressBar.vue.d.ts +0 -1
  10. package/dist/components/MCodeEditor.vue.d.ts +1 -1
  11. package/dist/components/MConfirmDialog.vue.d.ts +3 -0
  12. package/dist/components/MDialog.vue.d.ts +23 -7
  13. package/dist/components/MFab.vue.d.ts +2 -2
  14. package/dist/components/MListItem.vue.d.ts +11 -6
  15. package/dist/components/MNavigationRail.vue.d.ts +17 -1
  16. package/dist/components/MSelect.vue.d.ts +1 -0
  17. package/dist/components/MSwitch.vue.d.ts +8 -0
  18. package/dist/components/MTabs.vue.d.ts +3 -0
  19. package/dist/index.d.ts +1 -0
  20. package/dist/m3ui-vue.css +1 -1
  21. package/dist/m3ui.js +1798 -1432
  22. package/dist/m3ui.js.map +1 -1
  23. package/dist/rich-text-editor.js +1 -1
  24. package/dist/styles/palettes.css +659 -0
  25. package/dist/styles/theme.css +1 -0
  26. package/dist/styles.css +1 -1
  27. package/package.json +13 -1
  28. package/src/__tests__/useColorPalette.test.ts +2 -2
  29. package/src/code-editor.ts +1 -0
  30. package/src/components/MAutocomplete.vue +35 -26
  31. package/src/components/MBadge.vue +1 -1
  32. package/src/components/MBottomSheet.vue +4 -4
  33. package/src/components/MButton.vue +36 -19
  34. package/src/components/MButtonGroup.vue +2 -2
  35. package/src/components/MCard.vue +76 -11
  36. package/src/components/MChatBubble.vue +0 -1
  37. package/src/components/MCheckbox.vue +58 -13
  38. package/src/components/MChip.vue +26 -6
  39. package/src/components/MCircleProgressBar.vue +7 -4
  40. package/src/components/MCodeEditor.vue +54 -8
  41. package/src/components/MColorPicker.vue +9 -8
  42. package/src/components/MColorPickerModal.vue +2 -2
  43. package/src/components/MCommandPalette.vue +1 -1
  44. package/src/components/MConfirmDialog.vue +4 -0
  45. package/src/components/MContextMenu.vue +23 -2
  46. package/src/components/MDatePicker.vue +11 -11
  47. package/src/components/MDatePickerModal.vue +5 -5
  48. package/src/components/MDateRangePicker.vue +12 -12
  49. package/src/components/MDateRangePickerModal.vue +3 -3
  50. package/src/components/MDialog.vue +103 -12
  51. package/src/components/MFab.vue +10 -7
  52. package/src/components/MFabMenu.vue +1 -1
  53. package/src/components/MIconButton.vue +41 -19
  54. package/src/components/MListItem.vue +35 -17
  55. package/src/components/MLoadingIndicator.vue +14 -7
  56. package/src/components/MMaskField.vue +14 -6
  57. package/src/components/MMenu.vue +28 -3
  58. package/src/components/MMenuItem.vue +2 -2
  59. package/src/components/MMultiAutocomplete.vue +41 -26
  60. package/src/components/MMultiSelect.vue +40 -22
  61. package/src/components/MNavigationBar.vue +5 -10
  62. package/src/components/MNavigationDrawer.vue +10 -9
  63. package/src/components/MNavigationRail.vue +335 -22
  64. package/src/components/MNumberField.vue +14 -6
  65. package/src/components/MOverlay.vue +1 -1
  66. package/src/components/MPinInput.vue +7 -4
  67. package/src/components/MProgressBar.vue +16 -10
  68. package/src/components/MRadio.vue +54 -12
  69. package/src/components/MSearchBar.vue +3 -2
  70. package/src/components/MSegmentedButton.vue +14 -9
  71. package/src/components/MSelect.vue +44 -32
  72. package/src/components/MSideSheet.vue +1 -1
  73. package/src/components/MSnackbar.vue +4 -4
  74. package/src/components/MSplitButton.vue +32 -17
  75. package/src/components/MSpotlightSearch.vue +1 -1
  76. package/src/components/MSwitch.vue +96 -18
  77. package/src/components/MTabs.vue +16 -12
  78. package/src/components/MTagInput.vue +33 -22
  79. package/src/components/MTextField.vue +14 -6
  80. package/src/components/MTimePicker.vue +9 -9
  81. package/src/components/MTimePickerModal.vue +16 -16
  82. package/src/components/MToolbar.vue +5 -3
  83. package/src/components/MTooltip.vue +4 -4
  84. package/src/components/MTopAppBar.vue +14 -6
  85. package/src/components/MTour.vue +1 -1
  86. package/src/composables/useColorPalette.ts +10 -0
  87. package/src/index.ts +1 -0
  88. package/src/styles/palettes.css +659 -0
  89. package/src/styles/theme.css +1 -0
  90. 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 cursor-text items-center gap-1.5 flex-wrap',
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
- return [
126
- ...base,
127
- 'rounded-sm border bg-transparent py-2',
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
- return [
135
- ...base,
136
- 'rounded-t-sm bg-surface-container-highest border-b pb-2',
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
- ].join(' ')
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
- focused.value
163
- ? (props.error ? 'text-error' : 'text-primary')
164
- : (props.error ? 'text-error' : 'text-on-surface-variant'),
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 text-on-surface-variant"
180
- :class="variant === 'filled' ? 'top-5' : 'top-4.5'"
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="20" />
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 bg-secondary-container px-2 py-0.5 text-label-small text-on-secondary-container"
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="min-w-[60px] flex-1 bg-transparent text-body-large text-on-surface outline-none placeholder:text-on-surface-variant"
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:opacity-[0.38]",
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-sm border bg-transparent py-4",
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-sm bg-surface-container-highest border-b pt-6 pb-2",
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 text-on-surface-variant"
146
- :class="multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-5' : 'top-4.5'"
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="20" />
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-sm border bg-transparent px-4 text-left text-body-large transition-[border-color,border-width] duration-150"
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 opacity-[0.38]' : 'cursor-pointer',
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="20" class="shrink-0 text-on-surface-variant" />
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-lg bg-surface-container shadow-elevation-3"
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 = 20
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/40 p-4"
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-[72px] min-w-[96px] items-center justify-center rounded-lg text-display-medium transition-colors"
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-medium text-on-surface">:</span>
266
+ <span class="text-display-large text-on-surface">:</span>
267
267
 
268
268
  <button
269
269
  type="button"
270
- class="flex h-[72px] min-w-[96px] items-center justify-center rounded-lg text-display-medium transition-colors"
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-[72px] flex-col overflow-hidden rounded-lg border border-outline"
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-label-large transition-colors"
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-label-large transition-colors"
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-medium transition-colors"
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-medium transition-colors"
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-[72px] w-[96px] rounded-lg border border-outline bg-surface-container-highest text-center text-display-medium text-on-surface outline-none transition-colors focus:border-2 focus:border-primary"
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-medium text-on-surface">:</span>
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-[72px] w-[96px] rounded-lg border border-outline bg-surface-container-highest text-center text-display-medium text-on-surface outline-none transition-colors focus:border-2 focus:border-primary"
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-[72px] flex-col overflow-hidden rounded-lg border border-outline"
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-label-large transition-colors"
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-label-large transition-colors"
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 py-3 px-2' : 'flex-row px-3 py-2',
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-2xl shadow-elevation-2' : '',
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-auto border-t-0 border-r border-outline-variant' : '',
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 = 8
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-[220px] rounded bg-inverse-surface px-3 py-1.5 text-label-medium text-inverse-on-surface shadow-elevation-2"
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-3 ring-1 ring-outline-variant"
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 bg-surface transition-shadow"
25
- :class="[elevated ? 'shadow-elevation-2' : '', bordered ? 'border-b border-outline-variant' : '']"
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-4">
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 pb-3"
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"
@@ -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/40" @click="close" />
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'