@pandacss/studio 0.34.3 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/studio",
3
- "version": "0.34.3",
3
+ "version": "0.35.0",
4
4
  "description": "The automated token documentation for Panda CSS",
5
5
  "main": "dist/studio.js",
6
6
  "module": "dist/studio.mjs",
@@ -48,12 +48,12 @@
48
48
  "react": "18.2.0",
49
49
  "react-dom": "18.2.0",
50
50
  "vite": "5.1.3",
51
- "@pandacss/config": "0.34.3",
52
- "@pandacss/logger": "0.34.3",
53
- "@pandacss/shared": "0.34.3",
54
- "@pandacss/token-dictionary": "0.34.3",
55
- "@pandacss/types": "0.34.3",
56
- "@pandacss/astro-plugin-studio": "0.34.3"
51
+ "@pandacss/config": "0.35.0",
52
+ "@pandacss/logger": "0.35.0",
53
+ "@pandacss/shared": "0.35.0",
54
+ "@pandacss/token-dictionary": "0.35.0",
55
+ "@pandacss/types": "0.35.0",
56
+ "@pandacss/astro-plugin-studio": "0.35.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/react": "18.2.55",
@@ -1,11 +1,14 @@
1
1
  import { getSlotRecipes, memo, splitProps } from '../helpers.mjs';
2
2
  import { cva } from './cva.mjs';
3
+ import { cx } from './cx.mjs';
4
+
5
+ const slotClass = (className, slot) => className + '__' + slot
3
6
 
4
7
  export function sva(config) {
5
8
  const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
6
9
 
7
10
  function svaFn(props) {
8
- const result = slots.map(([slot, cvaFn]) => [slot, cvaFn(props)])
11
+ const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), config.className && slotClass(config.className, slot))])
9
12
  return Object.fromEntries(result)
10
13
  }
11
14
 
@@ -325,17 +325,6 @@ type StrictableProps =
325
325
  | 'backgroundAttachment'
326
326
  | 'backgroundClip'
327
327
  | 'borderCollapse'
328
- | 'border'
329
- | 'borderBlock'
330
- | 'borderBlockEnd'
331
- | 'borderBlockStart'
332
- | 'borderBottom'
333
- | 'borderInline'
334
- | 'borderInlineEnd'
335
- | 'borderInlineStart'
336
- | 'borderLeft'
337
- | 'borderRight'
338
- | 'borderTop'
339
328
  | 'borderBlockEndStyle'
340
329
  | 'borderBlockStartStyle'
341
330
  | 'borderBlockStyle'
@@ -387,7 +376,14 @@ type StrictableProps =
387
376
  | 'wordBreak'
388
377
  | 'writingMode'
389
378
 
390
- type WithEscapeHatch<T> = T | `[${string}]`
379
+ type WithColorOpacityModifier<T> = T extends string ? `${T}/${string}` : T
380
+
381
+ type ImportantMark = "!" | "!important"
382
+ type WhitespaceImportant = ` ${ImportantMark}`
383
+ type Important = ImportantMark | WhitespaceImportant
384
+ type WithImportant<T> = T extends string ? `${T}${Important}${string}` : T
385
+
386
+ type WithEscapeHatch<T> = T | `[${string}]` | (T extends string ? WithColorOpacityModifier<string> | WithImportant<T> : T)
391
387
 
392
388
  type FilterVagueString<Key, Value> = Value extends boolean
393
389
  ? Value
@@ -81,7 +81,7 @@ export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefi
81
81
 
82
82
  interface RecipeConfigMeta {
83
83
  /**
84
- * The name of the recipe.
84
+ * The class name of the recipe.
85
85
  */
86
86
  className: string
87
87
  /**
@@ -133,6 +133,10 @@ export interface SlotRecipeDefinition<
133
133
  S extends string = string,
134
134
  T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
135
135
  > {
136
+ /**
137
+ * An optional class name that can be used to target slots in the DOM.
138
+ */
139
+ className?: string
136
140
  /**
137
141
  * The parts/slots of the recipe.
138
142
  */