Files
NapCatQQ/.pnpm-store/v3/files/e1/bef45ecfbbf4360ac08703949190681b48e020f10e86e8659c9635bfe8cca8cd511df02c4012c1a46b26d322d7d78c125b5c55cfbc52392fc49d8403987c67
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

45 lines
1.5 KiB
Plaintext

"use client";
import {
useSwitch
} from "./chunk-EN4B57RQ.mjs";
// src/switch.tsx
import { cloneElement } from "react";
import { forwardRef } from "@heroui/system";
import { jsx, jsxs } from "react/jsx-runtime";
var Switch = forwardRef((props, ref) => {
const {
Component,
children,
startContent,
endContent,
thumbIcon,
getBaseProps,
getInputProps,
getWrapperProps,
getThumbProps,
getThumbIconProps,
getLabelProps,
getStartContentProps,
getEndContentProps
} = useSwitch({ ...props, ref });
const clonedThumbIcon = typeof thumbIcon === "function" ? thumbIcon(getThumbIconProps({ includeStateProps: true })) : thumbIcon && cloneElement(thumbIcon, getThumbIconProps());
const clonedStartContent = startContent && cloneElement(startContent, getStartContentProps());
const clonedEndContent = endContent && cloneElement(endContent, getEndContentProps());
return /* @__PURE__ */ jsxs(Component, { ...getBaseProps(), children: [
/* @__PURE__ */ jsx("input", { ...getInputProps() }),
/* @__PURE__ */ jsxs("span", { ...getWrapperProps(), children: [
startContent && clonedStartContent,
/* @__PURE__ */ jsx("span", { ...getThumbProps(), children: thumbIcon && clonedThumbIcon }),
endContent && clonedEndContent
] }),
children && /* @__PURE__ */ jsx("span", { ...getLabelProps(), children })
] });
});
Switch.displayName = "HeroUI.Switch";
var switch_default = Switch;
export {
switch_default
};