ios-haptics 2.0.0 → 3.0.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/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/index.d.ts +4 -32
- package/dist/index.js +6 -1
- package/package.json +13 -74
- package/dist/index.d.mts +0 -32
- package/dist/index.mjs +0 -1
- package/dist/react/index.d.mts +0 -11
- package/dist/react/index.d.ts +0 -11
- package/dist/react/index.js +0 -1
- package/dist/react/index.mjs +0 -1
- package/dist/svelte/HapticTrigger.svelte +0 -42
- package/dist/svelte/index.d.mts +0 -10
- package/dist/svelte/index.d.ts +0 -10
- package/dist/svelte/index.js +0 -1
- package/dist/svelte/index.mjs +0 -1
- package/dist/vue/index.d.mts +0 -13
- package/dist/vue/index.d.ts +0 -13
- package/dist/vue/index.js +0 -1
- package/dist/vue/index.mjs +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License Copyright (c) 2025 tijn
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of
|
|
4
|
+
charge, to any person obtaining a copy of this software and associated
|
|
5
|
+
documentation files (the "Software"), to deal in the Software without
|
|
6
|
+
restriction, including without limitation the rights to use, copy, modify, merge,
|
|
7
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice
|
|
12
|
+
(including the next paragraph) shall be included in all copies or substantial
|
|
13
|
+
portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
16
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
18
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
19
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# 📳 ios-haptics
|
|
2
|
+
|
|
3
|
+
javascript library for haptic feedback inside of safari on ios
|
|
4
|
+
|
|
5
|
+
please note this only works on ios 17.4 to 26.4, as apple patched it in ios 26.5
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
[](https://npmjs.com/package/ios-haptics)
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
demo: [ios-haptics demo](https://codepen.io/tijnjh/pen/KwpgPqB)
|
|
13
|
+
|
|
14
|
+
## 📦 installation
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm i ios-haptics
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 🚀 usage
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import { hapticTrigger } from 'ios-haptics'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
vanilla
|
|
28
|
+
```javascript
|
|
29
|
+
const element = document.getElementById('element')
|
|
30
|
+
|
|
31
|
+
hapticTrigger(element)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
svelte
|
|
35
|
+
```html
|
|
36
|
+
<button {@attach hapticTrigger}>click me</button>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
react
|
|
40
|
+
```html
|
|
41
|
+
<button ref={hapticTrigger}>click me</button>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
vue
|
|
45
|
+
```html
|
|
46
|
+
<button :ref="hapticTrigger">click me</button>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## ⚙️ how it works
|
|
51
|
+
|
|
52
|
+
this uses the `<input type="checkbox" switch />` (introduced in safari 17.4), which has haptic feedback when toggled
|
|
53
|
+
|
|
54
|
+
`hapticTrigger` renders one of those on top of your element, so when the user taps it, safari triggers the native haptic feedback
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
feel free to send a pr or open an issue if you have suggestions or find
|
|
59
|
+
improvements
|
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @deprecated */
|
|
6
|
-
arguments: never;
|
|
7
|
-
/** @deprecated */
|
|
8
|
-
bind: never;
|
|
9
|
-
/** @deprecated */
|
|
10
|
-
call: never;
|
|
11
|
-
/** @deprecated */
|
|
12
|
-
caller: never;
|
|
13
|
-
/** @deprecated */
|
|
14
|
-
length: never;
|
|
15
|
-
/** @deprecated */
|
|
16
|
-
name: never;
|
|
17
|
-
/** @deprecated */
|
|
18
|
-
prototype: never;
|
|
19
|
-
/** @deprecated */
|
|
20
|
-
toString: never;
|
|
21
|
-
/** @deprecated */
|
|
22
|
-
Symbol: never;
|
|
23
|
-
/** a single haptic */
|
|
24
|
-
(): void;
|
|
25
|
-
/** two rapid haptics */
|
|
26
|
-
confirm: () => void;
|
|
27
|
-
/** three rapid haptics */
|
|
28
|
-
error: () => void;
|
|
29
|
-
}
|
|
30
|
-
declare const __haptic: haptic;
|
|
31
|
-
|
|
32
|
-
export { __haptic as haptic, supportsHaptics };
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare function hapticTrigger(element: HTMLElement | undefined | null): void;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { hapticTrigger };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ios-haptics v3.0.0
|
|
3
|
+
* tijn.dev
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/
|
|
6
|
+
function e(e){if(!e)return;let t=document.createElement(`input`);t.type=`checkbox`,t.setAttribute(`switch`,``),Object.assign(t.style,{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,margin:0,opacity:0,cursor:`pointer`,clipPath:`inset(0 round 999px)`,touchAction:`manipulation`}),t.style.setProperty(`-webkit-tap-highlight-color`,`transparent`),e.style.position=`relative`,e.insertAdjacentElement(`beforeend`,t)}export{e as hapticTrigger};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ios-haptics",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "3.0.0",
|
|
4
5
|
"description": "haptic feedback for ios safari",
|
|
6
|
+
"author": "tijnjh",
|
|
5
7
|
"license": "MIT",
|
|
6
8
|
"repository": {
|
|
7
9
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/tijnjh/ios-haptics.git"
|
|
9
|
-
"directory": "packages/ios-haptics"
|
|
10
|
+
"url": "git+https://github.com/tijnjh/ios-haptics.git"
|
|
10
11
|
},
|
|
11
12
|
"keywords": [
|
|
12
13
|
"haptic",
|
|
@@ -18,86 +19,24 @@
|
|
|
18
19
|
"safari",
|
|
19
20
|
"vibrate"
|
|
20
21
|
],
|
|
21
|
-
"sideEffects": false,
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"require": "./dist/react/index.d.ts"
|
|
27
|
-
},
|
|
28
|
-
"import": "./dist/index.mjs",
|
|
29
|
-
"require": "./dist/index.js"
|
|
30
|
-
},
|
|
31
|
-
"./react": {
|
|
32
|
-
"types": {
|
|
33
|
-
"import": "./dist/react/index.d.mts",
|
|
34
|
-
"require": "./dist/react/index.d.ts"
|
|
35
|
-
},
|
|
36
|
-
"import": "./dist/react/index.mjs",
|
|
37
|
-
"require": "./dist/react/index.js"
|
|
38
|
-
},
|
|
39
|
-
"./vue": {
|
|
40
|
-
"types": {
|
|
41
|
-
"import": "./dist/vue/index.d.mts",
|
|
42
|
-
"require": "./dist/vue/index.d.ts"
|
|
43
|
-
},
|
|
44
|
-
"import": "./dist/vue/index.mjs",
|
|
45
|
-
"require": "./dist/vue/index.js"
|
|
46
|
-
},
|
|
47
|
-
"./svelte": {
|
|
48
|
-
"types": {
|
|
49
|
-
"import": "./dist/svelte/index.d.mts",
|
|
50
|
-
"require": "./dist/svelte/index.d.ts"
|
|
51
|
-
},
|
|
52
|
-
"svelte": "./dist/svelte/index.mjs",
|
|
53
|
-
"import": "./dist/svelte/index.mjs",
|
|
54
|
-
"require": "./dist/svelte/index.js"
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
55
26
|
}
|
|
56
27
|
},
|
|
57
|
-
"main": "dist/index.js",
|
|
58
|
-
"module": "dist/index.
|
|
59
|
-
"types": "dist/index.d.ts",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
60
31
|
"files": [
|
|
61
|
-
"dist
|
|
32
|
+
"dist"
|
|
62
33
|
],
|
|
63
34
|
"scripts": {
|
|
64
|
-
"build": "
|
|
65
|
-
"dev": "tsup --watch"
|
|
66
|
-
},
|
|
67
|
-
"peerDependencies": {
|
|
68
|
-
"react": ">=18",
|
|
69
|
-
"react-dom": ">=18",
|
|
70
|
-
"svelte": ">=5",
|
|
71
|
-
"vue": ">=3"
|
|
72
|
-
},
|
|
73
|
-
"peerDependenciesMeta": {
|
|
74
|
-
"react": {
|
|
75
|
-
"optional": true
|
|
76
|
-
},
|
|
77
|
-
"react-dom": {
|
|
78
|
-
"optional": true
|
|
79
|
-
},
|
|
80
|
-
"svelte": {
|
|
81
|
-
"optional": true
|
|
82
|
-
},
|
|
83
|
-
"vue": {
|
|
84
|
-
"optional": true
|
|
85
|
-
}
|
|
35
|
+
"build": "tsdown"
|
|
86
36
|
},
|
|
87
37
|
"devDependencies": {
|
|
88
38
|
"@antfu/eslint-config": "^9.0.0",
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"eslint": "^10.3.0",
|
|
92
|
-
"eslint-plugin-format": "^2.0.1",
|
|
93
|
-
"eslint-plugin-react-refresh": "^0.5.2",
|
|
94
|
-
"eslint-plugin-svelte": "^3.17.1",
|
|
95
|
-
"react": "^19.2.7",
|
|
96
|
-
"react-dom": "^19.2.7",
|
|
97
|
-
"svelte": "^5.56.3",
|
|
98
|
-
"svelte-eslint-parser": "^1.6.1",
|
|
99
|
-
"tsup": "^8.5.1",
|
|
100
|
-
"typescript": "5",
|
|
101
|
-
"vue": "^3.5.38"
|
|
39
|
+
"eslint": "^10.5.0",
|
|
40
|
+
"tsdown": "latest"
|
|
102
41
|
}
|
|
103
42
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
declare const supportsHaptics: boolean;
|
|
2
|
-
interface haptic {
|
|
3
|
-
/** @deprecated */
|
|
4
|
-
apply: never;
|
|
5
|
-
/** @deprecated */
|
|
6
|
-
arguments: never;
|
|
7
|
-
/** @deprecated */
|
|
8
|
-
bind: never;
|
|
9
|
-
/** @deprecated */
|
|
10
|
-
call: never;
|
|
11
|
-
/** @deprecated */
|
|
12
|
-
caller: never;
|
|
13
|
-
/** @deprecated */
|
|
14
|
-
length: never;
|
|
15
|
-
/** @deprecated */
|
|
16
|
-
name: never;
|
|
17
|
-
/** @deprecated */
|
|
18
|
-
prototype: never;
|
|
19
|
-
/** @deprecated */
|
|
20
|
-
toString: never;
|
|
21
|
-
/** @deprecated */
|
|
22
|
-
Symbol: never;
|
|
23
|
-
/** a single haptic */
|
|
24
|
-
(): void;
|
|
25
|
-
/** two rapid haptics */
|
|
26
|
-
confirm: () => void;
|
|
27
|
-
/** three rapid haptics */
|
|
28
|
-
error: () => void;
|
|
29
|
-
}
|
|
30
|
-
declare const __haptic: haptic;
|
|
31
|
-
|
|
32
|
-
export { __haptic as haptic, supportsHaptics };
|
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r=typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(pointer: coarse)").matches;function e(){try{if(navigator.vibrate){navigator.vibrate(50);return}if(!r)return;let t=document.createElement("label");t.ariaHidden="true",t.style.display="none";let n=document.createElement("input");n.type="checkbox",n.setAttribute("switch",""),t.appendChild(n),document.head.appendChild(t),t.click(),document.head.removeChild(t);}catch{}}e.confirm=()=>{if(navigator.vibrate){navigator.vibrate([50,70,50]);return}e(),setTimeout(e,120);};e.error=()=>{if(navigator.vibrate){navigator.vibrate([50,70,50,70,50]);return}e(),setTimeout(e,120),setTimeout(e,240);};var i=e;export{i as haptic,r as supportsHaptics};
|
package/dist/react/index.d.mts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ElementType, ComponentPropsWithoutRef } from 'react';
|
|
3
|
-
|
|
4
|
-
type HapticTriggerProps<T extends ElementType> = {
|
|
5
|
-
as?: T;
|
|
6
|
-
onTap?: () => void;
|
|
7
|
-
} & ComponentPropsWithoutRef<T>;
|
|
8
|
-
|
|
9
|
-
declare function HapticTrigger<T extends ElementType>({ as, onTap, children, ...props }: HapticTriggerProps<T>): react.JSX.Element;
|
|
10
|
-
|
|
11
|
-
export { HapticTrigger };
|
package/dist/react/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ElementType, ComponentPropsWithoutRef } from 'react';
|
|
3
|
-
|
|
4
|
-
type HapticTriggerProps<T extends ElementType> = {
|
|
5
|
-
as?: T;
|
|
6
|
-
onTap?: () => void;
|
|
7
|
-
} & ComponentPropsWithoutRef<T>;
|
|
8
|
-
|
|
9
|
-
declare function HapticTrigger<T extends ElementType>({ as, onTap, children, ...props }: HapticTriggerProps<T>): react.JSX.Element;
|
|
10
|
-
|
|
11
|
-
export { HapticTrigger };
|
package/dist/react/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';function t({as:e,onTap:i,children:r,...o}){return React.createElement(e??"button",{...o,style:{position:"relative",display:"inline-flex"}},r,React.createElement("input",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",margin:0,opacity:0,cursor:"pointer",clipPath:"inset(0 round 999px)",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},type:"checkbox",onChange:i,switch:""}))}exports.HapticTrigger=t;
|
package/dist/react/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t({as:e,onTap:i,children:r,...o}){return React.createElement(e??"button",{...o,style:{position:"relative",display:"inline-flex"}},r,React.createElement("input",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",margin:0,opacity:0,cursor:"pointer",clipPath:"inset(0 round 999px)",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},type:"checkbox",onChange:i,switch:""}))}export{t as HapticTrigger};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<script lang='ts' generics="T extends keyof SvelteHTMLElements">
|
|
2
|
-
import type { SvelteHTMLElements } from 'svelte/elements'
|
|
3
|
-
import { HapticTriggerProps } from './types'
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
as,
|
|
7
|
-
ontap,
|
|
8
|
-
children,
|
|
9
|
-
...props
|
|
10
|
-
}: HapticTriggerProps<T> = $props()
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<svelte:element
|
|
14
|
-
this={as ?? 'button'}
|
|
15
|
-
{...props}
|
|
16
|
-
style='
|
|
17
|
-
position: relative;
|
|
18
|
-
display: inline-flex;
|
|
19
|
-
'
|
|
20
|
-
>
|
|
21
|
-
{@render children?.()}
|
|
22
|
-
|
|
23
|
-
<input
|
|
24
|
-
style='
|
|
25
|
-
position: absolute;
|
|
26
|
-
top: 0;
|
|
27
|
-
left: 0;
|
|
28
|
-
width: 100%;
|
|
29
|
-
height: 100%;
|
|
30
|
-
margin: 0;
|
|
31
|
-
opacity: 0;
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
clip-path: inset(0 round 999px);
|
|
34
|
-
-webkit-tap-highlight-color: transparent;
|
|
35
|
-
touch-action: manipulation;
|
|
36
|
-
'
|
|
37
|
-
type='checkbox'
|
|
38
|
-
onchange={ontap}
|
|
39
|
-
// @ts-expect-error - unrecognized attribute
|
|
40
|
-
switch
|
|
41
|
-
/>
|
|
42
|
-
</svelte:element>
|
package/dist/svelte/index.d.mts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Component } from 'svelte';
|
|
2
|
-
import { SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
type HapticTriggerProps<T extends keyof SvelteHTMLElements> = {
|
|
5
|
-
as?: T;
|
|
6
|
-
ontap?: () => void;
|
|
7
|
-
} & SvelteHTMLElements[T];
|
|
8
|
-
declare const HapticTrigger: Component<HapticTriggerProps<any>>;
|
|
9
|
-
|
|
10
|
-
export { HapticTrigger, type HapticTriggerProps };
|
package/dist/svelte/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Component } from 'svelte';
|
|
2
|
-
import { SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
type HapticTriggerProps<T extends keyof SvelteHTMLElements> = {
|
|
5
|
-
as?: T;
|
|
6
|
-
ontap?: () => void;
|
|
7
|
-
} & SvelteHTMLElements[T];
|
|
8
|
-
declare const HapticTrigger: Component<HapticTriggerProps<any>>;
|
|
9
|
-
|
|
10
|
-
export { HapticTrigger, type HapticTriggerProps };
|
package/dist/svelte/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as HapticTrigger } from "./HapticTrigger.svelte";
|
package/dist/svelte/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as HapticTrigger } from "./HapticTrigger.svelte";
|
package/dist/vue/index.d.mts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as vue from 'vue';
|
|
2
|
-
|
|
3
|
-
declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
4
|
-
as: StringConstructor;
|
|
5
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "tap"[], "tap", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
8
|
-
as: StringConstructor;
|
|
9
|
-
}>> & Readonly<{
|
|
10
|
-
onTap?: ((...args: any[]) => any) | undefined;
|
|
11
|
-
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
12
|
-
|
|
13
|
-
export { _default as HapticTrigger };
|
package/dist/vue/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as vue from 'vue';
|
|
2
|
-
|
|
3
|
-
declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
4
|
-
as: StringConstructor;
|
|
5
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "tap"[], "tap", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
8
|
-
as: StringConstructor;
|
|
9
|
-
}>> & Readonly<{
|
|
10
|
-
onTap?: ((...args: any[]) => any) | undefined;
|
|
11
|
-
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
12
|
-
|
|
13
|
-
export { _default as HapticTrigger };
|
package/dist/vue/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var vue=require('vue');var n=vue.defineComponent({name:"HapticTrigger",props:{as:String},emits:["tap"],setup(i,{emit:e,slots:r,attrs:o}){return ()=>{let p=i.as??"button";return vue.h(p,{...o,style:{position:"relative",display:"inline-flex"}},[r.default?.(),vue.h("input",{type:"checkbox",switch:"",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",margin:0,opacity:0,cursor:"pointer",clipPath:"inset(0 round 999px)",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},onChange:e("tap")})])}}});exports.HapticTrigger=n;
|
package/dist/vue/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {defineComponent,h}from'vue';var n=defineComponent({name:"HapticTrigger",props:{as:String},emits:["tap"],setup(i,{emit:e,slots:r,attrs:o}){return ()=>{let p=i.as??"button";return h(p,{...o,style:{position:"relative",display:"inline-flex"}},[r.default?.(),h("input",{type:"checkbox",switch:"",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",margin:0,opacity:0,cursor:"pointer",clipPath:"inset(0 round 999px)",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},onChange:e("tap")})])}}});export{n as HapticTrigger};
|