joe-bell / cva

Class Variance Authority
https://cva.style
Apache License 2.0
5.71k stars 109 forks source link

export `Config` type #275

Closed ilovett closed 6 months ago

ilovett commented 6 months ago

I'd like to be able to separate my config as export const variantConfig: Config = { ... } and then pull those into storybook stories argTypes, but I don't see how I can import that type.

Alternatively, add .config to the returned function from cva() and we can access it through variants.config

argTypes: {
  color: {
    values: Object.keys(variants.config.variants.color),
    control: { type: 'radio' },
  }
}
joe-bell commented 6 months ago

Duplicate of https://github.com/joe-bell/cva/discussions/146