@yamada-ui/checkbox
Version:
Yamada UI checkbox component
66 lines (64 loc) • 1.66 kB
JavaScript
"use client"
import {
useCheckboxCardContext
} from "./chunk-2VDJDPFI.mjs";
// src/checkbox-card-label.tsx
import { forwardRef } from "@yamada-ui/core";
import { ui } from "@yamada-ui/core";
import { cx } from "@yamada-ui/utils";
import { jsx, jsxs } from "react/jsx-runtime";
var CheckboxCardLabel = forwardRef(
({
className,
children,
icon: iconProp,
withIcon,
contentProps,
iconProps,
...rest
}, ref) => {
const {
icon,
styles,
withIcon: defaultWithIcon,
getIconProps,
iconProps: defaultIconProps
} = useCheckboxCardContext();
withIcon != null ? withIcon : withIcon = defaultWithIcon;
return /* @__PURE__ */ jsxs(
ui.div,
{
ref,
className: cx("ui-checkbox-card__label", className),
__css: { ...styles.label },
...rest,
children: [
/* @__PURE__ */ jsx(
ui.span,
{
className: "ui-checkbox-card__label-content",
__css: { ...styles.labelContent },
...contentProps,
children
}
),
withIcon ? /* @__PURE__ */ jsx(
ui.div,
{
className: "ui-checkbox-card__icon",
__css: { ...styles.icon },
...getIconProps({ ...defaultIconProps, ...iconProps }),
children: iconProp != null ? iconProp : icon
}
) : null
]
}
);
}
);
CheckboxCardLabel.displayName = "CheckboxCardLabel";
CheckboxCardLabel.__ui__ = "CheckboxCardLabel";
export {
CheckboxCardLabel
};
//# sourceMappingURL=chunk-7QPJ25CW.mjs.map