@nexxtmove/ui 1.2.3 → 1.2.4
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/dist/index.js +427 -427
- package/package.json +1 -1
- package/src/components/Squircle/Squircle.vue +32 -14
- package/src/test-setup.ts +9 -0
package/package.json
CHANGED
|
@@ -23,21 +23,39 @@ const px = computed(() => (typeof props.size === 'number' ? props.size : sizeMap
|
|
|
23
23
|
|
|
24
24
|
const id = Math.random().toString(36).slice(2, 9)
|
|
25
25
|
const clipPathId = `squircle-clip-${id}`
|
|
26
|
+
|
|
27
|
+
// Squircle outline normalised to a 0-1 box so a single path works at any size.
|
|
28
|
+
// Safari renders foreignObject content unreliably, so the slot lives in a plain
|
|
29
|
+
// element that is clipped with an objectBoundingBox clipPath instead.
|
|
30
|
+
const squirclePath =
|
|
31
|
+
'M0.5,1 c0.219,0 0.341,0 0.4205,-0.0795 C1,0.841 1,0.719 1,0.5 s0,-0.341 -0.0795,-0.4205 ' +
|
|
32
|
+
'C0.841,0 0.719,0 0.5,0 S0.159,0 0.0795,0.0795 C0,0.159 0,0.281 0,0.5 ' +
|
|
33
|
+
's0,0.341 0.0795,0.4205 C0.159,1 0.281,1 0.5,1 Z'
|
|
34
|
+
|
|
35
|
+
const style = computed(() => ({
|
|
36
|
+
width: `${px.value}px`,
|
|
37
|
+
height: `${px.value}px`,
|
|
38
|
+
clipPath: `url(#${clipPathId})`,
|
|
39
|
+
WebkitClipPath: `url(#${clipPathId})`,
|
|
40
|
+
}))
|
|
26
41
|
</script>
|
|
27
42
|
|
|
28
43
|
<template>
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
<div class="relative block shrink-0 overflow-hidden" :style="style">
|
|
45
|
+
<svg
|
|
46
|
+
class="absolute h-0 w-0 overflow-hidden"
|
|
47
|
+
aria-hidden="true"
|
|
48
|
+
focusable="false"
|
|
49
|
+
width="0"
|
|
50
|
+
height="0"
|
|
51
|
+
>
|
|
52
|
+
<defs>
|
|
53
|
+
<clipPath :id="clipPathId" clipPathUnits="objectBoundingBox">
|
|
54
|
+
<path :d="squirclePath" />
|
|
55
|
+
</clipPath>
|
|
56
|
+
</defs>
|
|
57
|
+
</svg>
|
|
58
|
+
|
|
59
|
+
<slot />
|
|
60
|
+
</div>
|
|
43
61
|
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// jsdom ships no media playback, so components driving a <video> element make it
|
|
2
|
+
// log "Not implemented: HTMLMediaElement's play() method" on every test run.
|
|
3
|
+
// The stubs stay configurable and writable so individual tests can still spy on
|
|
4
|
+
// or override them per element.
|
|
5
|
+
Object.defineProperties(HTMLMediaElement.prototype, {
|
|
6
|
+
play: { configurable: true, writable: true, value: () => Promise.resolve() },
|
|
7
|
+
pause: { configurable: true, writable: true, value: () => {} },
|
|
8
|
+
load: { configurable: true, writable: true, value: () => {} },
|
|
9
|
+
})
|