@carbon/ibm-products
Version:
Carbon for IBM Products
51 lines (49 loc) • 1.65 kB
JavaScript
/**
* Copyright IBM Corp. 2020, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { __toESM } from "../../_virtual/_rolldown/runtime.js";
import { require_classnames } from "../../node_modules/classnames/index.js";
import { pkg } from "../../settings.js";
import { getDevtoolsProps } from "../../global/js/utils/devtools.js";
import React from "react";
import PropTypes from "prop-types";
import { Button } from "@carbon/react";
//#region src/components/InlineTip/InlineTipButton.tsx
/**
* Copyright IBM Corp. 2023, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
const blockClass = `${pkg.prefix}--inline-tip__button`;
const componentName = "InlineTipButton";
/**
* This is a standard Carbon button, styled specifically for use inside InlineTip.
*/
const InlineTipButton = React.forwardRef(({ children, className, ...rest }, ref) => {
return /* @__PURE__ */ React.createElement(Button, {
...rest,
className: (0, import_classnames.default)(blockClass, className),
ref,
...getDevtoolsProps(componentName),
size: "md",
kind: "ghost"
}, children);
});
InlineTipButton.displayName = componentName;
InlineTipButton.propTypes = {
/**
* Provide the contents of the InlineTipButton.
*/
children: PropTypes.node.isRequired,
/**
* Provide an optional class to be applied to the containing node.
*/
className: PropTypes.string
};
//#endregion
export { InlineTipButton };