const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../../locales/index.js");
const require_index$1 = require("../iconfont/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./PisellExport.less");
//#region src/components/pisellExport/PisellExport.tsx
/** 默认导出图标（download-cloud-01） */
const DEFAULT_ICON_TYPE = "pisell2-download-cloud-01";
/**
* PisellExport 导出触发器组件
*
* @description 仅负责 UI 展示与点击回调，不内置导出逻辑；支持 Icon/Button 两种形态与三种尺寸
*/
function PisellExport(props) {
	const { variant = "button", size = "medium", type = "default", disabled = false, label, icon, onExport, className, style } = props;
	const displayLabel = label !== void 0 ? label : require_index.getText("pisell-export-button-label");
	const iconNode = icon !== void 0 ? icon : /* @__PURE__ */ react.default.createElement(require_index$1.default, {
		type: DEFAULT_ICON_TYPE,
		className: "pisell-export-icon",
		style: {
			fontSize: 20,
			width: 20,
			height: 20,
			display: "inline-flex",
			alignItems: "center",
			justifyContent: "center"
		}
	});
	const handleClick = (0, react.useCallback)((e) => {
		if (disabled) return;
		onExport === null || onExport === void 0 || onExport(e);
	}, [disabled, onExport]);
	const rootClass = (0, classnames.default)("pisell-export", `pisell-export--${variant}`, `pisell-export--${size}`, `pisell-export--${type}`, disabled && "pisell-export--disabled", className);
	return /* @__PURE__ */ react.default.createElement("button", {
		type: "button",
		className: rootClass,
		style,
		disabled,
		onClick: handleClick,
		"aria-label": typeof displayLabel === "string" ? displayLabel : void 0
	}, /* @__PURE__ */ react.default.createElement("span", { className: "pisell-export-icon-wrap" }, iconNode), variant === "button" && /* @__PURE__ */ react.default.createElement("span", { className: "pisell-export-label" }, displayLabel));
}
//#endregion
exports.PisellExport = PisellExport;
