@ankhorage/surface 2.2.1 → 3.0.1

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 (116) 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/primitives/icon/Icon.d.ts +5 -12
  66. package/dist/primitives/icon/Icon.d.ts.map +1 -1
  67. package/dist/primitives/icon/Icon.js +5 -11
  68. package/dist/primitives/icon/Icon.js.map +1 -1
  69. package/dist/primitives/icon/PortableIcon.d.ts +51 -0
  70. package/dist/primitives/icon/PortableIcon.d.ts.map +1 -0
  71. package/dist/primitives/icon/PortableIcon.js +64 -0
  72. package/dist/primitives/icon/PortableIcon.js.map +1 -0
  73. package/dist/primitives/icon/index.d.ts +2 -1
  74. package/dist/primitives/icon/index.d.ts.map +1 -1
  75. package/dist/primitives/icon/index.js +1 -0
  76. package/dist/primitives/icon/index.js.map +1 -1
  77. package/dist/primitives/image/Image.d.ts.map +1 -1
  78. package/dist/primitives/image/Image.js +3 -5
  79. package/dist/primitives/image/Image.js.map +1 -1
  80. package/package.json +30 -27
  81. package/src/components/action-sheet/ActionSheet.tsx +14 -8
  82. package/src/components/button/Button.tsx +5 -17
  83. package/src/components/button/types.ts +2 -5
  84. package/src/components/drawer/Drawer.tsx +14 -8
  85. package/src/components/icon-button/IconButton.tsx +1 -6
  86. package/src/components/icon-button/types.ts +2 -5
  87. package/src/components/menu/Menu.tsx +14 -8
  88. package/src/components/modal/Modal.tsx +14 -8
  89. package/src/components/navigation/NavigationItem.tsx +1 -6
  90. package/src/components/navigation/TabBarItem.tsx +1 -6
  91. package/src/components/navigation/types.ts +2 -2
  92. package/src/components/toast/ToastProvider.tsx +3 -2
  93. package/src/components/tooltip/Tooltip.tsx +12 -6
  94. package/src/context/TranslationContext.tsx +12 -15
  95. package/src/index.test.ts +8 -0
  96. package/src/index.ts +2 -2
  97. package/src/internal/overlay/OverlayProvider.tsx +20 -20
  98. package/src/internal/overlay/Portal.tsx +2 -1
  99. package/src/internal/resolvePointerEvents.test.ts +19 -0
  100. package/src/internal/resolvePointerEvents.ts +29 -0
  101. package/src/layout/AppBar.tsx +1 -1
  102. package/src/layout/Box.tsx +5 -36
  103. package/src/layout/Grid.tsx +3 -3
  104. package/src/primitives/icon/Icon.tsx +9 -22
  105. package/src/primitives/icon/PortableIcon.tsx +112 -0
  106. package/src/primitives/icon/PortableIcon.web.test.tsx +119 -0
  107. package/src/primitives/icon/index.ts +2 -1
  108. package/src/primitives/image/Image.tsx +3 -6
  109. package/src/theme/colorEngine.test.ts +2 -2
  110. package/src/webAcceptance.test.tsx +84 -0
  111. package/dist/primitives/icon/resolveExpoIconComponent.d.ts +0 -11
  112. package/dist/primitives/icon/resolveExpoIconComponent.d.ts.map +0 -1
  113. package/dist/primitives/icon/resolveExpoIconComponent.js +0 -20
  114. package/dist/primitives/icon/resolveExpoIconComponent.js.map +0 -1
  115. package/src/primitives/icon/resolveExpoIconComponent.test.ts +0 -45
  116. package/src/primitives/icon/resolveExpoIconComponent.ts +0 -33
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ankhorage/surface
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c07471b: Support the React Native 0.86 patch line as a peer while validating Surface against the canonical React Native 0.86.3 application baseline.
8
+
9
+ ## 3.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - cf8741c: Move the consumer baseline to React 19.2.3, React Native 0.86.2, React Native Web 0.21, and TypeScript 6. Replace the Expo vector-icons resolver with the portable scoped RNVI static architecture for the intentional Ionicons and Font Awesome provider contract. FontAwesome5 and FontAwesome6 icons now require an explicit typed `regular`, `solid`, or `brand` variant.
14
+
3
15
  ## 2.2.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/surface
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v2.2.0](././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: v2.2.1](././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)
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
 
@@ -51,7 +51,6 @@ Cross-platform UI foundation for React Native and React Native Web. Provides the
51
51
  - [Toast sequence](././paradox/diagrams/sequences/toast.mmd)
52
52
  - [ToastProvider sequence](././paradox/diagrams/sequences/toast-provider.mmd)
53
53
  - [Tooltip sequence](././paradox/diagrams/sequences/tooltip.mmd)
54
- - [TranslationProvider sequence](././paradox/diagrams/sequences/translation-provider.mmd)
55
54
  - [useBreakpoint sequence](././paradox/diagrams/sequences/use-breakpoint.mmd)
56
55
  - [useFontContext sequence](././paradox/diagrams/sequences/use-font-context.mmd)
57
56
  - [useResponsiveRuntime sequence](././paradox/diagrams/sequences/use-responsive-runtime.mmd)
@@ -1 +1 @@
1
- {"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,WAAsB,EACtB,eAAsB,EACtB,iBAA6B,EAC7B,MAAM,GACP,EAAE,gBAAgB,4BAqGlB"}
1
+ {"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,WAAsB,EACtB,eAAsB,EACtB,iBAA6B,EAC7B,MAAM,GACP,EAAE,gBAAgB,4BAwGlB"}
@@ -2,11 +2,13 @@ import React from 'react';
2
2
  import { Pressable, View } from 'react-native';
3
3
  import { FocusScope } from '../../internal/focus/FocusScope';
4
4
  import { Portal } from '../../internal/overlay/Portal';
5
+ import { resolvePointerEvents } from '../../internal/resolvePointerEvents';
5
6
  import { resolveOverlayAnimation } from '../../internal/resolvers';
6
7
  import { Box, Stack, Surface } from '../../layout';
7
8
  import { Text } from '../../primitives/text';
8
9
  import { useTheme } from '../../theme/ThemeContext';
9
10
  import { ActionSheetItem } from './ActionSheetItem';
11
+ const boxNonePointerEvents = resolvePointerEvents('box-none');
10
12
  export function ActionSheet({ visible, onDismiss, title, description, children, cancelLabel = 'Cancel', closeOnBackdrop = true, interactionPolicy = 'enabled', testID, }) {
11
13
  const { theme } = useTheme();
12
14
  const animation = resolveOverlayAnimation('modal');
@@ -15,13 +17,16 @@ export function ActionSheet({ visible, onDismiss, title, description, children,
15
17
  return null;
16
18
  }
17
19
  return (<Portal layer="modal" visible={visible}>
18
- <View pointerEvents="box-none" style={{
19
- bottom: 0,
20
- left: 0,
21
- position: 'absolute',
22
- right: 0,
23
- top: 0,
24
- }}>
20
+ <View {...boxNonePointerEvents.props} style={[
21
+ boxNonePointerEvents.style,
22
+ {
23
+ bottom: 0,
24
+ left: 0,
25
+ position: 'absolute',
26
+ right: 0,
27
+ top: 0,
28
+ },
29
+ ]}>
25
30
  <Pressable onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined} style={{
26
31
  backgroundColor: theme.semantics.neutral.text,
27
32
  bottom: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"ActionSheet.js","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAA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} from 'react-native';\n\nimport { FocusScope } from '../../internal/focus/FocusScope';\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Box, Stack, Surface } from '../../layout';\nimport { Text } from '../../primitives/text';\nimport { useTheme } from '../../theme/ThemeContext';\nimport { ActionSheetItem } from './ActionSheetItem';\nimport type { ActionSheetProps } from './types';\n\nexport function ActionSheet({\n visible,\n onDismiss,\n title,\n description,\n children,\n cancelLabel = 'Cancel',\n closeOnBackdrop = true,\n interactionPolicy = 'enabled',\n testID,\n}: ActionSheetProps) {\n const { theme } = useTheme();\n const animation = resolveOverlayAnimation('modal');\n const passive = interactionPolicy === 'passive';\n\n if (!visible) {\n return null;\n }\n\n return (\n <Portal layer=\"modal\" visible={visible}>\n <View\n pointerEvents=\"box-none\"\n style={{\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n >\n <Pressable\n onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}\n style={{\n backgroundColor: theme.semantics.neutral.text,\n bottom: 0,\n left: 0,\n opacity: animation.backdropOpacity,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n testID={testID ? `${testID}-backdrop` : undefined}\n />\n <FocusScope\n active={visible}\n onEscape={passive ? undefined : onDismiss}\n testID={testID ? `${testID}-focus` : undefined}\n >\n <Box\n pointerEvents=\"box-none\"\n style={{\n flex: 1,\n justifyContent: 'flex-end',\n }}\n >\n <View\n accessible\n accessibilityViewIsModal\n style={{\n alignSelf: 'center',\n maxWidth: 560,\n padding: 16,\n width: '100%',\n }}\n >\n <Surface\n p=\"m\"\n style={{\n borderRadius: 24,\n shadowOpacity: 0.16,\n shadowRadius: 18,\n shadowOffset: { width: 0, height: -8 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n <Stack gap=\"s\">\n {title || description ? (\n <Box px=\"m\" py=\"s\">\n <Stack gap=\"xxs\">\n {title ? (\n <Text align=\"center\" variant=\"label\" weight=\"semiBold\">\n {title}\n </Text>\n ) : null}\n {description ? (\n <Text align=\"center\" emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n ) : null}\n <Stack gap=\"xxs\">{children}</Stack>\n {onDismiss ? (\n <ActionSheetItem\n label={cancelLabel}\n interactionPolicy={interactionPolicy}\n onPress={onDismiss}\n testID={testID ? `${testID}-cancel` : undefined}\n />\n ) : null}\n </Stack>\n </Surface>\n </View>\n </Box>\n </FocusScope>\n </View>\n </Portal>\n );\n}\n"]}
1
+ {"version":3,"file":"ActionSheet.js","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAE9D,MAAM,UAAU,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,WAAW,GAAG,QAAQ,EACtB,eAAe,GAAG,IAAI,EACtB,iBAAiB,GAAG,SAAS,EAC7B,MAAM,GACW;IACjB,MAAM,EAAE,KAAK,EAAE,GAAG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;4BAAA,CAAC,WAAW,CACd;0BAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;sBAAA,EAAE,KAAK,CACT;oBAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACR;kBAAA,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAClC;kBAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CACX,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,WAAW,CAAC,CACnB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,SAAS,CAAC,CACnB,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,EAChD,CACH,CAAC,CAAC,CAAC,IAAI,CACV;gBAAA,EAAE,KAAK,CACT;cAAA,EAAE,OAAO,CACX;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, View } from 'react-native';\n\nimport { FocusScope } from '../../internal/focus/FocusScope';\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolvePointerEvents } from '../../internal/resolvePointerEvents';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Box, Stack, Surface } from '../../layout';\nimport { Text } from '../../primitives/text';\nimport { useTheme } from '../../theme/ThemeContext';\nimport { ActionSheetItem } from './ActionSheetItem';\nimport type { ActionSheetProps } from './types';\n\nconst boxNonePointerEvents = resolvePointerEvents('box-none');\n\nexport function ActionSheet({\n visible,\n onDismiss,\n title,\n description,\n children,\n cancelLabel = 'Cancel',\n closeOnBackdrop = true,\n interactionPolicy = 'enabled',\n testID,\n}: ActionSheetProps) {\n const { theme } = useTheme();\n const animation = resolveOverlayAnimation('modal');\n const passive = interactionPolicy === 'passive';\n\n if (!visible) {\n return null;\n }\n\n return (\n <Portal layer=\"modal\" visible={visible}>\n <View\n {...boxNonePointerEvents.props}\n style={[\n boxNonePointerEvents.style,\n {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n ]}\n >\n <Pressable\n onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}\n style={{\n backgroundColor: theme.semantics.neutral.text,\n bottom: 0,\n left: 0,\n opacity: animation.backdropOpacity,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n testID={testID ? `${testID}-backdrop` : undefined}\n />\n <FocusScope\n active={visible}\n onEscape={passive ? undefined : onDismiss}\n testID={testID ? `${testID}-focus` : undefined}\n >\n <Box\n pointerEvents=\"box-none\"\n style={{\n flex: 1,\n justifyContent: 'flex-end',\n }}\n >\n <View\n accessible\n accessibilityViewIsModal\n style={{\n alignSelf: 'center',\n maxWidth: 560,\n padding: 16,\n width: '100%',\n }}\n >\n <Surface\n p=\"m\"\n style={{\n borderRadius: 24,\n shadowOpacity: 0.16,\n shadowRadius: 18,\n shadowOffset: { width: 0, height: -8 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n <Stack gap=\"s\">\n {title || description ? (\n <Box px=\"m\" py=\"s\">\n <Stack gap=\"xxs\">\n {title ? (\n <Text align=\"center\" variant=\"label\" weight=\"semiBold\">\n {title}\n </Text>\n ) : null}\n {description ? (\n <Text align=\"center\" emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n ) : null}\n <Stack gap=\"xxs\">{children}</Stack>\n {onDismiss ? (\n <ActionSheetItem\n label={cancelLabel}\n interactionPolicy={interactionPolicy}\n onPress={onDismiss}\n testID={testID ? `${testID}-cancel` : undefined}\n />\n ) : null}\n </Stack>\n </Surface>\n </View>\n </Box>\n </FocusScope>\n </View>\n </Portal>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,OAAiB,EACjB,KAAiB,EACjB,IAAU,EACV,QAAgB,EAChB,OAAe,EACf,WAAW,EACX,YAAY,EACZ,SAAiB,EACjB,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EAAE,WAAW,qBAqFb"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,OAAiB,EACjB,KAAiB,EACjB,IAAU,EACV,QAAgB,EAChB,OAAe,EACf,WAAW,EACX,YAAY,EACZ,SAAiB,EACjB,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EAAE,WAAW,qBAyEb"}
@@ -9,11 +9,9 @@ import { useTheme } from '../../theme/ThemeContext';
9
9
  export function Button({ children, variant = 'solid', color = 'primary', size = 'm', disabled = false, loading = false, leadingIcon, trailingIcon, fullWidth = false, onPress, testID, ...props }) {
10
10
  const { theme } = useTheme();
11
11
  const controlSize = resolveControlSize(theme, size);
12
- return (<ButtonBase {...props} disabled={disabled || loading} onPress={onPress} style={[
13
- {
14
- alignSelf: fullWidth ? 'stretch' : 'flex-start',
15
- },
16
- ]} testID={testID}>
12
+ return (<ButtonBase {...props} disabled={disabled || loading} onPress={onPress} style={{
13
+ alignSelf: fullWidth ? 'stretch' : 'flex-start',
14
+ }} testID={testID}>
17
15
  {(state) => {
18
16
  const colors = resolveButtonColors(theme, {
19
17
  variant,
@@ -37,13 +35,13 @@ export function Button({ children, variant = 'solid', color = 'primary', size =
37
35
  }}>
38
36
  {loading ? (<ActivityIndicator color={colors.contentColor} size="small"/>) : (<>
39
37
  {leadingIcon ? (<View style={{ marginRight: theme.spacing.s }}>
40
- <Icon color={colors.contentColor} name={leadingIcon.name} provider={leadingIcon.provider} size={iconSize}/>
38
+ <Icon {...leadingIcon} color={colors.contentColor} size={iconSize}/>
41
39
  </View>) : null}
42
40
  <Text color={resolvedTextColor} emphasis={resolvedTextEmphasis} variant={controlSize.textVariant} weight="semiBold">
43
41
  {children}
44
42
  </Text>
45
43
  {trailingIcon ? (<View style={{ marginLeft: theme.spacing.s }}>
46
- <Icon color={colors.contentColor} name={trailingIcon.name} provider={trailingIcon.provider} size={iconSize}/>
44
+ <Icon {...trailingIcon} color={colors.contentColor} size={iconSize}/>
47
45
  </View>) : null}
48
46
  </>)}
49
47
  </Box>);
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpG,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,UAAU,MAAM,CAAC,EACrB,QAAQ,EACR,OAAO,GAAG,OAAO,EACjB,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,WAAW,EACX,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U,CAEjB;kBAAA,CAAC,QAAQ,CACX;gBAAA,EAAE,IAAI,CACN;gBAAA,CAAC,YAAY,CAAC,CAAC,CAAC,CACd,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAC3C;oBAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAC3B,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CACxB,QAAQ,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAChC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAEnB;kBAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;cAAA,GAAG,CACJ,CACH;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { ActivityIndicator, View } from 'react-native';\n\nimport { resolveButtonColors, resolveControlSize, resolveIconSize } from '../../internal/resolvers';\nimport { Box } from '../../layout';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { Icon } from '../../primitives/icon';\nimport { Text } from '../../primitives/text';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { ButtonProps } from './types';\n\nexport function Button({\n children,\n variant = 'solid',\n color = 'primary',\n size = 'm',\n disabled = false,\n loading = false,\n leadingIcon,\n trailingIcon,\n fullWidth = false,\n onPress,\n testID,\n ...props\n}: ButtonProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n\n return (\n <ButtonBase\n {...props}\n disabled={disabled || loading}\n onPress={onPress}\n style={[\n {\n alignSelf: fullWidth ? 'stretch' : 'flex-start',\n },\n ]}\n testID={testID}\n >\n {(state) => {\n const colors = resolveButtonColors(theme, {\n variant,\n color,\n state,\n });\n const textEmphasis =\n colors.contentColor === theme.semantics.content.muted ? 'muted' : 'default';\n const resolvedTextColor = textEmphasis === 'muted' ? undefined : color;\n const resolvedTextEmphasis =\n textEmphasis === 'muted' ? 'muted' : variant === 'solid' ? 'inverse' : 'default';\n const iconSize = resolveIconSize(theme, size);\n\n return (\n <Box\n px={controlSize.paddingHorizontal}\n py={controlSize.paddingVertical}\n radius={controlSize.borderRadius}\n style={{\n minHeight: controlSize.minHeight,\n width: fullWidth ? '100%' : undefined,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n borderWidth: variant === 'solid' ? 0 : 1,\n opacity: colors.opacity,\n }}\n >\n {loading ? (\n <ActivityIndicator color={colors.contentColor} size=\"small\" />\n ) : (\n <>\n {leadingIcon ? (\n <View style={{ marginRight: theme.spacing.s }}>\n <Icon\n color={colors.contentColor}\n name={leadingIcon.name}\n provider={leadingIcon.provider}\n size={iconSize}\n />\n </View>\n ) : null}\n <Text\n color={resolvedTextColor}\n emphasis={resolvedTextEmphasis}\n variant={controlSize.textVariant}\n weight=\"semiBold\"\n >\n {children}\n </Text>\n {trailingIcon ? (\n <View style={{ marginLeft: theme.spacing.s }}>\n <Icon\n color={colors.contentColor}\n name={trailingIcon.name}\n provider={trailingIcon.provider}\n size={iconSize}\n />\n </View>\n ) : null}\n </>\n )}\n </Box>\n );\n }}\n </ButtonBase>\n );\n}\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpG,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAA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BAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;gBAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,iBAAiB,CAAC,CACzB,QAAQ,CAAC,CAAC,oBAAoB,CAAC,CAC/B,OAAO,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CACjC,MAAM,CAAC,UAAU,CAEjB;kBAAA,CAAC,QAAQ,CACX;gBAAA,EAAE,IAAI,CACN;gBAAA,CAAC,YAAY,CAAC,CAAC,CAAC,CACd,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAC3C;oBAAA,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EACrE;kBAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;cAAA,GAAG,CACJ,CACH;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { ActivityIndicator, View } from 'react-native';\n\nimport { resolveButtonColors, resolveControlSize, resolveIconSize } from '../../internal/resolvers';\nimport { Box } from '../../layout';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { Icon } from '../../primitives/icon';\nimport { Text } from '../../primitives/text';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { ButtonProps } from './types';\n\nexport function Button({\n children,\n variant = 'solid',\n color = 'primary',\n size = 'm',\n disabled = false,\n loading = false,\n leadingIcon,\n trailingIcon,\n fullWidth = false,\n onPress,\n testID,\n ...props\n}: ButtonProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n\n return (\n <ButtonBase\n {...props}\n disabled={disabled || loading}\n onPress={onPress}\n style={{\n alignSelf: fullWidth ? 'stretch' : 'flex-start',\n }}\n testID={testID}\n >\n {(state) => {\n const colors = resolveButtonColors(theme, {\n variant,\n color,\n state,\n });\n const textEmphasis =\n colors.contentColor === theme.semantics.content.muted ? 'muted' : 'default';\n const resolvedTextColor = textEmphasis === 'muted' ? undefined : color;\n const resolvedTextEmphasis =\n textEmphasis === 'muted' ? 'muted' : variant === 'solid' ? 'inverse' : 'default';\n const iconSize = resolveIconSize(theme, size);\n\n return (\n <Box\n px={controlSize.paddingHorizontal}\n py={controlSize.paddingVertical}\n radius={controlSize.borderRadius}\n style={{\n minHeight: controlSize.minHeight,\n width: fullWidth ? '100%' : undefined,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n borderWidth: variant === 'solid' ? 0 : 1,\n opacity: colors.opacity,\n }}\n >\n {loading ? (\n <ActivityIndicator color={colors.contentColor} size=\"small\" />\n ) : (\n <>\n {leadingIcon ? (\n <View style={{ marginRight: theme.spacing.s }}>\n <Icon {...leadingIcon} color={colors.contentColor} size={iconSize} />\n </View>\n ) : null}\n <Text\n color={resolvedTextColor}\n emphasis={resolvedTextEmphasis}\n variant={controlSize.textVariant}\n weight=\"semiBold\"\n >\n {children}\n </Text>\n {trailingIcon ? (\n <View style={{ marginLeft: theme.spacing.s }}>\n <Icon {...trailingIcon} color={colors.contentColor} size={iconSize} />\n </View>\n ) : null}\n </>\n )}\n </Box>\n );\n }}\n </ButtonBase>\n );\n}\n"]}
@@ -2,12 +2,9 @@ import type React from 'react';
2
2
  import type { ControlSize } from '../../internal/resolvers/resolveControlSize';
3
3
  import type { ButtonVariant } from '../../internal/resolvers/resolveInteractiveColors';
4
4
  import type { ButtonBaseProps } from '../../primitives/button-base';
5
- import type { IconProps } from '../../primitives/icon';
5
+ import type { IconSource } from '../../primitives/icon';
6
6
  import type { SurfaceColor } from '../../surfaceColor';
7
- export interface ButtonIconSpec {
8
- name: IconProps['name'];
9
- provider?: IconProps['provider'];
10
- }
7
+ export type ButtonIconSpec = IconSource;
11
8
  export interface ButtonProps extends Omit<ButtonBaseProps, 'accessibilityLabel' | 'children' | 'style'> {
12
9
  children?: React.ReactNode;
13
10
  variant?: ButtonVariant;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,eAAe,EACf,oBAAoB,GAAG,UAAU,GAAG,OAAO,CAC5C;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC;AAExC,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,eAAe,EACf,oBAAoB,GAAG,UAAU,GAAG,OAAO,CAC5C;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../../internal/resolvers/resolveControlSize';\nimport type { ButtonVariant } from '../../internal/resolvers/resolveInteractiveColors';\nimport type { ButtonBaseProps } from '../../primitives/button-base';\nimport type { IconProps } from '../../primitives/icon';\nimport type { SurfaceColor } from '../../surfaceColor';\n\nexport interface ButtonIconSpec {\n name: IconProps['name'];\n provider?: IconProps['provider'];\n}\n\nexport interface ButtonProps extends Omit<\n ButtonBaseProps,\n 'accessibilityLabel' | 'children' | 'style'\n> {\n children?: React.ReactNode;\n variant?: ButtonVariant;\n color?: SurfaceColor;\n size?: ControlSize;\n loading?: boolean;\n leadingIcon?: ButtonIconSpec;\n trailingIcon?: ButtonIconSpec;\n fullWidth?: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../../internal/resolvers/resolveControlSize';\nimport type { ButtonVariant } from '../../internal/resolvers/resolveInteractiveColors';\nimport type { ButtonBaseProps } from '../../primitives/button-base';\nimport type { IconSource } from '../../primitives/icon';\nimport type { SurfaceColor } from '../../surfaceColor';\n\nexport type ButtonIconSpec = IconSource;\n\nexport interface ButtonProps extends Omit<\n ButtonBaseProps,\n 'accessibilityLabel' | 'children' | 'style'\n> {\n children?: React.ReactNode;\n variant?: ButtonVariant;\n color?: SurfaceColor;\n size?: ControlSize;\n loading?: boolean;\n leadingIcon?: ButtonIconSpec;\n trailingIcon?: ButtonIconSpec;\n fullWidth?: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,SAAS,EACT,QAAkB,EAClB,QAAQ,EACR,eAAsB,EACtB,iBAA6B,EAC7B,MAAM,GACP,EAAE,WAAW,4BA2Eb"}
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,SAAS,EACT,QAAkB,EAClB,QAAQ,EACR,eAAsB,EACtB,iBAA6B,EAC7B,MAAM,GACP,EAAE,WAAW,4BA8Eb"}
@@ -2,9 +2,11 @@ import React from 'react';
2
2
  import { Pressable, View } from 'react-native';
3
3
  import { FocusScope } from '../../internal/focus/FocusScope';
4
4
  import { Portal } from '../../internal/overlay/Portal';
5
+ import { resolvePointerEvents } from '../../internal/resolvePointerEvents';
5
6
  import { resolveOverlayAnimation } from '../../internal/resolvers';
6
7
  import { Box, Surface } from '../../layout';
7
8
  import { useTheme } from '../../theme/ThemeContext';
9
+ const boxNonePointerEvents = resolvePointerEvents('box-none');
8
10
  export function Drawer({ visible, onDismiss, position = 'right', children, closeOnBackdrop = true, interactionPolicy = 'enabled', testID, }) {
9
11
  const { theme } = useTheme();
10
12
  const animation = resolveOverlayAnimation('drawer');
@@ -13,13 +15,16 @@ export function Drawer({ visible, onDismiss, position = 'right', children, close
13
15
  return null;
14
16
  }
15
17
  return (<Portal layer="drawer" visible={visible}>
16
- <View pointerEvents="box-none" style={{
17
- bottom: 0,
18
- left: 0,
19
- position: 'absolute',
20
- right: 0,
21
- top: 0,
22
- }}>
18
+ <View {...boxNonePointerEvents.props} style={[
19
+ boxNonePointerEvents.style,
20
+ {
21
+ bottom: 0,
22
+ left: 0,
23
+ position: 'absolute',
24
+ right: 0,
25
+ top: 0,
26
+ },
27
+ ]}>
23
28
  <Pressable onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined} style={{
24
29
  backgroundColor: theme.semantics.neutral.text,
25
30
  bottom: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE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usScope } from '../../internal/focus/FocusScope';\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Box, Surface } from '../../layout';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { DrawerProps } from './types';\n\nexport function Drawer({\n visible,\n onDismiss,\n position = 'right',\n children,\n closeOnBackdrop = true,\n interactionPolicy = 'enabled',\n testID,\n}: DrawerProps) {\n const { theme } = useTheme();\n const animation = resolveOverlayAnimation('drawer');\n const passive = interactionPolicy === 'passive';\n\n if (!visible) {\n return null;\n }\n\n return (\n <Portal layer=\"drawer\" visible={visible}>\n <View\n pointerEvents=\"box-none\"\n style={{\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n >\n <Pressable\n onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}\n style={{\n backgroundColor: theme.semantics.neutral.text,\n bottom: 0,\n left: 0,\n opacity: animation.backdropOpacity,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n testID={testID ? `${testID}-backdrop` : undefined}\n />\n <FocusScope\n active={visible}\n onEscape={passive ? undefined : onDismiss}\n testID={testID ? `${testID}-focus` : undefined}\n >\n <Box\n pointerEvents=\"box-none\"\n style={{\n flex: 1,\n justifyContent: 'flex-start',\n }}\n >\n <View\n accessible\n accessibilityViewIsModal\n style={{\n alignSelf: position === 'left' ? 'flex-start' : 'flex-end',\n height: '100%',\n maxWidth: 420,\n width: '88%',\n }}\n >\n <Surface\n p=\"l\"\n style={{\n height: '100%',\n shadowOpacity: 0.14,\n shadowRadius: 14,\n shadowOffset: { width: position === 'left' ? 4 : -4, height: 0 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n {children}\n </Surface>\n </View>\n </Box>\n </FocusScope>\n </View>\n </Portal>\n );\n}\n"]}
1
+ {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC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,KAAK,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;SACjE,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,OAAO,CAAC,QAAQ,CAEhB;gBAAA,CAAC,QAAQ,CACX;cAAA,EAAE,OAAO,CACX;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, View } from 'react-native';\n\nimport { FocusScope } from '../../internal/focus/FocusScope';\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolvePointerEvents } from '../../internal/resolvePointerEvents';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Box, Surface } from '../../layout';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { DrawerProps } from './types';\n\nconst boxNonePointerEvents = resolvePointerEvents('box-none');\n\nexport function Drawer({\n visible,\n onDismiss,\n position = 'right',\n children,\n closeOnBackdrop = true,\n interactionPolicy = 'enabled',\n testID,\n}: DrawerProps) {\n const { theme } = useTheme();\n const animation = resolveOverlayAnimation('drawer');\n const passive = interactionPolicy === 'passive';\n\n if (!visible) {\n return null;\n }\n\n return (\n <Portal layer=\"drawer\" visible={visible}>\n <View\n {...boxNonePointerEvents.props}\n style={[\n boxNonePointerEvents.style,\n {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n ]}\n >\n <Pressable\n onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}\n style={{\n backgroundColor: theme.semantics.neutral.text,\n bottom: 0,\n left: 0,\n opacity: animation.backdropOpacity,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n testID={testID ? `${testID}-backdrop` : undefined}\n />\n <FocusScope\n active={visible}\n onEscape={passive ? undefined : onDismiss}\n testID={testID ? `${testID}-focus` : undefined}\n >\n <Box\n pointerEvents=\"box-none\"\n style={{\n flex: 1,\n justifyContent: 'flex-start',\n }}\n >\n <View\n accessible\n accessibilityViewIsModal\n style={{\n alignSelf: position === 'left' ? 'flex-start' : 'flex-end',\n height: '100%',\n maxWidth: 420,\n width: '88%',\n }}\n >\n <Surface\n p=\"l\"\n style={{\n height: '100%',\n shadowOpacity: 0.14,\n shadowRadius: 14,\n shadowOffset: { width: position === 'left' ? 4 : -4, height: 0 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n {children}\n </Surface>\n </View>\n </Box>\n </FocusScope>\n </View>\n </Portal>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,kBAAkB,EAClB,OAAiB,EACjB,KAAiB,EACjB,IAAU,EACV,QAAgB,EAChB,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EAAE,eAAe,qBAwCjB"}
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,kBAAkB,EAClB,OAAiB,EACjB,KAAiB,EACjB,IAAU,EACV,QAAgB,EAChB,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EAAE,eAAe,qBAmCjB"}
@@ -20,7 +20,7 @@ export function IconButton({ icon, accessibilityLabel, variant = 'ghost', color
20
20
  borderWidth: variant === 'solid' ? 0 : 1,
21
21
  opacity: colors.opacity,
22
22
  }}>
23
- <Icon color={colors.contentColor} name={icon.name} provider={icon.provider} size={resolveIconSize(theme, size)}/>
23
+ <Icon {...icon} color={colors.contentColor} size={resolveIconSize(theme, size)}/>
24
24
  </Box>);
25
25
  }}
26
26
  </ButtonBase>);
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpG,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,kBAAkB,EAClB,OAAO,GAAG,OAAO,EACjB,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACQ;IAChB,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAEpD,OAAO,CACL,CAAC,UAAU,CACT,IAAI,KAAK,CAAC,CACV,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,CAAC,KAAK,EAAE,EAAE;YACT,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAErE,OAAO,CACL,CAAC,GAAG,CACF,MAAM,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CACjC,KAAK,CAAC,CAAC;oBACL,SAAS,EAAE,WAAW,CAAC,SAAS;oBAChC,QAAQ,EAAE,WAAW,CAAC,SAAS;oBAC/B,UAAU,EAAE,QAAQ;oBACpB,cAAc,EAAE,QAAQ;oBACxB,eAAe,EAAE,MAAM,CAAC,eAAe;oBACvC,WAAW,EAAE,MAAM,CAAC,WAAW;oBAC/B,WAAW,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACxC,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC,CAEF;YAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAC3B,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAChB,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACxB,IAAI,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAEvC;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { resolveButtonColors, resolveControlSize, resolveIconSize } from '../../internal/resolvers';\nimport { Box } from '../../layout';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { Icon } from '../../primitives/icon';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { IconButtonProps } from './types';\n\nexport function IconButton({\n icon,\n accessibilityLabel,\n variant = 'ghost',\n color = 'primary',\n size = 'm',\n disabled = false,\n onPress,\n testID,\n ...props\n}: IconButtonProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n\n return (\n <ButtonBase\n {...props}\n accessibilityLabel={accessibilityLabel}\n disabled={disabled}\n onPress={onPress}\n testID={testID}\n >\n {(state) => {\n const colors = resolveButtonColors(theme, { color, state, variant });\n\n return (\n <Box\n radius={controlSize.borderRadius}\n style={{\n minHeight: controlSize.minHeight,\n minWidth: controlSize.minHeight,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n borderWidth: variant === 'solid' ? 0 : 1,\n opacity: colors.opacity,\n }}\n >\n <Icon\n color={colors.contentColor}\n name={icon.name}\n provider={icon.provider}\n size={resolveIconSize(theme, size)}\n />\n </Box>\n );\n }}\n </ButtonBase>\n );\n}\n"]}
1
+ {"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpG,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,kBAAkB,EAClB,OAAO,GAAG,OAAO,EACjB,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACQ;IAChB,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAEpD,OAAO,CACL,CAAC,UAAU,CACT,IAAI,KAAK,CAAC,CACV,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,CAAC,KAAK,EAAE,EAAE;YACT,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAErE,OAAO,CACL,CAAC,GAAG,CACF,MAAM,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CACjC,KAAK,CAAC,CAAC;oBACL,SAAS,EAAE,WAAW,CAAC,SAAS;oBAChC,QAAQ,EAAE,WAAW,CAAC,SAAS;oBAC/B,UAAU,EAAE,QAAQ;oBACpB,cAAc,EAAE,QAAQ;oBACxB,eAAe,EAAE,MAAM,CAAC,eAAe;oBACvC,WAAW,EAAE,MAAM,CAAC,WAAW;oBAC/B,WAAW,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACxC,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC,CAEF;YAAA,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EACjF;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { resolveButtonColors, resolveControlSize, resolveIconSize } from '../../internal/resolvers';\nimport { Box } from '../../layout';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { Icon } from '../../primitives/icon';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { IconButtonProps } from './types';\n\nexport function IconButton({\n icon,\n accessibilityLabel,\n variant = 'ghost',\n color = 'primary',\n size = 'm',\n disabled = false,\n onPress,\n testID,\n ...props\n}: IconButtonProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n\n return (\n <ButtonBase\n {...props}\n accessibilityLabel={accessibilityLabel}\n disabled={disabled}\n onPress={onPress}\n testID={testID}\n >\n {(state) => {\n const colors = resolveButtonColors(theme, { color, state, variant });\n\n return (\n <Box\n radius={controlSize.borderRadius}\n style={{\n minHeight: controlSize.minHeight,\n minWidth: controlSize.minHeight,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n borderWidth: variant === 'solid' ? 0 : 1,\n opacity: colors.opacity,\n }}\n >\n <Icon {...icon} color={colors.contentColor} size={resolveIconSize(theme, size)} />\n </Box>\n );\n }}\n </ButtonBase>\n );\n}\n"]}
@@ -1,13 +1,10 @@
1
1
  import type { ControlSize } from '../../internal/resolvers/resolveControlSize';
2
2
  import type { ButtonVariant } from '../../internal/resolvers/resolveInteractiveColors';
3
3
  import type { ButtonBaseProps } from '../../primitives/button-base';
4
- import type { IconProps } from '../../primitives/icon';
4
+ import type { IconSource } from '../../primitives/icon';
5
5
  import type { SurfaceColor } from '../../surfaceColor';
6
6
  export interface IconButtonProps extends Omit<ButtonBaseProps, 'children' | 'style' | 'accessibilityLabel'> {
7
- icon: {
8
- name: IconProps['name'];
9
- provider?: IconProps['provider'];
10
- };
7
+ icon: IconSource;
11
8
  accessibilityLabel: string;
12
9
  variant?: ButtonVariant;
13
10
  color?: SurfaceColor;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,eAAe,EACf,UAAU,GAAG,OAAO,GAAG,oBAAoB,CAC5C;IACC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;KAClC,CAAC;IACF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,eAAe,EACf,UAAU,GAAG,OAAO,GAAG,oBAAoB,CAC5C;IACC,IAAI,EAAE,UAAU,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/icon-button/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ControlSize } from '../../internal/resolvers/resolveControlSize';\nimport type { ButtonVariant } from '../../internal/resolvers/resolveInteractiveColors';\nimport type { ButtonBaseProps } from '../../primitives/button-base';\nimport type { IconProps } from '../../primitives/icon';\nimport type { SurfaceColor } from '../../surfaceColor';\n\nexport interface IconButtonProps extends Omit<\n ButtonBaseProps,\n 'children' | 'style' | 'accessibilityLabel'\n> {\n icon: {\n name: IconProps['name'];\n provider?: IconProps['provider'];\n };\n accessibilityLabel: string;\n variant?: ButtonVariant;\n color?: SurfaceColor;\n size?: ControlSize;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/icon-button/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ControlSize } from '../../internal/resolvers/resolveControlSize';\nimport type { ButtonVariant } from '../../internal/resolvers/resolveInteractiveColors';\nimport type { ButtonBaseProps } from '../../primitives/button-base';\nimport type { IconSource } from '../../primitives/icon';\nimport type { SurfaceColor } from '../../surfaceColor';\n\nexport interface IconButtonProps extends Omit<\n ButtonBaseProps,\n 'children' | 'style' | 'accessibilityLabel'\n> {\n icon: IconSource;\n accessibilityLabel: string;\n variant?: ButtonVariant;\n color?: SurfaceColor;\n size?: ControlSize;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,SAAS,CAAC;AA2CrD,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,OAAO,EACP,OAAO,EACP,aAAoB,EACpB,iBAA6B,EAC7B,MAAM,GACP,EAAE,SAAS,qBA6JX"}
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,SAAS,CAAC;AA6CrD,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,OAAO,EACP,OAAO,EACP,aAAoB,EACpB,iBAA6B,EAC7B,MAAM,GACP,EAAE,SAAS,qBAgKX"}
@@ -3,12 +3,14 @@ import { Pressable, View } from 'react-native';
3
3
  import { FocusScope } from '../../internal/focus/FocusScope';
4
4
  import { useFocusManager } from '../../internal/focus/useFocusManager';
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, Inline, Stack, Surface } from '../../layout';
8
9
  import { ButtonBase } from '../../primitives/button-base';
9
10
  import { Text } from '../../primitives/text';
10
11
  import { useTheme } from '../../theme/ThemeContext';
11
12
  import { resolveNextMenuIndex } from './navigation';
13
+ const boxNonePointerEvents = resolvePointerEvents('box-none');
12
14
  function measureNode(node, callback) {
13
15
  const measurableNode = node;
14
16
  measurableNode?.measureInWindow?.((x, y, width, height) => {
@@ -95,13 +97,16 @@ export function Menu({ trigger, actions, dismiss, closeOnSelect = true, interact
95
97
  {trigger}
96
98
  </ButtonBase>
97
99
  <Portal layer="menu" visible={open && Boolean(layout)}>
98
- <View pointerEvents="box-none" style={{
99
- bottom: 0,
100
- left: 0,
101
- position: 'absolute',
102
- right: 0,
103
- top: 0,
104
- }}>
100
+ <View {...boxNonePointerEvents.props} style={[
101
+ boxNonePointerEvents.style,
102
+ {
103
+ bottom: 0,
104
+ left: 0,
105
+ position: 'absolute',
106
+ right: 0,
107
+ top: 0,
108
+ },
109
+ ]}>
105
110
  <Pressable onPress={passive ? undefined : closeMenu} style={{
106
111
  bottom: 0,
107
112
  left: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAwB,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,O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,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBACpC,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAE3D;wBAAA,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CACtC;sBAAA,EAAE,GAAG,CACP;oBAAA,EAAE,SAAS,CAAC,CACb,CAAC;QACJ,CAAC,CAAC,CACJ;cAAA,EAAE,OAAO,CACX;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,UAAU,CACd;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,MAAM,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { type LayoutRectangle, Pressable, View } from 'react-native';\n\nimport { FocusScope } from '../../internal/focus/FocusScope';\nimport { useFocusManager } from '../../internal/focus/useFocusManager';\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Box, Inline, Stack, Surface } from '../../layout';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { Text } from '../../primitives/text';\nimport { useTheme } from '../../theme/ThemeContext';\nimport { resolveNextMenuIndex } from './navigation';\nimport type { MenuAction, MenuProps } from './types';\n\ninterface MeasurableNode {\n measureInWindow?: (\n callback: (x: number, y: number, width: number, height: number) => void,\n ) => void;\n}\n\nfunction measureNode(node: unknown, callback: (layout: LayoutRectangle) => void) {\n const measurableNode = node as MeasurableNode | null;\n measurableNode?.measureInWindow?.((x, y, width, height) => {\n callback({ height, width, x, y });\n });\n}\n\nfunction renderActionContent(action: MenuAction, active: boolean) {\n const titleColor =\n action.intent === 'danger' ? 'danger' : active || action.selected ? 'neutral' : undefined;\n\n return (\n <Inline align=\"center\" gap=\"s\" justify=\"space-between\" wrap=\"nowrap\">\n {action.leading ? <Box>{action.leading}</Box> : null}\n <Box flex={1}>\n <Stack gap=\"xxs\">\n <Text\n color={titleColor}\n variant=\"bodySmall\"\n weight={action.selected ? 'semiBold' : 'medium'}\n >\n {action.title}\n </Text>\n {action.description ? (\n <Text emphasis=\"muted\" variant=\"caption\">\n {action.description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n {action.trailing ? <Box>{action.trailing}</Box> : null}\n </Inline>\n );\n}\n\nexport function Menu({\n trigger,\n actions,\n dismiss,\n closeOnSelect = true,\n interactionPolicy = 'enabled',\n testID,\n}: MenuProps) {\n const { theme } = useTheme();\n const { bindKeydown } = useFocusManager();\n const animation = resolveOverlayAnimation('menu');\n const anchorRef = React.useRef<View | null>(null);\n const [open, setOpen] = React.useState(false);\n const [layout, setLayout] = React.useState<LayoutRectangle | null>(null);\n const [activeIndex, setActiveIndex] = React.useState(0);\n const passive = interactionPolicy === 'passive';\n\n const closeMenu = React.useCallback(() => {\n setOpen(false);\n if (dismiss) {\n dismiss();\n }\n }, [dismiss]);\n\n const activateAction = React.useCallback(\n (action: MenuAction) => {\n if (action.disabled) {\n return;\n }\n\n if (action.activate) {\n action.activate();\n }\n\n if (closeOnSelect) {\n closeMenu();\n }\n },\n [closeMenu, closeOnSelect],\n );\n\n const openMenu = React.useCallback(() => {\n measureNode(anchorRef.current, setLayout);\n const firstEnabledIndex = actions.findIndex((action) => !action.disabled);\n setActiveIndex(firstEnabledIndex === -1 ? 0 : firstEnabledIndex);\n setOpen(true);\n }, [actions]);\n\n React.useEffect(() => {\n if (!open) {\n return undefined;\n }\n\n return bindKeydown((event) => {\n if (passive) {\n return;\n }\n\n const { key } = event;\n if (key === 'ArrowDown' || key === 'ArrowUp' || key === 'Home' || key === 'End') {\n event.preventDefault();\n setActiveIndex((current) => resolveNextMenuIndex(actions, current, key));\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n const activeAction = actions[activeIndex];\n if (activeAction) {\n activateAction(activeAction);\n }\n }\n\n if (event.key === 'Escape') {\n event.preventDefault();\n closeMenu();\n }\n });\n }, [activateAction, actions, activeIndex, bindKeydown, closeMenu, open, passive]);\n\n return (\n <View collapsable={false} ref={anchorRef}>\n <ButtonBase\n onPress={passive ? undefined : open ? closeMenu : openMenu}\n testID={testID ? `${testID}-trigger` : undefined}\n >\n {trigger}\n </ButtonBase>\n <Portal layer=\"menu\" visible={open && Boolean(layout)}>\n <View\n pointerEvents=\"box-none\"\n style={{\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n >\n <Pressable\n onPress={passive ? undefined : closeMenu}\n style={{\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n />\n <FocusScope active={open} onEscape={passive ? undefined : closeMenu}>\n <View\n style={{\n left: layout?.x ?? 0,\n position: 'absolute',\n top: (layout?.y ?? 0) + (layout?.height ?? 0) + animation.offset,\n }}\n >\n <Surface\n accessibilityRole=\"menu\"\n p=\"xs\"\n style={{\n minWidth: Math.max(layout?.width ?? 0, 220),\n shadowOpacity: 0.12,\n shadowRadius: 12,\n shadowOffset: { width: 0, height: 6 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n {actions.map((action, index) => {\n const active = index === activeIndex;\n const selected = action.selected ?? active;\n\n return (\n <Pressable\n accessibilityRole=\"menuitem\"\n accessibilityState={{ disabled: action.disabled, selected }}\n disabled={action.disabled}\n key={action.id}\n onPress={passive ? undefined : () => activateAction(action)}\n >\n <Box\n px=\"m\"\n py=\"s\"\n radius=\"s\"\n style={{\n backgroundColor: selected\n ? theme.semantics.action.neutral.softBg\n : 'transparent',\n opacity: action.disabled ? 0.56 : 1,\n }}\n testID={testID ? `${testID}-item-${action.id}` : undefined}\n >\n {renderActionContent(action, active)}\n </Box>\n </Pressable>\n );\n })}\n </Surface>\n </View>\n </FocusScope>\n </View>\n </Portal>\n </View>\n );\n}\n"]}
1
+ {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAA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C,MAAM,CAAC,CAAC,CAE5D;sBAAA,CAAC,GAAG,CACF,EAAE,CAAC,GAAG,CACN,EAAE,CAAC,GAAG,CACN,MAAM,CAAC,GAAG,CACV,KAAK,CAAC,CAAC;oBACL,eAAe,EAAE,QAAQ;wBACvB,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM;wBACvC,CAAC,CAAC,aAAa;oBACjB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBACpC,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAE3D;wBAAA,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CACtC;sBAAA,EAAE,GAAG,CACP;oBAAA,EAAE,SAAS,CAAC,CACb,CAAC;QACJ,CAAC,CAAC,CACJ;cAAA,EAAE,OAAO,CACX;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,UAAU,CACd;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,MAAM,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { type LayoutRectangle, Pressable, View } from 'react-native';\n\nimport { FocusScope } from '../../internal/focus/FocusScope';\nimport { useFocusManager } from '../../internal/focus/useFocusManager';\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolvePointerEvents } from '../../internal/resolvePointerEvents';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Box, Inline, Stack, Surface } from '../../layout';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { Text } from '../../primitives/text';\nimport { useTheme } from '../../theme/ThemeContext';\nimport { resolveNextMenuIndex } from './navigation';\nimport type { MenuAction, MenuProps } from './types';\n\nconst boxNonePointerEvents = resolvePointerEvents('box-none');\n\ninterface MeasurableNode {\n measureInWindow?: (\n callback: (x: number, y: number, width: number, height: number) => void,\n ) => void;\n}\n\nfunction measureNode(node: unknown, callback: (layout: LayoutRectangle) => void) {\n const measurableNode = node as MeasurableNode | null;\n measurableNode?.measureInWindow?.((x, y, width, height) => {\n callback({ height, width, x, y });\n });\n}\n\nfunction renderActionContent(action: MenuAction, active: boolean) {\n const titleColor =\n action.intent === 'danger' ? 'danger' : active || action.selected ? 'neutral' : undefined;\n\n return (\n <Inline align=\"center\" gap=\"s\" justify=\"space-between\" wrap=\"nowrap\">\n {action.leading ? <Box>{action.leading}</Box> : null}\n <Box flex={1}>\n <Stack gap=\"xxs\">\n <Text\n color={titleColor}\n variant=\"bodySmall\"\n weight={action.selected ? 'semiBold' : 'medium'}\n >\n {action.title}\n </Text>\n {action.description ? (\n <Text emphasis=\"muted\" variant=\"caption\">\n {action.description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n {action.trailing ? <Box>{action.trailing}</Box> : null}\n </Inline>\n );\n}\n\nexport function Menu({\n trigger,\n actions,\n dismiss,\n closeOnSelect = true,\n interactionPolicy = 'enabled',\n testID,\n}: MenuProps) {\n const { theme } = useTheme();\n const { bindKeydown } = useFocusManager();\n const animation = resolveOverlayAnimation('menu');\n const anchorRef = React.useRef<View | null>(null);\n const [open, setOpen] = React.useState(false);\n const [layout, setLayout] = React.useState<LayoutRectangle | null>(null);\n const [activeIndex, setActiveIndex] = React.useState(0);\n const passive = interactionPolicy === 'passive';\n\n const closeMenu = React.useCallback(() => {\n setOpen(false);\n if (dismiss) {\n dismiss();\n }\n }, [dismiss]);\n\n const activateAction = React.useCallback(\n (action: MenuAction) => {\n if (action.disabled) {\n return;\n }\n\n if (action.activate) {\n action.activate();\n }\n\n if (closeOnSelect) {\n closeMenu();\n }\n },\n [closeMenu, closeOnSelect],\n );\n\n const openMenu = React.useCallback(() => {\n measureNode(anchorRef.current, setLayout);\n const firstEnabledIndex = actions.findIndex((action) => !action.disabled);\n setActiveIndex(firstEnabledIndex === -1 ? 0 : firstEnabledIndex);\n setOpen(true);\n }, [actions]);\n\n React.useEffect(() => {\n if (!open) {\n return undefined;\n }\n\n return bindKeydown((event) => {\n if (passive) {\n return;\n }\n\n const { key } = event;\n if (key === 'ArrowDown' || key === 'ArrowUp' || key === 'Home' || key === 'End') {\n event.preventDefault();\n setActiveIndex((current) => resolveNextMenuIndex(actions, current, key));\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n const activeAction = actions[activeIndex];\n if (activeAction) {\n activateAction(activeAction);\n }\n }\n\n if (event.key === 'Escape') {\n event.preventDefault();\n closeMenu();\n }\n });\n }, [activateAction, actions, activeIndex, bindKeydown, closeMenu, open, passive]);\n\n return (\n <View collapsable={false} ref={anchorRef}>\n <ButtonBase\n onPress={passive ? undefined : open ? closeMenu : openMenu}\n testID={testID ? `${testID}-trigger` : undefined}\n >\n {trigger}\n </ButtonBase>\n <Portal layer=\"menu\" visible={open && Boolean(layout)}>\n <View\n {...boxNonePointerEvents.props}\n style={[\n boxNonePointerEvents.style,\n {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n ]}\n >\n <Pressable\n onPress={passive ? undefined : closeMenu}\n style={{\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n />\n <FocusScope active={open} onEscape={passive ? undefined : closeMenu}>\n <View\n style={{\n left: layout?.x ?? 0,\n position: 'absolute',\n top: (layout?.y ?? 0) + (layout?.height ?? 0) + animation.offset,\n }}\n >\n <Surface\n accessibilityRole=\"menu\"\n p=\"xs\"\n style={{\n minWidth: Math.max(layout?.width ?? 0, 220),\n shadowOpacity: 0.12,\n shadowRadius: 12,\n shadowOffset: { width: 0, height: 6 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n {actions.map((action, index) => {\n const active = index === activeIndex;\n const selected = action.selected ?? active;\n\n return (\n <Pressable\n accessibilityRole=\"menuitem\"\n accessibilityState={{ disabled: action.disabled, selected }}\n disabled={action.disabled}\n key={action.id}\n onPress={passive ? undefined : () => activateAction(action)}\n >\n <Box\n px=\"m\"\n py=\"s\"\n radius=\"s\"\n style={{\n backgroundColor: selected\n ? theme.semantics.action.neutral.softBg\n : 'transparent',\n opacity: action.disabled ? 0.56 : 1,\n }}\n testID={testID ? `${testID}-item-${action.id}` : undefined}\n >\n {renderActionContent(action, active)}\n </Box>\n </Pressable>\n );\n })}\n </Surface>\n </View>\n </FocusScope>\n </View>\n </Portal>\n </View>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,iBAA6B,EAC7B,MAAM,GACP,EAAE,UAAU,4BAuEZ"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI1C,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,iBAA6B,EAC7B,MAAM,GACP,EAAE,UAAU,4BA0EZ"}
@@ -2,9 +2,11 @@ import React from 'react';
2
2
  import { Pressable, View } from 'react-native';
3
3
  import { FocusScope } from '../../internal/focus/FocusScope';
4
4
  import { Portal } from '../../internal/overlay/Portal';
5
+ import { resolvePointerEvents } from '../../internal/resolvePointerEvents';
5
6
  import { resolveOverlayAnimation } from '../../internal/resolvers';
6
7
  import { Center, Surface } from '../../layout';
7
8
  import { useTheme } from '../../theme/ThemeContext';
9
+ const boxNonePointerEvents = resolvePointerEvents('box-none');
8
10
  export function Modal({ visible, onDismiss, children, closeOnBackdrop = true, interactionPolicy = 'enabled', testID, }) {
9
11
  const { theme } = useTheme();
10
12
  const animation = resolveOverlayAnimation('modal');
@@ -13,13 +15,16 @@ export function Modal({ visible, onDismiss, children, closeOnBackdrop = true, in
13
15
  return null;
14
16
  }
15
17
  return (<Portal layer="modal" visible={visible}>
16
- <View pointerEvents="box-none" style={{
17
- bottom: 0,
18
- left: 0,
19
- position: 'absolute',
20
- right: 0,
21
- top: 0,
22
- }}>
18
+ <View {...boxNonePointerEvents.props} style={[
19
+ boxNonePointerEvents.style,
20
+ {
21
+ bottom: 0,
22
+ left: 0,
23
+ position: 'absolute',
24
+ right: 0,
25
+ top: 0,
26
+ },
27
+ ]}>
23
28
  <Pressable onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined} style={{
24
29
  backgroundColor: theme.semantics.neutral.text,
25
30
  bottom: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,UAAU,KAAK,CAAC,EACpB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,eAAe,GAAG,IAAI,EACtB,iBAAiB,GAAG,SAAS,EAC7B,MAAM,GACK;IACX,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,uBAAuB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AK,CAAC,CAAC;YACL,IAAI,EAAE,CAAC;SACR,CAAC,CAEF;YAAA,CAAC,IAAI,CACH,UAAU,CACV,wBAAwB,CACxB,KAAK,CAAC,CAAC;YACL,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,MAAM;SACd,CAAC,CAEF;cAAA,CAAC,OAAO,CACN,CAAC,CAAC,GAAG,CACL,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,EAAE;YAChB,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;SACtC,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,OAAO,CAAC,QAAQ,CAEhB;gBAAA,CAAC,QAAQ,CACX;cAAA,EAAE,OAAO,CACX;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,MAAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, View } from 'react-native';\n\nimport { FocusScope } from '../../internal/focus/FocusScope';\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Center, Surface } from '../../layout';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { ModalProps } from './types';\n\nexport function Modal({\n visible,\n onDismiss,\n children,\n closeOnBackdrop = true,\n interactionPolicy = 'enabled',\n testID,\n}: ModalProps) {\n const { theme } = useTheme();\n const animation = resolveOverlayAnimation('modal');\n const passive = interactionPolicy === 'passive';\n\n if (!visible) {\n return null;\n }\n\n return (\n <Portal layer=\"modal\" visible={visible}>\n <View\n pointerEvents=\"box-none\"\n style={{\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n >\n <Pressable\n onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}\n style={{\n backgroundColor: theme.semantics.neutral.text,\n bottom: 0,\n left: 0,\n opacity: animation.backdropOpacity,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n testID={testID ? `${testID}-backdrop` : undefined}\n />\n <FocusScope\n active={visible}\n onEscape={passive ? undefined : onDismiss}\n testID={testID ? `${testID}-focus` : undefined}\n >\n <Center\n p=\"l\"\n style={{\n flex: 1,\n }}\n >\n <View\n accessible\n accessibilityViewIsModal\n style={{\n maxWidth: 560,\n width: '100%',\n }}\n >\n <Surface\n p=\"l\"\n style={{\n shadowOpacity: 0.14,\n shadowRadius: 18,\n shadowOffset: { width: 0, height: 8 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n {children}\n </Surface>\n </View>\n </Center>\n </FocusScope>\n </View>\n </Portal>\n );\n}\n"]}
1
+ {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAE9D,MAAM,UAAU,KAAK,CAAC,EACpB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,eAAe,GAAG,IAAI,EACtB,iBAAiB,GAAG,SAAS,EAC7B,MAAM,GACK;IACX,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,uBAA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CAAC,CAE/C;UAAA,CAAC,MAAM,CACL,CAAC,CAAC,GAAG,CACL,KAAK,CAAC,CAAC;YACL,IAAI,EAAE,CAAC;SACR,CAAC,CAEF;YAAA,CAAC,IAAI,CACH,UAAU,CACV,wBAAwB,CACxB,KAAK,CAAC,CAAC;YACL,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,MAAM;SACd,CAAC,CAEF;cAAA,CAAC,OAAO,CACN,CAAC,CAAC,GAAG,CACL,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,EAAE;YAChB,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;SACtC,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,OAAO,CAAC,QAAQ,CAEhB;gBAAA,CAAC,QAAQ,CACX;cAAA,EAAE,OAAO,CACX;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,MAAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, View } from 'react-native';\n\nimport { FocusScope } from '../../internal/focus/FocusScope';\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolvePointerEvents } from '../../internal/resolvePointerEvents';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Center, Surface } from '../../layout';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { ModalProps } from './types';\n\nconst boxNonePointerEvents = resolvePointerEvents('box-none');\n\nexport function Modal({\n visible,\n onDismiss,\n children,\n closeOnBackdrop = true,\n interactionPolicy = 'enabled',\n testID,\n}: ModalProps) {\n const { theme } = useTheme();\n const animation = resolveOverlayAnimation('modal');\n const passive = interactionPolicy === 'passive';\n\n if (!visible) {\n return null;\n }\n\n return (\n <Portal layer=\"modal\" visible={visible}>\n <View\n {...boxNonePointerEvents.props}\n style={[\n boxNonePointerEvents.style,\n {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n ]}\n >\n <Pressable\n onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}\n style={{\n backgroundColor: theme.semantics.neutral.text,\n bottom: 0,\n left: 0,\n opacity: animation.backdropOpacity,\n position: 'absolute',\n right: 0,\n top: 0,\n }}\n testID={testID ? `${testID}-backdrop` : undefined}\n />\n <FocusScope\n active={visible}\n onEscape={passive ? undefined : onDismiss}\n testID={testID ? `${testID}-focus` : undefined}\n >\n <Center\n p=\"l\"\n style={{\n flex: 1,\n }}\n >\n <View\n accessible\n accessibilityViewIsModal\n style={{\n maxWidth: 560,\n width: '100%',\n }}\n >\n <Surface\n p=\"l\"\n style={{\n shadowOpacity: 0.14,\n shadowRadius: 18,\n shadowOffset: { width: 0, height: 8 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n {children}\n </Surface>\n </View>\n </Center>\n </FocusScope>\n </View>\n </Portal>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationItem.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/NavigationItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,OAAe,EACf,MAAM,EACN,iBAAiB,GAClB,EAAE,mBAAmB,qBAmErB"}
1
+ {"version":3,"file":"NavigationItem.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/NavigationItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,OAAe,EACf,MAAM,EACN,iBAAiB,GAClB,EAAE,mBAAmB,qBA8DrB"}
@@ -26,7 +26,7 @@ export function NavigationItem({ item, compact = false, testID, interactionPolic
26
26
  opacity: presentation.opacity,
27
27
  }}>
28
28
  {item.icon ? (<View style={{ marginRight: theme.spacing.s }}>
29
- <Icon color={presentation.contentColor} name={item.icon.name} provider={item.icon.provider} size={compact ? 's' : 'm'}/>
29
+ <Icon {...item.icon} color={presentation.contentColor} size={compact ? 's' : 'm'}/>
30
30
  </View>) : null}
31
31
  <Box flex={1}>
32
32
  <Text color={active && !disabled ? 'primary' : undefined} emphasis={disabled ? 'muted' : 'default'} numberOfLines={1} variant={compact ? 'bodySmall' : 'body'} weight="medium">