@pandacss/generator 0.0.0-dev-20230503141334 → 0.0.0-dev-20230503210841
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 +12 -12
- package/dist/index.mjs +12 -12
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -662,8 +662,8 @@ function generatePattern(ctx) {
|
|
|
662
662
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
663
663
|
import type { PropertyValue } from '../types/prop-type'
|
|
664
664
|
import type { Properties } from '../types/csstype'
|
|
665
|
-
import type { Tokens } from '../types/
|
|
666
|
-
|
|
665
|
+
import type { Tokens } from '../types/tokens'
|
|
666
|
+
|
|
667
667
|
export type ${upperName}Properties = {
|
|
668
668
|
${Object.keys(properties ?? {}).map((key) => {
|
|
669
669
|
const value = properties[key];
|
|
@@ -681,25 +681,25 @@ function generatePattern(ctx) {
|
|
|
681
681
|
});
|
|
682
682
|
}).join("\n ")}
|
|
683
683
|
}
|
|
684
|
-
|
|
684
|
+
|
|
685
685
|
${strict ? import_outdent8.outdent`export declare function ${name}(options: ${upperName}Properties): string` : import_outdent8.outdent`
|
|
686
|
-
|
|
686
|
+
|
|
687
687
|
type ${upperName}Options = ${upperName}Properties & Omit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
688
|
-
|
|
688
|
+
|
|
689
689
|
${description ? `/** ${description} */` : ""}
|
|
690
690
|
export declare function ${name}(options?: ${upperName}Options): string
|
|
691
691
|
`}
|
|
692
|
-
|
|
692
|
+
|
|
693
693
|
`,
|
|
694
694
|
js: import_outdent8.outdent`
|
|
695
695
|
${ctx.file.import(helperImports.join(", "), "../helpers")}
|
|
696
696
|
${ctx.file.import("css", "../css/index")}
|
|
697
|
-
|
|
697
|
+
|
|
698
698
|
const ${name}Config = ${transformFn.replace(`{transform`, `{
|
|
699
699
|
transform`)}
|
|
700
|
-
|
|
700
|
+
|
|
701
701
|
export const ${styleFnName} = (styles = {}) => ${name}Config.transform(styles, { map: mapObject })
|
|
702
|
-
|
|
702
|
+
|
|
703
703
|
export const ${name} = (styles) => css(${styleFnName}(styles))
|
|
704
704
|
`
|
|
705
705
|
};
|
|
@@ -837,7 +837,7 @@ function generateTokenJs(ctx) {
|
|
|
837
837
|
token.var = tokenVar
|
|
838
838
|
`,
|
|
839
839
|
dts: import_outdent10.default`
|
|
840
|
-
import type { Token } from '../types/
|
|
840
|
+
import type { Token } from '../types/tokens'
|
|
841
841
|
|
|
842
842
|
export declare const token: {
|
|
843
843
|
(path: Token, fallback?: string): string
|
|
@@ -1801,7 +1801,7 @@ var csstype_d_ts_default = {
|
|
|
1801
1801
|
|
|
1802
1802
|
// src/artifacts/generated/system-types.d.ts.json
|
|
1803
1803
|
var system_types_d_ts_default = {
|
|
1804
|
-
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 NativeCssProperties = PropertiesFallback<String | Number>\n\nexport type NativeCssProperty = keyof NativeCssProperties\n\nexport type CssProperties = NativeCssProperties & CssVarProperties\n\nexport type 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\ntype 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 | GenericProperties
|
|
1804
|
+
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 NativeCssProperties = PropertiesFallback<String | Number>\n\nexport type NativeCssProperty = keyof NativeCssProperties\n\nexport type CssProperties = NativeCssProperties & CssVarProperties\n\nexport type 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\ntype 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 | GenericProperties) & CssVarProperties>\n\nexport type GlobalStyleObject = {\n [selector: string]: SystemStyleObject\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 * -----------------------------------------------------------------------------*/\n\nexport type JsxStyleProps = SystemProperties &\n MinimalNested<SystemStyleObject> & {\n css?: SystemStyleObject\n }\n\ntype Assign<T, U> = Omit<T, keyof U> & U\n\ntype HTMLProps = {\n htmlSize?: string | number\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n}\n\ntype WithHTMLProps<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
1805
1805
|
};
|
|
1806
1806
|
|
|
1807
1807
|
// src/artifacts/generated/composition.d.ts.json
|
|
@@ -1816,7 +1816,7 @@ var recipe_d_ts_default = {
|
|
|
1816
1816
|
|
|
1817
1817
|
// src/artifacts/generated/pattern.d.ts.json
|
|
1818
1818
|
var pattern_d_ts_default = {
|
|
1819
|
-
content: "import type { NativeCssProperty, SystemStyleObject } from './system-types'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\
|
|
1819
|
+
content: "import type { NativeCssProperty, 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: NativeCssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: NativeCssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport type PatternHelpers = {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternConfig<T> = {\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 extends Record<string, PatternProperty> ? T : Record<string, PatternProperty>\n /**\n * The css object this pattern will generate.\n */\n transform?: (\n props: T extends Record<infer Keys, PatternProperty> ? Record<Keys, any> : Record<string, PatternProperty>,\n helpers: PatternHelpers,\n ) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsx?: string\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<NativeCssProperty>[]\n}\n\nexport type AnyPatternConfig = PatternConfig<PatternProperty>\n"
|
|
1820
1820
|
};
|
|
1821
1821
|
|
|
1822
1822
|
// src/artifacts/generated/parts.d.ts.json
|
package/dist/index.mjs
CHANGED
|
@@ -631,8 +631,8 @@ function generatePattern(ctx) {
|
|
|
631
631
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
632
632
|
import type { PropertyValue } from '../types/prop-type'
|
|
633
633
|
import type { Properties } from '../types/csstype'
|
|
634
|
-
import type { Tokens } from '../types/
|
|
635
|
-
|
|
634
|
+
import type { Tokens } from '../types/tokens'
|
|
635
|
+
|
|
636
636
|
export type ${upperName}Properties = {
|
|
637
637
|
${Object.keys(properties ?? {}).map((key) => {
|
|
638
638
|
const value = properties[key];
|
|
@@ -650,25 +650,25 @@ function generatePattern(ctx) {
|
|
|
650
650
|
});
|
|
651
651
|
}).join("\n ")}
|
|
652
652
|
}
|
|
653
|
-
|
|
653
|
+
|
|
654
654
|
${strict ? outdent8`export declare function ${name}(options: ${upperName}Properties): string` : outdent8`
|
|
655
|
-
|
|
655
|
+
|
|
656
656
|
type ${upperName}Options = ${upperName}Properties & Omit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
657
|
-
|
|
657
|
+
|
|
658
658
|
${description ? `/** ${description} */` : ""}
|
|
659
659
|
export declare function ${name}(options?: ${upperName}Options): string
|
|
660
660
|
`}
|
|
661
|
-
|
|
661
|
+
|
|
662
662
|
`,
|
|
663
663
|
js: outdent8`
|
|
664
664
|
${ctx.file.import(helperImports.join(", "), "../helpers")}
|
|
665
665
|
${ctx.file.import("css", "../css/index")}
|
|
666
|
-
|
|
666
|
+
|
|
667
667
|
const ${name}Config = ${transformFn.replace(`{transform`, `{
|
|
668
668
|
transform`)}
|
|
669
|
-
|
|
669
|
+
|
|
670
670
|
export const ${styleFnName} = (styles = {}) => ${name}Config.transform(styles, { map: mapObject })
|
|
671
|
-
|
|
671
|
+
|
|
672
672
|
export const ${name} = (styles) => css(${styleFnName}(styles))
|
|
673
673
|
`
|
|
674
674
|
};
|
|
@@ -806,7 +806,7 @@ function generateTokenJs(ctx) {
|
|
|
806
806
|
token.var = tokenVar
|
|
807
807
|
`,
|
|
808
808
|
dts: outdent10`
|
|
809
|
-
import type { Token } from '../types/
|
|
809
|
+
import type { Token } from '../types/tokens'
|
|
810
810
|
|
|
811
811
|
export declare const token: {
|
|
812
812
|
(path: Token, fallback?: string): string
|
|
@@ -1770,7 +1770,7 @@ var csstype_d_ts_default = {
|
|
|
1770
1770
|
|
|
1771
1771
|
// src/artifacts/generated/system-types.d.ts.json
|
|
1772
1772
|
var system_types_d_ts_default = {
|
|
1773
|
-
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 NativeCssProperties = PropertiesFallback<String | Number>\n\nexport type NativeCssProperty = keyof NativeCssProperties\n\nexport type CssProperties = NativeCssProperties & CssVarProperties\n\nexport type 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\ntype 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 | GenericProperties
|
|
1773
|
+
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 NativeCssProperties = PropertiesFallback<String | Number>\n\nexport type NativeCssProperty = keyof NativeCssProperties\n\nexport type CssProperties = NativeCssProperties & CssVarProperties\n\nexport type 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\ntype 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 | GenericProperties) & CssVarProperties>\n\nexport type GlobalStyleObject = {\n [selector: string]: SystemStyleObject\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 * -----------------------------------------------------------------------------*/\n\nexport type JsxStyleProps = SystemProperties &\n MinimalNested<SystemStyleObject> & {\n css?: SystemStyleObject\n }\n\ntype Assign<T, U> = Omit<T, keyof U> & U\n\ntype HTMLProps = {\n htmlSize?: string | number\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n}\n\ntype WithHTMLProps<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
1774
1774
|
};
|
|
1775
1775
|
|
|
1776
1776
|
// src/artifacts/generated/composition.d.ts.json
|
|
@@ -1785,7 +1785,7 @@ var recipe_d_ts_default = {
|
|
|
1785
1785
|
|
|
1786
1786
|
// src/artifacts/generated/pattern.d.ts.json
|
|
1787
1787
|
var pattern_d_ts_default = {
|
|
1788
|
-
content: "import type { NativeCssProperty, SystemStyleObject } from './system-types'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\
|
|
1788
|
+
content: "import type { NativeCssProperty, 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: NativeCssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: NativeCssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport type PatternHelpers = {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternConfig<T> = {\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 extends Record<string, PatternProperty> ? T : Record<string, PatternProperty>\n /**\n * The css object this pattern will generate.\n */\n transform?: (\n props: T extends Record<infer Keys, PatternProperty> ? Record<Keys, any> : Record<string, PatternProperty>,\n helpers: PatternHelpers,\n ) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsx?: string\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<NativeCssProperty>[]\n}\n\nexport type AnyPatternConfig = PatternConfig<PatternProperty>\n"
|
|
1789
1789
|
};
|
|
1790
1790
|
|
|
1791
1791
|
// src/artifacts/generated/parts.d.ts.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230503210841",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "8.4.23",
|
|
22
22
|
"ts-pattern": "4.2.2",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
25
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/types": "0.0.0-dev-
|
|
28
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20230503210841",
|
|
24
|
+
"@pandacss/logger": "0.0.0-dev-20230503210841",
|
|
25
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230503210841",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20230503210841",
|
|
27
|
+
"@pandacss/types": "0.0.0-dev-20230503210841",
|
|
28
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230503210841"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.29",
|
|
32
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
32
|
+
"@pandacss/fixture": "0.0.0-dev-20230503210841"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"prebuild": "tsx scripts/prebuild.ts",
|