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

65 lines
2.7 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-skeleton.ts
var use_skeleton_exports = {};
__export(use_skeleton_exports, {
useSkeleton: () => useSkeleton
});
module.exports = __toCommonJS(use_skeleton_exports);
var import_system = require("@heroui/system");
var import_theme = require("@heroui/theme");
var import_shared_utils = require("@heroui/shared-utils");
var import_react = require("react");
var import_system2 = require("@heroui/system");
function useSkeleton(originalProps) {
var _a, _b;
const globalContext = (0, import_system2.useProviderContext)();
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys);
const { as, children, isLoaded = false, className, classNames, ...otherProps } = props;
const Component = as || "div";
const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const slots = (0, import_react.useMemo)(
() => (0, import_theme.skeleton)({
...variantProps,
disableAnimation
}),
[(0, import_shared_utils.objectToDeps)(variantProps), disableAnimation, children]
);
const baseStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className);
const getSkeletonProps = (props2 = {}) => {
return {
"data-loaded": (0, import_shared_utils.dataAttr)(isLoaded),
className: slots.base({ class: (0, import_shared_utils.clsx)(baseStyles, props2 == null ? void 0 : props2.className) }),
...otherProps
};
};
const getContentProps = (props2 = {}) => {
return {
className: slots.content({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.content, props2 == null ? void 0 : props2.className) })
};
};
return { Component, children, slots, classNames, getSkeletonProps, getContentProps };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useSkeleton
});