@pandacss/generator 1.1.0 → 1.3.0
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 +197 -44
- package/dist/index.mjs +198 -45
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -996,7 +996,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
996
996
|
const __base__ = Dynamic.__base__ || Dynamic
|
|
997
997
|
|
|
998
998
|
const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
|
|
999
|
-
const { as: Element = __base__, children, ...restProps } = props
|
|
999
|
+
const { as: Element = __base__, unstyled, children, ...restProps } = props
|
|
1000
1000
|
|
|
1001
1001
|
|
|
1002
1002
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
@@ -1017,7 +1017,13 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1017
1017
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
|
|
1018
1018
|
}
|
|
1019
1019
|
|
|
1020
|
-
const classes =
|
|
1020
|
+
const classes = () => {
|
|
1021
|
+
if (unstyled) {
|
|
1022
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1023
|
+
return cx(css(propStyles, cssStyles), combinedProps.class, combinedProps.className)
|
|
1024
|
+
}
|
|
1025
|
+
return configOrCva.__recipe__ ? recipeClass() : cvaClass()
|
|
1026
|
+
}
|
|
1021
1027
|
|
|
1022
1028
|
return h(Element, {
|
|
1023
1029
|
...forwardedProps,
|
|
@@ -1025,7 +1031,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1025
1031
|
...normalizeHTMLProps(htmlProps),
|
|
1026
1032
|
ref,
|
|
1027
1033
|
className: classes()
|
|
1028
|
-
},
|
|
1034
|
+
}, children ?? combinedProps.children)
|
|
1029
1035
|
})
|
|
1030
1036
|
|
|
1031
1037
|
const name = getDisplayName(__base__)
|
|
@@ -1151,9 +1157,23 @@ interface Dict {
|
|
|
1151
1157
|
[k: string]: unknown
|
|
1152
1158
|
}
|
|
1153
1159
|
|
|
1160
|
+
export interface UnstyledProps {
|
|
1161
|
+
/**
|
|
1162
|
+
* Whether to remove recipe styles
|
|
1163
|
+
*/
|
|
1164
|
+
unstyled?: boolean | undefined
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
export interface AsProps {
|
|
1168
|
+
/**
|
|
1169
|
+
* The element to render as
|
|
1170
|
+
*/
|
|
1171
|
+
as?: ElementType | undefined
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1154
1174
|
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
1155
|
-
(props: JsxHTMLProps<ComponentProps<T
|
|
1156
|
-
displayName?: string
|
|
1175
|
+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
|
|
1176
|
+
displayName?: string | undefined
|
|
1157
1177
|
}
|
|
1158
1178
|
|
|
1159
1179
|
interface RecipeFn {
|
|
@@ -1162,12 +1182,12 @@ interface RecipeFn {
|
|
|
1162
1182
|
|
|
1163
1183
|
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
1164
1184
|
dataAttr?: boolean
|
|
1165
|
-
defaultProps?: TProps
|
|
1185
|
+
defaultProps?: Partial<TProps>
|
|
1166
1186
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
1167
1187
|
forwardProps?: string[]
|
|
1168
1188
|
}
|
|
1169
1189
|
|
|
1170
|
-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T
|
|
1190
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>
|
|
1171
1191
|
|
|
1172
1192
|
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
|
|
1173
1193
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -1188,7 +1208,7 @@ export type JsxElements = {
|
|
|
1188
1208
|
|
|
1189
1209
|
export type ${upperName} = JsxFactory & JsxElements
|
|
1190
1210
|
|
|
1191
|
-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T
|
|
1211
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
1192
1212
|
|
|
1193
1213
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
1194
1214
|
`
|
|
@@ -1426,9 +1446,16 @@ interface Dict {
|
|
|
1426
1446
|
[k: string]: unknown
|
|
1427
1447
|
}
|
|
1428
1448
|
|
|
1449
|
+
export interface AsProps {
|
|
1450
|
+
/**
|
|
1451
|
+
* The element to render as
|
|
1452
|
+
*/
|
|
1453
|
+
as?: ElementType | undefined
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1429
1456
|
export type ${componentName}<T extends ElementType> = {
|
|
1430
|
-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
|
|
1431
|
-
displayName?: string
|
|
1457
|
+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
|
|
1458
|
+
displayName?: string | undefined
|
|
1432
1459
|
}
|
|
1433
1460
|
|
|
1434
1461
|
export interface JsxFactory {
|
|
@@ -1480,7 +1507,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1480
1507
|
const __base__ = Dynamic.__base__ || Dynamic
|
|
1481
1508
|
|
|
1482
1509
|
const ${componentName} = function ${componentName}(props) {
|
|
1483
|
-
const { as: Element = __base__, children, className, ...restProps } = props
|
|
1510
|
+
const { as: Element = __base__, unstyled, children, className, ...restProps } = props
|
|
1484
1511
|
|
|
1485
1512
|
const combinedProps = Object.assign({}, defaultProps, restProps)
|
|
1486
1513
|
|
|
@@ -1501,14 +1528,20 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1501
1528
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, className)
|
|
1502
1529
|
}
|
|
1503
1530
|
|
|
1504
|
-
const classes =
|
|
1531
|
+
const classes = () => {
|
|
1532
|
+
if (unstyled) {
|
|
1533
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1534
|
+
return cx(css(propStyles, cssStyles), combinedProps.class, className)
|
|
1535
|
+
}
|
|
1536
|
+
return configOrCva.__recipe__ ? recipeClass() : cvaClass()
|
|
1537
|
+
}
|
|
1505
1538
|
|
|
1506
1539
|
return h(Element, {
|
|
1507
1540
|
...forwardedProps,
|
|
1508
1541
|
...elementProps,
|
|
1509
1542
|
...normalizeHTMLProps(htmlProps),
|
|
1510
1543
|
class: classes(),
|
|
1511
|
-
},
|
|
1544
|
+
}, children ?? combinedProps.children)
|
|
1512
1545
|
}
|
|
1513
1546
|
|
|
1514
1547
|
const name = getDisplayName(__base__)
|
|
@@ -1640,7 +1673,21 @@ interface Dict {
|
|
|
1640
1673
|
[k: string]: unknown
|
|
1641
1674
|
}
|
|
1642
1675
|
|
|
1643
|
-
export interface
|
|
1676
|
+
export interface UnstyledProps {
|
|
1677
|
+
/**
|
|
1678
|
+
* Whether to remove recipe styles
|
|
1679
|
+
*/
|
|
1680
|
+
unstyled?: boolean | undefined
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
export interface AsProps {
|
|
1684
|
+
/**
|
|
1685
|
+
* The element to render as
|
|
1686
|
+
*/
|
|
1687
|
+
as?: ElementType | undefined
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> extends Component<Assign<ComponentProps<T> & UnstyledProps & AsProps, Assign<PatchedHTMLProps, Assign<JsxStyleProps, P>>>> {}
|
|
1644
1691
|
|
|
1645
1692
|
interface RecipeFn {
|
|
1646
1693
|
__type: any
|
|
@@ -1648,12 +1695,12 @@ interface RecipeFn {
|
|
|
1648
1695
|
|
|
1649
1696
|
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
1650
1697
|
dataAttr?: boolean
|
|
1651
|
-
defaultProps?: TProps
|
|
1698
|
+
defaultProps?: Partial<TProps>
|
|
1652
1699
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
1653
1700
|
forwardProps?: string[]
|
|
1654
1701
|
}
|
|
1655
1702
|
|
|
1656
|
-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T
|
|
1703
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
|
|
1657
1704
|
|
|
1658
1705
|
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
|
|
1659
1706
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -1674,7 +1721,7 @@ export type JsxElements = {
|
|
|
1674
1721
|
|
|
1675
1722
|
export type ${upperName} = JsxFactory & JsxElements
|
|
1676
1723
|
|
|
1677
|
-
export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T
|
|
1724
|
+
export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
1678
1725
|
|
|
1679
1726
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
1680
1727
|
`
|
|
@@ -1765,8 +1812,15 @@ interface Dict {
|
|
|
1765
1812
|
[k: string]: unknown
|
|
1766
1813
|
}
|
|
1767
1814
|
|
|
1815
|
+
export interface AsProps {
|
|
1816
|
+
/**
|
|
1817
|
+
* The element to render as
|
|
1818
|
+
*/
|
|
1819
|
+
as?: ElementType | undefined
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1768
1822
|
export type ${componentName}<T extends ElementType> = {
|
|
1769
|
-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
|
|
1823
|
+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
|
|
1770
1824
|
}
|
|
1771
1825
|
|
|
1772
1826
|
export interface JsxFactory {
|
|
@@ -1818,7 +1872,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1818
1872
|
const __base__ = Dynamic.__base__ || Dynamic
|
|
1819
1873
|
|
|
1820
1874
|
const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
|
|
1821
|
-
const { as: Element = __base__, children, ...restProps } = props
|
|
1875
|
+
const { as: Element = __base__, unstyled, children, ...restProps } = props
|
|
1822
1876
|
|
|
1823
1877
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
1824
1878
|
|
|
@@ -1838,7 +1892,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1838
1892
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.className)
|
|
1839
1893
|
}
|
|
1840
1894
|
|
|
1841
|
-
const classes =
|
|
1895
|
+
const classes = () => {
|
|
1896
|
+
if (unstyled) {
|
|
1897
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1898
|
+
return cx(css(propStyles, cssStyles), combinedProps.className)
|
|
1899
|
+
}
|
|
1900
|
+
return configOrCva.__recipe__ ? recipeClass() : cvaClass()
|
|
1901
|
+
}
|
|
1842
1902
|
|
|
1843
1903
|
return createElement(Element, {
|
|
1844
1904
|
ref,
|
|
@@ -1846,7 +1906,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1846
1906
|
...elementProps,
|
|
1847
1907
|
...normalizeHTMLProps(htmlProps),
|
|
1848
1908
|
className: classes(),
|
|
1849
|
-
},
|
|
1909
|
+
}, children ?? combinedProps.children)
|
|
1850
1910
|
})
|
|
1851
1911
|
|
|
1852
1912
|
const name = getDisplayName(__base__)
|
|
@@ -1970,13 +2030,27 @@ interface Dict {
|
|
|
1970
2030
|
[k: string]: unknown
|
|
1971
2031
|
}
|
|
1972
2032
|
|
|
2033
|
+
export interface UnstyledProps {
|
|
2034
|
+
/**
|
|
2035
|
+
* Whether to remove recipe styles
|
|
2036
|
+
*/
|
|
2037
|
+
unstyled?: boolean | undefined
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
export interface AsProps {
|
|
2041
|
+
/**
|
|
2042
|
+
* The element to render as
|
|
2043
|
+
*/
|
|
2044
|
+
as?: ElementType | undefined
|
|
2045
|
+
}
|
|
2046
|
+
|
|
1973
2047
|
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1974
2048
|
ref?: Ref<ElementRef<T>>
|
|
1975
2049
|
}
|
|
1976
2050
|
|
|
1977
2051
|
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
1978
|
-
(props: JsxHTMLProps<ComponentProps<T
|
|
1979
|
-
displayName?: string
|
|
2052
|
+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
|
|
2053
|
+
displayName?: string | undefined
|
|
1980
2054
|
}
|
|
1981
2055
|
|
|
1982
2056
|
interface RecipeFn {
|
|
@@ -1985,12 +2059,12 @@ interface RecipeFn {
|
|
|
1985
2059
|
|
|
1986
2060
|
interface JsxFactoryOptions<TProps extends Dict> {
|
|
1987
2061
|
dataAttr?: boolean
|
|
1988
|
-
defaultProps?: TProps
|
|
2062
|
+
defaultProps?: Partial<TProps>
|
|
1989
2063
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
1990
2064
|
forwardProps?: string[]
|
|
1991
2065
|
}
|
|
1992
2066
|
|
|
1993
|
-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T
|
|
2067
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
|
|
1994
2068
|
|
|
1995
2069
|
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
|
|
1996
2070
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -2011,7 +2085,7 @@ export type JsxElements = {
|
|
|
2011
2085
|
|
|
2012
2086
|
export type ${upperName} = JsxFactory & JsxElements
|
|
2013
2087
|
|
|
2014
|
-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T
|
|
2088
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
2015
2089
|
|
|
2016
2090
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
2017
2091
|
`
|
|
@@ -2248,13 +2322,20 @@ interface Dict {
|
|
|
2248
2322
|
[k: string]: unknown
|
|
2249
2323
|
}
|
|
2250
2324
|
|
|
2325
|
+
export interface AsProps {
|
|
2326
|
+
/**
|
|
2327
|
+
* The element to render as
|
|
2328
|
+
*/
|
|
2329
|
+
as?: ElementType | undefined
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2251
2332
|
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
2252
2333
|
ref?: Ref<ElementRef<T>>
|
|
2253
|
-
}
|
|
2334
|
+
} & AsProps
|
|
2254
2335
|
|
|
2255
2336
|
export type ${componentName}<T extends ElementType> = {
|
|
2256
2337
|
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
|
|
2257
|
-
displayName?: string
|
|
2338
|
+
displayName?: string | undefined
|
|
2258
2339
|
}
|
|
2259
2340
|
|
|
2260
2341
|
export interface JsxFactory {
|
|
@@ -2322,6 +2403,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2322
2403
|
|
|
2323
2404
|
const [localProps, restProps] = splitProps(mergedProps, [
|
|
2324
2405
|
'as',
|
|
2406
|
+
'unstyled',
|
|
2325
2407
|
'class',
|
|
2326
2408
|
'className',
|
|
2327
2409
|
])
|
|
@@ -2364,7 +2446,13 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2364
2446
|
)
|
|
2365
2447
|
}
|
|
2366
2448
|
|
|
2367
|
-
const classes =
|
|
2449
|
+
const classes = () => {
|
|
2450
|
+
if (localProps.unstyled) {
|
|
2451
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
2452
|
+
return cx(css(propStyles, cssStyles), localProps.class, localProps.className)
|
|
2453
|
+
}
|
|
2454
|
+
return configOrCva.__recipe__ ? recipeClass() : cvaClass()
|
|
2455
|
+
}
|
|
2368
2456
|
|
|
2369
2457
|
if (forwardedProps.className) {
|
|
2370
2458
|
delete forwardedProps.className
|
|
@@ -2510,11 +2598,25 @@ interface Dict {
|
|
|
2510
2598
|
[k: string]: unknown
|
|
2511
2599
|
}
|
|
2512
2600
|
|
|
2601
|
+
export interface UnstyledProps {
|
|
2602
|
+
/**
|
|
2603
|
+
* Whether to remove recipe styles
|
|
2604
|
+
*/
|
|
2605
|
+
unstyled?: boolean | undefined
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
export interface AsProps {
|
|
2609
|
+
/**
|
|
2610
|
+
* The element to render as
|
|
2611
|
+
*/
|
|
2612
|
+
as?: ElementType | undefined
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2513
2615
|
export type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
|
|
2514
2616
|
|
|
2515
2617
|
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
2516
|
-
(props: JsxHTMLProps<ComponentProps<T
|
|
2517
|
-
displayName?: string
|
|
2618
|
+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
|
|
2619
|
+
displayName?: string | undefined
|
|
2518
2620
|
}
|
|
2519
2621
|
|
|
2520
2622
|
interface RecipeFn {
|
|
@@ -2523,12 +2625,12 @@ interface RecipeFn {
|
|
|
2523
2625
|
|
|
2524
2626
|
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
2525
2627
|
dataAttr?: boolean
|
|
2526
|
-
defaultProps?: TProps
|
|
2628
|
+
defaultProps?: Partial<TProps>
|
|
2527
2629
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
2528
2630
|
forwardProps?: string[]
|
|
2529
2631
|
}
|
|
2530
2632
|
|
|
2531
|
-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T
|
|
2633
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
|
|
2532
2634
|
|
|
2533
2635
|
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
|
|
2534
2636
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -2549,7 +2651,7 @@ export type JsxElements = {
|
|
|
2549
2651
|
|
|
2550
2652
|
export type ${upperName} = JsxFactory & JsxElements
|
|
2551
2653
|
|
|
2552
|
-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T
|
|
2654
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
2553
2655
|
|
|
2554
2656
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
2555
2657
|
`
|
|
@@ -2815,11 +2917,18 @@ interface Dict {
|
|
|
2815
2917
|
[k: string]: unknown
|
|
2816
2918
|
}
|
|
2817
2919
|
|
|
2920
|
+
export interface AsProps {
|
|
2921
|
+
/**
|
|
2922
|
+
* The element to render as
|
|
2923
|
+
*/
|
|
2924
|
+
as?: ElementType | undefined
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2818
2927
|
export type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
|
|
2819
2928
|
|
|
2820
2929
|
export type ${componentName}<T extends ElementType> = {
|
|
2821
|
-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
|
|
2822
|
-
displayName?: string
|
|
2930
|
+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
|
|
2931
|
+
displayName?: string | undefined
|
|
2823
2932
|
}
|
|
2824
2933
|
|
|
2825
2934
|
export interface JsxFactory {
|
|
@@ -2877,6 +2986,7 @@ function generateVueJsxFactory(ctx) {
|
|
|
2877
2986
|
inheritAttrs: false,
|
|
2878
2987
|
props: {
|
|
2879
2988
|
modelValue: null,
|
|
2989
|
+
unstyled: { type: Boolean, default: false },
|
|
2880
2990
|
as: { type: [String, Object], default: __base__ }
|
|
2881
2991
|
},
|
|
2882
2992
|
setup(props, { slots, attrs, emit }) {
|
|
@@ -2900,7 +3010,14 @@ function generateVueJsxFactory(ctx) {
|
|
|
2900
3010
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
|
|
2901
3011
|
})
|
|
2902
3012
|
|
|
2903
|
-
const classes =
|
|
3013
|
+
const classes = computed(() => {
|
|
3014
|
+
if (props.unstyled) {
|
|
3015
|
+
const [_htmlProps, _forwardedProps, _variantProps, styleProps, _elementProps] = splittedProps.value
|
|
3016
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
3017
|
+
return cx(css(propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
|
|
3018
|
+
}
|
|
3019
|
+
return configOrCva.__recipe__ ? recipeClass.value : cvaClass.value
|
|
3020
|
+
})
|
|
2904
3021
|
|
|
2905
3022
|
const vModelProps = computed(() => {
|
|
2906
3023
|
const result = {};
|
|
@@ -3074,8 +3191,26 @@ export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
|
3074
3191
|
? Props
|
|
3075
3192
|
: never
|
|
3076
3193
|
|
|
3194
|
+
interface Dict {
|
|
3195
|
+
[k: string]: unknown
|
|
3196
|
+
}
|
|
3197
|
+
|
|
3198
|
+
export interface UnstyledProps {
|
|
3199
|
+
/**
|
|
3200
|
+
* Whether to remove recipe styles
|
|
3201
|
+
*/
|
|
3202
|
+
unstyled?: boolean | undefined
|
|
3203
|
+
}
|
|
3204
|
+
|
|
3205
|
+
export interface AsProps {
|
|
3206
|
+
/**
|
|
3207
|
+
* The element to render as
|
|
3208
|
+
*/
|
|
3209
|
+
as?: ElementType | undefined
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3077
3212
|
export interface ${componentName}<T extends ElementType, P extends Dict = {}> extends FunctionalComponent<
|
|
3078
|
-
JsxHTMLProps<ComponentProps<T
|
|
3213
|
+
JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>
|
|
3079
3214
|
> {}
|
|
3080
3215
|
|
|
3081
3216
|
interface RecipeFn {
|
|
@@ -3084,12 +3219,12 @@ interface RecipeFn {
|
|
|
3084
3219
|
|
|
3085
3220
|
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
3086
3221
|
dataAttr?: boolean
|
|
3087
|
-
defaultProps?: TProps
|
|
3222
|
+
defaultProps?: Partial<TProps>
|
|
3088
3223
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
3089
3224
|
forwardProps?: string[]
|
|
3090
3225
|
}
|
|
3091
3226
|
|
|
3092
|
-
export type JsxRecipeProps<T extends ElementType, P extends RecipeFn> = JsxHTMLProps<ComponentProps<T
|
|
3227
|
+
export type JsxRecipeProps<T extends ElementType, P extends RecipeFn> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P['__type']>>;
|
|
3093
3228
|
|
|
3094
3229
|
export type JsxElement<T extends ElementType, P> = T extends ${componentName}<infer A, infer B>
|
|
3095
3230
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -3110,7 +3245,7 @@ export type JsxElements = {
|
|
|
3110
3245
|
|
|
3111
3246
|
export type ${upperName} = JsxFactory & JsxElements
|
|
3112
3247
|
|
|
3113
|
-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T
|
|
3248
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
3114
3249
|
|
|
3115
3250
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
3116
3251
|
`
|
|
@@ -3420,8 +3555,15 @@ export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
|
3420
3555
|
? Props
|
|
3421
3556
|
: never
|
|
3422
3557
|
|
|
3558
|
+
export interface AsProps {
|
|
3559
|
+
/**
|
|
3560
|
+
* The element to render as
|
|
3561
|
+
*/
|
|
3562
|
+
as?: ElementType | undefined
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3423
3565
|
export type ${componentName}<T extends ElementType> = {
|
|
3424
|
-
(args: { raw: readonly string[] | ArrayLike<string> }): FunctionalComponent<ComponentProps<T
|
|
3566
|
+
(args: { raw: readonly string[] | ArrayLike<string> }): FunctionalComponent<ComponentProps<T> & AsProps>
|
|
3425
3567
|
}
|
|
3426
3568
|
|
|
3427
3569
|
export interface JsxFactory {
|
|
@@ -3511,7 +3653,7 @@ var import_ts_pattern14 = require("ts-pattern");
|
|
|
3511
3653
|
|
|
3512
3654
|
// src/artifacts/generated/composition.d.ts.json
|
|
3513
3655
|
var composition_d_ts_default = {
|
|
3514
|
-
content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Token<T> {\n value: T\n description?: string\n}\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'font'\n | 'fontFamily'\n | 'fontFeatureSettings'\n | 'fontKerning'\n | 'fontLanguageOverride'\n | 'fontOpticalSizing'\n | 'fontPalette'\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontStretch'\n | 'fontStyle'\n | 'fontSynthesis'\n | 'fontVariant'\n | 'fontVariantAlternates'\n | 'fontVariantCaps'\n | 'fontVariantLigatures'\n | 'fontVariantNumeric'\n | 'fontVariantPosition'\n | 'fontVariationSettings'\n | 'fontWeight'\n | 'hypens'\n | 'hyphenateCharacter'\n | 'hyphenateLimitChars'\n | 'letterSpacing'\n | 'lineBreak'\n | 'lineHeight'\n | 'quotes'\n | 'overflowWrap'\n | 'textCombineUpright'\n | 'textDecoration'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationSkipInk'\n | 'textDecorationStyle'\n | 'textDecorationThickness'\n | 'textEmphasis'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'textIndent'\n | 'textJustify'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n | 'textShadow'\n | 'textTransform'\n | 'textUnderlineOffset'\n | 'textUnderlinePosition'\n | 'textWrap'\n | 'textWrapMode'\n | 'textWrapStyle'\n | 'verticalAlign'\n | 'whiteSpace'\n | 'wordBreak'\n | 'wordSpacing'\n\nexport type TextStyle = CompositionStyleObject<TextStyleProperty>\n\nexport type TextStyles = Recursive<Token<TextStyle>>\n\n/* -----------------------------------------------------------------------------\n * Layer styles\n * -----------------------------------------------------------------------------*/\n\ntype
|
|
3656
|
+
content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Token<T> {\n value: T\n description?: string\n}\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'color'\n | 'direction'\n | 'font'\n | 'fontFamily'\n | 'fontFeatureSettings'\n | 'fontKerning'\n | 'fontLanguageOverride'\n | 'fontOpticalSizing'\n | 'fontPalette'\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontStretch'\n | 'fontStyle'\n | 'fontSynthesis'\n | 'fontVariant'\n | 'fontVariantAlternates'\n | 'fontVariantCaps'\n | 'fontVariantLigatures'\n | 'fontVariantNumeric'\n | 'fontVariantPosition'\n | 'fontVariationSettings'\n | 'fontWeight'\n | 'hangingPunctuation'\n | 'hypens'\n | 'hyphenateCharacter'\n | 'hyphenateLimitChars'\n | 'letterSpacing'\n | 'lineBreak'\n | 'lineHeight'\n | 'quotes'\n | 'overflowWrap'\n | 'tabSize'\n | 'textAlign'\n | 'textAlignLast'\n | 'textCombineUpright'\n | 'textDecoration'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationSkip'\n | 'textDecorationSkipBox'\n | 'textDecorationSkipInk'\n | 'textDecorationSkipInset'\n | 'textDecorationStyle'\n | 'textDecorationThickness'\n | 'textEmphasis'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'textIndent'\n | 'textJustify'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n | 'textShadow'\n | 'textStroke'\n | 'textStrokeColor'\n | 'textStrokeWidth'\n | 'textTransform'\n | 'textUnderlineOffset'\n | 'textUnderlinePosition'\n | 'textWrap'\n | 'textWrapMode'\n | 'textWrapStyle'\n | 'unicodeBidi'\n | 'verticalAlign'\n | 'whiteSpace'\n | 'wordBreak'\n | 'wordSpacing'\n | 'writingMode'\n\nexport type TextStyle = CompositionStyleObject<TextStyleProperty>\n\nexport type TextStyles = Recursive<Token<TextStyle>>\n\n/* -----------------------------------------------------------------------------\n * Layer styles\n * -----------------------------------------------------------------------------*/\n\ntype LogicalPlacement = 'Inline' | 'Block' | 'InlineStart' | 'InlineEnd' | 'BlockStart' | 'BlockEnd'\n\ntype PhysicalPlacement = 'Top' | 'Right' | 'Bottom' | 'Left'\n\ntype Placement = PhysicalPlacement | LogicalPlacement\n\ntype Radius =\n | `Top${'Right' | 'Left'}`\n | `Bottom${'Right' | 'Left'}`\n | `Start${'Start' | 'End'}`\n | `End${'Start' | 'End'}`\n\ntype LayerStyleProperty =\n | 'aspectRatio'\n | 'background'\n | 'backgroundColor'\n | 'backgroundImage'\n | 'border'\n | 'borderColor'\n | 'borderImage'\n | 'borderImageOutset'\n | 'borderImageRepeat'\n | 'borderImageSlice'\n | 'borderImageSource'\n | 'borderImageWidth'\n | 'borderRadius'\n | 'borderStyle'\n | 'borderWidth'\n | `border${Placement}`\n | `border${Placement}Color`\n | `border${Placement}Style`\n | `border${Placement}Width`\n | 'borderRadius'\n | `border${Radius}Radius`\n | 'boxShadow'\n | 'boxShadowColor'\n | 'clipPath'\n | 'color'\n | 'contain'\n | 'content'\n | 'contentVisibility'\n | 'cursor'\n | 'display'\n | 'filter'\n | 'backdropFilter'\n | 'height'\n | 'width'\n | 'minHeight'\n | 'minWidth'\n | 'maxHeight'\n | 'maxWidth'\n | `margin${Placement}`\n | 'inset'\n | `inset${LogicalPlacement}`\n | Lowercase<PhysicalPlacement>\n | 'isolation'\n | 'mask'\n | 'maskClip'\n | 'maskComposite'\n | 'maskImage'\n | 'maskMode'\n | 'maskOrigin'\n | 'maskPosition'\n | 'maskRepeat'\n | 'maskSize'\n | 'mixBlendMode'\n | 'objectFit'\n | 'objectPosition'\n | 'opacity'\n | 'outline'\n | 'outlineColor'\n | 'outlineOffset'\n | 'outlineStyle'\n | 'outlineWidth'\n | 'overflow'\n | 'overflowX'\n | 'overflowY'\n | 'padding'\n | `padding${Placement}`\n | 'pointerEvents'\n | 'position'\n | 'resize'\n | 'transform'\n | 'transition'\n | 'visibility'\n | 'willChange'\n | 'zIndex'\n | 'backgroundBlendMode'\n | 'backgroundAttachment'\n | 'backgroundClip'\n | 'backgroundOrigin'\n | 'backgroundPosition'\n | 'backgroundRepeat'\n | 'backgroundSize'\n\nexport type LayerStyle = CompositionStyleObject<LayerStyleProperty>\n\nexport type LayerStyles = Recursive<Token<LayerStyle>>\n\n/* -----------------------------------------------------------------------------\n * Motion styles\n * -----------------------------------------------------------------------------*/\n\ntype AnimationStyleProperty =\n | 'animation'\n | 'animationComposition'\n | 'animationDelay'\n | 'animationDirection'\n | 'animationDuration'\n | 'animationFillMode'\n | 'animationIterationCount'\n | 'animationName'\n | 'animationPlayState'\n | 'animationTimingFunction'\n | 'animationRange'\n | 'animationRangeStart'\n | 'animationRangeEnd'\n | 'animationTimeline'\n | 'transformOrigin'\n\nexport type AnimationStyle = CompositionStyleObject<AnimationStyleProperty>\n\nexport type AnimationStyles = Recursive<Token<AnimationStyle>>\n\nexport interface CompositionStyles {\n textStyles: TextStyles\n layerStyles: LayerStyles\n animationStyles: AnimationStyles\n}\n"
|
|
3515
3657
|
};
|
|
3516
3658
|
|
|
3517
3659
|
// src/artifacts/generated/csstype.d.ts.json
|
|
@@ -5307,6 +5449,9 @@ function generateResetCss(ctx, sheet) {
|
|
|
5307
5449
|
"--placeholder-fallback": "color-mix(in oklab, currentcolor 50%, transparent)"
|
|
5308
5450
|
}
|
|
5309
5451
|
},
|
|
5452
|
+
"::selection": {
|
|
5453
|
+
backgroundColor: "var(--global-color-selection, rgba(0, 115, 255, 0.3))"
|
|
5454
|
+
},
|
|
5310
5455
|
textarea: {
|
|
5311
5456
|
resize: "vertical"
|
|
5312
5457
|
},
|
|
@@ -5386,7 +5531,15 @@ function generateResetCss(ctx, sheet) {
|
|
|
5386
5531
|
}
|
|
5387
5532
|
};
|
|
5388
5533
|
if (level === "element") {
|
|
5389
|
-
const modified = (0, import_shared6.mapEntries)(scoped, (k, v) =>
|
|
5534
|
+
const modified = (0, import_shared6.mapEntries)(scoped, (k, v) => {
|
|
5535
|
+
const [trailingPseudo, rebuiltSelector] = (0, import_core4.extractTrailingPseudos)(k.toString());
|
|
5536
|
+
if (trailingPseudo) {
|
|
5537
|
+
const scopeClass = selector.replace("&", "");
|
|
5538
|
+
const newSelector = rebuiltSelector ? `${scopeClass} ${rebuiltSelector}${trailingPseudo}` : `${scopeClass} ${trailingPseudo}`;
|
|
5539
|
+
return [newSelector, v];
|
|
5540
|
+
}
|
|
5541
|
+
return [k, { [selector]: v }];
|
|
5542
|
+
});
|
|
5390
5543
|
Object.assign(reset, modified);
|
|
5391
5544
|
} else if (selector) {
|
|
5392
5545
|
reset[selector] = scoped;
|
package/dist/index.mjs
CHANGED
|
@@ -960,7 +960,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
960
960
|
const __base__ = Dynamic.__base__ || Dynamic
|
|
961
961
|
|
|
962
962
|
const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
|
|
963
|
-
const { as: Element = __base__, children, ...restProps } = props
|
|
963
|
+
const { as: Element = __base__, unstyled, children, ...restProps } = props
|
|
964
964
|
|
|
965
965
|
|
|
966
966
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
@@ -981,7 +981,13 @@ function generatePreactJsxFactory(ctx) {
|
|
|
981
981
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
|
|
982
982
|
}
|
|
983
983
|
|
|
984
|
-
const classes =
|
|
984
|
+
const classes = () => {
|
|
985
|
+
if (unstyled) {
|
|
986
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
987
|
+
return cx(css(propStyles, cssStyles), combinedProps.class, combinedProps.className)
|
|
988
|
+
}
|
|
989
|
+
return configOrCva.__recipe__ ? recipeClass() : cvaClass()
|
|
990
|
+
}
|
|
985
991
|
|
|
986
992
|
return h(Element, {
|
|
987
993
|
...forwardedProps,
|
|
@@ -989,7 +995,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
989
995
|
...normalizeHTMLProps(htmlProps),
|
|
990
996
|
ref,
|
|
991
997
|
className: classes()
|
|
992
|
-
},
|
|
998
|
+
}, children ?? combinedProps.children)
|
|
993
999
|
})
|
|
994
1000
|
|
|
995
1001
|
const name = getDisplayName(__base__)
|
|
@@ -1115,9 +1121,23 @@ interface Dict {
|
|
|
1115
1121
|
[k: string]: unknown
|
|
1116
1122
|
}
|
|
1117
1123
|
|
|
1124
|
+
export interface UnstyledProps {
|
|
1125
|
+
/**
|
|
1126
|
+
* Whether to remove recipe styles
|
|
1127
|
+
*/
|
|
1128
|
+
unstyled?: boolean | undefined
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
export interface AsProps {
|
|
1132
|
+
/**
|
|
1133
|
+
* The element to render as
|
|
1134
|
+
*/
|
|
1135
|
+
as?: ElementType | undefined
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1118
1138
|
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
1119
|
-
(props: JsxHTMLProps<ComponentProps<T
|
|
1120
|
-
displayName?: string
|
|
1139
|
+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
|
|
1140
|
+
displayName?: string | undefined
|
|
1121
1141
|
}
|
|
1122
1142
|
|
|
1123
1143
|
interface RecipeFn {
|
|
@@ -1126,12 +1146,12 @@ interface RecipeFn {
|
|
|
1126
1146
|
|
|
1127
1147
|
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
1128
1148
|
dataAttr?: boolean
|
|
1129
|
-
defaultProps?: TProps
|
|
1149
|
+
defaultProps?: Partial<TProps>
|
|
1130
1150
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
1131
1151
|
forwardProps?: string[]
|
|
1132
1152
|
}
|
|
1133
1153
|
|
|
1134
|
-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T
|
|
1154
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>
|
|
1135
1155
|
|
|
1136
1156
|
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
|
|
1137
1157
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -1152,7 +1172,7 @@ export type JsxElements = {
|
|
|
1152
1172
|
|
|
1153
1173
|
export type ${upperName} = JsxFactory & JsxElements
|
|
1154
1174
|
|
|
1155
|
-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T
|
|
1175
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
1156
1176
|
|
|
1157
1177
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
1158
1178
|
`
|
|
@@ -1390,9 +1410,16 @@ interface Dict {
|
|
|
1390
1410
|
[k: string]: unknown
|
|
1391
1411
|
}
|
|
1392
1412
|
|
|
1413
|
+
export interface AsProps {
|
|
1414
|
+
/**
|
|
1415
|
+
* The element to render as
|
|
1416
|
+
*/
|
|
1417
|
+
as?: ElementType | undefined
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1393
1420
|
export type ${componentName}<T extends ElementType> = {
|
|
1394
|
-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
|
|
1395
|
-
displayName?: string
|
|
1421
|
+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
|
|
1422
|
+
displayName?: string | undefined
|
|
1396
1423
|
}
|
|
1397
1424
|
|
|
1398
1425
|
export interface JsxFactory {
|
|
@@ -1444,7 +1471,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1444
1471
|
const __base__ = Dynamic.__base__ || Dynamic
|
|
1445
1472
|
|
|
1446
1473
|
const ${componentName} = function ${componentName}(props) {
|
|
1447
|
-
const { as: Element = __base__, children, className, ...restProps } = props
|
|
1474
|
+
const { as: Element = __base__, unstyled, children, className, ...restProps } = props
|
|
1448
1475
|
|
|
1449
1476
|
const combinedProps = Object.assign({}, defaultProps, restProps)
|
|
1450
1477
|
|
|
@@ -1465,14 +1492,20 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1465
1492
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, className)
|
|
1466
1493
|
}
|
|
1467
1494
|
|
|
1468
|
-
const classes =
|
|
1495
|
+
const classes = () => {
|
|
1496
|
+
if (unstyled) {
|
|
1497
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1498
|
+
return cx(css(propStyles, cssStyles), combinedProps.class, className)
|
|
1499
|
+
}
|
|
1500
|
+
return configOrCva.__recipe__ ? recipeClass() : cvaClass()
|
|
1501
|
+
}
|
|
1469
1502
|
|
|
1470
1503
|
return h(Element, {
|
|
1471
1504
|
...forwardedProps,
|
|
1472
1505
|
...elementProps,
|
|
1473
1506
|
...normalizeHTMLProps(htmlProps),
|
|
1474
1507
|
class: classes(),
|
|
1475
|
-
},
|
|
1508
|
+
}, children ?? combinedProps.children)
|
|
1476
1509
|
}
|
|
1477
1510
|
|
|
1478
1511
|
const name = getDisplayName(__base__)
|
|
@@ -1604,7 +1637,21 @@ interface Dict {
|
|
|
1604
1637
|
[k: string]: unknown
|
|
1605
1638
|
}
|
|
1606
1639
|
|
|
1607
|
-
export interface
|
|
1640
|
+
export interface UnstyledProps {
|
|
1641
|
+
/**
|
|
1642
|
+
* Whether to remove recipe styles
|
|
1643
|
+
*/
|
|
1644
|
+
unstyled?: boolean | undefined
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
export interface AsProps {
|
|
1648
|
+
/**
|
|
1649
|
+
* The element to render as
|
|
1650
|
+
*/
|
|
1651
|
+
as?: ElementType | undefined
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> extends Component<Assign<ComponentProps<T> & UnstyledProps & AsProps, Assign<PatchedHTMLProps, Assign<JsxStyleProps, P>>>> {}
|
|
1608
1655
|
|
|
1609
1656
|
interface RecipeFn {
|
|
1610
1657
|
__type: any
|
|
@@ -1612,12 +1659,12 @@ interface RecipeFn {
|
|
|
1612
1659
|
|
|
1613
1660
|
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
1614
1661
|
dataAttr?: boolean
|
|
1615
|
-
defaultProps?: TProps
|
|
1662
|
+
defaultProps?: Partial<TProps>
|
|
1616
1663
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
1617
1664
|
forwardProps?: string[]
|
|
1618
1665
|
}
|
|
1619
1666
|
|
|
1620
|
-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T
|
|
1667
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
|
|
1621
1668
|
|
|
1622
1669
|
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
|
|
1623
1670
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -1638,7 +1685,7 @@ export type JsxElements = {
|
|
|
1638
1685
|
|
|
1639
1686
|
export type ${upperName} = JsxFactory & JsxElements
|
|
1640
1687
|
|
|
1641
|
-
export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T
|
|
1688
|
+
export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
1642
1689
|
|
|
1643
1690
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
1644
1691
|
`
|
|
@@ -1729,8 +1776,15 @@ interface Dict {
|
|
|
1729
1776
|
[k: string]: unknown
|
|
1730
1777
|
}
|
|
1731
1778
|
|
|
1779
|
+
export interface AsProps {
|
|
1780
|
+
/**
|
|
1781
|
+
* The element to render as
|
|
1782
|
+
*/
|
|
1783
|
+
as?: ElementType | undefined
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1732
1786
|
export type ${componentName}<T extends ElementType> = {
|
|
1733
|
-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
|
|
1787
|
+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
|
|
1734
1788
|
}
|
|
1735
1789
|
|
|
1736
1790
|
export interface JsxFactory {
|
|
@@ -1782,7 +1836,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1782
1836
|
const __base__ = Dynamic.__base__ || Dynamic
|
|
1783
1837
|
|
|
1784
1838
|
const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
|
|
1785
|
-
const { as: Element = __base__, children, ...restProps } = props
|
|
1839
|
+
const { as: Element = __base__, unstyled, children, ...restProps } = props
|
|
1786
1840
|
|
|
1787
1841
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
1788
1842
|
|
|
@@ -1802,7 +1856,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1802
1856
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.className)
|
|
1803
1857
|
}
|
|
1804
1858
|
|
|
1805
|
-
const classes =
|
|
1859
|
+
const classes = () => {
|
|
1860
|
+
if (unstyled) {
|
|
1861
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1862
|
+
return cx(css(propStyles, cssStyles), combinedProps.className)
|
|
1863
|
+
}
|
|
1864
|
+
return configOrCva.__recipe__ ? recipeClass() : cvaClass()
|
|
1865
|
+
}
|
|
1806
1866
|
|
|
1807
1867
|
return createElement(Element, {
|
|
1808
1868
|
ref,
|
|
@@ -1810,7 +1870,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1810
1870
|
...elementProps,
|
|
1811
1871
|
...normalizeHTMLProps(htmlProps),
|
|
1812
1872
|
className: classes(),
|
|
1813
|
-
},
|
|
1873
|
+
}, children ?? combinedProps.children)
|
|
1814
1874
|
})
|
|
1815
1875
|
|
|
1816
1876
|
const name = getDisplayName(__base__)
|
|
@@ -1934,13 +1994,27 @@ interface Dict {
|
|
|
1934
1994
|
[k: string]: unknown
|
|
1935
1995
|
}
|
|
1936
1996
|
|
|
1997
|
+
export interface UnstyledProps {
|
|
1998
|
+
/**
|
|
1999
|
+
* Whether to remove recipe styles
|
|
2000
|
+
*/
|
|
2001
|
+
unstyled?: boolean | undefined
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
export interface AsProps {
|
|
2005
|
+
/**
|
|
2006
|
+
* The element to render as
|
|
2007
|
+
*/
|
|
2008
|
+
as?: ElementType | undefined
|
|
2009
|
+
}
|
|
2010
|
+
|
|
1937
2011
|
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1938
2012
|
ref?: Ref<ElementRef<T>>
|
|
1939
2013
|
}
|
|
1940
2014
|
|
|
1941
2015
|
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
1942
|
-
(props: JsxHTMLProps<ComponentProps<T
|
|
1943
|
-
displayName?: string
|
|
2016
|
+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
|
|
2017
|
+
displayName?: string | undefined
|
|
1944
2018
|
}
|
|
1945
2019
|
|
|
1946
2020
|
interface RecipeFn {
|
|
@@ -1949,12 +2023,12 @@ interface RecipeFn {
|
|
|
1949
2023
|
|
|
1950
2024
|
interface JsxFactoryOptions<TProps extends Dict> {
|
|
1951
2025
|
dataAttr?: boolean
|
|
1952
|
-
defaultProps?: TProps
|
|
2026
|
+
defaultProps?: Partial<TProps>
|
|
1953
2027
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
1954
2028
|
forwardProps?: string[]
|
|
1955
2029
|
}
|
|
1956
2030
|
|
|
1957
|
-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T
|
|
2031
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
|
|
1958
2032
|
|
|
1959
2033
|
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
|
|
1960
2034
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -1975,7 +2049,7 @@ export type JsxElements = {
|
|
|
1975
2049
|
|
|
1976
2050
|
export type ${upperName} = JsxFactory & JsxElements
|
|
1977
2051
|
|
|
1978
|
-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T
|
|
2052
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
1979
2053
|
|
|
1980
2054
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
1981
2055
|
`
|
|
@@ -2212,13 +2286,20 @@ interface Dict {
|
|
|
2212
2286
|
[k: string]: unknown
|
|
2213
2287
|
}
|
|
2214
2288
|
|
|
2289
|
+
export interface AsProps {
|
|
2290
|
+
/**
|
|
2291
|
+
* The element to render as
|
|
2292
|
+
*/
|
|
2293
|
+
as?: ElementType | undefined
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2215
2296
|
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
2216
2297
|
ref?: Ref<ElementRef<T>>
|
|
2217
|
-
}
|
|
2298
|
+
} & AsProps
|
|
2218
2299
|
|
|
2219
2300
|
export type ${componentName}<T extends ElementType> = {
|
|
2220
2301
|
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
|
|
2221
|
-
displayName?: string
|
|
2302
|
+
displayName?: string | undefined
|
|
2222
2303
|
}
|
|
2223
2304
|
|
|
2224
2305
|
export interface JsxFactory {
|
|
@@ -2286,6 +2367,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2286
2367
|
|
|
2287
2368
|
const [localProps, restProps] = splitProps(mergedProps, [
|
|
2288
2369
|
'as',
|
|
2370
|
+
'unstyled',
|
|
2289
2371
|
'class',
|
|
2290
2372
|
'className',
|
|
2291
2373
|
])
|
|
@@ -2328,7 +2410,13 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2328
2410
|
)
|
|
2329
2411
|
}
|
|
2330
2412
|
|
|
2331
|
-
const classes =
|
|
2413
|
+
const classes = () => {
|
|
2414
|
+
if (localProps.unstyled) {
|
|
2415
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
2416
|
+
return cx(css(propStyles, cssStyles), localProps.class, localProps.className)
|
|
2417
|
+
}
|
|
2418
|
+
return configOrCva.__recipe__ ? recipeClass() : cvaClass()
|
|
2419
|
+
}
|
|
2332
2420
|
|
|
2333
2421
|
if (forwardedProps.className) {
|
|
2334
2422
|
delete forwardedProps.className
|
|
@@ -2474,11 +2562,25 @@ interface Dict {
|
|
|
2474
2562
|
[k: string]: unknown
|
|
2475
2563
|
}
|
|
2476
2564
|
|
|
2565
|
+
export interface UnstyledProps {
|
|
2566
|
+
/**
|
|
2567
|
+
* Whether to remove recipe styles
|
|
2568
|
+
*/
|
|
2569
|
+
unstyled?: boolean | undefined
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
export interface AsProps {
|
|
2573
|
+
/**
|
|
2574
|
+
* The element to render as
|
|
2575
|
+
*/
|
|
2576
|
+
as?: ElementType | undefined
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2477
2579
|
export type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
|
|
2478
2580
|
|
|
2479
2581
|
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
2480
|
-
(props: JsxHTMLProps<ComponentProps<T
|
|
2481
|
-
displayName?: string
|
|
2582
|
+
(props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
|
|
2583
|
+
displayName?: string | undefined
|
|
2482
2584
|
}
|
|
2483
2585
|
|
|
2484
2586
|
interface RecipeFn {
|
|
@@ -2487,12 +2589,12 @@ interface RecipeFn {
|
|
|
2487
2589
|
|
|
2488
2590
|
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
2489
2591
|
dataAttr?: boolean
|
|
2490
|
-
defaultProps?: TProps
|
|
2592
|
+
defaultProps?: Partial<TProps>
|
|
2491
2593
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
2492
2594
|
forwardProps?: string[]
|
|
2493
2595
|
}
|
|
2494
2596
|
|
|
2495
|
-
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T
|
|
2597
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, P>;
|
|
2496
2598
|
|
|
2497
2599
|
export type JsxElement<T extends ElementType, P extends Dict> = T extends ${componentName}<infer A, infer B>
|
|
2498
2600
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -2513,7 +2615,7 @@ export type JsxElements = {
|
|
|
2513
2615
|
|
|
2514
2616
|
export type ${upperName} = JsxFactory & JsxElements
|
|
2515
2617
|
|
|
2516
|
-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T
|
|
2618
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
2517
2619
|
|
|
2518
2620
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
2519
2621
|
`
|
|
@@ -2779,11 +2881,18 @@ interface Dict {
|
|
|
2779
2881
|
[k: string]: unknown
|
|
2780
2882
|
}
|
|
2781
2883
|
|
|
2884
|
+
export interface AsProps {
|
|
2885
|
+
/**
|
|
2886
|
+
* The element to render as
|
|
2887
|
+
*/
|
|
2888
|
+
as?: ElementType | undefined
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2782
2891
|
export type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
|
|
2783
2892
|
|
|
2784
2893
|
export type ${componentName}<T extends ElementType> = {
|
|
2785
|
-
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T>) => JSX.Element
|
|
2786
|
-
displayName?: string
|
|
2894
|
+
(args: { raw: readonly string[] | ArrayLike<string> }): (props: ComponentProps<T> & AsProps) => JSX.Element
|
|
2895
|
+
displayName?: string | undefined
|
|
2787
2896
|
}
|
|
2788
2897
|
|
|
2789
2898
|
export interface JsxFactory {
|
|
@@ -2841,6 +2950,7 @@ function generateVueJsxFactory(ctx) {
|
|
|
2841
2950
|
inheritAttrs: false,
|
|
2842
2951
|
props: {
|
|
2843
2952
|
modelValue: null,
|
|
2953
|
+
unstyled: { type: Boolean, default: false },
|
|
2844
2954
|
as: { type: [String, Object], default: __base__ }
|
|
2845
2955
|
},
|
|
2846
2956
|
setup(props, { slots, attrs, emit }) {
|
|
@@ -2864,7 +2974,14 @@ function generateVueJsxFactory(ctx) {
|
|
|
2864
2974
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
|
|
2865
2975
|
})
|
|
2866
2976
|
|
|
2867
|
-
const classes =
|
|
2977
|
+
const classes = computed(() => {
|
|
2978
|
+
if (props.unstyled) {
|
|
2979
|
+
const [_htmlProps, _forwardedProps, _variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2980
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
2981
|
+
return cx(css(propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
|
|
2982
|
+
}
|
|
2983
|
+
return configOrCva.__recipe__ ? recipeClass.value : cvaClass.value
|
|
2984
|
+
})
|
|
2868
2985
|
|
|
2869
2986
|
const vModelProps = computed(() => {
|
|
2870
2987
|
const result = {};
|
|
@@ -3038,8 +3155,26 @@ export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
|
3038
3155
|
? Props
|
|
3039
3156
|
: never
|
|
3040
3157
|
|
|
3158
|
+
interface Dict {
|
|
3159
|
+
[k: string]: unknown
|
|
3160
|
+
}
|
|
3161
|
+
|
|
3162
|
+
export interface UnstyledProps {
|
|
3163
|
+
/**
|
|
3164
|
+
* Whether to remove recipe styles
|
|
3165
|
+
*/
|
|
3166
|
+
unstyled?: boolean | undefined
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
export interface AsProps {
|
|
3170
|
+
/**
|
|
3171
|
+
* The element to render as
|
|
3172
|
+
*/
|
|
3173
|
+
as?: ElementType | undefined
|
|
3174
|
+
}
|
|
3175
|
+
|
|
3041
3176
|
export interface ${componentName}<T extends ElementType, P extends Dict = {}> extends FunctionalComponent<
|
|
3042
|
-
JsxHTMLProps<ComponentProps<T
|
|
3177
|
+
JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>
|
|
3043
3178
|
> {}
|
|
3044
3179
|
|
|
3045
3180
|
interface RecipeFn {
|
|
@@ -3048,12 +3183,12 @@ interface RecipeFn {
|
|
|
3048
3183
|
|
|
3049
3184
|
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
3050
3185
|
dataAttr?: boolean
|
|
3051
|
-
defaultProps?: TProps
|
|
3186
|
+
defaultProps?: Partial<TProps>
|
|
3052
3187
|
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
3053
3188
|
forwardProps?: string[]
|
|
3054
3189
|
}
|
|
3055
3190
|
|
|
3056
|
-
export type JsxRecipeProps<T extends ElementType, P extends RecipeFn> = JsxHTMLProps<ComponentProps<T
|
|
3191
|
+
export type JsxRecipeProps<T extends ElementType, P extends RecipeFn> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P['__type']>>;
|
|
3057
3192
|
|
|
3058
3193
|
export type JsxElement<T extends ElementType, P> = T extends ${componentName}<infer A, infer B>
|
|
3059
3194
|
? ${componentName}<A, Pretty<DistributiveUnion<P, B>>>
|
|
@@ -3074,7 +3209,7 @@ export type JsxElements = {
|
|
|
3074
3209
|
|
|
3075
3210
|
export type ${upperName} = JsxFactory & JsxElements
|
|
3076
3211
|
|
|
3077
|
-
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T
|
|
3212
|
+
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
|
|
3078
3213
|
|
|
3079
3214
|
export type ${variantName}<T extends ${componentName}<any, any>> = T extends ${componentName}<any, infer Props> ? Props : never
|
|
3080
3215
|
`
|
|
@@ -3384,8 +3519,15 @@ export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
|
3384
3519
|
? Props
|
|
3385
3520
|
: never
|
|
3386
3521
|
|
|
3522
|
+
export interface AsProps {
|
|
3523
|
+
/**
|
|
3524
|
+
* The element to render as
|
|
3525
|
+
*/
|
|
3526
|
+
as?: ElementType | undefined
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3387
3529
|
export type ${componentName}<T extends ElementType> = {
|
|
3388
|
-
(args: { raw: readonly string[] | ArrayLike<string> }): FunctionalComponent<ComponentProps<T
|
|
3530
|
+
(args: { raw: readonly string[] | ArrayLike<string> }): FunctionalComponent<ComponentProps<T> & AsProps>
|
|
3389
3531
|
}
|
|
3390
3532
|
|
|
3391
3533
|
export interface JsxFactory {
|
|
@@ -3475,7 +3617,7 @@ import { match as match14 } from "ts-pattern";
|
|
|
3475
3617
|
|
|
3476
3618
|
// src/artifacts/generated/composition.d.ts.json
|
|
3477
3619
|
var composition_d_ts_default = {
|
|
3478
|
-
content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Token<T> {\n value: T\n description?: string\n}\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'font'\n | 'fontFamily'\n | 'fontFeatureSettings'\n | 'fontKerning'\n | 'fontLanguageOverride'\n | 'fontOpticalSizing'\n | 'fontPalette'\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontStretch'\n | 'fontStyle'\n | 'fontSynthesis'\n | 'fontVariant'\n | 'fontVariantAlternates'\n | 'fontVariantCaps'\n | 'fontVariantLigatures'\n | 'fontVariantNumeric'\n | 'fontVariantPosition'\n | 'fontVariationSettings'\n | 'fontWeight'\n | 'hypens'\n | 'hyphenateCharacter'\n | 'hyphenateLimitChars'\n | 'letterSpacing'\n | 'lineBreak'\n | 'lineHeight'\n | 'quotes'\n | 'overflowWrap'\n | 'textCombineUpright'\n | 'textDecoration'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationSkipInk'\n | 'textDecorationStyle'\n | 'textDecorationThickness'\n | 'textEmphasis'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'textIndent'\n | 'textJustify'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n | 'textShadow'\n | 'textTransform'\n | 'textUnderlineOffset'\n | 'textUnderlinePosition'\n | 'textWrap'\n | 'textWrapMode'\n | 'textWrapStyle'\n | 'verticalAlign'\n | 'whiteSpace'\n | 'wordBreak'\n | 'wordSpacing'\n\nexport type TextStyle = CompositionStyleObject<TextStyleProperty>\n\nexport type TextStyles = Recursive<Token<TextStyle>>\n\n/* -----------------------------------------------------------------------------\n * Layer styles\n * -----------------------------------------------------------------------------*/\n\ntype
|
|
3620
|
+
content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Token<T> {\n value: T\n description?: string\n}\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'color'\n | 'direction'\n | 'font'\n | 'fontFamily'\n | 'fontFeatureSettings'\n | 'fontKerning'\n | 'fontLanguageOverride'\n | 'fontOpticalSizing'\n | 'fontPalette'\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontStretch'\n | 'fontStyle'\n | 'fontSynthesis'\n | 'fontVariant'\n | 'fontVariantAlternates'\n | 'fontVariantCaps'\n | 'fontVariantLigatures'\n | 'fontVariantNumeric'\n | 'fontVariantPosition'\n | 'fontVariationSettings'\n | 'fontWeight'\n | 'hangingPunctuation'\n | 'hypens'\n | 'hyphenateCharacter'\n | 'hyphenateLimitChars'\n | 'letterSpacing'\n | 'lineBreak'\n | 'lineHeight'\n | 'quotes'\n | 'overflowWrap'\n | 'tabSize'\n | 'textAlign'\n | 'textAlignLast'\n | 'textCombineUpright'\n | 'textDecoration'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationSkip'\n | 'textDecorationSkipBox'\n | 'textDecorationSkipInk'\n | 'textDecorationSkipInset'\n | 'textDecorationStyle'\n | 'textDecorationThickness'\n | 'textEmphasis'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'textIndent'\n | 'textJustify'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n | 'textShadow'\n | 'textStroke'\n | 'textStrokeColor'\n | 'textStrokeWidth'\n | 'textTransform'\n | 'textUnderlineOffset'\n | 'textUnderlinePosition'\n | 'textWrap'\n | 'textWrapMode'\n | 'textWrapStyle'\n | 'unicodeBidi'\n | 'verticalAlign'\n | 'whiteSpace'\n | 'wordBreak'\n | 'wordSpacing'\n | 'writingMode'\n\nexport type TextStyle = CompositionStyleObject<TextStyleProperty>\n\nexport type TextStyles = Recursive<Token<TextStyle>>\n\n/* -----------------------------------------------------------------------------\n * Layer styles\n * -----------------------------------------------------------------------------*/\n\ntype LogicalPlacement = 'Inline' | 'Block' | 'InlineStart' | 'InlineEnd' | 'BlockStart' | 'BlockEnd'\n\ntype PhysicalPlacement = 'Top' | 'Right' | 'Bottom' | 'Left'\n\ntype Placement = PhysicalPlacement | LogicalPlacement\n\ntype Radius =\n | `Top${'Right' | 'Left'}`\n | `Bottom${'Right' | 'Left'}`\n | `Start${'Start' | 'End'}`\n | `End${'Start' | 'End'}`\n\ntype LayerStyleProperty =\n | 'aspectRatio'\n | 'background'\n | 'backgroundColor'\n | 'backgroundImage'\n | 'border'\n | 'borderColor'\n | 'borderImage'\n | 'borderImageOutset'\n | 'borderImageRepeat'\n | 'borderImageSlice'\n | 'borderImageSource'\n | 'borderImageWidth'\n | 'borderRadius'\n | 'borderStyle'\n | 'borderWidth'\n | `border${Placement}`\n | `border${Placement}Color`\n | `border${Placement}Style`\n | `border${Placement}Width`\n | 'borderRadius'\n | `border${Radius}Radius`\n | 'boxShadow'\n | 'boxShadowColor'\n | 'clipPath'\n | 'color'\n | 'contain'\n | 'content'\n | 'contentVisibility'\n | 'cursor'\n | 'display'\n | 'filter'\n | 'backdropFilter'\n | 'height'\n | 'width'\n | 'minHeight'\n | 'minWidth'\n | 'maxHeight'\n | 'maxWidth'\n | `margin${Placement}`\n | 'inset'\n | `inset${LogicalPlacement}`\n | Lowercase<PhysicalPlacement>\n | 'isolation'\n | 'mask'\n | 'maskClip'\n | 'maskComposite'\n | 'maskImage'\n | 'maskMode'\n | 'maskOrigin'\n | 'maskPosition'\n | 'maskRepeat'\n | 'maskSize'\n | 'mixBlendMode'\n | 'objectFit'\n | 'objectPosition'\n | 'opacity'\n | 'outline'\n | 'outlineColor'\n | 'outlineOffset'\n | 'outlineStyle'\n | 'outlineWidth'\n | 'overflow'\n | 'overflowX'\n | 'overflowY'\n | 'padding'\n | `padding${Placement}`\n | 'pointerEvents'\n | 'position'\n | 'resize'\n | 'transform'\n | 'transition'\n | 'visibility'\n | 'willChange'\n | 'zIndex'\n | 'backgroundBlendMode'\n | 'backgroundAttachment'\n | 'backgroundClip'\n | 'backgroundOrigin'\n | 'backgroundPosition'\n | 'backgroundRepeat'\n | 'backgroundSize'\n\nexport type LayerStyle = CompositionStyleObject<LayerStyleProperty>\n\nexport type LayerStyles = Recursive<Token<LayerStyle>>\n\n/* -----------------------------------------------------------------------------\n * Motion styles\n * -----------------------------------------------------------------------------*/\n\ntype AnimationStyleProperty =\n | 'animation'\n | 'animationComposition'\n | 'animationDelay'\n | 'animationDirection'\n | 'animationDuration'\n | 'animationFillMode'\n | 'animationIterationCount'\n | 'animationName'\n | 'animationPlayState'\n | 'animationTimingFunction'\n | 'animationRange'\n | 'animationRangeStart'\n | 'animationRangeEnd'\n | 'animationTimeline'\n | 'transformOrigin'\n\nexport type AnimationStyle = CompositionStyleObject<AnimationStyleProperty>\n\nexport type AnimationStyles = Recursive<Token<AnimationStyle>>\n\nexport interface CompositionStyles {\n textStyles: TextStyles\n layerStyles: LayerStyles\n animationStyles: AnimationStyles\n}\n"
|
|
3479
3621
|
};
|
|
3480
3622
|
|
|
3481
3623
|
// src/artifacts/generated/csstype.d.ts.json
|
|
@@ -5200,7 +5342,7 @@ var generateParserCss = (ctx, decoder) => {
|
|
|
5200
5342
|
};
|
|
5201
5343
|
|
|
5202
5344
|
// src/artifacts/css/reset-css.ts
|
|
5203
|
-
import "@pandacss/core";
|
|
5345
|
+
import { extractTrailingPseudos } from "@pandacss/core";
|
|
5204
5346
|
import { isObject, mapEntries } from "@pandacss/shared";
|
|
5205
5347
|
function generateResetCss(ctx, sheet) {
|
|
5206
5348
|
const { preflight } = ctx.config;
|
|
@@ -5271,6 +5413,9 @@ function generateResetCss(ctx, sheet) {
|
|
|
5271
5413
|
"--placeholder-fallback": "color-mix(in oklab, currentcolor 50%, transparent)"
|
|
5272
5414
|
}
|
|
5273
5415
|
},
|
|
5416
|
+
"::selection": {
|
|
5417
|
+
backgroundColor: "var(--global-color-selection, rgba(0, 115, 255, 0.3))"
|
|
5418
|
+
},
|
|
5274
5419
|
textarea: {
|
|
5275
5420
|
resize: "vertical"
|
|
5276
5421
|
},
|
|
@@ -5350,7 +5495,15 @@ function generateResetCss(ctx, sheet) {
|
|
|
5350
5495
|
}
|
|
5351
5496
|
};
|
|
5352
5497
|
if (level === "element") {
|
|
5353
|
-
const modified = mapEntries(scoped, (k, v) =>
|
|
5498
|
+
const modified = mapEntries(scoped, (k, v) => {
|
|
5499
|
+
const [trailingPseudo, rebuiltSelector] = extractTrailingPseudos(k.toString());
|
|
5500
|
+
if (trailingPseudo) {
|
|
5501
|
+
const scopeClass = selector.replace("&", "");
|
|
5502
|
+
const newSelector = rebuiltSelector ? `${scopeClass} ${rebuiltSelector}${trailingPseudo}` : `${scopeClass} ${trailingPseudo}`;
|
|
5503
|
+
return [newSelector, v];
|
|
5504
|
+
}
|
|
5505
|
+
return [k, { [selector]: v }];
|
|
5506
|
+
});
|
|
5354
5507
|
Object.assign(reset, modified);
|
|
5355
5508
|
} else if (selector) {
|
|
5356
5509
|
reset[selector] = scoped;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"pluralize": "8.0.0",
|
|
38
38
|
"postcss": "8.4.49",
|
|
39
39
|
"ts-pattern": "5.8.0",
|
|
40
|
-
"@pandacss/core": "1.
|
|
41
|
-
"@pandacss/is-valid-prop": "^1.
|
|
42
|
-
"@pandacss/logger": "1.
|
|
43
|
-
"@pandacss/shared": "1.
|
|
44
|
-
"@pandacss/token-dictionary": "1.
|
|
45
|
-
"@pandacss/types": "1.
|
|
40
|
+
"@pandacss/core": "1.3.0",
|
|
41
|
+
"@pandacss/is-valid-prop": "^1.3.0",
|
|
42
|
+
"@pandacss/logger": "1.3.0",
|
|
43
|
+
"@pandacss/shared": "1.3.0",
|
|
44
|
+
"@pandacss/token-dictionary": "1.3.0",
|
|
45
|
+
"@pandacss/types": "1.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/pluralize": "0.0.33"
|