@react-native-aria/disclosure 0.2.6 → 0.2.7

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/lib/commonjs/index.js +0 -4
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/index.web.js +0 -4
  5. package/lib/commonjs/index.web.js.map +1 -1
  6. package/lib/commonjs/useDisclosure.js +0 -1
  7. package/lib/commonjs/useDisclosure.js.map +1 -1
  8. package/lib/commonjs/useDisclosure.web.js +1 -5
  9. package/lib/commonjs/useDisclosure.web.js.map +1 -1
  10. package/lib/commonjs/useDisclosureButton.js +0 -2
  11. package/lib/commonjs/useDisclosureButton.js.map +1 -1
  12. package/lib/commonjs/useDisclosureButton.web.js +0 -6
  13. package/lib/commonjs/useDisclosureButton.web.js.map +1 -1
  14. package/lib/commonjs/utils.js +1 -2
  15. package/lib/commonjs/utils.js.map +1 -1
  16. package/lib/module/index.js.map +1 -1
  17. package/lib/module/index.web.js.map +1 -1
  18. package/lib/module/useDisclosure.js.map +1 -1
  19. package/lib/module/useDisclosure.web.js +1 -1
  20. package/lib/module/useDisclosure.web.js.map +1 -1
  21. package/lib/module/useDisclosureButton.js.map +1 -1
  22. package/lib/module/useDisclosureButton.web.js.map +1 -1
  23. package/lib/module/utils.js.map +1 -1
  24. package/lib/typescript/index.d.ts +1 -0
  25. package/lib/typescript/index.d.ts.map +1 -0
  26. package/lib/typescript/index.web.d.ts +1 -0
  27. package/lib/typescript/index.web.d.ts.map +1 -0
  28. package/lib/typescript/useDisclosure.d.ts +1 -0
  29. package/lib/typescript/useDisclosure.d.ts.map +1 -0
  30. package/lib/typescript/useDisclosure.web.d.ts +2 -1
  31. package/lib/typescript/useDisclosure.web.d.ts.map +1 -0
  32. package/lib/typescript/useDisclosureButton.d.ts +1 -0
  33. package/lib/typescript/useDisclosureButton.d.ts.map +1 -0
  34. package/lib/typescript/useDisclosureButton.web.d.ts +1 -0
  35. package/lib/typescript/useDisclosureButton.web.d.ts.map +1 -0
  36. package/lib/typescript/utils.d.ts +1 -0
  37. package/lib/typescript/utils.d.ts.map +1 -0
  38. package/package.json +8 -4
  39. package/src/useDisclosure.web.ts +1 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # @react-native-aria/disclosure
2
+
3
+ ## 0.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: warnings of deprecated props
8
+ - Updated dependencies
9
+ - @react-native-aria/utils@0.2.11
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _useDisclosure = require("./useDisclosure");
8
-
9
7
  Object.keys(_useDisclosure).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _useDisclosure[key]) return;
@@ -16,9 +14,7 @@ Object.keys(_useDisclosure).forEach(function (key) {
16
14
  }
17
15
  });
18
16
  });
19
-
20
17
  var _useDisclosureButton = require("./useDisclosureButton");
21
-
22
18
  Object.keys(_useDisclosureButton).forEach(function (key) {
23
19
  if (key === "default" || key === "__esModule") return;
24
20
  if (key in exports && exports[key] === _useDisclosureButton[key]) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './useDisclosure';\nexport * from './useDisclosureButton';\n"]}
1
+ {"version":3,"names":["_useDisclosure","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_useDisclosureButton"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,oBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,oBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,oBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,oBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _useDisclosure = require("./useDisclosure.web");
8
-
9
7
  Object.keys(_useDisclosure).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _useDisclosure[key]) return;
@@ -16,9 +14,7 @@ Object.keys(_useDisclosure).forEach(function (key) {
16
14
  }
17
15
  });
18
16
  });
19
-
20
17
  var _useDisclosureButton = require("./useDisclosureButton.web");
21
-
22
18
  Object.keys(_useDisclosureButton).forEach(function (key) {
23
19
  if (key === "default" || key === "__esModule") return;
24
20
  if (key in exports && exports[key] === _useDisclosureButton[key]) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["index.web.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './useDisclosure.web';\nexport * from './useDisclosureButton.web';\n"]}
1
+ {"version":3,"names":["_useDisclosure","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_useDisclosureButton"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,oBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,oBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,oBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,oBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useDisclosure = useDisclosure;
7
-
8
7
  // Polyfill
9
8
  function useDisclosure(_props, _state) {
10
9
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["useDisclosure.ts"],"names":["useDisclosure","_props","_state","disclosureProps"],"mappings":";;;;;;;AAGA;AACO,SAASA,aAAT,CAAuBC,MAAvB,EAA0CC,MAA1C,EAA+D;AACpE,SAAO;AACLC,IAAAA,eAAe,EAAEF;AADZ,GAAP;AAGD","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\nimport { ViewProps } from 'react-native';\n\n// Polyfill\nexport function useDisclosure(_props: ViewProps, _state: ToggleState) {\n return {\n disclosureProps: _props,\n };\n}\n"]}
1
+ {"version":3,"names":["useDisclosure","_props","_state","disclosureProps"],"sourceRoot":"../../src","sources":["useDisclosure.ts"],"mappings":";;;;;;AAGA;AACO,SAASA,aAAaA,CAACC,MAAiB,EAAEC,MAAmB,EAAE;EACpE,OAAO;IACLC,eAAe,EAAEF;EACnB,CAAC;AACH"}
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useDisclosure = useDisclosure;
7
-
8
7
  var _utils = require("@react-aria/utils");
9
-
10
8
  var _utils2 = require("./utils");
11
-
12
9
  function useDisclosure(props, state) {
13
10
  const id = _utils2.disclosureIds.get(state);
14
-
15
11
  return {
16
12
  disclosureProps: (0, _utils.mergeProps)(props, {
17
- nativeID: id
13
+ id
18
14
  })
19
15
  };
20
16
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useDisclosure.web.ts"],"names":["useDisclosure","props","state","id","disclosureIds","get","disclosureProps","nativeID"],"mappings":";;;;;;;AACA;;AAEA;;AAEO,SAASA,aAAT,CAAuBC,KAAvB,EAAyCC,KAAzC,EAA6D;AAClE,QAAMC,EAAE,GAAGC,sBAAcC,GAAd,CAAkBH,KAAlB,CAAX;;AAEA,SAAO;AACLI,IAAAA,eAAe,EAAE,uBAAWL,KAAX,EAAkB;AACjCM,MAAAA,QAAQ,EAAEJ;AADuB,KAAlB;AADZ,GAAP;AAKD","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\nimport { mergeProps } from '@react-aria/utils';\nimport { ViewProps } from 'react-native';\nimport { disclosureIds } from './utils';\n\nexport function useDisclosure(props: ViewProps, state: ToggleState) {\n const id = disclosureIds.get(state);\n\n return {\n disclosureProps: mergeProps(props, {\n nativeID: id,\n }),\n };\n}\n"]}
1
+ {"version":3,"names":["_utils","require","_utils2","useDisclosure","props","state","id","disclosureIds","get","disclosureProps","mergeProps"],"sourceRoot":"../../src","sources":["useDisclosure.web.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAEO,SAASE,aAAaA,CAACC,KAAgB,EAAEC,KAAkB,EAAE;EAClE,MAAMC,EAAE,GAAGC,qBAAa,CAACC,GAAG,CAACH,KAAK,CAAC;EAEnC,OAAO;IACLI,eAAe,EAAE,IAAAC,iBAAU,EAACN,KAAK,EAAE;MACjCE;IACF,CAAC;EACH,CAAC;AACH"}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useDisclosureButton = useDisclosureButton;
7
-
8
7
  var _utils = require("@react-aria/utils");
9
-
10
8
  function useDisclosureButton(props, state) {
11
9
  const onPress = state.toggle;
12
10
  return {
@@ -1 +1 @@
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
+ {"version":3,"names":["_utils","require","useDisclosureButton","props","state","onPress","toggle","buttonProps","mergeProps","isSelected"],"sourceRoot":"../../src","sources":["useDisclosureButton.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAGO,SAASC,mBAAmBA,CACjCC,KAA8B,EAC9BC,KAAkB,EAClB;EACA,MAAMC,OAAO,GAAGD,KAAK,CAACE,MAAM;EAE5B,OAAO;IACLC,WAAW,EAAE,IAAAC,iBAAU,EAACL,KAAK,EAAE;MAC7BE,OAAO;MACP,eAAe,EAAED,KAAK,CAACK,UAAU;MACjC,MAAM,EAAE;IACV,CAAC;EACH,CAAC;AACH"}
@@ -4,18 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useDisclosureButton = useDisclosureButton;
7
-
8
7
  var _utils = require("@react-aria/utils");
9
-
10
8
  var _utils2 = require("@react-native-aria/utils");
11
-
12
9
  var _utils3 = require("./utils");
13
-
14
10
  function useDisclosureButton(props, state) {
15
11
  const id = (0, _utils.useId)();
16
-
17
12
  _utils3.disclosureIds.set(state, id);
18
-
19
13
  const onPress = state.toggle;
20
14
  const ariaProps = (0, _utils2.mapDomPropsToRN)({
21
15
  'aria-expanded': state.isSelected,
@@ -1 +1 @@
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
+ {"version":3,"names":["_utils","require","_utils2","_utils3","useDisclosureButton","props","state","id","useId","disclosureIds","set","onPress","toggle","ariaProps","mapDomPropsToRN","isSelected","undefined","buttonProps","mergeProps","role"],"sourceRoot":"../../src","sources":["useDisclosureButton.web.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAEO,SAASG,mBAAmBA,CAACC,KAAqB,EAAEC,KAAkB,EAAE;EAC7E,MAAMC,EAAE,GAAG,IAAAC,YAAK,EAAC,CAAC;EAElBC,qBAAa,CAACC,GAAG,CAACJ,KAAK,EAAEC,EAAE,CAAC;EAE5B,MAAMI,OAAO,GAAGL,KAAK,CAACM,MAAM;EAE5B,MAAMC,SAAS,GAAG,IAAAC,uBAAe,EAAC;IAChC,eAAe,EAAER,KAAK,CAACS,UAAU;IACjC,eAAe,EAAET,KAAK,CAACS,UAAU,GAAGR,EAAE,GAAGS;EAC3C,CAAC,CAAC;EAEF,OAAO;IACLC,WAAW,EAAE,IAAAC,iBAAU,EAACb,KAAK,EAAE;MAC7BM,OAAO;MACP,GAAGE,SAAS;MACZM,IAAI,EAAE;IACR,CAAC;EACH,CAAC;AACH"}
@@ -4,6 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.disclosureIds = void 0;
7
- const disclosureIds = new WeakMap();
8
- exports.disclosureIds = disclosureIds;
7
+ const disclosureIds = exports.disclosureIds = new WeakMap();
9
8
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["utils.ts"],"names":["disclosureIds","WeakMap"],"mappings":";;;;;;AAEO,MAAMA,aAAa,GAAG,IAAIC,OAAJ,EAAtB","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\n\nexport const disclosureIds = new WeakMap<ToggleState, string>();\n"]}
1
+ {"version":3,"names":["disclosureIds","exports","WeakMap"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;;;;;AAEO,MAAMA,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAIE,OAAO,CAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAd;AACA,cAAc,uBAAd","sourcesContent":["export * from './useDisclosure';\nexport * from './useDisclosureButton';\n"]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.web.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAd;AACA,cAAc,2BAAd","sourcesContent":["export * from './useDisclosure.web';\nexport * from './useDisclosureButton.web';\n"]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,2BAA2B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useDisclosure.ts"],"names":["useDisclosure","_props","_state","disclosureProps"],"mappings":"AAGA;AACA,OAAO,SAASA,aAAT,CAAuBC,MAAvB,EAA0CC,MAA1C,EAA+D;AACpE,SAAO;AACLC,IAAAA,eAAe,EAAEF;AADZ,GAAP;AAGD","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\nimport { ViewProps } from 'react-native';\n\n// Polyfill\nexport function useDisclosure(_props: ViewProps, _state: ToggleState) {\n return {\n disclosureProps: _props,\n };\n}\n"]}
1
+ {"version":3,"names":["useDisclosure","_props","_state","disclosureProps"],"sourceRoot":"../../src","sources":["useDisclosure.ts"],"mappings":"AAGA;AACA,OAAO,SAASA,aAAaA,CAACC,MAAiB,EAAEC,MAAmB,EAAE;EACpE,OAAO;IACLC,eAAe,EAAEF;EACnB,CAAC;AACH"}
@@ -4,7 +4,7 @@ export function useDisclosure(props, state) {
4
4
  const id = disclosureIds.get(state);
5
5
  return {
6
6
  disclosureProps: mergeProps(props, {
7
- nativeID: id
7
+ id
8
8
  })
9
9
  };
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useDisclosure.web.ts"],"names":["mergeProps","disclosureIds","useDisclosure","props","state","id","get","disclosureProps","nativeID"],"mappings":"AACA,SAASA,UAAT,QAA2B,mBAA3B;AAEA,SAASC,aAAT,QAA8B,SAA9B;AAEA,OAAO,SAASC,aAAT,CAAuBC,KAAvB,EAAyCC,KAAzC,EAA6D;AAClE,QAAMC,EAAE,GAAGJ,aAAa,CAACK,GAAd,CAAkBF,KAAlB,CAAX;AAEA,SAAO;AACLG,IAAAA,eAAe,EAAEP,UAAU,CAACG,KAAD,EAAQ;AACjCK,MAAAA,QAAQ,EAAEH;AADuB,KAAR;AADtB,GAAP;AAKD","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\nimport { mergeProps } from '@react-aria/utils';\nimport { ViewProps } from 'react-native';\nimport { disclosureIds } from './utils';\n\nexport function useDisclosure(props: ViewProps, state: ToggleState) {\n const id = disclosureIds.get(state);\n\n return {\n disclosureProps: mergeProps(props, {\n nativeID: id,\n }),\n };\n}\n"]}
1
+ {"version":3,"names":["mergeProps","disclosureIds","useDisclosure","props","state","id","get","disclosureProps"],"sourceRoot":"../../src","sources":["useDisclosure.web.ts"],"mappings":"AACA,SAASA,UAAU,QAAQ,mBAAmB;AAE9C,SAASC,aAAa,QAAQ,SAAS;AAEvC,OAAO,SAASC,aAAaA,CAACC,KAAgB,EAAEC,KAAkB,EAAE;EAClE,MAAMC,EAAE,GAAGJ,aAAa,CAACK,GAAG,CAACF,KAAK,CAAC;EAEnC,OAAO;IACLG,eAAe,EAAEP,UAAU,CAACG,KAAK,EAAE;MACjCE;IACF,CAAC;EACH,CAAC;AACH"}
@@ -1 +1 @@
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
+ {"version":3,"names":["mergeProps","useDisclosureButton","props","state","onPress","toggle","buttonProps","isSelected"],"sourceRoot":"../../src","sources":["useDisclosureButton.ts"],"mappings":"AACA,SAASA,UAAU,QAAQ,mBAAmB;AAG9C,OAAO,SAASC,mBAAmBA,CACjCC,KAA8B,EAC9BC,KAAkB,EAClB;EACA,MAAMC,OAAO,GAAGD,KAAK,CAACE,MAAM;EAE5B,OAAO;IACLC,WAAW,EAAEN,UAAU,CAACE,KAAK,EAAE;MAC7BE,OAAO;MACP,eAAe,EAAED,KAAK,CAACI,UAAU;MACjC,MAAM,EAAE;IACV,CAAC;EACH,CAAC;AACH"}
@@ -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","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"]}
1
+ {"version":3,"names":["useId","mergeProps","mapDomPropsToRN","disclosureIds","useDisclosureButton","props","state","id","set","onPress","toggle","ariaProps","isSelected","undefined","buttonProps","role"],"sourceRoot":"../../src","sources":["useDisclosureButton.web.ts"],"mappings":"AACA,SAASA,KAAK,EAAEC,UAAU,QAAQ,mBAAmB;AACrD,SAASC,eAAe,QAAQ,0BAA0B;AAE1D,SAASC,aAAa,QAAQ,SAAS;AAEvC,OAAO,SAASC,mBAAmBA,CAACC,KAAqB,EAAEC,KAAkB,EAAE;EAC7E,MAAMC,EAAE,GAAGP,KAAK,CAAC,CAAC;EAElBG,aAAa,CAACK,GAAG,CAACF,KAAK,EAAEC,EAAE,CAAC;EAE5B,MAAME,OAAO,GAAGH,KAAK,CAACI,MAAM;EAE5B,MAAMC,SAAS,GAAGT,eAAe,CAAC;IAChC,eAAe,EAAEI,KAAK,CAACM,UAAU;IACjC,eAAe,EAAEN,KAAK,CAACM,UAAU,GAAGL,EAAE,GAAGM;EAC3C,CAAC,CAAC;EAEF,OAAO;IACLC,WAAW,EAAEb,UAAU,CAACI,KAAK,EAAE;MAC7BI,OAAO;MACP,GAAGE,SAAS;MACZI,IAAI,EAAE;IACR,CAAC;EACH,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"sources":["utils.ts"],"names":["disclosureIds","WeakMap"],"mappings":"AAEA,OAAO,MAAMA,aAAa,GAAG,IAAIC,OAAJ,EAAtB","sourcesContent":["import { ToggleState } from '@react-stately/toggle';\n\nexport const disclosureIds = new WeakMap<ToggleState, string>();\n"]}
1
+ {"version":3,"names":["disclosureIds","WeakMap"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":"AAEA,OAAO,MAAMA,aAAa,GAAG,IAAIC,OAAO,CAAsB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './useDisclosure';
2
2
  export * from './useDisclosureButton';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './useDisclosure.web';
2
2
  export * from './useDisclosureButton.web';
3
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/index.web.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC"}
@@ -3,3 +3,4 @@ import { ViewProps } from 'react-native';
3
3
  export declare function useDisclosure(_props: ViewProps, _state: ToggleState): {
4
4
  disclosureProps: ViewProps;
5
5
  };
6
+ //# sourceMappingURL=useDisclosure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDisclosure.d.ts","sourceRoot":"","sources":["../../src/useDisclosure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW;;EAInE"}
@@ -2,6 +2,7 @@ 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
+ id: string;
6
6
  };
7
7
  };
8
+ //# sourceMappingURL=useDisclosure.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDisclosure.web.d.ts","sourceRoot":"","sources":["../../src/useDisclosure.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW;;;;EAQjE"}
@@ -7,3 +7,4 @@ export declare function useDisclosureButton(props: Partial<PressableProps>, stat
7
7
  role: string;
8
8
  };
9
9
  };
10
+ //# sourceMappingURL=useDisclosureButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDisclosureButton.d.ts","sourceRoot":"","sources":["../../src/useDisclosureButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,EAC9B,KAAK,EAAE,WAAW;;;;;;EAWnB"}
@@ -3,3 +3,4 @@ import { PressableProps } from 'react-native';
3
3
  export declare function useDisclosureButton(props: PressableProps, state: ToggleState): {
4
4
  buttonProps: any;
5
5
  };
6
+ //# sourceMappingURL=useDisclosureButton.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDisclosureButton.web.d.ts","sourceRoot":"","sources":["../../src/useDisclosureButton.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW;;EAmB5E"}
@@ -1,2 +1,3 @@
1
1
  import { ToggleState } from '@react-stately/toggle';
2
2
  export declare const disclosureIds: WeakMap<ToggleState, string>;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,eAAO,MAAM,aAAa,8BAAqC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-aria/disclosure",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "mono repo setup with bob",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -26,6 +26,7 @@
26
26
  "test": "jest",
27
27
  "typescript": "tsc --noEmit",
28
28
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
29
+ "build": "bob build",
29
30
  "prepare": "bob build",
30
31
  "release": "release-it",
31
32
  "example": "yarn --cwd example",
@@ -37,13 +38,16 @@
37
38
  "ios",
38
39
  "android"
39
40
  ],
40
- "repository": "https://github.com/intergalacticspacehighway/react-native-bob-mono",
41
+ "homepage": "https://github.com/gluestack/gluestack-ui/tree/main/packages/react-native-aria/disclosure#readme",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/gluestack/gluestack-ui.git"
45
+ },
41
46
  "author": "nishan <nishanbende@gmail.com> (https://github.com/intergalacticspacehighway)",
42
47
  "license": "MIT",
43
48
  "bugs": {
44
49
  "url": "https://github.com/intergalacticspacehighway/react-native-bob-mono/issues"
45
50
  },
46
- "homepage": "https://github.com/intergalacticspacehighway/react-native-bob-mono#readme",
47
51
  "publishConfig": {
48
52
  "registry": "https://registry.npmjs.org/"
49
53
  },
@@ -54,7 +58,7 @@
54
58
  },
55
59
  "dependencies": {
56
60
  "@react-aria/utils": "^3.6.0",
57
- "@react-native-aria/utils": "^0.2.10"
61
+ "@react-native-aria/utils": "0.2.11"
58
62
  },
59
63
  "jest": {
60
64
  "preset": "react-native",
@@ -8,7 +8,7 @@ export function useDisclosure(props: ViewProps, state: ToggleState) {
8
8
 
9
9
  return {
10
10
  disclosureProps: mergeProps(props, {
11
- nativeID: id,
11
+ id,
12
12
  }),
13
13
  };
14
14
  }