diff --git a/m3-foundation/types/dom.d.ts b/m3-foundation/types/dom.d.ts index 6a06d0f..8c5e020 100644 --- a/m3-foundation/types/dom.d.ts +++ b/m3-foundation/types/dom.d.ts @@ -7,4 +7,4 @@ export interface Focusable { blur (): void; } -export interface Interactable extends Clickable, Focusable {} +export interface Interactive extends Clickable, Focusable {} diff --git a/m3-vue/package.json b/m3-vue/package.json index 33430ce..387b65e 100644 --- a/m3-vue/package.json +++ b/m3-vue/package.json @@ -34,7 +34,7 @@ "lodash.isequal": "^4.5.0" }, "peerDependencies": { - "vue": "^3.4" + "vue": "^3.5" }, "devDependencies": { "@chromatic-com/storybook": "^1.1.10", @@ -60,7 +60,7 @@ "@typescript-eslint/eslint-plugin": "^8.11.0", "@typescript-eslint/parser": "^8.11.0", "@vitejs/plugin-vue": "^5.0.4", - "@vue/compiler-sfc": "^3.4.19", + "@vue/compiler-sfc": "^3.5.13", "@vue/language-server": "^2.0.19", "eslint": "^9.13.0", "eslint-plugin-import": "^2.31.0", @@ -81,7 +81,7 @@ "vite": "^5.4.10", "vite-svg-loader": "^5.1.0", "vitest": "^2.1.3", - "vue": "^3.4.19", + "vue": "^3.5.13", "vue-router": "^4.3.0" }, "contributors": [ diff --git a/m3-vue/src/components/button/M3Button.ts b/m3-vue/src/components/button/M3Button.ts index 56f926d..7b272ad 100644 --- a/m3-vue/src/components/button/M3Button.ts +++ b/m3-vue/src/components/button/M3Button.ts @@ -1,4 +1,4 @@ -import type { Interactable } from '@modulify/m3-foundation' +import type { Interactive } from '@modulify/m3-foundation' import type { PropType, VNode } from 'vue' import type { RouteLocationRaw } from 'vue-router' @@ -58,7 +58,7 @@ export default defineComponent({ click: () => root.value?.click(), focus: () => root.value?.focus(), blur: () => root.value?.blur(), - } satisfies Interactable) + } satisfies Interactive) const onKeyup = (event: KeyboardEvent) => { if (event.code === 'Enter') { diff --git a/m3-vue/src/components/card/M3Card.vue b/m3-vue/src/components/card/M3Card.vue index 0fd1f51..8b8cf43 100644 --- a/m3-vue/src/components/card/M3Card.vue +++ b/m3-vue/src/components/card/M3Card.vue @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/m3-vue/src/components/checkbox/M3Checkbox.vue b/m3-vue/src/components/checkbox/M3Checkbox.vue index 6e1dcc4..6394791 100644 --- a/m3-vue/src/components/checkbox/M3Checkbox.vue +++ b/m3-vue/src/components/checkbox/M3Checkbox.vue @@ -13,11 +13,11 @@ \ No newline at end of file diff --git a/m3-vue/src/components/side-sheet/M3SideSheet.vue b/m3-vue/src/components/side-sheet/M3SideSheet.vue index 37659b8..f90d023 100644 --- a/m3-vue/src/components/side-sheet/M3SideSheet.vue +++ b/m3-vue/src/components/side-sheet/M3SideSheet.vue @@ -11,7 +11,7 @@
@@ -34,7 +34,7 @@
-
+
@@ -65,19 +65,21 @@ import { M3IconButton } from '@/components/icon-button' import { M3ScrollRail } from '@/components/scroll-rail' +import { computed } from 'vue' + import { isId, isUndefined, Or, } from '@modulify/m3-foundation/lib/predicates' -import makeId from '@/utils/id' +import useId from '@/composables/id' -defineProps({ +const props = defineProps({ id: { type: String, validator: Or(isId, isUndefined), - default: () => makeId('m3-side-sheet'), + default: undefined, }, shown: { @@ -92,4 +94,6 @@ defineProps({ }) const emit = defineEmits(['update:shown']) + +const _id = useId('m3-side-sheet', computed(() => props.id)) \ No newline at end of file diff --git a/m3-vue/src/components/slider/M3Slider.vue b/m3-vue/src/components/slider/M3Slider.vue index c2c1f9b..a4526c3 100644 --- a/m3-vue/src/components/slider/M3Slider.vue +++ b/m3-vue/src/components/slider/M3Slider.vue @@ -15,7 +15,7 @@
{ return min <= value && value <= max } -const toGap = ({ left, right }: DOMRect) => [left, right] +const toGap = ({ left, right }: DOMRect): [number, number] => [left, right] const updateNotches = () => { const _active = fillerActive.value?.getBoundingClientRect() @@ -529,9 +529,9 @@ watch(() => props.disabled, (disabled) => { onMounted(() => { updateNotches() - const fillerActiveObserver = new ResizeObserver(() => updateNotches()) - const handleMaxObserver = new ResizeObserver(() => updateNotches()) - const handleMinObserver = new ResizeObserver(() => updateNotches()) + const fillerActiveObserver = new ResizeObserver(() => requestAnimationFrame(updateNotches)) + const handleMaxObserver = new ResizeObserver(() => requestAnimationFrame(updateNotches)) + const handleMinObserver = new ResizeObserver(() => requestAnimationFrame(updateNotches)) fillerActiveObserver.observe(fillerActive.value as HTMLElement) handleMaxObserver.observe(handleMax.value as HTMLElement) diff --git a/m3-vue/src/components/switch/M3Switch.vue b/m3-vue/src/components/switch/M3Switch.vue index ec3e75a..452f1c9 100644 --- a/m3-vue/src/components/switch/M3Switch.vue +++ b/m3-vue/src/components/switch/M3Switch.vue @@ -8,8 +8,8 @@ v-bind="$attrs" > diff --git a/m3-vue/storybook/main.ts b/m3-vue/storybook/main.ts index d6718ce..e4f850e 100644 --- a/m3-vue/storybook/main.ts +++ b/m3-vue/storybook/main.ts @@ -39,7 +39,10 @@ const config: StorybookConfig = { './**/*.stories.@(js|jsx|mjs|ts|tsx)', ], viteFinal: async (config) => { - config.server.hmr.clientPort = 80 + if (config.server && typeof config.server.hmr === 'object') { + config.server.hmr.clientPort = 80 + } + return config }, } diff --git a/yarn.lock b/yarn.lock index 434f4b4..c03d5db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1514,7 +1514,7 @@ __metadata: "@typescript-eslint/eslint-plugin": "npm:^8.11.0" "@typescript-eslint/parser": "npm:^8.11.0" "@vitejs/plugin-vue": "npm:^5.0.4" - "@vue/compiler-sfc": "npm:^3.4.19" + "@vue/compiler-sfc": "npm:^3.5.13" "@vue/language-server": "npm:^2.0.19" eslint: "npm:^9.13.0" eslint-plugin-import: "npm:^2.31.0" @@ -1536,10 +1536,10 @@ __metadata: vite: "npm:^5.4.10" vite-svg-loader: "npm:^5.1.0" vitest: "npm:^2.1.3" - vue: "npm:^3.4.19" + vue: "npm:^3.5.13" vue-router: "npm:^4.3.0" peerDependencies: - vue: ^3.4 + vue: ^3.5 languageName: unknown linkType: soft @@ -3311,6 +3311,19 @@ __metadata: languageName: node linkType: hard +"@vue/compiler-core@npm:3.5.13": + version: 3.5.13 + resolution: "@vue/compiler-core@npm:3.5.13" + dependencies: + "@babel/parser": "npm:^7.25.3" + "@vue/shared": "npm:3.5.13" + entities: "npm:^4.5.0" + estree-walker: "npm:^2.0.2" + source-map-js: "npm:^1.2.0" + checksum: 10c0/b89f3e3ca92c3177ae449ada1480df13d99b5b3b2cdcf3202fd37dc30f294a1db1f473209f8bae9233e2d338632219d39b2bfa6941d158cea55255e4b0b30f90 + languageName: node + linkType: hard + "@vue/compiler-dom@npm:3.5.10, @vue/compiler-dom@npm:^3.2.0, @vue/compiler-dom@npm:^3.4.0": version: 3.5.10 resolution: "@vue/compiler-dom@npm:3.5.10" @@ -3321,7 +3334,34 @@ __metadata: languageName: node linkType: hard -"@vue/compiler-sfc@npm:3.5.10, @vue/compiler-sfc@npm:^3.2.0, @vue/compiler-sfc@npm:^3.4.19": +"@vue/compiler-dom@npm:3.5.13": + version: 3.5.13 + resolution: "@vue/compiler-dom@npm:3.5.13" + dependencies: + "@vue/compiler-core": "npm:3.5.13" + "@vue/shared": "npm:3.5.13" + checksum: 10c0/8f424a71883c9ef4abdd125d2be8d12dd8cf94ba56089245c88734b1f87c65e10597816070ba2ea0a297a2f66dc579f39275a9a53ef5664c143a12409612cd72 + languageName: node + linkType: hard + +"@vue/compiler-sfc@npm:3.5.13, @vue/compiler-sfc@npm:^3.5.13": + version: 3.5.13 + resolution: "@vue/compiler-sfc@npm:3.5.13" + dependencies: + "@babel/parser": "npm:^7.25.3" + "@vue/compiler-core": "npm:3.5.13" + "@vue/compiler-dom": "npm:3.5.13" + "@vue/compiler-ssr": "npm:3.5.13" + "@vue/shared": "npm:3.5.13" + estree-walker: "npm:^2.0.2" + magic-string: "npm:^0.30.11" + postcss: "npm:^8.4.48" + source-map-js: "npm:^1.2.0" + checksum: 10c0/5fd57895ce2801e480c08f31f91f0d1746ed08a9c1973895fd7269615f5bcdf75497978fb358bda738938d9844dea2404064c53b2cdda991014225297acce19e + languageName: node + linkType: hard + +"@vue/compiler-sfc@npm:^3.2.0": version: 3.5.10 resolution: "@vue/compiler-sfc@npm:3.5.10" dependencies: @@ -3348,6 +3388,16 @@ __metadata: languageName: node linkType: hard +"@vue/compiler-ssr@npm:3.5.13": + version: 3.5.13 + resolution: "@vue/compiler-ssr@npm:3.5.13" + dependencies: + "@vue/compiler-dom": "npm:3.5.13" + "@vue/shared": "npm:3.5.13" + checksum: 10c0/67621337b12fc414fcf9f16578961850724713a9fb64501136e432c2dfe95de99932c46fa24be9820f8bcdf8e7281f815f585b519a95ea979753bafd637dde1b + languageName: node + linkType: hard + "@vue/compiler-vue2@npm:^2.7.16": version: 2.7.16 resolution: "@vue/compiler-vue2@npm:2.7.16" @@ -3432,46 +3482,46 @@ __metadata: languageName: node linkType: hard -"@vue/reactivity@npm:3.5.10": - version: 3.5.10 - resolution: "@vue/reactivity@npm:3.5.10" +"@vue/reactivity@npm:3.5.13": + version: 3.5.13 + resolution: "@vue/reactivity@npm:3.5.13" dependencies: - "@vue/shared": "npm:3.5.10" - checksum: 10c0/4f11ea3b4e6f001944255098a94fd4ddb6150cdce61dc5f7beaad9b092d1464c7c98ac78414645c4c26942f2ce38d2f63b6cefc1ba7d1af471f96ced802bee21 + "@vue/shared": "npm:3.5.13" + checksum: 10c0/4bf2754a4b8cc31afc8da5bdfd12bba6be67b2963a65f7c9e2b59810883c58128dfc58cce6d1e479c4f666190bc0794f17208d9efd3fc909a2e4843d2cc0e69e languageName: node linkType: hard -"@vue/runtime-core@npm:3.5.10": - version: 3.5.10 - resolution: "@vue/runtime-core@npm:3.5.10" +"@vue/runtime-core@npm:3.5.13": + version: 3.5.13 + resolution: "@vue/runtime-core@npm:3.5.13" dependencies: - "@vue/reactivity": "npm:3.5.10" - "@vue/shared": "npm:3.5.10" - checksum: 10c0/18528668f3bfd291098e98d93eb8c76d9131bb44f62513fd55cccd2caf5101510ebb2a3d35ea6336d9123d3590442fac3d559f9b9a182cc4844f894f788d4750 + "@vue/reactivity": "npm:3.5.13" + "@vue/shared": "npm:3.5.13" + checksum: 10c0/b6be854bf082a224222614a334fbeac0e7b6445f3cf4ea45cbd49ae4bb1551200c461c14c7a452d748f2459f7402ad4dee5522d51be5a28ea4ae1f699a7c016f languageName: node linkType: hard -"@vue/runtime-dom@npm:3.5.10": - version: 3.5.10 - resolution: "@vue/runtime-dom@npm:3.5.10" +"@vue/runtime-dom@npm:3.5.13": + version: 3.5.13 + resolution: "@vue/runtime-dom@npm:3.5.13" dependencies: - "@vue/reactivity": "npm:3.5.10" - "@vue/runtime-core": "npm:3.5.10" - "@vue/shared": "npm:3.5.10" + "@vue/reactivity": "npm:3.5.13" + "@vue/runtime-core": "npm:3.5.13" + "@vue/shared": "npm:3.5.13" csstype: "npm:^3.1.3" - checksum: 10c0/6e03c2a0b3fabe4be173a5cb0d931e1353bd186379851ae81f77d270d4a950e445af7456a1bbb06d451b6c1b54d1ef618645b21d6f33a199ec37a4368370a215 + checksum: 10c0/8ee7f3980d19f77f8e7ae854e3ff1f7ee9a9b8b4e214c8d0492e1180ae818e33c04803b3d094503524d557431a30728b78cf15c3683d8abbbbd1b263a299d62a languageName: node linkType: hard -"@vue/server-renderer@npm:3.5.10": - version: 3.5.10 - resolution: "@vue/server-renderer@npm:3.5.10" +"@vue/server-renderer@npm:3.5.13": + version: 3.5.13 + resolution: "@vue/server-renderer@npm:3.5.13" dependencies: - "@vue/compiler-ssr": "npm:3.5.10" - "@vue/shared": "npm:3.5.10" + "@vue/compiler-ssr": "npm:3.5.13" + "@vue/shared": "npm:3.5.13" peerDependencies: - vue: 3.5.10 - checksum: 10c0/703ad1d8ccd4e4c66beac929a08b8bdf47876ac6d14f9bf824eabacf701465397ff20296a660ff70c536d88480129cda008b58be96d70f86a72905097f109bb2 + vue: 3.5.13 + checksum: 10c0/f500bdabc199abf41f1d84defd2a365a47afce1f2223a34c32fada84f6193b39ec2ce50636483409eec81b788b8ef0fa1ff59c63ca0c74764d738c24409eef8f languageName: node linkType: hard @@ -3482,6 +3532,13 @@ __metadata: languageName: node linkType: hard +"@vue/shared@npm:3.5.13": + version: 3.5.13 + resolution: "@vue/shared@npm:3.5.13" + checksum: 10c0/2c940ef907116f1c2583ca1d7733984e5705983ab07054c4e72f1d95eb0f7bdf4d01efbdaee1776c2008f79595963f44e98fced057f5957d86d57b70028f5025 + languageName: node + linkType: hard + "@vue/test-utils@npm:^2.4.1": version: 2.4.6 resolution: "@vue/test-utils@npm:2.4.6" @@ -9002,6 +9059,13 @@ __metadata: languageName: node linkType: hard +"picocolors@npm:^1.1.1": + version: 1.1.1 + resolution: "picocolors@npm:1.1.1" + checksum: 10c0/e2e3e8170ab9d7c7421969adaa7e1b31434f789afb9b3f115f6b96d91945041ac3ceb02e9ec6fe6510ff036bcc0bf91e69a1772edc0b707e12b19c0f2d6bcf58 + languageName: node + linkType: hard + "picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" @@ -9076,6 +9140,17 @@ __metadata: languageName: node linkType: hard +"postcss@npm:^8.4.48": + version: 8.4.49 + resolution: "postcss@npm:8.4.49" + dependencies: + nanoid: "npm:^3.3.7" + picocolors: "npm:^1.1.1" + source-map-js: "npm:^1.2.1" + checksum: 10c0/f1b3f17aaf36d136f59ec373459f18129908235e65dbdc3aee5eef8eba0756106f52de5ec4682e29a2eab53eb25170e7e871b3e4b52a8f1de3d344a514306be3 + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -11750,21 +11825,21 @@ __metadata: languageName: node linkType: hard -"vue@npm:^3.4.19": - version: 3.5.10 - resolution: "vue@npm:3.5.10" +"vue@npm:^3.5.13": + version: 3.5.13 + resolution: "vue@npm:3.5.13" dependencies: - "@vue/compiler-dom": "npm:3.5.10" - "@vue/compiler-sfc": "npm:3.5.10" - "@vue/runtime-dom": "npm:3.5.10" - "@vue/server-renderer": "npm:3.5.10" - "@vue/shared": "npm:3.5.10" + "@vue/compiler-dom": "npm:3.5.13" + "@vue/compiler-sfc": "npm:3.5.13" + "@vue/runtime-dom": "npm:3.5.13" + "@vue/server-renderer": "npm:3.5.13" + "@vue/shared": "npm:3.5.13" peerDependencies: typescript: "*" peerDependenciesMeta: typescript: optional: true - checksum: 10c0/00eb32562e22a34430ed2e459972a713b90a50e8ad5e957acae7e14a161dcdc4b8e210adc685e617342497f28dc174847bdebda9e1c3cd7d7b37bb7b259fcabb + checksum: 10c0/4bbb5caf3f04fed933b01c100804f3693ff902984a3152ea1359a972264fa3240f6551d32f0163a79c64df3715b4d6691818c9f652cdd41b2473c69e2b0a373d languageName: node linkType: hard