@audira/carbon-react-native
Version:
Build React Native apps with component and shared patterns using Carbon
41 lines (40 loc) • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ActionableInlineVariant = void 0;
var _react = require("react");
var _VariantContextProvider = require("../../_VariantContextProvider.js");
var _index = require("../../base/index.js");
var _index2 = require("../../subtitle/index.js");
var _ButtonGhost = require("../_ButtonGhost.js");
var _jsxRuntime = require("react/jsx-runtime");
const ActionableInlineVariant = exports.ActionableInlineVariant = /*#__PURE__*/(0, _react.forwardRef)(function ActionableInlineVariant({
color,
Icon,
subtitle,
subtitleStyle,
buttonProps,
...props
}, ref) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_VariantContextProvider.VariantContextProvider, {
color: color,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Base, {
...props,
inline: true,
Icon: Icon,
iconClose: true,
body: subtitle && (typeof subtitle === 'string' || typeof subtitle === 'number') ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Subtitle, {
style: subtitleStyle,
children: subtitle
}) : subtitle,
nodes: {
beforeButtonClose: buttonProps ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGhost.ButtonGhost, {
...buttonProps
}) : undefined
},
ref: ref
})
});
});
//# sourceMappingURL=ActionableInlineVariant.js.map