@react-native-aria/disclosure 0.2.4 → 0.2.6
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/lib/commonjs/useDisclosureButton.js +2 -4
- package/lib/commonjs/useDisclosureButton.js.map +1 -1
- package/lib/commonjs/useDisclosureButton.web.js +1 -1
- package/lib/commonjs/useDisclosureButton.web.js.map +1 -1
- package/lib/module/useDisclosureButton.js +2 -4
- package/lib/module/useDisclosureButton.js.map +1 -1
- package/lib/module/useDisclosureButton.web.js +1 -1
- package/lib/module/useDisclosureButton.web.js.map +1 -1
- package/lib/typescript/useDisclosure.web.d.ts +1 -1
- package/lib/typescript/useDisclosureButton.d.ts +2 -2
- package/package.json +5 -5
- package/src/useDisclosureButton.ts +2 -6
- package/src/useDisclosureButton.web.ts +1 -1
- package/.DS_Store +0 -0
- package/src/.DS_Store +0 -0
|
@@ -9,13 +9,11 @@ var _utils = require("@react-aria/utils");
|
|
|
9
9
|
|
|
10
10
|
function useDisclosureButton(props, state) {
|
|
11
11
|
const onPress = state.toggle;
|
|
12
|
-
const accessibilityState = props.accessibilityState || {};
|
|
13
|
-
accessibilityState.expanded = state.isSelected;
|
|
14
12
|
return {
|
|
15
13
|
buttonProps: (0, _utils.mergeProps)(props, {
|
|
16
14
|
onPress,
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
'aria-expanded': state.isSelected,
|
|
16
|
+
'role': 'button'
|
|
19
17
|
})
|
|
20
18
|
};
|
|
21
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDisclosureButton.ts"],"names":["useDisclosureButton","props","state","onPress","toggle","
|
|
1
|
+
{"version":3,"sources":["useDisclosureButton.ts"],"names":["useDisclosureButton","props","state","onPress","toggle","buttonProps","isSelected"],"mappings":";;;;;;;AACA;;AAGO,SAASA,mBAAT,CACLC,KADK,EAELC,KAFK,EAGL;AACA,QAAMC,OAAO,GAAGD,KAAK,CAACE,MAAtB;AAEA,SAAO;AACLC,IAAAA,WAAW,EAAE,uBAAWJ,KAAX,EAAkB;AAC7BE,MAAAA,OAD6B;AAE7B,uBAAiBD,KAAK,CAACI,UAFM;AAG7B,cAAQ;AAHqB,KAAlB;AADR,GAAP;AAOD","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\nimport { mergeProps } from '@react-aria/utils';\nimport { PressableProps } from 'react-native';\n\nexport function useDisclosureButton(\n props: Partial<PressableProps>,\n state: ToggleState\n) {\n const onPress = state.toggle;\n\n return {\n buttonProps: mergeProps(props, {\n onPress,\n 'aria-expanded': state.isSelected,\n 'role': 'button',\n }),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDisclosureButton.web.ts"],"names":["useDisclosureButton","props","state","id","disclosureIds","set","onPress","toggle","ariaProps","isSelected","undefined","buttonProps","
|
|
1
|
+
{"version":3,"sources":["useDisclosureButton.web.ts"],"names":["useDisclosureButton","props","state","id","disclosureIds","set","onPress","toggle","ariaProps","isSelected","undefined","buttonProps","role"],"mappings":";;;;;;;AACA;;AACA;;AAEA;;AAEO,SAASA,mBAAT,CAA6BC,KAA7B,EAAoDC,KAApD,EAAwE;AAC7E,QAAMC,EAAE,GAAG,mBAAX;;AAEAC,wBAAcC,GAAd,CAAkBH,KAAlB,EAAyBC,EAAzB;;AAEA,QAAMG,OAAO,GAAGJ,KAAK,CAACK,MAAtB;AAEA,QAAMC,SAAS,GAAG,6BAAgB;AAChC,qBAAiBN,KAAK,CAACO,UADS;AAEhC,qBAAiBP,KAAK,CAACO,UAAN,GAAmBN,EAAnB,GAAwBO;AAFT,GAAhB,CAAlB;AAKA,SAAO;AACLC,IAAAA,WAAW,EAAE,uBAAWV,KAAX,EAAkB;AAC7BK,MAAAA,OAD6B;AAE7B,SAAGE,SAF0B;AAG7BI,MAAAA,IAAI,EAAE;AAHuB,KAAlB;AADR,GAAP;AAOD","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\nimport { useId, mergeProps } from '@react-aria/utils';\nimport { mapDomPropsToRN } from '@react-native-aria/utils';\nimport { PressableProps } from 'react-native';\nimport { disclosureIds } from './utils';\n\nexport function useDisclosureButton(props: PressableProps, state: ToggleState) {\n const id = useId();\n\n disclosureIds.set(state, id);\n\n const onPress = state.toggle;\n\n const ariaProps = mapDomPropsToRN({\n 'aria-expanded': state.isSelected,\n 'aria-controls': state.isSelected ? id : undefined,\n });\n\n return {\n buttonProps: mergeProps(props, {\n onPress,\n ...ariaProps,\n role: 'button',\n }),\n };\n}\n"]}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { mergeProps } from '@react-aria/utils';
|
|
2
2
|
export function useDisclosureButton(props, state) {
|
|
3
3
|
const onPress = state.toggle;
|
|
4
|
-
const accessibilityState = props.accessibilityState || {};
|
|
5
|
-
accessibilityState.expanded = state.isSelected;
|
|
6
4
|
return {
|
|
7
5
|
buttonProps: mergeProps(props, {
|
|
8
6
|
onPress,
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
'aria-expanded': state.isSelected,
|
|
8
|
+
'role': 'button'
|
|
11
9
|
})
|
|
12
10
|
};
|
|
13
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDisclosureButton.ts"],"names":["mergeProps","useDisclosureButton","props","state","onPress","toggle","
|
|
1
|
+
{"version":3,"sources":["useDisclosureButton.ts"],"names":["mergeProps","useDisclosureButton","props","state","onPress","toggle","buttonProps","isSelected"],"mappings":"AACA,SAASA,UAAT,QAA2B,mBAA3B;AAGA,OAAO,SAASC,mBAAT,CACLC,KADK,EAELC,KAFK,EAGL;AACA,QAAMC,OAAO,GAAGD,KAAK,CAACE,MAAtB;AAEA,SAAO;AACLC,IAAAA,WAAW,EAAEN,UAAU,CAACE,KAAD,EAAQ;AAC7BE,MAAAA,OAD6B;AAE7B,uBAAiBD,KAAK,CAACI,UAFM;AAG7B,cAAQ;AAHqB,KAAR;AADlB,GAAP;AAOD","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\nimport { mergeProps } from '@react-aria/utils';\nimport { PressableProps } from 'react-native';\n\nexport function useDisclosureButton(\n props: Partial<PressableProps>,\n state: ToggleState\n) {\n const onPress = state.toggle;\n\n return {\n buttonProps: mergeProps(props, {\n onPress,\n 'aria-expanded': state.isSelected,\n 'role': 'button',\n }),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDisclosureButton.web.ts"],"names":["useId","mergeProps","mapDomPropsToRN","disclosureIds","useDisclosureButton","props","state","id","set","onPress","toggle","ariaProps","isSelected","undefined","buttonProps","
|
|
1
|
+
{"version":3,"sources":["useDisclosureButton.web.ts"],"names":["useId","mergeProps","mapDomPropsToRN","disclosureIds","useDisclosureButton","props","state","id","set","onPress","toggle","ariaProps","isSelected","undefined","buttonProps","role"],"mappings":"AACA,SAASA,KAAT,EAAgBC,UAAhB,QAAkC,mBAAlC;AACA,SAASC,eAAT,QAAgC,0BAAhC;AAEA,SAASC,aAAT,QAA8B,SAA9B;AAEA,OAAO,SAASC,mBAAT,CAA6BC,KAA7B,EAAoDC,KAApD,EAAwE;AAC7E,QAAMC,EAAE,GAAGP,KAAK,EAAhB;AAEAG,EAAAA,aAAa,CAACK,GAAd,CAAkBF,KAAlB,EAAyBC,EAAzB;AAEA,QAAME,OAAO,GAAGH,KAAK,CAACI,MAAtB;AAEA,QAAMC,SAAS,GAAGT,eAAe,CAAC;AAChC,qBAAiBI,KAAK,CAACM,UADS;AAEhC,qBAAiBN,KAAK,CAACM,UAAN,GAAmBL,EAAnB,GAAwBM;AAFT,GAAD,CAAjC;AAKA,SAAO;AACLC,IAAAA,WAAW,EAAEb,UAAU,CAACI,KAAD,EAAQ;AAC7BI,MAAAA,OAD6B;AAE7B,SAAGE,SAF0B;AAG7BI,MAAAA,IAAI,EAAE;AAHuB,KAAR;AADlB,GAAP;AAOD","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\nimport { useId, mergeProps } from '@react-aria/utils';\nimport { mapDomPropsToRN } from '@react-native-aria/utils';\nimport { PressableProps } from 'react-native';\nimport { disclosureIds } from './utils';\n\nexport function useDisclosureButton(props: PressableProps, state: ToggleState) {\n const id = useId();\n\n disclosureIds.set(state, id);\n\n const onPress = state.toggle;\n\n const ariaProps = mapDomPropsToRN({\n 'aria-expanded': state.isSelected,\n 'aria-controls': state.isSelected ? id : undefined,\n });\n\n return {\n buttonProps: mergeProps(props, {\n onPress,\n ...ariaProps,\n role: 'button',\n }),\n };\n}\n"]}
|
|
@@ -2,6 +2,6 @@ import { ToggleState } from '@react-stately/toggle';
|
|
|
2
2
|
import { ViewProps } from 'react-native';
|
|
3
3
|
export declare function useDisclosure(props: ViewProps, state: ToggleState): {
|
|
4
4
|
disclosureProps: ViewProps & {
|
|
5
|
-
nativeID: string
|
|
5
|
+
nativeID: string;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
@@ -3,7 +3,7 @@ import { PressableProps } from 'react-native';
|
|
|
3
3
|
export declare function useDisclosureButton(props: Partial<PressableProps>, state: ToggleState): {
|
|
4
4
|
buttonProps: Partial<PressableProps> & {
|
|
5
5
|
onPress: () => void;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
'aria-expanded': boolean;
|
|
7
|
+
role: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-aria/disclosure",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "mono repo setup with bob",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"registry": "https://registry.npmjs.org/"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
+
"@react-stately/toggle": "*",
|
|
51
52
|
"react": "*",
|
|
52
|
-
"react-native": "*"
|
|
53
|
-
"@react-stately/toggle":"*"
|
|
53
|
+
"react-native": "*"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@react-aria/utils":"^3.6.0",
|
|
57
|
-
"@react-native-aria/utils":"^0.2.
|
|
56
|
+
"@react-aria/utils": "^3.6.0",
|
|
57
|
+
"@react-native-aria/utils": "^0.2.10"
|
|
58
58
|
},
|
|
59
59
|
"jest": {
|
|
60
60
|
"preset": "react-native",
|
|
@@ -8,15 +8,11 @@ export function useDisclosureButton(
|
|
|
8
8
|
) {
|
|
9
9
|
const onPress = state.toggle;
|
|
10
10
|
|
|
11
|
-
const accessibilityState = props.accessibilityState || {};
|
|
12
|
-
|
|
13
|
-
accessibilityState.expanded = state.isSelected;
|
|
14
|
-
|
|
15
11
|
return {
|
|
16
12
|
buttonProps: mergeProps(props, {
|
|
17
13
|
onPress,
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
'aria-expanded': state.isSelected,
|
|
15
|
+
'role': 'button',
|
|
20
16
|
}),
|
|
21
17
|
};
|
|
22
18
|
}
|
package/.DS_Store
DELETED
|
Binary file
|
package/src/.DS_Store
DELETED
|
Binary file
|