@pandacss/node 0.0.0-dev-20221128063601 → 0.0.0-dev-20221128100346

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 (3) hide show
  1. package/dist/index.js +38 -40
  2. package/dist/index.mjs +38 -40
  3. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -323,10 +323,9 @@ function generatePreactJsxFactory(ctx) {
323
323
  import type { JSXStyleProperties } from '../types'
324
324
 
325
325
  type Element = keyof JSX.IntrinsicElements
326
-
327
- type Merge<P, T> = Omit<P, 'color'> & T;
328
326
 
329
- export type HTML${upperName}Props<T extends Element> = Merge<ComponentProps<T>, JSXStyleProperties>
327
+ export type HTML${upperName}Props<T extends Element> = Omit<ComponentProps<T>, 'color'> | JSXStyleProperties
328
+
330
329
 
331
330
  type JSXFactory = {
332
331
  [K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
@@ -335,8 +334,8 @@ function generatePreactJsxFactory(ctx) {
335
334
  export declare const ${name}: JSXFactory
336
335
  `,
337
336
  js: import_outdent6.outdent`
338
- import { h } from 'preact';
339
- import { forwardRef } from 'preact/compat';
337
+ import { h } from 'preact'
338
+ import { forwardRef } from 'preact/compat'
340
339
  import { isCssProperty } from './is-valid-prop'
341
340
  import { css } from '../css'
342
341
 
@@ -371,7 +370,7 @@ function generatePreactJsxFactory(ctx) {
371
370
  return cx(atomicClass, elementProps.className)
372
371
  }
373
372
 
374
- return h(Element, { ...elementProps, ref, className: classes() });
373
+ return h(Element, { ...elementProps, ref, className: classes() })
375
374
  })
376
375
 
377
376
  ${upperName}Component.displayName = \`${name}.\${Dynamic}\`
@@ -391,7 +390,7 @@ function generatePreactJsxFactory(ctx) {
391
390
  })
392
391
  }
393
392
 
394
- export const ${name} = createFactory();
393
+ export const ${name} = createFactory()
395
394
  `
396
395
  };
397
396
  }
@@ -481,20 +480,18 @@ function generate(name, pattern, jsxFactory) {
481
480
  `,
482
481
  dts: import_outdent8.outdent`
483
482
  import { ComponentProps, JSX, ComponentChildren } from 'preact';
484
- import { ${upperName}Options } from '../patterns/${(0, import_shared3.dashCase)(name)}'
483
+ import { ${upperName}Properties } from '../patterns/${(0, import_shared3.dashCase)(name)}'
485
484
  import { JSXStyleProperties, Assign } from '../types'
486
485
 
487
486
  type ElementType = keyof JSX.IntrinsicElements
488
-
489
- type PropsWithChildren<T> = T & { children?: ComponentChildren }
490
- type PropsOf<C extends ElementType> = ComponentProps<C>
491
-
492
- type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties &
493
- Assign<Omit<PropsOf<C>, 'color'>, P & { as?: C }>
487
+
488
+ type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties |
489
+ Assign<Omit<ComponentProps<C>, 'color'>, P & { as?: C }>
494
490
 
495
- type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Options>
491
+ type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
496
492
 
497
- export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
493
+ ${pattern.description ? `/** ${pattern.description} */` : ""}
494
+ export declare function ${jsxName}<V extends ElementType = 'div'>(props: ${jsxName}Props<V>): JSX.Element
498
495
  `
499
496
  };
500
497
  }
@@ -517,7 +514,7 @@ function generateReactJsxFactory(ctx) {
517
514
 
518
515
  type Element = keyof JSX.IntrinsicElements
519
516
 
520
- export type HTML${upperName}Props<T extends Element> = Omit<ComponentProps<T>, "color"> & JSXStyleProperties
517
+ export type HTML${upperName}Props<T extends Element> = Omit<ComponentProps<T>, 'color'> | JSXStyleProperties;
521
518
 
522
519
  type JSXFactory = {
523
520
  [K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
@@ -672,17 +669,17 @@ function generate2(name, pattern, jsxFactory) {
672
669
  `,
673
670
  dts: import_outdent11.outdent`
674
671
  import { ComponentProps, ElementType, PropsWithChildren } from 'react'
675
- import { ${upperName}Options } from '../patterns/${(0, import_shared5.dashCase)(name)}'
672
+ import { ${upperName}Properties } from '../patterns/${(0, import_shared5.dashCase)(name)}'
676
673
  import { JSXStyleProperties, Assign } from '../types'
677
674
 
678
- type PropsOf<C extends ElementType> = ComponentProps<C>
679
-
680
- type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties &
681
- Assign<Omit<PropsOf<C>, 'color'>, P & { as?: C }>
675
+ type Polymorphic<C extends ElementType = "div", P = {}> =
676
+ | JSXStyleProperties
677
+ | Assign<Omit<ComponentProps<C>, "color">, P & { as?: C }>
682
678
 
683
- export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Options>
679
+ export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
684
680
 
685
- export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
681
+ ${pattern.description ? `/** ${pattern.description} */` : ""}
682
+ export declare function ${jsxName}<V extends ElementType = 'div'>(props: ${jsxName}Props<V>): JSX.Element
686
683
  `
687
684
  };
688
685
  }
@@ -705,7 +702,7 @@ function generateSolidJsxFactory(ctx) {
705
702
 
706
703
  type Element = keyof JSX.IntrinsicElements
707
704
 
708
- export type HTML${upperName}Props<T extends Element> = Assign<JSX.IntrinsicElements[T], JSXStyleProperties>
705
+ export type HTML${upperName}Props<T extends Element> = Omit<JSX.IntrinsicElements[T], 'color'> | JSXStyleProperties
709
706
 
710
707
  type JSXFactory = {
711
708
  [K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
@@ -714,8 +711,8 @@ function generateSolidJsxFactory(ctx) {
714
711
  export declare const ${name}: JSXFactory
715
712
  `,
716
713
  js: import_outdent12.outdent`
717
- import { Dynamic } from 'solid-js/web';
718
- import { mergeProps, splitProps } from 'solid-js';
714
+ import { Dynamic } from 'solid-js/web'
715
+ import { mergeProps, splitProps } from 'solid-js'
719
716
  import { allCssProperties } from './is-valid-prop'
720
717
  import { css } from '../css'
721
718
 
@@ -744,19 +741,19 @@ function generateSolidJsxFactory(ctx) {
744
741
  }
745
742
 
746
743
  function createFactory() {
747
- const cache = new Map();
744
+ const cache = new Map()
748
745
 
749
746
  return new Proxy(Object.create(null), {
750
747
  get(_, el) {
751
748
  if (!cache.has(el)) {
752
- cache.set(el, styled(el));
749
+ cache.set(el, styled(el))
753
750
  }
754
- return cache.get(el);
751
+ return cache.get(el)
755
752
  },
756
753
  })
757
754
  }
758
755
 
759
- export const ${name} = createFactory();
756
+ export const ${name} = createFactory()
760
757
  `
761
758
  };
762
759
  }
@@ -844,18 +841,18 @@ function generate3(name, pattern, jsxFactory) {
844
841
  `,
845
842
  dts: import_outdent14.outdent`
846
843
  import { ComponentProps, JSX } from 'solid-js'
847
- import { ${upperName}Options } from '../patterns/${(0, import_shared7.dashCase)(name)}'
844
+ import { ${upperName}Properties } from '../patterns/${(0, import_shared7.dashCase)(name)}'
848
845
  import { Assign, JSXStyleProperties } from '../types'
849
846
 
850
847
  type ElementType = keyof JSX.IntrinsicElements
851
- type PropsOf<C extends ElementType> = ComponentProps<C>
852
848
 
853
- type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties &
854
- Assign<Omit<PropsOf<C>, 'color'>, P & { as?: C }>
849
+ type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties |
850
+ Assign<Omit<ComponentProps<C>, 'color'>, P & { as?: C }>
855
851
 
856
- export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Options>
852
+ export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
857
853
 
858
- export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
854
+ ${pattern.description ? `/** ${pattern.description} */` : ""}
855
+ export declare function ${jsxName}<V extends ElementType = 'div'>(props: ${jsxName}Props<V>): JSX.Element
859
856
  `
860
857
  };
861
858
  }
@@ -905,7 +902,7 @@ function generate4(name, pattern) {
905
902
  import { Properties } from "../types/csstype"
906
903
  import { Tokens } from "../types/token"
907
904
 
908
- export type ${(0, import_shared8.capitalize)(name)}Options = {
905
+ export type ${(0, import_shared8.capitalize)(name)}Properties = {
909
906
  ${Object.keys(properties ?? {}).map((key) => {
910
907
  const value = properties[key];
911
908
  return (0, import_ts_pattern4.match)(value).with({ type: "property" }, (value2) => {
@@ -923,10 +920,11 @@ function generate4(name, pattern) {
923
920
  }).join("\n ")}
924
921
  }
925
922
 
926
- ${strict ? import_outdent15.outdent`export declare function ${name}(options: ${(0, import_shared8.capitalize)(name)}Options): string` : import_outdent15.outdent`
923
+ ${strict ? import_outdent15.outdent`export declare function ${name}(options: ${(0, import_shared8.capitalize)(name)}Properties): string` : import_outdent15.outdent`
927
924
  type Merge<T> = Omit<SystemStyleObject, keyof T> & T
925
+
928
926
  ${description ? `/** ${description} */` : ""}
929
- export declare function ${name}(options: Merge<${(0, import_shared8.capitalize)(name)}Options>): string
927
+ export declare function ${name}(options: Merge<${(0, import_shared8.capitalize)(name)}Properties>): string
930
928
  `}
931
929
 
932
930
  `,
package/dist/index.mjs CHANGED
@@ -278,10 +278,9 @@ function generatePreactJsxFactory(ctx) {
278
278
  import type { JSXStyleProperties } from '../types'
279
279
 
280
280
  type Element = keyof JSX.IntrinsicElements
281
-
282
- type Merge<P, T> = Omit<P, 'color'> & T;
283
281
 
284
- export type HTML${upperName}Props<T extends Element> = Merge<ComponentProps<T>, JSXStyleProperties>
282
+ export type HTML${upperName}Props<T extends Element> = Omit<ComponentProps<T>, 'color'> | JSXStyleProperties
283
+
285
284
 
286
285
  type JSXFactory = {
287
286
  [K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
@@ -290,8 +289,8 @@ function generatePreactJsxFactory(ctx) {
290
289
  export declare const ${name}: JSXFactory
291
290
  `,
292
291
  js: outdent6`
293
- import { h } from 'preact';
294
- import { forwardRef } from 'preact/compat';
292
+ import { h } from 'preact'
293
+ import { forwardRef } from 'preact/compat'
295
294
  import { isCssProperty } from './is-valid-prop'
296
295
  import { css } from '../css'
297
296
 
@@ -326,7 +325,7 @@ function generatePreactJsxFactory(ctx) {
326
325
  return cx(atomicClass, elementProps.className)
327
326
  }
328
327
 
329
- return h(Element, { ...elementProps, ref, className: classes() });
328
+ return h(Element, { ...elementProps, ref, className: classes() })
330
329
  })
331
330
 
332
331
  ${upperName}Component.displayName = \`${name}.\${Dynamic}\`
@@ -346,7 +345,7 @@ function generatePreactJsxFactory(ctx) {
346
345
  })
347
346
  }
348
347
 
349
- export const ${name} = createFactory();
348
+ export const ${name} = createFactory()
350
349
  `
351
350
  };
352
351
  }
@@ -436,20 +435,18 @@ function generate(name, pattern, jsxFactory) {
436
435
  `,
437
436
  dts: outdent8`
438
437
  import { ComponentProps, JSX, ComponentChildren } from 'preact';
439
- import { ${upperName}Options } from '../patterns/${dashCase(name)}'
438
+ import { ${upperName}Properties } from '../patterns/${dashCase(name)}'
440
439
  import { JSXStyleProperties, Assign } from '../types'
441
440
 
442
441
  type ElementType = keyof JSX.IntrinsicElements
443
-
444
- type PropsWithChildren<T> = T & { children?: ComponentChildren }
445
- type PropsOf<C extends ElementType> = ComponentProps<C>
446
-
447
- type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties &
448
- Assign<Omit<PropsOf<C>, 'color'>, P & { as?: C }>
442
+
443
+ type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties |
444
+ Assign<Omit<ComponentProps<C>, 'color'>, P & { as?: C }>
449
445
 
450
- type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Options>
446
+ type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
451
447
 
452
- export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
448
+ ${pattern.description ? `/** ${pattern.description} */` : ""}
449
+ export declare function ${jsxName}<V extends ElementType = 'div'>(props: ${jsxName}Props<V>): JSX.Element
453
450
  `
454
451
  };
455
452
  }
@@ -472,7 +469,7 @@ function generateReactJsxFactory(ctx) {
472
469
 
473
470
  type Element = keyof JSX.IntrinsicElements
474
471
 
475
- export type HTML${upperName}Props<T extends Element> = Omit<ComponentProps<T>, "color"> & JSXStyleProperties
472
+ export type HTML${upperName}Props<T extends Element> = Omit<ComponentProps<T>, 'color'> | JSXStyleProperties;
476
473
 
477
474
  type JSXFactory = {
478
475
  [K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
@@ -627,17 +624,17 @@ function generate2(name, pattern, jsxFactory) {
627
624
  `,
628
625
  dts: outdent11`
629
626
  import { ComponentProps, ElementType, PropsWithChildren } from 'react'
630
- import { ${upperName}Options } from '../patterns/${dashCase2(name)}'
627
+ import { ${upperName}Properties } from '../patterns/${dashCase2(name)}'
631
628
  import { JSXStyleProperties, Assign } from '../types'
632
629
 
633
- type PropsOf<C extends ElementType> = ComponentProps<C>
634
-
635
- type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties &
636
- Assign<Omit<PropsOf<C>, 'color'>, P & { as?: C }>
630
+ type Polymorphic<C extends ElementType = "div", P = {}> =
631
+ | JSXStyleProperties
632
+ | Assign<Omit<ComponentProps<C>, "color">, P & { as?: C }>
637
633
 
638
- export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Options>
634
+ export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
639
635
 
640
- export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
636
+ ${pattern.description ? `/** ${pattern.description} */` : ""}
637
+ export declare function ${jsxName}<V extends ElementType = 'div'>(props: ${jsxName}Props<V>): JSX.Element
641
638
  `
642
639
  };
643
640
  }
@@ -660,7 +657,7 @@ function generateSolidJsxFactory(ctx) {
660
657
 
661
658
  type Element = keyof JSX.IntrinsicElements
662
659
 
663
- export type HTML${upperName}Props<T extends Element> = Assign<JSX.IntrinsicElements[T], JSXStyleProperties>
660
+ export type HTML${upperName}Props<T extends Element> = Omit<JSX.IntrinsicElements[T], 'color'> | JSXStyleProperties
664
661
 
665
662
  type JSXFactory = {
666
663
  [K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
@@ -669,8 +666,8 @@ function generateSolidJsxFactory(ctx) {
669
666
  export declare const ${name}: JSXFactory
670
667
  `,
671
668
  js: outdent12`
672
- import { Dynamic } from 'solid-js/web';
673
- import { mergeProps, splitProps } from 'solid-js';
669
+ import { Dynamic } from 'solid-js/web'
670
+ import { mergeProps, splitProps } from 'solid-js'
674
671
  import { allCssProperties } from './is-valid-prop'
675
672
  import { css } from '../css'
676
673
 
@@ -699,19 +696,19 @@ function generateSolidJsxFactory(ctx) {
699
696
  }
700
697
 
701
698
  function createFactory() {
702
- const cache = new Map();
699
+ const cache = new Map()
703
700
 
704
701
  return new Proxy(Object.create(null), {
705
702
  get(_, el) {
706
703
  if (!cache.has(el)) {
707
- cache.set(el, styled(el));
704
+ cache.set(el, styled(el))
708
705
  }
709
- return cache.get(el);
706
+ return cache.get(el)
710
707
  },
711
708
  })
712
709
  }
713
710
 
714
- export const ${name} = createFactory();
711
+ export const ${name} = createFactory()
715
712
  `
716
713
  };
717
714
  }
@@ -799,18 +796,18 @@ function generate3(name, pattern, jsxFactory) {
799
796
  `,
800
797
  dts: outdent14`
801
798
  import { ComponentProps, JSX } from 'solid-js'
802
- import { ${upperName}Options } from '../patterns/${dashCase3(name)}'
799
+ import { ${upperName}Properties } from '../patterns/${dashCase3(name)}'
803
800
  import { Assign, JSXStyleProperties } from '../types'
804
801
 
805
802
  type ElementType = keyof JSX.IntrinsicElements
806
- type PropsOf<C extends ElementType> = ComponentProps<C>
807
803
 
808
- type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties &
809
- Assign<Omit<PropsOf<C>, 'color'>, P & { as?: C }>
804
+ type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties |
805
+ Assign<Omit<ComponentProps<C>, 'color'>, P & { as?: C }>
810
806
 
811
- export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Options>
807
+ export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
812
808
 
813
- export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
809
+ ${pattern.description ? `/** ${pattern.description} */` : ""}
810
+ export declare function ${jsxName}<V extends ElementType = 'div'>(props: ${jsxName}Props<V>): JSX.Element
814
811
  `
815
812
  };
816
813
  }
@@ -860,7 +857,7 @@ function generate4(name, pattern) {
860
857
  import { Properties } from "../types/csstype"
861
858
  import { Tokens } from "../types/token"
862
859
 
863
- export type ${capitalize7(name)}Options = {
860
+ export type ${capitalize7(name)}Properties = {
864
861
  ${Object.keys(properties ?? {}).map((key) => {
865
862
  const value = properties[key];
866
863
  return match4(value).with({ type: "property" }, (value2) => {
@@ -878,10 +875,11 @@ function generate4(name, pattern) {
878
875
  }).join("\n ")}
879
876
  }
880
877
 
881
- ${strict ? outdent15`export declare function ${name}(options: ${capitalize7(name)}Options): string` : outdent15`
878
+ ${strict ? outdent15`export declare function ${name}(options: ${capitalize7(name)}Properties): string` : outdent15`
882
879
  type Merge<T> = Omit<SystemStyleObject, keyof T> & T
880
+
883
881
  ${description ? `/** ${description} */` : ""}
884
- export declare function ${name}(options: Merge<${capitalize7(name)}Options>): string
882
+ export declare function ${name}(options: Merge<${capitalize7(name)}Properties>): string
885
883
  `}
886
884
 
887
885
  `,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.0.0-dev-20221128063601",
3
+ "version": "0.0.0-dev-20221128100346",
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": "6.0.8",
31
31
  "ts-pattern": "4.0.6",
32
32
  "ts-morph": "17.0.1",
33
- "@pandacss/types": "0.0.0-dev-20221128063601",
34
- "@pandacss/is-valid-prop": "0.0.0-dev-20221128063601",
35
- "@pandacss/error": "0.0.0-dev-20221128063601",
36
- "@pandacss/parser": "0.0.0-dev-20221128063601",
37
- "@pandacss/shared": "0.0.0-dev-20221128063601",
38
- "@pandacss/token-dictionary": "0.0.0-dev-20221128063601",
39
- "@pandacss/logger": "0.0.0-dev-20221128063601",
40
- "@pandacss/core": "0.0.0-dev-20221128063601",
41
- "@pandacss/config": "0.0.0-dev-20221128063601"
33
+ "@pandacss/types": "0.0.0-dev-20221128100346",
34
+ "@pandacss/is-valid-prop": "0.0.0-dev-20221128100346",
35
+ "@pandacss/error": "0.0.0-dev-20221128100346",
36
+ "@pandacss/parser": "0.0.0-dev-20221128100346",
37
+ "@pandacss/shared": "0.0.0-dev-20221128100346",
38
+ "@pandacss/token-dictionary": "0.0.0-dev-20221128100346",
39
+ "@pandacss/logger": "0.0.0-dev-20221128100346",
40
+ "@pandacss/core": "0.0.0-dev-20221128100346",
41
+ "@pandacss/config": "0.0.0-dev-20221128100346"
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-20221128063601"
49
+ "@pandacss/fixture": "0.0.0-dev-20221128100346"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",