@pandacss/generator 0.15.1 → 0.15.2
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.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +53 -49
- package/dist/index.mjs +53 -49
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as _pandacss_types_dist_shared from '@pandacss/types/dist/shared';
|
|
2
1
|
import * as _pandacss_core from '@pandacss/core';
|
|
3
2
|
import * as _pandacss_token_dictionary from '@pandacss/token-dictionary';
|
|
4
3
|
import * as _pandacss_types from '@pandacss/types';
|
|
5
4
|
import { ConfigResultWithHooks, TSConfig } from '@pandacss/types';
|
|
5
|
+
import * as _pandacss_types_dist_pattern from '@pandacss/types/dist/pattern';
|
|
6
6
|
|
|
7
7
|
declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
8
8
|
patterns: {
|
|
9
|
-
getConfig: (name: string) => _pandacss_types.PatternConfig
|
|
9
|
+
getConfig: (name: string) => _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
10
10
|
transform: (name: string, data: _pandacss_types.Dict) => _pandacss_types.SystemStyleObject;
|
|
11
11
|
getNames: (name: string) => {
|
|
12
12
|
upperName: string;
|
|
@@ -18,7 +18,7 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
18
18
|
details: {
|
|
19
19
|
props: string[];
|
|
20
20
|
blocklistType: string;
|
|
21
|
-
config: _pandacss_types.PatternConfig
|
|
21
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
22
22
|
type: "pattern";
|
|
23
23
|
match: RegExp;
|
|
24
24
|
jsx: (string | RegExp)[];
|
|
@@ -32,7 +32,7 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
32
32
|
filter: (jsxName: string) => {
|
|
33
33
|
props: string[];
|
|
34
34
|
blocklistType: string;
|
|
35
|
-
config: _pandacss_types.PatternConfig
|
|
35
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
36
36
|
type: "pattern";
|
|
37
37
|
match: RegExp;
|
|
38
38
|
jsx: (string | RegExp)[];
|
|
@@ -106,7 +106,7 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
106
106
|
layerNames: string[];
|
|
107
107
|
hooks: _pandacss_types.PandaHookable;
|
|
108
108
|
path: string;
|
|
109
|
-
config:
|
|
109
|
+
config: _pandacss_types.UserConfig;
|
|
110
110
|
tsconfig?: TSConfig | undefined;
|
|
111
111
|
tsOptions?: _pandacss_types.ConfigTsOptions | undefined;
|
|
112
112
|
tsconfigFile?: string | undefined;
|
|
@@ -187,7 +187,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
187
187
|
nodes: ({
|
|
188
188
|
props: string[];
|
|
189
189
|
blocklistType: string;
|
|
190
|
-
config: _pandacss_types.PatternConfig
|
|
190
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
191
191
|
type: "pattern";
|
|
192
192
|
match: RegExp;
|
|
193
193
|
jsx: (string | RegExp)[];
|
|
@@ -206,7 +206,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
206
206
|
dashName: string;
|
|
207
207
|
jsxName: string;
|
|
208
208
|
match: RegExp;
|
|
209
|
-
config: _pandacss_types.RecipeConfig | _pandacss_types.SlotRecipeConfig;
|
|
209
|
+
config: _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord> | _pandacss_types.SlotRecipeConfig;
|
|
210
210
|
splitProps: (props: _pandacss_types.Dict) => [_pandacss_types.Dict, _pandacss_types.Dict];
|
|
211
211
|
props: string[];
|
|
212
212
|
})[];
|
|
@@ -221,14 +221,14 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
221
221
|
dashName: string;
|
|
222
222
|
jsxName: string;
|
|
223
223
|
match: RegExp;
|
|
224
|
-
config: _pandacss_types.RecipeConfig | _pandacss_types.SlotRecipeConfig;
|
|
224
|
+
config: _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord> | _pandacss_types.SlotRecipeConfig;
|
|
225
225
|
splitProps: (props: _pandacss_types.Dict) => [_pandacss_types.Dict, _pandacss_types.Dict];
|
|
226
226
|
props: string[];
|
|
227
227
|
}[];
|
|
228
228
|
getPatternsByJsxName: (jsxName: string) => {
|
|
229
229
|
props: string[];
|
|
230
230
|
blocklistType: string;
|
|
231
|
-
config: _pandacss_types.PatternConfig
|
|
231
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
232
232
|
type: "pattern";
|
|
233
233
|
match: RegExp;
|
|
234
234
|
jsx: (string | RegExp)[];
|
|
@@ -242,7 +242,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
242
242
|
tsOptions: _pandacss_types.ConfigTsOptions | undefined;
|
|
243
243
|
};
|
|
244
244
|
patterns: {
|
|
245
|
-
getConfig: (name: string) => _pandacss_types.PatternConfig
|
|
245
|
+
getConfig: (name: string) => _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
246
246
|
transform: (name: string, data: _pandacss_types.Dict) => _pandacss_types.SystemStyleObject;
|
|
247
247
|
getNames: (name: string) => {
|
|
248
248
|
upperName: string;
|
|
@@ -254,7 +254,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
254
254
|
details: {
|
|
255
255
|
props: string[];
|
|
256
256
|
blocklistType: string;
|
|
257
|
-
config: _pandacss_types.PatternConfig
|
|
257
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
258
258
|
type: "pattern";
|
|
259
259
|
match: RegExp;
|
|
260
260
|
jsx: (string | RegExp)[];
|
|
@@ -268,7 +268,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
268
268
|
filter: (jsxName: string) => {
|
|
269
269
|
props: string[];
|
|
270
270
|
blocklistType: string;
|
|
271
|
-
config: _pandacss_types.PatternConfig
|
|
271
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
272
272
|
type: "pattern";
|
|
273
273
|
match: RegExp;
|
|
274
274
|
jsx: (string | RegExp)[];
|
|
@@ -342,7 +342,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
342
342
|
layerNames: string[];
|
|
343
343
|
hooks: _pandacss_types.PandaHookable;
|
|
344
344
|
path: string;
|
|
345
|
-
config:
|
|
345
|
+
config: _pandacss_types.UserConfig;
|
|
346
346
|
tsconfig?: TSConfig | undefined;
|
|
347
347
|
tsOptions?: _pandacss_types.ConfigTsOptions | undefined;
|
|
348
348
|
tsconfigFile?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as _pandacss_types_dist_shared from '@pandacss/types/dist/shared';
|
|
2
1
|
import * as _pandacss_core from '@pandacss/core';
|
|
3
2
|
import * as _pandacss_token_dictionary from '@pandacss/token-dictionary';
|
|
4
3
|
import * as _pandacss_types from '@pandacss/types';
|
|
5
4
|
import { ConfigResultWithHooks, TSConfig } from '@pandacss/types';
|
|
5
|
+
import * as _pandacss_types_dist_pattern from '@pandacss/types/dist/pattern';
|
|
6
6
|
|
|
7
7
|
declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
8
8
|
patterns: {
|
|
9
|
-
getConfig: (name: string) => _pandacss_types.PatternConfig
|
|
9
|
+
getConfig: (name: string) => _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
10
10
|
transform: (name: string, data: _pandacss_types.Dict) => _pandacss_types.SystemStyleObject;
|
|
11
11
|
getNames: (name: string) => {
|
|
12
12
|
upperName: string;
|
|
@@ -18,7 +18,7 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
18
18
|
details: {
|
|
19
19
|
props: string[];
|
|
20
20
|
blocklistType: string;
|
|
21
|
-
config: _pandacss_types.PatternConfig
|
|
21
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
22
22
|
type: "pattern";
|
|
23
23
|
match: RegExp;
|
|
24
24
|
jsx: (string | RegExp)[];
|
|
@@ -32,7 +32,7 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
32
32
|
filter: (jsxName: string) => {
|
|
33
33
|
props: string[];
|
|
34
34
|
blocklistType: string;
|
|
35
|
-
config: _pandacss_types.PatternConfig
|
|
35
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
36
36
|
type: "pattern";
|
|
37
37
|
match: RegExp;
|
|
38
38
|
jsx: (string | RegExp)[];
|
|
@@ -106,7 +106,7 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
106
106
|
layerNames: string[];
|
|
107
107
|
hooks: _pandacss_types.PandaHookable;
|
|
108
108
|
path: string;
|
|
109
|
-
config:
|
|
109
|
+
config: _pandacss_types.UserConfig;
|
|
110
110
|
tsconfig?: TSConfig | undefined;
|
|
111
111
|
tsOptions?: _pandacss_types.ConfigTsOptions | undefined;
|
|
112
112
|
tsconfigFile?: string | undefined;
|
|
@@ -187,7 +187,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
187
187
|
nodes: ({
|
|
188
188
|
props: string[];
|
|
189
189
|
blocklistType: string;
|
|
190
|
-
config: _pandacss_types.PatternConfig
|
|
190
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
191
191
|
type: "pattern";
|
|
192
192
|
match: RegExp;
|
|
193
193
|
jsx: (string | RegExp)[];
|
|
@@ -206,7 +206,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
206
206
|
dashName: string;
|
|
207
207
|
jsxName: string;
|
|
208
208
|
match: RegExp;
|
|
209
|
-
config: _pandacss_types.RecipeConfig | _pandacss_types.SlotRecipeConfig;
|
|
209
|
+
config: _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord> | _pandacss_types.SlotRecipeConfig;
|
|
210
210
|
splitProps: (props: _pandacss_types.Dict) => [_pandacss_types.Dict, _pandacss_types.Dict];
|
|
211
211
|
props: string[];
|
|
212
212
|
})[];
|
|
@@ -221,14 +221,14 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
221
221
|
dashName: string;
|
|
222
222
|
jsxName: string;
|
|
223
223
|
match: RegExp;
|
|
224
|
-
config: _pandacss_types.RecipeConfig | _pandacss_types.SlotRecipeConfig;
|
|
224
|
+
config: _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord> | _pandacss_types.SlotRecipeConfig;
|
|
225
225
|
splitProps: (props: _pandacss_types.Dict) => [_pandacss_types.Dict, _pandacss_types.Dict];
|
|
226
226
|
props: string[];
|
|
227
227
|
}[];
|
|
228
228
|
getPatternsByJsxName: (jsxName: string) => {
|
|
229
229
|
props: string[];
|
|
230
230
|
blocklistType: string;
|
|
231
|
-
config: _pandacss_types.PatternConfig
|
|
231
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
232
232
|
type: "pattern";
|
|
233
233
|
match: RegExp;
|
|
234
234
|
jsx: (string | RegExp)[];
|
|
@@ -242,7 +242,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
242
242
|
tsOptions: _pandacss_types.ConfigTsOptions | undefined;
|
|
243
243
|
};
|
|
244
244
|
patterns: {
|
|
245
|
-
getConfig: (name: string) => _pandacss_types.PatternConfig
|
|
245
|
+
getConfig: (name: string) => _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
246
246
|
transform: (name: string, data: _pandacss_types.Dict) => _pandacss_types.SystemStyleObject;
|
|
247
247
|
getNames: (name: string) => {
|
|
248
248
|
upperName: string;
|
|
@@ -254,7 +254,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
254
254
|
details: {
|
|
255
255
|
props: string[];
|
|
256
256
|
blocklistType: string;
|
|
257
|
-
config: _pandacss_types.PatternConfig
|
|
257
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
258
258
|
type: "pattern";
|
|
259
259
|
match: RegExp;
|
|
260
260
|
jsx: (string | RegExp)[];
|
|
@@ -268,7 +268,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
268
268
|
filter: (jsxName: string) => {
|
|
269
269
|
props: string[];
|
|
270
270
|
blocklistType: string;
|
|
271
|
-
config: _pandacss_types.PatternConfig
|
|
271
|
+
config: _pandacss_types.PatternConfig<_pandacss_types_dist_pattern.PatternProperties>;
|
|
272
272
|
type: "pattern";
|
|
273
273
|
match: RegExp;
|
|
274
274
|
jsx: (string | RegExp)[];
|
|
@@ -342,7 +342,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
342
342
|
layerNames: string[];
|
|
343
343
|
hooks: _pandacss_types.PandaHookable;
|
|
344
344
|
path: string;
|
|
345
|
-
config:
|
|
345
|
+
config: _pandacss_types.UserConfig;
|
|
346
346
|
tsconfig?: TSConfig | undefined;
|
|
347
347
|
tsOptions?: _pandacss_types.ConfigTsOptions | undefined;
|
|
348
348
|
tsconfigFile?: string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -572,9 +572,11 @@ function generateConditions(ctx) {
|
|
|
572
572
|
dts: import_outdent2.default`
|
|
573
573
|
${ctx.file.importType("AnySelector, Selectors", "./selectors")}
|
|
574
574
|
|
|
575
|
-
export
|
|
575
|
+
export interface Conditions {
|
|
576
576
|
${keys.map(
|
|
577
|
-
(key) => ` ${key === "base" ? `/** The base (=no conditions) styles to apply
|
|
577
|
+
(key) => ` ${key === "base" ? `/** The base (=no conditions) styles to apply */
|
|
578
|
+
` : ctx.conditions.get(key) ? `/** \`${ctx.conditions.get(key)}\` */
|
|
579
|
+
` : ""} ${JSON.stringify(key)}: string`
|
|
578
580
|
).join("\n")}
|
|
579
581
|
}
|
|
580
582
|
|
|
@@ -979,7 +981,7 @@ function generatePattern(ctx) {
|
|
|
979
981
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
980
982
|
${ctx.file.importType("Tokens", "../tokens/index")}
|
|
981
983
|
|
|
982
|
-
export
|
|
984
|
+
export interface ${upperName}Properties {
|
|
983
985
|
${Object.keys(properties ?? {}).map((key) => {
|
|
984
986
|
const value = properties[key];
|
|
985
987
|
return (0, import_ts_pattern2.match)(value).with({ type: "property" }, (value2) => {
|
|
@@ -999,7 +1001,7 @@ function generatePattern(ctx) {
|
|
|
999
1001
|
|
|
1000
1002
|
${strict ? import_outdent10.outdent`export declare function ${baseName}(styles: ${upperName}Properties): string` : import_outdent10.outdent`
|
|
1001
1003
|
|
|
1002
|
-
|
|
1004
|
+
interface ${upperName}Styles extends ${upperName}Properties, DistributiveOmit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1003
1005
|
|
|
1004
1006
|
interface ${upperName}PatternFn {
|
|
1005
1007
|
(styles?: ${upperName}Styles): string
|
|
@@ -1148,7 +1150,7 @@ function generateRecipes(ctx) {
|
|
|
1148
1150
|
${ctx.file.importType("Pretty", "../types/helpers")}
|
|
1149
1151
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
1150
1152
|
|
|
1151
|
-
|
|
1153
|
+
interface ${upperName}Variant {
|
|
1152
1154
|
${Object.keys(variantKeyMap).map((key) => {
|
|
1153
1155
|
const values = variantKeyMap[key];
|
|
1154
1156
|
if (values.every(isBooleanValue))
|
|
@@ -1165,7 +1167,7 @@ function generateRecipes(ctx) {
|
|
|
1165
1167
|
[key in keyof ${upperName}Variant]?: ${compoundVariants?.length ? `${upperName}Variant[key]` : `ConditionalValue<${upperName}Variant[key]>`}
|
|
1166
1168
|
}
|
|
1167
1169
|
|
|
1168
|
-
interface ${upperName}Recipe {
|
|
1170
|
+
export interface ${upperName}Recipe {
|
|
1169
1171
|
__type: ${upperName}VariantProps
|
|
1170
1172
|
(props?: ${upperName}VariantProps): ${(0, import_core4.isSlotRecipe)(config) ? `Pretty<Record<${(0, import_shared2.unionType)(config.slots)}, string>>` : "string"}
|
|
1171
1173
|
raw: (props?: ${upperName}VariantProps) => ${upperName}VariantProps
|
|
@@ -1379,7 +1381,7 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1379
1381
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
1380
1382
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
1381
1383
|
|
|
1382
|
-
export
|
|
1384
|
+
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1383
1385
|
|
|
1384
1386
|
${description ? `/** ${description} */` : ""}
|
|
1385
1387
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
@@ -1406,12 +1408,12 @@ type ElementType = keyof JSX.IntrinsicElements
|
|
|
1406
1408
|
|
|
1407
1409
|
type Dict = Record<string, unknown>
|
|
1408
1410
|
|
|
1409
|
-
export
|
|
1411
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
1410
1412
|
(props: JsxHTMLProps<ComponentProps<T>, P> & JsxStyleProps): JSX.Element
|
|
1411
1413
|
displayName?: string
|
|
1412
1414
|
}
|
|
1413
1415
|
|
|
1414
|
-
|
|
1416
|
+
interface RecipeFn = { __type: any }
|
|
1415
1417
|
|
|
1416
1418
|
interface JsxFactory {
|
|
1417
1419
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -1599,7 +1601,7 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1599
1601
|
import { h } from '@builder.io/qwik'
|
|
1600
1602
|
${ctx.file.import(factoryName, "./factory")}
|
|
1601
1603
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
1602
|
-
|
|
1604
|
+
|
|
1603
1605
|
export const ${jsxName} = function ${jsxName}(props) {
|
|
1604
1606
|
${(0, import_ts_pattern5.match)(props.length).with(
|
|
1605
1607
|
0,
|
|
@@ -1622,8 +1624,8 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1622
1624
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
1623
1625
|
${ctx.file.importType("Assign, DistributiveOmit", "../types/system-types")}
|
|
1624
1626
|
|
|
1625
|
-
export
|
|
1626
|
-
|
|
1627
|
+
export interface ${upperName}Props extends Assign<${typeName}<'${jsxElement}'>, DistributiveOmit<${upperName}Properties, ${blocklistType || '""'}>> {}
|
|
1628
|
+
|
|
1627
1629
|
${description ? `/** ${description} */` : ""}
|
|
1628
1630
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
1629
1631
|
`
|
|
@@ -1647,7 +1649,7 @@ import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './r
|
|
|
1647
1649
|
|
|
1648
1650
|
type ElementType = keyof QwikIntrinsicElements | Component<any>
|
|
1649
1651
|
|
|
1650
|
-
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1652
|
+
export type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1651
1653
|
? QwikIntrinsicElements[T]
|
|
1652
1654
|
: T extends Component<infer P>
|
|
1653
1655
|
? P
|
|
@@ -1655,9 +1657,9 @@ type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElemen
|
|
|
1655
1657
|
|
|
1656
1658
|
type Dict = Record<string, unknown>
|
|
1657
1659
|
|
|
1658
|
-
export
|
|
1660
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> extends Component<Assign<ComponentProps<T>, PatchedHTMLProps, Assign<JsxStyleProps, P>>> {}
|
|
1659
1661
|
|
|
1660
|
-
|
|
1662
|
+
interface RecipeFn { __type: any }
|
|
1661
1663
|
|
|
1662
1664
|
interface JsxFactory {
|
|
1663
1665
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -1741,7 +1743,7 @@ import type { Component, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
|
1741
1743
|
|
|
1742
1744
|
type ElementType = keyof QwikIntrinsicElements | Component<any>
|
|
1743
1745
|
|
|
1744
|
-
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1746
|
+
export type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1745
1747
|
? QwikIntrinsicElements[T]
|
|
1746
1748
|
: T extends Component<infer P>
|
|
1747
1749
|
? P
|
|
@@ -1909,7 +1911,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1909
1911
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
1910
1912
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
1911
1913
|
|
|
1912
|
-
export
|
|
1914
|
+
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1913
1915
|
|
|
1914
1916
|
${description ? `/** ${description} */` : ""}
|
|
1915
1917
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
@@ -1934,16 +1936,16 @@ ${ctx.file.importType("RecipeDefinition, RecipeSelection, RecipeVariantRecord",
|
|
|
1934
1936
|
|
|
1935
1937
|
type Dict = Record<string, unknown>
|
|
1936
1938
|
|
|
1937
|
-
type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1939
|
+
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1938
1940
|
ref?: Ref<ElementRef<T>>
|
|
1939
1941
|
}
|
|
1940
1942
|
|
|
1941
|
-
export
|
|
1943
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
1942
1944
|
(props: JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>): JSX.Element
|
|
1943
1945
|
displayName?: string
|
|
1944
1946
|
}
|
|
1945
1947
|
|
|
1946
|
-
|
|
1948
|
+
interface RecipeFn { __type: any }
|
|
1947
1949
|
|
|
1948
1950
|
interface JsxFactory {
|
|
1949
1951
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -2029,7 +2031,7 @@ ${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
|
2029
2031
|
|
|
2030
2032
|
type Dict = Record<string, unknown>
|
|
2031
2033
|
|
|
2032
|
-
type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
2034
|
+
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
2033
2035
|
ref?: Ref<ElementRef<T>>
|
|
2034
2036
|
}
|
|
2035
2037
|
|
|
@@ -2170,7 +2172,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
2170
2172
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
2171
2173
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
2172
2174
|
|
|
2173
|
-
export
|
|
2175
|
+
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
2174
2176
|
|
|
2175
2177
|
${description ? `/** ${description} */` : ""}
|
|
2176
2178
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
@@ -2197,12 +2199,12 @@ type Dict = Record<string, unknown>
|
|
|
2197
2199
|
|
|
2198
2200
|
type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
|
|
2199
2201
|
|
|
2200
|
-
export
|
|
2202
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
2201
2203
|
(props: JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>): JSX.Element
|
|
2202
2204
|
displayName?: string
|
|
2203
2205
|
}
|
|
2204
2206
|
|
|
2205
|
-
|
|
2207
|
+
interface RecipeFn { __type: any }
|
|
2206
2208
|
|
|
2207
2209
|
interface JsxFactory {
|
|
2208
2210
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -2481,7 +2483,7 @@ function generateVueJsxPattern(ctx) {
|
|
|
2481
2483
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
2482
2484
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
2483
2485
|
|
|
2484
|
-
export
|
|
2486
|
+
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
2485
2487
|
|
|
2486
2488
|
${description ? `/** ${description} */` : ""}
|
|
2487
2489
|
export declare const ${jsxName}: FunctionalComponent<${upperName}Props>
|
|
@@ -2509,17 +2511,17 @@ ${ctx.file.importType("Assign, JsxStyleProps, JsxHTMLProps", "./system-types")}
|
|
|
2509
2511
|
type IntrinsicElement = keyof NativeElements
|
|
2510
2512
|
type ElementType = IntrinsicElement | Component
|
|
2511
2513
|
|
|
2512
|
-
type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2514
|
+
export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2513
2515
|
? NativeElements[T]
|
|
2514
2516
|
: T extends Component<infer Props>
|
|
2515
2517
|
? Props
|
|
2516
2518
|
: never
|
|
2517
2519
|
|
|
2518
|
-
|
|
2520
|
+
interface ${componentName}<T extends ElementType, P extends Dict = {}> extends FunctionalComponent<
|
|
2519
2521
|
JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
2520
|
-
>
|
|
2522
|
+
> {}
|
|
2521
2523
|
|
|
2522
|
-
|
|
2524
|
+
interface RecipeFn = { __type: any }
|
|
2523
2525
|
|
|
2524
2526
|
interface JsxFactory {
|
|
2525
2527
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -2555,7 +2557,7 @@ import type { Component, FunctionalComponent, NativeElements } from 'vue'
|
|
|
2555
2557
|
type IntrinsicElement = keyof NativeElements
|
|
2556
2558
|
type ElementType = IntrinsicElement | Component
|
|
2557
2559
|
|
|
2558
|
-
type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2560
|
+
export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2559
2561
|
? NativeElements[T]
|
|
2560
2562
|
: T extends Component<infer Props>
|
|
2561
2563
|
? Props
|
|
@@ -2685,27 +2687,27 @@ var csstype_d_ts_default = {
|
|
|
2685
2687
|
|
|
2686
2688
|
// src/artifacts/generated/system-types.d.ts.json
|
|
2687
2689
|
var system_types_d_ts_default = {
|
|
2688
|
-
content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport
|
|
2690
|
+
content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport interface CssProperties extends PropertiesFallback<String | Number>, CssVarProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ntype MinimalNested<P> = {\n [K in keyof Conditions]?: Nested<P>\n}\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<SystemProperties & CssVarProperties>\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<{\n [K in Property]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject\n}\ntype StyleProps = SystemProperties & MinimalNested<SystemStyleObject>\n\nexport type JsxStyleProps = StyleProps & WithCss\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
2689
2691
|
};
|
|
2690
2692
|
|
|
2691
2693
|
// src/artifacts/generated/composition.d.ts.json
|
|
2692
2694
|
var composition_d_ts_default = {
|
|
2693
|
-
content: "import type { CompositionStyleObject } from './system-types'\n\
|
|
2695
|
+
content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\n}\n\nexport interface Token<Value = any> {\n value: Value\n description?: string\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontVariationSettings'\n | 'fontVariantPosition'\n | 'fontVariantCaps'\n | 'fontVariantNumeric'\n | 'fontVariantAlternates'\n | 'fontVariantLigatures'\n | 'fontFamily'\n | 'fontWeight'\n | 'fontSynthesis'\n | 'fontStyle'\n | 'fontVariant'\n | 'lineHeight'\n | 'letterSpacing'\n | 'textDecoration'\n | 'textTransform'\n | 'textIndent'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationStyle'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'hyphenateCharacter'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n\nexport type TextStyle = CompositionStyleObject<TextStyleProperty>\n\nexport type TextStyles = Recursive<Token<TextStyle>>\n\n/* -----------------------------------------------------------------------------\n * Layer styles\n * -----------------------------------------------------------------------------*/\n\ntype Placement =\n | 'Top'\n | 'Right'\n | 'Bottom'\n | 'Left'\n | 'Inline'\n | 'Block'\n | 'InlineStart'\n | 'InlineEnd'\n | 'BlockStart'\n | 'BlockEnd'\n\ntype Radius =\n | `Top${'Right' | 'Left'}`\n | `Bottom${'Right' | 'Left'}`\n | `Start${'Start' | 'End'}`\n | `End${'Start' | 'End'}`\n\ntype LayerStyleProperty =\n | 'background'\n | 'backgroundColor'\n | 'backgroundImage'\n | 'borderRadius'\n | 'border'\n | 'borderWidth'\n | 'borderColor'\n | 'borderStyle'\n | 'boxShadow'\n | 'filter'\n | 'backdropFilter'\n | 'transform'\n | 'color'\n | 'opacity'\n | 'backgroundBlendMode'\n | 'backgroundAttachment'\n | 'backgroundClip'\n | 'backgroundOrigin'\n | 'backgroundPosition'\n | 'backgroundRepeat'\n | 'backgroundSize'\n | `border${Placement}`\n | `border${Placement}Width`\n | 'borderRadius'\n | `border${Radius}Radius`\n | `border${Placement}Color`\n | `border${Placement}Style`\n | 'padding'\n | `padding${Placement}`\n\nexport type LayerStyle = CompositionStyleObject<LayerStyleProperty>\n\nexport type LayerStyles = Recursive<Token<LayerStyle>>\n\nexport interface CompositionStyles {\n textStyles: TextStyles\n layerStyles: LayerStyles\n}\n"
|
|
2694
2696
|
};
|
|
2695
2697
|
|
|
2696
2698
|
// src/artifacts/generated/recipe.d.ts.json
|
|
2697
2699
|
var recipe_d_ts_default = {
|
|
2698
|
-
content: "import type { SystemStyleObject, DistributiveOmit } from './system-types'\n\ntype Pretty<T> = { [K in keyof T]: T[K] } & {}\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport
|
|
2700
|
+
content: "import type { SystemStyleObject, DistributiveOmit } from './system-types'\n\ntype Pretty<T> = { [K in keyof T]: T[K] } & {}\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n raw: (props?: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\nexport type RecipeCompoundSelection<T extends RecipeVariantRecord> = {\n [K in keyof T]?: StringToBoolean<keyof T[K]> | Array<StringToBoolean<keyof T[K]>>\n}\n\nexport type RecipeCompoundVariant<T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition<T extends RecipeVariantRecord> {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | RecipeVariantRecord\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Array<RecipeCompoundVariant<T>>\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\ninterface RecipeConfigMeta {\n /**\n * The name of the recipe.\n */\n className: string\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The jsx elements to track for this recipe. Can be string or Regexp.\n *\n * @default capitalize(recipe.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n}\n\nexport interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>\n extends RecipeDefinition<T>,\n RecipeConfigMeta {}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Slot\n * -----------------------------------------------------------------------------*/\n\ntype SlotRecord<S extends string, T> = Partial<Record<S, T>>\n\nexport type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>\n\nexport type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (\n props?: RecipeSelection<T>,\n) => SlotRecord<S, string>\n\nexport interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>>\n extends SlotRecipeVariantFn<S, T> {\n raw: (props?: RecipeSelection<T>) => Record<S, SystemStyleObject>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<Omit<Props, keyof T>>]\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVariantRecord<S>> {\n /**\n * The parts/slots of the recipe.\n */\n slots: S[] | Readonly<S[]>\n /**\n * The base styles of the recipe.\n */\n base?: SlotRecord<S, SystemStyleObject>\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | SlotRecipeVariantRecord<S>\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Array<SlotRecipeCompoundVariant<S, T>>\n}\n\nexport type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(\n config: SlotRecipeDefinition<S, T>,\n) => SlotRecipeRuntimeFn<S, T>\n\nexport type SlotRecipeConfig<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> = SlotRecipeDefinition<S, T> & RecipeConfigMeta\n"
|
|
2699
2701
|
};
|
|
2700
2702
|
|
|
2701
2703
|
// src/artifacts/generated/pattern.d.ts.json
|
|
2702
2704
|
var pattern_d_ts_default = {
|
|
2703
|
-
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport
|
|
2705
|
+
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport interface PatternHelpers {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternProperties = Record<string, PatternProperty>\n\ntype Props<T> = Record<LiteralUnion<keyof T>, any>\n\nexport interface PatternConfig<T extends PatternProperties = PatternProperties> {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties?: T\n /**\n * The css object this pattern will generate.\n */\n transform?: (props: Props<T>, helpers: PatternHelpers) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsxName?: string\n /**\n * The jsx elements to track for this pattern. Can be string or Regexp.\n *\n * @default capitalize(pattern.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n"
|
|
2704
2706
|
};
|
|
2705
2707
|
|
|
2706
2708
|
// src/artifacts/generated/parts.d.ts.json
|
|
2707
2709
|
var parts_d_ts_default = {
|
|
2708
|
-
content: "export
|
|
2710
|
+
content: "export interface Part {\n selector: string\n}\n\nexport type Parts = Record<string, Part>\n"
|
|
2709
2711
|
};
|
|
2710
2712
|
|
|
2711
2713
|
// src/artifacts/generated/selectors.d.ts.json
|
|
@@ -2736,7 +2738,7 @@ var import_outdent39 = require("outdent");
|
|
|
2736
2738
|
var generateTypesEntry = (ctx) => ({
|
|
2737
2739
|
global: import_outdent39.outdent`
|
|
2738
2740
|
// @ts-nocheck
|
|
2739
|
-
import type
|
|
2741
|
+
import type * as Panda from '@pandacss/dev'
|
|
2740
2742
|
${ctx.file.importType("RecipeVariantRecord, RecipeConfig, SlotRecipeVariantRecord, SlotRecipeConfig", "./recipe")}
|
|
2741
2743
|
${ctx.file.importType("Parts", "./parts")}
|
|
2742
2744
|
${ctx.file.importType("PatternConfig, PatternProperties", "./pattern")}
|
|
@@ -2744,23 +2746,25 @@ var generateTypesEntry = (ctx) => ({
|
|
|
2744
2746
|
${ctx.file.importType("CompositionStyles", "./composition")}
|
|
2745
2747
|
|
|
2746
2748
|
declare module '@pandacss/dev' {
|
|
2747
|
-
export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>): RecipeConfig
|
|
2748
|
-
export function defineSlotRecipe<S extends string, V extends SlotRecipeVariantRecord<S>>(config: SlotRecipeConfig<S, V>): SlotRecipeConfig
|
|
2749
|
+
export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>): Panda.RecipeConfig
|
|
2750
|
+
export function defineSlotRecipe<S extends string, V extends SlotRecipeVariantRecord<S>>(config: SlotRecipeConfig<S, V>): Panda.SlotRecipeConfig
|
|
2749
2751
|
export function defineStyles(definition: SystemStyleObject): SystemStyleObject
|
|
2750
|
-
export function defineGlobalStyles(definition: GlobalStyleObject): GlobalStyleObject
|
|
2751
|
-
export function defineTextStyles(definition: CompositionStyles['textStyles']): TextStyles
|
|
2752
|
-
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): LayerStyles
|
|
2753
|
-
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): PatternConfig
|
|
2752
|
+
export function defineGlobalStyles(definition: GlobalStyleObject): Panda.GlobalStyleObject
|
|
2753
|
+
export function defineTextStyles(definition: CompositionStyles['textStyles']): Panda.TextStyles
|
|
2754
|
+
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): Panda.LayerStyles
|
|
2755
|
+
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): Panda.PatternConfig
|
|
2754
2756
|
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>
|
|
2755
2757
|
}
|
|
2756
2758
|
`,
|
|
2757
2759
|
// We need to export types used in the global.d.ts here to avoid TS errors such as `The inferred type of 'xxx' cannot be named without a reference to 'yyy'`
|
|
2758
2760
|
index: import_outdent39.outdent`
|
|
2759
2761
|
import '${ctx.file.extDts("./global")}'
|
|
2760
|
-
${ctx.file.
|
|
2761
|
-
${ctx.file.
|
|
2762
|
-
${ctx.file.
|
|
2763
|
-
${ctx.file.
|
|
2762
|
+
${ctx.file.exportTypeStar("./conditions")}
|
|
2763
|
+
${ctx.file.exportTypeStar("./pattern")}
|
|
2764
|
+
${ctx.file.exportTypeStar("./recipe")}
|
|
2765
|
+
${ctx.file.exportTypeStar("./system-types")}
|
|
2766
|
+
${ctx.file.exportTypeStar("./jsx")}
|
|
2767
|
+
${ctx.file.exportTypeStar("./style-props")}
|
|
2764
2768
|
|
|
2765
2769
|
`,
|
|
2766
2770
|
helpers: import_outdent39.outdent`
|
|
@@ -2782,7 +2786,7 @@ function generatePropTypes(ctx) {
|
|
|
2782
2786
|
${ctx.file.importType("CssProperties", "./system-types")}
|
|
2783
2787
|
${ctx.file.importType("Tokens", "../tokens/index")}
|
|
2784
2788
|
|
|
2785
|
-
|
|
2789
|
+
interface PropertyValueTypes {`
|
|
2786
2790
|
];
|
|
2787
2791
|
const types = utility.getTypes();
|
|
2788
2792
|
for (const [prop, values] of types.entries()) {
|
|
@@ -2794,7 +2798,7 @@ function generatePropTypes(ctx) {
|
|
|
2794
2798
|
|
|
2795
2799
|
type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : CssValue<T>
|
|
2796
2800
|
|
|
2797
|
-
export
|
|
2801
|
+
export interface PropertyTypes extends PropertyValueTypes {
|
|
2798
2802
|
`);
|
|
2799
2803
|
utility.shorthands.forEach((value, key) => {
|
|
2800
2804
|
result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
|
|
@@ -2825,7 +2829,7 @@ function generateStyleProps(ctx) {
|
|
|
2825
2829
|
[key in \`--\${string}\`]?: ConditionalValue<Token | (string & {}) | (number & {})>
|
|
2826
2830
|
}
|
|
2827
2831
|
|
|
2828
|
-
export
|
|
2832
|
+
export interface SystemProperties {
|
|
2829
2833
|
${Array.from(props).map((v) => ` ${v}?: PropertyValue<'${v}'>`).join("\n")}
|
|
2830
2834
|
}
|
|
2831
2835
|
`;
|
package/dist/index.mjs
CHANGED
|
@@ -541,9 +541,11 @@ function generateConditions(ctx) {
|
|
|
541
541
|
dts: outdent2`
|
|
542
542
|
${ctx.file.importType("AnySelector, Selectors", "./selectors")}
|
|
543
543
|
|
|
544
|
-
export
|
|
544
|
+
export interface Conditions {
|
|
545
545
|
${keys.map(
|
|
546
|
-
(key) => ` ${key === "base" ? `/** The base (=no conditions) styles to apply
|
|
546
|
+
(key) => ` ${key === "base" ? `/** The base (=no conditions) styles to apply */
|
|
547
|
+
` : ctx.conditions.get(key) ? `/** \`${ctx.conditions.get(key)}\` */
|
|
548
|
+
` : ""} ${JSON.stringify(key)}: string`
|
|
547
549
|
).join("\n")}
|
|
548
550
|
}
|
|
549
551
|
|
|
@@ -948,7 +950,7 @@ function generatePattern(ctx) {
|
|
|
948
950
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
949
951
|
${ctx.file.importType("Tokens", "../tokens/index")}
|
|
950
952
|
|
|
951
|
-
export
|
|
953
|
+
export interface ${upperName}Properties {
|
|
952
954
|
${Object.keys(properties ?? {}).map((key) => {
|
|
953
955
|
const value = properties[key];
|
|
954
956
|
return match2(value).with({ type: "property" }, (value2) => {
|
|
@@ -968,7 +970,7 @@ function generatePattern(ctx) {
|
|
|
968
970
|
|
|
969
971
|
${strict ? outdent10`export declare function ${baseName}(styles: ${upperName}Properties): string` : outdent10`
|
|
970
972
|
|
|
971
|
-
|
|
973
|
+
interface ${upperName}Styles extends ${upperName}Properties, DistributiveOmit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}> {}
|
|
972
974
|
|
|
973
975
|
interface ${upperName}PatternFn {
|
|
974
976
|
(styles?: ${upperName}Styles): string
|
|
@@ -1117,7 +1119,7 @@ function generateRecipes(ctx) {
|
|
|
1117
1119
|
${ctx.file.importType("Pretty", "../types/helpers")}
|
|
1118
1120
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
1119
1121
|
|
|
1120
|
-
|
|
1122
|
+
interface ${upperName}Variant {
|
|
1121
1123
|
${Object.keys(variantKeyMap).map((key) => {
|
|
1122
1124
|
const values = variantKeyMap[key];
|
|
1123
1125
|
if (values.every(isBooleanValue))
|
|
@@ -1134,7 +1136,7 @@ function generateRecipes(ctx) {
|
|
|
1134
1136
|
[key in keyof ${upperName}Variant]?: ${compoundVariants?.length ? `${upperName}Variant[key]` : `ConditionalValue<${upperName}Variant[key]>`}
|
|
1135
1137
|
}
|
|
1136
1138
|
|
|
1137
|
-
interface ${upperName}Recipe {
|
|
1139
|
+
export interface ${upperName}Recipe {
|
|
1138
1140
|
__type: ${upperName}VariantProps
|
|
1139
1141
|
(props?: ${upperName}VariantProps): ${isSlotRecipe(config) ? `Pretty<Record<${unionType2(config.slots)}, string>>` : "string"}
|
|
1140
1142
|
raw: (props?: ${upperName}VariantProps) => ${upperName}VariantProps
|
|
@@ -1348,7 +1350,7 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1348
1350
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
1349
1351
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
1350
1352
|
|
|
1351
|
-
export
|
|
1353
|
+
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1352
1354
|
|
|
1353
1355
|
${description ? `/** ${description} */` : ""}
|
|
1354
1356
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
@@ -1375,12 +1377,12 @@ type ElementType = keyof JSX.IntrinsicElements
|
|
|
1375
1377
|
|
|
1376
1378
|
type Dict = Record<string, unknown>
|
|
1377
1379
|
|
|
1378
|
-
export
|
|
1380
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
1379
1381
|
(props: JsxHTMLProps<ComponentProps<T>, P> & JsxStyleProps): JSX.Element
|
|
1380
1382
|
displayName?: string
|
|
1381
1383
|
}
|
|
1382
1384
|
|
|
1383
|
-
|
|
1385
|
+
interface RecipeFn = { __type: any }
|
|
1384
1386
|
|
|
1385
1387
|
interface JsxFactory {
|
|
1386
1388
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -1568,7 +1570,7 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1568
1570
|
import { h } from '@builder.io/qwik'
|
|
1569
1571
|
${ctx.file.import(factoryName, "./factory")}
|
|
1570
1572
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
1571
|
-
|
|
1573
|
+
|
|
1572
1574
|
export const ${jsxName} = function ${jsxName}(props) {
|
|
1573
1575
|
${match5(props.length).with(
|
|
1574
1576
|
0,
|
|
@@ -1591,8 +1593,8 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1591
1593
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
1592
1594
|
${ctx.file.importType("Assign, DistributiveOmit", "../types/system-types")}
|
|
1593
1595
|
|
|
1594
|
-
export
|
|
1595
|
-
|
|
1596
|
+
export interface ${upperName}Props extends Assign<${typeName}<'${jsxElement}'>, DistributiveOmit<${upperName}Properties, ${blocklistType || '""'}>> {}
|
|
1597
|
+
|
|
1596
1598
|
${description ? `/** ${description} */` : ""}
|
|
1597
1599
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
1598
1600
|
`
|
|
@@ -1616,7 +1618,7 @@ import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './r
|
|
|
1616
1618
|
|
|
1617
1619
|
type ElementType = keyof QwikIntrinsicElements | Component<any>
|
|
1618
1620
|
|
|
1619
|
-
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1621
|
+
export type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1620
1622
|
? QwikIntrinsicElements[T]
|
|
1621
1623
|
: T extends Component<infer P>
|
|
1622
1624
|
? P
|
|
@@ -1624,9 +1626,9 @@ type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElemen
|
|
|
1624
1626
|
|
|
1625
1627
|
type Dict = Record<string, unknown>
|
|
1626
1628
|
|
|
1627
|
-
export
|
|
1629
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> extends Component<Assign<ComponentProps<T>, PatchedHTMLProps, Assign<JsxStyleProps, P>>> {}
|
|
1628
1630
|
|
|
1629
|
-
|
|
1631
|
+
interface RecipeFn { __type: any }
|
|
1630
1632
|
|
|
1631
1633
|
interface JsxFactory {
|
|
1632
1634
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -1710,7 +1712,7 @@ import type { Component, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
|
1710
1712
|
|
|
1711
1713
|
type ElementType = keyof QwikIntrinsicElements | Component<any>
|
|
1712
1714
|
|
|
1713
|
-
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1715
|
+
export type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1714
1716
|
? QwikIntrinsicElements[T]
|
|
1715
1717
|
: T extends Component<infer P>
|
|
1716
1718
|
? P
|
|
@@ -1878,7 +1880,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1878
1880
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
1879
1881
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
1880
1882
|
|
|
1881
|
-
export
|
|
1883
|
+
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1882
1884
|
|
|
1883
1885
|
${description ? `/** ${description} */` : ""}
|
|
1884
1886
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
@@ -1903,16 +1905,16 @@ ${ctx.file.importType("RecipeDefinition, RecipeSelection, RecipeVariantRecord",
|
|
|
1903
1905
|
|
|
1904
1906
|
type Dict = Record<string, unknown>
|
|
1905
1907
|
|
|
1906
|
-
type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1908
|
+
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1907
1909
|
ref?: Ref<ElementRef<T>>
|
|
1908
1910
|
}
|
|
1909
1911
|
|
|
1910
|
-
export
|
|
1912
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
1911
1913
|
(props: JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>): JSX.Element
|
|
1912
1914
|
displayName?: string
|
|
1913
1915
|
}
|
|
1914
1916
|
|
|
1915
|
-
|
|
1917
|
+
interface RecipeFn { __type: any }
|
|
1916
1918
|
|
|
1917
1919
|
interface JsxFactory {
|
|
1918
1920
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -1998,7 +2000,7 @@ ${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
|
1998
2000
|
|
|
1999
2001
|
type Dict = Record<string, unknown>
|
|
2000
2002
|
|
|
2001
|
-
type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
2003
|
+
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
2002
2004
|
ref?: Ref<ElementRef<T>>
|
|
2003
2005
|
}
|
|
2004
2006
|
|
|
@@ -2139,7 +2141,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
2139
2141
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
2140
2142
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
2141
2143
|
|
|
2142
|
-
export
|
|
2144
|
+
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
2143
2145
|
|
|
2144
2146
|
${description ? `/** ${description} */` : ""}
|
|
2145
2147
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
@@ -2166,12 +2168,12 @@ type Dict = Record<string, unknown>
|
|
|
2166
2168
|
|
|
2167
2169
|
type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
|
|
2168
2170
|
|
|
2169
|
-
export
|
|
2171
|
+
export interface ${componentName}<T extends ElementType, P extends Dict = {}> {
|
|
2170
2172
|
(props: JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>): JSX.Element
|
|
2171
2173
|
displayName?: string
|
|
2172
2174
|
}
|
|
2173
2175
|
|
|
2174
|
-
|
|
2176
|
+
interface RecipeFn { __type: any }
|
|
2175
2177
|
|
|
2176
2178
|
interface JsxFactory {
|
|
2177
2179
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -2450,7 +2452,7 @@ function generateVueJsxPattern(ctx) {
|
|
|
2450
2452
|
${ctx.file.importType(typeName, "../types/jsx")}
|
|
2451
2453
|
${ctx.file.importType("DistributiveOmit", "../types/system-types")}
|
|
2452
2454
|
|
|
2453
|
-
export
|
|
2455
|
+
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
2454
2456
|
|
|
2455
2457
|
${description ? `/** ${description} */` : ""}
|
|
2456
2458
|
export declare const ${jsxName}: FunctionalComponent<${upperName}Props>
|
|
@@ -2478,17 +2480,17 @@ ${ctx.file.importType("Assign, JsxStyleProps, JsxHTMLProps", "./system-types")}
|
|
|
2478
2480
|
type IntrinsicElement = keyof NativeElements
|
|
2479
2481
|
type ElementType = IntrinsicElement | Component
|
|
2480
2482
|
|
|
2481
|
-
type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2483
|
+
export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2482
2484
|
? NativeElements[T]
|
|
2483
2485
|
: T extends Component<infer Props>
|
|
2484
2486
|
? Props
|
|
2485
2487
|
: never
|
|
2486
2488
|
|
|
2487
|
-
|
|
2489
|
+
interface ${componentName}<T extends ElementType, P extends Dict = {}> extends FunctionalComponent<
|
|
2488
2490
|
JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
2489
|
-
>
|
|
2491
|
+
> {}
|
|
2490
2492
|
|
|
2491
|
-
|
|
2493
|
+
interface RecipeFn = { __type: any }
|
|
2492
2494
|
|
|
2493
2495
|
interface JsxFactory {
|
|
2494
2496
|
${styleProps === "none" ? "" : `<T extends ElementType>(component: T): ${componentName}<T, {}>`}
|
|
@@ -2524,7 +2526,7 @@ import type { Component, FunctionalComponent, NativeElements } from 'vue'
|
|
|
2524
2526
|
type IntrinsicElement = keyof NativeElements
|
|
2525
2527
|
type ElementType = IntrinsicElement | Component
|
|
2526
2528
|
|
|
2527
|
-
type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2529
|
+
export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
2528
2530
|
? NativeElements[T]
|
|
2529
2531
|
: T extends Component<infer Props>
|
|
2530
2532
|
? Props
|
|
@@ -2654,27 +2656,27 @@ var csstype_d_ts_default = {
|
|
|
2654
2656
|
|
|
2655
2657
|
// src/artifacts/generated/system-types.d.ts.json
|
|
2656
2658
|
var system_types_d_ts_default = {
|
|
2657
|
-
content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport
|
|
2659
|
+
content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport interface CssProperties extends PropertiesFallback<String | Number>, CssVarProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ntype MinimalNested<P> = {\n [K in keyof Conditions]?: Nested<P>\n}\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<SystemProperties & CssVarProperties>\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<{\n [K in Property]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject\n}\ntype StyleProps = SystemProperties & MinimalNested<SystemStyleObject>\n\nexport type JsxStyleProps = StyleProps & WithCss\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
2658
2660
|
};
|
|
2659
2661
|
|
|
2660
2662
|
// src/artifacts/generated/composition.d.ts.json
|
|
2661
2663
|
var composition_d_ts_default = {
|
|
2662
|
-
content: "import type { CompositionStyleObject } from './system-types'\n\
|
|
2664
|
+
content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\n}\n\nexport interface Token<Value = any> {\n value: Value\n description?: string\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontVariationSettings'\n | 'fontVariantPosition'\n | 'fontVariantCaps'\n | 'fontVariantNumeric'\n | 'fontVariantAlternates'\n | 'fontVariantLigatures'\n | 'fontFamily'\n | 'fontWeight'\n | 'fontSynthesis'\n | 'fontStyle'\n | 'fontVariant'\n | 'lineHeight'\n | 'letterSpacing'\n | 'textDecoration'\n | 'textTransform'\n | 'textIndent'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationStyle'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'hyphenateCharacter'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n\nexport type TextStyle = CompositionStyleObject<TextStyleProperty>\n\nexport type TextStyles = Recursive<Token<TextStyle>>\n\n/* -----------------------------------------------------------------------------\n * Layer styles\n * -----------------------------------------------------------------------------*/\n\ntype Placement =\n | 'Top'\n | 'Right'\n | 'Bottom'\n | 'Left'\n | 'Inline'\n | 'Block'\n | 'InlineStart'\n | 'InlineEnd'\n | 'BlockStart'\n | 'BlockEnd'\n\ntype Radius =\n | `Top${'Right' | 'Left'}`\n | `Bottom${'Right' | 'Left'}`\n | `Start${'Start' | 'End'}`\n | `End${'Start' | 'End'}`\n\ntype LayerStyleProperty =\n | 'background'\n | 'backgroundColor'\n | 'backgroundImage'\n | 'borderRadius'\n | 'border'\n | 'borderWidth'\n | 'borderColor'\n | 'borderStyle'\n | 'boxShadow'\n | 'filter'\n | 'backdropFilter'\n | 'transform'\n | 'color'\n | 'opacity'\n | 'backgroundBlendMode'\n | 'backgroundAttachment'\n | 'backgroundClip'\n | 'backgroundOrigin'\n | 'backgroundPosition'\n | 'backgroundRepeat'\n | 'backgroundSize'\n | `border${Placement}`\n | `border${Placement}Width`\n | 'borderRadius'\n | `border${Radius}Radius`\n | `border${Placement}Color`\n | `border${Placement}Style`\n | 'padding'\n | `padding${Placement}`\n\nexport type LayerStyle = CompositionStyleObject<LayerStyleProperty>\n\nexport type LayerStyles = Recursive<Token<LayerStyle>>\n\nexport interface CompositionStyles {\n textStyles: TextStyles\n layerStyles: LayerStyles\n}\n"
|
|
2663
2665
|
};
|
|
2664
2666
|
|
|
2665
2667
|
// src/artifacts/generated/recipe.d.ts.json
|
|
2666
2668
|
var recipe_d_ts_default = {
|
|
2667
|
-
content: "import type { SystemStyleObject, DistributiveOmit } from './system-types'\n\ntype Pretty<T> = { [K in keyof T]: T[K] } & {}\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport
|
|
2669
|
+
content: "import type { SystemStyleObject, DistributiveOmit } from './system-types'\n\ntype Pretty<T> = { [K in keyof T]: T[K] } & {}\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n raw: (props?: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\nexport type RecipeCompoundSelection<T extends RecipeVariantRecord> = {\n [K in keyof T]?: StringToBoolean<keyof T[K]> | Array<StringToBoolean<keyof T[K]>>\n}\n\nexport type RecipeCompoundVariant<T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition<T extends RecipeVariantRecord> {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | RecipeVariantRecord\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Array<RecipeCompoundVariant<T>>\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\ninterface RecipeConfigMeta {\n /**\n * The name of the recipe.\n */\n className: string\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The jsx elements to track for this recipe. Can be string or Regexp.\n *\n * @default capitalize(recipe.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n}\n\nexport interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>\n extends RecipeDefinition<T>,\n RecipeConfigMeta {}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Slot\n * -----------------------------------------------------------------------------*/\n\ntype SlotRecord<S extends string, T> = Partial<Record<S, T>>\n\nexport type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>\n\nexport type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (\n props?: RecipeSelection<T>,\n) => SlotRecord<S, string>\n\nexport interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>>\n extends SlotRecipeVariantFn<S, T> {\n raw: (props?: RecipeSelection<T>) => Record<S, SystemStyleObject>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<Omit<Props, keyof T>>]\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVariantRecord<S>> {\n /**\n * The parts/slots of the recipe.\n */\n slots: S[] | Readonly<S[]>\n /**\n * The base styles of the recipe.\n */\n base?: SlotRecord<S, SystemStyleObject>\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | SlotRecipeVariantRecord<S>\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Array<SlotRecipeCompoundVariant<S, T>>\n}\n\nexport type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(\n config: SlotRecipeDefinition<S, T>,\n) => SlotRecipeRuntimeFn<S, T>\n\nexport type SlotRecipeConfig<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> = SlotRecipeDefinition<S, T> & RecipeConfigMeta\n"
|
|
2668
2670
|
};
|
|
2669
2671
|
|
|
2670
2672
|
// src/artifacts/generated/pattern.d.ts.json
|
|
2671
2673
|
var pattern_d_ts_default = {
|
|
2672
|
-
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport
|
|
2674
|
+
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport interface PatternHelpers {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternProperties = Record<string, PatternProperty>\n\ntype Props<T> = Record<LiteralUnion<keyof T>, any>\n\nexport interface PatternConfig<T extends PatternProperties = PatternProperties> {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties?: T\n /**\n * The css object this pattern will generate.\n */\n transform?: (props: Props<T>, helpers: PatternHelpers) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsxName?: string\n /**\n * The jsx elements to track for this pattern. Can be string or Regexp.\n *\n * @default capitalize(pattern.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n"
|
|
2673
2675
|
};
|
|
2674
2676
|
|
|
2675
2677
|
// src/artifacts/generated/parts.d.ts.json
|
|
2676
2678
|
var parts_d_ts_default = {
|
|
2677
|
-
content: "export
|
|
2679
|
+
content: "export interface Part {\n selector: string\n}\n\nexport type Parts = Record<string, Part>\n"
|
|
2678
2680
|
};
|
|
2679
2681
|
|
|
2680
2682
|
// src/artifacts/generated/selectors.d.ts.json
|
|
@@ -2705,7 +2707,7 @@ import { outdent as outdent39 } from "outdent";
|
|
|
2705
2707
|
var generateTypesEntry = (ctx) => ({
|
|
2706
2708
|
global: outdent39`
|
|
2707
2709
|
// @ts-nocheck
|
|
2708
|
-
import type
|
|
2710
|
+
import type * as Panda from '@pandacss/dev'
|
|
2709
2711
|
${ctx.file.importType("RecipeVariantRecord, RecipeConfig, SlotRecipeVariantRecord, SlotRecipeConfig", "./recipe")}
|
|
2710
2712
|
${ctx.file.importType("Parts", "./parts")}
|
|
2711
2713
|
${ctx.file.importType("PatternConfig, PatternProperties", "./pattern")}
|
|
@@ -2713,23 +2715,25 @@ var generateTypesEntry = (ctx) => ({
|
|
|
2713
2715
|
${ctx.file.importType("CompositionStyles", "./composition")}
|
|
2714
2716
|
|
|
2715
2717
|
declare module '@pandacss/dev' {
|
|
2716
|
-
export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>): RecipeConfig
|
|
2717
|
-
export function defineSlotRecipe<S extends string, V extends SlotRecipeVariantRecord<S>>(config: SlotRecipeConfig<S, V>): SlotRecipeConfig
|
|
2718
|
+
export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>): Panda.RecipeConfig
|
|
2719
|
+
export function defineSlotRecipe<S extends string, V extends SlotRecipeVariantRecord<S>>(config: SlotRecipeConfig<S, V>): Panda.SlotRecipeConfig
|
|
2718
2720
|
export function defineStyles(definition: SystemStyleObject): SystemStyleObject
|
|
2719
|
-
export function defineGlobalStyles(definition: GlobalStyleObject): GlobalStyleObject
|
|
2720
|
-
export function defineTextStyles(definition: CompositionStyles['textStyles']): TextStyles
|
|
2721
|
-
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): LayerStyles
|
|
2722
|
-
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): PatternConfig
|
|
2721
|
+
export function defineGlobalStyles(definition: GlobalStyleObject): Panda.GlobalStyleObject
|
|
2722
|
+
export function defineTextStyles(definition: CompositionStyles['textStyles']): Panda.TextStyles
|
|
2723
|
+
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): Panda.LayerStyles
|
|
2724
|
+
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): Panda.PatternConfig
|
|
2723
2725
|
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>
|
|
2724
2726
|
}
|
|
2725
2727
|
`,
|
|
2726
2728
|
// We need to export types used in the global.d.ts here to avoid TS errors such as `The inferred type of 'xxx' cannot be named without a reference to 'yyy'`
|
|
2727
2729
|
index: outdent39`
|
|
2728
2730
|
import '${ctx.file.extDts("./global")}'
|
|
2729
|
-
${ctx.file.
|
|
2730
|
-
${ctx.file.
|
|
2731
|
-
${ctx.file.
|
|
2732
|
-
${ctx.file.
|
|
2731
|
+
${ctx.file.exportTypeStar("./conditions")}
|
|
2732
|
+
${ctx.file.exportTypeStar("./pattern")}
|
|
2733
|
+
${ctx.file.exportTypeStar("./recipe")}
|
|
2734
|
+
${ctx.file.exportTypeStar("./system-types")}
|
|
2735
|
+
${ctx.file.exportTypeStar("./jsx")}
|
|
2736
|
+
${ctx.file.exportTypeStar("./style-props")}
|
|
2733
2737
|
|
|
2734
2738
|
`,
|
|
2735
2739
|
helpers: outdent39`
|
|
@@ -2751,7 +2755,7 @@ function generatePropTypes(ctx) {
|
|
|
2751
2755
|
${ctx.file.importType("CssProperties", "./system-types")}
|
|
2752
2756
|
${ctx.file.importType("Tokens", "../tokens/index")}
|
|
2753
2757
|
|
|
2754
|
-
|
|
2758
|
+
interface PropertyValueTypes {`
|
|
2755
2759
|
];
|
|
2756
2760
|
const types = utility.getTypes();
|
|
2757
2761
|
for (const [prop, values] of types.entries()) {
|
|
@@ -2763,7 +2767,7 @@ function generatePropTypes(ctx) {
|
|
|
2763
2767
|
|
|
2764
2768
|
type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : CssValue<T>
|
|
2765
2769
|
|
|
2766
|
-
export
|
|
2770
|
+
export interface PropertyTypes extends PropertyValueTypes {
|
|
2767
2771
|
`);
|
|
2768
2772
|
utility.shorthands.forEach((value, key) => {
|
|
2769
2773
|
result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
|
|
@@ -2794,7 +2798,7 @@ function generateStyleProps(ctx) {
|
|
|
2794
2798
|
[key in \`--\${string}\`]?: ConditionalValue<Token | (string & {}) | (number & {})>
|
|
2795
2799
|
}
|
|
2796
2800
|
|
|
2797
|
-
export
|
|
2801
|
+
export interface SystemProperties {
|
|
2798
2802
|
${Array.from(props).map((v) => ` ${v}?: PropertyValue<'${v}'>`).join("\n")}
|
|
2799
2803
|
}
|
|
2800
2804
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
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.5",
|
|
23
|
-
"@pandacss/core": "0.15.
|
|
24
|
-
"@pandacss/is-valid-prop": "0.15.
|
|
25
|
-
"@pandacss/logger": "0.15.
|
|
26
|
-
"@pandacss/shared": "0.15.
|
|
27
|
-
"@pandacss/token-dictionary": "0.15.
|
|
28
|
-
"@pandacss/types": "0.15.
|
|
23
|
+
"@pandacss/core": "0.15.2",
|
|
24
|
+
"@pandacss/is-valid-prop": "0.15.2",
|
|
25
|
+
"@pandacss/logger": "0.15.2",
|
|
26
|
+
"@pandacss/shared": "0.15.2",
|
|
27
|
+
"@pandacss/token-dictionary": "0.15.2",
|
|
28
|
+
"@pandacss/types": "0.15.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.30",
|
|
32
32
|
"hookable": "5.5.3",
|
|
33
|
-
"@pandacss/fixture": "0.15.
|
|
33
|
+
"@pandacss/fixture": "0.15.2"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "tsx scripts/prebuild.ts",
|