@wordpress/components
Version:
UI components for WordPress.
34 lines (32 loc) • 769 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@wordpress/element";
/**
* WordPress dependencies
*/
import { memo } from '@wordpress/element';
/**
* Internal dependencies
*/
import SwitchCell from '../mobile/bottom-sheet/switch-cell';
const ToggleControl = memo(({
label,
checked,
help,
instanceId,
className,
onChange,
...props
}) => {
const id = `inspector-toggle-control-${instanceId}`;
return createElement(SwitchCell, _extends({
label: label,
id: id,
help: help,
className: className,
value: checked,
onValueChange: onChange,
"aria-describedby": !!help ? id + '__help' : undefined
}, props));
});
export default ToggleControl;
//# sourceMappingURL=index.native.js.map