@pandacss/node 0.0.0-dev-20230105084653 → 0.0.0-dev-20230106112845

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.d.ts CHANGED
@@ -119,6 +119,7 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
119
119
  }[];
120
120
  }[];
121
121
  jsxFramework: "solid" | "react" | "preact" | undefined;
122
+ jsxFactoryName: string;
122
123
  jsxFactory: string;
123
124
  cssVarRoot: string;
124
125
  properties: string[];
@@ -255,6 +256,7 @@ declare class Builder {
255
256
  }[];
256
257
  }[];
257
258
  jsxFramework: "solid" | "react" | "preact" | undefined;
259
+ jsxFactoryName: string;
258
260
  jsxFactory: string;
259
261
  cssVarRoot: string;
260
262
  properties: string[];
@@ -383,6 +385,7 @@ declare function loadConfigAndCreateContext(options?: {
383
385
  }[];
384
386
  }[];
385
387
  jsxFramework: "solid" | "react" | "preact" | undefined;
388
+ jsxFactoryName: string;
386
389
  jsxFactory: string;
387
390
  cssVarRoot: string;
388
391
  properties: string[];
package/dist/index.js CHANGED
@@ -721,23 +721,17 @@ import type { ElementType, ComponentProps } from 'react'
721
721
  import type { JsxStyleProps, Assign } from '.'
722
722
 
723
723
  type Element = keyof JSX.IntrinsicElements
724
- type As<P = any> = ElementType<P>
725
724
  type Dict<T = unknown> = Record<string, T>
726
725
 
727
- type Clean<T> = Omit<T, 'transition' | 'as' | 'color'>
726
+ type Clean<T> = Omit<T, 'color' | 'translate' | 'transition'>
728
727
 
729
728
  type PolymorphicProps<
730
729
  ComponentProps extends Dict,
731
- AsProps extends Dict,
732
730
  AdditionalProps extends Dict = {},
733
- AsComponent extends As = As,
734
- > = Assign<Clean<ComponentProps>, AdditionalProps> &
735
- Assign<Clean<AsProps>, AdditionalProps> & {
736
- as?: AsComponent
737
- }
731
+ > = Assign<Clean<ComponentProps>, AdditionalProps>
738
732
 
739
- export type PolymorphicComponent<C extends As, P extends Dict = {}> = {
740
- <E extends As = C>(props: PolymorphicProps<ComponentProps<C>, ComponentProps<E>, P, E> & JsxStyleProps<P>): JSX.Element
733
+ export type PolymorphicComponent<C extends ElementType, P extends Dict = {}> = {
734
+ (props: PolymorphicProps<ComponentProps<C>, P> & JsxStyleProps<P>): JSX.Element
741
735
  displayName?: string
742
736
  }
743
737
 
@@ -745,7 +739,7 @@ export type PolymorphicComponents = {
745
739
  [K in Element]: PolymorphicComponent<K, {}>
746
740
  }
747
741
 
748
- export type HTML${upperName}Props<T extends As> = Clean<ComponentProps<T>> & JsxStyleProps
742
+ export type HTML${upperName}Props<T extends ElementType> = Clean<ComponentProps<T>> & JsxStyleProps
749
743
  `
750
744
  };
751
745
  }
@@ -1388,11 +1382,15 @@ function generateCssType(ctx) {
1388
1382
  import { Conditions } from './conditions'
1389
1383
 
1390
1384
  export type SystemStyleObject<Overrides extends Record<string, unknown> = {}> = System.StyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
1385
+
1391
1386
  export type GlobalStyleObject<Overrides extends Record<string, unknown> = {}> = System.GlobalStyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
1387
+
1392
1388
  export type JsxStyleProps<Overrides extends Record<string, unknown> = {}> = System.JsxStyleProps<Conditions, PropTypes, ${strictArg}, Overrides>
1389
+
1393
1390
  export type ConditionalValue<Value> = System.Conditional<Conditions, Value>
1394
1391
 
1395
1392
  type DistributiveOmit<T, U> = T extends any ? Pick<T, Exclude<keyof T, U>> : never
1393
+
1396
1394
  export type Assign<Target, Override> = DistributiveOmit<Target, keyof Override> & Override
1397
1395
  `
1398
1396
  };
@@ -1540,7 +1538,13 @@ function setupJsx(ctx) {
1540
1538
  { file: "is-valid-prop.mjs", code: isValidProp.js },
1541
1539
  { file: "factory.d.ts", code: types.jsxFactory },
1542
1540
  { file: "factory.jsx", code: factory.js },
1543
- { file: "index.d.ts", code: indexCode },
1541
+ {
1542
+ file: "index.d.ts",
1543
+ code: import_outdent24.default`
1544
+ ${indexCode}
1545
+ export type { HTML${ctx.jsxFactoryName}Props } from '../types/jsx'
1546
+ `
1547
+ },
1544
1548
  { file: "index.jsx", code: indexCode }
1545
1549
  ]
1546
1550
  };
@@ -1763,6 +1767,7 @@ function createContext(conf, io = fileSystem) {
1763
1767
  textStyles,
1764
1768
  layerStyles
1765
1769
  } = theme;
1770
+ const jsxFactoryName = (0, import_shared14.capitalize)(jsxFactory);
1766
1771
  const cwd = (0, import_path2.resolve)(cwdProp);
1767
1772
  const exclude = [".git", "node_modules", "test-results"].concat(excludeProp);
1768
1773
  const tokens = new import_token_dictionary.TokenDictionary({
@@ -2103,6 +2108,7 @@ function createContext(conf, io = fileSystem) {
2103
2108
  hasRecipes,
2104
2109
  getRecipeDetails,
2105
2110
  jsxFramework,
2111
+ jsxFactoryName,
2106
2112
  jsxFactory,
2107
2113
  cssVarRoot,
2108
2114
  properties,
package/dist/index.mjs CHANGED
@@ -675,23 +675,17 @@ import type { ElementType, ComponentProps } from 'react'
675
675
  import type { JsxStyleProps, Assign } from '.'
676
676
 
677
677
  type Element = keyof JSX.IntrinsicElements
678
- type As<P = any> = ElementType<P>
679
678
  type Dict<T = unknown> = Record<string, T>
680
679
 
681
- type Clean<T> = Omit<T, 'transition' | 'as' | 'color'>
680
+ type Clean<T> = Omit<T, 'color' | 'translate' | 'transition'>
682
681
 
683
682
  type PolymorphicProps<
684
683
  ComponentProps extends Dict,
685
- AsProps extends Dict,
686
684
  AdditionalProps extends Dict = {},
687
- AsComponent extends As = As,
688
- > = Assign<Clean<ComponentProps>, AdditionalProps> &
689
- Assign<Clean<AsProps>, AdditionalProps> & {
690
- as?: AsComponent
691
- }
685
+ > = Assign<Clean<ComponentProps>, AdditionalProps>
692
686
 
693
- export type PolymorphicComponent<C extends As, P extends Dict = {}> = {
694
- <E extends As = C>(props: PolymorphicProps<ComponentProps<C>, ComponentProps<E>, P, E> & JsxStyleProps<P>): JSX.Element
687
+ export type PolymorphicComponent<C extends ElementType, P extends Dict = {}> = {
688
+ (props: PolymorphicProps<ComponentProps<C>, P> & JsxStyleProps<P>): JSX.Element
695
689
  displayName?: string
696
690
  }
697
691
 
@@ -699,7 +693,7 @@ export type PolymorphicComponents = {
699
693
  [K in Element]: PolymorphicComponent<K, {}>
700
694
  }
701
695
 
702
- export type HTML${upperName}Props<T extends As> = Clean<ComponentProps<T>> & JsxStyleProps
696
+ export type HTML${upperName}Props<T extends ElementType> = Clean<ComponentProps<T>> & JsxStyleProps
703
697
  `
704
698
  };
705
699
  }
@@ -1342,11 +1336,15 @@ function generateCssType(ctx) {
1342
1336
  import { Conditions } from './conditions'
1343
1337
 
1344
1338
  export type SystemStyleObject<Overrides extends Record<string, unknown> = {}> = System.StyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
1339
+
1345
1340
  export type GlobalStyleObject<Overrides extends Record<string, unknown> = {}> = System.GlobalStyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
1341
+
1346
1342
  export type JsxStyleProps<Overrides extends Record<string, unknown> = {}> = System.JsxStyleProps<Conditions, PropTypes, ${strictArg}, Overrides>
1343
+
1347
1344
  export type ConditionalValue<Value> = System.Conditional<Conditions, Value>
1348
1345
 
1349
1346
  type DistributiveOmit<T, U> = T extends any ? Pick<T, Exclude<keyof T, U>> : never
1347
+
1350
1348
  export type Assign<Target, Override> = DistributiveOmit<Target, keyof Override> & Override
1351
1349
  `
1352
1350
  };
@@ -1494,7 +1492,13 @@ function setupJsx(ctx) {
1494
1492
  { file: "is-valid-prop.mjs", code: isValidProp.js },
1495
1493
  { file: "factory.d.ts", code: types.jsxFactory },
1496
1494
  { file: "factory.jsx", code: factory.js },
1497
- { file: "index.d.ts", code: indexCode },
1495
+ {
1496
+ file: "index.d.ts",
1497
+ code: outdent24`
1498
+ ${indexCode}
1499
+ export type { HTML${ctx.jsxFactoryName}Props } from '../types/jsx'
1500
+ `
1501
+ },
1498
1502
  { file: "index.jsx", code: indexCode }
1499
1503
  ]
1500
1504
  };
@@ -1724,6 +1728,7 @@ function createContext(conf, io = fileSystem) {
1724
1728
  textStyles,
1725
1729
  layerStyles
1726
1730
  } = theme;
1731
+ const jsxFactoryName = capitalize13(jsxFactory);
1727
1732
  const cwd = resolve(cwdProp);
1728
1733
  const exclude = [".git", "node_modules", "test-results"].concat(excludeProp);
1729
1734
  const tokens = new TokenDictionary({
@@ -2064,6 +2069,7 @@ function createContext(conf, io = fileSystem) {
2064
2069
  hasRecipes,
2065
2070
  getRecipeDetails,
2066
2071
  jsxFramework,
2072
+ jsxFactoryName,
2067
2073
  jsxFactory,
2068
2074
  cssVarRoot,
2069
2075
  properties,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.0.0-dev-20230105084653",
3
+ "version": "0.0.0-dev-20230106112845",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,15 +30,15 @@
30
30
  "telejson": "7.0.4",
31
31
  "ts-pattern": "4.0.6",
32
32
  "ts-morph": "17.0.1",
33
- "@pandacss/types": "0.0.0-dev-20230105084653",
34
- "@pandacss/is-valid-prop": "0.0.0-dev-20230105084653",
35
- "@pandacss/error": "0.0.0-dev-20230105084653",
36
- "@pandacss/parser": "0.0.0-dev-20230105084653",
37
- "@pandacss/shared": "0.0.0-dev-20230105084653",
38
- "@pandacss/token-dictionary": "0.0.0-dev-20230105084653",
39
- "@pandacss/logger": "0.0.0-dev-20230105084653",
40
- "@pandacss/core": "0.0.0-dev-20230105084653",
41
- "@pandacss/config": "0.0.0-dev-20230105084653"
33
+ "@pandacss/types": "0.0.0-dev-20230106112845",
34
+ "@pandacss/is-valid-prop": "0.0.0-dev-20230106112845",
35
+ "@pandacss/error": "0.0.0-dev-20230106112845",
36
+ "@pandacss/parser": "0.0.0-dev-20230106112845",
37
+ "@pandacss/shared": "0.0.0-dev-20230106112845",
38
+ "@pandacss/token-dictionary": "0.0.0-dev-20230106112845",
39
+ "@pandacss/logger": "0.0.0-dev-20230106112845",
40
+ "@pandacss/core": "0.0.0-dev-20230106112845",
41
+ "@pandacss/config": "0.0.0-dev-20230106112845"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/fs-extra": "9.0.13",
@@ -46,7 +46,7 @@
46
46
  "@types/glob-parent": "^5.1.1",
47
47
  "@types/pluralize": "0.0.29",
48
48
  "@types/lodash.merge": "4.6.7",
49
- "@pandacss/fixture": "0.0.0-dev-20230105084653"
49
+ "@pandacss/fixture": "0.0.0-dev-20230106112845"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",