@pandacss/studio 0.34.3 → 0.36.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.
@@ -1,11 +1,10 @@
1
1
  /* eslint-disable */
2
- import type { ConditionalValue } from './conditions';
2
+ import type { Conditional } from './conditions';
3
3
  import type { CssProperties } from './system-types';
4
4
  import type { Tokens } from '../tokens/index';
5
5
 
6
- interface PropertyValueTypes {
6
+ export interface UtilityValues {
7
7
  aspectRatio: Tokens["aspectRatios"];
8
- zIndex: Tokens["zIndex"];
9
8
  top: Tokens["spacing"];
10
9
  left: Tokens["spacing"];
11
10
  insetInline: Tokens["spacing"];
@@ -56,7 +55,6 @@ interface PropertyValueTypes {
56
55
  marginInline: "auto" | Tokens["spacing"];
57
56
  marginInlineEnd: "auto" | Tokens["spacing"];
58
57
  marginInlineStart: "auto" | Tokens["spacing"];
59
- outlineWidth: Tokens["borderWidths"];
60
58
  outlineColor: Tokens["colors"];
61
59
  outline: Tokens["borders"];
62
60
  outlineOffset: Tokens["spacing"];
@@ -94,8 +92,8 @@ interface PropertyValueTypes {
94
92
  background: Tokens["colors"];
95
93
  backgroundColor: Tokens["colors"];
96
94
  backgroundImage: Tokens["assets"];
97
- backgroundGradient: Tokens["gradients"] | "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
98
- textGradient: Tokens["gradients"] | "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
95
+ backgroundGradient: "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
96
+ textGradient: "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
99
97
  gradientFrom: Tokens["colors"];
100
98
  gradientTo: Tokens["colors"];
101
99
  gradientVia: Tokens["colors"];
@@ -115,27 +113,18 @@ interface PropertyValueTypes {
115
113
  borderEndEndRadius: Tokens["radii"];
116
114
  borderEndRadius: Tokens["radii"] | CssProperties["borderRadius"];
117
115
  border: Tokens["borders"];
118
- borderWidth: Tokens["borderWidths"];
119
- borderTopWidth: Tokens["borderWidths"];
120
- borderLeftWidth: Tokens["borderWidths"];
121
- borderRightWidth: Tokens["borderWidths"];
122
- borderBottomWidth: Tokens["borderWidths"];
123
116
  borderColor: Tokens["colors"];
124
117
  borderInline: Tokens["borders"];
125
- borderInlineWidth: Tokens["borderWidths"];
126
118
  borderInlineColor: Tokens["colors"];
127
119
  borderBlock: Tokens["borders"];
128
- borderBlockWidth: Tokens["borderWidths"];
129
120
  borderBlockColor: Tokens["colors"];
130
121
  borderLeft: Tokens["borders"];
131
122
  borderLeftColor: Tokens["colors"];
132
123
  borderInlineStart: Tokens["borders"];
133
- borderInlineStartWidth: Tokens["borderWidths"];
134
124
  borderInlineStartColor: Tokens["colors"];
135
125
  borderRight: Tokens["borders"];
136
126
  borderRightColor: Tokens["colors"];
137
127
  borderInlineEnd: Tokens["borders"];
138
- borderInlineEndWidth: Tokens["borderWidths"];
139
128
  borderInlineEndColor: Tokens["colors"];
140
129
  borderTop: Tokens["borders"];
141
130
  borderTopColor: Tokens["colors"];
@@ -145,11 +134,9 @@ interface PropertyValueTypes {
145
134
  borderBlockEndColor: Tokens["colors"];
146
135
  borderBlockStart: Tokens["borders"];
147
136
  borderBlockStartColor: Tokens["colors"];
148
- opacity: Tokens["opacity"];
149
137
  boxShadow: Tokens["shadows"];
150
138
  boxShadowColor: Tokens["colors"];
151
139
  filter: "auto";
152
- dropShadow: Tokens["dropShadows"];
153
140
  blur: Tokens["blurs"];
154
141
  backdropFilter: "auto";
155
142
  backdropBlur: Tokens["blurs"];
@@ -161,7 +148,6 @@ interface PropertyValueTypes {
161
148
  transitionDuration: Tokens["durations"];
162
149
  transition: "all" | "common" | "background" | "colors" | "opacity" | "shadow" | "transform";
163
150
  animation: Tokens["animations"];
164
- animationName: Tokens["animationName"];
165
151
  animationDelay: Tokens["durations"];
166
152
  scale: "auto" | CssProperties["scale"];
167
153
  translate: "auto" | CssProperties["translate"];
@@ -201,212 +187,50 @@ interface PropertyValueTypes {
201
187
  scrollSnapMarginRight: Tokens["spacing"];
202
188
  fill: Tokens["colors"];
203
189
  stroke: Tokens["colors"];
204
- strokeWidth: Tokens["borderWidths"];
205
190
  srOnly: boolean;
206
191
  debug: boolean;
207
- containerName: Tokens["containerNames"] | CssProperties["containerName"];
192
+ containerName: CssProperties["containerName"];
208
193
  colorPalette: "current" | "black" | "white" | "transparent" | "rose" | "pink" | "fuchsia" | "purple" | "violet" | "indigo" | "blue" | "sky" | "cyan" | "teal" | "emerald" | "green" | "lime" | "yellow" | "amber" | "orange" | "red" | "stone" | "zinc" | "gray" | "slate" | "neutral" | "text" | "bg" | "card" | "border" | "accent";
209
194
  textStyle: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
210
195
  }
211
196
 
212
197
 
213
198
 
214
- type CssValue<T> = T extends keyof CssProperties ? CssProperties[T] : never
199
+ type WithColorOpacityModifier<T> = T extends string ? `${T}/${string}` : T
215
200
 
216
- type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T] | CssValue<T> : CssValue<T>
201
+ type ImportantMark = "!" | "!important"
202
+ type WhitespaceImportant = ` ${ImportantMark}`
203
+ type Important = ImportantMark | WhitespaceImportant
204
+ type WithImportant<T> = T extends string ? `${T}${Important}${string}` : T
217
205
 
218
- export interface PropertyTypes extends PropertyValueTypes {
219
-
220
- pos: Shorthand<"position">;
221
- insetX: Shorthand<"insetInline">;
222
- insetY: Shorthand<"insetBlock">;
223
- insetEnd: Shorthand<"insetInlineEnd">;
224
- end: Shorthand<"insetInlineEnd">;
225
- insetStart: Shorthand<"insetInlineStart">;
226
- start: Shorthand<"insetInlineStart">;
227
- flexDir: Shorthand<"flexDirection">;
228
- p: Shorthand<"padding">;
229
- pl: Shorthand<"paddingLeft">;
230
- pr: Shorthand<"paddingRight">;
231
- pt: Shorthand<"paddingTop">;
232
- pb: Shorthand<"paddingBottom">;
233
- py: Shorthand<"paddingBlock">;
234
- paddingY: Shorthand<"paddingBlock">;
235
- paddingX: Shorthand<"paddingInline">;
236
- px: Shorthand<"paddingInline">;
237
- pe: Shorthand<"paddingInlineEnd">;
238
- paddingEnd: Shorthand<"paddingInlineEnd">;
239
- ps: Shorthand<"paddingInlineStart">;
240
- paddingStart: Shorthand<"paddingInlineStart">;
241
- ml: Shorthand<"marginLeft">;
242
- mr: Shorthand<"marginRight">;
243
- mt: Shorthand<"marginTop">;
244
- mb: Shorthand<"marginBottom">;
245
- m: Shorthand<"margin">;
246
- my: Shorthand<"marginBlock">;
247
- marginY: Shorthand<"marginBlock">;
248
- mx: Shorthand<"marginInline">;
249
- marginX: Shorthand<"marginInline">;
250
- me: Shorthand<"marginInlineEnd">;
251
- marginEnd: Shorthand<"marginInlineEnd">;
252
- ms: Shorthand<"marginInlineStart">;
253
- marginStart: Shorthand<"marginInlineStart">;
254
- ringWidth: Shorthand<"outlineWidth">;
255
- ringColor: Shorthand<"outlineColor">;
256
- ring: Shorthand<"outline">;
257
- ringOffset: Shorthand<"outlineOffset">;
258
- w: Shorthand<"width">;
259
- minW: Shorthand<"minWidth">;
260
- maxW: Shorthand<"maxWidth">;
261
- h: Shorthand<"height">;
262
- minH: Shorthand<"minHeight">;
263
- maxH: Shorthand<"maxHeight">;
264
- textShadowColor: Shorthand<"textShadowColor">;
265
- bgPosition: Shorthand<"backgroundPosition">;
266
- bgPositionX: Shorthand<"backgroundPositionX">;
267
- bgPositionY: Shorthand<"backgroundPositionY">;
268
- bgAttachment: Shorthand<"backgroundAttachment">;
269
- bgClip: Shorthand<"backgroundClip">;
270
- bg: Shorthand<"background">;
271
- bgColor: Shorthand<"backgroundColor">;
272
- bgOrigin: Shorthand<"backgroundOrigin">;
273
- bgImage: Shorthand<"backgroundImage">;
274
- bgRepeat: Shorthand<"backgroundRepeat">;
275
- bgBlendMode: Shorthand<"backgroundBlendMode">;
276
- bgSize: Shorthand<"backgroundSize">;
277
- bgGradient: Shorthand<"backgroundGradient">;
278
- rounded: Shorthand<"borderRadius">;
279
- roundedTopLeft: Shorthand<"borderTopLeftRadius">;
280
- roundedTopRight: Shorthand<"borderTopRightRadius">;
281
- roundedBottomRight: Shorthand<"borderBottomRightRadius">;
282
- roundedBottomLeft: Shorthand<"borderBottomLeftRadius">;
283
- roundedTop: Shorthand<"borderTopRadius">;
284
- roundedRight: Shorthand<"borderRightRadius">;
285
- roundedBottom: Shorthand<"borderBottomRadius">;
286
- roundedLeft: Shorthand<"borderLeftRadius">;
287
- roundedStartStart: Shorthand<"borderStartStartRadius">;
288
- roundedStartEnd: Shorthand<"borderStartEndRadius">;
289
- roundedStart: Shorthand<"borderStartRadius">;
290
- roundedEndStart: Shorthand<"borderEndStartRadius">;
291
- roundedEndEnd: Shorthand<"borderEndEndRadius">;
292
- roundedEnd: Shorthand<"borderEndRadius">;
293
- borderX: Shorthand<"borderInline">;
294
- borderXWidth: Shorthand<"borderInlineWidth">;
295
- borderXColor: Shorthand<"borderInlineColor">;
296
- borderY: Shorthand<"borderBlock">;
297
- borderYWidth: Shorthand<"borderBlockWidth">;
298
- borderYColor: Shorthand<"borderBlockColor">;
299
- borderStart: Shorthand<"borderInlineStart">;
300
- borderStartWidth: Shorthand<"borderInlineStartWidth">;
301
- borderStartColor: Shorthand<"borderInlineStartColor">;
302
- borderEnd: Shorthand<"borderInlineEnd">;
303
- borderEndWidth: Shorthand<"borderInlineEndWidth">;
304
- borderEndColor: Shorthand<"borderInlineEndColor">;
305
- shadow: Shorthand<"boxShadow">;
306
- shadowColor: Shorthand<"boxShadowColor">;
307
- x: Shorthand<"translateX">;
308
- y: Shorthand<"translateY">;
309
- scrollMarginY: Shorthand<"scrollMarginBlock">;
310
- scrollMarginX: Shorthand<"scrollMarginInline">;
311
- scrollPaddingY: Shorthand<"scrollPaddingBlock">;
312
- scrollPaddingX: Shorthand<"scrollPaddingInline">;
313
- }
314
-
315
- type StrictableProps =
316
- | 'alignContent'
317
- | 'alignItems'
318
- | 'alignSelf'
319
- | 'all'
320
- | 'animationComposition'
321
- | 'animationDirection'
322
- | 'animationFillMode'
323
- | 'appearance'
324
- | 'backfaceVisibility'
325
- | 'backgroundAttachment'
326
- | 'backgroundClip'
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
- | 'borderBlockEndStyle'
340
- | 'borderBlockStartStyle'
341
- | 'borderBlockStyle'
342
- | 'borderBottomStyle'
343
- | 'borderInlineEndStyle'
344
- | 'borderInlineStartStyle'
345
- | 'borderInlineStyle'
346
- | 'borderLeftStyle'
347
- | 'borderRightStyle'
348
- | 'borderTopStyle'
349
- | 'boxDecorationBreak'
350
- | 'boxSizing'
351
- | 'breakAfter'
352
- | 'breakBefore'
353
- | 'breakInside'
354
- | 'captionSide'
355
- | 'clear'
356
- | 'columnFill'
357
- | 'columnRuleStyle'
358
- | 'contentVisibility'
359
- | 'direction'
360
- | 'display'
361
- | 'emptyCells'
362
- | 'flexDirection'
363
- | 'flexWrap'
364
- | 'float'
365
- | 'fontKerning'
366
- | 'forcedColorAdjust'
367
- | 'isolation'
368
- | 'lineBreak'
369
- | 'mixBlendMode'
370
- | 'objectFit'
371
- | 'outlineStyle'
372
- | 'overflow'
373
- | 'overflowX'
374
- | 'overflowY'
375
- | 'overflowBlock'
376
- | 'overflowInline'
377
- | 'overflowWrap'
378
- | 'pointerEvents'
379
- | 'position'
380
- | 'resize'
381
- | 'scrollBehavior'
382
- | 'touchAction'
383
- | 'transformBox'
384
- | 'transformStyle'
385
- | 'userSelect'
386
- | 'visibility'
387
- | 'wordBreak'
388
- | 'writingMode'
206
+ /**
207
+ * Only relevant when using `strictTokens` or `strictPropertyValues` in your config.
208
+ * - Allows you to use an escape hatch (e.g. `[123px]`) to use any string as a value.
209
+ * - Allows you to use a color opacity modifier (e.g. `red/300`) with known color values.
210
+ * - Allows you to use an important mark (e.g. `!` or `!important`) in the value.
211
+ *
212
+ * This is useful when you want to use a value that is not defined in the config or want to opt-out of the defaults.
213
+ *
214
+ * @example
215
+ * css({
216
+ * fontSize: '[123px]', // ⚠️ will not throw even if you haven't defined 123px as a token
217
+ * })
218
+ *
219
+ * @see https://panda-css.com/docs/concepts/writing-styles#stricttokens
220
+ * @see https://panda-css.com/docs/concepts/writing-styles#strictpropertyvalues
221
+ */
222
+ export type WithEscapeHatch<T> = T | `[${string}]` | (T extends string ? WithColorOpacityModifier<string> | WithImportant<T> : T)
389
223
 
390
- type WithEscapeHatch<T> = T | `[${string}]`
391
-
392
- type FilterVagueString<Key, Value> = Value extends boolean
224
+ /**
225
+ * Will restrict the value of properties that have predefined values to those values only.
226
+ *
227
+ * @example
228
+ * css({
229
+ * display: 'abc', // ❌ will throw
230
+ * })
231
+ *
232
+ * @see https://panda-css.com/docs/concepts/writing-styles#strictpropertyvalues
233
+ */
234
+ export type OnlyKnown<Key, Value> = Value extends boolean
393
235
  ? Value
394
- : Key extends StrictableProps
395
- ? Value extends `${infer _}` ? Value : never
396
- : Value
397
-
398
- type PropOrCondition<Key, Value> = ConditionalValue<Value | (string & {})>
399
-
400
- type PropertyTypeValue<T extends string> = T extends keyof PropertyTypes
401
- ? PropOrCondition<T, PropertyTypes[T] | CssValue<T>>
402
- : never;
403
-
404
- type CssPropertyValue<T extends string> = T extends keyof CssProperties
405
- ? PropOrCondition<T, CssProperties[T]>
406
- : never;
407
-
408
- export type PropertyValue<T extends string> = T extends keyof PropertyTypes
409
- ? PropertyTypeValue<T>
410
- : T extends keyof CssProperties
411
- ? CssPropertyValue<T>
412
- : PropOrCondition<T, string | number>
236
+ : Value extends `${infer _}` ? Value : never
@@ -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
  */
@@ -44,4 +44,8 @@ export interface StaticCssOptions {
44
44
  patterns?: {
45
45
  [pattern: string]: PatternRule[]
46
46
  }
47
+ /**
48
+ * The CSS themes to generate
49
+ */
50
+ themes?: string[]
47
51
  }