@wordpress/components
Version:
UI components for WordPress.
45 lines (42 loc) • 1.46 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = BottomSheetColorCell;
var _i18n = require("@wordpress/i18n");
var _icons = require("@wordpress/icons");
var _cell = _interopRequireDefault(require("./cell"));
var _styles = _interopRequireDefault(require("./styles.scss"));
var _colorIndicator = _interopRequireDefault(require("../../color-indicator"));
var _jsxRuntime = require("react/jsx-runtime");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function BottomSheetColorCell(props) {
const {
color,
withColorIndicator = true,
disabled,
...cellProps
} = props;
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_cell.default, {
...cellProps,
accessibilityRole: "button",
accessibilityHint: /* translators: accessibility text (hint for moving to color settings) */
(0, _i18n.__)('Double tap to go to color settings'),
editable: false,
disabled: disabled,
value: withColorIndicator && !color && (0, _i18n.__)('Default'),
children: [withColorIndicator && color && /*#__PURE__*/(0, _jsxRuntime.jsx)(_colorIndicator.default, {
color: color,
style: _styles.default.colorCircle
}), disabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
icon: _icons.chevronRight
})]
});
}
//# sourceMappingURL=color-cell.native.js.map