{"_id":"@acflow/react-native-action-sheet","_rev":"2-93337fbfee64789dae42fc04c94040f0","name":"@acflow/react-native-action-sheet","dist-tags":{"latest":"3.12.0"},"versions":{"3.12.0":{"name":"@acflow/react-native-action-sheet","version":"3.12.0","description":"A cross-platform ActionSheet for React Native","react-native":"lib/module/index.js","types":"lib/typescript/index.d.ts","main":"lib/commonjs/index.js","module":"lib/module/index.js","scripts":{"prepare":"bob build","build":"bob build","type-check":"tsc --noEmit","lint":"eslint . --fix","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/expo/react-native-action-sheet.git"},"keywords":["expo","react-native","action-sheet"],"author":{"name":"Jesse Ruder","email":"jesse@sixfivezero.net"},"license":"MIT","bugs":{"url":"https://github.com/expo/react-native-action-sheet/issues"},"homepage":"https://github.com/expo/react-native-action-sheet","devDependencies":{"@react-native-community/bob":"^0.6.1","@semantic-release/changelog":"^5.0.1","@semantic-release/git":"^9.0.0","@types/react":"^16.8.23","@types/react-native":"^0.57.65","eslint":"^7.32.0","eslint-config-universe":"^8.0.0","husky":"^3.0.0","lint-staged":"^9.2.0","prettier":"^2.3.2","react":"^16.8.6","react-native":"https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz","semantic-release":"^17.4.4","typescript":"^3.5.3"},"peerDependencies":{"react":">=16.3.0"},"@react-native-community/bob":{"source":"src","output":"lib","targets":["commonjs","module","typescript"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["yarn lint","git add"]},"dependencies":{"@types/hoist-non-react-statics":"^3.3.1","hoist-non-react-statics":"^3.3.0"},"gitHead":"bd0c001215b95bfb7432c58a95eaa5b1fc7ef95e","_id":"@acflow/react-native-action-sheet@3.12.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.4","dist":{"integrity":"sha512-aVxTyCjlXdYIDgeaBh9SocP/1JG8LXNob+MMLSMg+6+6ugd13j5sMC1HSh7z33LhRPiumJkNqFhPsBw0Vu5Ghg==","shasum":"ba1685c2141901f8441eae2e00d70b11d9f5beec","tarball":"https://registry.npmjs.org/@acflow/react-native-action-sheet/-/react-native-action-sheet-3.12.0.tgz","fileCount":48,"unpackedSize":156172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuFDQCRA9TVsSAnZWagAAQSoP/1haQc6LQMJFl+zvlbYo\nd4/12JSGt60J0RcRkLVMYN7WGaOxoqOgPxMwlKBx3k5FHNmtCMmICP/WPaTK\n9GsWeZd/igji0nKL2apEOF1gQnHkEmChkqjqgbeh5HnWztWlXMTQTAfnffxc\nPodSZvzd0Mr/MvlUo8qsgPyDFDnY7xQOlvjFn6W1s3/GckcQoIMSth2gpnpt\nhXVp0Luk5B8uGlXvdNQFpeWNTZFqxN6MW9NWxjr1ML3R6oP3EGZYoOFAlGLM\nEFvmUH8xFFWStpBvGjz1pkbHb1YVmKAYoPCUJh0NcDFgp1pYFtegDqBOLL3y\n6OclABW7UgIXNVPWC+su+lfXmp6UrcM+ZMDUe6OGmXosvuzjLbuNyZBsK95R\nsiXjriLAqPKj7sUoFM9gOkIjz90TiLybF/820KcoV/q2HgUE4Tm24LaavVxp\n6/m4LLNl/9AghX4qRgwDjfdZyKMYtIjCroV9Np/4qN7G/YMKQaT40kmyudXC\n2doGIv0D/z1O+An7M4l0ItrPoiS7fxDoscj2E1n4lkSxsuAhzT/zdvRL7a1q\nVC8EdEIVopmTAxuBX1m/u0YNKTbi20X929+bT5E24aUW3bKLu8+/hdyrLLIH\nJilDtTTJOURcvNv2qraptqGFz3xqXMFQcC6cusnDP4T0/1fhZGDH/Bp6/XtP\nYEKF\r\n=HFvo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8NSUUKcUtCJwISvNtWyrkFTNh5LM2DcNr/zZLwPbkzAiEAwjOIWbegXGqI/AdQ0GFPWOsgj6F7FyIAqNPRPiQvMgI="}]},"_npmUser":{"name":"bevvvis","email":"bevis@acflow.com"},"directories":{},"maintainers":[{"name":"bevvvis","email":"bevis@acflow.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-action-sheet_3.12.0_1639469264521_0.7517710098836441"},"_hasShrinkwrap":false}},"time":{"created":"2021-12-14T08:07:44.467Z","3.12.0":"2021-12-14T08:07:44.692Z","modified":"2022-06-08T06:34:09.707Z"},"maintainers":[{"email":"maojunkai@acflow.com","name":"junkai"},{"email":"bevis@acflow.com","name":"bevvvis"}],"description":"A cross-platform ActionSheet for React Native","homepage":"https://github.com/expo/react-native-action-sheet","keywords":["expo","react-native","action-sheet"],"repository":{"type":"git","url":"git+https://github.com/expo/react-native-action-sheet.git"},"author":{"name":"Jesse Ruder","email":"jesse@sixfivezero.net"},"bugs":{"url":"https://github.com/expo/react-native-action-sheet/issues"},"license":"MIT","readme":"# react-native-action-sheet\n\n[![npm](https://img.shields.io/npm/v/@expo/react-native-action-sheet.svg?style=flat-square)](https://www.npmjs.com/package/@expo/react-native-action-sheet)\n[![License: MIT](https://img.shields.io/github/license/nd-02110114/goofi-mobile.svg)](https://opensource.org/licenses/MIT)\n[![Discord](https://img.shields.io/badge/discord-expo-green?style=flat-square&logo=discord)](https://discord.gg/4gtbPAdpaE)\n\nActionSheet is a cross-platform React Native component that uses the native UIActionSheet on iOS and a JS implementation on Android. Almost a drop in replacement for [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios.html) except it cannot be called statically.\n\n| iOS                                                                                                                        | Android                                                                                                                        | Web                                                                                                                        |\n| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |\n| <img  src=\"https://raw.githubusercontent.com/expo/react-native-action-sheet/master/gif/ios.gif\" width=\"200\" height=\"400\"/> | <img  src=\"https://raw.githubusercontent.com/expo/react-native-action-sheet/master/gif/android.gif\" width=\"200\" height=\"400\"/> | <img  src=\"https://raw.githubusercontent.com/expo/react-native-action-sheet/master/gif/web.gif\" width=\"400\" height=\"400\"/> |\n\n## Installation\n\n```\n$ npm install @expo/react-native-action-sheet -S\n```\n\nor\n\n```\n$ yarn add @expo/react-native-action-sheet\n```\n\n## A basic ActionSheet Setup\n\n### 1. Wrap your top-level component with `<ActionSheetProvider />`\n\n```es6\nimport { ActionSheetProvider } from '@expo/react-native-action-sheet';\n\nclass AppContainer extends React.Component {\n  render() {\n    return (\n      <ActionSheetProvider>\n        <ConnectedApp />\n      </ActionSheetProvider>\n    );\n  }\n}\n```\n\n### 2. Connect your component which uses showActionSheetWithOptions.\n\n```es6\nimport { connectActionSheet } from '@expo/react-native-action-sheet';\n\nclass App extends React.Component {\n  /* ... */\n}\n\nconst ConnectedApp = connectActionSheet(App);\n\nexport default ConnectedApp;\n```\n\n`App` component can access the actionSheet method as `this.props.showActionSheetWithOptions`\n\n```es6\n_onOpenActionSheet = () => {\n  // Same interface as https://facebook.github.io/react-native/docs/actionsheetios.html\n  const options = ['Delete', 'Save', 'Cancel'];\n  const destructiveButtonIndex = 0;\n  const cancelButtonIndex = 2;\n\n  this.props.showActionSheetWithOptions(\n    {\n      options,\n      cancelButtonIndex,\n      destructiveButtonIndex,\n    },\n    (buttonIndex) => {\n      // Do something here depending on the button index selected\n    }\n  );\n};\n```\n\nYou can use a hook instead of the higher order component if you are on React 16.8 or newer.\n\n```es6\nimport { useActionSheet } from '@expo/react-native-action-sheet';\n\nexport default function App() {\n  const { showActionSheetWithOptions } = useActionSheet();\n  /* ... */\n}\n```\n\n## Options\n\nThe goal of this library is to mimic the native iOS and Android ActionSheets as closely as possible.\n\nThis library can also be used in the browser with Expo for web.\n\n### Universal Props\n\nThe same options available on React Native's [ActionSheetIOS](https://reactnative.dev/docs/0.64/actionsheetios#showactionsheetwithoptions) component exist for both iOS and Android in this library. Note: `disabledButtonIndices` is only available for iOS in Expo 43+ or RN 0.64.0+.\n\n### iOS Only Props\n\n| Name               | Type   | Required | Default |\n| ------------------ | ------ | -------- | ------- |\n| anchor             | number | No       |         |\n| userInterfaceStyle | string | No       |         |\n\n#### `anchor` (optional)\n\niPad only option that allows for docking the action sheet to a node. See [ShowActionSheetButton.tsx](/example/ShowActionSheetButton.tsx) for an example on how to implement this.\n\n#### `userInterfaceStyle` (optional)\n\nThe interface style used for the action sheet, can be set to `light` or `dark`, otherwise the default system style will be used.\n\n### Android/Web-Only Props\n\nThe below props allow modification of the Android ActionSheet. They have no effect on the look on iOS as the native iOS Action Sheet does not have options for modifying these options.\n\n| Name             | Type                              | Required | Default                           |\n| ---------------- | --------------------------------- | -------- | --------------------------------- |\n| icons            | array of required images or icons | No       |                                   |\n| tintIcons        | boolean                           | No       | true                              |\n| textStyle        | TextStyle                         | No       |                                   |\n| titleTextStyle   | TextStyle                         | No       |                                   |\n| messageTextStyle | TextStyle                         | No       |                                   |\n| autoFocus        | boolean                           | No       | false                             |\n| showSeparators   | boolean                           | No       | false                             |\n| containerStyle   | ViewStyle                         | No       |                                   |\n| separatorStyle   | ViewStyle                         | No       |                                   |\n| useModal         | boolean                           | No       | false (true if autoFocus is true) |\n| destructiveColor | string                            | No       | #d32f2f                           |\n\n#### `icons` (optional)\n\nShow icons to go along with each option. If image source paths are provided via `require`, images will be rendered for you. Alternatively, you can provide an array of elements such as vector icons, pre-rendered Images, etc.\n\n#### `tintIcons` (optional)\n\nIcons by default will be tinted to match the text color. When set to false, the icons will be the color of the source image. This is useful if you want to use multicolor icons. If you provide your own nodes/pre-rendered icons rather than required images in the `icons` array, you will need to tint them appropriately before providing them in the array of `icons`; `tintColor` will not be applied to icons unless they are images from a required source.\n\n#### `textStyle` (optional)\n\nApply any text style props to the options. If the `tintColor` option is provided, it takes precedence over a color text style prop.\n\n#### `titleTextStyle` (optional)\n\nApply any text style props to the title if present.\n\n#### `messageTextStyle` (optional)\n\nApply any text style props to the message if present.\n\n#### `autoFocus`: (optional)\n\nIf true, will give the first option screen reader focus automatically when the action sheet becomes visible.\nOn iOS, this is the default behavior of the native action sheet.\n\n#### `showSeparators`: (optional)\n\nShow separators between items. On iOS, separators always show so this prop has no effect.\n\n#### `containerStyle`: (optional)\n\nApply any view style props to the container rather than use the default look (e.g. dark mode).\n\n#### `separatorStyle`: (optional)\n\nModify the look of the separators rather than use the default look.\n\n#### `useModal`: (optional)\n\nWrap the ActionSheet with a Modal, in order to show in front of other Modals that were already opened ([issue reference](https://github.com/expo/react-native-action-sheet/issues/164)).\n\n#### `destructiveColor`: (optional)\n\nModify color for text of destructive option.\n\n## ActionSheetProvider Props\n\nThe following props can be set directly on the `ActionSheetProvider`\n\n#### `useNativeDriver` (optional)\n\nWindows only option that provides the option to disable the [native animation](https://reactnative.dev/docs/animated#using-the-native-driver) driver for React Native Windows projects targeting _Windows 10 Version-1809 ; Build-10.0.17763.0_ and earlier. `useNativeDriver` is [supported in Version-1903 and later](https://microsoft.github.io/react-native-windows/docs/win10-compat) so if your project is targeting that, you don't need to set this prop.\n\n## Try it out\n\nTry it in Expo: https://expo.io/@community/react-native-action-sheet-example\n\n## Example\n\nSee the [example app](https://github.com/expo/react-native-action-sheet/tree/master/example).\n\n### Usage\n\n```\n$ cd example\n$ yarn\n\n// build simulator\n$ yarn ios\n$ yarn android\n\n// web\n$ yarn web\n```\n\n## Development\n\n### Setup\n\n```\n$ git clone git@github.com:expo/react-native-action-sheet.git\n$ cd react-native-action-sheet\n$ yarn\n```\n\n### Build\n\nWe use [bob](https://github.com/react-native-community/bob).\n\n```\n$ yarn build\n```\n\n### Lint & Format\n\n```\n// tsc\n$ yarn type-check\n\n// ESLint + Prettier\n$ yarn lint\n```\n","readmeFilename":"README.md"}