UNPKG

@carbon/ibm-products

Version:
65 lines (63 loc) 2.25 kB
/** * 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. */ const require_runtime = require("../../../_virtual/_rolldown/runtime.js"); const require_index = require("../../../node_modules/classnames/index.js"); const require_settings = require("../../../settings.js"); const require_devtools = require("../../../global/js/utils/devtools.js"); let react = require("react"); react = require_runtime.__toESM(react); let prop_types = require("prop-types"); prop_types = require_runtime.__toESM(prop_types); //#region src/components/Card/next/CardAction.tsx /** * Copyright IBM Corp. 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. */ var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default); const blockClass = `${require_settings.pkg.prefix}--card-next`; const componentName = "CardAction"; /** * CardAction is a wrapper for interactive elements in the card footer. * Its presence signals action-set layout to the footer (no padding, auto * border, stretch behavior). * * Note: do not use CardAction inside a clickable card — clickable cards * should not contain interactive elements (see usage guidelines). */ let CardAction = (0, react.forwardRef)(({ children, className, ...rest }, ref) => { return /* @__PURE__ */ react.default.createElement("div", { ...rest, ref, className: (0, import_classnames.default)(`${blockClass}__action`, className), ...require_devtools.getDevtoolsProps(componentName) }, children); }); CardAction.propTypes = { /** * Provide the contents of the CardAction. */ children: prop_types.default.node, /** * Provide an optional class to be applied to the containing node. */ className: prop_types.default.string, /** * Label shown in the overflow menu when this action is hidden. */ label: prop_types.default.string }; CardAction = require_settings.pkg.checkComponentEnabled(CardAction, componentName); CardAction.displayName = componentName; //#endregion Object.defineProperty(exports, "CardAction", { enumerable: true, get: function() { return CardAction; } });