nicecode-v2/packages/meta/lib/_util/wave/style.js

58 lines
2.0 KiB
JavaScript

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/_util/wave/style.ts
var style_exports = {};
__export(style_exports, {
default: () => style_default
});
module.exports = __toCommonJS(style_exports);
var import_internal = require("../../theme/internal");
var genWaveStyle = (token) => {
const { componentCls, colorPrimary } = token;
return {
[componentCls]: {
position: "absolute",
background: "transparent",
pointerEvents: "none",
boxSizing: "border-box",
color: `var(--wave-color, ${colorPrimary})`,
boxShadow: `0 0 0 0 currentcolor`,
opacity: 0.2,
// =================== Motion ===================
"&.wave-motion-appear": {
transition: [
`box-shadow 0.4s ${token.motionEaseOutCirc}`,
`opacity 2s ${token.motionEaseOutCirc}`
].join(","),
"&-active": {
boxShadow: `0 0 0 6px currentcolor`,
opacity: 0
},
"&.wave-quick": {
transition: [
`box-shadow 0.3s ${token.motionEaseInOut}`,
`opacity 0.35s ${token.motionEaseInOut}`
].join(",")
}
}
}
};
};
var style_default = (0, import_internal.genComponentStyleHook)("Wave", (token) => [genWaveStyle(token)]);