@react-native-aria/checkbox 0.2.6 → 0.2.8-alpha.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["useCheckbox.ts"],"names":["useCheckbox","props","state","inputRef","inputProps","isSelected","isIndeterminate","isDisabled"],"mappings":";;;;;;;AAEA;;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAT,CACLC,KADK,EAELC,KAFK,EAGLC,QAHK,EAIS;AACd,MAAI;AAAEC,IAAAA;AAAF,MAAiB,uBAAUH,KAAV,EAAiBC,KAAjB,EAAwBC,QAAxB,CAArB;AACA,MAAI;AAAEE,IAAAA;AAAF,MAAiBH,KAArB;AAEA,MAAI;AAAEI,IAAAA;AAAF,MAAsBL,KAA1B;AAEA,SAAO;AACLG,IAAAA,UAAU,EAAE,uBAAWA,UAAX,EAAuB;AACjC,iBAAWC,UADsB;AAEjC,cAAQ,UAFyB;AAGjC,sBAAgBC,eAAe,GAAG,OAAH,GAAaD,UAHX;AAIjC,uBAAiBJ,KAAK,CAACM;AAJU,KAAvB;AADP,GAAP;AAQD","sourcesContent":["import type { RefObject } from 'react';\nimport type { ToggleState } from '@react-stately/toggle';\nimport { mergeProps } from '@react-aria/utils';\nimport { useToggle } from '@react-native-aria/toggle';\nimport { AriaCheckboxProps } from '@react-types/checkbox';\n\nexport interface CheckboxAria {\n /** Props for the input or Pressable/Touchable element. */\n inputProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useToggleState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckbox(\n props: AriaCheckboxProps,\n state: ToggleState,\n inputRef: RefObject<HTMLInputElement>\n): CheckboxAria {\n let { inputProps } = useToggle(props, state, inputRef);\n let { isSelected } = state;\n\n let { isIndeterminate } = props;\n\n return {\n inputProps: mergeProps(inputProps, {\n 'checked': isSelected,\n 'role': 'checkbox',\n 'aria-checked': isIndeterminate ? 'mixed' : isSelected,\n 'aria-disabled': props.isDisabled,\n }),\n };\n}\n"]}
1
+ {"version":3,"sources":["useCheckbox.ts"],"names":["useCheckbox","props","state","inputRef","inputProps","isSelected","isIndeterminate","isDisabled"],"mappings":";;;;;;;AAEA;;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAT,CACLC,KADK,EAELC,KAFK,EAGLC,QAHK,EAIS;AACd,MAAI;AAAEC,IAAAA;AAAF,MAAiB,uBAAUH,KAAV,EAAiBC,KAAjB,EAAwBC,QAAxB,CAArB;AACA,MAAI;AAAEE,IAAAA;AAAF,MAAiBH,KAArB;AAEA,MAAI;AAAEI,IAAAA;AAAF,MAAsBL,KAA1B;AAEA,SAAO;AACLG,IAAAA,UAAU,EAAE,uBAAWA,UAAX,EAAuB;AACjC,iBAAWC,UADsB;AAEjC,cAAQ,UAFyB;AAGjC,sBAAgBC,eAAe,GAAG,OAAH,GAAaD,UAHX;AAIjC,uBAAiBJ,KAAK,CAACM;AAJU,KAAvB;AADP,GAAP;AAQD","sourcesContent":["import type { RefObject } from 'react';\nimport type { ToggleState } from '@react-stately/toggle';\nimport { mergeProps } from '@react-aria/utils';\nimport { useToggle } from '@react-native-aria/toggle';\nimport type { AccessibilityProps } from 'react-native';\nimport { AriaCheckboxProps } from '@react-types/checkbox';\n\nexport interface CheckboxAria extends AccessibilityProps {\n /** Props for the input or Pressable/Touchable element. */\n inputProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useToggleState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckbox(\n props: AriaCheckboxProps,\n state: ToggleState,\n inputRef: RefObject<HTMLInputElement>\n): CheckboxAria {\n let { inputProps } = useToggle(props, state, inputRef);\n let { isSelected } = state;\n\n let { isIndeterminate } = props;\n\n return {\n inputProps: mergeProps(inputProps, {\n 'checked': isSelected,\n 'role': 'checkbox',\n 'aria-checked': isIndeterminate ? 'mixed' : isSelected,\n 'aria-disabled': props.isDisabled,\n }),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["useCheckbox.ts"],"names":["mergeProps","useToggle","useCheckbox","props","state","inputRef","inputProps","isSelected","isIndeterminate","isDisabled"],"mappings":"AAEA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,QAA0B,2BAA1B;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAT,CACLC,KADK,EAELC,KAFK,EAGLC,QAHK,EAIS;AACd,MAAI;AAAEC,IAAAA;AAAF,MAAiBL,SAAS,CAACE,KAAD,EAAQC,KAAR,EAAeC,QAAf,CAA9B;AACA,MAAI;AAAEE,IAAAA;AAAF,MAAiBH,KAArB;AAEA,MAAI;AAAEI,IAAAA;AAAF,MAAsBL,KAA1B;AAEA,SAAO;AACLG,IAAAA,UAAU,EAAEN,UAAU,CAACM,UAAD,EAAa;AACjC,iBAAWC,UADsB;AAEjC,cAAQ,UAFyB;AAGjC,sBAAgBC,eAAe,GAAG,OAAH,GAAaD,UAHX;AAIjC,uBAAiBJ,KAAK,CAACM;AAJU,KAAb;AADjB,GAAP;AAQD","sourcesContent":["import type { RefObject } from 'react';\nimport type { ToggleState } from '@react-stately/toggle';\nimport { mergeProps } from '@react-aria/utils';\nimport { useToggle } from '@react-native-aria/toggle';\nimport { AriaCheckboxProps } from '@react-types/checkbox';\n\nexport interface CheckboxAria {\n /** Props for the input or Pressable/Touchable element. */\n inputProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useToggleState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckbox(\n props: AriaCheckboxProps,\n state: ToggleState,\n inputRef: RefObject<HTMLInputElement>\n): CheckboxAria {\n let { inputProps } = useToggle(props, state, inputRef);\n let { isSelected } = state;\n\n let { isIndeterminate } = props;\n\n return {\n inputProps: mergeProps(inputProps, {\n 'checked': isSelected,\n 'role': 'checkbox',\n 'aria-checked': isIndeterminate ? 'mixed' : isSelected,\n 'aria-disabled': props.isDisabled,\n }),\n };\n}\n"]}
1
+ {"version":3,"sources":["useCheckbox.ts"],"names":["mergeProps","useToggle","useCheckbox","props","state","inputRef","inputProps","isSelected","isIndeterminate","isDisabled"],"mappings":"AAEA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,QAA0B,2BAA1B;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAT,CACLC,KADK,EAELC,KAFK,EAGLC,QAHK,EAIS;AACd,MAAI;AAAEC,IAAAA;AAAF,MAAiBL,SAAS,CAACE,KAAD,EAAQC,KAAR,EAAeC,QAAf,CAA9B;AACA,MAAI;AAAEE,IAAAA;AAAF,MAAiBH,KAArB;AAEA,MAAI;AAAEI,IAAAA;AAAF,MAAsBL,KAA1B;AAEA,SAAO;AACLG,IAAAA,UAAU,EAAEN,UAAU,CAACM,UAAD,EAAa;AACjC,iBAAWC,UADsB;AAEjC,cAAQ,UAFyB;AAGjC,sBAAgBC,eAAe,GAAG,OAAH,GAAaD,UAHX;AAIjC,uBAAiBJ,KAAK,CAACM;AAJU,KAAb;AADjB,GAAP;AAQD","sourcesContent":["import type { RefObject } from 'react';\nimport type { ToggleState } from '@react-stately/toggle';\nimport { mergeProps } from '@react-aria/utils';\nimport { useToggle } from '@react-native-aria/toggle';\nimport type { AccessibilityProps } from 'react-native';\nimport { AriaCheckboxProps } from '@react-types/checkbox';\n\nexport interface CheckboxAria extends AccessibilityProps {\n /** Props for the input or Pressable/Touchable element. */\n inputProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useToggleState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckbox(\n props: AriaCheckboxProps,\n state: ToggleState,\n inputRef: RefObject<HTMLInputElement>\n): CheckboxAria {\n let { inputProps } = useToggle(props, state, inputRef);\n let { isSelected } = state;\n\n let { isIndeterminate } = props;\n\n return {\n inputProps: mergeProps(inputProps, {\n 'checked': isSelected,\n 'role': 'checkbox',\n 'aria-checked': isIndeterminate ? 'mixed' : isSelected,\n 'aria-disabled': props.isDisabled,\n }),\n };\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import type { RefObject } from 'react';
2
2
  import type { ToggleState } from '@react-stately/toggle';
3
+ import type { AccessibilityProps } from 'react-native';
3
4
  import { AriaCheckboxProps } from '@react-types/checkbox';
4
- export interface CheckboxAria {
5
+ export interface CheckboxAria extends AccessibilityProps {
5
6
  /** Props for the input or Pressable/Touchable element. */
6
7
  inputProps: any;
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-aria/checkbox",
3
- "version": "0.2.6",
3
+ "version": "0.2.8-alpha.0",
4
4
  "description": "mono repo setup with bob",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -47,11 +47,11 @@
47
47
  "registry": "https://registry.npmjs.org/"
48
48
  },
49
49
  "dependencies": {
50
- "@react-aria/checkbox": "^3.2.1",
51
- "@react-aria/utils": "^3.6.0",
52
- "@react-native-aria/toggle": "^0.2.6",
53
- "@react-native-aria/utils": "^0.2.10",
54
- "@react-stately/toggle": "^3.2.1"
50
+ "@react-aria/checkbox": "3.2.1",
51
+ "@react-aria/utils": "3.6.0",
52
+ "@react-native-aria/toggle": "0.2.6",
53
+ "@react-native-aria/utils": "0.2.10",
54
+ "@react-stately/toggle": "3.2.1"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "react": "*",
@@ -2,9 +2,10 @@ import type { RefObject } from 'react';
2
2
  import type { ToggleState } from '@react-stately/toggle';
3
3
  import { mergeProps } from '@react-aria/utils';
4
4
  import { useToggle } from '@react-native-aria/toggle';
5
+ import type { AccessibilityProps } from 'react-native';
5
6
  import { AriaCheckboxProps } from '@react-types/checkbox';
6
7
 
7
- export interface CheckboxAria {
8
+ export interface CheckboxAria extends AccessibilityProps {
8
9
  /** Props for the input or Pressable/Touchable element. */
9
10
  inputProps: any;
10
11
  }