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

104 lines
3.0 KiB
Plaintext

"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-button-group.ts
var use_button_group_exports = {};
__export(use_button_group_exports, {
useButtonGroup: () => useButtonGroup
});
module.exports = __toCommonJS(use_button_group_exports);
var import_theme = require("@heroui/theme");
var import_system = require("@heroui/system");
var import_react_utils = require("@heroui/react-utils");
var import_react = require("react");
var import_shared_utils = require("@heroui/shared-utils");
function useButtonGroup(originalProps) {
var _a, _b;
const globalContext = (0, import_system.useProviderContext)();
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.buttonGroup.variantKeys);
const {
ref,
as,
children,
color = "default",
size = "md",
variant = "solid",
radius,
isDisabled = false,
isIconOnly = false,
disableRipple = (_a = globalContext == null ? void 0 : globalContext.disableRipple) != null ? _a : false,
disableAnimation = (_b = globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false,
className,
...otherProps
} = props;
const Component = as || "div";
const domRef = (0, import_react_utils.useDOMRef)(ref);
const classNames = (0, import_react.useMemo)(
() => (0, import_theme.buttonGroup)({
...variantProps,
className
}),
[(0, import_shared_utils.objectToDeps)(variantProps), className]
);
const context = (0, import_react.useMemo)(
() => ({
size,
color,
variant,
radius,
isIconOnly,
isDisabled,
disableAnimation,
disableRipple,
fullWidth: !!(originalProps == null ? void 0 : originalProps.fullWidth)
}),
[
size,
color,
variant,
radius,
isDisabled,
isIconOnly,
disableAnimation,
disableRipple,
originalProps == null ? void 0 : originalProps.fullWidth
]
);
const getButtonGroupProps = (0, import_react.useCallback)(
() => ({
role: "group",
...otherProps
}),
[otherProps]
);
return {
Component,
children,
domRef,
context,
classNames,
getButtonGroupProps
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useButtonGroup
});