MCPcopy Create free account
hub / github.com/chakra-ui/panda / patternParser

Function patternParser

packages/parser/__tests__/fixture.ts:77–105  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

75}
76
77export function patternParser(code: string) {
78 const project = getProject(code, {
79 patterns: {
80 extend: {
81 stack: {
82 properties: {
83 align: { type: 'property', value: 'alignItems' },
84 justify: { type: 'property', value: 'justifyContent' },
85 direction: { type: 'property', value: 'flexDirection' },
86 gap: { type: 'property', value: 'gap' },
87 },
88 transform(props: any) {
89 const { align = 'flex-start', justify, direction = 'column', gap = '10px', ...rest } = props
90 return {
91 display: 'flex',
92 flexDirection: direction,
93 alignItems: align,
94 justifyContent: justify,
95 gap,
96 ...rest,
97 }
98 },
99 },
100 },
101 },
102 })
103 const data = project.parseSourceFile(filePath)!
104 return data.pattern
105}
106
107export function jsxRecipeParser(code: string) {
108 const project = getProject(code, {

Callers 1

patterns.test.tsFile · 0.90

Calls 1

getProjectFunction · 0.85

Tested by

no test coverage detected