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

Function generateJsxExamples

packages/generator/src/shared.ts:78–92  ·  view source on GitHub ↗
(
  props: Record<string, string | null | undefined>,
  jsxStyleProps: JsxStyleProps = 'all',
  component = 'Box',
)

Source from the content-addressed store, hash-verified

76 * Generates function and JSX examples for a style property
77 */
78export const generateJsxExamples = (
79 props: Record<string, string | null | undefined>,
80 jsxStyleProps: JsxStyleProps = 'all',
81 component = 'Box',
82): { functionExamples: string[]; jsxExamples: string[] } => {
83 const functionExamples = [`css({ ${formatProps(props)} })`]
84 const jsxExamples: string[] = []
85
86 const jsxExample = generateJsxExample(props, jsxStyleProps, component)
87 if (jsxExample) {
88 jsxExamples.push(jsxExample)
89 }
90
91 return { functionExamples, jsxExamples }
92}
93
94export type CompositionStyleType = 'text-styles' | 'layer-styles' | 'animation-styles'
95

Callers 1

Calls 2

formatPropsFunction · 0.85
generateJsxExampleFunction · 0.85

Tested by

no test coverage detected