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

Function getExampleValue

packages/generator/src/spec/patterns.ts:4–18  ·  view source on GitHub ↗
(prop: { type?: string; value?: unknown })

Source from the content-addressed store, hash-verified

2import type { PatternSpec } from '@pandacss/types'
3
4const getExampleValue = (prop: { type?: string; value?: unknown }): string => {
5 if (prop.type === 'enum' && Array.isArray(prop.value) && prop.value.length > 0) {
6 return `"${prop.value[0]}"`
7 }
8 if (prop.type === 'boolean') {
9 return 'true'
10 }
11 if (prop.type === 'number') {
12 return '4'
13 }
14 if (prop.type === 'token') {
15 return '"md"'
16 }
17 return '<value>'
18}
19
20export const generatePatternsSpec = (ctx: Context): PatternSpec => {
21 const jsxStyleProps = ctx.config.jsxStyleProps

Callers 1

generatePatternsSpecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected