UNPKG

@nurl/panda-preset

Version:

Official Panda-CSS preset for the Ganglion Design System.

63 lines 1.6 kB
// src/patterns.ts function definePattern(config) { return config; } var scrollable = definePattern({ description: "A container that allows for scrolling", properties: { // The direction of the scroll direction: { type: "enum", value: ["horizontal", "vertical"] }, // Whether to hide the scrollbar hideScrollbar: { type: "boolean" } }, // disallow the `overflow` property (in TypeScript) blocklist: ["overflow"], transform(props) { const { direction, hideScrollbar, ...rest } = props; return { overflow: "auto", height: direction === "horizontal" ? "100%" : "auto", width: direction === "vertical" ? "100%" : "auto", scrollbarWidth: hideScrollbar ? "none" : "auto", WebkitOverflowScrolling: "touch", "&::-webkit-scrollbar": { display: hideScrollbar ? "none" : "auto" }, ...rest }; } }); var animateIn = definePattern({ description: "A container that fades in the content", properties: { // The delay of the animation delay: { type: "string" } }, // disallow the `overflow` property (in TypeScript) blocklist: ["overflow"], transform(props) { const { delay, ...rest } = props; return { animationName: "fadeIn", animationDuration: "2s", animationFillMode: "forwards", animationDelay: delay ?? "200ms", opacity: "0", ...rest, _motionReduce: { animationName: "none" } }; } }); var patterns = { extend: { animateIn, scrollable } }; export { definePattern, patterns }; //# sourceMappingURL=patterns.js.map