@pandacss/language-server 0.0.0-dev-20230927132629 → 0.0.0-dev-20230927144111

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.
Files changed (2) hide show
  1. package/dist/index.js +54 -45
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -31684,7 +31684,15 @@ transform`)}
31684
31684
  ${r.file.import("compact, createCss, withoutSpace","../helpers")}
31685
31685
 
31686
31686
  export const createRecipe = (name, defaultVariants, compoundVariants) => {
31687
- return (variants) => {
31687
+ const getRecipeStyles = (variants) => {
31688
+ return {
31689
+ [name]: '__ignore__',
31690
+ ...defaultVariants,
31691
+ ...compact(variants),
31692
+ };
31693
+ };
31694
+
31695
+ const recipeFn = (variants, withCompoundVariants = true) => {
31688
31696
  const transform = (prop, value) => {
31689
31697
  assertCompoundVariant(name, compoundVariants, variants, prop)
31690
31698
 
@@ -31704,16 +31712,21 @@ transform`)}
31704
31712
  }
31705
31713
  })
31706
31714
 
31707
- const recipeStyles = {
31708
- [name]: '__ignore__',
31709
- ...defaultVariants,
31710
- ...compact(variants),
31711
- }
31715
+ const recipeStyles = getRecipeStyles(variants)
31712
31716
 
31713
- const compoundVariantStyles = getCompoundVariantCss(compoundVariants, recipeStyles)
31717
+ if (withCompoundVariants) {
31718
+ const compoundVariantStyles = getCompoundVariantCss(compoundVariants, recipeStyles)
31719
+ return cx(recipeCss(recipeStyles), css(compoundVariantStyles))
31720
+ }
31714
31721
 
31715
- return cx(recipeCss(recipeStyles), css(compoundVariantStyles))
31722
+ return recipeCss(recipeStyles)
31716
31723
  }
31724
+
31725
+ return Object.assign(recipeFn, {
31726
+ __getCompoundVariantCss__: (variants) => {
31727
+ return getCompoundVariantCss(compoundVariants, getRecipeStyles(variants));
31728
+ },
31729
+ })
31717
31730
  }
31718
31731
  `},...r.recipes.details.map(h=>{let{baseName:b,config:x,upperName:w,variantKeyMap:L,dashName:q}=h,{description:te,defaultVariants:me,compoundVariants:Ee}=x,ke=Sg(x).when(aRe,Ue=>pf`
31719
31732
  ${r.file.import("splitProps, getSlotCompoundVariant","../helpers")}
@@ -31851,7 +31864,7 @@ transform`)}
31851
31864
  import { h } from 'preact'
31852
31865
  import { forwardRef } from 'preact/compat'
31853
31866
  import { useMemo } from 'preact/hooks'
31854
- ${r.file.import("css, cx, cva, assignCss","../css/index")}
31867
+ ${r.file.import("css, cx, cva","../css/index")}
31855
31868
  ${r.file.import("splitProps, normalizeHTMLProps","../helpers")}
31856
31869
  ${r.file.import("isCssProperty","./is-valid-prop")}
31857
31870
 
@@ -31867,15 +31880,14 @@ transform`)}
31867
31880
 
31868
31881
  function recipeClass() {
31869
31882
  const { css: cssStyles, ...propStyles } = styleProps
31870
- const styles = assignCss(propStyles, cssStyles)
31871
- return cx(cvaFn(variantProps), css(styles), elementProps.className, elementProps.class)
31883
+ const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
31884
+ return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className, elementProps.class)
31872
31885
  }
31873
31886
 
31874
31887
  function cvaClass() {
31875
31888
  const { css: cssStyles, ...propStyles } = styleProps
31876
31889
  const cvaStyles = cvaFn.raw(variantProps)
31877
- const styles = assignCss(cvaStyles, propStyles, cssStyles)
31878
- return cx(css(styles), elementProps.className, elementProps.class)
31890
+ return cx(css(cvaStyles, propStyles, cssStyles), elementProps.className, elementProps.class)
31879
31891
  }
31880
31892
 
31881
31893
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -32037,7 +32049,7 @@ export type ${u} = JsxFactory ${i==="none"?"":"& JsxElements"}
32037
32049
  export type ${d}<T extends ElementType> = ComponentProps<T>
32038
32050
  `}}function B0r(r){let{factoryName:e,componentName:i}=r.jsx;return{js:pf`
32039
32051
  import { h } from '@builder.io/qwik'
32040
- ${r.file.import("css, cx, cva, assignCss","../css/index")}
32052
+ ${r.file.import("css, cx, cva","../css/index")}
32041
32053
  ${r.file.import("splitProps, normalizeHTMLProps","../helpers")}
32042
32054
  ${r.file.import("isCssProperty","./is-valid-prop")}
32043
32055
 
@@ -32053,14 +32065,13 @@ export type ${d}<T extends ElementType> = ComponentProps<T>
32053
32065
  const { css: cssStyles, ...propStyles } = styleProps
32054
32066
 
32055
32067
  function recipeClass() {
32056
- const styles = assignCss(propStyles, cssStyles)
32057
- return cx(cvaFn(variantProps), css(styles), elementProps.class)
32068
+ const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
32069
+ return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.class)
32058
32070
  }
32059
32071
 
32060
32072
  function cvaClass() {
32061
32073
  const cvaStyles = cvaFn.raw(variantProps)
32062
- const styles = assignCss(cvaStyles, propStyles, cssStyles)
32063
- return cx(css(styles), elementProps.class)
32074
+ return cx(css(cvaStyles, propStyles, cssStyles), elementProps.class)
32064
32075
  }
32065
32076
 
32066
32077
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -32228,7 +32239,7 @@ export type ${u} = JsxFactory ${i==="none"?"":"& JsxElements"}
32228
32239
  export type ${d}<T extends ElementType> = ComponentProps<T>
32229
32240
  `}}function b0r(r){let{factoryName:e,componentName:i}=r.jsx;return{js:pf`
32230
32241
  import { createElement, forwardRef, useMemo } from 'react'
32231
- ${r.file.import("css, cx, cva, assignCss","../css/index")}
32242
+ ${r.file.import("css, cx, cva","../css/index")}
32232
32243
  ${r.file.import("splitProps, normalizeHTMLProps","../helpers")}
32233
32244
  ${r.jsx.styleProps==="all"?r.file.import("isCssProperty","./is-valid-prop"):""}
32234
32245
 
@@ -32245,41 +32256,40 @@ export type ${d}<T extends ElementType> = ComponentProps<T>
32245
32256
 
32246
32257
  function recipeClass() {
32247
32258
  const { css: cssStyles, ...propStyles } = styleProps
32248
- const styles = assignCss(propStyles, cssStyles)
32249
- return cx(cvaFn(variantProps), css(styles), elementProps.className)
32259
+ const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
32260
+ return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className)
32250
32261
  }
32251
32262
 
32252
32263
  function cvaClass() {
32253
32264
  const { css: cssStyles, ...propStyles } = styleProps
32254
32265
  const cvaStyles = cvaFn.raw(variantProps)
32255
- const styles = assignCss(cvaStyles, propStyles, cssStyles)
32256
- return cx(css(styles), elementProps.className)
32266
+ return cx(css(cvaStyles, propStyles, cssStyles), elementProps.className)
32257
32267
  }`).with("minimal",()=>pf`
32258
32268
  const [variantProps, htmlProps, elementProps] = useMemo(() => {
32259
32269
  return splitProps(restProps, cvaFn.variantKeys, normalizeHTMLProps.keys)
32260
32270
  }, [restProps])
32261
32271
 
32262
32272
  function recipeClass() {
32263
- return cx(cvaFn(variantProps), css(assignCss(elementProps.css)), elementProps.className)
32273
+ const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
32274
+ return cx(cvaFn(variantProps, false), css(compoundVariantStyles, elementProps.css), elementProps.className)
32264
32275
  }
32265
32276
 
32266
32277
  function cvaClass() {
32267
32278
  const cvaStyles = cvaFn.raw(variantProps)
32268
- const styles = assignCss(cvaStyles, elementProps.css)
32269
- return cx(css(styles), elementProps.className)
32279
+ return cx(css(cvaStyles, elementProps.css), elementProps.className)
32270
32280
  }`).with("none",()=>pf`
32271
32281
  const [variantProps, htmlProps, elementProps] = useMemo(() => {
32272
32282
  return splitProps(restProps, cvaFn.variantKeys, normalizeHTMLProps.keys)
32273
32283
  }, [restProps])
32274
32284
 
32275
32285
  function recipeClass() {
32276
- return cx(cvaFn(variantProps), elementProps.className)
32286
+ const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
32287
+ return cx(cvaFn(variantProps, false), elementProps.className)
32277
32288
  }
32278
32289
 
32279
32290
  function cvaClass() {
32280
32291
  const cvaStyles = cvaFn.raw(variantProps)
32281
- const styles = assignCss(cvaStyles)
32282
- return cx(css(styles), elementProps.className)
32292
+ return cx(css(cvaStyles), elementProps.className)
32283
32293
  }`).run()}
32284
32294
 
32285
32295
 
@@ -32469,15 +32479,13 @@ export type ${d}<T extends ElementType> = ComponentProps<T>
32469
32479
 
32470
32480
  function recipeClass() {
32471
32481
  const { css: cssStyles, ...propStyles } = styleProps
32472
- const styles = assignCss(propStyles, cssStyles)
32473
- return cx(cvaFn(variantProps), css(styles), localProps.class)
32482
+ return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), localProps.class)
32474
32483
  }
32475
32484
 
32476
32485
  function cvaClass() {
32477
32486
  const { css: cssStyles, ...propStyles } = styleProps
32478
32487
  const cvaStyles = cvaFn.raw(variantProps)
32479
- const styles = assignCss(cvaStyles, propStyles, cssStyles)
32480
- return cx(css(styles), localProps.class)
32488
+ return cx(css(cvaStyles, propStyles, cssStyles), localProps.class)
32481
32489
  }
32482
32490
 
32483
32491
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -32669,15 +32677,14 @@ export type ${d}<T extends ElementType> = ComponentProps<T>
32669
32677
  const recipeClass = computed(() => {
32670
32678
  const [variantProps, styleProps, _htmlProps, elementProps] = splittedProps.value
32671
32679
  const { css: cssStyles, ...propStyles } = styleProps
32672
- const styles = assignCss(propStyles, cssStyles)
32673
- return cx(cvaFn(variantProps), css(styles), elementProps.className)
32680
+ const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
32681
+ return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className)
32674
32682
  })
32675
32683
 
32676
32684
  const cvaClass = computed(() => {
32677
32685
  const [variantProps, styleProps, _htmlProps, elementProps] = splittedProps.value
32678
32686
  const { css: cssStyles, ...propStyles } = styleProps
32679
- const styles = assignCss(propStyles, cssStyles)
32680
- return cx(cvaFn(variantProps), css(styles), elementProps.className)
32687
+ return cx(cvaFn(variantProps), css(propStyles, cssStyles), elementProps.className)
32681
32688
  })
32682
32689
 
32683
32690
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -53839,11 +53846,13 @@ export interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVa
53839
53846
  ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
53840
53847
  }
53841
53848
 
53842
- export type RecipeCompoundSelection<T extends RecipeVariantRecord> = {
53843
- [K in keyof T]?: StringToBoolean<keyof T[K]> | Array<StringToBoolean<keyof T[K]>>
53849
+ type OneOrMore<T> = T | Array<T>
53850
+
53851
+ export type RecipeCompoundSelection<T> = {
53852
+ [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>>
53844
53853
  }
53845
53854
 
53846
- export type RecipeCompoundVariant<T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {
53855
+ export type RecipeCompoundVariant<T> = T & {
53847
53856
  css: SystemStyleObject
53848
53857
  }
53849
53858
 
@@ -53855,7 +53864,7 @@ export interface RecipeDefinition<T extends RecipeVariantRecord> {
53855
53864
  /**
53856
53865
  * The multi-variant styles of the recipe.
53857
53866
  */
53858
- variants?: T | RecipeVariantRecord
53867
+ variants?: T
53859
53868
  /**
53860
53869
  * The default variants of the recipe.
53861
53870
  */
@@ -53863,7 +53872,7 @@ export interface RecipeDefinition<T extends RecipeVariantRecord> {
53863
53872
  /**
53864
53873
  * The styles to apply when a combination of variants is selected.
53865
53874
  */
53866
- compoundVariants?: Array<RecipeCompoundVariant<T>>
53875
+ compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[]
53867
53876
  }
53868
53877
 
53869
53878
  export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
@@ -53910,7 +53919,7 @@ export interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVaria
53910
53919
  splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<Omit<Props, keyof T>>]
53911
53920
  }
53912
53921
 
53913
- export type SlotRecipeCompoundVariant<S extends string, T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {
53922
+ export type SlotRecipeCompoundVariant<S extends string, T> = T & {
53914
53923
  css: SlotRecord<S, SystemStyleObject>
53915
53924
  }
53916
53925
 
@@ -53926,7 +53935,7 @@ export interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVari
53926
53935
  /**
53927
53936
  * The multi-variant styles of the recipe.
53928
53937
  */
53929
- variants?: T | SlotRecipeVariantRecord<S>
53938
+ variants?: T
53930
53939
  /**
53931
53940
  * The default variants of the recipe.
53932
53941
  */
@@ -53934,7 +53943,7 @@ export interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVari
53934
53943
  /**
53935
53944
  * The styles to apply when a combination of variants is selected.
53936
53945
  */
53937
- compoundVariants?: Array<SlotRecipeCompoundVariant<S, T>>
53946
+ compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[]
53938
53947
  }
53939
53948
 
53940
53949
  export type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pandacss/language-server",
3
3
  "displayName": "Panda CSS",
4
4
  "description": "🐼 The official Panda language server",
5
- "version": "0.0.0-dev-20230927132629",
5
+ "version": "0.0.0-dev-20230927144111",
6
6
  "main": "dist/index.js",
7
7
  "repository": {
8
8
  "url": "https://github.com/chakra-ui/panda",
@@ -32,14 +32,14 @@
32
32
  "vscode-languageserver": "^8.1.0",
33
33
  "vscode-languageserver-textdocument": "^1.0.8",
34
34
  "vscode-uri": "^3.0.7",
35
- "@pandacss/core": "0.0.0-dev-20230927132629",
36
- "@pandacss/extension-shared": "0.0.0-dev-20230927132629",
37
- "@pandacss/extractor": "0.0.0-dev-20230927132629",
38
- "@pandacss/node": "0.0.0-dev-20230927132629",
39
- "@pandacss/parser": "0.0.0-dev-20230927132629",
40
- "@pandacss/shared": "0.0.0-dev-20230927132629",
41
- "@pandacss/token-dictionary": "0.0.0-dev-20230927132629",
42
- "@pandacss/types": "0.0.0-dev-20230927132629"
35
+ "@pandacss/core": "0.0.0-dev-20230927144111",
36
+ "@pandacss/extension-shared": "0.0.0-dev-20230927144111",
37
+ "@pandacss/extractor": "0.0.0-dev-20230927144111",
38
+ "@pandacss/node": "0.0.0-dev-20230927144111",
39
+ "@pandacss/parser": "0.0.0-dev-20230927144111",
40
+ "@pandacss/shared": "0.0.0-dev-20230927144111",
41
+ "@pandacss/token-dictionary": "0.0.0-dev-20230927144111",
42
+ "@pandacss/types": "0.0.0-dev-20230927144111"
43
43
  },
44
44
  "dependencies": {
45
45
  "fast-glob": "^3.3.1"