New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

expo-checkbox

Package Overview
Dependencies
Maintainers
25
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-checkbox - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

29

build/Checkbox.types.d.ts

@@ -6,16 +6,31 @@ import { ColorValue, NativeSyntheticEvent, ViewProps } from 'react-native';

}>;
export interface CheckboxProps extends ViewProps {
/** The value of the checkbox. If true the checkbox will be turned on. Default value is false. */
export declare type CheckboxProps = ViewProps & {
/**
* Value indicating if the checkbox should be rendered as checked or not. Default value is `false`.
*/
value?: boolean;
/** If true the user won't be able to toggle the checkbox. Default value is false. */
/**
* If the checkbox is disabled, it becomes opaque and uncheckable.
*/
disabled?: boolean;
/** Sets the tint color of the checkbox */
/**
* The tint or color of the checkbox. This overrides the disabled opaque style.
*/
color?: ColorValue;
/** Used in case the props change removes the component. */
/**
* Callback that is invoked when the user presses the checkbox.
* @param event A native event containing the checkbox change.
*/
onChange?: (event: CheckboxEvent) => void;
/** Invoked with the new value when the value changes. */
/**
* Callback that is invoked when the user presses the checkbox.
* @param value A boolean indicating the new checked state of the checkbox.
*/
onValueChange?: (value: boolean) => void;
}
};
export declare type CheckboxComponent = React.FC<CheckboxProps> & {
/**
* @deprecated
*/
isAvailableAsync: () => Promise<boolean>;
};

@@ -1,1 +0,3 @@

export { default } from './CheckboxUnavailable';
import { CheckboxComponent } from './Checkbox.types';
declare const ExpoCheckbox: CheckboxComponent;
export default ExpoCheckbox;

@@ -1,2 +0,56 @@

export { default } from './CheckboxUnavailable';
import React, { useCallback } from 'react';
import { StyleSheet, Image, Pressable, Platform } from 'react-native';
const checkmarkBase64 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAACXBIWXMAFxGDABcRgwEFErJzAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5r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gA1ssIuIBixGQwS0SEfGABQnIBCaPiHjAogRkEpNGRDxgYQIykckiIh6wOAGZzCQREQ+AER3H8ePjOP79GNPfHsfxe71/RwC84hgzIuIBMINjrIiIB8BMjjEiIh4AM+ocEfEAmFmniIgHwAoujoh4AKzkooiIB8CKiiMiHgArK4qIeADsoHFExANgJ40iIh4AO3oyIuIBsLMHIyIeANwdEfEA4HdujIh4APC5NyIiHgC87pWIiAcAb/skIuIBwO2O4/jJcRy/OI7jXe8tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADA5/4PiZTk2kr08uAAAAAASUVORK5CYII=';
const ExpoCheckbox = (props) => {
const { color, disabled, onChange, onValueChange, style, value, ...other } = props;
const handleChange = useCallback(() => {
onValueChange && onValueChange(!value);
}, [onValueChange, value]);
return (React.createElement(Pressable, { ...other, disabled: disabled,
// Announces "checked" status and "checkbox" as the focused element
accessibilityRole: "checkbox", accessibilityState: { disabled, checked: value }, style: [
styles.root,
style,
value && styles.checked,
!!color && { backgroundColor: value ? color : undefined, borderColor: color },
disabled && styles.disabled,
value && disabled && styles.checkedAndDisabled,
], onPress: handleChange }, value && (React.createElement(Image, { source: {
uri: checkmarkBase64,
}, style: StyleSheet.absoluteFill }))));
};
ExpoCheckbox.displayName = 'Checkbox';
export default ExpoCheckbox;
const defaultEnabledColor = Platform.select({
ios: '#007AFF',
android: '#009688',
});
const defaultGrayColor = '#657786';
const disabledGrayColor = '#CCD6DD';
const disabledCheckedGrayColor = '#AAB8C2';
const styles = StyleSheet.create({
root: {
height: 20,
width: 20,
borderRadius: 2,
borderWidth: 2,
borderColor: defaultGrayColor,
},
checked: {
backgroundColor: defaultEnabledColor,
borderColor: defaultEnabledColor,
},
disabled: {
borderColor: disabledGrayColor,
backgroundColor: 'transparent',
},
checkedAndDisabled: {
backgroundColor: disabledCheckedGrayColor,
borderColor: disabledCheckedGrayColor,
},
});
ExpoCheckbox.isAvailableAsync = () => {
console.warn('Checkbox.isAvailableAsync() is deprecated and will be removed in future releases');
return Promise.resolve(true);
};
//# sourceMappingURL=ExpoCheckbox.js.map

@@ -13,3 +13,3 @@ /**

import { StyleSheet, View, unstable_createElement as createElement } from 'react-native';
const ExpoCheckbox = props => {
const ExpoCheckbox = (props) => {
const { color, disabled, onChange, onValueChange, style, value, ...other } = props;

@@ -22,3 +22,3 @@ const handleChange = useCallback((event) => {

}, [onChange, onValueChange]);
const fakeControl = (React.createElement(View, { style: [
const fakeControl = (React.createElement(View, { pointerEvents: "none", style: [
styles.fakeControl,

@@ -32,2 +32,3 @@ value && styles.fakeControlChecked,

const nativeControl = createElement('input', {
accessibilityState: { disabled, checked: value },
checked: value,

@@ -39,8 +40,7 @@ disabled,

});
return (React.createElement(View, Object.assign({}, other, { style: [styles.root, style, disabled && styles.cursorDefault] }),
fakeControl,
nativeControl));
return (React.createElement(View, { ...other, style: [styles.root, style, disabled && styles.cursorDefault] },
nativeControl,
fakeControl));
};
ExpoCheckbox.displayName = 'Checkbox';
ExpoCheckbox.isAvailableAsync = async () => true;
const styles = StyleSheet.create({

@@ -63,2 +63,3 @@ root: {

fakeControl: {
...StyleSheet.absoluteFillObject,
alignItems: 'center',

@@ -92,9 +93,14 @@ backgroundColor: '#fff',

margin: 0,
opacity: 0,
padding: 0,
width: '100%',
// @ts-ignore
WebkitAppearance: 'none',
},
});
export default ExpoCheckbox;
ExpoCheckbox.isAvailableAsync = () => {
console.warn('Checkbox.isAvailableAsync() is deprecated and will be removed in future releases');
return Promise.resolve(true);
};
export const name = 'ExpoCheckbox';
//# sourceMappingURL=ExpoCheckbox.web.js.map

@@ -11,2 +11,10 @@ # Changelog

### 💡 Others
## 2.0.0 — 2021-09-28
### 🛠 Breaking changes
- Remove `isAvailableAsync()` and reimplement module in javascript. ([#13510](https://github.com/expo/expo/pull/13510) by [@ajsmth](https://github.com/ajsmth))
## 1.0.3 — 2021-03-10

@@ -13,0 +21,0 @@

{
"name": "expo-checkbox",
"version": "1.0.3",
"description": "Checkbox for Android and web",
"version": "2.0.0",
"description": "Basic checkbox for iOS, Android, and web",
"main": "build/Checkbox.js",

@@ -31,3 +31,3 @@ "types": "build/Checkbox.d.ts",

"license": "MIT",
"homepage": "https://docs.expo.io/versions/latest/sdk/checkbox",
"homepage": "https://docs.expo.dev/versions/latest/sdk/checkbox",
"devDependencies": {

@@ -39,3 +39,3 @@ "expo-module-scripts": "^2.0.0"

},
"gitHead": "20fd5d772b3909444cf5c981845625801fe51e78"
"gitHead": "1fffde73411ee7a642b98f1506a8de921805d52b"
}
import { ColorValue, NativeSyntheticEvent, ViewProps } from 'react-native';
// @docsMissing
export type CheckboxEvent = NativeSyntheticEvent<{ target: number; value: boolean }>;
export interface CheckboxProps extends ViewProps {
/** The value of the checkbox. If true the checkbox will be turned on. Default value is false. */
// @needsAudit
export type CheckboxProps = ViewProps & {
/**
* Value indicating if the checkbox should be rendered as checked or not. Default value is `false`.
*/
value?: boolean;
/** If true the user won't be able to toggle the checkbox. Default value is false. */
/**
* If the checkbox is disabled, it becomes opaque and uncheckable.
*/
disabled?: boolean;
/** Sets the tint color of the checkbox */
/**
* The tint or color of the checkbox. This overrides the disabled opaque style.
*/
color?: ColorValue;
/** Used in case the props change removes the component. */
/**
* Callback that is invoked when the user presses the checkbox.
* @param event A native event containing the checkbox change.
*/
onChange?: (event: CheckboxEvent) => void;
/** Invoked with the new value when the value changes. */
/**
* Callback that is invoked when the user presses the checkbox.
* @param value A boolean indicating the new checked state of the checkbox.
*/
onValueChange?: (value: boolean) => void;
}
};
// @docsMissing
export type CheckboxComponent = React.FC<CheckboxProps> & {
/**
* @deprecated
*/
isAvailableAsync: () => Promise<boolean>;
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc