@ankhorage/surface 9.1.6 → 9.1.8

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 (40) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +28 -1
  3. package/dist/features/bottom-sheet/BottomSheetScrollView.web.d.ts +9 -2
  4. package/dist/features/bottom-sheet/BottomSheetScrollView.web.d.ts.map +1 -1
  5. package/dist/features/bottom-sheet/BottomSheetSectionList.d.ts +1 -1
  6. package/dist/features/bottom-sheet/BottomSheetSectionList.d.ts.map +1 -1
  7. package/dist/features/bottom-sheet/BottomSheetView.web.d.ts +5 -2
  8. package/dist/features/bottom-sheet/BottomSheetView.web.d.ts.map +1 -1
  9. package/dist/features/bottom-sheet/BottomSheetVirtualizedList.d.ts +1 -1
  10. package/dist/features/bottom-sheet/BottomSheetVirtualizedList.d.ts.map +1 -1
  11. package/dist/features/bottom-sheet/BottomSheetVirtualizedList.web.d.ts +1 -2
  12. package/dist/features/bottom-sheet/BottomSheetVirtualizedList.web.d.ts.map +1 -1
  13. package/dist/features/icon/adapters/inbound/PortableIcon.d.ts.map +1 -1
  14. package/dist/features/icon/adapters/inbound/PortableIcon.js +6 -3
  15. package/dist/features/icon/adapters/inbound/PortableIcon.js.map +1 -1
  16. package/dist/features/image/utils/getSourceKey.js +11 -3
  17. package/dist/features/image/utils/getSourceKey.js.map +1 -1
  18. package/dist/features/popover/adapters/inbound/Popover.js.map +1 -1
  19. package/dist/features/popover/adapters/inbound/PopoverOverlay.d.ts +1 -1
  20. package/dist/features/popover/adapters/inbound/PopoverOverlay.d.ts.map +1 -1
  21. package/dist/features/popover/adapters/inbound/PopoverOverlay.js.map +1 -1
  22. package/dist/features/popover/adapters/inbound/usePopoverLayout.d.ts +1 -1
  23. package/dist/features/popover/adapters/inbound/usePopoverLayout.d.ts.map +1 -1
  24. package/dist/features/popover/adapters/inbound/usePopoverLayout.js.map +1 -1
  25. package/dist/features/tabs/composition/useTabRegistration.d.ts +3 -2
  26. package/dist/features/tabs/composition/useTabRegistration.d.ts.map +1 -1
  27. package/dist/features/tabs/composition/useTabRegistration.js +1 -1
  28. package/dist/features/tabs/composition/useTabRegistration.js.map +1 -1
  29. package/dist/internal/focus/FocusScope.js.map +1 -1
  30. package/dist/utils/resolveViewStyles.js.map +1 -1
  31. package/package.json +39 -39
  32. package/src/features/icon/adapters/inbound/PortableIcon.tsx +8 -4
  33. package/src/features/image/utils/getSourceKey.ts +14 -4
  34. package/src/features/popover/adapters/inbound/Popover.tsx +1 -1
  35. package/src/features/popover/adapters/inbound/PopoverOverlay.tsx +1 -1
  36. package/src/features/popover/adapters/inbound/usePopoverLayout.ts +1 -1
  37. package/src/features/tabs/composition/useTabRegistration.ts +7 -1
  38. package/src/index.test.ts +24 -9
  39. package/src/internal/focus/FocusScope.tsx +1 -1
  40. package/src/utils/resolveViewStyles.ts +7 -25
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @ankhorage/surface
2
2
 
3
+ ## 9.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 67c1faa: Consolidate the current Renovate dependency updates, adapt Surface to React Native 0.87 host and image-source types, and restore release documentation validation.
8
+ - 3772594: Update Ankhorage dependencies: `@ankhorage/paradox`, `@ankhorage/utility`.
9
+ - ef91354: Update dependencies from Renovate pull request #244.
10
+ - 655fca6: Update dependencies from Renovate pull request #249.
11
+ - edc9d6f: Update dependencies from Renovate pull request #250.
12
+ - f3b9ca9: Update dependencies from Renovate pull request #252.
13
+ - c6ddd9a: Update dependencies from Renovate pull request #253.
14
+ - 2f7c98d: Update dependencies from Renovate pull request #254.
15
+ - 874803c: Update Ankhorage dependencies: `@ankhorage/paradox`, `@ankhorage/utility`.
16
+ - 0601633: Update dependencies from Renovate pull request #259.
17
+ - a4a4e83: Update dependencies from Renovate pull request #262.
18
+
19
+ ## 9.1.7
20
+
21
+ ### Patch Changes
22
+
23
+ - c12104e: Update Ankhorage dependencies: `@ankhorage/contracts`.
24
+
3
25
  ## 9.1.6
4
26
 
5
27
  ### Patch Changes
package/README.md CHANGED
@@ -3,10 +3,37 @@
3
3
 
4
4
  # @ankhorage/surface
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v9.1.6](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v9.1.8](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Cross-platform UI foundation for React Native and React Native Web. Provides theming, layout primitives, and core building blocks for modern apps.
9
9
 
10
+ ## Configuration
11
+
12
+ ### Example
13
+
14
+ ```ts
15
+ import { defineParadoxConfig } from '@ankhorage/paradox';
16
+
17
+ export default defineParadoxConfig({
18
+ mode: 'write',
19
+
20
+ docs: {
21
+ title: '@ankhorage/surface',
22
+ description:
23
+ 'Cross-platform UI foundation for React Native and React Native Web. Provides theming, layout primitives, and core building blocks for modern apps.',
24
+ },
25
+
26
+ package: {
27
+ root: '.',
28
+ entrypoints: ['src/index.ts'],
29
+ },
30
+
31
+ output: {
32
+ dir: './paradox',
33
+ },
34
+ });
35
+ ```
36
+
10
37
  ## Generated documentation
11
38
 
12
39
  - [Interactive documentation app](././paradox/index.html)
@@ -1,4 +1,11 @@
1
- import { ScrollView } from 'react-native';
2
1
  /*** Exposes the portable React Native Web ScrollView under the bottom-sheet contract. */
3
- export declare const BottomSheetScrollView: typeof ScrollView;
2
+ export declare const BottomSheetScrollView: ((props: Omit<import("react-native").ScrollViewProps, keyof {
3
+ ref?: React.Ref<import("react-native").ScrollViewInstance> | undefined;
4
+ }> & {
5
+ ref?: React.Ref<import("react-native").ScrollViewInstance> | undefined;
6
+ }) => React.ReactNode) & Readonly<{
7
+ Context: import("react").Context<{
8
+ horizontal: boolean;
9
+ } | null>;
10
+ }>;
4
11
  //# sourceMappingURL=BottomSheetScrollView.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheetScrollView.web.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetScrollView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,mBAAa,CAAC"}
1
+ {"version":3,"file":"BottomSheetScrollView.web.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetScrollView.web.tsx"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,eAAO,MAAM,qBAAqB;OAC2zvB,CAAC;;OAAyD,CAAC;;;;;EADz2vB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  /*** Exposes the native BottomSheet-aware SectionList implementation. */
2
- export declare const BottomSheetSectionList: <ItemT, SectionT = import("react-native").DefaultSectionT>(props: import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetSectionListProps<ItemT, SectionT>) => ReturnType<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetSectionListProps<never, import("react-native").DefaultSectionT>, "ref"> & import("react").RefAttributes<import("@gorhom/bottom-sheet").BottomSheetSectionListMethods>>>>;
2
+ export declare const BottomSheetSectionList: <ItemT, SectionT = DefaultSectionT>(props: import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetSectionListProps<ItemT, SectionT>) => ReturnType<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetSectionListProps<never, DefaultSectionT>, "ref"> & import("react").RefAttributes<import("@gorhom/bottom-sheet").BottomSheetSectionListMethods>>>>;
3
3
  //# sourceMappingURL=BottomSheetSectionList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheetSectionList.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetSectionList.tsx"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,gjBAA+B,CAAC"}
1
+ {"version":3,"file":"BottomSheetSectionList.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetSectionList.tsx"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,kgBAA+B,CAAC"}
@@ -1,4 +1,7 @@
1
- import { View } from 'react-native';
2
1
  /*** Exposes the portable React Native Web View under the bottom-sheet contract. */
3
- export declare const BottomSheetView: typeof View;
2
+ export declare const BottomSheetView: (props: Omit<import("react-native").ViewProps, keyof {
3
+ ref?: React.Ref<import("react-native").ViewInstance> | undefined;
4
+ }> & {
5
+ ref?: React.Ref<import("react-native").ViewInstance> | undefined;
6
+ }) => React.ReactNode;
4
7
  //# sourceMappingURL=BottomSheetView.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheetView.web.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,mFAAmF;AACnF,eAAO,MAAM,eAAe,aAAO,CAAC"}
1
+ {"version":3,"file":"BottomSheetView.web.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetView.web.tsx"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,eAAO,MAAM,eAAe;OACoe,CAAC;;OAAmD,CAAC;qBADlhB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  /*** Exposes the native BottomSheet-aware VirtualizedList implementation. */
2
- export declare const BottomSheetVirtualizedList: <T>(props: import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetVirtualizedListProps<T>) => ReturnType<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetVirtualizedListProps<never>, "ref"> & import("react").RefAttributes<import("@gorhom/bottom-sheet").BottomSheetVirtualizedListMethods>>>>;
2
+ export declare const BottomSheetVirtualizedList: <T>(props: import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetVirtualizedListProps<T>) => ReturnType<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetVirtualizedListProps<T_1>, "ref"> & import("react").RefAttributes<import("@gorhom/bottom-sheet").BottomSheetVirtualizedListMethods>>>>;
3
3
  //# sourceMappingURL=BottomSheetVirtualizedList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheetVirtualizedList.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetVirtualizedList.tsx"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,+cAAmC,CAAC"}
1
+ {"version":3,"file":"BottomSheetVirtualizedList.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetVirtualizedList.tsx"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,6cAAmC,CAAC"}
@@ -1,4 +1,3 @@
1
- import { VirtualizedList } from 'react-native';
2
1
  /*** Exposes the portable React Native Web VirtualizedList under the bottom-sheet contract. */
3
- export declare const BottomSheetVirtualizedList: typeof VirtualizedList;
2
+ export declare const BottomSheetVirtualizedList: typeof import("@react-native/virtualized-lists/types_generated/Lists/VirtualizedList").default;
4
3
  //# sourceMappingURL=BottomSheetVirtualizedList.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheetVirtualizedList.web.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetVirtualizedList.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,8FAA8F;AAC9F,eAAO,MAAM,0BAA0B,wBAAkB,CAAC"}
1
+ {"version":3,"file":"BottomSheetVirtualizedList.web.d.ts","sourceRoot":"","sources":["../../../src/features/bottom-sheet/BottomSheetVirtualizedList.web.tsx"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,eAAO,MAAM,0BAA0B,gGAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PortableIcon.d.ts","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/PortableIcon.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EAEd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,cAAc,EAAc,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGxF,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA0BpD;AAED,UAAU,6BAA6B;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,KAAK,qBAAqB,GAAG,cAAc,GACzC,6BAA6B,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC;AACnE,KAAK,oBAAoB,GAAG,aAAa,GACvC,6BAA6B,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC;AACnE,KAAK,iBAAiB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC"}
1
+ {"version":3,"file":"PortableIcon.d.ts","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/PortableIcon.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,KAAK,SAAS,EAEd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,cAAc,EAAc,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGxF,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA0BpD;AAED,UAAU,6BAA6B;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,KAAK,qBAAqB,GAAG,cAAc,GACzC,6BAA6B,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC;AACnE,KAAK,oBAAoB,GAAG,aAAa,GACvC,6BAA6B,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC;AACnE,KAAK,iBAAiB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC"}
@@ -38,12 +38,15 @@ const styles = StyleSheet.create({ bundledSvgImage: { height: '100%', width: '10
38
38
  function resolveSvgIconUri(source) {
39
39
  if (typeof source === 'string')
40
40
  return source;
41
- if (!Array.isArray(source) && typeof source === 'object' && typeof source.uri === 'string') {
41
+ if (isImageUriSource(source) && typeof source.uri === 'string')
42
42
  return source.uri;
43
- }
44
43
  if (typeof Image.resolveAssetSource !== 'function')
45
44
  return null;
46
- return Image.resolveAssetSource(source).uri;
45
+ return Image.resolveAssetSource(source)?.uri ?? null;
46
+ }
47
+ /*** Narrows a React Native image source to one URI-bearing source object. */
48
+ function isImageUriSource(source) {
49
+ return typeof source === 'object' && 'uri' in source;
47
50
  }
48
51
  /*** Renders URI-backed SVGs and bundled SVG image assets. */
49
52
  function renderSvgIcon(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"PortableIcon.js","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/PortableIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAC9F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,KAAK,EAEL,UAAU,EAEV,IAAI,GAEL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK1C,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,IAAI,QAAQ,IAAI,KAAK;QAAE,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;IAEnD,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,WAAW,GAAG;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,CAAC;IAEF,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,SAAS,CAAC;QACf,KAAK,UAAU;YACb,OAAO,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QACzD,KAAK,aAAa;YAChB,OAAO,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,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AAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QAC/E,KAAK,SAAS;YACZ,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QACjF,KAAK,OAAO;YACV,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QAC/E;YACE,OAAO,WAAW,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IACxD,CAAC;AACH,CAAC;AAED,yCAAyC;AACzC,SAAS,kBAAkB,CACzB,KAAwD,EACxD,WAA4B;IAE5B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE1B,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QAC/E,KAAK,SAAS;YACZ,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QACjF,KAAK,OAAO;YACV,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QAC/E;YACE,OAAO,WAAW,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IACxD,CAAC;AACH,CAAC","sourcesContent":["import { FontAwesome } from '@react-native-vector-icons/fontawesome/static';\nimport { FontAwesome5 } from '@react-native-vector-icons/fontawesome5/static';\nimport { FontAwesome6 } from '@react-native-vector-icons/fontawesome6/static';\nimport { Ionicons } from '@react-native-vector-icons/ionicons/static';\nimport { MaterialDesignIcons } from '@react-native-vector-icons/material-design-icons/static';\nimport React from 'react';\nimport {\n Image,\n type StyleProp,\n StyleSheet,\n type TextStyle,\n View,\n type ViewStyle,\n} from 'react-native';\nimport { SvgUri } from 'react-native-svg';\n\nimport type { FontIconSource, IconSource, SvgIconSource } from '../../../../types/icon';\nimport type { SurfaceImageSource } from '../../../../types/image';\n\n/*** Renders a resolved portable icon using the configured font or SVG runtime. */\nexport function PortableIcon(props: PortableIconProps) {\n if ('source' in props) return renderSvgIcon(props);\n\n const { provider } = props;\n const sharedProps = {\n color: props.color,\n size: props.size,\n style: props.style,\n testID: props.testID,\n };\n\n switch (provider) {\n case undefined:\n case 'Ionicons':\n return <Ionicons {...sharedProps} name={props.name} />;\n case 'FontAwesome':\n return <FontAwesome {...sharedProps} name={props.name} />;\n case 'FontAwesome5':\n return renderFontAwesome5(props, sharedProps);\n case 'FontAwesome6':\n return renderFontAwesome6(props, sharedProps);\n case 'MaterialDesignIcons':\n return <MaterialDesignIcons {...sharedProps} name={props.name} />;\n default:\n return assertNever(provider, 'provider');\n }\n}\n\ninterface PortableIconPresentationProps {\n color: string;\n size: number;\n testID?: string;\n}\n\ntype FontPortableIconProps = FontIconSource &\n PortableIconPresentationProps & { style?: StyleProp<TextStyle> };\ntype SvgPortableIconProps = SvgIconSource &\n PortableIconPresentationProps & { style?: StyleProp<ViewStyle> };\ntype PortableIconProps = FontPortableIconProps | SvgPortableIconProps;\ntype SharedIconProps = PortableIconPresentationProps & { style?: StyleProp<TextStyle> };\n\nconst styles = StyleSheet.create({ bundledSvgImage: { height: '100%', width: '100%' } });\n\n/*** Resolves an SVG URI directly or through React Native's bundled-asset API. */\nfunction resolveSvgIconUri(source: SurfaceImageSource): string | null {\n if (typeof source === 'string') return source;\n if (!Array.isArray(source) && typeof source === 'object' && typeof source.uri === 'string') {\n return source.uri;\n }\n if (typeof Image.resolveAssetSource !== 'function') return null;\n return Image.resolveAssetSource(source).uri;\n}\n\n/*** Renders URI-backed SVGs and bundled SVG image assets. */\nfunction renderSvgIcon(props: SvgPortableIconProps) {\n const uri = resolveSvgIconUri(props.source);\n if (uri) {\n return (\n <SvgUri\n color={props.color}\n height={props.size}\n style={props.style}\n testID={props.testID}\n uri={uri}\n width={props.size}\n />\n );\n }\n\n const imageSource = typeof props.source === 'string' ? { uri: props.source } : props.source;\n return (\n <View style={[{ height: props.size, width: props.size }, props.style]} testID={props.testID}>\n <Image source={imageSource} style={styles.bundledSvgImage} tintColor={props.color} />\n </View>\n );\n}\n\n/*** Rejects unsupported icon configuration at runtime. */\nfunction assertNever(value: never, configuration: string): never {\n throw new Error(`Unsupported icon ${configuration}: ${String(value)}`);\n}\n\n/*** Renders one FontAwesome5 variant. */\nfunction renderFontAwesome5(\n props: Extract<IconSource, { provider: 'FontAwesome5' }>,\n sharedProps: SharedIconProps,\n) {\n const { variant } = props;\n\n switch (variant) {\n case 'brand':\n return <FontAwesome5 {...sharedProps} iconStyle=\"brand\" name={props.name} />;\n case 'regular':\n return <FontAwesome5 {...sharedProps} iconStyle=\"regular\" name={props.name} />;\n case 'solid':\n return <FontAwesome5 {...sharedProps} iconStyle=\"solid\" name={props.name} />;\n default:\n return assertNever(variant, 'FontAwesome5 variant');\n }\n}\n\n/*** Renders one FontAwesome6 variant. */\nfunction renderFontAwesome6(\n props: Extract<IconSource, { provider: 'FontAwesome6' }>,\n sharedProps: SharedIconProps,\n) {\n const { variant } = props;\n\n switch (variant) {\n case 'brand':\n return <FontAwesome6 {...sharedProps} iconStyle=\"brand\" name={props.name} />;\n case 'regular':\n return <FontAwesome6 {...sharedProps} iconStyle=\"regular\" name={props.name} />;\n case 'solid':\n return <FontAwesome6 {...sharedProps} iconStyle=\"solid\" name={props.name} />;\n default:\n return assertNever(variant, 'FontAwesome6 variant');\n }\n}\n"]}
1
+ {"version":3,"file":"PortableIcon.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C,EAAG,CAAC;QAC/E,KAAK,SAAS;YACZ,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QACjF,KAAK,OAAO;YACV,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QAC/E;YACE,OAAO,WAAW,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IACxD,CAAC;AACH,CAAC;AAED,yCAAyC;AACzC,SAAS,kBAAkB,CACzB,KAAwD,EACxD,WAA4B;IAE5B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE1B,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QAC/E,KAAK,SAAS;YACZ,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QACjF,KAAK,OAAO;YACV,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QAC/E;YACE,OAAO,WAAW,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IACxD,CAAC;AACH,CAAC","sourcesContent":["import { FontAwesome } from '@react-native-vector-icons/fontawesome/static';\nimport { FontAwesome5 } from '@react-native-vector-icons/fontawesome5/static';\nimport { FontAwesome6 } from '@react-native-vector-icons/fontawesome6/static';\nimport { Ionicons } from '@react-native-vector-icons/ionicons/static';\nimport { MaterialDesignIcons } from '@react-native-vector-icons/material-design-icons/static';\nimport React from 'react';\nimport {\n Image,\n type ImageURISource,\n type StyleProp,\n StyleSheet,\n type TextStyle,\n View,\n type ViewStyle,\n} from 'react-native';\nimport { SvgUri } from 'react-native-svg';\n\nimport type { FontIconSource, IconSource, SvgIconSource } from '../../../../types/icon';\nimport type { SurfaceImageSource } from '../../../../types/image';\n\n/*** Renders a resolved portable icon using the configured font or SVG runtime. */\nexport function PortableIcon(props: PortableIconProps) {\n if ('source' in props) return renderSvgIcon(props);\n\n const { provider } = props;\n const sharedProps = {\n color: props.color,\n size: props.size,\n style: props.style,\n testID: props.testID,\n };\n\n switch (provider) {\n case undefined:\n case 'Ionicons':\n return <Ionicons {...sharedProps} name={props.name} />;\n case 'FontAwesome':\n return <FontAwesome {...sharedProps} name={props.name} />;\n case 'FontAwesome5':\n return renderFontAwesome5(props, sharedProps);\n case 'FontAwesome6':\n return renderFontAwesome6(props, sharedProps);\n case 'MaterialDesignIcons':\n return <MaterialDesignIcons {...sharedProps} name={props.name} />;\n default:\n return assertNever(provider, 'provider');\n }\n}\n\ninterface PortableIconPresentationProps {\n color: string;\n size: number;\n testID?: string;\n}\n\ntype FontPortableIconProps = FontIconSource &\n PortableIconPresentationProps & { style?: StyleProp<TextStyle> };\ntype SvgPortableIconProps = SvgIconSource &\n PortableIconPresentationProps & { style?: StyleProp<ViewStyle> };\ntype PortableIconProps = FontPortableIconProps | SvgPortableIconProps;\ntype SharedIconProps = PortableIconPresentationProps & { style?: StyleProp<TextStyle> };\n\nconst styles = StyleSheet.create({ bundledSvgImage: { height: '100%', width: '100%' } });\n\n/*** Resolves an SVG URI directly or through React Native's bundled-asset API. */\nfunction resolveSvgIconUri(source: SurfaceImageSource): string | null {\n if (typeof source === 'string') return source;\n if (isImageUriSource(source) && typeof source.uri === 'string') return source.uri;\n if (typeof Image.resolveAssetSource !== 'function') return null;\n return Image.resolveAssetSource(source)?.uri ?? null;\n}\n\n/*** Narrows a React Native image source to one URI-bearing source object. */\nfunction isImageUriSource(source: Exclude<SurfaceImageSource, string>): source is ImageURISource {\n return typeof source === 'object' && 'uri' in source;\n}\n\n/*** Renders URI-backed SVGs and bundled SVG image assets. */\nfunction renderSvgIcon(props: SvgPortableIconProps) {\n const uri = resolveSvgIconUri(props.source);\n if (uri) {\n return (\n <SvgUri\n color={props.color}\n height={props.size}\n style={props.style}\n testID={props.testID}\n uri={uri}\n width={props.size}\n />\n );\n }\n\n const imageSource = typeof props.source === 'string' ? { uri: props.source } : props.source;\n return (\n <View style={[{ height: props.size, width: props.size }, props.style]} testID={props.testID}>\n <Image source={imageSource} style={styles.bundledSvgImage} tintColor={props.color} />\n </View>\n );\n}\n\n/*** Rejects unsupported icon configuration at runtime. */\nfunction assertNever(value: never, configuration: string): never {\n throw new Error(`Unsupported icon ${configuration}: ${String(value)}`);\n}\n\n/*** Renders one FontAwesome5 variant. */\nfunction renderFontAwesome5(\n props: Extract<IconSource, { provider: 'FontAwesome5' }>,\n sharedProps: SharedIconProps,\n) {\n const { variant } = props;\n\n switch (variant) {\n case 'brand':\n return <FontAwesome5 {...sharedProps} iconStyle=\"brand\" name={props.name} />;\n case 'regular':\n return <FontAwesome5 {...sharedProps} iconStyle=\"regular\" name={props.name} />;\n case 'solid':\n return <FontAwesome5 {...sharedProps} iconStyle=\"solid\" name={props.name} />;\n default:\n return assertNever(variant, 'FontAwesome5 variant');\n }\n}\n\n/*** Renders one FontAwesome6 variant. */\nfunction renderFontAwesome6(\n props: Extract<IconSource, { provider: 'FontAwesome6' }>,\n sharedProps: SharedIconProps,\n) {\n const { variant } = props;\n\n switch (variant) {\n case 'brand':\n return <FontAwesome6 {...sharedProps} iconStyle=\"brand\" name={props.name} />;\n case 'regular':\n return <FontAwesome6 {...sharedProps} iconStyle=\"regular\" name={props.name} />;\n case 'solid':\n return <FontAwesome6 {...sharedProps} iconStyle=\"solid\" name={props.name} />;\n default:\n return assertNever(variant, 'FontAwesome6 variant');\n }\n}\n"]}
@@ -6,7 +6,7 @@ export function getSourceKey(source) {
6
6
  return `uri:${source}`;
7
7
  if (typeof source === 'number')
8
8
  return `asset:${source}`;
9
- if (Array.isArray(source)) {
9
+ if (isImageUriSourceList(source)) {
10
10
  const parts = source
11
11
  .map((item) => item.uri)
12
12
  .filter((value) => typeof value === 'string');
@@ -24,10 +24,18 @@ export function getSourceKey(source) {
24
24
  }
25
25
  /*** Reads the first URI represented by a React Native image source. */
26
26
  function getUriFromSource(source) {
27
- if (Array.isArray(source))
27
+ if (isImageUriSourceList(source))
28
28
  return source[0]?.uri;
29
29
  if (typeof source === 'number')
30
30
  return undefined;
31
- return source.uri;
31
+ return isImageUriSource(source) ? source.uri : undefined;
32
+ }
33
+ /*** Narrows a React Native image source to one URI-bearing source object. */
34
+ function isImageUriSource(source) {
35
+ return typeof source === 'object' && 'uri' in source;
36
+ }
37
+ /*** Narrows a React Native image source to the readonly multi-source form. */
38
+ function isImageUriSourceList(source) {
39
+ return Array.isArray(source);
32
40
  }
33
41
  //# sourceMappingURL=getSourceKey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSourceKey.js","sourceRoot":"","sources":["../../../../src/features/image/utils/getSourceKey.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,MAAM,UAAU,YAAY,CAAC,MAA6C;IACxE,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACzD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,OAAO,MAAM,EAAE,CAAC;IACvD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,MAAM,EAAE,CAAC;IACzD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,MAAM;aACjB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;aACvB,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;QACjE,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACtC,CAAC;IAED,MAAM,GAAG,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,GAAG;QAAE,OAAO,OAAO,GAAG,EAAE,CAAC;IAE7B,IAAI,CAAC;QACH,OAAO,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,SAAS,gBAAgB,CAAC,MAA2B;IACnD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACjD,OAAO,MAAM,CAAC,GAAG,CAAC;AACpB,CAAC","sourcesContent":["import type { ImageSourcePropType } from 'react-native';\n\nimport type { SurfaceImageSource } from '../../../types/image';\n\n/*** Derives a stable runtime key for one Surface image source. */\nexport function getSourceKey(source: SurfaceImageSource | null | undefined): string | null {\n if (source === null || source === undefined) return null;\n if (typeof source === 'string') return `uri:${source}`;\n if (typeof source === 'number') return `asset:${source}`;\n if (Array.isArray(source)) {\n const parts = source\n .map((item) => item.uri)\n .filter((value): value is string => typeof value === 'string');\n return `uri-set:${parts.join('|')}`;\n }\n\n const uri = getUriFromSource(source);\n if (uri) return `uri:${uri}`;\n\n try {\n return `src:${JSON.stringify(source)}`;\n } catch {\n return 'src:unknown';\n }\n}\n\n/*** Reads the first URI represented by a React Native image source. */\nfunction getUriFromSource(source: ImageSourcePropType): string | undefined {\n if (Array.isArray(source)) return source[0]?.uri;\n if (typeof source === 'number') return undefined;\n return source.uri;\n}\n"]}
1
+ {"version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C,SAAS,CAAC;AAC3D,CAAC;AAED,6EAA6E;AAC7E,SAAS,gBAAgB,CAAC,MAA2B;IACnD,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,IAAI,MAAM,CAAC;AACvD,CAAC;AAED,8EAA8E;AAC9E,SAAS,oBAAoB,CAAC,MAA2B;IACvD,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import type { ImageSourcePropType, ImageURISource } from 'react-native';\n\nimport type { SurfaceImageSource } from '../../../types/image';\n\n/*** Derives a stable runtime key for one Surface image source. */\nexport function getSourceKey(source: SurfaceImageSource | null | undefined): string | null {\n if (source === null || source === undefined) return null;\n if (typeof source === 'string') return `uri:${source}`;\n if (typeof source === 'number') return `asset:${source}`;\n if (isImageUriSourceList(source)) {\n const parts = source\n .map((item) => item.uri)\n .filter((value): value is string => typeof value === 'string');\n return `uri-set:${parts.join('|')}`;\n }\n\n const uri = getUriFromSource(source);\n if (uri) return `uri:${uri}`;\n\n try {\n return `src:${JSON.stringify(source)}`;\n } catch {\n return 'src:unknown';\n }\n}\n\n/*** Reads the first URI represented by a React Native image source. */\nfunction getUriFromSource(source: ImageSourcePropType): string | undefined {\n if (isImageUriSourceList(source)) return source[0]?.uri;\n if (typeof source === 'number') return undefined;\n return isImageUriSource(source) ? source.uri : undefined;\n}\n\n/*** Narrows a React Native image source to one URI-bearing source object. */\nfunction isImageUriSource(source: ImageSourcePropType): source is ImageURISource {\n return typeof source === 'object' && 'uri' in source;\n}\n\n/*** Narrows a React Native image source to the readonly multi-source form. */\nfunction isImageUriSourceList(source: ImageSourcePropType): source is readonly ImageURISource[] {\n return Array.isArray(source);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,M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A,EAAE,IAAI,CACN;MAAA,CAAC,YAAY,CAAC,CAAC,CAAC,CACd,CAAC,cAAc,CACb,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,mBAAmB,CAAC,CAAC,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC,CACvD,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAC1B,OAAO,CAAC,CAAC,KAAK,CAAC,CACf,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,cAAc,CAAC,CAC7C,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAErB;UAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;QAAA,EAAE,cAAc,CAAC,CAClB,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { useControllableState } from '../../../../internal/useControllableState';\nimport type { PopoverProps } from '../../../../types/popover';\nimport { PopoverOverlay } from './PopoverOverlay';\n\n/*** Renders anchored overlay content through the shared Surface overlay stack. */\nexport function Popover(props: PopoverProps) {\n const anchorRef = React.useRef<View | null>(null);\n const [resolvedOpen, setResolvedOpen] = useControllableState<boolean>({\n defaultValue: props.defaultOpen ?? false,\n onChange: props.onOpenChange,\n value: props.open,\n });\n const passive = props.interactionPolicy === 'passive';\n\n const close = React.useCallback(() => {\n if (!passive) setResolvedOpen(false);\n }, [passive, setResolvedOpen]);\n const toggle = React.useCallback(() => {\n if (!passive) setResolvedOpen(!resolvedOpen);\n }, [passive, resolvedOpen, setResolvedOpen]);\n\n return (\n <>\n <View\n collapsable={false}\n ref={anchorRef}\n testID={props.testID ? `${props.testID}-anchor` : undefined}\n >\n {props.anchor({ close, open: resolvedOpen, toggle })}\n </View>\n {resolvedOpen ? (\n <PopoverOverlay\n anchorRef={anchorRef}\n closeOnOutsidePress={props.closeOnOutsidePress ?? true}\n offset={props.offset ?? 8}\n onClose={close}\n passive={passive}\n placement={props.placement ?? 'bottom-start'}\n testID={props.testID}\n >\n {props.children}\n </PopoverOverlay>\n ) : null}\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,kFAAkF;AAClF,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAuC,IAAI,CAAC,CAAC;IAC3E,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,oBAAoB,CAAU;QACpE,YAAY,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK;QACxC,QAAQ,EAAE,KAAK,CAAC,YAAY;QAC5B,KAAK,EAAE,KAAK,CAAC,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,KAAK,CAAC,iBAAiB,KAAK,SAAS,CAAC;IAEtD,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACnC,IAAI,CAAC,OAAO;YAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACpC,IAAI,CAAC,OAAO;YAAE,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAE7C,OAAO,CACL,EACE;MAAA,CAAC,IAAI,CACH,WAAW,CAAC,CAAC,KAAK,CAAC,CACnB,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAE5D;QAAA,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CACtD;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,YAAY,CAAC,CAAC,CAAC,CACd,CAAC,cAAc,CACb,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,mBAAmB,CAAC,CAAC,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC,CACvD,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAC1B,OAAO,CAAC,CAAC,KAAK,CAAC,CACf,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,cAAc,CAAC,CAC7C,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAErB;UAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;QAAA,EAAE,cAAc,CAAC,CAClB,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { useControllableState } from '../../../../internal/useControllableState';\nimport type { PopoverProps } from '../../../../types/popover';\nimport { PopoverOverlay } from './PopoverOverlay';\n\n/*** Renders anchored overlay content through the shared Surface overlay stack. */\nexport function Popover(props: PopoverProps) {\n const anchorRef = React.useRef<React.ElementRef<typeof View> | null>(null);\n const [resolvedOpen, setResolvedOpen] = useControllableState<boolean>({\n defaultValue: props.defaultOpen ?? false,\n onChange: props.onOpenChange,\n value: props.open,\n });\n const passive = props.interactionPolicy === 'passive';\n\n const close = React.useCallback(() => {\n if (!passive) setResolvedOpen(false);\n }, [passive, setResolvedOpen]);\n const toggle = React.useCallback(() => {\n if (!passive) setResolvedOpen(!resolvedOpen);\n }, [passive, resolvedOpen, setResolvedOpen]);\n\n return (\n <>\n <View\n collapsable={false}\n ref={anchorRef}\n testID={props.testID ? `${props.testID}-anchor` : undefined}\n >\n {props.anchor({ close, open: resolvedOpen, toggle })}\n </View>\n {resolvedOpen ? (\n <PopoverOverlay\n anchorRef={anchorRef}\n closeOnOutsidePress={props.closeOnOutsidePress ?? true}\n offset={props.offset ?? 8}\n onClose={close}\n passive={passive}\n placement={props.placement ?? 'bottom-start'}\n testID={props.testID}\n >\n {props.children}\n </PopoverOverlay>\n ) : null}\n </>\n );\n}\n"]}
@@ -4,7 +4,7 @@ import type { PopoverPlacement } from '../../../../types/popover';
4
4
  /*** Renders and positions one mounted popover overlay for an open anchor. */
5
5
  export declare function PopoverOverlay({ anchorRef, children, closeOnOutsidePress, offset, onClose, passive, placement, testID, }: PopoverOverlayProps): React.JSX.Element;
6
6
  interface PopoverOverlayProps {
7
- anchorRef: React.RefObject<View | null>;
7
+ anchorRef: React.RefObject<React.ElementRef<typeof View> | null>;
8
8
  children?: React.ReactNode;
9
9
  closeOnOutsidePress: boolean;
10
10
  offset: number;
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverOverlay.d.ts","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/PopoverOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyB,IAAI,EAAkB,MAAM,cAAc,CAAC;AAG3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,MAAM,GACP,EAAE,mBAAmB,qBA6BrB;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"PopoverOverlay.d.ts","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/PopoverOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyB,IAAI,EAAkB,MAAM,cAAc,CAAC;AAG3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,MAAM,GACP,EAAE,mBAAmB,qBA6BrB;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACjE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverOverlay.js","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/PopoverOverlay.tsx"],"names":[],"mappings":"A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AAG,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAEjD;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC;AAaD,MAAM,YAAY,GAAc;IAC9B,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;IACjC,OAAO,EAAE,YAAY;CACtB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, View, type ViewStyle } from 'react-native';\n\nimport { Portal } from '../../../../internal/overlay/Portal';\nimport type { PopoverPlacement } from '../../../../types/popover';\nimport { usePopoverLayout } from './usePopoverLayout';\n\n/*** Renders and positions one mounted popover overlay for an open anchor. */\nexport function PopoverOverlay({\n anchorRef,\n children,\n closeOnOutsidePress,\n offset,\n onClose,\n passive,\n placement,\n testID,\n}: PopoverOverlayProps) {\n const { onContentLayout, position, ready } = usePopoverLayout({\n anchorRef,\n offset,\n open: true,\n placement,\n });\n\n return (\n <Portal layer=\"popover\" visible={ready}>\n <View pointerEvents=\"box-none\" style={styles.overlay}>\n {closeOnOutsidePress ? (\n <Pressable\n accessibilityLabel=\"Close popover\"\n onPress={passive ? undefined : onClose}\n style={styles.backdrop}\n testID={testID ? `${testID}-backdrop` : undefined}\n />\n ) : null}\n <View\n onLayout={onContentLayout}\n style={[styles.content, position]}\n testID={testID ? `${testID}-content` : undefined}\n >\n {children}\n </View>\n </View>\n </Portal>\n );\n}\n\ninterface PopoverOverlayProps {\n anchorRef: React.RefObject<View | null>;\n children?: React.ReactNode;\n closeOnOutsidePress: boolean;\n offset: number;\n onClose: () => void;\n passive: boolean;\n placement: PopoverPlacement;\n testID?: string;\n}\n\nconst absoluteFill: ViewStyle = {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n};\n\nconst styles = StyleSheet.create({\n backdrop: absoluteFill,\n content: { position: 'absolute' },\n overlay: absoluteFill,\n});\n"]}
1
+ {"version":3,"file":"PopoverOverlay.js","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/PopoverOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAE3E,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,6EAA6E;AAC7E,MAAM,UAAU,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,MAAM,GACc;IACpB,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAC;QAC5D,SAAS;QACT,MAAM;QACN,IAAI,EAAE,IAAI;QACV,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CACrC;MAAA,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CACnD;QAAA,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACrB,CAAC,SAAS,CACR,kBAAkB,CAAC,eAAe,CAClC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CACvC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,EAClD,CACH,CAAC,CAAC,CAAC,IAAI,CACR;QAAA,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC1B,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAClC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAEjD;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC;AAaD,MAAM,YAAY,GAAc;IAC9B,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;IACjC,OAAO,EAAE,YAAY;CACtB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, View, type ViewStyle } from 'react-native';\n\nimport { Portal } from '../../../../internal/overlay/Portal';\nimport type { PopoverPlacement } from '../../../../types/popover';\nimport { usePopoverLayout } from './usePopoverLayout';\n\n/*** Renders and positions one mounted popover overlay for an open anchor. */\nexport function PopoverOverlay({\n anchorRef,\n children,\n closeOnOutsidePress,\n offset,\n onClose,\n passive,\n placement,\n testID,\n}: PopoverOverlayProps) {\n const { onContentLayout, position, ready } = usePopoverLayout({\n anchorRef,\n offset,\n open: true,\n placement,\n });\n\n return (\n <Portal layer=\"popover\" visible={ready}>\n <View pointerEvents=\"box-none\" style={styles.overlay}>\n {closeOnOutsidePress ? (\n <Pressable\n accessibilityLabel=\"Close popover\"\n onPress={passive ? undefined : onClose}\n style={styles.backdrop}\n testID={testID ? `${testID}-backdrop` : undefined}\n />\n ) : null}\n <View\n onLayout={onContentLayout}\n style={[styles.content, position]}\n testID={testID ? `${testID}-content` : undefined}\n >\n {children}\n </View>\n </View>\n </Portal>\n );\n}\n\ninterface PopoverOverlayProps {\n anchorRef: React.RefObject<React.ElementRef<typeof View> | null>;\n children?: React.ReactNode;\n closeOnOutsidePress: boolean;\n offset: number;\n onClose: () => void;\n passive: boolean;\n placement: PopoverPlacement;\n testID?: string;\n}\n\nconst absoluteFill: ViewStyle = {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n};\n\nconst styles = StyleSheet.create({\n backdrop: absoluteFill,\n content: { position: 'absolute' },\n overlay: absoluteFill,\n});\n"]}
@@ -12,7 +12,7 @@ export declare function usePopoverLayout({ anchorRef, offset, open, placement }:
12
12
  ready: boolean;
13
13
  };
14
14
  interface UsePopoverLayoutInput {
15
- anchorRef: React.RefObject<View | null>;
15
+ anchorRef: React.RefObject<React.ElementRef<typeof View> | null>;
16
16
  offset: number;
17
17
  open: boolean;
18
18
  placement: PopoverPlacement;
@@ -1 +1 @@
1
- {"version":3,"file":"usePopoverLayout.d.ts","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/usePopoverLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,KAAK,iBAAiB,EAGtB,KAAK,IAAI,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,qBAAqB;;6BAe1C,iBAAiB;;;;;;EAgBpE;AAED,UAAU,qBAAqB;IAC7B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,gBAAgB,CAAC;CAC7B"}
1
+ {"version":3,"file":"usePopoverLayout.d.ts","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/usePopoverLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,KAAK,iBAAiB,EAGtB,KAAK,IAAI,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,qBAAqB;;6BAe1C,iBAAiB;;;;;;EAgBpE;AAED,UAAU,qBAAqB;IAC7B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,gBAAgB,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePopoverLayout.js","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/usePopoverLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,oFAAoF;AACpF,MAAM,UAAU,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAyB;IAC5F,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAyB,I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YAAY,CAAC,EAAE,CAAC;AACpF,CAAC","sourcesContent":["import React from 'react';\nimport {\n type LayoutChangeEvent,\n type LayoutRectangle,\n useWindowDimensions,\n type View,\n} from 'react-native';\n\nimport type { PopoverPlacement } from '../../../../types/popover';\nimport { resolvePopoverPosition } from '../../utils/resolvePopoverPosition';\n\n/*** Measures the anchor and resolves the current viewport-safe popover position. */\nexport function usePopoverLayout({ anchorRef, offset, open, placement }: UsePopoverLayoutInput) {\n const [anchorLayout, setAnchorLayout] = React.useState<LayoutRectangle | null>(null);\n const [contentSize, setContentSize] = React.useState({ height: 0, width: 0 });\n const { height: viewportHeight, width: viewportWidth } = useWindowDimensions();\n\n const measureAnchor = React.useCallback(() => {\n anchorRef.current?.measureInWindow((x, y, width, height) => {\n setAnchorLayout({ height, width, x, y });\n });\n }, [anchorRef]);\n\n React.useEffect(() => {\n if (open) measureAnchor();\n }, [measureAnchor, open]);\n\n const onContentLayout = React.useCallback((event: LayoutChangeEvent) => {\n setContentSize(event.nativeEvent.layout);\n }, []);\n\n const position = anchorLayout\n ? resolvePopoverPosition({\n anchor: anchorLayout,\n contentSize,\n offset,\n placement,\n viewport: { height: viewportHeight, width: viewportWidth },\n viewportPadding: 8,\n })\n : undefined;\n\n return { measureAnchor, onContentLayout, position, ready: Boolean(anchorLayout) };\n}\n\ninterface UsePopoverLayoutInput {\n anchorRef: React.RefObject<View | null>;\n offset: number;\n open: boolean;\n placement: PopoverPlacement;\n}\n"]}
1
+ {"version":3,"file":"usePopoverLayout.js","sourceRoot":"","sources":["../../../../../src/features/popover/adapters/inbound/usePopoverLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,oFAAoF;AACpF,MAAM,UAAU,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAA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,CAAC,SAAS,CAAC;IAEd,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;AACpF,CAAC","sourcesContent":["import React from 'react';\nimport {\n type LayoutChangeEvent,\n type LayoutRectangle,\n useWindowDimensions,\n type View,\n} from 'react-native';\n\nimport type { PopoverPlacement } from '../../../../types/popover';\nimport { resolvePopoverPosition } from '../../utils/resolvePopoverPosition';\n\n/*** Measures the anchor and resolves the current viewport-safe popover position. */\nexport function usePopoverLayout({ anchorRef, offset, open, placement }: UsePopoverLayoutInput) {\n const [anchorLayout, setAnchorLayout] = React.useState<LayoutRectangle | null>(null);\n const [contentSize, setContentSize] = React.useState({ height: 0, width: 0 });\n const { height: viewportHeight, width: viewportWidth } = useWindowDimensions();\n\n const measureAnchor = React.useCallback(() => {\n anchorRef.current?.measureInWindow((x, y, width, height) => {\n setAnchorLayout({ height, width, x, y });\n });\n }, [anchorRef]);\n\n React.useEffect(() => {\n if (open) measureAnchor();\n }, [measureAnchor, open]);\n\n const onContentLayout = React.useCallback((event: LayoutChangeEvent) => {\n setContentSize(event.nativeEvent.layout);\n }, []);\n\n const position = anchorLayout\n ? resolvePopoverPosition({\n anchor: anchorLayout,\n contentSize,\n offset,\n placement,\n viewport: { height: viewportHeight, width: viewportWidth },\n viewportPadding: 8,\n })\n : undefined;\n\n return { measureAnchor, onContentLayout, position, ready: Boolean(anchorLayout) };\n}\n\ninterface UsePopoverLayoutInput {\n anchorRef: React.RefObject<React.ElementRef<typeof View> | null>;\n offset: number;\n open: boolean;\n placement: PopoverPlacement;\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
+ import type { Pressable } from 'react-native';
2
3
  /*** Registers one focusable tab with the owning Tabs context. */
3
- export declare function useTabRegistration({ disabled, value }: {
4
+ export declare function useTabRegistration({ disabled, value, }: {
4
5
  disabled: boolean;
5
6
  value: string;
6
- }): React.RefObject<import("react-native").View | null>;
7
+ }): React.RefObject<React.ElementRef<typeof Pressable> | null>;
7
8
  //# sourceMappingURL=useTabRegistration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTabRegistration.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,uDAoB3F"}
1
+ {"version":3,"file":"useTabRegistration.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,GAAG,IAAI,CAAC,CAoB7D"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTabsContext } from './useTabsContext';
3
3
  /*** Registers one focusable tab with the owning Tabs context. */
4
- export function useTabRegistration({ disabled, value }) {
4
+ export function useTabRegistration({ disabled, value, }) {
5
5
  const { registerTab, unregisterTab } = useTabsContext();
6
6
  const pressableRef = React.useRef(null);
7
7
  React.useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"useTabRegistration.js","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAwC;IAC1F,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,cAAc,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAA4C,IAAI,CAAC,CAAC;IAEnF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,WAAW,CAAC;YACV,QAAQ;YACR,KAAK,EAAE,GAAG,EAAE;gBACV,MAAM,SAAS,GAAG,YAAY,CAAC,OAEvB,CAAC;gBACT,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC;YACvB,CAAC;YACD,KAAK;SACN,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;IAElD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import React from 'react';\nimport type { Pressable } from 'react-native';\n\nimport { useTabsContext } from './useTabsContext';\n\n/*** Registers one focusable tab with the owning Tabs context. */\nexport function useTabRegistration({ disabled, value }: { disabled: boolean; value: string }) {\n const { registerTab, unregisterTab } = useTabsContext();\n const pressableRef = React.useRef<React.ElementRef<typeof Pressable> | null>(null);\n\n React.useEffect(() => {\n registerTab({\n disabled,\n focus: () => {\n const focusable = pressableRef.current as unknown as {\n focus?: (() => void) | undefined;\n } | null;\n focusable?.focus?.();\n },\n value,\n });\n\n return () => unregisterTab(value);\n }, [disabled, registerTab, unregisterTab, value]);\n\n return pressableRef;\n}\n"]}
1
+ {"version":3,"file":"useTabRegistration.js","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,GAIN;IACC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,cAAc,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAA4C,IAAI,CAAC,CAAC;IAEnF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,WAAW,CAAC;YACV,QAAQ;YACR,KAAK,EAAE,GAAG,EAAE;gBACV,MAAM,SAAS,GAAG,YAAY,CAAC,OAEvB,CAAC;gBACT,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC;YACvB,CAAC;YACD,KAAK;SACN,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;IAElD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import React from 'react';\nimport type { Pressable } from 'react-native';\n\nimport { useTabsContext } from './useTabsContext';\n\n/*** Registers one focusable tab with the owning Tabs context. */\nexport function useTabRegistration({\n disabled,\n value,\n}: {\n disabled: boolean;\n value: string;\n}): React.RefObject<React.ElementRef<typeof Pressable> | null> {\n const { registerTab, unregisterTab } = useTabsContext();\n const pressableRef = React.useRef<React.ElementRef<typeof Pressable> | null>(null);\n\n React.useEffect(() => {\n registerTab({\n disabled,\n focus: () => {\n const focusable = pressableRef.current as unknown as {\n focus?: (() => void) | undefined;\n } | null;\n focusable?.focus?.();\n },\n value,\n });\n\n return () => unregisterTab(value);\n }, [disabled, registerTab, unregisterTab, value]);\n\n return pressableRef;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FocusScope.js","sourceRoot":"","sources":["../../../src/internal/focus/FocusScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EA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IAEH,OAAO,CACL,CAAC,IAAI,CACH,WAAW,CAAC,CAAC,KAAK,CAAC,CACnB,GAAG,CAAC,CAAC,YAAY,CAAC,CAClB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC;YACL,IAAI,EAAE,CAAC;SACR,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { useFocusManager } from './useFocusManager';\n\nexport interface FocusScopeProps {\n active: boolean;\n children?: React.ReactNode;\n onEscape?: (() => void) | undefined;\n testID?: string;\n}\n\nexport function FocusScope({ active, children, onEscape, testID }: FocusScopeProps) {\n const containerRef = React.useRef<View | null>(null);\n const { bindKeydown, capturePreviousFocus, cycleFocus, focusFirst, restorePreviousFocus } =\n useFocusManager();\n\n React.useEffect(() => {\n if (!active) {\n return undefined;\n }\n\n capturePreviousFocus();\n const timeoutId = setTimeout(() => {\n focusFirst(containerRef.current);\n }, 0);\n\n const unbind = bindKeydown((event) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n cycleFocus(containerRef.current, Boolean(event.shiftKey));\n }\n\n if (event.key === 'Escape') {\n onEscape?.();\n }\n });\n\n return () => {\n clearTimeout(timeoutId);\n unbind();\n restorePreviousFocus();\n };\n }, [\n active,\n bindKeydown,\n capturePreviousFocus,\n cycleFocus,\n focusFirst,\n onEscape,\n restorePreviousFocus,\n ]);\n\n return (\n <View\n collapsable={false}\n ref={containerRef}\n testID={testID}\n style={{\n flex: 1,\n }}\n >\n {children}\n </View>\n );\n}\n"]}
1
+ {"version":3,"file":"FocusScope.js","sourceRoot":"","sources":["../../../src/internal/focus/FocusScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAA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,GAAG,CAAC,CAAC,YAAY,CAAC,CAClB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC;YACL,IAAI,EAAE,CAAC;SACR,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { useFocusManager } from './useFocusManager';\n\nexport interface FocusScopeProps {\n active: boolean;\n children?: React.ReactNode;\n onEscape?: (() => void) | undefined;\n testID?: string;\n}\n\nexport function FocusScope({ active, children, onEscape, testID }: FocusScopeProps) {\n const containerRef = React.useRef<React.ElementRef<typeof View> | null>(null);\n const { bindKeydown, capturePreviousFocus, cycleFocus, focusFirst, restorePreviousFocus } =\n useFocusManager();\n\n React.useEffect(() => {\n if (!active) {\n return undefined;\n }\n\n capturePreviousFocus();\n const timeoutId = setTimeout(() => {\n focusFirst(containerRef.current);\n }, 0);\n\n const unbind = bindKeydown((event) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n cycleFocus(containerRef.current, Boolean(event.shiftKey));\n }\n\n if (event.key === 'Escape') {\n onEscape?.();\n }\n });\n\n return () => {\n clearTimeout(timeoutId);\n unbind();\n restorePreviousFocus();\n };\n }, [\n active,\n bindKeydown,\n capturePreviousFocus,\n cycleFocus,\n focusFirst,\n onEscape,\n restorePreviousFocus,\n ]);\n\n return (\n <View\n collapsable={false}\n ref={containerRef}\n testID={testID}\n style={{\n flex: 1,\n }}\n >\n {children}\n </View>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveViewStyles.js","sourceRoot":"","sources":["../../src/utils/resolveViewStyles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,sFAAsF;AACt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;AACjF,SAAS,gBAAgB,CACvB,KAAmB,EACnB,KAAkC;IAElC,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import type { ViewStyle } from 'react-native';\n\nimport { resolveResponsive } from '../core/responsive/resolve';\nimport type { Breakpoint } from '../core/responsive/types';\nimport { resolveToken } from '../features/theme/utils/resolveToken';\nimport type { ColorValue, ViewStyleProps } from '../types/layout';\nimport type { SurfaceTheme } from '../types/theme';\nimport { resolveSpacing } from './resolveSpacing';\n\n/*** Resolves responsive Surface View style props into one React Native view style. */\nexport function resolveViewStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n elevation: 0,\n ...resolveSpacingStyles(theme, breakpoint, props),\n ...resolveVisualStyles(theme, breakpoint, props),\n ...resolveDimensionStyles(theme, breakpoint, props),\n ...resolveLayoutStyles(breakpoint, props),\n };\n}\n\n/*** Resolves padding, margin, and gap styles from responsive spacing props. */\nfunction resolveSpacingStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n padding: resolveSpacing(theme, resolveResponsive(props.p, breakpoint)),\n paddingHorizontal: resolveSpacing(theme, resolveResponsive(props.px, breakpoint)),\n paddingVertical: resolveSpacing(theme, resolveResponsive(props.py, breakpoint)),\n paddingTop: resolveSpacing(theme, resolveResponsive(props.pt, breakpoint)),\n paddingBottom: resolveSpacing(theme, resolveResponsive(props.pb, breakpoint)),\n paddingLeft: resolveSpacing(theme, resolveResponsive(props.pl, breakpoint)),\n paddingRight: resolveSpacing(theme, resolveResponsive(props.pr, breakpoint)),\n margin: resolveSpacing(theme, resolveResponsive(props.m, breakpoint)),\n marginHorizontal: resolveSpacing(theme, resolveResponsive(props.mx, breakpoint)),\n marginVertical: resolveSpacing(theme, resolveResponsive(props.my, breakpoint)),\n marginTop: resolveSpacing(theme, resolveResponsive(props.mt, breakpoint)),\n marginBottom: resolveSpacing(theme, resolveResponsive(props.mb, breakpoint)),\n marginLeft: resolveSpacing(theme, resolveResponsive(props.ml, breakpoint)),\n marginRight: resolveSpacing(theme, resolveResponsive(props.mr, breakpoint)),\n gap: resolveSpacing(theme, resolveResponsive(props.gap, breakpoint)),\n rowGap: resolveSpacing(theme, resolveResponsive(props.rowGap, breakpoint)),\n columnGap: resolveSpacing(theme, resolveResponsive(props.columnGap, breakpoint)),\n };\n}\n\n/*** Resolves background, radius, and border styles. */\nfunction resolveVisualStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n backgroundColor: resolveColor(theme, resolveResponsive(props.bg, breakpoint)),\n borderRadius: resolveRadius(theme, resolveResponsive(props.radius, breakpoint)),\n borderWidth: resolveResponsive(props.borderWidth, breakpoint),\n borderColor: resolveColor(theme, resolveResponsive(props.borderColor, breakpoint)),\n };\n}\n\n/*** Resolves responsive dimension props through spacing tokens. */\nfunction resolveDimensionStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n width: resolveDimension(\n theme,\n resolveResponsive(props.width, breakpoint),\n ) as ViewStyle['width'],\n height: resolveDimension(\n theme,\n resolveResponsive(props.height, breakpoint),\n ) as ViewStyle['height'],\n minWidth: resolveDimension(\n theme,\n resolveResponsive(props.minWidth, breakpoint),\n ) as ViewStyle['minWidth'],\n maxWidth: resolveDimension(\n theme,\n resolveResponsive(props.maxWidth, breakpoint),\n ) as ViewStyle['maxWidth'],\n minHeight: resolveDimension(\n theme,\n resolveResponsive(props.minHeight, breakpoint),\n ) as ViewStyle['minHeight'],\n maxHeight: resolveDimension(\n theme,\n resolveResponsive(props.maxHeight, breakpoint),\n ) as ViewStyle['maxHeight'],\n };\n}\n\n/*** Resolves responsive flex, positioning, and visibility styles. */\nfunction resolveLayoutStyles(breakpoint: Breakpoint, props: ViewStyleProps): ViewStyle {\n return {\n flex: resolveResponsive(props.flex, breakpoint),\n flexGrow: resolveResponsive(props.flexGrow, breakpoint),\n flexShrink: resolveResponsive(props.flexShrink, breakpoint),\n flexBasis: resolveResponsive(props.flexBasis, breakpoint) as ViewStyle['flexBasis'],\n flexDirection: resolveResponsive(props.direction, breakpoint),\n alignItems: resolveResponsive(props.align, breakpoint),\n justifyContent: resolveResponsive(props.justify, breakpoint),\n flexWrap: resolveResponsive(props.wrap, breakpoint),\n alignSelf: resolveResponsive(props.alignSelf, breakpoint),\n position: resolveResponsive(props.position, breakpoint),\n top: resolveResponsive(props.top, breakpoint),\n bottom: resolveResponsive(props.bottom, breakpoint),\n left: resolveResponsive(props.left, breakpoint),\n right: resolveResponsive(props.right, breakpoint),\n overflow: resolveResponsive(props.overflow, breakpoint),\n zIndex: resolveResponsive(props.zIndex, breakpoint),\n opacity: resolveResponsive(props.opacity, breakpoint),\n };\n}\n\n/*** Resolves a Surface radius token or raw number. */\nfunction resolveRadius(\n theme: SurfaceTheme,\n value: number | keyof SurfaceTheme['radii'] | undefined,\n): number | undefined {\n return resolveToken(theme.radii, value);\n}\n\n/*** Resolves a Surface color token while preserving arbitrary color strings. */\nfunction resolveColor(theme: SurfaceTheme, value: ColorValue | undefined): string | undefined {\n return resolveToken(theme.colors, value);\n}\n\n/*** Resolves spacing-token dimensions while preserving raw dimension strings. */\nfunction resolveDimension(\n theme: SurfaceTheme,\n value: number | string | undefined,\n): number | string | undefined {\n return resolveToken(theme.spacing, value);\n}\n"]}
1
+ {"version":3,"file":"resolveViewStyles.js","sourceRoot":"","sources":["../../src/utils/resolveViewStyles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,sFAAsF;AACtF,MAAM,UAAU,iBAAiB,CAC/B,KAAmB,EACnB,UAAsB,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;IAElC,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import type { ViewStyle } from 'react-native';\n\nimport { resolveResponsive } from '../core/responsive/resolve';\nimport type { Breakpoint } from '../core/responsive/types';\nimport { resolveToken } from '../features/theme/utils/resolveToken';\nimport type { ColorValue, ViewStyleProps } from '../types/layout';\nimport type { SurfaceTheme } from '../types/theme';\nimport { resolveSpacing } from './resolveSpacing';\n\n/*** Resolves responsive Surface View style props into one React Native view style. */\nexport function resolveViewStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n elevation: 0,\n ...resolveSpacingStyles(theme, breakpoint, props),\n ...resolveVisualStyles(theme, breakpoint, props),\n ...resolveDimensionStyles(theme, breakpoint, props),\n ...resolveLayoutStyles(breakpoint, props),\n };\n}\n\n/*** Resolves padding, margin, and gap styles from responsive spacing props. */\nfunction resolveSpacingStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n padding: resolveSpacing(theme, resolveResponsive(props.p, breakpoint)),\n paddingHorizontal: resolveSpacing(theme, resolveResponsive(props.px, breakpoint)),\n paddingVertical: resolveSpacing(theme, resolveResponsive(props.py, breakpoint)),\n paddingTop: resolveSpacing(theme, resolveResponsive(props.pt, breakpoint)),\n paddingBottom: resolveSpacing(theme, resolveResponsive(props.pb, breakpoint)),\n paddingLeft: resolveSpacing(theme, resolveResponsive(props.pl, breakpoint)),\n paddingRight: resolveSpacing(theme, resolveResponsive(props.pr, breakpoint)),\n margin: resolveSpacing(theme, resolveResponsive(props.m, breakpoint)),\n marginHorizontal: resolveSpacing(theme, resolveResponsive(props.mx, breakpoint)),\n marginVertical: resolveSpacing(theme, resolveResponsive(props.my, breakpoint)),\n marginTop: resolveSpacing(theme, resolveResponsive(props.mt, breakpoint)),\n marginBottom: resolveSpacing(theme, resolveResponsive(props.mb, breakpoint)),\n marginLeft: resolveSpacing(theme, resolveResponsive(props.ml, breakpoint)),\n marginRight: resolveSpacing(theme, resolveResponsive(props.mr, breakpoint)),\n gap: resolveSpacing(theme, resolveResponsive(props.gap, breakpoint)),\n rowGap: resolveSpacing(theme, resolveResponsive(props.rowGap, breakpoint)),\n columnGap: resolveSpacing(theme, resolveResponsive(props.columnGap, breakpoint)),\n };\n}\n\n/*** Resolves background, radius, and border styles. */\nfunction resolveVisualStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n backgroundColor: resolveColor(theme, resolveResponsive(props.bg, breakpoint)),\n borderRadius: resolveRadius(theme, resolveResponsive(props.radius, breakpoint)),\n borderWidth: resolveResponsive(props.borderWidth, breakpoint),\n borderColor: resolveColor(theme, resolveResponsive(props.borderColor, breakpoint)),\n };\n}\n\n/*** Resolves responsive dimension props through spacing tokens. */\nfunction resolveDimensionStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n width: resolveDimension(theme, resolveResponsive(props.width, breakpoint)),\n height: resolveDimension(theme, resolveResponsive(props.height, breakpoint)),\n minWidth: resolveDimension(theme, resolveResponsive(props.minWidth, breakpoint)),\n maxWidth: resolveDimension(theme, resolveResponsive(props.maxWidth, breakpoint)),\n minHeight: resolveDimension(theme, resolveResponsive(props.minHeight, breakpoint)),\n maxHeight: resolveDimension(theme, resolveResponsive(props.maxHeight, breakpoint)),\n };\n}\n\n/*** Resolves responsive flex, positioning, and visibility styles. */\nfunction resolveLayoutStyles(breakpoint: Breakpoint, props: ViewStyleProps): ViewStyle {\n return {\n flex: resolveResponsive(props.flex, breakpoint),\n flexGrow: resolveResponsive(props.flexGrow, breakpoint),\n flexShrink: resolveResponsive(props.flexShrink, breakpoint),\n flexBasis: resolveResponsive(props.flexBasis, breakpoint),\n flexDirection: resolveResponsive(props.direction, breakpoint),\n alignItems: resolveResponsive(props.align, breakpoint),\n justifyContent: resolveResponsive(props.justify, breakpoint),\n flexWrap: resolveResponsive(props.wrap, breakpoint),\n alignSelf: resolveResponsive(props.alignSelf, breakpoint),\n position: resolveResponsive(props.position, breakpoint),\n top: resolveResponsive(props.top, breakpoint),\n bottom: resolveResponsive(props.bottom, breakpoint),\n left: resolveResponsive(props.left, breakpoint),\n right: resolveResponsive(props.right, breakpoint),\n overflow: resolveResponsive(props.overflow, breakpoint),\n zIndex: resolveResponsive(props.zIndex, breakpoint),\n opacity: resolveResponsive(props.opacity, breakpoint),\n };\n}\n\n/*** Resolves a Surface radius token or raw number. */\nfunction resolveRadius(\n theme: SurfaceTheme,\n value: number | keyof SurfaceTheme['radii'] | undefined,\n): number | undefined {\n return resolveToken(theme.radii, value);\n}\n\n/*** Resolves a Surface color token while preserving arbitrary color strings. */\nfunction resolveColor(theme: SurfaceTheme, value: ColorValue | undefined): string | undefined {\n return resolveToken(theme.colors, value);\n}\n\n/*** Resolves spacing-token dimensions while preserving raw dimension strings. */\nfunction resolveDimension(\n theme: SurfaceTheme,\n value: number | string | undefined,\n): number | string | undefined {\n return resolveToken(theme.spacing, value);\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/surface",
3
3
  "type": "module",
4
- "version": "9.1.6",
4
+ "version": "9.1.8",
5
5
  "description": "Stable UI foundation for React Native and React Native Web.",
6
6
  "homepage": "https://github.com/ankhorage/surface#readme",
7
7
  "bugs": {
@@ -28,25 +28,25 @@
28
28
  "ui"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@react-native-vector-icons/fontawesome": "^13.1.3",
32
- "@react-native-vector-icons/fontawesome5": "^13.1.3",
33
- "@react-native-vector-icons/fontawesome6": "^13.1.3",
34
- "@react-native-vector-icons/ionicons": "^13.1.3",
35
- "@react-native-vector-icons/material-design-icons": "^13.1.3",
36
- "react": "19.2.3",
37
- "react-native": "0.86.x",
38
- "react-native-gesture-handler": "~2.32.0",
39
- "react-native-reanimated": "4.5.1",
40
- "react-native-safe-area-context": "~5.7.0",
41
- "react-native-svg": "15.15.4",
42
- "react-native-web": "~0.21.0",
43
- "react-native-worklets": "0.10.1"
31
+ "@react-native-vector-icons/fontawesome": "^13.1.4",
32
+ "@react-native-vector-icons/fontawesome5": "^13.1.4",
33
+ "@react-native-vector-icons/fontawesome6": "^13.1.4",
34
+ "@react-native-vector-icons/ionicons": "^13.1.4",
35
+ "@react-native-vector-icons/material-design-icons": "^13.1.4",
36
+ "react": "19.3.0",
37
+ "react-native": "0.87.1",
38
+ "react-native-gesture-handler": "~3.3.0",
39
+ "react-native-reanimated": "4.7.0",
40
+ "react-native-safe-area-context": "~5.10.0",
41
+ "react-native-svg": "15.15.5",
42
+ "react-native-web": "~0.21.3",
43
+ "react-native-worklets": "0.13.0"
44
44
  },
45
45
  "dependencies": {
46
46
  "@ankhorage/color-theory": "^0.3.1",
47
- "@ankhorage/contracts": "^22.8.1",
48
- "@ankhorage/utility": "^1.8.0",
49
- "@gorhom/bottom-sheet": "^5.2.13"
47
+ "@ankhorage/contracts": "^22.8.2",
48
+ "@ankhorage/utility": "^1.9.0",
49
+ "@gorhom/bottom-sheet": "^5.2.14"
50
50
  },
51
51
  "files": [
52
52
  "dist",
@@ -107,28 +107,28 @@
107
107
  "version-packages": "ankhorage-changeset version"
108
108
  },
109
109
  "devDependencies": {
110
- "@ankhorage/devtools": "^1.18.5",
111
- "@ankhorage/paradox": "^0.1.26",
112
- "@react-native-vector-icons/fontawesome": "^13.1.3",
113
- "@react-native-vector-icons/fontawesome5": "^13.1.3",
114
- "@react-native-vector-icons/fontawesome6": "^13.1.3",
115
- "@react-native-vector-icons/ionicons": "^13.1.3",
116
- "@react-native-vector-icons/material-design-icons": "^13.1.3",
117
- "@types/bun": "^1.4.1",
118
- "@types/node": "^24.13.3",
119
- "@types/react": "^19.2.18",
120
- "@types/react-dom": "^19.2.4",
121
- "@types/react-native-web": "^0.19.2",
122
- "happy-dom": "^20.11.6",
123
- "react": "19.2.3",
124
- "react-dom": "19.2.3",
125
- "react-native": "0.86.3",
126
- "react-native-gesture-handler": "~2.32.0",
127
- "react-native-reanimated": "4.5.1",
128
- "react-native-safe-area-context": "~5.7.0",
129
- "react-native-svg": "15.15.4",
130
- "react-native-web": "~0.21.0",
131
- "react-native-worklets": "0.10.1",
110
+ "@ankhorage/devtools": "^2.0.19",
111
+ "@ankhorage/paradox": "^0.2.8",
112
+ "@react-native-vector-icons/fontawesome": "^13.1.4",
113
+ "@react-native-vector-icons/fontawesome5": "^13.1.4",
114
+ "@react-native-vector-icons/fontawesome6": "^13.1.4",
115
+ "@react-native-vector-icons/ionicons": "^13.1.4",
116
+ "@react-native-vector-icons/material-design-icons": "^13.1.4",
117
+ "@types/bun": "^1.4.2",
118
+ "@types/node": "^26.6.3",
119
+ "@types/react": "^19.3.0",
120
+ "@types/react-dom": "^19.3.0",
121
+ "@types/react-native-web": "^0.19.3",
122
+ "happy-dom": "^20.14.5",
123
+ "react": "19.3.0",
124
+ "react-dom": "19.3.0",
125
+ "react-native": "0.87.1",
126
+ "react-native-gesture-handler": "~3.3.0",
127
+ "react-native-reanimated": "4.7.0",
128
+ "react-native-safe-area-context": "~5.10.0",
129
+ "react-native-svg": "15.15.5",
130
+ "react-native-web": "~0.21.3",
131
+ "react-native-worklets": "0.13.0",
132
132
  "typescript": "~6.0.3"
133
133
  },
134
134
  "packageManager": "bun@1.4.2"
@@ -6,6 +6,7 @@ import { MaterialDesignIcons } from '@react-native-vector-icons/material-design-
6
6
  import React from 'react';
7
7
  import {
8
8
  Image,
9
+ type ImageURISource,
9
10
  type StyleProp,
10
11
  StyleSheet,
11
12
  type TextStyle,
@@ -64,11 +65,14 @@ const styles = StyleSheet.create({ bundledSvgImage: { height: '100%', width: '10
64
65
  /*** Resolves an SVG URI directly or through React Native's bundled-asset API. */
65
66
  function resolveSvgIconUri(source: SurfaceImageSource): string | null {
66
67
  if (typeof source === 'string') return source;
67
- if (!Array.isArray(source) && typeof source === 'object' && typeof source.uri === 'string') {
68
- return source.uri;
69
- }
68
+ if (isImageUriSource(source) && typeof source.uri === 'string') return source.uri;
70
69
  if (typeof Image.resolveAssetSource !== 'function') return null;
71
- return Image.resolveAssetSource(source).uri;
70
+ return Image.resolveAssetSource(source)?.uri ?? null;
71
+ }
72
+
73
+ /*** Narrows a React Native image source to one URI-bearing source object. */
74
+ function isImageUriSource(source: Exclude<SurfaceImageSource, string>): source is ImageURISource {
75
+ return typeof source === 'object' && 'uri' in source;
72
76
  }
73
77
 
74
78
  /*** Renders URI-backed SVGs and bundled SVG image assets. */
@@ -1,4 +1,4 @@
1
- import type { ImageSourcePropType } from 'react-native';
1
+ import type { ImageSourcePropType, ImageURISource } from 'react-native';
2
2
 
3
3
  import type { SurfaceImageSource } from '../../../types/image';
4
4
 
@@ -7,7 +7,7 @@ export function getSourceKey(source: SurfaceImageSource | null | undefined): str
7
7
  if (source === null || source === undefined) return null;
8
8
  if (typeof source === 'string') return `uri:${source}`;
9
9
  if (typeof source === 'number') return `asset:${source}`;
10
- if (Array.isArray(source)) {
10
+ if (isImageUriSourceList(source)) {
11
11
  const parts = source
12
12
  .map((item) => item.uri)
13
13
  .filter((value): value is string => typeof value === 'string');
@@ -26,7 +26,17 @@ export function getSourceKey(source: SurfaceImageSource | null | undefined): str
26
26
 
27
27
  /*** Reads the first URI represented by a React Native image source. */
28
28
  function getUriFromSource(source: ImageSourcePropType): string | undefined {
29
- if (Array.isArray(source)) return source[0]?.uri;
29
+ if (isImageUriSourceList(source)) return source[0]?.uri;
30
30
  if (typeof source === 'number') return undefined;
31
- return source.uri;
31
+ return isImageUriSource(source) ? source.uri : undefined;
32
+ }
33
+
34
+ /*** Narrows a React Native image source to one URI-bearing source object. */
35
+ function isImageUriSource(source: ImageSourcePropType): source is ImageURISource {
36
+ return typeof source === 'object' && 'uri' in source;
37
+ }
38
+
39
+ /*** Narrows a React Native image source to the readonly multi-source form. */
40
+ function isImageUriSourceList(source: ImageSourcePropType): source is readonly ImageURISource[] {
41
+ return Array.isArray(source);
32
42
  }
@@ -7,7 +7,7 @@ import { PopoverOverlay } from './PopoverOverlay';
7
7
 
8
8
  /*** Renders anchored overlay content through the shared Surface overlay stack. */
9
9
  export function Popover(props: PopoverProps) {
10
- const anchorRef = React.useRef<View | null>(null);
10
+ const anchorRef = React.useRef<React.ElementRef<typeof View> | null>(null);
11
11
  const [resolvedOpen, setResolvedOpen] = useControllableState<boolean>({
12
12
  defaultValue: props.defaultOpen ?? false,
13
13
  onChange: props.onOpenChange,
@@ -47,7 +47,7 @@ export function PopoverOverlay({
47
47
  }
48
48
 
49
49
  interface PopoverOverlayProps {
50
- anchorRef: React.RefObject<View | null>;
50
+ anchorRef: React.RefObject<React.ElementRef<typeof View> | null>;
51
51
  children?: React.ReactNode;
52
52
  closeOnOutsidePress: boolean;
53
53
  offset: number;
@@ -44,7 +44,7 @@ export function usePopoverLayout({ anchorRef, offset, open, placement }: UsePopo
44
44
  }
45
45
 
46
46
  interface UsePopoverLayoutInput {
47
- anchorRef: React.RefObject<View | null>;
47
+ anchorRef: React.RefObject<React.ElementRef<typeof View> | null>;
48
48
  offset: number;
49
49
  open: boolean;
50
50
  placement: PopoverPlacement;
@@ -4,7 +4,13 @@ import type { Pressable } from 'react-native';
4
4
  import { useTabsContext } from './useTabsContext';
5
5
 
6
6
  /*** Registers one focusable tab with the owning Tabs context. */
7
- export function useTabRegistration({ disabled, value }: { disabled: boolean; value: string }) {
7
+ export function useTabRegistration({
8
+ disabled,
9
+ value,
10
+ }: {
11
+ disabled: boolean;
12
+ value: string;
13
+ }): React.RefObject<React.ElementRef<typeof Pressable> | null> {
8
14
  const { registerTab, unregisterTab } = useTabsContext();
9
15
  const pressableRef = React.useRef<React.ElementRef<typeof Pressable> | null>(null);
10
16
 
package/src/index.test.ts CHANGED
@@ -149,19 +149,34 @@ describe('public package metadata contract', () => {
149
149
  });
150
150
  });
151
151
 
152
- it('supports RN 0.86 patches while validating the canonical RN 0.86.3 baseline', () => {
153
- expect(packageJson.peerDependencies['react-native']).toBe('0.86.x');
154
- expect(packageJson.devDependencies['react-native']).toBe('0.86.3');
155
- expect(packageJson.peerDependencies['react-native-svg']).toBe('15.15.4');
156
- expect(packageJson.devDependencies['react-native-svg']).toBe('15.15.4');
152
+ it('keeps React Native runtime peers aligned with the tested development baseline', () => {
153
+ expect(packageJson.peerDependencies['react-native']).toMatch(/^\d+\.\d+\.\d+$/);
154
+ expect(packageJson.devDependencies['react-native']).toBe(
155
+ packageJson.peerDependencies['react-native'],
156
+ );
157
+ expect(packageJson.peerDependencies['react-native-svg']).toMatch(/^\d+\.\d+\.\d+$/);
158
+ expect(packageJson.devDependencies['react-native-svg']).toBe(
159
+ packageJson.peerDependencies['react-native-svg'],
160
+ );
157
161
  });
158
162
  });
159
163
 
160
164
  describe('bottom-sheet package contract', () => {
161
- it('keeps the implementation and Expo 57 runtime boundary explicit', () => {
165
+ it('keeps the implementation and native runtime boundaries explicit', () => {
162
166
  expect(packageJson.dependencies['@gorhom/bottom-sheet']).toMatch(/^\^5\./);
163
- expect(packageJson.peerDependencies['react-native-gesture-handler']).toMatch(/^~2\.32\./);
164
- expect(packageJson.peerDependencies['react-native-reanimated']).toBe('4.5.1');
165
- expect(packageJson.peerDependencies['react-native-worklets']).toBe('0.10.1');
167
+ expect(packageJson.peerDependencies['react-native-gesture-handler']).toMatch(
168
+ /^~\d+\.\d+\.\d+$/,
169
+ );
170
+ expect(packageJson.devDependencies['react-native-gesture-handler']).toBe(
171
+ packageJson.peerDependencies['react-native-gesture-handler'],
172
+ );
173
+ expect(packageJson.peerDependencies['react-native-reanimated']).toMatch(/^\d+\.\d+\.\d+$/);
174
+ expect(packageJson.devDependencies['react-native-reanimated']).toBe(
175
+ packageJson.peerDependencies['react-native-reanimated'],
176
+ );
177
+ expect(packageJson.peerDependencies['react-native-worklets']).toMatch(/^\d+\.\d+\.\d+$/);
178
+ expect(packageJson.devDependencies['react-native-worklets']).toBe(
179
+ packageJson.peerDependencies['react-native-worklets'],
180
+ );
166
181
  });
167
182
  });
@@ -11,7 +11,7 @@ export interface FocusScopeProps {
11
11
  }
12
12
 
13
13
  export function FocusScope({ active, children, onEscape, testID }: FocusScopeProps) {
14
- const containerRef = React.useRef<View | null>(null);
14
+ const containerRef = React.useRef<React.ElementRef<typeof View> | null>(null);
15
15
  const { bindKeydown, capturePreviousFocus, cycleFocus, focusFirst, restorePreviousFocus } =
16
16
  useFocusManager();
17
17
 
@@ -70,30 +70,12 @@ function resolveDimensionStyles(
70
70
  props: ViewStyleProps,
71
71
  ): ViewStyle {
72
72
  return {
73
- width: resolveDimension(
74
- theme,
75
- resolveResponsive(props.width, breakpoint),
76
- ) as ViewStyle['width'],
77
- height: resolveDimension(
78
- theme,
79
- resolveResponsive(props.height, breakpoint),
80
- ) as ViewStyle['height'],
81
- minWidth: resolveDimension(
82
- theme,
83
- resolveResponsive(props.minWidth, breakpoint),
84
- ) as ViewStyle['minWidth'],
85
- maxWidth: resolveDimension(
86
- theme,
87
- resolveResponsive(props.maxWidth, breakpoint),
88
- ) as ViewStyle['maxWidth'],
89
- minHeight: resolveDimension(
90
- theme,
91
- resolveResponsive(props.minHeight, breakpoint),
92
- ) as ViewStyle['minHeight'],
93
- maxHeight: resolveDimension(
94
- theme,
95
- resolveResponsive(props.maxHeight, breakpoint),
96
- ) as ViewStyle['maxHeight'],
73
+ width: resolveDimension(theme, resolveResponsive(props.width, breakpoint)),
74
+ height: resolveDimension(theme, resolveResponsive(props.height, breakpoint)),
75
+ minWidth: resolveDimension(theme, resolveResponsive(props.minWidth, breakpoint)),
76
+ maxWidth: resolveDimension(theme, resolveResponsive(props.maxWidth, breakpoint)),
77
+ minHeight: resolveDimension(theme, resolveResponsive(props.minHeight, breakpoint)),
78
+ maxHeight: resolveDimension(theme, resolveResponsive(props.maxHeight, breakpoint)),
97
79
  };
98
80
  }
99
81
 
@@ -103,7 +85,7 @@ function resolveLayoutStyles(breakpoint: Breakpoint, props: ViewStyleProps): Vie
103
85
  flex: resolveResponsive(props.flex, breakpoint),
104
86
  flexGrow: resolveResponsive(props.flexGrow, breakpoint),
105
87
  flexShrink: resolveResponsive(props.flexShrink, breakpoint),
106
- flexBasis: resolveResponsive(props.flexBasis, breakpoint) as ViewStyle['flexBasis'],
88
+ flexBasis: resolveResponsive(props.flexBasis, breakpoint),
107
89
  flexDirection: resolveResponsive(props.direction, breakpoint),
108
90
  alignItems: resolveResponsive(props.align, breakpoint),
109
91
  justifyContent: resolveResponsive(props.justify, breakpoint),