@tamagui/switch-headless 3.0.0-beta.924.1 → 3.0.1
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/package.json +12 -9
- package/src/useSwitch.tsx +6 -1
- package/types/useSwitch.d.ts +50 -2
- package/types/useSwitch.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/switch-headless",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"source": "src/index.ts",
|
|
5
6
|
"files": [
|
|
6
7
|
"src",
|
|
@@ -34,16 +35,17 @@
|
|
|
34
35
|
"clean:build": "tamagui-build clean:build"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@tamagui/compose-refs": "3.0.
|
|
38
|
-
"@tamagui/constants": "3.0.
|
|
39
|
-
"@tamagui/helpers": "3.0.
|
|
40
|
-
"@tamagui/label": "3.0.
|
|
41
|
-
"@tamagui/
|
|
38
|
+
"@tamagui/compose-refs": "3.0.1",
|
|
39
|
+
"@tamagui/constants": "3.0.1",
|
|
40
|
+
"@tamagui/helpers": "3.0.1",
|
|
41
|
+
"@tamagui/label": "3.0.1",
|
|
42
|
+
"@tamagui/react-native-types": "3.0.1",
|
|
43
|
+
"@tamagui/use-previous": "3.0.1"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@tamagui/build": "3.0.
|
|
46
|
+
"@tamagui/build": "3.0.1",
|
|
45
47
|
"react": "19.2.3",
|
|
46
|
-
"react-native": "0.
|
|
48
|
+
"react-native": "0.87.1"
|
|
47
49
|
},
|
|
48
50
|
"peerDependencies": {
|
|
49
51
|
"react": ">=19"
|
|
@@ -53,5 +55,6 @@
|
|
|
53
55
|
"type": "git",
|
|
54
56
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
55
57
|
"directory": "code/ui/switch-headless"
|
|
56
|
-
}
|
|
58
|
+
},
|
|
59
|
+
"releaseSourceCommit": "c156b7cc55e5a6cc5883ebc8189720850ac32dbd"
|
|
57
60
|
}
|
package/src/useSwitch.tsx
CHANGED
|
@@ -4,7 +4,12 @@ import { composeEventHandlers } from '@tamagui/helpers'
|
|
|
4
4
|
import { useLabelContext } from '@tamagui/label'
|
|
5
5
|
import { usePrevious } from '@tamagui/use-previous'
|
|
6
6
|
import * as React from 'react'
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
GestureResponderEvent,
|
|
9
|
+
PressableProps,
|
|
10
|
+
ViewInstance as View,
|
|
11
|
+
ViewProps,
|
|
12
|
+
} from '@tamagui/react-native-types'
|
|
8
13
|
|
|
9
14
|
type SwitchBaseProps = ViewProps & Pick<PressableProps, 'onPress'>
|
|
10
15
|
|
package/types/useSwitch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PressableProps, ViewInstance as View, ViewProps } from '@tamagui/react-native-types';
|
|
3
3
|
type SwitchBaseProps = ViewProps & Pick<PressableProps, 'onPress'>;
|
|
4
4
|
export type SwitchExtraProps = {
|
|
5
5
|
labeledBy?: string;
|
|
@@ -28,7 +28,55 @@ export declare function useSwitch<R extends View, P extends SwitchProps>(props:
|
|
|
28
28
|
'data-disabled'?: string | undefined;
|
|
29
29
|
disabled?: boolean | undefined;
|
|
30
30
|
'aria-labelledby': string | undefined;
|
|
31
|
-
onPress: import("@tamagui/helpers").EventHandler<
|
|
31
|
+
onPress: import("@tamagui/helpers").EventHandler<Readonly<Omit<Readonly<{
|
|
32
|
+
bubbles: boolean | undefined;
|
|
33
|
+
cancelable: boolean | undefined;
|
|
34
|
+
currentTarget: number | import("@tamagui/react-native-types").HostInstance;
|
|
35
|
+
defaultPrevented: boolean | undefined;
|
|
36
|
+
dispatchConfig: Readonly<{
|
|
37
|
+
registrationName: string;
|
|
38
|
+
}>;
|
|
39
|
+
eventPhase: number | undefined;
|
|
40
|
+
preventDefault: () => void;
|
|
41
|
+
isDefaultPrevented: () => boolean;
|
|
42
|
+
stopPropagation: () => void;
|
|
43
|
+
isPropagationStopped: () => boolean;
|
|
44
|
+
isTrusted: boolean | undefined;
|
|
45
|
+
nativeEvent: Readonly<{
|
|
46
|
+
changedTouches: ReadonlyArray<import("@tamagui/react-native-types").NativeTouchEvent>;
|
|
47
|
+
force?: number | undefined;
|
|
48
|
+
identifier: number;
|
|
49
|
+
locationX: number;
|
|
50
|
+
locationY: number;
|
|
51
|
+
pageX: number;
|
|
52
|
+
pageY: number;
|
|
53
|
+
target: number | undefined;
|
|
54
|
+
timestamp: number;
|
|
55
|
+
touches: ReadonlyArray<import("@tamagui/react-native-types").NativeTouchEvent>;
|
|
56
|
+
}>;
|
|
57
|
+
persist: () => void;
|
|
58
|
+
target: (number | undefined) | import("@tamagui/react-native-types").HostInstance;
|
|
59
|
+
timeStamp: number;
|
|
60
|
+
type: string | undefined;
|
|
61
|
+
}>, "touchHistory"> & {
|
|
62
|
+
touchHistory: Readonly<{
|
|
63
|
+
indexOfSingleActiveTouch: number;
|
|
64
|
+
mostRecentTimeStamp: number;
|
|
65
|
+
numberActiveTouches: number;
|
|
66
|
+
touchBank: ReadonlyArray<Readonly<{
|
|
67
|
+
touchActive: boolean;
|
|
68
|
+
startPageX: number;
|
|
69
|
+
startPageY: number;
|
|
70
|
+
startTimeStamp: number;
|
|
71
|
+
currentPageX: number;
|
|
72
|
+
currentPageY: number;
|
|
73
|
+
currentTimeStamp: number;
|
|
74
|
+
previousPageX: number;
|
|
75
|
+
previousPageY: number;
|
|
76
|
+
previousTimeStamp: number;
|
|
77
|
+
}>>;
|
|
78
|
+
}>;
|
|
79
|
+
}>> | undefined;
|
|
32
80
|
};
|
|
33
81
|
switchRef: (node: View) => void;
|
|
34
82
|
/**
|
package/types/useSwitch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSwitch.d.ts","sourceRoot":"","sources":["../src/useSwitch.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useSwitch.d.ts","sourceRoot":"","sources":["../src/useSwitch.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAEV,cAAc,EACd,YAAY,IAAI,IAAI,EACpB,SAAS,EACV,MAAM,6BAA6B,CAAA;AAEpC,KAAK,eAAe,GAAG,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;AAElE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,gBAAgB,CAAA;AAC5D,MAAM,MAAM,WAAW,GAAG,OAAO,CAAA;AAwDjC,wBAAgB,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,WAAW,EAC7D,KAAK,EAAE,CAAC,EACR,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,EACvF,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoDb;;OAEG;;EAmBR"}
|