@pandacss/node 0.0.0-dev-20221128065048 → 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.
- package/dist/index.js +28 -31
- package/dist/index.mjs +28 -31
- 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> =
|
|
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
|
}
|
|
@@ -485,16 +484,14 @@ function generate(name, pattern, jsxFactory) {
|
|
|
485
484
|
import { JSXStyleProperties, Assign } from '../types'
|
|
486
485
|
|
|
487
486
|
type ElementType = keyof JSX.IntrinsicElements
|
|
488
|
-
|
|
489
|
-
type
|
|
490
|
-
|
|
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
491
|
type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
|
|
496
492
|
|
|
497
|
-
|
|
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>,
|
|
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
|
|
@@ -675,14 +672,14 @@ function generate2(name, pattern, jsxFactory) {
|
|
|
675
672
|
import { ${upperName}Properties } from '../patterns/${(0, import_shared5.dashCase)(name)}'
|
|
676
673
|
import { JSXStyleProperties, Assign } from '../types'
|
|
677
674
|
|
|
678
|
-
type
|
|
679
|
-
|
|
680
|
-
|
|
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
679
|
export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
|
|
684
680
|
|
|
685
|
-
|
|
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> =
|
|
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
|
}
|
|
@@ -848,14 +845,14 @@ function generate3(name, pattern, jsxFactory) {
|
|
|
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<
|
|
849
|
+
type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties |
|
|
850
|
+
Assign<Omit<ComponentProps<C>, 'color'>, P & { as?: C }>
|
|
855
851
|
|
|
856
852
|
export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
|
|
857
853
|
|
|
858
|
-
|
|
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
|
}
|
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> =
|
|
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
|
}
|
|
@@ -440,16 +439,14 @@ function generate(name, pattern, jsxFactory) {
|
|
|
440
439
|
import { JSXStyleProperties, Assign } from '../types'
|
|
441
440
|
|
|
442
441
|
type ElementType = keyof JSX.IntrinsicElements
|
|
443
|
-
|
|
444
|
-
type
|
|
445
|
-
|
|
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
446
|
type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
|
|
451
447
|
|
|
452
|
-
|
|
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>,
|
|
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
|
|
@@ -630,14 +627,14 @@ function generate2(name, pattern, jsxFactory) {
|
|
|
630
627
|
import { ${upperName}Properties } from '../patterns/${dashCase2(name)}'
|
|
631
628
|
import { JSXStyleProperties, Assign } from '../types'
|
|
632
629
|
|
|
633
|
-
type
|
|
634
|
-
|
|
635
|
-
|
|
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
634
|
export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
|
|
639
635
|
|
|
640
|
-
|
|
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> =
|
|
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
|
}
|
|
@@ -803,14 +800,14 @@ function generate3(name, pattern, jsxFactory) {
|
|
|
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<
|
|
804
|
+
type Polymorphic<C extends ElementType = 'div', P = {}> = JSXStyleProperties |
|
|
805
|
+
Assign<Omit<ComponentProps<C>, 'color'>, P & { as?: C }>
|
|
810
806
|
|
|
811
807
|
export type ${jsxName}Props<C extends ElementType = 'div'> = Polymorphic<C, ${upperName}Properties>
|
|
812
808
|
|
|
813
|
-
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
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-
|
|
34
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
35
|
-
"@pandacss/error": "0.0.0-dev-
|
|
36
|
-
"@pandacss/parser": "0.0.0-dev-
|
|
37
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
38
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
39
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
40
|
-
"@pandacss/core": "0.0.0-dev-
|
|
41
|
-
"@pandacss/config": "0.0.0-dev-
|
|
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-
|
|
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",
|