Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pandacss/preset-base

Package Overview
Dependencies
Maintainers
1
Versions
705
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pandacss/preset-base - npm Package Versions

1
71

0.38.0

Diff

Changelog

Source

[0.38.0] - 2024-04-29

Fixed

  • Fix css reset regressions where:
    • first letter gets a different color
    • input or select gets a default border
  • Fix type import
  • Fix Panda imports detection when using tsconfig.baseUrl with an outdir that starts with ./.

Added

  • Add least resource used (LRU) cache in the hot parts to prevent memory from growing infinitely
  • Add support for deprecating tokens, utilities, patterns and config recipes.

Set the deprecated property to true to enable deprecation warnings. Alternatively, you can also set it to a string to provide a custom migration message.

Deprecating a utility

defineConfig({
  utilities: {
    ta: {
      deprecated: true,
      transform(value) {
        return { textAlign: value }
      },
    },
  },
})

Deprecating a token

defineConfig({
  theme: {
    tokens: {
      spacing: {
        lg: { value: '8px', deprecated: 'use `8` instead' },
      },
    },
  },
})

Deprecating a pattern

defineConfig({
  patterns: {
    customStack: {
      deprecated: true,
    },
  },
})

Deprecating a recipe

defineConfig({
  theme: {
    recipes: {
      btn: {
        deprecated: 'will be removed in v2.0',
      },
    },
  },
})
  • Add support for array values in the special css property for the JSX factory and JSX patterns

This makes it even easier to merge styles from multiple sources.

import { Stack, styled } from '../styled-system/jsx'

const HeroSection = (props) => {
  return (
    <Stack css={[{ color: 'blue.300', padding: '4' }, props.css]}>
      <styled.div css={[{ fontSize: '2xl' }, props.hero]}>Hero Section</styled.div>
    </Stack>
  )
}

const App = () => {
  return (
    <>
      <HeroSection css={{ backgroundColor: 'yellow.300' }} hero={css.raw({ fontSize: '4xl', color: 'red.300' })} />
    </>
  )
}

should render something like:

<div class="d_flex flex_column gap_10px text_blue.300 p_4 bg_yellow.300">
  <div class="fs_4xl text_red.300">Hero Section</div>
</div>
segunadebayo
published 0.0.0-dev-20240429170712 •

segunadebayo
published 0.0.0-dev-20240425193018 •

segunadebayo
published 0.0.0-dev-20240422125835 •

segunadebayo
published 0.0.0-dev-20240422122109 •

segunadebayo
published 0.0.0-dev-20240419031424 •

segunadebayo
published 0.0.0-dev-20240413152357 •

segunadebayo
published 0.0.0-dev-20240411204220 •

segunadebayo
published 0.0.0-dev-20240409220115 •

segunadebayo
published 0.37.2 •

Changelog

Source

[0.37.2] - 2024-04-05

Fixed

  • fix: build correct path for debug files on windows
  • Add missing type PatternProperties to solve a TypeScript issue (The inferred type of xxx cannot be named without a reference)
  • Fix sva typings, the splitVariantProps was missing from the d.ts file

Added

  • Add a getVariantProps helper to the slot recipes API (sva and config slot recipes)
import { sva } from '../styled-system/css'
import { getVariantProps } from '../styled-system/recipes'

const button = sva({
  slots: ['root', 'icon'],
  // ...
  variants: {
    size: {
      sm: {
        // ...
      },
      md: {
        // ...
      },
    },
    variant: {
      primary: {
        // ...
      },
      danger: {
        // ...
      }
    }
  }
  defaultVariants: {
    size: 'md',
    variant: 'primary',
  }
})

// ✅ this will return the computed variants based on the defaultVariants + props passed
const buttonProps = button.getVariantProps({ size: "sm" })
//    ^? { size: "sm", variant: "primary" }

Changed

  • Make WithImportant<T> more performant and ensure typescript is happy. This changes will make code autocompletion and ts-related linting much faster than before.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc