@m3ui-vue/m3ui-vue 0.9.2 → 0.9.3
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 +2 -0
- package/dist/API.md +69 -8
- package/dist/{MIcon-CaEooCmZ.js → MIcon-DLOkQduI.js} +10 -3
- package/dist/MIcon-DLOkQduI.js.map +1 -0
- package/dist/{MTextField-Ck0oWDMk.js → MTextField-DKtgPymd.js} +416 -206
- package/dist/MTextField-DKtgPymd.js.map +1 -0
- package/dist/THIRD_PARTY_LICENSES.md +547 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/components/MButton.vue.d.ts +4 -2
- package/dist/components/MButtonGroup.vue.d.ts +2 -0
- package/dist/components/MFab.vue.d.ts +4 -2
- package/dist/components/MIcon.vue.d.ts +3 -0
- package/dist/components/MIconButton.vue.d.ts +15 -1
- package/dist/components/MMenuItem.vue.d.ts +17 -4
- package/dist/components/MSplitButton.vue.d.ts +2 -0
- package/dist/components/MTabs.vue.d.ts +6 -0
- package/dist/components/MTimePickerModal.vue.d.ts +3 -0
- package/dist/components/MTimeScroll.vue.d.ts +22 -0
- package/dist/components/MToggleButton.vue.d.ts +2 -0
- package/dist/components/MTree.vue.d.ts +2 -2
- package/dist/components/_MDrawerItemList.vue.d.ts +3 -0
- package/dist/composables/_useSpring.d.ts +2 -0
- package/dist/composables/useLocale.d.ts +6 -0
- package/dist/directives/vRipple.d.ts +16 -0
- package/dist/emoji-names-de-BphO5XpV.js.map +1 -1
- package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -1
- package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -1
- package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -1
- package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -1
- package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -1
- package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -1
- package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/locales/index.js +42 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +5741 -5634
- package/dist/m3ui.js.map +1 -1
- package/dist/rich-text-editor.js +22 -22
- package/dist/styles/theme.css +13 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-CFW8cIzL.js → useLocale-Cn9MVIdw.js} +7 -1
- package/dist/useLocale-Cn9MVIdw.js.map +1 -0
- package/package.json +2 -2
- package/src/__tests__/MIconButton.test.ts +60 -0
- package/src/__tests__/MMenuItem.test.ts +84 -0
- package/src/__tests__/MScrollField.test.ts +28 -0
- package/src/__tests__/MTabs.test.ts +39 -0
- package/src/__tests__/MTimePickerModal.test.ts +52 -0
- package/src/__tests__/MTimeScroll.test.ts +44 -0
- package/src/__tests__/vRipple.test.ts +92 -0
- package/src/components/MButton.vue +4 -13
- package/src/components/MButtonGroup.vue +4 -11
- package/src/components/MFab.vue +8 -15
- package/src/components/MIcon.vue +4 -2
- package/src/components/MIconButton.vue +96 -24
- package/src/components/MMenuItem.vue +115 -13
- package/src/components/MScrollField.vue +10 -2
- package/src/components/MSplitButton.vue +5 -12
- package/src/components/MTabs.vue +16 -5
- package/src/components/MTimePickerModal.vue +48 -8
- package/src/components/MTimeScroll.vue +161 -0
- package/src/components/MToggleButton.vue +5 -12
- package/src/composables/_carouselStrategy.ts +3 -0
- package/src/composables/_useSpring.ts +2 -0
- package/src/composables/useLocale.ts +12 -0
- package/src/data/emoji-names/emoji-names-de.ts +1 -0
- package/src/data/emoji-names/emoji-names-en.ts +1 -0
- package/src/data/emoji-names/emoji-names-es.ts +1 -0
- package/src/data/emoji-names/emoji-names-fr.ts +1 -0
- package/src/data/emoji-names/emoji-names-ja.ts +1 -0
- package/src/data/emoji-names/emoji-names-ko.ts +1 -0
- package/src/data/emoji-names/emoji-names-pt.ts +1 -0
- package/src/data/emoji-names/emoji-names-zh.ts +1 -0
- package/src/data/emojis.ts +1 -0
- package/src/directives/vRipple.ts +73 -0
- package/src/index.ts +5 -0
- package/src/locales/de.ts +6 -0
- package/src/locales/es.ts +6 -0
- package/src/locales/fr.ts +6 -0
- package/src/locales/ja.ts +6 -0
- package/src/locales/ko.ts +6 -0
- package/src/locales/pt.ts +6 -0
- package/src/locales/zh.ts +6 -0
- package/src/plugin.ts +2 -0
- package/src/styles/theme.css +13 -0
- package/dist/MIcon-CaEooCmZ.js.map +0 -1
- package/dist/MTextField-Ck0oWDMk.js.map +0 -1
- package/dist/useLocale-CFW8cIzL.js.map +0 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Portions Copyright The Android Open Source Project, licensed under the Apache License, Version 2.0
|
|
3
|
+
* (dist/THIRD_PARTY_LICENSES.md). Translated from Kotlin to TypeScript and modified for this library.
|
|
4
|
+
*
|
|
2
5
|
* Port of the Compose Material3 carousel engine (androidx compose/material3/carousel:
|
|
3
6
|
* Arrangement.kt, KeylineList.kt, Keylines.kt, Strategy.kt, KeylineSnapPosition.kt), kept close to
|
|
4
7
|
* the original so it can be diffed against upstream. Pure functions, no DOM: MCarousel feeds it the
|
|
@@ -7,6 +7,8 @@ export interface SpringSpec { dampingRatio: number; stiffness: number }
|
|
|
7
7
|
|
|
8
8
|
/** MotionSchemeKeyTokens.FastSpatial in the Standard scheme (StandardMotionTokens.SpringFastSpatial*) */
|
|
9
9
|
export const FAST_SPATIAL: SpringSpec = { dampingRatio: 0.9, stiffness: 1400 }
|
|
10
|
+
/** MotionSchemeKeyTokens.FastEffects in the Standard scheme */
|
|
11
|
+
export const FAST_EFFECTS: SpringSpec = { dampingRatio: 1, stiffness: 3800 }
|
|
10
12
|
/** MotionSchemeKeyTokens.DefaultEffects in the Standard scheme */
|
|
11
13
|
export const DEFAULT_EFFECTS: SpringSpec = { dampingRatio: 1, stiffness: 1600 }
|
|
12
14
|
/** MotionSchemeKeyTokens.DefaultSpatial in the Standard scheme */
|
|
@@ -39,6 +39,12 @@ export interface M3Locale {
|
|
|
39
39
|
// Pickers
|
|
40
40
|
selectDate: string
|
|
41
41
|
selectTime: string
|
|
42
|
+
timeHourSelection: string
|
|
43
|
+
timeMinuteSelection: string
|
|
44
|
+
timePeriodToggle: string
|
|
45
|
+
timeToggleKeyboard: string
|
|
46
|
+
timeToggleDial: string
|
|
47
|
+
timeToggleScroll: string
|
|
42
48
|
selectRange: string
|
|
43
49
|
pickStart: string
|
|
44
50
|
pickEnd: string
|
|
@@ -212,6 +218,12 @@ export const defaultLocale: M3Locale = {
|
|
|
212
218
|
|
|
213
219
|
selectDate: 'Select date',
|
|
214
220
|
selectTime: 'Select time',
|
|
221
|
+
timeHourSelection: 'Select hour',
|
|
222
|
+
timeMinuteSelection: 'Select minutes',
|
|
223
|
+
timePeriodToggle: 'Select AM or PM',
|
|
224
|
+
timeToggleKeyboard: 'Switch to text input mode',
|
|
225
|
+
timeToggleDial: 'Switch to clock mode',
|
|
226
|
+
timeToggleScroll: 'Switch to scroll mode',
|
|
215
227
|
selectRange: 'Select range',
|
|
216
228
|
pickStart: 'Select start',
|
|
217
229
|
pickEnd: 'Select end',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from CLDR 48.2.0 annotations (de). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
// "name|keyword|keyword…" per emoji.
|
|
3
4
|
const names: Record<string, string> = {
|
|
4
5
|
'😀': 'grinsendes Gesicht|froh|fröhlich|Gesicht|grinsen|haha|lachen|lol|lustig|Smiley',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from CLDR 48.2.0 annotations (en). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
// "name|keyword|keyword…" per emoji.
|
|
3
4
|
const names: Record<string, string> = {
|
|
4
5
|
'😀': 'grinning face|cheerful|cheery|face|grin|grinning|happy|laugh|nice|smile|smiling|teeth',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from CLDR 48.2.0 annotations (es). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
// "name|keyword|keyword…" per emoji.
|
|
3
4
|
const names: Record<string, string> = {
|
|
4
5
|
'😀': 'cara sonriendo|cara|divertido|feliz|sonrisa',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from CLDR 48.2.0 annotations (fr). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
// "name|keyword|keyword…" per emoji.
|
|
3
4
|
const names: Record<string, string> = {
|
|
4
5
|
'😀': 'visage rieur|content|dents|émoticône|grand sourire|heureux|joyeux|rire|sourire|super|visage|visage très souriant',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from CLDR 48.2.0 annotations (ja). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
// "name|keyword|keyword…" per emoji.
|
|
3
4
|
const names: Record<string, string> = {
|
|
4
5
|
'😀': 'にっこり笑う|スマイル|ナイス|にっこり|ハッピー|笑う|笑顔|顔',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from CLDR 48.2.0 annotations (ko). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
// "name|keyword|keyword…" per emoji.
|
|
3
4
|
const names: Record<string, string> = {
|
|
4
5
|
'😀': '활짝 웃는 얼굴|미소|발랄함|스마일|얼굴|웃음|치아|행복|환호',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from CLDR 48.2.0 annotations (pt). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
// "name|keyword|keyword…" per emoji.
|
|
3
4
|
const names: Record<string, string> = {
|
|
4
5
|
'😀': 'rosto risonho|engraçado|feliz|lol|rindo|risada|riso|rosto|sorridente',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from CLDR 48.2.0 annotations (zh). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
// "name|keyword|keyword…" per emoji.
|
|
3
4
|
const names: Record<string, string> = {
|
|
4
5
|
'😀': '嘿嘿|笑脸|脸|高兴',
|
package/src/data/emojis.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-emoji-data.mjs from Unicode emoji-test.txt (Emoji 15). Don't edit by hand.
|
|
2
|
+
// Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
|
|
2
3
|
|
|
3
4
|
export interface EmojiCategory {
|
|
4
5
|
id: string
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Directive } from 'vue'
|
|
2
|
+
|
|
3
|
+
/** Options for `v-ripple`. */
|
|
4
|
+
export interface RippleOptions {
|
|
5
|
+
/** No ripple while true (e.g. bound to the element's disabled state). */
|
|
6
|
+
disabled?: boolean
|
|
7
|
+
/** Any CSS color for the ripple; defaults to the element's text color (`currentColor`). */
|
|
8
|
+
color?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** `v-ripple` value: nothing or `true` (on), `false` (off), a CSS color, or an options object. */
|
|
12
|
+
export type RippleValue = boolean | string | RippleOptions | null | undefined
|
|
13
|
+
|
|
14
|
+
function normalize(value: RippleValue): RippleOptions {
|
|
15
|
+
if (value === false) return { disabled: true }
|
|
16
|
+
if (typeof value === 'string') return { color: value }
|
|
17
|
+
if (value === true || value == null) return {}
|
|
18
|
+
return value
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// The ripple sits in its own clipping layer (`border-radius: inherit`), so the host only needs to be
|
|
22
|
+
// positioned, not `overflow: hidden`.
|
|
23
|
+
function spawnRipple(host: HTMLElement, event: { clientX: number; clientY: number }, color?: string) {
|
|
24
|
+
const rect = host.getBoundingClientRect()
|
|
25
|
+
const d = Math.max(rect.width, rect.height) * 2
|
|
26
|
+
const layer = document.createElement('span')
|
|
27
|
+
layer.className = 'm3-ripple-layer'
|
|
28
|
+
const el = document.createElement('span')
|
|
29
|
+
el.className = 'm3-ripple'
|
|
30
|
+
el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`
|
|
31
|
+
if (color) el.style.background = color
|
|
32
|
+
layer.appendChild(el)
|
|
33
|
+
host.appendChild(layer)
|
|
34
|
+
el.addEventListener('animationend', () => layer.remove(), { once: true })
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface RippleState {
|
|
38
|
+
options: RippleOptions
|
|
39
|
+
onPointerDown: (e: PointerEvent) => void
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const states = new WeakMap<HTMLElement, RippleState>()
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The M3 press ripple for any element: `<div v-ripple>`, `v-ripple="false"`, `v-ripple="'#e91e63'"`
|
|
46
|
+
* or `v-ripple="{ disabled, color }"`. A statically positioned element is made `position: relative`.
|
|
47
|
+
* Registered globally as `v-ripple` by `createM3UI()`; import `vRipple` to use it without the plugin.
|
|
48
|
+
*/
|
|
49
|
+
export const vRipple: Directive<HTMLElement, RippleValue> = {
|
|
50
|
+
mounted(el, binding) {
|
|
51
|
+
const state: RippleState = {
|
|
52
|
+
options: normalize(binding.value),
|
|
53
|
+
onPointerDown(e) {
|
|
54
|
+
if (state.options.disabled || e.button !== 0) return
|
|
55
|
+
// Checked on press, not on mount: the element may not be in the document yet when mounted.
|
|
56
|
+
const { position } = getComputedStyle(el)
|
|
57
|
+
if (!position || position === 'static') el.style.position = 'relative'
|
|
58
|
+
spawnRipple(el, e, state.options.color)
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
states.set(el, state)
|
|
62
|
+
el.addEventListener('pointerdown', state.onPointerDown)
|
|
63
|
+
},
|
|
64
|
+
updated(el, binding) {
|
|
65
|
+
const state = states.get(el)
|
|
66
|
+
if (state) state.options = normalize(binding.value)
|
|
67
|
+
},
|
|
68
|
+
beforeUnmount(el) {
|
|
69
|
+
const state = states.get(el)
|
|
70
|
+
if (state) el.removeEventListener('pointerdown', state.onPointerDown)
|
|
71
|
+
states.delete(el)
|
|
72
|
+
},
|
|
73
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,10 @@ export type { Notification, NotificationVariant, NotificationPosition, Notificat
|
|
|
23
23
|
export { useDebounce } from './composables/useDebounce'
|
|
24
24
|
export { usePageProgress } from './composables/usePageProgress'
|
|
25
25
|
|
|
26
|
+
// Directives
|
|
27
|
+
export { vRipple } from './directives/vRipple'
|
|
28
|
+
export type { RippleOptions, RippleValue } from './directives/vRipple'
|
|
29
|
+
|
|
26
30
|
// Components
|
|
27
31
|
export { default as MAbsolute } from './components/MAbsolute.vue'
|
|
28
32
|
export { default as MAlert } from './components/MAlert.vue'
|
|
@@ -173,6 +177,7 @@ export { default as MTextField } from './components/MTextField.vue'
|
|
|
173
177
|
export { default as MTimeline } from './components/MTimeline.vue'
|
|
174
178
|
export { default as MTimePicker } from './components/MTimePicker.vue'
|
|
175
179
|
export { default as MTimePickerModal } from './components/MTimePickerModal.vue'
|
|
180
|
+
export { default as MTimeScroll } from './components/MTimeScroll.vue'
|
|
176
181
|
export { default as MTitle } from './components/MTitle.vue'
|
|
177
182
|
export { default as MToggleButton } from './components/MToggleButton.vue'
|
|
178
183
|
export { default as MTooltip } from './components/MTooltip.vue'
|
package/src/locales/de.ts
CHANGED
|
@@ -38,6 +38,12 @@ export const deLocale: M3Locale = {
|
|
|
38
38
|
// Pickers
|
|
39
39
|
selectDate: 'Datum auswählen',
|
|
40
40
|
selectTime: 'Uhrzeit auswählen',
|
|
41
|
+
timeHourSelection: 'Stunde auswählen',
|
|
42
|
+
timeMinuteSelection: 'Minuten auswählen',
|
|
43
|
+
timePeriodToggle: 'AM oder PM auswählen',
|
|
44
|
+
timeToggleKeyboard: 'Zur Texteingabe wechseln',
|
|
45
|
+
timeToggleDial: 'Zum Uhrmodus wechseln',
|
|
46
|
+
timeToggleScroll: 'Zum Scrollmodus wechseln',
|
|
41
47
|
selectRange: 'Bereich auswählen',
|
|
42
48
|
pickStart: 'Anfang auswählen',
|
|
43
49
|
pickEnd: 'Ende auswählen',
|
package/src/locales/es.ts
CHANGED
|
@@ -38,6 +38,12 @@ export const esLocale: M3Locale = {
|
|
|
38
38
|
// Pickers
|
|
39
39
|
selectDate: 'Seleccionar fecha',
|
|
40
40
|
selectTime: 'Seleccionar hora',
|
|
41
|
+
timeHourSelection: 'Seleccionar hora',
|
|
42
|
+
timeMinuteSelection: 'Seleccionar minutos',
|
|
43
|
+
timePeriodToggle: 'Seleccionar a. m. o p. m.',
|
|
44
|
+
timeToggleKeyboard: 'Cambiar a entrada de texto',
|
|
45
|
+
timeToggleDial: 'Cambiar a modo reloj',
|
|
46
|
+
timeToggleScroll: 'Cambiar a modo desplazamiento',
|
|
41
47
|
selectRange: 'Seleccionar rango',
|
|
42
48
|
pickStart: 'Seleccionar inicio',
|
|
43
49
|
pickEnd: 'Seleccionar fin',
|
package/src/locales/fr.ts
CHANGED
|
@@ -38,6 +38,12 @@ export const frLocale: M3Locale = {
|
|
|
38
38
|
// Pickers
|
|
39
39
|
selectDate: 'Sélectionner la date',
|
|
40
40
|
selectTime: "Sélectionner l'heure",
|
|
41
|
+
timeHourSelection: "Sélectionner l'heure",
|
|
42
|
+
timeMinuteSelection: 'Sélectionner les minutes',
|
|
43
|
+
timePeriodToggle: 'Sélectionner AM ou PM',
|
|
44
|
+
timeToggleKeyboard: 'Passer à la saisie de texte',
|
|
45
|
+
timeToggleDial: 'Passer au mode horloge',
|
|
46
|
+
timeToggleScroll: 'Passer au mode défilement',
|
|
41
47
|
selectRange: 'Sélectionner la plage',
|
|
42
48
|
pickStart: 'Sélectionner le début',
|
|
43
49
|
pickEnd: 'Sélectionner la fin',
|
package/src/locales/ja.ts
CHANGED
|
@@ -38,6 +38,12 @@ export const jaLocale: M3Locale = {
|
|
|
38
38
|
// Pickers
|
|
39
39
|
selectDate: '日付を選択',
|
|
40
40
|
selectTime: '時刻を選択',
|
|
41
|
+
timeHourSelection: '時間を選択',
|
|
42
|
+
timeMinuteSelection: '分を選択',
|
|
43
|
+
timePeriodToggle: '午前または午後を選択',
|
|
44
|
+
timeToggleKeyboard: 'テキスト入力モードに切り替え',
|
|
45
|
+
timeToggleDial: '時計モードに切り替え',
|
|
46
|
+
timeToggleScroll: 'スクロールモードに切り替え',
|
|
41
47
|
selectRange: '範囲を選択',
|
|
42
48
|
pickStart: '開始を選択',
|
|
43
49
|
pickEnd: '終了を選択',
|
package/src/locales/ko.ts
CHANGED
|
@@ -38,6 +38,12 @@ export const koLocale: M3Locale = {
|
|
|
38
38
|
// Pickers
|
|
39
39
|
selectDate: '날짜 선택',
|
|
40
40
|
selectTime: '시간 선택',
|
|
41
|
+
timeHourSelection: '시간 선택',
|
|
42
|
+
timeMinuteSelection: '분 선택',
|
|
43
|
+
timePeriodToggle: '오전 또는 오후 선택',
|
|
44
|
+
timeToggleKeyboard: '텍스트 입력 모드로 전환',
|
|
45
|
+
timeToggleDial: '시계 모드로 전환',
|
|
46
|
+
timeToggleScroll: '스크롤 모드로 전환',
|
|
41
47
|
selectRange: '범위 선택',
|
|
42
48
|
pickStart: '시작 선택',
|
|
43
49
|
pickEnd: '종료 선택',
|
package/src/locales/pt.ts
CHANGED
|
@@ -38,6 +38,12 @@ export const ptLocale: M3Locale = {
|
|
|
38
38
|
// Pickers
|
|
39
39
|
selectDate: 'Selecionar data',
|
|
40
40
|
selectTime: 'Selecionar hora',
|
|
41
|
+
timeHourSelection: 'Selecionar hora',
|
|
42
|
+
timeMinuteSelection: 'Selecionar minutos',
|
|
43
|
+
timePeriodToggle: 'Selecionar AM ou PM',
|
|
44
|
+
timeToggleKeyboard: 'Mudar para entrada de texto',
|
|
45
|
+
timeToggleDial: 'Mudar para o modo relógio',
|
|
46
|
+
timeToggleScroll: 'Mudar para o modo de rolagem',
|
|
41
47
|
selectRange: 'Selecionar intervalo',
|
|
42
48
|
pickStart: 'Selecionar início',
|
|
43
49
|
pickEnd: 'Selecionar fim',
|
package/src/locales/zh.ts
CHANGED
|
@@ -38,6 +38,12 @@ export const zhLocale: M3Locale = {
|
|
|
38
38
|
// Pickers
|
|
39
39
|
selectDate: '选择日期',
|
|
40
40
|
selectTime: '选择时间',
|
|
41
|
+
timeHourSelection: '选择小时',
|
|
42
|
+
timeMinuteSelection: '选择分钟',
|
|
43
|
+
timePeriodToggle: '选择上午或下午',
|
|
44
|
+
timeToggleKeyboard: '切换到文本输入模式',
|
|
45
|
+
timeToggleDial: '切换到时钟模式',
|
|
46
|
+
timeToggleScroll: '切换到滚动模式',
|
|
41
47
|
selectRange: '选择范围',
|
|
42
48
|
pickStart: '选择开始',
|
|
43
49
|
pickEnd: '选择结束',
|
package/src/plugin.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { SeedOptions } from './composables/dynamicColor'
|
|
|
5
5
|
import { syncThemeColor } from './composables/_themeColor'
|
|
6
6
|
import type { M3Locale } from './composables/useLocale'
|
|
7
7
|
import { M3_LOCALE_KEY, __setAppLocale } from './composables/useLocale'
|
|
8
|
+
import { vRipple } from './directives/vRipple'
|
|
8
9
|
|
|
9
10
|
export interface M3UIOptions {
|
|
10
11
|
palette?: string
|
|
@@ -47,6 +48,7 @@ export interface M3UIOptions {
|
|
|
47
48
|
export function createM3UI(options: M3UIOptions = {}) {
|
|
48
49
|
return {
|
|
49
50
|
install(app: App) {
|
|
51
|
+
app.directive('ripple', vRipple)
|
|
50
52
|
for (const custom of options.customPalettes ?? []) {
|
|
51
53
|
const i = palettes.findIndex((p) => p.id === custom.id)
|
|
52
54
|
if (i === -1) palettes.push(custom)
|
package/src/styles/theme.css
CHANGED
|
@@ -82,6 +82,11 @@
|
|
|
82
82
|
--radius-md: 12px;
|
|
83
83
|
--radius-lg: 16px;
|
|
84
84
|
--radius-xl: 28px;
|
|
85
|
+
/* M3 Expressive steps (ShapeKeyTokens CornerLargeIncreased, CornerExtraLargeIncreased, CornerExtraExtraLarge);
|
|
86
|
+
not 2xl/3xl, which are Tailwind's own defaults (16px/24px) and stay as they are */
|
|
87
|
+
--radius-lg-increased: 20px;
|
|
88
|
+
--radius-xl-increased: 32px;
|
|
89
|
+
--radius-xxl: 48px;
|
|
85
90
|
|
|
86
91
|
/* Elevation */
|
|
87
92
|
--shadow-elevation-1: 0px 1px 2px 0px rgb(0 0 0 / 0.3), 0px 1px 3px 1px rgb(0 0 0 / 0.15);
|
|
@@ -313,6 +318,14 @@ html.theme-transitioning *::after {
|
|
|
313
318
|
to { transform: scale(1); opacity: 0; }
|
|
314
319
|
}
|
|
315
320
|
|
|
321
|
+
.m3-ripple-layer {
|
|
322
|
+
position: absolute;
|
|
323
|
+
inset: 0;
|
|
324
|
+
overflow: hidden;
|
|
325
|
+
border-radius: inherit;
|
|
326
|
+
pointer-events: none;
|
|
327
|
+
}
|
|
328
|
+
|
|
316
329
|
.m3-ripple {
|
|
317
330
|
position: absolute;
|
|
318
331
|
border-radius: 50%;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MIcon-CaEooCmZ.js","names":[],"sources":["../src/components/MIcon.vue","../src/components/MIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a\n * Tailwind text-* class).\n */\nwithDefaults(defineProps<{\n /** Material Symbol name (e.g. \"settings\", \"favorite\") */\n name: string\n /** Icon size in px */\n size?: number\n}>(), { size: 24 })\n</script>\n\n<template>\n <span class=\"material-symbols-outlined leading-none\" :style=\"{ fontSize: `${size}px` }\">{{\n name\n }}</span>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a\n * Tailwind text-* class).\n */\nwithDefaults(defineProps<{\n /** Material Symbol name (e.g. \"settings\", \"favorite\") */\n name: string\n /** Icon size in px */\n size?: number\n}>(), { size: 24 })\n</script>\n\n<template>\n <span class=\"material-symbols-outlined leading-none\" :style=\"{ fontSize: `${size}px` }\">{{\n name\n }}</span>\n</template>\n"],"mappings":";;;;;;;;;;oBAcE,EAAA,GAAA,EAES,QAAA;GAFH,OAAM;GAA0C,OAAK,EAAA,EAAA,UAAA,GAAiB,EAAA,KAAI,IAAA,CAAA;EAC9E,GAAA,EAAA,EAAA,IAAI,GAAA,CAAA"}
|