Skip to content

Latest commit

 

History

History
297 lines (232 loc) · 7.71 KB

CHANGELOG.md

File metadata and controls

297 lines (232 loc) · 7.71 KB

@pandacss/generator

0.7.0

Patch Changes

0.6.0

Patch Changes

  • cd912f35: Fix definePattern module overriden type, was missing an extends constraint which lead to a type error:

    styled-system/types/global.d.ts:14:58 - error TS2344: Type 'T' does not satisfy the constraint 'PatternProperties'.
    
    14   export function definePattern<T>(config: PatternConfig<T>): PatternConfig
                                                                ~
    
      styled-system/types/global.d.ts:14:33
        14   export function definePattern<T>(config: PatternConfig<T>): PatternConfig
                                           ~
        This type parameter might need an `extends PatternProperties` constraint.
    
    
  • dc4e80f7: Export isCssProperty helper function from styled-system/jsx

  • 5bd88c41: Fix JSX recipe extraction when multiple recipes were used on the same component, ex:

    const ComponentWithMultipleRecipes = ({ variant }) => {
      return (
        <button className={cx(pinkRecipe({ variant }), greenRecipe({ variant }), blueRecipe({ variant }))}>Hello</button>
      )
    }

    Given a panda.config.ts with recipes each including a common jsx tag name, such as:

    recipes: {
        pinkRecipe: {
            name: 'pinkRecipe',
            jsx: ['ComponentWithMultipleRecipes'],
            base: { color: 'pink.100' },
            variants: {
                variant: {
                small: { fontSize: 'sm' },
                },
            },
        },
        greenRecipe: {
            name: 'greenRecipe',
            jsx: ['ComponentWithMultipleRecipes'],
            base: { color: 'green.100' },
            variants: {
                variant: {
                small: { fontSize: 'sm' },
                },
            },
        },
        blueRecipe: {
            name: 'blueRecipe',
            jsx: ['ComponentWithMultipleRecipes'],
            base: { color: 'blue.100' },
            variants: {
                variant: {
                small: { fontSize: 'sm' },
                },
            },
        },
    },

    Only the first matching recipe would be noticed and have its CSS generated, now this will properly generate the CSS for each of them

  • ef1dd676: Fix issue where staticCss did not generate all variants in the array of css rules

  • b50675ca: Refactor parser to support extracting css prop in JSX elements correctly.

  • Updated dependencies [12c900ee]

  • Updated dependencies [5bd88c41]

  • Updated dependencies [ef1dd676]

  • Updated dependencies [b50675ca]

0.5.1

Patch Changes

  • 53fb0708: Fix config.staticCss by filtering types on getPropertyKeys

    It used to throw because of them:

    <css input>:33:21: Missed semicolon
     ELIFECYCLE  Command failed with exit code 1.
    @layer utilities {
        .m_type\:Tokens\[\"spacing\"\] {
            margin: type:Tokens["spacing"]
        }
    }
  • 1ed239cd: Add feature where config.staticCss.recipes can now use [*] to generate all variants of a recipe.

    before:

    staticCss: {
      recipes: {
        button: [{ size: ['*'], shape: ['*'] }]
      }
    }

    now:

    staticCss: {
      recipes: {
        button: ['*']
      }
    }
  • 78ed6ed4: Fix issue where using a nested outdir like src/styled-system with a baseUrl like ./src would result on parser NOT matching imports like import { container } from "styled-system/patterns"; cause it would expect the full path src/styled-system

  • b8f8c2a6: Fix reset.css (generated when config has preflight: true) import order, always place it first so that it can be easily overriden

  • Updated dependencies [8c670d60]

  • Updated dependencies [c0335cf4]

  • Updated dependencies [762fd0c9]

  • Updated dependencies [f9247e52]

  • Updated dependencies [1ed239cd]

  • Updated dependencies [78ed6ed4]

0.5.0

Minor Changes

  • ead9eaa3: Add support for tagged template literal version.

    This features is pure css approach to writing styles, and can be a great way to migrate from styled-components and emotion.

    Set the syntax option to template-literal in the panda config to enable this feature.

    // panda.config.ts
    export default defineConfig({
      //...
      syntax: 'template-literal',
    })

    For existing projects, you might need to run the panda codegen --clean

    You can also use the --syntax option to specify the syntax type when using the CLI.

    panda init -p --syntax template-literal

    To get autocomplete for token variables, consider using the CSS Var Autocomplete extension.

Patch Changes

0.4.0

Minor Changes

  • 5b344b9c: Add support for disabling shorthand props

    import { defineConfig } from '@pandacss/dev'
    
    export default defineConfig({
      // ...
      shorthands: false,
    })

Patch Changes

0.3.2

Patch Changes

0.3.1

Patch Changes

0.3.0

Minor Changes

  • 6d81ee9e: - Set default jsx factory to 'styled'
    • Fix issue where pattern JSX was not being generated correctly when properties are not defined

Patch Changes

0.0.2

Patch Changes

  • fb40fff2: Initial release of all packages

    • Internal AST parser for TS and TSX
    • Support for defining presets in config
    • Support for design tokens (core and semantic)
    • Add outExtension key to config to allow file extension options for generated javascript. .js or .mjs
    • Add jsxElement option to patterns, to allow specifying the jsx element rendered by the patterns.
  • Updated dependencies [c308e8be]

  • Updated dependencies [fb40fff2]