@ankhorage/surface 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -2
  3. package/dist/components/action-sheet/ActionSheet.d.ts.map +1 -1
  4. package/dist/components/action-sheet/ActionSheet.js +12 -7
  5. package/dist/components/action-sheet/ActionSheet.js.map +1 -1
  6. package/dist/components/button/Button.d.ts.map +1 -1
  7. package/dist/components/button/Button.js +5 -7
  8. package/dist/components/button/Button.js.map +1 -1
  9. package/dist/components/button/types.d.ts +2 -5
  10. package/dist/components/button/types.d.ts.map +1 -1
  11. package/dist/components/button/types.js.map +1 -1
  12. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  13. package/dist/components/drawer/Drawer.js +12 -7
  14. package/dist/components/drawer/Drawer.js.map +1 -1
  15. package/dist/components/icon-button/IconButton.d.ts.map +1 -1
  16. package/dist/components/icon-button/IconButton.js +1 -1
  17. package/dist/components/icon-button/IconButton.js.map +1 -1
  18. package/dist/components/icon-button/types.d.ts +2 -5
  19. package/dist/components/icon-button/types.d.ts.map +1 -1
  20. package/dist/components/icon-button/types.js.map +1 -1
  21. package/dist/components/menu/Menu.d.ts.map +1 -1
  22. package/dist/components/menu/Menu.js +12 -7
  23. package/dist/components/menu/Menu.js.map +1 -1
  24. package/dist/components/modal/Modal.d.ts.map +1 -1
  25. package/dist/components/modal/Modal.js +12 -7
  26. package/dist/components/modal/Modal.js.map +1 -1
  27. package/dist/components/navigation/NavigationItem.d.ts.map +1 -1
  28. package/dist/components/navigation/NavigationItem.js +1 -1
  29. package/dist/components/navigation/NavigationItem.js.map +1 -1
  30. package/dist/components/navigation/TabBarItem.d.ts.map +1 -1
  31. package/dist/components/navigation/TabBarItem.js +1 -1
  32. package/dist/components/navigation/TabBarItem.js.map +1 -1
  33. package/dist/components/navigation/types.d.ts +2 -2
  34. package/dist/components/navigation/types.d.ts.map +1 -1
  35. package/dist/components/navigation/types.js.map +1 -1
  36. package/dist/components/toast/ToastProvider.d.ts.map +1 -1
  37. package/dist/components/toast/ToastProvider.js +3 -2
  38. package/dist/components/toast/ToastProvider.js.map +1 -1
  39. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  40. package/dist/components/tooltip/Tooltip.js +10 -5
  41. package/dist/components/tooltip/Tooltip.js.map +1 -1
  42. package/dist/context/TranslationContext.d.ts.map +1 -1
  43. package/dist/context/TranslationContext.js +3 -3
  44. package/dist/context/TranslationContext.js.map +1 -1
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/internal/overlay/OverlayProvider.d.ts.map +1 -1
  50. package/dist/internal/overlay/OverlayProvider.js +17 -16
  51. package/dist/internal/overlay/OverlayProvider.js.map +1 -1
  52. package/dist/internal/overlay/Portal.d.ts.map +1 -1
  53. package/dist/internal/overlay/Portal.js +2 -1
  54. package/dist/internal/overlay/Portal.js.map +1 -1
  55. package/dist/internal/resolvePointerEvents.d.ts +9 -0
  56. package/dist/internal/resolvePointerEvents.d.ts.map +1 -0
  57. package/dist/internal/resolvePointerEvents.js +17 -0
  58. package/dist/internal/resolvePointerEvents.js.map +1 -0
  59. package/dist/layout/AppBar.js +1 -1
  60. package/dist/layout/AppBar.js.map +1 -1
  61. package/dist/layout/Box.d.ts.map +1 -1
  62. package/dist/layout/Box.js +4 -22
  63. package/dist/layout/Box.js.map +1 -1
  64. package/dist/layout/Grid.js.map +1 -1
  65. package/dist/layout/Stack.d.ts +1 -1
  66. package/dist/layout/Stack.d.ts.map +1 -1
  67. package/dist/layout/Stack.js +2 -13
  68. package/dist/layout/Stack.js.map +1 -1
  69. package/dist/primitives/icon/Icon.d.ts +5 -12
  70. package/dist/primitives/icon/Icon.d.ts.map +1 -1
  71. package/dist/primitives/icon/Icon.js +5 -11
  72. package/dist/primitives/icon/Icon.js.map +1 -1
  73. package/dist/primitives/icon/PortableIcon.d.ts +51 -0
  74. package/dist/primitives/icon/PortableIcon.d.ts.map +1 -0
  75. package/dist/primitives/icon/PortableIcon.js +64 -0
  76. package/dist/primitives/icon/PortableIcon.js.map +1 -0
  77. package/dist/primitives/icon/index.d.ts +2 -1
  78. package/dist/primitives/icon/index.d.ts.map +1 -1
  79. package/dist/primitives/icon/index.js +1 -0
  80. package/dist/primitives/icon/index.js.map +1 -1
  81. package/dist/primitives/image/Image.d.ts.map +1 -1
  82. package/dist/primitives/image/Image.js +3 -5
  83. package/dist/primitives/image/Image.js.map +1 -1
  84. package/package.json +30 -27
  85. package/src/components/action-sheet/ActionSheet.tsx +14 -8
  86. package/src/components/button/Button.tsx +5 -17
  87. package/src/components/button/types.ts +2 -5
  88. package/src/components/drawer/Drawer.tsx +14 -8
  89. package/src/components/icon-button/IconButton.tsx +1 -6
  90. package/src/components/icon-button/types.ts +2 -5
  91. package/src/components/menu/Menu.tsx +14 -8
  92. package/src/components/modal/Modal.tsx +14 -8
  93. package/src/components/navigation/NavigationItem.tsx +1 -6
  94. package/src/components/navigation/TabBarItem.tsx +1 -6
  95. package/src/components/navigation/types.ts +2 -2
  96. package/src/components/toast/ToastProvider.tsx +3 -2
  97. package/src/components/tooltip/Tooltip.tsx +12 -6
  98. package/src/context/TranslationContext.tsx +12 -15
  99. package/src/index.test.ts +1 -0
  100. package/src/index.ts +2 -2
  101. package/src/internal/overlay/OverlayProvider.tsx +20 -20
  102. package/src/internal/overlay/Portal.tsx +2 -1
  103. package/src/internal/resolvePointerEvents.test.ts +19 -0
  104. package/src/internal/resolvePointerEvents.ts +29 -0
  105. package/src/layout/AppBar.tsx +1 -1
  106. package/src/layout/Box.tsx +5 -36
  107. package/src/layout/Grid.tsx +3 -3
  108. package/src/layout/Stack.test.ts +14 -0
  109. package/src/layout/Stack.tsx +3 -17
  110. package/src/primitives/icon/Icon.tsx +9 -22
  111. package/src/primitives/icon/PortableIcon.tsx +112 -0
  112. package/src/primitives/icon/PortableIcon.web.test.tsx +119 -0
  113. package/src/primitives/icon/index.ts +2 -1
  114. package/src/primitives/image/Image.tsx +3 -6
  115. package/src/theme/colorEngine.test.ts +2 -2
  116. package/src/webAcceptance.test.tsx +84 -0
  117. package/dist/primitives/icon/resolveExpoIconComponent.d.ts +0 -11
  118. package/dist/primitives/icon/resolveExpoIconComponent.d.ts.map +0 -1
  119. package/dist/primitives/icon/resolveExpoIconComponent.js +0 -20
  120. package/dist/primitives/icon/resolveExpoIconComponent.js.map +0 -1
  121. package/src/primitives/icon/resolveExpoIconComponent.test.ts +0 -45
  122. package/src/primitives/icon/resolveExpoIconComponent.ts +0 -33
@@ -1,33 +1,15 @@
1
1
  import React from 'react';
2
- import { Platform, View, } from 'react-native';
2
+ import { View } from 'react-native';
3
3
  import { useResponsiveRuntime } from '../core/responsive';
4
+ import { resolvePointerEvents } from '../internal/resolvePointerEvents';
4
5
  import { useTheme } from '../theme/ThemeContext';
5
6
  import { resolveBoxStyles } from './helpers';
6
- function resolvePointerEventsStyle(pointerEvents) {
7
- if (Platform.OS !== 'web' || pointerEvents === undefined)
8
- return null;
9
- if (pointerEvents === 'auto' || pointerEvents === 'none') {
10
- return { pointerEvents };
11
- }
12
- return null;
13
- }
14
- function resolveViewPointerEvents(pointerEvents) {
15
- if (pointerEvents === undefined)
16
- return undefined;
17
- if (Platform.OS !== 'web')
18
- return pointerEvents;
19
- if (pointerEvents === 'box-none' || pointerEvents === 'box-only') {
20
- return pointerEvents;
21
- }
22
- return undefined;
23
- }
24
7
  export function Box({ accessible, accessibilityLabel, accessibilityRole, accessibilityState, children, pointerEvents, style, testID, ...props }) {
25
8
  const { theme } = useTheme();
26
9
  const { breakpoint } = useResponsiveRuntime();
27
10
  const resolved = resolveBoxStyles(theme, breakpoint, props);
28
- const pointerEventsStyle = resolvePointerEventsStyle(pointerEvents);
29
- const viewPointerEvents = resolveViewPointerEvents(pointerEvents);
30
- return (<View accessible={accessible} accessibilityLabel={accessibilityLabel} accessibilityRole={accessibilityRole} accessibilityState={accessibilityState} pointerEvents={viewPointerEvents} testID={testID} style={[resolved, pointerEventsStyle, style]}>
11
+ const resolvedPointerEvents = pointerEvents ? resolvePointerEvents(pointerEvents) : null;
12
+ return (<View {...resolvedPointerEvents?.props} accessible={accessible} accessibilityLabel={accessibilityLabel} accessibilityRole={accessibilityRole} accessibilityState={accessibilityState} testID={testID} style={[resolved, resolvedPointerEvents?.style, style]}>
31
13
  {children}
32
14
  </View>);
33
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Box.js","sourceRoot":"","sources":["../../src/layout/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EAER,IAAI,GAGL,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAsB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAYjE,SAAS,yBAAyB,CAChC,aAAgE;IAEhE,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,aAAa,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAEtE,IAAI,aAAa,KAAK,MAAM,IAAI,aAAa,KAAK,MAAM,EAAE,CAAC;QACzD,OAAO,EAAE,aAAa,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,wBAAwB,CAC/B,aAAgE;IAEhE,IAAI,aAAa,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAClD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,aAAa,CAAC;IAEhD,IAAI,aAAa,KAAK,UAAU,IAAI,aAAa,KAAK,UAAU,EAAE,CAAC;QACjE,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,EAClB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACC;IACT,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAC5D,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,aAAa,CAAC,CAAC;IACpE,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,aAAa,CAAC,CAAC;IAElE,OAAO,CACL,CAAC,IAAI,CACH,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,aAAa,CAAC,CAAC,iBAAiB,CAAC,CACjC,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC,CAE7C;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport {\n Platform,\n type StyleProp,\n View,\n type ViewProps as ReactNativeViewProps,\n type ViewStyle,\n} from 'react-native';\n\nimport { useResponsiveRuntime } from '../core/responsive';\nimport { useTheme } from '../theme/ThemeContext';\nimport { type BoxStyleProps, resolveBoxStyles } from './helpers';\n\nexport interface BoxProps extends BoxStyleProps {\n accessibilityLabel?: ReactNativeViewProps['accessibilityLabel'];\n accessibilityRole?: ReactNativeViewProps['accessibilityRole'];\n accessibilityState?: ReactNativeViewProps['accessibilityState'];\n accessible?: ReactNativeViewProps['accessible'];\n children?: React.ReactNode;\n pointerEvents?: ReactNativeViewProps['pointerEvents'];\n testID?: string;\n}\n\nfunction resolvePointerEventsStyle(\n pointerEvents: ReactNativeViewProps['pointerEvents'] | undefined,\n): StyleProp<ViewStyle> | null {\n if (Platform.OS !== 'web' || pointerEvents === undefined) return null;\n\n if (pointerEvents === 'auto' || pointerEvents === 'none') {\n return { pointerEvents };\n }\n\n return null;\n}\n\nfunction resolveViewPointerEvents(\n pointerEvents: ReactNativeViewProps['pointerEvents'] | undefined,\n): ReactNativeViewProps['pointerEvents'] | undefined {\n if (pointerEvents === undefined) return undefined;\n if (Platform.OS !== 'web') return pointerEvents;\n\n if (pointerEvents === 'box-none' || pointerEvents === 'box-only') {\n return pointerEvents;\n }\n\n return undefined;\n}\n\nexport function Box({\n accessible,\n accessibilityLabel,\n accessibilityRole,\n accessibilityState,\n children,\n pointerEvents,\n style,\n testID,\n ...props\n}: BoxProps) {\n const { theme } = useTheme();\n const { breakpoint } = useResponsiveRuntime();\n const resolved = resolveBoxStyles(theme, breakpoint, props);\n const pointerEventsStyle = resolvePointerEventsStyle(pointerEvents);\n const viewPointerEvents = resolveViewPointerEvents(pointerEvents);\n\n return (\n <View\n accessible={accessible}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole}\n accessibilityState={accessibilityState}\n pointerEvents={viewPointerEvents}\n testID={testID}\n style={[resolved, pointerEventsStyle, style]}\n >\n {children}\n </View>\n );\n}\n"]}
1
+ {"version":3,"file":"Box.js","sourceRoot":"","sources":["../../src/layout/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAA0C,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAsB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAYjE,MAAM,UAAU,GAAG,CAAC,EAClB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACC;IACT,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAC5D,MAAM,qBAAqB,GAAG,aAAa,CAAC,CAAC,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzF,OAAO,CACL,CAAC,IAAI,CACH,IAAI,qBAAqB,EAAE,KAAK,CAAC,CACjC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAEvD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View, type ViewProps as ReactNativeViewProps } from 'react-native';\n\nimport { useResponsiveRuntime } from '../core/responsive';\nimport { resolvePointerEvents } from '../internal/resolvePointerEvents';\nimport { useTheme } from '../theme/ThemeContext';\nimport { type BoxStyleProps, resolveBoxStyles } from './helpers';\n\nexport interface BoxProps extends BoxStyleProps {\n accessibilityLabel?: ReactNativeViewProps['accessibilityLabel'];\n accessibilityRole?: ReactNativeViewProps['accessibilityRole'];\n accessibilityState?: ReactNativeViewProps['accessibilityState'];\n accessible?: ReactNativeViewProps['accessible'];\n children?: React.ReactNode;\n pointerEvents?: ReactNativeViewProps['pointerEvents'];\n testID?: string;\n}\n\nexport function Box({\n accessible,\n accessibilityLabel,\n accessibilityRole,\n accessibilityState,\n children,\n pointerEvents,\n style,\n testID,\n ...props\n}: BoxProps) {\n const { theme } = useTheme();\n const { breakpoint } = useResponsiveRuntime();\n const resolved = resolveBoxStyles(theme, breakpoint, props);\n const resolvedPointerEvents = pointerEvents ? resolvePointerEvents(pointerEvents) : null;\n\n return (\n <View\n {...resolvedPointerEvents?.props}\n accessible={accessible}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole}\n accessibilityState={accessibilityState}\n testID={testID}\n style={[resolved, resolvedPointerEvents?.style, style]}\n >\n {children}\n </View>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.js","sourceRoot":"","sources":["../../src/layout/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAmB,MAAM,WAAW,CAAC;AAW5D,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,IAAI,EACJ,GAAG,GAAG,CAAC,EACP,MAAM,EACN,MAAM,EACN,YAAY,EACZ,GAAG,KAAK,EACE;IACV,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAE9C,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CA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AAQ,EAAE,CAAC;iBACZ;gBACH,CAAC,CAAC;oBACE,KAAK,EAAE,YAAkC;oBACzC,SAAS,EAAE,YAAsC;iBAClD,CAAC;YAER,OAAO,CACL,CAAC,IAAI,CACH,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CACnB,KAAK,CAAC,CAAC;oBACL,UAAU,EAAE,UAAU,GAAG,CAAC;oBAC1B,aAAa,EAAE,UAAU,GAAG,CAAC;oBAC7B,WAAW,EAAE,UAAU,GAAG,CAAC;oBAC3B,YAAY,EAAE,UAAU,GAAG,CAAC;oBAC5B,GAAG,SAAS;iBACb,CAAC,CAEF;cAAA,CAAC,IAAI,CACP;YAAA,EAAE,IAAI,CAAC,CACR,CAAC;QACJ,CAAC,CAAC,CACJ;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View, type ViewStyle } from 'react-native';\n\nimport { resolveResponsive, type Responsive, useResponsiveRuntime } from '../core/responsive';\nimport { useTheme } from '../theme/ThemeContext';\nimport { Box, type BoxProps } from './Box';\nimport { resolveSpacing, type SpaceValue } from './helpers';\n\nexport interface GridProps extends Omit<BoxProps, 'children'> {\n children?: React.ReactNode;\n cols: Responsive<number>;\n gap?: Responsive<SpaceValue>;\n rowGap?: Responsive<SpaceValue>;\n colGap?: Responsive<SpaceValue>;\n minItemWidth?: Responsive<number>;\n}\n\nexport function Grid({\n children,\n cols,\n gap = 0,\n rowGap,\n colGap,\n minItemWidth,\n ...props\n}: GridProps) {\n const { theme } = useTheme();\n const { breakpoint } = useResponsiveRuntime();\n\n const activeCols = Math.max(1, Math.floor(resolveResponsive(cols, breakpoint) ?? 1));\n const defaultGap = resolveResponsive(gap, breakpoint) ?? 0;\n const activeRowGap = resolveResponsive(rowGap, breakpoint) ?? defaultGap;\n const activeColGap = resolveResponsive(colGap, breakpoint) ?? defaultGap;\n const rowSpacing = Number(resolveSpacing(theme, activeRowGap) ?? 0);\n const colSpacing = Number(resolveSpacing(theme, activeColGap) ?? 0);\n const activeMinItemWidth = resolveResponsive(minItemWidth, breakpoint);\n\n const basisPercent = `${100 / activeCols}%`;\n const nodes = React.Children.toArray(children);\n\n return (\n <Box {...props}>\n <View\n style={{\n flexDirection: 'row',\n flexWrap: 'wrap',\n marginTop: -rowSpacing / 2,\n marginLeft: -colSpacing / 2,\n marginRight: -colSpacing / 2,\n }}\n >\n {nodes.map((node, index) => {\n const itemStyle: ViewStyle =\n activeMinItemWidth !== undefined\n ? {\n minWidth: activeMinItemWidth,\n flexBasis: activeMinItemWidth,\n flexGrow: 1,\n }\n : {\n width: basisPercent as ViewStyle['width'],\n flexBasis: basisPercent as ViewStyle['flexBasis'],\n };\n\n return (\n <View\n key={String(index)}\n style={{\n paddingTop: rowSpacing / 2,\n paddingBottom: rowSpacing / 2,\n paddingLeft: colSpacing / 2,\n paddingRight: colSpacing / 2,\n ...itemStyle,\n }}\n >\n {node}\n </View>\n );\n })}\n </View>\n </Box>\n );\n}\n"]}
1
+ {"version":3,"file":"Grid.js","sourceRoot":"","sources":["../../src/layout/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAmB,MAAM,WAAW,CAAC;AAW5D,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,IAAI,EACJ,GAAG,GAAG,CAAC,EACP,MAAM,EACN,MAAM,EACN,YAAY,EACZ,GAAG,KAAK,EACE;IACV,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MA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,SAAS,GACb,kBAAkB,KAAK,SAAS;gBAC9B,CAAC,CAAC;oBACE,QAAQ,EAAE,kBAAkB;oBAC5B,SAAS,EAAE,kBAAkB;oBAC7B,QAAQ,EAAE,CAAC;iBACZ;gBACH,CAAC,CAAC;oBACE,KAAK,EAAE,YAAY;oBACnB,SAAS,EAAE,YAAY;iBACxB,CAAC;YAER,OAAO,CACL,CAAC,IAAI,CACH,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CACnB,KAAK,CAAC,CAAC;oBACL,UAAU,EAAE,UAAU,GAAG,CAAC;oBAC1B,aAAa,EAAE,UAAU,GAAG,CAAC;oBAC7B,WAAW,EAAE,UAAU,GAAG,CAAC;oBAC3B,YAAY,EAAE,UAAU,GAAG,CAAC;oBAC5B,GAAG,SAAS;iBACb,CAAC,CAEF;cAAA,CAAC,IAAI,CACP;YAAA,EAAE,IAAI,CAAC,CACR,CAAC;QACJ,CAAC,CAAC,CACJ;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View, type ViewStyle } from 'react-native';\n\nimport { resolveResponsive, type Responsive, useResponsiveRuntime } from '../core/responsive';\nimport { useTheme } from '../theme/ThemeContext';\nimport { Box, type BoxProps } from './Box';\nimport { resolveSpacing, type SpaceValue } from './helpers';\n\nexport interface GridProps extends Omit<BoxProps, 'children'> {\n children?: React.ReactNode;\n cols: Responsive<number>;\n gap?: Responsive<SpaceValue>;\n rowGap?: Responsive<SpaceValue>;\n colGap?: Responsive<SpaceValue>;\n minItemWidth?: Responsive<number>;\n}\n\nexport function Grid({\n children,\n cols,\n gap = 0,\n rowGap,\n colGap,\n minItemWidth,\n ...props\n}: GridProps) {\n const { theme } = useTheme();\n const { breakpoint } = useResponsiveRuntime();\n\n const activeCols = Math.max(1, Math.floor(resolveResponsive(cols, breakpoint) ?? 1));\n const defaultGap = resolveResponsive(gap, breakpoint) ?? 0;\n const activeRowGap = resolveResponsive(rowGap, breakpoint) ?? defaultGap;\n const activeColGap = resolveResponsive(colGap, breakpoint) ?? defaultGap;\n const rowSpacing = Number(resolveSpacing(theme, activeRowGap) ?? 0);\n const colSpacing = Number(resolveSpacing(theme, activeColGap) ?? 0);\n const activeMinItemWidth = resolveResponsive(minItemWidth, breakpoint);\n\n const basisPercent: `${number}%` = `${100 / activeCols}%`;\n const nodes = React.Children.toArray(children);\n\n return (\n <Box {...props}>\n <View\n style={{\n flexDirection: 'row',\n flexWrap: 'wrap',\n marginTop: -rowSpacing / 2,\n marginLeft: -colSpacing / 2,\n marginRight: -colSpacing / 2,\n }}\n >\n {nodes.map((node, index) => {\n const itemStyle: ViewStyle =\n activeMinItemWidth !== undefined\n ? {\n minWidth: activeMinItemWidth,\n flexBasis: activeMinItemWidth,\n flexGrow: 1,\n }\n : {\n width: basisPercent,\n flexBasis: basisPercent,\n };\n\n return (\n <View\n key={String(index)}\n style={{\n paddingTop: rowSpacing / 2,\n paddingBottom: rowSpacing / 2,\n paddingLeft: colSpacing / 2,\n paddingRight: colSpacing / 2,\n ...itemStyle,\n }}\n >\n {node}\n </View>\n );\n })}\n </View>\n </Box>\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  import { type Responsive } from '../core/responsive';
3
3
  import { type BoxProps } from './Box';
4
4
  import { type SpaceValue } from './helpers';
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/layout/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAqB,KAAK,UAAU,EAAwB,MAAM,oBAAoB,CAAC;AAE9F,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,QAAQ,EAAE,U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,GAAG,UAAU,CAAC,CAAC;IAClF,OAAO,CAAC,EAAE,UAAU,CAClB,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,eAAe,GAAG,cAAc,GAAG,cAAc,CACzF,CAAC;IACF,IAAI,CAAC,EAAE,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;CACtC;AAED,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,SAAoB,EACpB,GAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,UAAU,qBA0BZ"}
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
- import { View } from 'react-native';
3
1
  import { resolveResponsive, useResponsiveRuntime } from '../core/responsive';
4
2
  import { useTheme } from '../theme/ThemeContext';
5
3
  import { Box } from './Box';
@@ -12,26 +10,17 @@ export function Stack({ children, direction = 'column', gap = 0, align, justify,
12
10
  const activeAlign = resolveResponsive(align, breakpoint);
13
11
  const activeJustify = resolveResponsive(justify, breakpoint);
14
12
  const activeWrap = resolveResponsive(wrap, breakpoint);
15
- const nodes = React.Children.toArray(children);
16
13
  return (<Box {...props} style={[
17
14
  {
18
15
  flexDirection: activeDirection,
16
+ gap: activeGap,
19
17
  alignItems: activeAlign,
20
18
  justifyContent: activeJustify,
21
19
  flexWrap: activeWrap,
22
20
  },
23
21
  props.style,
24
22
  ]}>
25
- {nodes.map((node, index) => {
26
- const spacing = index === 0
27
- ? undefined
28
- : activeDirection === 'row'
29
- ? { marginLeft: activeGap }
30
- : { marginTop: activeGap };
31
- return (<View key={String(index)} style={spacing}>
32
- {node}
33
- </View>);
34
- })}
23
+ {children}
35
24
  </Box>);
36
25
  }
37
26
  //# sourceMappingURL=Stack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../src/layout/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,C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CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACzB,MAAM,OAAO,GACX,KAAK,KAAK,CAAC;gBACT,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,eAAe,KAAK,KAAK;oBACzB,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE;oBAC3B,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;YACjC,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CACvC;YAAA,CAAC,IAAI,CACP;UAAA,EAAE,IAAI,CAAC,CACR,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { resolveResponsive, type Responsive, useResponsiveRuntime } from '../core/responsive';\nimport { useTheme } from '../theme/ThemeContext';\nimport { Box, type BoxProps } from './Box';\nimport { resolveSpacing, type SpaceValue } from './helpers';\n\nexport interface StackProps extends Omit<BoxProps, 'children'> {\n children?: React.ReactNode;\n direction?: Responsive<'row' | 'column'>;\n gap?: Responsive<SpaceValue>;\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n justify?: Responsive<\n 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'\n >;\n wrap?: Responsive<'nowrap' | 'wrap'>;\n}\n\nexport function Stack({\n children,\n direction = 'column',\n gap = 0,\n align,\n justify,\n wrap,\n ...props\n}: StackProps) {\n const { theme } = useTheme();\n const { breakpoint } = useResponsiveRuntime();\n const activeDirection = resolveResponsive(direction, breakpoint) ?? 'column';\n const activeGap = resolveSpacing(theme, resolveResponsive(gap, breakpoint)) ?? 0;\n const activeAlign = resolveResponsive(align, breakpoint);\n const activeJustify = resolveResponsive(justify, breakpoint);\n const activeWrap = resolveResponsive(wrap, breakpoint);\n\n const nodes = React.Children.toArray(children);\n\n return (\n <Box\n {...props}\n style={[\n {\n flexDirection: activeDirection,\n alignItems: activeAlign,\n justifyContent: activeJustify,\n flexWrap: activeWrap,\n },\n props.style,\n ]}\n >\n {nodes.map((node, index) => {\n const spacing =\n index === 0\n ? undefined\n : activeDirection === 'row'\n ? { marginLeft: activeGap }\n : { marginTop: activeGap };\n return (\n <View key={String(index)} style={spacing}>\n {node}\n </View>\n );\n })}\n </Box>\n );\n}\n"]}
1
+ {"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../src/layout/Stack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAmB,MAAM,WAAW,CAAC;AAa5D,MAAM,UAAU,KAAK,CAAC,EACpB,QAAQ,EACR,SAAS,GAAG,QAAQ,EACpB,GAAG,GAAG,CAAC,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACG;IACX,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAC9C,MAAM,eAAe,GAAG,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,QAAQ,CAAC;IAC7E,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;IACjF,MAAM,WAAW,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAEvD,OAAO,CACL,CAAC,GAAG,CACF,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL;gBACE,aAAa,EAAE,eAAe;gBAC9B,GAAG,EAAE,SAAS;gBACd,UAAU,EAAE,WAAW;gBACvB,cAAc,EAAE,aAAa;gBAC7B,QAAQ,EAAE,UAAU;aACrB;YACD,KAAK,CAAC,KAAK;SACZ,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type React from 'react';\n\nimport { resolveResponsive, type Responsive, useResponsiveRuntime } from '../core/responsive';\nimport { useTheme } from '../theme/ThemeContext';\nimport { Box, type BoxProps } from './Box';\nimport { resolveSpacing, type SpaceValue } from './helpers';\n\nexport interface StackProps extends Omit<BoxProps, 'children'> {\n children?: React.ReactNode;\n direction?: Responsive<'row' | 'column'>;\n gap?: Responsive<SpaceValue>;\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n justify?: Responsive<\n 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'\n >;\n wrap?: Responsive<'nowrap' | 'wrap'>;\n}\n\nexport function Stack({\n children,\n direction = 'column',\n gap = 0,\n align,\n justify,\n wrap,\n ...props\n}: StackProps) {\n const { theme } = useTheme();\n const { breakpoint } = useResponsiveRuntime();\n const activeDirection = resolveResponsive(direction, breakpoint) ?? 'column';\n const activeGap = resolveSpacing(theme, resolveResponsive(gap, breakpoint)) ?? 0;\n const activeAlign = resolveResponsive(align, breakpoint);\n const activeJustify = resolveResponsive(justify, breakpoint);\n const activeWrap = resolveResponsive(wrap, breakpoint);\n\n return (\n <Box\n {...props}\n style={[\n {\n flexDirection: activeDirection,\n gap: activeGap,\n alignItems: activeAlign,\n justifyContent: activeJustify,\n flexWrap: activeWrap,\n },\n props.style,\n ]}\n >\n {children}\n </Box>\n );\n}\n"]}
@@ -1,20 +1,13 @@
1
- import React from 'react';
2
1
  import { type StyleProp, type TextStyle } from 'react-native';
3
2
  import type { SurfaceTheme } from '../../theme/types';
4
- export type IconProvider = string;
5
- export interface IconProps {
6
- name: string;
7
- provider?: IconProvider;
3
+ import { type IconSource } from './PortableIcon';
4
+ export type { IconProvider, IconSource, IconVariant } from './PortableIcon';
5
+ interface IconPresentationProps {
8
6
  size?: keyof SurfaceTheme['spacing'] | number;
9
7
  color?: keyof SurfaceTheme['colors'] | string;
10
8
  style?: StyleProp<TextStyle>;
11
9
  testID?: string;
12
10
  }
13
- export declare function Icon({ name, provider, size, color, style, testID, }: IconProps): React.ReactElement<{
14
- color?: string;
15
- name?: string;
16
- size?: number;
17
- style?: StyleProp<TextStyle>;
18
- testID?: string;
19
- }, string | React.JSXElementConstructor<any>>;
11
+ export type IconProps = IconSource & IconPresentationProps;
12
+ export declare function Icon(props: IconProps): import("react").JSX.Element;
20
13
  //# sourceMappingURL=Icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,QAAqB,EACrB,IAAU,EACV,KAAc,EACd,KAAK,EACL,MAAM,GACP,EAAE,SAAS;;;;;;8CAaX"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,gBAAgB,CAAC;AAE/D,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE5E,UAAU,qBAAqB;IAC7B,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,qBAAqB,CAAC;AAE3D,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAQpC"}
@@ -1,19 +1,13 @@
1
- import React from 'react';
2
1
  import {} from 'react-native';
3
2
  import { resolveToken } from '../../theme/resolveToken';
4
3
  import { useTheme } from '../../theme/ThemeContext';
5
- import { resolveExpoIconComponent } from './resolveExpoIconComponent';
6
- export function Icon({ name, provider = 'Ionicons', size = 'm', color = 'text', style, testID, }) {
4
+ import { PortableIcon } from './PortableIcon';
5
+ export function Icon(props) {
7
6
  const { theme } = useTheme();
8
- const IconComponent = resolveExpoIconComponent(provider);
7
+ const size = props.size ?? 'm';
8
+ const color = props.color ?? 'text';
9
9
  const resolvedSize = typeof size === 'number' ? size : resolveToken(theme.spacing, size);
10
10
  const resolvedColor = resolveToken(theme.colors, color);
11
- return React.createElement(IconComponent, {
12
- color: resolvedColor,
13
- name,
14
- size: resolvedSize,
15
- style,
16
- testID,
17
- });
11
+ return <PortableIcon {...props} color={resolvedColor} size={resolvedSize}/>;
18
12
  }
19
13
  //# sourceMappingURL=Icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/primitives/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkC,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAatE,MAAM,UAAU,IAAI,CAAC,EACnB,IAAI,EACJ,QAAQ,GAAG,UAAU,EACrB,IAAI,GAAG,GAAG,EACV,KAAK,GAAG,MAAM,EACd,KAAK,EACL,MAAM,GACI;IACV,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,aAAa,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzF,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAExD,OAAO,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE;QACxC,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,IAAI,EAAE,YAAY;QAClB,KAAK;QACL,MAAM;KACP,CAAC,CAAC;AACL,CAAC","sourcesContent":["import React from 'react';\nimport { type StyleProp, type TextStyle } from 'react-native';\n\nimport { resolveToken } from '../../theme/resolveToken';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { SurfaceTheme } from '../../theme/types';\nimport { resolveExpoIconComponent } from './resolveExpoIconComponent';\n\nexport type IconProvider = string;\n\nexport interface IconProps {\n name: string;\n provider?: IconProvider;\n size?: keyof SurfaceTheme['spacing'] | number;\n color?: keyof SurfaceTheme['colors'] | string;\n style?: StyleProp<TextStyle>;\n testID?: string;\n}\n\nexport function Icon({\n name,\n provider = 'Ionicons',\n size = 'm',\n color = 'text',\n style,\n testID,\n}: IconProps) {\n const { theme } = useTheme();\n const IconComponent = resolveExpoIconComponent(provider);\n const resolvedSize = typeof size === 'number' ? size : resolveToken(theme.spacing, size);\n const resolvedColor = resolveToken(theme.colors, color);\n\n return React.createElement(IconComponent, {\n color: resolvedColor,\n name,\n size: resolvedSize,\n style,\n testID,\n });\n}\n"]}
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/primitives/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAmB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAa/D,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC;IACpC,MAAM,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzF,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAExD,OAAO,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,EAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { type StyleProp, type TextStyle } from 'react-native';\n\nimport { resolveToken } from '../../theme/resolveToken';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { SurfaceTheme } from '../../theme/types';\nimport { type IconSource, PortableIcon } from './PortableIcon';\n\nexport type { IconProvider, IconSource, IconVariant } from './PortableIcon';\n\ninterface IconPresentationProps {\n size?: keyof SurfaceTheme['spacing'] | number;\n color?: keyof SurfaceTheme['colors'] | string;\n style?: StyleProp<TextStyle>;\n testID?: string;\n}\n\nexport type IconProps = IconSource & IconPresentationProps;\n\nexport function Icon(props: IconProps) {\n const { theme } = useTheme();\n const size = props.size ?? 'm';\n const color = props.color ?? 'text';\n const resolvedSize = typeof size === 'number' ? size : resolveToken(theme.spacing, size);\n const resolvedColor = resolveToken(theme.colors, color);\n\n return <PortableIcon {...props} color={resolvedColor} size={resolvedSize} />;\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import { type FontAwesomeIconName } from '@react-native-vector-icons/fontawesome/static';
2
+ import { type FontAwesome5BrandIconName, type FontAwesome5RegularIconName, type FontAwesome5SolidIconName } from '@react-native-vector-icons/fontawesome5/static';
3
+ import { type FontAwesome6BrandIconName, type FontAwesome6RegularIconName, type FontAwesome6SolidIconName } from '@react-native-vector-icons/fontawesome6/static';
4
+ import { type IoniconsIconName } from '@react-native-vector-icons/ionicons/static';
5
+ import React from 'react';
6
+ import { type StyleProp, type TextStyle } from 'react-native';
7
+ export declare const SUPPORTED_ICON_PROVIDERS: readonly ["Ionicons", "FontAwesome", "FontAwesome5", "FontAwesome6"];
8
+ export type IconProvider = (typeof SUPPORTED_ICON_PROVIDERS)[number];
9
+ export type IconVariant = 'regular' | 'solid' | 'brand';
10
+ export type IconSource = {
11
+ name: IoniconsIconName;
12
+ provider?: 'Ionicons';
13
+ variant?: never;
14
+ } | {
15
+ name: FontAwesomeIconName;
16
+ provider: 'FontAwesome';
17
+ variant?: never;
18
+ } | {
19
+ name: FontAwesome5RegularIconName;
20
+ provider: 'FontAwesome5';
21
+ variant: 'regular';
22
+ } | {
23
+ name: FontAwesome5SolidIconName;
24
+ provider: 'FontAwesome5';
25
+ variant: 'solid';
26
+ } | {
27
+ name: FontAwesome5BrandIconName;
28
+ provider: 'FontAwesome5';
29
+ variant: 'brand';
30
+ } | {
31
+ name: FontAwesome6RegularIconName;
32
+ provider: 'FontAwesome6';
33
+ variant: 'regular';
34
+ } | {
35
+ name: FontAwesome6SolidIconName;
36
+ provider: 'FontAwesome6';
37
+ variant: 'solid';
38
+ } | {
39
+ name: FontAwesome6BrandIconName;
40
+ provider: 'FontAwesome6';
41
+ variant: 'brand';
42
+ };
43
+ type PortableIconProps = IconSource & {
44
+ color: string;
45
+ size: number;
46
+ style?: StyleProp<TextStyle>;
47
+ testID?: string;
48
+ };
49
+ export declare function PortableIcon(props: PortableIconProps): React.JSX.Element;
50
+ export {};
51
+ //# sourceMappingURL=PortableIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortableIcon.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/PortableIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC/B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC/B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAY,KAAK,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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I,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA4CF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAsBpD"}
@@ -0,0 +1,64 @@
1
+ import { FontAwesome, } from '@react-native-vector-icons/fontawesome/static';
2
+ import { FontAwesome5, } from '@react-native-vector-icons/fontawesome5/static';
3
+ import { FontAwesome6, } from '@react-native-vector-icons/fontawesome6/static';
4
+ import { Ionicons } from '@react-native-vector-icons/ionicons/static';
5
+ import React from 'react';
6
+ import {} from 'react-native';
7
+ export const SUPPORTED_ICON_PROVIDERS = [
8
+ 'Ionicons',
9
+ 'FontAwesome',
10
+ 'FontAwesome5',
11
+ 'FontAwesome6',
12
+ ];
13
+ function assertNever(value, configuration) {
14
+ throw new Error(`Unsupported icon ${configuration}: ${String(value)}`);
15
+ }
16
+ function renderFontAwesome5(props, sharedProps) {
17
+ const { variant } = props;
18
+ switch (variant) {
19
+ case 'brand':
20
+ return <FontAwesome5 {...sharedProps} iconStyle="brand" name={props.name}/>;
21
+ case 'regular':
22
+ return <FontAwesome5 {...sharedProps} iconStyle="regular" name={props.name}/>;
23
+ case 'solid':
24
+ return <FontAwesome5 {...sharedProps} iconStyle="solid" name={props.name}/>;
25
+ default:
26
+ return assertNever(variant, 'FontAwesome5 variant');
27
+ }
28
+ }
29
+ function renderFontAwesome6(props, sharedProps) {
30
+ const { variant } = props;
31
+ switch (variant) {
32
+ case 'brand':
33
+ return <FontAwesome6 {...sharedProps} iconStyle="brand" name={props.name}/>;
34
+ case 'regular':
35
+ return <FontAwesome6 {...sharedProps} iconStyle="regular" name={props.name}/>;
36
+ case 'solid':
37
+ return <FontAwesome6 {...sharedProps} iconStyle="solid" name={props.name}/>;
38
+ default:
39
+ return assertNever(variant, 'FontAwesome6 variant');
40
+ }
41
+ }
42
+ export function PortableIcon(props) {
43
+ const { provider } = props;
44
+ const sharedProps = {
45
+ color: props.color,
46
+ size: props.size,
47
+ style: props.style,
48
+ testID: props.testID,
49
+ };
50
+ switch (provider) {
51
+ case undefined:
52
+ case 'Ionicons':
53
+ return <Ionicons {...sharedProps} name={props.name}/>;
54
+ case 'FontAwesome':
55
+ return <FontAwesome {...sharedProps} name={props.name}/>;
56
+ case 'FontAwesome5':
57
+ return renderFontAwesome5(props, sharedProps);
58
+ case 'FontAwesome6':
59
+ return renderFontAwesome6(props, sharedProps);
60
+ default:
61
+ return assertNever(provider, 'provider');
62
+ }
63
+ }
64
+ //# sourceMappingURL=PortableIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortableIcon.js","sourceRoot":"","sources":["../../../src/primitives/icon/PortableIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GAEZ,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,YAAY,GAIb,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,YAAY,GAIb,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAyB,MAAM,4CAA4C,CAAC;AAC7F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkC,MAAM,cAAc,CAAC;AAE9D,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU;IACV,aAAa;IACb,cAAc;IACd,cAAc;CACN,CAAC;AAwBX,SAAS,WAAW,CAAC,KAAY,EAAE,aAAqB;IACtD,MAAM,IAAI,KAAK,CAAC,oBAAoB,aAAa,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,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,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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,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;QAC5D,KAAK,cAAc;YACjB,OAAO,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAChD,KAAK,cAAc;YACjB,OAAO,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAChD;YACE,OAAO,WAAW,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC","sourcesContent":["import {\n FontAwesome,\n type FontAwesomeIconName,\n} from '@react-native-vector-icons/fontawesome/static';\nimport {\n FontAwesome5,\n type FontAwesome5BrandIconName,\n type FontAwesome5RegularIconName,\n type FontAwesome5SolidIconName,\n} from '@react-native-vector-icons/fontawesome5/static';\nimport {\n FontAwesome6,\n type FontAwesome6BrandIconName,\n type FontAwesome6RegularIconName,\n type FontAwesome6SolidIconName,\n} from '@react-native-vector-icons/fontawesome6/static';\nimport { Ionicons, type IoniconsIconName } from '@react-native-vector-icons/ionicons/static';\nimport React from 'react';\nimport { type StyleProp, type TextStyle } from 'react-native';\n\nexport const SUPPORTED_ICON_PROVIDERS = [\n 'Ionicons',\n 'FontAwesome',\n 'FontAwesome5',\n 'FontAwesome6',\n] as const;\n\nexport type IconProvider = (typeof SUPPORTED_ICON_PROVIDERS)[number];\nexport type IconVariant = 'regular' | 'solid' | 'brand';\n\nexport type IconSource =\n | { name: IoniconsIconName; provider?: 'Ionicons'; variant?: never }\n | { name: FontAwesomeIconName; provider: 'FontAwesome'; variant?: never }\n | { name: FontAwesome5RegularIconName; provider: 'FontAwesome5'; variant: 'regular' }\n | { name: FontAwesome5SolidIconName; provider: 'FontAwesome5'; variant: 'solid' }\n | { name: FontAwesome5BrandIconName; provider: 'FontAwesome5'; variant: 'brand' }\n | { name: FontAwesome6RegularIconName; provider: 'FontAwesome6'; variant: 'regular' }\n | { name: FontAwesome6SolidIconName; provider: 'FontAwesome6'; variant: 'solid' }\n | { name: FontAwesome6BrandIconName; provider: 'FontAwesome6'; variant: 'brand' };\n\ntype PortableIconProps = IconSource & {\n color: string;\n size: number;\n style?: StyleProp<TextStyle>;\n testID?: string;\n};\n\ntype SharedIconProps = Pick<PortableIconProps, 'color' | 'size' | 'style' | 'testID'>;\n\nfunction assertNever(value: never, configuration: string): never {\n throw new Error(`Unsupported icon ${configuration}: ${String(value)}`);\n}\n\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\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\nexport function PortableIcon(props: PortableIconProps) {\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 default:\n return assertNever(provider, 'provider');\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
- export type { IconProps, IconProvider } from './Icon';
1
+ export type { IconProps, IconProvider, IconSource, IconVariant } from './Icon';
2
2
  export { Icon } from './Icon';
3
+ export { SUPPORTED_ICON_PROVIDERS } from './PortableIcon';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { Icon } from './Icon';
2
+ export { SUPPORTED_ICON_PROVIDERS } from './PortableIcon';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primitives/icon/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type { IconProps, IconProvider } from './Icon';\nexport { Icon } from './Icon';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primitives/icon/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export type { IconProps, IconProvider, IconSource, IconVariant } from './Icon';\nexport { Icon } from './Icon';\nexport { SUPPORTED_ICON_PROVIDERS } from './PortableIcon';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../src/primitives/image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,cAAc,EACd,GAAG,EACH,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,WAAW,EACX,GAAG,EACH,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,GACR,EAAE,UAAU,4BAsCZ"}
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../src/primitives/image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,cAAc,EACd,GAAG,EACH,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,WAAW,EACX,GAAG,EACH,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,GACR,EAAE,UAAU,4BAmCZ"}
@@ -4,11 +4,9 @@ import { useTheme } from '../../theme/ThemeContext';
4
4
  import { getSourceKey, normalizeSource, resolveAccessibilityLabel, resolveAlt, resolveImageStyle, resolveRenderedSource, resolveResizeMode, } from './resolveImageProps';
5
5
  export function Image({ source, fallbackSource, alt, accessibilityLabel, width, height, aspectRatio, fit, resizeMode, radius, style, testID, onError, }) {
6
6
  const { theme } = useTheme();
7
- const [showFallback, setShowFallback] = React.useState(false);
8
7
  const primaryKey = React.useMemo(() => getSourceKey(source), [source]);
9
- React.useEffect(() => {
10
- setShowFallback(false);
11
- }, [primaryKey]);
8
+ const [failedPrimaryKey, setFailedPrimaryKey] = React.useState(null);
9
+ const showFallback = primaryKey !== null && failedPrimaryKey === primaryKey;
12
10
  const normalizedPrimary = normalizeSource(source);
13
11
  const normalizedFallback = normalizeSource(fallbackSource);
14
12
  const resolvedSource = resolveRenderedSource(normalizedPrimary, normalizedFallback, showFallback);
@@ -21,7 +19,7 @@ export function Image({ source, fallbackSource, alt, accessibilityLabel, width,
21
19
  return (<RNImage accessibilityLabel={resolvedAccessibilityLabel} accessibilityRole="image" alt={resolvedAlt} onError={(event) => {
22
20
  onError?.(event);
23
21
  if (!showFallback && normalizedFallback) {
24
- setShowFallback(true);
22
+ setFailedPrimaryKey(primaryKey);
25
23
  }
26
24
  }} resizeMode={resolvedResizeMode} source={resolvedSource} style={[resolvedStyle, style]} testID={testID}/>);
27
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../src/primitives/image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,yBAAyB,EACzB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,UAAU,KAAK,CAAC,EACpB,MAAM,EACN,cAAc,EACd,GAAG,EACH,kBAAkB,EAClB,KAAK,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CAAC,KAAK,EAAE,EAAE;YACjB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;YAEjB,IAAI,CAAC,YAAY,IAAI,kBAAkB,EAAE,CAAC;gBACxC,eAAe,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACH,CAAC,CAAC,CACF,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAC/B,MAAM,CAAC,CAAC,cAAc,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAC9B,MAAM,CAAC,CAAC,MAAM,CAAC,EACf,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Image as RNImage } from 'react-native';\n\nimport { useTheme } from '../../theme/ThemeContext';\nimport {\n getSourceKey,\n normalizeSource,\n resolveAccessibilityLabel,\n resolveAlt,\n resolveImageStyle,\n resolveRenderedSource,\n resolveResizeMode,\n} from './resolveImageProps';\nimport type { ImageProps } from './types';\n\nexport function Image({\n source,\n fallbackSource,\n alt,\n accessibilityLabel,\n width,\n height,\n aspectRatio,\n fit,\n resizeMode,\n radius,\n style,\n testID,\n onError,\n}: ImageProps) {\n const { theme } = useTheme();\n const [showFallback, setShowFallback] = React.useState(false);\n const primaryKey = React.useMemo(() => getSourceKey(source), [source]);\n\n React.useEffect(() => {\n setShowFallback(false);\n }, [primaryKey]);\n\n const normalizedPrimary = normalizeSource(source);\n const normalizedFallback = normalizeSource(fallbackSource);\n const resolvedSource = resolveRenderedSource(normalizedPrimary, normalizedFallback, showFallback);\n\n if (!resolvedSource) return null;\n\n const resolvedResizeMode = resolveResizeMode(fit, resizeMode);\n const resolvedAccessibilityLabel = resolveAccessibilityLabel(alt, accessibilityLabel);\n const resolvedAlt = resolveAlt(alt, accessibilityLabel);\n const resolvedStyle = resolveImageStyle(theme, { width, height, aspectRatio, radius });\n\n return (\n <RNImage\n accessibilityLabel={resolvedAccessibilityLabel}\n accessibilityRole=\"image\"\n alt={resolvedAlt}\n onError={(event) => {\n onError?.(event);\n\n if (!showFallback && normalizedFallback) {\n setShowFallback(true);\n }\n }}\n resizeMode={resolvedResizeMode}\n source={resolvedSource}\n style={[resolvedStyle, style]}\n testID={testID}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../src/primitives/image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,yBAAyB,EACzB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,UAAU,KAAK,CAAC,EACpB,MAAM,EACN,cAAc,EACd,GAAG,EACH,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,WAAW,EACX,GAAG,EACH,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,GACI;IACX,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACvE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACpF,MAAM,YAAY,GAAG,UAAU,KAAK,IAAI,IAAI,gBAAgB,KAAK,UAAU,CAAC;IAE5E,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,kBAAkB,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAC3D,MAAM,cAAc,GAAG,qBAAqB,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAC;IAElG,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAC9D,MAAM,0BAA0B,GAAG,yBAAyB,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IACtF,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IACxD,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;IAEvF,OAAO,CACL,CAAC,OAAO,CACN,kBAAkB,CAAC,CAAC,0BAA0B,CAAC,CAC/C,iBAAiB,CAAC,OAAO,CACzB,GAAG,CAAC,CAAC,WAAW,CAAC,CACjB,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;YAEjB,IAAI,CAAC,YAAY,IAAI,kBAAkB,EAAE,CAAC;gBACxC,mBAAmB,CAAC,UAAU,CAAC,CAAC;YAClC,CAAC;QACH,CAAC,CAAC,CACF,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAC/B,MAAM,CAAC,CAAC,cAAc,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAC9B,MAAM,CAAC,CAAC,MAAM,CAAC,EACf,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Image as RNImage } from 'react-native';\n\nimport { useTheme } from '../../theme/ThemeContext';\nimport {\n getSourceKey,\n normalizeSource,\n resolveAccessibilityLabel,\n resolveAlt,\n resolveImageStyle,\n resolveRenderedSource,\n resolveResizeMode,\n} from './resolveImageProps';\nimport type { ImageProps } from './types';\n\nexport function Image({\n source,\n fallbackSource,\n alt,\n accessibilityLabel,\n width,\n height,\n aspectRatio,\n fit,\n resizeMode,\n radius,\n style,\n testID,\n onError,\n}: ImageProps) {\n const { theme } = useTheme();\n const primaryKey = React.useMemo(() => getSourceKey(source), [source]);\n const [failedPrimaryKey, setFailedPrimaryKey] = React.useState<string | null>(null);\n const showFallback = primaryKey !== null && failedPrimaryKey === primaryKey;\n\n const normalizedPrimary = normalizeSource(source);\n const normalizedFallback = normalizeSource(fallbackSource);\n const resolvedSource = resolveRenderedSource(normalizedPrimary, normalizedFallback, showFallback);\n\n if (!resolvedSource) return null;\n\n const resolvedResizeMode = resolveResizeMode(fit, resizeMode);\n const resolvedAccessibilityLabel = resolveAccessibilityLabel(alt, accessibilityLabel);\n const resolvedAlt = resolveAlt(alt, accessibilityLabel);\n const resolvedStyle = resolveImageStyle(theme, { width, height, aspectRatio, radius });\n\n return (\n <RNImage\n accessibilityLabel={resolvedAccessibilityLabel}\n accessibilityRole=\"image\"\n alt={resolvedAlt}\n onError={(event) => {\n onError?.(event);\n\n if (!showFallback && normalizedFallback) {\n setFailedPrimaryKey(primaryKey);\n }\n }}\n resizeMode={resolvedResizeMode}\n source={resolvedSource}\n style={[resolvedStyle, style]}\n testID={testID}\n />\n );\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/surface",
3
3
  "type": "module",
4
- "version": "2.2.0",
4
+ "version": "3.0.0",
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": {
@@ -27,23 +27,18 @@
27
27
  "components"
28
28
  ],
29
29
  "peerDependencies": {
30
- "@expo/vector-icons": ">=14.0.0",
31
- "expo-font": "^55.0.6",
32
- "react": ">=18.2.0",
33
- "react-native": ">=0.72.0",
34
- "react-native-safe-area-context": "^5.0.0"
35
- },
36
- "peerDependenciesMeta": {
37
- "@expo/vector-icons": {
38
- "optional": true
39
- },
40
- "expo-font": {
41
- "optional": true
42
- }
30
+ "@react-native-vector-icons/fontawesome": "^13.1.3",
31
+ "@react-native-vector-icons/fontawesome5": "^13.1.3",
32
+ "@react-native-vector-icons/fontawesome6": "^13.1.3",
33
+ "@react-native-vector-icons/ionicons": "^13.1.3",
34
+ "react": "19.2.3",
35
+ "react-native": "0.86.2",
36
+ "react-native-safe-area-context": "~5.7.0",
37
+ "react-native-web": "~0.21.0"
43
38
  },
44
39
  "dependencies": {
45
40
  "@ankhorage/color-theory": "^0.0.8",
46
- "@ankhorage/contracts": "^7.2.0"
41
+ "@ankhorage/contracts": "^8.0.0"
47
42
  },
48
43
  "files": [
49
44
  "dist",
@@ -66,10 +61,10 @@
66
61
  "access": "public"
67
62
  },
68
63
  "scripts": {
69
- "build": "rm -rf dist tsconfig.tsbuildinfo && bun x tsc -p tsconfig.json",
64
+ "build": "rm -rf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && bun x tsc -p tsconfig.build.json",
70
65
  "changeset": "changeset",
71
66
  "changeset:status": "changeset status --since=origin/main",
72
- "docs": "paradox",
67
+ "docs": "paradox && ankhorage-prettier --write README.md paradox",
73
68
  "knip": "ankhorage-knip",
74
69
  "lint": "ankhorage-eslint . --max-warnings=0",
75
70
  "lint:fix": "ankhorage-eslint . --fix --max-warnings=0",
@@ -81,17 +76,25 @@
81
76
  "version-packages": "changeset version"
82
77
  },
83
78
  "devDependencies": {
84
- "@ankhorage/devtools": "^1.0.6",
79
+ "@ankhorage/devtools": "^1.6.0",
85
80
  "@ankhorage/paradox": "^0.1.21",
81
+ "@react-native-vector-icons/fontawesome": "^13.1.3",
82
+ "@react-native-vector-icons/fontawesome5": "^13.1.3",
83
+ "@react-native-vector-icons/fontawesome6": "^13.1.3",
84
+ "@react-native-vector-icons/ionicons": "^13.1.3",
86
85
  "@changesets/cli": "^2.31.0",
87
- "@expo/vector-icons": "^15.1.1",
88
- "@types/bun": "^1.3.13",
89
- "@types/node": "^25.6.0",
90
- "@types/react": "^19.2.14",
91
- "react": "19.1.0",
92
- "react-native": "0.81.5",
93
- "react-native-safe-area-context": "^5.0.0",
94
- "typescript": "^5.9.3"
86
+ "@types/bun": "^1.3.14",
87
+ "@types/node": "^24.13.3",
88
+ "@types/react": "^19.2.18",
89
+ "@types/react-dom": "^19.2.4",
90
+ "@types/react-native-web": "^0.19.2",
91
+ "happy-dom": "^20.11.6",
92
+ "react": "19.2.3",
93
+ "react-dom": "19.2.3",
94
+ "react-native": "0.86.2",
95
+ "react-native-safe-area-context": "~5.7.0",
96
+ "react-native-web": "~0.21.0",
97
+ "typescript": "~6.0.3"
95
98
  },
96
- "packageManager": "bun@1.3.13"
99
+ "packageManager": "bun@1.3.14"
97
100
  }
@@ -3,6 +3,7 @@ import { Pressable, View } from 'react-native';
3
3
 
4
4
  import { FocusScope } from '../../internal/focus/FocusScope';
5
5
  import { Portal } from '../../internal/overlay/Portal';
6
+ import { resolvePointerEvents } from '../../internal/resolvePointerEvents';
6
7
  import { resolveOverlayAnimation } from '../../internal/resolvers';
7
8
  import { Box, Stack, Surface } from '../../layout';
8
9
  import { Text } from '../../primitives/text';
@@ -10,6 +11,8 @@ import { useTheme } from '../../theme/ThemeContext';
10
11
  import { ActionSheetItem } from './ActionSheetItem';
11
12
  import type { ActionSheetProps } from './types';
12
13
 
14
+ const boxNonePointerEvents = resolvePointerEvents('box-none');
15
+
13
16
  export function ActionSheet({
14
17
  visible,
15
18
  onDismiss,
@@ -32,14 +35,17 @@ export function ActionSheet({
32
35
  return (
33
36
  <Portal layer="modal" visible={visible}>
34
37
  <View
35
- pointerEvents="box-none"
36
- style={{
37
- bottom: 0,
38
- left: 0,
39
- position: 'absolute',
40
- right: 0,
41
- top: 0,
42
- }}
38
+ {...boxNonePointerEvents.props}
39
+ style={[
40
+ boxNonePointerEvents.style,
41
+ {
42
+ bottom: 0,
43
+ left: 0,
44
+ position: 'absolute',
45
+ right: 0,
46
+ top: 0,
47
+ },
48
+ ]}
43
49
  >
44
50
  <Pressable
45
51
  onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}