@pandacss/generator 0.0.0-dev-20231115170809 → 0.0.0-dev-20231121120209

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/dist/index.js CHANGED
@@ -67,7 +67,7 @@ var artifactsGenerated = (ctx) => {
67
67
  ${tick} ${(0, import_logger.quote)(outdir, "/tokens")}: the css variables and js function to query your tokens
68
68
  `,
69
69
  !patterns.isEmpty() && !ctx.isTemplateLiteralSyntax && import_outdent.outdent`
70
- ${tick} ${(0, import_logger.quote)(outdir, "/patterns")}: functions to implement apply common layout patterns
70
+ ${tick} ${(0, import_logger.quote)(outdir, "/patterns")}: functions to implement and apply common layout patterns
71
71
  `,
72
72
  !recipes.isEmpty() && import_outdent.outdent`
73
73
  ${tick} ${(0, import_logger.quote)(outdir, "/recipes")}: functions to create multi-variant styles
@@ -3187,7 +3187,6 @@ function generatePropTypes(ctx) {
3187
3187
  config: { strictTokens },
3188
3188
  utility
3189
3189
  } = ctx;
3190
- const strictText = `${strictTokens ? "" : " | CssValue<T>"}`;
3191
3190
  const result = [
3192
3191
  import_outdent41.outdent`
3193
3192
  ${ctx.file.importType("ConditionalValue", "./conditions")}
@@ -3204,7 +3203,7 @@ function generatePropTypes(ctx) {
3204
3203
  result.push(`
3205
3204
  type CssValue<T> = T extends keyof CssProperties ? CssProperties[T] : never
3206
3205
 
3207
- type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : CssValue<T>
3206
+ type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictTokens ? "" : " | CssValue<T>"} : CssValue<T>
3208
3207
 
3209
3208
  export interface PropertyTypes extends PropertyValueTypes {
3210
3209
  `);
@@ -3215,10 +3214,11 @@ function generatePropTypes(ctx) {
3215
3214
  return import_outdent41.outdent`
3216
3215
  ${result.join("\n")}
3217
3216
 
3217
+ ${strictTokens ? `type FilterString<T> = T extends \`\${infer _}\` ? T : never;` : ""}
3218
3218
  export type PropertyValue<T extends string> = T extends keyof PropertyTypes
3219
- ? ConditionalValue<PropertyTypes[T]${strictText}${!ctx.config.strictTokens ? " | (string & {})" : ""}>
3219
+ ? ConditionalValue<${strictTokens ? "FilterString<PropertyTypes[T]>" : "PropertyTypes[T] | CssValue<T> | (string & {})"}>
3220
3220
  : T extends keyof CssProperties
3221
- ? ConditionalValue<CssProperties[T]${!ctx.config.strictTokens ? " | (string & {})" : ""}>
3221
+ ? ConditionalValue<${strictTokens ? "FilterString<CssProperties[T]>" : "CssProperties[T] | (string & {})"}>
3222
3222
  : ConditionalValue<string | number>
3223
3223
  `;
3224
3224
  }
package/dist/index.mjs CHANGED
@@ -36,7 +36,7 @@ var artifactsGenerated = (ctx) => {
36
36
  ${tick} ${quote(outdir, "/tokens")}: the css variables and js function to query your tokens
37
37
  `,
38
38
  !patterns.isEmpty() && !ctx.isTemplateLiteralSyntax && outdent`
39
- ${tick} ${quote(outdir, "/patterns")}: functions to implement apply common layout patterns
39
+ ${tick} ${quote(outdir, "/patterns")}: functions to implement and apply common layout patterns
40
40
  `,
41
41
  !recipes.isEmpty() && outdent`
42
42
  ${tick} ${quote(outdir, "/recipes")}: functions to create multi-variant styles
@@ -3156,7 +3156,6 @@ function generatePropTypes(ctx) {
3156
3156
  config: { strictTokens },
3157
3157
  utility
3158
3158
  } = ctx;
3159
- const strictText = `${strictTokens ? "" : " | CssValue<T>"}`;
3160
3159
  const result = [
3161
3160
  outdent41`
3162
3161
  ${ctx.file.importType("ConditionalValue", "./conditions")}
@@ -3173,7 +3172,7 @@ function generatePropTypes(ctx) {
3173
3172
  result.push(`
3174
3173
  type CssValue<T> = T extends keyof CssProperties ? CssProperties[T] : never
3175
3174
 
3176
- type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : CssValue<T>
3175
+ type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictTokens ? "" : " | CssValue<T>"} : CssValue<T>
3177
3176
 
3178
3177
  export interface PropertyTypes extends PropertyValueTypes {
3179
3178
  `);
@@ -3184,10 +3183,11 @@ function generatePropTypes(ctx) {
3184
3183
  return outdent41`
3185
3184
  ${result.join("\n")}
3186
3185
 
3186
+ ${strictTokens ? `type FilterString<T> = T extends \`\${infer _}\` ? T : never;` : ""}
3187
3187
  export type PropertyValue<T extends string> = T extends keyof PropertyTypes
3188
- ? ConditionalValue<PropertyTypes[T]${strictText}${!ctx.config.strictTokens ? " | (string & {})" : ""}>
3188
+ ? ConditionalValue<${strictTokens ? "FilterString<PropertyTypes[T]>" : "PropertyTypes[T] | CssValue<T> | (string & {})"}>
3189
3189
  : T extends keyof CssProperties
3190
- ? ConditionalValue<CssProperties[T]${!ctx.config.strictTokens ? " | (string & {})" : ""}>
3190
+ ? ConditionalValue<${strictTokens ? "FilterString<CssProperties[T]>" : "CssProperties[T] | (string & {})"}>
3191
3191
  : ConditionalValue<string | number>
3192
3192
  `;
3193
3193
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "0.0.0-dev-20231115170809",
3
+ "version": "0.0.0-dev-20231121120209",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,17 +32,17 @@
32
32
  "pluralize": "8.0.0",
33
33
  "postcss": "^8.4.31",
34
34
  "ts-pattern": "5.0.5",
35
- "@pandacss/core": "0.0.0-dev-20231115170809",
36
- "@pandacss/is-valid-prop": "0.0.0-dev-20231115170809",
37
- "@pandacss/logger": "0.0.0-dev-20231115170809",
38
- "@pandacss/shared": "0.0.0-dev-20231115170809",
39
- "@pandacss/token-dictionary": "0.0.0-dev-20231115170809",
40
- "@pandacss/types": "0.0.0-dev-20231115170809"
35
+ "@pandacss/core": "0.0.0-dev-20231121120209",
36
+ "@pandacss/is-valid-prop": "0.0.0-dev-20231121120209",
37
+ "@pandacss/logger": "0.0.0-dev-20231121120209",
38
+ "@pandacss/shared": "0.0.0-dev-20231121120209",
39
+ "@pandacss/token-dictionary": "0.0.0-dev-20231121120209",
40
+ "@pandacss/types": "0.0.0-dev-20231121120209"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/pluralize": "0.0.30",
44
44
  "hookable": "5.5.3",
45
- "@pandacss/fixture": "0.0.0-dev-20231115170809"
45
+ "@pandacss/fixture": "0.0.0-dev-20231121120209"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsup src/index.ts --format=esm,cjs --dts",