@audira/carbon-react-native
Version:
Build React Native apps with component and shared patterns using Carbon
37 lines (36 loc) • 1.11 kB
JavaScript
;
import { forwardRef } from 'react';
import { VariantContextProvider } from "../../_VariantContextProvider.js";
import { Base } from "../../base/index.js";
import { Subtitle } from "../../subtitle/index.js";
import { ButtonGhost } from "../_ButtonGhost.js";
import { jsx as _jsx } from "react/jsx-runtime";
export const ActionableInlineVariant = /*#__PURE__*/forwardRef(function ActionableInlineVariant({
color,
Icon,
subtitle,
subtitleStyle,
buttonProps,
...props
}, ref) {
return /*#__PURE__*/_jsx(VariantContextProvider, {
color: color,
children: /*#__PURE__*/_jsx(Base, {
...props,
inline: true,
Icon: Icon,
iconClose: true,
body: subtitle && (typeof subtitle === 'string' || typeof subtitle === 'number') ? /*#__PURE__*/_jsx(Subtitle, {
style: subtitleStyle,
children: subtitle
}) : subtitle,
nodes: {
beforeButtonClose: buttonProps ? /*#__PURE__*/_jsx(ButtonGhost, {
...buttonProps
}) : undefined
},
ref: ref
})
});
});
//# sourceMappingURL=ActionableInlineVariant.js.map