@pandacss/generator 0.0.0-dev-20230505100426 → 0.0.0-dev-20230505185444

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
@@ -1801,7 +1801,7 @@ var csstype_d_ts_default = {
1801
1801
 
1802
1802
  // src/artifacts/generated/system-types.d.ts.json
1803
1803
  var system_types_d_ts_default = {
1804
- content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type NativeCssProperties = PropertiesFallback<String | Number>\n\nexport type NativeCssProperty = keyof NativeCssProperties\n\nexport type CssProperties = NativeCssProperties & CssVarProperties\n\nexport type CssKeyframes = {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ntype MinimalNested<P> = {\n [K in keyof Conditions]?: Nested<P>\n}\n\ntype GenericProperties = {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<(SystemProperties | GenericProperties) & CssVarProperties>\n\nexport type GlobalStyleObject = {\n [selector: string]: SystemStyleObject\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<{\n [K in Property]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\n\nexport type JsxStyleProps = SystemProperties &\n MinimalNested<SystemStyleObject> & {\n css?: SystemStyleObject\n }\n\ntype Assign<T, U> = Omit<T, keyof U> & U\n\ntype HTMLProps = {\n htmlSize?: string | number\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n}\n\ntype WithHTMLProps<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
1804
+ content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport type CssProperties = PropertiesFallback<String | Number> & CssVarProperties\n\nexport type CssKeyframes = {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ntype MinimalNested<P> = {\n [K in keyof Conditions]?: Nested<P>\n}\n\ntype GenericProperties = {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<(SystemProperties | GenericProperties) & CssVarProperties>\n\nexport type GlobalStyleObject = {\n [selector: string]: SystemStyleObject\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<{\n [K in Property]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\n\nexport type JsxStyleProps = SystemProperties &\n MinimalNested<SystemStyleObject> & {\n css?: SystemStyleObject\n }\n\ntype Assign<T, U> = Omit<T, keyof U> & U\n\ntype HTMLProps = {\n htmlSize?: string | number\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n}\n\ntype WithHTMLProps<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
1805
1805
  };
1806
1806
 
1807
1807
  // src/artifacts/generated/composition.d.ts.json
@@ -1816,7 +1816,7 @@ var recipe_d_ts_default = {
1816
1816
 
1817
1817
  // src/artifacts/generated/pattern.d.ts.json
1818
1818
  var pattern_d_ts_default = {
1819
- content: "import type { NativeCssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from './tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: NativeCssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: NativeCssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport type PatternHelpers = {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternConfig<T> = {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties: T extends Record<string, PatternProperty> ? T : Record<string, PatternProperty>\n /**\n * The css object this pattern will generate.\n */\n transform?: (\n props: T extends Record<infer Keys, PatternProperty> ? Record<Keys, any> : Record<string, PatternProperty>,\n helpers: PatternHelpers,\n ) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsx?: string\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<NativeCssProperty>[]\n}\n\nexport type AnyPatternConfig = PatternConfig<PatternProperty>\n"
1819
+ content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from './tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport type PatternHelpers = {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternConfig<T> = {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties: T extends Record<string, PatternProperty> ? T : Record<string, PatternProperty>\n /**\n * The css object this pattern will generate.\n */\n transform?: (\n props: T extends Record<infer Keys, PatternProperty> ? Record<Keys, any> : Record<string, PatternProperty>,\n helpers: PatternHelpers,\n ) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsx?: string\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n\nexport type AnyPatternConfig = PatternConfig<PatternProperty>\n"
1820
1820
  };
1821
1821
 
1822
1822
  // src/artifacts/generated/parts.d.ts.json
@@ -1879,11 +1879,11 @@ function generatePropTypes(ctx) {
1879
1879
  config: { strictTokens },
1880
1880
  utility
1881
1881
  } = ctx;
1882
- const strictText = `${strictTokens ? "" : " | NativeValue<T>"}`;
1882
+ const strictText = `${strictTokens ? "" : " | CssValue<T>"}`;
1883
1883
  const result = [
1884
1884
  import_outdent27.outdent`
1885
1885
  import type { ConditionalValue } from './conditions';
1886
- import type { Properties as CSSProperties } from './csstype'
1886
+ import type { CssProperties } from './system-types'
1887
1887
  import type { Tokens } from './tokens'
1888
1888
 
1889
1889
  type PropertyValueTypes = {`
@@ -1894,9 +1894,9 @@ function generatePropTypes(ctx) {
1894
1894
  }
1895
1895
  result.push("}", "\n");
1896
1896
  result.push(`
1897
- type NativeValue<T> = T extends keyof CSSProperties ? CSSProperties[T] : never
1897
+ type CssValue<T> = T extends keyof CssProperties ? CssProperties[T] : never
1898
1898
 
1899
- type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : NativeValue<T>
1899
+ type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : CssValue<T>
1900
1900
 
1901
1901
  export type PropertyTypes = PropertyValueTypes & {
1902
1902
  `);
@@ -1909,8 +1909,8 @@ function generatePropTypes(ctx) {
1909
1909
 
1910
1910
  export type PropertyValue<T extends string> = T extends keyof PropertyTypes
1911
1911
  ? ConditionalValue<PropertyTypes[T]${strictText}>
1912
- : T extends keyof CSSProperties
1913
- ? ConditionalValue<CSSProperties[T]>
1912
+ : T extends keyof CssProperties
1913
+ ? ConditionalValue<CssProperties[T]>
1914
1914
  : ConditionalValue<string | number>
1915
1915
  `;
1916
1916
  }
package/dist/index.mjs CHANGED
@@ -1770,7 +1770,7 @@ var csstype_d_ts_default = {
1770
1770
 
1771
1771
  // src/artifacts/generated/system-types.d.ts.json
1772
1772
  var system_types_d_ts_default = {
1773
- content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type NativeCssProperties = PropertiesFallback<String | Number>\n\nexport type NativeCssProperty = keyof NativeCssProperties\n\nexport type CssProperties = NativeCssProperties & CssVarProperties\n\nexport type CssKeyframes = {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ntype MinimalNested<P> = {\n [K in keyof Conditions]?: Nested<P>\n}\n\ntype GenericProperties = {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<(SystemProperties | GenericProperties) & CssVarProperties>\n\nexport type GlobalStyleObject = {\n [selector: string]: SystemStyleObject\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<{\n [K in Property]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\n\nexport type JsxStyleProps = SystemProperties &\n MinimalNested<SystemStyleObject> & {\n css?: SystemStyleObject\n }\n\ntype Assign<T, U> = Omit<T, keyof U> & U\n\ntype HTMLProps = {\n htmlSize?: string | number\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n}\n\ntype WithHTMLProps<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
1773
+ content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport type CssProperties = PropertiesFallback<String | Number> & CssVarProperties\n\nexport type CssKeyframes = {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ntype MinimalNested<P> = {\n [K in keyof Conditions]?: Nested<P>\n}\n\ntype GenericProperties = {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<(SystemProperties | GenericProperties) & CssVarProperties>\n\nexport type GlobalStyleObject = {\n [selector: string]: SystemStyleObject\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<{\n [K in Property]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\n\nexport type JsxStyleProps = SystemProperties &\n MinimalNested<SystemStyleObject> & {\n css?: SystemStyleObject\n }\n\ntype Assign<T, U> = Omit<T, keyof U> & U\n\ntype HTMLProps = {\n htmlSize?: string | number\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n}\n\ntype WithHTMLProps<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
1774
1774
  };
1775
1775
 
1776
1776
  // src/artifacts/generated/composition.d.ts.json
@@ -1785,7 +1785,7 @@ var recipe_d_ts_default = {
1785
1785
 
1786
1786
  // src/artifacts/generated/pattern.d.ts.json
1787
1787
  var pattern_d_ts_default = {
1788
- content: "import type { NativeCssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from './tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: NativeCssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: NativeCssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport type PatternHelpers = {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternConfig<T> = {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties: T extends Record<string, PatternProperty> ? T : Record<string, PatternProperty>\n /**\n * The css object this pattern will generate.\n */\n transform?: (\n props: T extends Record<infer Keys, PatternProperty> ? Record<Keys, any> : Record<string, PatternProperty>,\n helpers: PatternHelpers,\n ) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsx?: string\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<NativeCssProperty>[]\n}\n\nexport type AnyPatternConfig = PatternConfig<PatternProperty>\n"
1788
+ content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from './tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport type PatternHelpers = {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternConfig<T> = {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties: T extends Record<string, PatternProperty> ? T : Record<string, PatternProperty>\n /**\n * The css object this pattern will generate.\n */\n transform?: (\n props: T extends Record<infer Keys, PatternProperty> ? Record<Keys, any> : Record<string, PatternProperty>,\n helpers: PatternHelpers,\n ) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsx?: string\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n\nexport type AnyPatternConfig = PatternConfig<PatternProperty>\n"
1789
1789
  };
1790
1790
 
1791
1791
  // src/artifacts/generated/parts.d.ts.json
@@ -1848,11 +1848,11 @@ function generatePropTypes(ctx) {
1848
1848
  config: { strictTokens },
1849
1849
  utility
1850
1850
  } = ctx;
1851
- const strictText = `${strictTokens ? "" : " | NativeValue<T>"}`;
1851
+ const strictText = `${strictTokens ? "" : " | CssValue<T>"}`;
1852
1852
  const result = [
1853
1853
  outdent27`
1854
1854
  import type { ConditionalValue } from './conditions';
1855
- import type { Properties as CSSProperties } from './csstype'
1855
+ import type { CssProperties } from './system-types'
1856
1856
  import type { Tokens } from './tokens'
1857
1857
 
1858
1858
  type PropertyValueTypes = {`
@@ -1863,9 +1863,9 @@ function generatePropTypes(ctx) {
1863
1863
  }
1864
1864
  result.push("}", "\n");
1865
1865
  result.push(`
1866
- type NativeValue<T> = T extends keyof CSSProperties ? CSSProperties[T] : never
1866
+ type CssValue<T> = T extends keyof CssProperties ? CssProperties[T] : never
1867
1867
 
1868
- type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : NativeValue<T>
1868
+ type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : CssValue<T>
1869
1869
 
1870
1870
  export type PropertyTypes = PropertyValueTypes & {
1871
1871
  `);
@@ -1878,8 +1878,8 @@ function generatePropTypes(ctx) {
1878
1878
 
1879
1879
  export type PropertyValue<T extends string> = T extends keyof PropertyTypes
1880
1880
  ? ConditionalValue<PropertyTypes[T]${strictText}>
1881
- : T extends keyof CSSProperties
1882
- ? ConditionalValue<CSSProperties[T]>
1881
+ : T extends keyof CssProperties
1882
+ ? ConditionalValue<CssProperties[T]>
1883
1883
  : ConditionalValue<string | number>
1884
1884
  `;
1885
1885
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "0.0.0-dev-20230505100426",
3
+ "version": "0.0.0-dev-20230505185444",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -20,16 +20,16 @@
20
20
  "pluralize": "8.0.0",
21
21
  "postcss": "8.4.23",
22
22
  "ts-pattern": "4.2.2",
23
- "@pandacss/core": "0.0.0-dev-20230505100426",
24
- "@pandacss/logger": "0.0.0-dev-20230505100426",
25
- "@pandacss/is-valid-prop": "0.0.0-dev-20230505100426",
26
- "@pandacss/shared": "0.0.0-dev-20230505100426",
27
- "@pandacss/types": "0.0.0-dev-20230505100426",
28
- "@pandacss/token-dictionary": "0.0.0-dev-20230505100426"
23
+ "@pandacss/core": "0.0.0-dev-20230505185444",
24
+ "@pandacss/logger": "0.0.0-dev-20230505185444",
25
+ "@pandacss/is-valid-prop": "0.0.0-dev-20230505185444",
26
+ "@pandacss/shared": "0.0.0-dev-20230505185444",
27
+ "@pandacss/types": "0.0.0-dev-20230505185444",
28
+ "@pandacss/token-dictionary": "0.0.0-dev-20230505185444"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/pluralize": "0.0.29",
32
- "@pandacss/fixture": "0.0.0-dev-20230505100426"
32
+ "@pandacss/fixture": "0.0.0-dev-20230505185444"
33
33
  },
34
34
  "scripts": {
35
35
  "prebuild": "tsx scripts/prebuild.ts",