UNPKG

@nurl/panda-preset

Version:

Official Panda-CSS preset for the Ganglion Design System.

1 lines 2.79 kB
{"version":3,"sources":["../../src/patterns.ts"],"sourcesContent":["import type { PatternConfig } from '@pandacss/types'\n\nexport function definePattern<T extends PatternConfig>(config: T) {\n return config\n}\n\nconst scrollable = definePattern({\n description: 'A container that allows for scrolling',\n properties: {\n // The direction of the scroll\n direction: { type: 'enum', value: ['horizontal', 'vertical'] },\n // Whether to hide the scrollbar\n hideScrollbar: { type: 'boolean' },\n },\n\n // disallow the `overflow` property (in TypeScript)\n blocklist: ['overflow'],\n\n transform(props) {\n const { direction, hideScrollbar, ...rest } = props\n return {\n overflow: 'auto',\n height: direction === 'horizontal' ? '100%' : 'auto',\n width: direction === 'vertical' ? '100%' : 'auto',\n scrollbarWidth: hideScrollbar ? 'none' : 'auto',\n WebkitOverflowScrolling: 'touch',\n '&::-webkit-scrollbar': {\n display: hideScrollbar ? 'none' : 'auto',\n },\n ...rest,\n }\n },\n})\n\nconst animateIn = definePattern({\n description: 'A container that fades in the content',\n properties: {\n // The delay of the animation\n delay: { type: 'string' },\n },\n\n // disallow the `overflow` property (in TypeScript)\n blocklist: ['overflow'],\n\n transform(props) {\n const { delay, ...rest } = props\n return {\n animationName: 'fadeIn',\n animationDuration: '2s',\n animationFillMode: 'forwards',\n animationDelay: delay ?? '200ms',\n opacity: '0',\n ...rest,\n _motionReduce: {\n animationName: 'none',\n },\n }\n },\n})\n\nexport const patterns = {\n extend: {\n animateIn,\n scrollable,\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,cAAuC,QAAW;AAChE,SAAO;AACT;AAEA,IAAM,aAAa,cAAc;AAAA,EAC/B,aAAa;AAAA,EACb,YAAY;AAAA;AAAA,IAEV,WAAW,EAAE,MAAM,QAAQ,OAAO,CAAC,cAAc,UAAU,EAAE;AAAA;AAAA,IAE7D,eAAe,EAAE,MAAM,UAAU;AAAA,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