UNPKG

@wordpress/components

Version:
58 lines (56 loc) 1.99 kB
"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); // packages/components/src/utils/dropdown-motion.ts var dropdown_motion_exports = {}; __export(dropdown_motion_exports, { DROPDOWN_MOTION: () => DROPDOWN_MOTION, DROPDOWN_MOTION_CSS: () => DROPDOWN_MOTION_CSS }); module.exports = __toCommonJS(dropdown_motion_exports); var DROPDOWN_MOTION = Object.freeze({ SLIDE_DISTANCE: 4, SLIDE_DURATION: 200, SLIDE_EASING: { function: "cubic-bezier", args: [0, 0, 0, 1] }, FADE_DURATION: 80, FADE_EASING: { function: "linear" } }); var convertEasingToString = (easing) => { if (easing.args?.length) { return `${easing.function}(${easing.args.join(",")})`; } return easing.function; }; var DROPDOWN_MOTION_CSS = Object.freeze({ SLIDE_DISTANCE: `${DROPDOWN_MOTION.SLIDE_DISTANCE}px`, SLIDE_DURATION: `${DROPDOWN_MOTION.SLIDE_DURATION}ms`, SLIDE_EASING: convertEasingToString(DROPDOWN_MOTION.SLIDE_EASING), FADE_DURATION: `${DROPDOWN_MOTION.FADE_DURATION}ms`, FADE_EASING: convertEasingToString(DROPDOWN_MOTION.FADE_EASING) }); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { DROPDOWN_MOTION, DROPDOWN_MOTION_CSS }); //# sourceMappingURL=dropdown-motion.cjs.map