@tamagui/checkbox-headless 3.0.0-beta.807.1 → 3.0.0-beta.831.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/checkbox-headless",
3
- "version": "3.0.0-beta.807.1",
3
+ "version": "3.0.0-beta.831.1",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -35,18 +35,18 @@
35
35
  "clean:build": "tamagui-build clean:build"
36
36
  },
37
37
  "dependencies": {
38
- "@tamagui/compose-refs": "3.0.0-beta.807.1",
39
- "@tamagui/constants": "3.0.0-beta.807.1",
40
- "@tamagui/create-context": "3.0.0-beta.807.1",
41
- "@tamagui/focusable": "3.0.0-beta.807.1",
42
- "@tamagui/helpers": "3.0.0-beta.807.1",
43
- "@tamagui/label": "3.0.0-beta.807.1",
44
- "@tamagui/use-controllable-state": "3.0.0-beta.807.1",
45
- "@tamagui/use-previous": "3.0.0-beta.807.1",
46
- "@tamagui/web": "3.0.0-beta.807.1"
38
+ "@tamagui/compose-refs": "3.0.0-beta.831.1",
39
+ "@tamagui/constants": "3.0.0-beta.831.1",
40
+ "@tamagui/create-context": "3.0.0-beta.831.1",
41
+ "@tamagui/focusable": "3.0.0-beta.831.1",
42
+ "@tamagui/helpers": "3.0.0-beta.831.1",
43
+ "@tamagui/label": "3.0.0-beta.831.1",
44
+ "@tamagui/use-controllable-state": "3.0.0-beta.831.1",
45
+ "@tamagui/use-previous": "3.0.0-beta.831.1",
46
+ "@tamagui/web": "3.0.0-beta.831.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@tamagui/build": "3.0.0-beta.807.1",
49
+ "@tamagui/build": "3.0.0-beta.831.1",
50
50
  "react": "19.2.3",
51
51
  "react-native": "0.86.2"
52
52
  },
@@ -4,7 +4,7 @@ import type { GestureReponderEvent } from '@tamagui/web'
4
4
  import { composeEventHandlers } from '@tamagui/helpers'
5
5
  import { useLabelContext } from '@tamagui/label'
6
6
  import React, { useMemo } from 'react'
7
- import type { PressableProps, View, ViewProps } from 'react-native'
7
+ import type { PressableProps, ViewProps } from 'react-native'
8
8
 
9
9
  import { BubbleInput } from './BubbleInput'
10
10
  import { getState, isIndeterminate } from './utils'
@@ -33,13 +33,15 @@ export type CheckboxExtraProps = {
33
33
 
34
34
  export type CheckboxProps = CheckboxBaseProps & CheckboxExtraProps
35
35
 
36
- export function useCheckbox<R extends View, P extends CheckboxProps>(
36
+ type CheckboxBehaviorProps = CheckboxExtraProps & Pick<PressableProps, 'onPress'>
37
+
38
+ export function useCheckbox<R, P extends CheckboxBehaviorProps>(
37
39
  props: P,
38
40
  [checked, setChecked]: [
39
41
  CheckedState,
40
42
  React.Dispatch<React.SetStateAction<CheckedState>>,
41
43
  ],
42
- ref: React.Ref<R>
44
+ ref: React.Ref<R> | undefined
43
45
  ) {
44
46
  const {
45
47
  labelledBy: ariaLabelledby,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { PressableProps, View, ViewProps } from 'react-native';
2
+ import type { PressableProps, ViewProps } from 'react-native';
3
3
  export type CheckedState = boolean | 'indeterminate';
4
4
  type CheckboxBaseProps = Omit<ViewProps, 'onFocus' | 'onBlur'> & Pick<PressableProps, 'onPress'>;
5
5
  export type CheckboxExtraProps = {
@@ -19,10 +19,11 @@ export type CheckboxExtraProps = {
19
19
  value?: string;
20
20
  };
21
21
  export type CheckboxProps = CheckboxBaseProps & CheckboxExtraProps;
22
- export declare function useCheckbox<R extends View, P extends CheckboxProps>(props: P, [checked, setChecked]: [
22
+ type CheckboxBehaviorProps = CheckboxExtraProps & Pick<PressableProps, 'onPress'>;
23
+ export declare function useCheckbox<R, P extends CheckboxBehaviorProps>(props: P, [checked, setChecked]: [
23
24
  CheckedState,
24
25
  React.Dispatch<React.SetStateAction<CheckedState>>
25
- ], ref: React.Ref<R>): {
26
+ ], ref: React.Ref<R> | undefined): {
26
27
  bubbleInput: React.JSX.Element | null;
27
28
  checkboxRef: (node: R | null) => void;
28
29
  checkboxProps: {
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckbox.d.ts","sourceRoot":"","sources":["../src/useCheckbox.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKnE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,eAAe,CAAA;AAEpD,KAAK,iBAAiB,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,QAAQ,CAAC,GAC5D,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;AAEjC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,eAAe,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAA;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,kBAAkB,CAAA;AAElE,wBAAgB,WAAW,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,aAAa,EACjE,KAAK,EAAE,CAAC,EACR,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;IACrB,YAAY;IACZ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;CACn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