Skip to content

Commit 7eaeb3c

Browse files
authored
docs: migrate to velite (#3355)
* feat: expose as prop * refactor: migrate to velite * refactor: docs and semantic tokens * chore: fix sidebar * refactor: docs layout * refactor: tokens * refactor: toc and layout * fix: focus ring * chore: initial setup of llm txt * chore: update * fix: color mode * chore: start search * chore: update * chore: rm search input * refactor: ui and docs * docs: update * chore: update docs * chore: rm patch * docs: update * fix: studio * docs: fix routes * refactor: mobile nav * fix: build issues * fix: script warning * docs: update uo * chore: rm exact optional * fix: pagination * fix: hidden toc * chore: update * chore: rework ui * refactor: og image * chore: update * docs: llm txt docs * docs: reword * docs: fix dark mode * fix: breadcrumb
1 parent fd9ed92 commit 7eaeb3c

File tree

301 files changed

+8370
-10281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+8370
-10281
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@pandacss/generator': patch
3+
---
4+
5+
Added `as` prop to JSX types for polymorphic component support to enable basic polymorphic components.
6+
7+
**Note:** The `as` prop does not infer types of the target element.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"git add --all packages/studio/"
7272
]
7373
},
74-
"packageManager": "pnpm@10.14.0",
74+
"packageManager": "pnpm@10.15.1",
7575
"pnpm": {
7676
"overrides": {
7777
"@swc/helpers@~0.4": "0.4.36"

packages/generator/src/artifacts/preact-jsx/types.string-literal.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ interface Dict {
1818
[k: string]: unknown
1919
}
2020
21+
export interface AsProps {
22+
/**
23+
* The element to render as
24+
*/
25+
as?: ElementType | undefined
26+
}
27+
2128
export type ${componentName}<T extends ElementType> = {
22-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
23-
displayName?: string
29+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
30+
displayName?: string | undefined
2431
}
2532
2633
export interface JsxFactory {

packages/generator/src/artifacts/preact-jsx/types.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,16 @@ export interface UnstyledProps {
3030
unstyled?: boolean | undefined
3131
}
3232
33+
export interface AsProps {
34+
/**
35+
* The element to render as
36+
*/
37+
as?: ElementType | undefined
38+
}
39+
3340
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
34-
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps, Assign<JsxStyleProps, P>>): JSX.Element
35-
displayName?: string
41+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
42+
displayName?: string | undefined
3643
}
3744
3845
interface RecipeFn {
@@ -46,7 +53,7 @@ export interface JsxFactoryOptions<TProps extends Dict> {
4653
forwardProps?: string[]
4754
}
4855
49-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps, P>
56+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>
5057
5158
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
5259
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
@@ -67,7 +74,7 @@ export type JsxElements = {
6774
6875
export type ${upperName} = JsxFactory & JsxElements
6976
70-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps, JsxStyleProps>
77+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
7178
7279
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
7380
`,

packages/generator/src/artifacts/qwik-jsx/types.string-literal.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ interface Dict {
2424
[k: string]: unknown
2525
}
2626
27+
export interface AsProps {
28+
/**
29+
* The element to render as
30+
*/
31+
as?: ElementType | undefined
32+
}
33+
2734
export type ${componentName}<T extends ElementType> = {
28-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
35+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
2936
}
3037
3138
export interface JsxFactory {

packages/generator/src/artifacts/qwik-jsx/types.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ export interface UnstyledProps {
3636
unstyled?: boolean | undefined
3737
}
3838
39-
export interface ${componentName}<T extends ElementType, P extends Dict = {}> extends Component<Assign<ComponentProps<T> & UnstyledProps, Assign<PatchedHTMLProps, Assign<JsxStyleProps, P>>>> {}
39+
export interface AsProps {
40+
/**
41+
* The element to render as
42+
*/
43+
as?: ElementType | undefined
44+
}
45+
46+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> extends Component<Assign<ComponentProps<T> & UnstyledProps & AsProps, Assign<PatchedHTMLProps, Assign<JsxStyleProps, P>>>> {}
4047
4148
interface RecipeFn {
4249
__type: any
@@ -49,7 +56,7 @@ export interface JsxFactoryOptions<TProps extends Dict> {
4956
forwardProps?: string[]
5057
}
5158
52-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps, P>;
59+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
5360
5461
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
5562
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
@@ -70,7 +77,7 @@ export type JsxElements = {
7077
7178
export type ${upperName} = JsxFactory & JsxElements
7279
73-
export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T> & UnstyledProps, JsxStyleProps>
80+
export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
7481
7582
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
7683
`,

packages/generator/src/artifacts/react-jsx/types.string-literal.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ interface Dict {
1717
[k: string]: unknown
1818
}
1919
20+
export interface AsProps {
21+
/**
22+
* The element to render as
23+
*/
24+
as?: ElementType | undefined
25+
}
26+
2027
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
2128
ref?: Ref<ElementRef<T>>
22-
}
29+
} & AsProps
2330
2431
export type ${componentName}<T extends ElementType> = {
2532
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
26-
displayName?: string
33+
displayName?: string | undefined
2734
}
2835
2936
export interface JsxFactory {

packages/generator/src/artifacts/react-jsx/types.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ export interface UnstyledProps {
2828
unstyled?: boolean | undefined
2929
}
3030
31+
export interface AsProps {
32+
/**
33+
* The element to render as
34+
*/
35+
as?: ElementType | undefined
36+
}
37+
3138
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
3239
ref?: Ref<ElementRef<T>>
3340
}
3441
3542
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
36-
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps, Assign<JsxStyleProps, P>>): JSX.Element
37-
displayName?: string
43+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
44+
displayName?: string | undefined
3845
}
3946
4047
interface RecipeFn {
@@ -48,7 +55,7 @@ interface JsxFactoryOptions<TProps extends Dict> {
4855
forwardProps?: string[]
4956
}
5057
51-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps, P>;
58+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
5259
5360
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
5461
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
@@ -69,7 +76,7 @@ export type JsxElements = {
6976
7077
export type ${upperName} = JsxFactory & JsxElements
7178
72-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps, JsxStyleProps>
79+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
7380
7481
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
7582
`,

packages/generator/src/artifacts/solid-jsx/types.string-literal.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,18 @@ interface Dict {
1616
[k: string]: unknown
1717
}
1818
19+
export interface AsProps {
20+
/**
21+
* The element to render as
22+
*/
23+
as?: ElementType | undefined
24+
}
25+
1926
export type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
2027
2128
export type ${componentName}<T extends ElementType> = {
22-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
23-
displayName?: string
29+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
30+
displayName?: string | undefined
2431
}
2532
2633
export interface JsxFactory {

packages/generator/src/artifacts/solid-jsx/types.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,18 @@ export interface UnstyledProps {
2828
unstyled?: boolean | undefined
2929
}
3030
31+
export interface AsProps {
32+
/**
33+
* The element to render as
34+
*/
35+
as?: ElementType | undefined
36+
}
37+
3138
export type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
3239
3340
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
34-
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps, Assign<JsxStyleProps, P>>): JSX.Element
35-
displayName?: string
41+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
42+
displayName?: string | undefined
3643
}
3744
3845
interface RecipeFn {
@@ -46,7 +53,7 @@ export interface JsxFactoryOptions<TProps extends Dict> {
4653
forwardProps?: string[]
4754
}
4855
49-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps, P>;
56+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
5057
5158
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
5259
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
@@ -67,7 +74,7 @@ export type JsxElements = {
6774
6875
export type ${upperName} = JsxFactory & JsxElements
6976
70-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps, JsxStyleProps>
77+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
7178
7279
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
7380
`,

0 commit comments

Comments
 (0)