UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

42 lines 1.65 kB
var _span, _AlignmentHelper, _AlignmentHelper2; import React from 'react'; import AlignmentHelper from "../../../shared/AlignmentHelper.js"; import { isTrue } from "../../../shared/component-helper.js"; import IconPrimary from "../../icon-primary/IconPrimary.js"; export default function ButtonContent({ title = null, content = null, custom_content = null, icon = null, icon_size = 'default', bounding = null, skeleton = null, isIconOnly = null, iconElement = null }) { return React.createElement(React.Fragment, null, isTrue(bounding) && (_span || (_span = React.createElement("span", { key: "button-bounding", className: "dnb-button__bounding" }))), custom_content && React.createElement(React.Fragment, { key: "button-custom-content" }, custom_content), content && React.createElement(React.Fragment, null, _AlignmentHelper || (_AlignmentHelper = React.createElement(AlignmentHelper, { key: "button-alignment", className: "dnb-button__alignment", pseudoElementOnly: true })), React.createElement("span", { key: "button-text", className: "dnb-button__text dnb-skeleton--show-font" }, content)), !content && icon && (_AlignmentHelper2 || (_AlignmentHelper2 = React.createElement(AlignmentHelper, { key: "button-alignment", className: "dnb-button__alignment", pseudoElementOnly: true }))), icon && (iconElement || React.createElement(IconPrimary, { key: "button-icon", className: "dnb-button__icon", icon: icon, size: icon_size, "aria-hidden": isIconOnly && !title ? null : true, skeleton: skeleton }))); } //# sourceMappingURL=ButtonContent.js.map