Compare commits

...
16 Commits
Author SHA1 Message Date
semantic-release-bot 1df8d22613 chore(release): 3.14.0 [skip ci]
# [3.14.0](https://github.com/expo/react-native-action-sheet/compare/v3.13.1...v3.14.0) (2022-10-03)

### Features

* support cancelButtonTintColor ([#278](https://github.com/expo/react-native-action-sheet/issues/278)) ([2dcd54c](https://github.com/expo/react-native-action-sheet/commit/2dcd54c56f35a64c66f8d9a7d09a9475801cf037))
2022-10-03 19:40:24 +00:00
BradByte 2dcd54c56f feat: support cancelButtonTintColor (#278)
* feat: bump expo to sdk 46
* feat: add support for cancelButtonTintColor
2022-10-03 14:39:47 -05:00
semantic-release-bot 6244df4549 chore(release): 3.13.1 [skip ci]
## [3.13.1](https://github.com/expo/react-native-action-sheet/compare/v3.13.0...v3.13.1) (2022-10-03)

### Bug Fixes

* add return type to connectActionSheet ([#273](https://github.com/expo/react-native-action-sheet/issues/273)) ([f46a5cf](https://github.com/expo/react-native-action-sheet/commit/f46a5cfc473807478c558a733c8adb1440941017))
2022-10-03 18:36:09 +00:00
Danilo Bürger f46a5cfc47 fix: add return type to connectActionSheet (#273)
This avoids importing hoist-non-react-statics in the built d.ts file causing errors when using typescript with esModuleInterop = false
2022-10-03 13:35:33 -05:00
dependabot[bot] 9c6f5be31d chore(deps): bump simple-plist from 1.1.1 to 1.3.1 (#268)
Bumps [simple-plist](https://github.com/wollardj/simple-plist) from 1.1.1 to 1.3.1.
- [Release notes](https://github.com/wollardj/simple-plist/releases)
- [Commits](https://github.com/wollardj/simple-plist/compare/v1.1.1...v1.3.1)

---
updated-dependencies:
- dependency-name: simple-plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:15:43 -05:00
dependabot[bot] 0147d326f9 chore(deps): bump simple-plist from 1.0.0 to 1.3.1 in /example (#269)
Bumps [simple-plist](https://github.com/wollardj/simple-plist) from 1.0.0 to 1.3.1.
- [Release notes](https://github.com/wollardj/simple-plist/releases)
- [Commits](https://github.com/wollardj/simple-plist/compare/v1.0.0...v1.3.1)

---
updated-dependencies:
- dependency-name: simple-plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:15:31 -05:00
dependabot[bot] 47a1711c3c chore(deps-dev): bump semantic-release from 17.4.4 to 19.0.3 (#271)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.4.4 to 19.0.3.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.4.4...v19.0.3)

---
updated-dependencies:
- dependency-name: semantic-release
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:14:41 -05:00
dependabot[bot] 758050480d chore(deps): bump semver-regex from 3.1.3 to 3.1.4 (#270)
Bumps [semver-regex](https://github.com/sindresorhus/semver-regex) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/sindresorhus/semver-regex/releases)
- [Commits](https://github.com/sindresorhus/semver-regex/commits/v3.1.4)

---
updated-dependencies:
- dependency-name: semver-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:14:26 -05:00
dependabot[bot] e4f4246880 chore(deps): bump plist from 3.0.1 to 3.0.5 in /example (#266)
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.1 to 3.0.5.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:13:58 -05:00
dependabot[bot] da6105e8a0 chore(deps): bump ansi-regex from 4.1.0 to 4.1.1 in /example (#265)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:13:48 -05:00
dependabot[bot] 3822febbf8 chore(deps): bump plist from 3.0.1 to 3.0.5 (#264)
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.1 to 3.0.5.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:13:37 -05:00
dependabot[bot] 8999650323 chore(deps): bump cross-fetch from 3.1.4 to 3.1.5 in /example (#262)
Bumps [cross-fetch](https://github.com/lquixada/cross-fetch) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/lquixada/cross-fetch/releases)
- [Commits](https://github.com/lquixada/cross-fetch/compare/v3.1.4...v3.1.5)

---
updated-dependencies:
- dependency-name: cross-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:13:26 -05:00
dependabot[bot] 6e22c372d3 chore(deps): bump async from 2.6.3 to 2.6.4 (#261)
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:13:09 -05:00
dependabot[bot] 02b2db8947 chore(deps): bump async from 2.6.2 to 2.6.4 in /example (#260)
Bumps [async](https://github.com/caolan/async) from 2.6.2 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.2...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:13:00 -05:00
dependabot[bot] 880fe21224 chore(deps): bump url-parse from 1.5.3 to 1.5.10 in /example (#257)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.3...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:12:49 -05:00
dependabot[bot] df363ead72 chore(deps): bump shelljs from 0.8.4 to 0.8.5 in /example (#255)
Bumps [shelljs](https://github.com/shelljs/shelljs) from 0.8.4 to 0.8.5.
- [Release notes](https://github.com/shelljs/shelljs/releases)
- [Changelog](https://github.com/shelljs/shelljs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/shelljs/shelljs/compare/v0.8.4...v0.8.5)

---
updated-dependencies:
- dependency-name: shelljs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:12:38 -05:00
12 changed files with 4139 additions and 3125 deletions

No files matched your search

+14
View File
@@ -1,5 +1,19 @@
# Changelog
# [3.14.0](https://github.com/expo/react-native-action-sheet/compare/v3.13.1...v3.14.0) (2022-10-03)
### Features
* support cancelButtonTintColor ([#278](https://github.com/expo/react-native-action-sheet/issues/278)) ([2dcd54c](https://github.com/expo/react-native-action-sheet/commit/2dcd54c56f35a64c66f8d9a7d09a9475801cf037))
## [3.13.1](https://github.com/expo/react-native-action-sheet/compare/v3.13.0...v3.13.1) (2022-10-03)
### Bug Fixes
* add return type to connectActionSheet ([#273](https://github.com/expo/react-native-action-sheet/issues/273)) ([f46a5cf](https://github.com/expo/react-native-action-sheet/commit/f46a5cfc473807478c558a733c8adb1440941017))
# [3.13.0](https://github.com/expo/react-native-action-sheet/compare/v3.12.0...v3.13.0) (2022-01-10)
+6
View File
@@ -96,6 +96,12 @@ class App extends React.Component<Props, State> {
onSelection={this._updateSelectionText}
showActionSheetWithOptions={showActionSheetWithOptions}
/>
<ShowActionSheetButton
title="Cancel Button Tint Color"
withCancelButtonTintColor
onSelection={this._updateSelectionText}
showActionSheetWithOptions={showActionSheetWithOptions}
/>
<ShowActionSheetButton
title="iPad Anchor"
withAnchor
+4
View File
@@ -19,6 +19,7 @@ interface Props {
withIcons?: boolean;
withSeparators?: boolean;
withCustomStyles?: boolean;
withCancelButtonTintColor?: boolean;
withAnchor?: boolean;
useModal?: boolean;
}
@@ -32,6 +33,7 @@ export default class ShowActionSheetButton extends React.PureComponent<Props> {
withSeparators: false,
withCustomStyles: false,
withAnchor: false,
withCancelButtonTintColor: false,
onSelection: null,
useModal: false,
};
@@ -46,6 +48,7 @@ export default class ShowActionSheetButton extends React.PureComponent<Props> {
withIcons,
withSeparators,
withCustomStyles,
withCancelButtonTintColor,
onSelection,
showActionSheetWithOptions,
useModal,
@@ -98,6 +101,7 @@ export default class ShowActionSheetButton extends React.PureComponent<Props> {
{
options,
cancelButtonIndex,
cancelButtonTintColor: withCancelButtonTintColor ? '#D93F0B' : undefined,
destructiveButtonIndex,
disabledButtonIndices,
title,
+10 -10
View File
@@ -13,18 +13,18 @@
},
"dependencies": {
"@expo/react-native-action-sheet": "../src",
"@expo/vector-icons": "^12.0.0",
"expo": "^43.0.0-beta.3",
"@expo/vector-icons": "^13.0.0",
"expo": "^46.0.0",
"hoist-non-react-statics": "^3.3.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.2",
"react-native-web": "0.17.1"
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.6",
"react-native-web": "~0.18.7"
},
"devDependencies": {
"@types/react": "~17.0.21",
"@types/react-native": "~0.64.12",
"babel-preset-expo": "8.5.1",
"typescript": "~4.3.5"
"@types/react": "~18.0.0",
"@types/react-native": "~0.69.1",
"babel-preset-expo": "~9.2.0",
"typescript": "^4.6.3"
}
}
+2820 -1149
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@expo/react-native-action-sheet",
"version": "3.13.0",
"version": "3.14.0",
"description": "A cross-platform ActionSheet for React Native",
"react-native": "lib/module/index.js",
"types": "lib/typescript/index.d.ts",
@@ -45,7 +45,7 @@
"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",
"semantic-release": "^19.0.3",
"typescript": "^3.5.3"
},
"peerDependencies": {
+8 -1
View File
@@ -119,6 +119,8 @@ export default class ActionGroup extends React.Component<Props> {
const {
options,
icons,
cancelButtonIndex,
cancelButtonTintColor,
destructiveButtonIndex,
disabledButtonIndices,
destructiveColor = DESTRUCTIVE_COLOR,
@@ -141,7 +143,12 @@ export default class ActionGroup extends React.Component<Props> {
? tintColor
: (textStyle || {}).color || BLACK_87PC_TRANSPARENT;
const disabled = isIndexDisabled(i, disabledButtonIndices);
const color = isIndexDestructive(i, destructiveButtonIndex) ? destructiveColor : defaultColor;
const isCancelButton = i === cancelButtonIndex;
const color = isIndexDestructive(i, destructiveButtonIndex)
? destructiveColor
: isCancelButton
? cancelButtonTintColor || defaultColor
: defaultColor;
const iconSource = icons != null ? icons[i] : null;
optionViews.push(
+9 -2
View File
@@ -21,13 +21,20 @@ export default class ActionSheet extends React.Component<Props> {
showActionSheetWithOptions(dataOptions: ActionSheetIOSOptions, onSelect: onSelect) {
// ...dataOptions include other keys which use in android and web, thats why `Android-Only options` Crash on IOS
const { cancelButtonIndex, destructiveButtonIndex, options, tintColor, disabledButtonIndices } =
dataOptions;
const {
cancelButtonIndex,
destructiveButtonIndex,
options,
tintColor,
cancelButtonTintColor,
disabledButtonIndices,
} = dataOptions;
const iosOptions: ActionSheetIOSOptions = {
cancelButtonIndex,
destructiveButtonIndex,
options,
tintColor,
cancelButtonTintColor,
disabledButtonIndices,
// A null title or message on iOS causes a crash
title: dataOptions.title || undefined,
+4
View File
@@ -141,6 +141,8 @@ export default class ActionSheet extends React.Component<Props, State> {
showSeparators,
containerStyle,
separatorStyle,
cancelButtonIndex,
cancelButtonTintColor,
} = options;
return (
<TouchableWithoutFeedback importantForAccessibility="yes" onPress={this._selectCancelButton}>
@@ -165,6 +167,8 @@ export default class ActionSheet extends React.Component<Props, State> {
options={optionsArray}
icons={icons}
tintIcons={tintIcons === undefined ? true : tintIcons}
cancelButtonIndex={cancelButtonIndex}
cancelButtonTintColor={cancelButtonTintColor}
destructiveButtonIndex={destructiveButtonIndex}
destructiveColor={destructiveColor}
disabledButtonIndices={disabledButtonIndices}
+1 -1
View File
@@ -6,7 +6,7 @@ import { ActionSheetProps } from './types';
export default function connectActionSheet<OwnProps = any>(
WrappedComponent: React.ComponentType<OwnProps & ActionSheetProps>
) {
): React.FunctionComponent<OwnProps & ActionSheetProps> {
const ConnectedActionSheet = (props: OwnProps) => {
return (
<Consumer>
+1
View File
@@ -15,6 +15,7 @@ export interface ActionSheetIOSOptions {
message?: string;
tintColor?: string;
cancelButtonIndex?: number;
cancelButtonTintColor?: string;
destructiveButtonIndex?: number | number[];
anchor?: number;
userInterfaceStyle?: 'light' | 'dark';
+1260 -1960
View File
File diff suppressed because it is too large. Load diff