|
1 | 1 | # @vanilla-extract/recipes |
2 | 2 |
|
3 | | -## 0.1.1 |
4 | | -### Patch Changes |
| 3 | +## 0.2.0 |
5 | 4 |
|
| 5 | +### Minor Changes |
6 | 6 |
|
| 7 | +- [#376](https://github.com/seek-oss/vanilla-extract/pull/376) [`f8082b9`](https://github.com/seek-oss/vanilla-extract/commit/f8082b9b62c57f394bf82cf05296a680c3ef177b) Thanks [@TheMightyPenguin](https://github.com/TheMightyPenguin)! - Add `RecipeVariants` type |
7 | 8 |
|
8 | | -- [#380](https://github.com/seek-oss/vanilla-extract/pull/380) [`3ae2422`](https://github.com/seek-oss/vanilla-extract/commit/3ae24220e2187475561e0be54631558076370fa4) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add variant group names to debug IDs |
| 9 | + A utility to make use of the recipe’s type interface. This can be useful when typing functions or component props that need to accept recipe values as part of their interface. |
| 10 | + |
| 11 | + ```ts |
| 12 | + // button.css.ts |
| 13 | + import { recipe, RecipeVariants } from '@vanilla-extract/recipes'; |
| 14 | + |
| 15 | + export const button = recipe({ |
| 16 | + variants: { |
| 17 | + color: { |
| 18 | + neutral: { background: 'whitesmoke' }, |
| 19 | + brand: { background: 'blueviolet' }, |
| 20 | + accent: { background: 'slateblue' }, |
| 21 | + }, |
| 22 | + size: { |
| 23 | + small: { padding: 12 }, |
| 24 | + medium: { padding: 16 }, |
| 25 | + large: { padding: 24 }, |
| 26 | + }, |
| 27 | + }, |
| 28 | + }); |
| 29 | + |
| 30 | + // Get the type |
| 31 | + export type ButtonVariants = RecipeVariants<typeof button>; |
9 | 32 |
|
| 33 | + // the above will result in a type equivalent to: |
| 34 | + export type ButtonVariants = { |
| 35 | + color?: 'neutral' | 'brand' | 'accent'; |
| 36 | + size?: 'small' | 'medium' | 'large'; |
| 37 | + }; |
| 38 | + ``` |
10 | 39 |
|
| 40 | +## 0.1.1 |
| 41 | + |
| 42 | +### Patch Changes |
| 43 | + |
| 44 | +- [#380](https://github.com/seek-oss/vanilla-extract/pull/380) [`3ae2422`](https://github.com/seek-oss/vanilla-extract/commit/3ae24220e2187475561e0be54631558076370fa4) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add variant group names to debug IDs |
11 | 45 |
|
12 | | -- [#380](https://github.com/seek-oss/vanilla-extract/pull/380) [`3ae2422`](https://github.com/seek-oss/vanilla-extract/commit/3ae24220e2187475561e0be54631558076370fa4) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Return default variants when selection is `undefined` |
| 46 | +* [#380](https://github.com/seek-oss/vanilla-extract/pull/380) [`3ae2422`](https://github.com/seek-oss/vanilla-extract/commit/3ae24220e2187475561e0be54631558076370fa4) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Return default variants when selection is `undefined` |
0 commit comments