@pandacss/generator 0.0.0-dev-20230911132038 → 0.0.0-dev-20230911161250
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 +56 -283
- package/dist/index.mjs +56 -283
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -2477,158 +2477,40 @@ ${ctx.file.importType(upperName, "../types/jsx")}
|
|
|
2477
2477
|
export declare const ${factoryName}: ${upperName}
|
|
2478
2478
|
`,
|
|
2479
2479
|
jsxType: import_outdent37.outdent`
|
|
2480
|
-
import type { Component, FunctionalComponent } from 'vue'
|
|
2480
|
+
import type { Component, FunctionalComponent, NativeElements } from 'vue'
|
|
2481
2481
|
|
|
2482
2482
|
${ctx.file.importType("RecipeDefinition, RecipeSelection, RecipeVariantRecord", "./recipe")}
|
|
2483
2483
|
${ctx.file.importType("Assign, JsxStyleProps, JsxHTMLProps", "./system-types")}
|
|
2484
2484
|
|
|
2485
|
-
type IntrinsicElement =
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
| 'b'
|
|
2494
|
-
| 'base'
|
|
2495
|
-
| 'bdi'
|
|
2496
|
-
| 'bdo'
|
|
2497
|
-
| 'blockquote'
|
|
2498
|
-
| 'body'
|
|
2499
|
-
| 'br'
|
|
2500
|
-
| 'button'
|
|
2501
|
-
| 'canvas'
|
|
2502
|
-
| 'caption'
|
|
2503
|
-
| 'cite'
|
|
2504
|
-
| 'code'
|
|
2505
|
-
| 'col'
|
|
2506
|
-
| 'colgroup'
|
|
2507
|
-
| 'data'
|
|
2508
|
-
| 'datalist'
|
|
2509
|
-
| 'dd'
|
|
2510
|
-
| 'del'
|
|
2511
|
-
| 'details'
|
|
2512
|
-
| 'dfn'
|
|
2513
|
-
| 'dialog'
|
|
2514
|
-
| 'div'
|
|
2515
|
-
| 'dl'
|
|
2516
|
-
| 'dt'
|
|
2517
|
-
| 'em'
|
|
2518
|
-
| 'embed'
|
|
2519
|
-
| 'fieldset'
|
|
2520
|
-
| 'figcaption'
|
|
2521
|
-
| 'figure'
|
|
2522
|
-
| 'footer'
|
|
2523
|
-
| 'form'
|
|
2524
|
-
| 'h1'
|
|
2525
|
-
| 'h2'
|
|
2526
|
-
| 'h3'
|
|
2527
|
-
| 'h4'
|
|
2528
|
-
| 'h5'
|
|
2529
|
-
| 'h6'
|
|
2530
|
-
| 'head'
|
|
2531
|
-
| 'header'
|
|
2532
|
-
| 'hgroup'
|
|
2533
|
-
| 'hr'
|
|
2534
|
-
| 'html'
|
|
2535
|
-
| 'i'
|
|
2536
|
-
| 'iframe'
|
|
2537
|
-
| 'img'
|
|
2538
|
-
| 'input'
|
|
2539
|
-
| 'ins'
|
|
2540
|
-
| 'kbd'
|
|
2541
|
-
| 'label'
|
|
2542
|
-
| 'legend'
|
|
2543
|
-
| 'li'
|
|
2544
|
-
| 'link'
|
|
2545
|
-
| 'main'
|
|
2546
|
-
| 'map'
|
|
2547
|
-
| 'mark'
|
|
2548
|
-
| 'math'
|
|
2549
|
-
| 'menu'
|
|
2550
|
-
| 'menuitem'
|
|
2551
|
-
| 'meta'
|
|
2552
|
-
| 'meter'
|
|
2553
|
-
| 'nav'
|
|
2554
|
-
| 'noscript'
|
|
2555
|
-
| 'object'
|
|
2556
|
-
| 'ol'
|
|
2557
|
-
| 'optgroup'
|
|
2558
|
-
| 'option'
|
|
2559
|
-
| 'output'
|
|
2560
|
-
| 'p'
|
|
2561
|
-
| 'param'
|
|
2562
|
-
| 'picture'
|
|
2563
|
-
| 'pre'
|
|
2564
|
-
| 'progress'
|
|
2565
|
-
| 'q'
|
|
2566
|
-
| 'rb'
|
|
2567
|
-
| 'rp'
|
|
2568
|
-
| 'rt'
|
|
2569
|
-
| 'rtc'
|
|
2570
|
-
| 'ruby'
|
|
2571
|
-
| 's'
|
|
2572
|
-
| 'samp'
|
|
2573
|
-
| 'script'
|
|
2574
|
-
| 'section'
|
|
2575
|
-
| 'select'
|
|
2576
|
-
| 'slot'
|
|
2577
|
-
| 'small'
|
|
2578
|
-
| 'source'
|
|
2579
|
-
| 'span'
|
|
2580
|
-
| 'strong'
|
|
2581
|
-
| 'style'
|
|
2582
|
-
| 'sub'
|
|
2583
|
-
| 'summary'
|
|
2584
|
-
| 'sup'
|
|
2585
|
-
| 'svg'
|
|
2586
|
-
| 'table'
|
|
2587
|
-
| 'tbody'
|
|
2588
|
-
| 'td'
|
|
2589
|
-
| 'template'
|
|
2590
|
-
| 'textarea'
|
|
2591
|
-
| 'tfoot'
|
|
2592
|
-
| 'th'
|
|
2593
|
-
| 'thead'
|
|
2594
|
-
| 'time'
|
|
2595
|
-
| 'title'
|
|
2596
|
-
| 'tr'
|
|
2597
|
-
| 'track'
|
|
2598
|
-
| 'u'
|
|
2599
|
-
| 'ul'
|
|
2600
|
-
| 'var'
|
|
2601
|
-
| 'video'
|
|
2602
|
-
| 'wbr'
|
|
2603
|
-
|
|
2604
|
-
type ElementType = IntrinsicElement | Component
|
|
2605
|
-
|
|
2606
|
-
type ComponentProps<T extends ElementType> = T extends keyof JSX.IntrinsicElements
|
|
2607
|
-
? JSX.IntrinsicElements[T]
|
|
2608
|
-
: T extends Component<infer Props>
|
|
2609
|
-
? Props
|
|
2610
|
-
: never
|
|
2611
|
-
|
|
2612
|
-
type ${componentName}<T extends ElementType, P extends Dict = {}> = FunctionalComponent<
|
|
2613
|
-
JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
2614
|
-
>
|
|
2485
|
+
type IntrinsicElement = keyof NativeElements
|
|
2486
|
+
type ElementType = IntrinsicElement | Component
|
|
2487
|
+
|
|
2488
|
+
type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2489
|
+
? NativeElements[T]
|
|
2490
|
+
: T extends Component<infer Props>
|
|
2491
|
+
? Props
|
|
2492
|
+
: never
|
|
2615
2493
|
|
|
2616
|
-
|
|
2494
|
+
type ${componentName}<T extends ElementType, P extends Dict = {}> = FunctionalComponent<
|
|
2495
|
+
JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
2496
|
+
>
|
|
2617
2497
|
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
<
|
|
2625
|
-
|
|
2498
|
+
type RecipeFn = { __type: any }
|
|
2499
|
+
|
|
2500
|
+
interface JsxFactory {
|
|
2501
|
+
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
2502
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>): ${componentName}<
|
|
2503
|
+
T,
|
|
2504
|
+
RecipeSelection<P>
|
|
2505
|
+
>
|
|
2506
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P): ${componentName}<T, P['__type']>
|
|
2507
|
+
}
|
|
2626
2508
|
|
|
2627
|
-
|
|
2509
|
+
type JsxElements = { [K in IntrinsicElement]: ${componentName}<K, {}> }
|
|
2628
2510
|
|
|
2629
|
-
|
|
2511
|
+
export type ${upperName} = JsxFactory ${styleProps === "none" ? "" : "& JsxElements"}
|
|
2630
2512
|
|
|
2631
|
-
|
|
2513
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
2632
2514
|
`
|
|
2633
2515
|
};
|
|
2634
2516
|
}
|
|
@@ -2644,147 +2526,29 @@ ${ctx.file.importType(upperName, "../types/jsx")}
|
|
|
2644
2526
|
export declare const ${factoryName}: ${upperName}
|
|
2645
2527
|
`,
|
|
2646
2528
|
jsxType: import_outdent38.outdent`
|
|
2647
|
-
import type { Component, FunctionalComponent } from 'vue'
|
|
2648
|
-
|
|
2649
|
-
type IntrinsicElement =
|
|
2650
|
-
| 'a'
|
|
2651
|
-
| 'abbr'
|
|
2652
|
-
| 'address'
|
|
2653
|
-
| 'area'
|
|
2654
|
-
| 'article'
|
|
2655
|
-
| 'aside'
|
|
2656
|
-
| 'audio'
|
|
2657
|
-
| 'b'
|
|
2658
|
-
| 'base'
|
|
2659
|
-
| 'bdi'
|
|
2660
|
-
| 'bdo'
|
|
2661
|
-
| 'blockquote'
|
|
2662
|
-
| 'body'
|
|
2663
|
-
| 'br'
|
|
2664
|
-
| 'button'
|
|
2665
|
-
| 'canvas'
|
|
2666
|
-
| 'caption'
|
|
2667
|
-
| 'cite'
|
|
2668
|
-
| 'code'
|
|
2669
|
-
| 'col'
|
|
2670
|
-
| 'colgroup'
|
|
2671
|
-
| 'data'
|
|
2672
|
-
| 'datalist'
|
|
2673
|
-
| 'dd'
|
|
2674
|
-
| 'del'
|
|
2675
|
-
| 'details'
|
|
2676
|
-
| 'dfn'
|
|
2677
|
-
| 'dialog'
|
|
2678
|
-
| 'div'
|
|
2679
|
-
| 'dl'
|
|
2680
|
-
| 'dt'
|
|
2681
|
-
| 'em'
|
|
2682
|
-
| 'embed'
|
|
2683
|
-
| 'fieldset'
|
|
2684
|
-
| 'figcaption'
|
|
2685
|
-
| 'figure'
|
|
2686
|
-
| 'footer'
|
|
2687
|
-
| 'form'
|
|
2688
|
-
| 'h1'
|
|
2689
|
-
| 'h2'
|
|
2690
|
-
| 'h3'
|
|
2691
|
-
| 'h4'
|
|
2692
|
-
| 'h5'
|
|
2693
|
-
| 'h6'
|
|
2694
|
-
| 'head'
|
|
2695
|
-
| 'header'
|
|
2696
|
-
| 'hgroup'
|
|
2697
|
-
| 'hr'
|
|
2698
|
-
| 'html'
|
|
2699
|
-
| 'i'
|
|
2700
|
-
| 'iframe'
|
|
2701
|
-
| 'img'
|
|
2702
|
-
| 'input'
|
|
2703
|
-
| 'ins'
|
|
2704
|
-
| 'kbd'
|
|
2705
|
-
| 'label'
|
|
2706
|
-
| 'legend'
|
|
2707
|
-
| 'li'
|
|
2708
|
-
| 'link'
|
|
2709
|
-
| 'main'
|
|
2710
|
-
| 'map'
|
|
2711
|
-
| 'mark'
|
|
2712
|
-
| 'math'
|
|
2713
|
-
| 'menu'
|
|
2714
|
-
| 'menuitem'
|
|
2715
|
-
| 'meta'
|
|
2716
|
-
| 'meter'
|
|
2717
|
-
| 'nav'
|
|
2718
|
-
| 'noscript'
|
|
2719
|
-
| 'object'
|
|
2720
|
-
| 'ol'
|
|
2721
|
-
| 'optgroup'
|
|
2722
|
-
| 'option'
|
|
2723
|
-
| 'output'
|
|
2724
|
-
| 'p'
|
|
2725
|
-
| 'param'
|
|
2726
|
-
| 'picture'
|
|
2727
|
-
| 'pre'
|
|
2728
|
-
| 'progress'
|
|
2729
|
-
| 'q'
|
|
2730
|
-
| 'rb'
|
|
2731
|
-
| 'rp'
|
|
2732
|
-
| 'rt'
|
|
2733
|
-
| 'rtc'
|
|
2734
|
-
| 'ruby'
|
|
2735
|
-
| 's'
|
|
2736
|
-
| 'samp'
|
|
2737
|
-
| 'script'
|
|
2738
|
-
| 'section'
|
|
2739
|
-
| 'select'
|
|
2740
|
-
| 'slot'
|
|
2741
|
-
| 'small'
|
|
2742
|
-
| 'source'
|
|
2743
|
-
| 'span'
|
|
2744
|
-
| 'strong'
|
|
2745
|
-
| 'style'
|
|
2746
|
-
| 'sub'
|
|
2747
|
-
| 'summary'
|
|
2748
|
-
| 'sup'
|
|
2749
|
-
| 'svg'
|
|
2750
|
-
| 'table'
|
|
2751
|
-
| 'tbody'
|
|
2752
|
-
| 'td'
|
|
2753
|
-
| 'template'
|
|
2754
|
-
| 'textarea'
|
|
2755
|
-
| 'tfoot'
|
|
2756
|
-
| 'th'
|
|
2757
|
-
| 'thead'
|
|
2758
|
-
| 'time'
|
|
2759
|
-
| 'title'
|
|
2760
|
-
| 'tr'
|
|
2761
|
-
| 'track'
|
|
2762
|
-
| 'u'
|
|
2763
|
-
| 'ul'
|
|
2764
|
-
| 'var'
|
|
2765
|
-
| 'video'
|
|
2766
|
-
| 'wbr'
|
|
2767
|
-
|
|
2768
|
-
type ElementType = IntrinsicElement | Component
|
|
2769
|
-
|
|
2770
|
-
type ComponentProps<T extends ElementType> = T extends keyof JSX.IntrinsicElements
|
|
2771
|
-
? JSX.IntrinsicElements[T]
|
|
2772
|
-
: T extends Component<infer Props>
|
|
2773
|
-
? Props
|
|
2774
|
-
: never
|
|
2775
|
-
|
|
2776
|
-
type ${componentName}<T extends ElementType> = FunctionalComponent<ComponentProps<T>>
|
|
2777
|
-
>
|
|
2529
|
+
import type { Component, FunctionalComponent, NativeElements } from 'vue'
|
|
2778
2530
|
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2531
|
+
type IntrinsicElement = keyof NativeElements
|
|
2532
|
+
type ElementType = IntrinsicElement | Component
|
|
2533
|
+
|
|
2534
|
+
type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2535
|
+
? NativeElements[T]
|
|
2536
|
+
: T extends Component<infer Props>
|
|
2537
|
+
? Props
|
|
2538
|
+
: never
|
|
2782
2539
|
|
|
2783
|
-
|
|
2540
|
+
type ${componentName}<T extends ElementType> = FunctionalComponent<ComponentProps<T>>
|
|
2541
|
+
>
|
|
2784
2542
|
|
|
2785
|
-
|
|
2543
|
+
interface JsxFactory {
|
|
2544
|
+
<T extends ElementType>(component: T): ${componentName}<T>
|
|
2545
|
+
}
|
|
2786
2546
|
|
|
2787
|
-
|
|
2547
|
+
type JsxElements = { [K in IntrinsicElement]: ${componentName}<K> }
|
|
2548
|
+
|
|
2549
|
+
export type ${upperName} = JsxFactory ${styleProps === "none" ? "" : "& JsxElements"}
|
|
2550
|
+
|
|
2551
|
+
export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
2788
2552
|
`
|
|
2789
2553
|
};
|
|
2790
2554
|
}
|
|
@@ -3405,7 +3169,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3405
3169
|
});
|
|
3406
3170
|
result2.jsx.forEach((jsx) => {
|
|
3407
3171
|
jsx.data.forEach((data) => {
|
|
3408
|
-
sheet.processStyleProps(data);
|
|
3172
|
+
sheet.processStyleProps(filterProps(ctx, data));
|
|
3409
3173
|
});
|
|
3410
3174
|
});
|
|
3411
3175
|
result2.recipe.forEach((recipeSet, recipeName) => {
|
|
@@ -3417,7 +3181,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3417
3181
|
(0, import_ts_pattern10.match)(recipe).with({ type: "jsx-recipe" }, () => {
|
|
3418
3182
|
recipe.data.forEach((data) => {
|
|
3419
3183
|
const [recipeProps, styleProps] = recipes.splitProps(recipeName, data);
|
|
3420
|
-
sheet.processStyleProps(styleProps);
|
|
3184
|
+
sheet.processStyleProps(filterProps(ctx, styleProps));
|
|
3421
3185
|
sheet.processRecipe(recipeName, recipeConfig, recipeProps);
|
|
3422
3186
|
});
|
|
3423
3187
|
}).otherwise(() => {
|
|
@@ -3437,7 +3201,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3437
3201
|
pattern.data.forEach((data) => {
|
|
3438
3202
|
const fnName = patterns.find(jsxName);
|
|
3439
3203
|
const styleProps = patterns.transform(fnName, data);
|
|
3440
|
-
sheet.processStyleProps(styleProps);
|
|
3204
|
+
sheet.processStyleProps(filterProps(ctx, styleProps));
|
|
3441
3205
|
});
|
|
3442
3206
|
}).otherwise(() => {
|
|
3443
3207
|
pattern.data.forEach((data) => {
|
|
@@ -3462,6 +3226,15 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3462
3226
|
}
|
|
3463
3227
|
)
|
|
3464
3228
|
);
|
|
3229
|
+
var filterProps = (ctx, props) => {
|
|
3230
|
+
const clone = {};
|
|
3231
|
+
for (const [key, value] of Object.entries(props)) {
|
|
3232
|
+
if (ctx.isValidProperty(key)) {
|
|
3233
|
+
clone[key] = value;
|
|
3234
|
+
}
|
|
3235
|
+
}
|
|
3236
|
+
return clone;
|
|
3237
|
+
};
|
|
3465
3238
|
|
|
3466
3239
|
// src/engines/base.ts
|
|
3467
3240
|
var import_core5 = require("@pandacss/core");
|
package/dist/index.mjs
CHANGED
|
@@ -2446,158 +2446,40 @@ ${ctx.file.importType(upperName, "../types/jsx")}
|
|
|
2446
2446
|
export declare const ${factoryName}: ${upperName}
|
|
2447
2447
|
`,
|
|
2448
2448
|
jsxType: outdent37`
|
|
2449
|
-
import type { Component, FunctionalComponent } from 'vue'
|
|
2449
|
+
import type { Component, FunctionalComponent, NativeElements } from 'vue'
|
|
2450
2450
|
|
|
2451
2451
|
${ctx.file.importType("RecipeDefinition, RecipeSelection, RecipeVariantRecord", "./recipe")}
|
|
2452
2452
|
${ctx.file.importType("Assign, JsxStyleProps, JsxHTMLProps", "./system-types")}
|
|
2453
2453
|
|
|
2454
|
-
type IntrinsicElement =
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
| 'b'
|
|
2463
|
-
| 'base'
|
|
2464
|
-
| 'bdi'
|
|
2465
|
-
| 'bdo'
|
|
2466
|
-
| 'blockquote'
|
|
2467
|
-
| 'body'
|
|
2468
|
-
| 'br'
|
|
2469
|
-
| 'button'
|
|
2470
|
-
| 'canvas'
|
|
2471
|
-
| 'caption'
|
|
2472
|
-
| 'cite'
|
|
2473
|
-
| 'code'
|
|
2474
|
-
| 'col'
|
|
2475
|
-
| 'colgroup'
|
|
2476
|
-
| 'data'
|
|
2477
|
-
| 'datalist'
|
|
2478
|
-
| 'dd'
|
|
2479
|
-
| 'del'
|
|
2480
|
-
| 'details'
|
|
2481
|
-
| 'dfn'
|
|
2482
|
-
| 'dialog'
|
|
2483
|
-
| 'div'
|
|
2484
|
-
| 'dl'
|
|
2485
|
-
| 'dt'
|
|
2486
|
-
| 'em'
|
|
2487
|
-
| 'embed'
|
|
2488
|
-
| 'fieldset'
|
|
2489
|
-
| 'figcaption'
|
|
2490
|
-
| 'figure'
|
|
2491
|
-
| 'footer'
|
|
2492
|
-
| 'form'
|
|
2493
|
-
| 'h1'
|
|
2494
|
-
| 'h2'
|
|
2495
|
-
| 'h3'
|
|
2496
|
-
| 'h4'
|
|
2497
|
-
| 'h5'
|
|
2498
|
-
| 'h6'
|
|
2499
|
-
| 'head'
|
|
2500
|
-
| 'header'
|
|
2501
|
-
| 'hgroup'
|
|
2502
|
-
| 'hr'
|
|
2503
|
-
| 'html'
|
|
2504
|
-
| 'i'
|
|
2505
|
-
| 'iframe'
|
|
2506
|
-
| 'img'
|
|
2507
|
-
| 'input'
|
|
2508
|
-
| 'ins'
|
|
2509
|
-
| 'kbd'
|
|
2510
|
-
| 'label'
|
|
2511
|
-
| 'legend'
|
|
2512
|
-
| 'li'
|
|
2513
|
-
| 'link'
|
|
2514
|
-
| 'main'
|
|
2515
|
-
| 'map'
|
|
2516
|
-
| 'mark'
|
|
2517
|
-
| 'math'
|
|
2518
|
-
| 'menu'
|
|
2519
|
-
| 'menuitem'
|
|
2520
|
-
| 'meta'
|
|
2521
|
-
| 'meter'
|
|
2522
|
-
| 'nav'
|
|
2523
|
-
| 'noscript'
|
|
2524
|
-
| 'object'
|
|
2525
|
-
| 'ol'
|
|
2526
|
-
| 'optgroup'
|
|
2527
|
-
| 'option'
|
|
2528
|
-
| 'output'
|
|
2529
|
-
| 'p'
|
|
2530
|
-
| 'param'
|
|
2531
|
-
| 'picture'
|
|
2532
|
-
| 'pre'
|
|
2533
|
-
| 'progress'
|
|
2534
|
-
| 'q'
|
|
2535
|
-
| 'rb'
|
|
2536
|
-
| 'rp'
|
|
2537
|
-
| 'rt'
|
|
2538
|
-
| 'rtc'
|
|
2539
|
-
| 'ruby'
|
|
2540
|
-
| 's'
|
|
2541
|
-
| 'samp'
|
|
2542
|
-
| 'script'
|
|
2543
|
-
| 'section'
|
|
2544
|
-
| 'select'
|
|
2545
|
-
| 'slot'
|
|
2546
|
-
| 'small'
|
|
2547
|
-
| 'source'
|
|
2548
|
-
| 'span'
|
|
2549
|
-
| 'strong'
|
|
2550
|
-
| 'style'
|
|
2551
|
-
| 'sub'
|
|
2552
|
-
| 'summary'
|
|
2553
|
-
| 'sup'
|
|
2554
|
-
| 'svg'
|
|
2555
|
-
| 'table'
|
|
2556
|
-
| 'tbody'
|
|
2557
|
-
| 'td'
|
|
2558
|
-
| 'template'
|
|
2559
|
-
| 'textarea'
|
|
2560
|
-
| 'tfoot'
|
|
2561
|
-
| 'th'
|
|
2562
|
-
| 'thead'
|
|
2563
|
-
| 'time'
|
|
2564
|
-
| 'title'
|
|
2565
|
-
| 'tr'
|
|
2566
|
-
| 'track'
|
|
2567
|
-
| 'u'
|
|
2568
|
-
| 'ul'
|
|
2569
|
-
| 'var'
|
|
2570
|
-
| 'video'
|
|
2571
|
-
| 'wbr'
|
|
2572
|
-
|
|
2573
|
-
type ElementType = IntrinsicElement | Component
|
|
2574
|
-
|
|
2575
|
-
type ComponentProps<T extends ElementType> = T extends keyof JSX.IntrinsicElements
|
|
2576
|
-
? JSX.IntrinsicElements[T]
|
|
2577
|
-
: T extends Component<infer Props>
|
|
2578
|
-
? Props
|
|
2579
|
-
: never
|
|
2580
|
-
|
|
2581
|
-
type ${componentName}<T extends ElementType, P extends Dict = {}> = FunctionalComponent<
|
|
2582
|
-
JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
2583
|
-
>
|
|
2454
|
+
type IntrinsicElement = keyof NativeElements
|
|
2455
|
+
type ElementType = IntrinsicElement | Component
|
|
2456
|
+
|
|
2457
|
+
type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2458
|
+
? NativeElements[T]
|
|
2459
|
+
: T extends Component<infer Props>
|
|
2460
|
+
? Props
|
|
2461
|
+
: never
|
|
2584
2462
|
|
|
2585
|
-
|
|
2463
|
+
type ${componentName}<T extends ElementType, P extends Dict = {}> = FunctionalComponent<
|
|
2464
|
+
JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
2465
|
+
>
|
|
2586
2466
|
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
<
|
|
2594
|
-
|
|
2467
|
+
type RecipeFn = { __type: any }
|
|
2468
|
+
|
|
2469
|
+
interface JsxFactory {
|
|
2470
|
+
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
2471
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>): ${componentName}<
|
|
2472
|
+
T,
|
|
2473
|
+
RecipeSelection<P>
|
|
2474
|
+
>
|
|
2475
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P): ${componentName}<T, P['__type']>
|
|
2476
|
+
}
|
|
2595
2477
|
|
|
2596
|
-
|
|
2478
|
+
type JsxElements = { [K in IntrinsicElement]: ${componentName}<K, {}> }
|
|
2597
2479
|
|
|
2598
|
-
|
|
2480
|
+
export type ${upperName} = JsxFactory ${styleProps === "none" ? "" : "& JsxElements"}
|
|
2599
2481
|
|
|
2600
|
-
|
|
2482
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
2601
2483
|
`
|
|
2602
2484
|
};
|
|
2603
2485
|
}
|
|
@@ -2613,147 +2495,29 @@ ${ctx.file.importType(upperName, "../types/jsx")}
|
|
|
2613
2495
|
export declare const ${factoryName}: ${upperName}
|
|
2614
2496
|
`,
|
|
2615
2497
|
jsxType: outdent38`
|
|
2616
|
-
import type { Component, FunctionalComponent } from 'vue'
|
|
2617
|
-
|
|
2618
|
-
type IntrinsicElement =
|
|
2619
|
-
| 'a'
|
|
2620
|
-
| 'abbr'
|
|
2621
|
-
| 'address'
|
|
2622
|
-
| 'area'
|
|
2623
|
-
| 'article'
|
|
2624
|
-
| 'aside'
|
|
2625
|
-
| 'audio'
|
|
2626
|
-
| 'b'
|
|
2627
|
-
| 'base'
|
|
2628
|
-
| 'bdi'
|
|
2629
|
-
| 'bdo'
|
|
2630
|
-
| 'blockquote'
|
|
2631
|
-
| 'body'
|
|
2632
|
-
| 'br'
|
|
2633
|
-
| 'button'
|
|
2634
|
-
| 'canvas'
|
|
2635
|
-
| 'caption'
|
|
2636
|
-
| 'cite'
|
|
2637
|
-
| 'code'
|
|
2638
|
-
| 'col'
|
|
2639
|
-
| 'colgroup'
|
|
2640
|
-
| 'data'
|
|
2641
|
-
| 'datalist'
|
|
2642
|
-
| 'dd'
|
|
2643
|
-
| 'del'
|
|
2644
|
-
| 'details'
|
|
2645
|
-
| 'dfn'
|
|
2646
|
-
| 'dialog'
|
|
2647
|
-
| 'div'
|
|
2648
|
-
| 'dl'
|
|
2649
|
-
| 'dt'
|
|
2650
|
-
| 'em'
|
|
2651
|
-
| 'embed'
|
|
2652
|
-
| 'fieldset'
|
|
2653
|
-
| 'figcaption'
|
|
2654
|
-
| 'figure'
|
|
2655
|
-
| 'footer'
|
|
2656
|
-
| 'form'
|
|
2657
|
-
| 'h1'
|
|
2658
|
-
| 'h2'
|
|
2659
|
-
| 'h3'
|
|
2660
|
-
| 'h4'
|
|
2661
|
-
| 'h5'
|
|
2662
|
-
| 'h6'
|
|
2663
|
-
| 'head'
|
|
2664
|
-
| 'header'
|
|
2665
|
-
| 'hgroup'
|
|
2666
|
-
| 'hr'
|
|
2667
|
-
| 'html'
|
|
2668
|
-
| 'i'
|
|
2669
|
-
| 'iframe'
|
|
2670
|
-
| 'img'
|
|
2671
|
-
| 'input'
|
|
2672
|
-
| 'ins'
|
|
2673
|
-
| 'kbd'
|
|
2674
|
-
| 'label'
|
|
2675
|
-
| 'legend'
|
|
2676
|
-
| 'li'
|
|
2677
|
-
| 'link'
|
|
2678
|
-
| 'main'
|
|
2679
|
-
| 'map'
|
|
2680
|
-
| 'mark'
|
|
2681
|
-
| 'math'
|
|
2682
|
-
| 'menu'
|
|
2683
|
-
| 'menuitem'
|
|
2684
|
-
| 'meta'
|
|
2685
|
-
| 'meter'
|
|
2686
|
-
| 'nav'
|
|
2687
|
-
| 'noscript'
|
|
2688
|
-
| 'object'
|
|
2689
|
-
| 'ol'
|
|
2690
|
-
| 'optgroup'
|
|
2691
|
-
| 'option'
|
|
2692
|
-
| 'output'
|
|
2693
|
-
| 'p'
|
|
2694
|
-
| 'param'
|
|
2695
|
-
| 'picture'
|
|
2696
|
-
| 'pre'
|
|
2697
|
-
| 'progress'
|
|
2698
|
-
| 'q'
|
|
2699
|
-
| 'rb'
|
|
2700
|
-
| 'rp'
|
|
2701
|
-
| 'rt'
|
|
2702
|
-
| 'rtc'
|
|
2703
|
-
| 'ruby'
|
|
2704
|
-
| 's'
|
|
2705
|
-
| 'samp'
|
|
2706
|
-
| 'script'
|
|
2707
|
-
| 'section'
|
|
2708
|
-
| 'select'
|
|
2709
|
-
| 'slot'
|
|
2710
|
-
| 'small'
|
|
2711
|
-
| 'source'
|
|
2712
|
-
| 'span'
|
|
2713
|
-
| 'strong'
|
|
2714
|
-
| 'style'
|
|
2715
|
-
| 'sub'
|
|
2716
|
-
| 'summary'
|
|
2717
|
-
| 'sup'
|
|
2718
|
-
| 'svg'
|
|
2719
|
-
| 'table'
|
|
2720
|
-
| 'tbody'
|
|
2721
|
-
| 'td'
|
|
2722
|
-
| 'template'
|
|
2723
|
-
| 'textarea'
|
|
2724
|
-
| 'tfoot'
|
|
2725
|
-
| 'th'
|
|
2726
|
-
| 'thead'
|
|
2727
|
-
| 'time'
|
|
2728
|
-
| 'title'
|
|
2729
|
-
| 'tr'
|
|
2730
|
-
| 'track'
|
|
2731
|
-
| 'u'
|
|
2732
|
-
| 'ul'
|
|
2733
|
-
| 'var'
|
|
2734
|
-
| 'video'
|
|
2735
|
-
| 'wbr'
|
|
2736
|
-
|
|
2737
|
-
type ElementType = IntrinsicElement | Component
|
|
2738
|
-
|
|
2739
|
-
type ComponentProps<T extends ElementType> = T extends keyof JSX.IntrinsicElements
|
|
2740
|
-
? JSX.IntrinsicElements[T]
|
|
2741
|
-
: T extends Component<infer Props>
|
|
2742
|
-
? Props
|
|
2743
|
-
: never
|
|
2744
|
-
|
|
2745
|
-
type ${componentName}<T extends ElementType> = FunctionalComponent<ComponentProps<T>>
|
|
2746
|
-
>
|
|
2498
|
+
import type { Component, FunctionalComponent, NativeElements } from 'vue'
|
|
2747
2499
|
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2500
|
+
type IntrinsicElement = keyof NativeElements
|
|
2501
|
+
type ElementType = IntrinsicElement | Component
|
|
2502
|
+
|
|
2503
|
+
type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2504
|
+
? NativeElements[T]
|
|
2505
|
+
: T extends Component<infer Props>
|
|
2506
|
+
? Props
|
|
2507
|
+
: never
|
|
2751
2508
|
|
|
2752
|
-
|
|
2509
|
+
type ${componentName}<T extends ElementType> = FunctionalComponent<ComponentProps<T>>
|
|
2510
|
+
>
|
|
2753
2511
|
|
|
2754
|
-
|
|
2512
|
+
interface JsxFactory {
|
|
2513
|
+
<T extends ElementType>(component: T): ${componentName}<T>
|
|
2514
|
+
}
|
|
2755
2515
|
|
|
2756
|
-
|
|
2516
|
+
type JsxElements = { [K in IntrinsicElement]: ${componentName}<K> }
|
|
2517
|
+
|
|
2518
|
+
export type ${upperName} = JsxFactory ${styleProps === "none" ? "" : "& JsxElements"}
|
|
2519
|
+
|
|
2520
|
+
export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
2757
2521
|
`
|
|
2758
2522
|
};
|
|
2759
2523
|
}
|
|
@@ -3374,7 +3138,7 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
3374
3138
|
});
|
|
3375
3139
|
result2.jsx.forEach((jsx) => {
|
|
3376
3140
|
jsx.data.forEach((data) => {
|
|
3377
|
-
sheet.processStyleProps(data);
|
|
3141
|
+
sheet.processStyleProps(filterProps(ctx, data));
|
|
3378
3142
|
});
|
|
3379
3143
|
});
|
|
3380
3144
|
result2.recipe.forEach((recipeSet, recipeName) => {
|
|
@@ -3386,7 +3150,7 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
3386
3150
|
match10(recipe).with({ type: "jsx-recipe" }, () => {
|
|
3387
3151
|
recipe.data.forEach((data) => {
|
|
3388
3152
|
const [recipeProps, styleProps] = recipes.splitProps(recipeName, data);
|
|
3389
|
-
sheet.processStyleProps(styleProps);
|
|
3153
|
+
sheet.processStyleProps(filterProps(ctx, styleProps));
|
|
3390
3154
|
sheet.processRecipe(recipeName, recipeConfig, recipeProps);
|
|
3391
3155
|
});
|
|
3392
3156
|
}).otherwise(() => {
|
|
@@ -3406,7 +3170,7 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
3406
3170
|
pattern.data.forEach((data) => {
|
|
3407
3171
|
const fnName = patterns.find(jsxName);
|
|
3408
3172
|
const styleProps = patterns.transform(fnName, data);
|
|
3409
|
-
sheet.processStyleProps(styleProps);
|
|
3173
|
+
sheet.processStyleProps(filterProps(ctx, styleProps));
|
|
3410
3174
|
});
|
|
3411
3175
|
}).otherwise(() => {
|
|
3412
3176
|
pattern.data.forEach((data) => {
|
|
@@ -3431,6 +3195,15 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
3431
3195
|
}
|
|
3432
3196
|
)
|
|
3433
3197
|
);
|
|
3198
|
+
var filterProps = (ctx, props) => {
|
|
3199
|
+
const clone = {};
|
|
3200
|
+
for (const [key, value] of Object.entries(props)) {
|
|
3201
|
+
if (ctx.isValidProperty(key)) {
|
|
3202
|
+
clone[key] = value;
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
3205
|
+
return clone;
|
|
3206
|
+
};
|
|
3434
3207
|
|
|
3435
3208
|
// src/engines/base.ts
|
|
3436
3209
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230911161250",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "8.4.27",
|
|
22
22
|
"ts-pattern": "5.0.4",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
25
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
28
|
-
"@pandacss/types": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20230911161250",
|
|
24
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230911161250",
|
|
25
|
+
"@pandacss/logger": "0.0.0-dev-20230911161250",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20230911161250",
|
|
27
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230911161250",
|
|
28
|
+
"@pandacss/types": "0.0.0-dev-20230911161250"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.30",
|
|
32
32
|
"hookable": "5.5.3",
|
|
33
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
33
|
+
"@pandacss/fixture": "0.0.0-dev-20230911161250"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "tsx scripts/prebuild.ts",
|