@pandacss/generator 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +103 -71
- package/dist/index.mjs +103 -71
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -94,6 +94,10 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
94
94
|
conditions: _pandacss_core.Conditions;
|
|
95
95
|
createSheetContext: () => _pandacss_core.StylesheetContext;
|
|
96
96
|
createSheet: (options?: Pick<_pandacss_core.StylesheetOptions, "content"> | undefined) => _pandacss_core.Stylesheet;
|
|
97
|
+
layers: _pandacss_types.CascadeLayers;
|
|
98
|
+
isValidLayerRule: (layerRule: string) => boolean;
|
|
99
|
+
layerString: string;
|
|
100
|
+
layerNames: string[];
|
|
97
101
|
hooks: _pandacss_types.PandaHookable;
|
|
98
102
|
path: string;
|
|
99
103
|
config: _pandacss_types_dist_shared.UnwrapExtend<_pandacss_types.RequiredBy<_pandacss_types.Config, "outdir" | "cwd" | "include">>;
|
|
@@ -320,6 +324,10 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
320
324
|
conditions: _pandacss_core.Conditions;
|
|
321
325
|
createSheetContext: () => _pandacss_core.StylesheetContext;
|
|
322
326
|
createSheet: (options?: Pick<_pandacss_core.StylesheetOptions, "content"> | undefined) => _pandacss_core.Stylesheet;
|
|
327
|
+
layers: _pandacss_types.CascadeLayers;
|
|
328
|
+
isValidLayerRule: (layerRule: string) => boolean;
|
|
329
|
+
layerString: string;
|
|
330
|
+
layerNames: string[];
|
|
323
331
|
hooks: _pandacss_types.PandaHookable;
|
|
324
332
|
path: string;
|
|
325
333
|
config: _pandacss_types_dist_shared.UnwrapExtend<_pandacss_types.RequiredBy<_pandacss_types.Config, "outdir" | "cwd" | "include">>;
|
package/dist/index.d.ts
CHANGED
|
@@ -94,6 +94,10 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
94
94
|
conditions: _pandacss_core.Conditions;
|
|
95
95
|
createSheetContext: () => _pandacss_core.StylesheetContext;
|
|
96
96
|
createSheet: (options?: Pick<_pandacss_core.StylesheetOptions, "content"> | undefined) => _pandacss_core.Stylesheet;
|
|
97
|
+
layers: _pandacss_types.CascadeLayers;
|
|
98
|
+
isValidLayerRule: (layerRule: string) => boolean;
|
|
99
|
+
layerString: string;
|
|
100
|
+
layerNames: string[];
|
|
97
101
|
hooks: _pandacss_types.PandaHookable;
|
|
98
102
|
path: string;
|
|
99
103
|
config: _pandacss_types_dist_shared.UnwrapExtend<_pandacss_types.RequiredBy<_pandacss_types.Config, "outdir" | "cwd" | "include">>;
|
|
@@ -320,6 +324,10 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
320
324
|
conditions: _pandacss_core.Conditions;
|
|
321
325
|
createSheetContext: () => _pandacss_core.StylesheetContext;
|
|
322
326
|
createSheet: (options?: Pick<_pandacss_core.StylesheetOptions, "content"> | undefined) => _pandacss_core.Stylesheet;
|
|
327
|
+
layers: _pandacss_types.CascadeLayers;
|
|
328
|
+
isValidLayerRule: (layerRule: string) => boolean;
|
|
329
|
+
layerString: string;
|
|
330
|
+
layerNames: string[];
|
|
323
331
|
hooks: _pandacss_types.PandaHookable;
|
|
324
332
|
path: string;
|
|
325
333
|
config: _pandacss_types_dist_shared.UnwrapExtend<_pandacss_types.RequiredBy<_pandacss_types.Config, "outdir" | "cwd" | "include">>;
|
package/dist/index.js
CHANGED
|
@@ -206,7 +206,7 @@ function generateKeyframeCss(ctx) {
|
|
|
206
206
|
var css = String.raw;
|
|
207
207
|
function generateResetCss(ctx, scope = "") {
|
|
208
208
|
const selector = scope ? `${scope} ` : "";
|
|
209
|
-
const output = css`@layer reset {
|
|
209
|
+
const output = css`@layer ${ctx.layers.reset} {
|
|
210
210
|
${selector}* {
|
|
211
211
|
margin: 0;
|
|
212
212
|
padding: 0;
|
|
@@ -473,7 +473,7 @@ function generateTokenCss(ctx) {
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
const css2 = results.join("\n\n");
|
|
476
|
-
const output = `@layer tokens {
|
|
476
|
+
const output = `@layer ${ctx.layers.tokens} {
|
|
477
477
|
${(0, import_core3.prettifyCss)(cleanupSelectors(css2, root))}
|
|
478
478
|
}
|
|
479
479
|
`;
|
|
@@ -654,13 +654,13 @@ function generateCssFn(ctx) {
|
|
|
654
654
|
return result;
|
|
655
655
|
}).join(",")}"
|
|
656
656
|
|
|
657
|
-
const
|
|
657
|
+
const classNameByProp = new Map()
|
|
658
658
|
${utility.hasShorthand ? import_outdent4.outdent`
|
|
659
659
|
const shorthands = new Map()
|
|
660
660
|
utilities.split(',').forEach((utility) => {
|
|
661
661
|
const [prop, meta] = utility.split(':')
|
|
662
662
|
const [className, ...shorthandList] = meta.split('/')
|
|
663
|
-
|
|
663
|
+
classNameByProp.set(prop, className)
|
|
664
664
|
if (shorthandList.length) {
|
|
665
665
|
shorthandList.forEach((shorthand) => {
|
|
666
666
|
shorthands.set(shorthand === '1' ? className : shorthand, prop)
|
|
@@ -672,7 +672,7 @@ function generateCssFn(ctx) {
|
|
|
672
672
|
` : import_outdent4.outdent`
|
|
673
673
|
utilities.split(',').forEach((utility) => {
|
|
674
674
|
const [prop, className] = utility.split(':')
|
|
675
|
-
|
|
675
|
+
classNameByProp.set(prop, className)
|
|
676
676
|
})
|
|
677
677
|
`}
|
|
678
678
|
|
|
@@ -687,15 +687,21 @@ function generateCssFn(ctx) {
|
|
|
687
687
|
${prefix ? "prefix: " + JSON.stringify(prefix) + "," : ""}
|
|
688
688
|
transform: ${utility.hasShorthand ? `(prop, value) => {
|
|
689
689
|
const key = resolveShorthand(prop)
|
|
690
|
-
const propKey =
|
|
690
|
+
const propKey = classNameByProp.get(key) || hypenateProperty(key)
|
|
691
691
|
return { className: \`\${propKey}${separator}\${withoutSpace(value)}\` }
|
|
692
|
-
}` : `(key, value) => ({ className: \`\${
|
|
692
|
+
}` : `(key, value) => ({ className: \`\${classNameByProp.get(key) || hypenateProperty(key)}${separator}\${withoutSpace(value)}\` })`},
|
|
693
693
|
${utility.hasShorthand ? "hasShorthand: true," : ""}
|
|
694
694
|
resolveShorthand: ${utility.hasShorthand ? "resolveShorthand" : "prop => prop"},
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
697
|
|
|
698
|
-
|
|
698
|
+
const cssFn = createCss(context)
|
|
699
|
+
export const cssCache = new Map()
|
|
700
|
+
export const css = (styles) => {
|
|
701
|
+
const classNames = cssFn(styles)
|
|
702
|
+
cssCache.set(classNames, styles)
|
|
703
|
+
return classNames
|
|
704
|
+
}
|
|
699
705
|
css.raw = (styles) => styles
|
|
700
706
|
|
|
701
707
|
export const { mergeCss, assignCss } = createMergeCss(context)
|
|
@@ -833,23 +839,34 @@ function generateCvaFn(ctx) {
|
|
|
833
839
|
|
|
834
840
|
// src/artifacts/js/cx.ts
|
|
835
841
|
var import_outdent7 = __toESM(require("outdent"));
|
|
836
|
-
function generateCx() {
|
|
842
|
+
function generateCx(ctx) {
|
|
837
843
|
return {
|
|
838
844
|
js: import_outdent7.default`
|
|
845
|
+
${ctx.file.import("cssCache, css, mergeCss", "./css")}
|
|
846
|
+
|
|
839
847
|
function cx() {
|
|
848
|
+
const objs = []
|
|
840
849
|
let str = '',
|
|
841
850
|
i = 0,
|
|
842
851
|
arg
|
|
843
|
-
|
|
852
|
+
|
|
844
853
|
for (; i < arguments.length; ) {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
854
|
+
arg = arguments[i++]
|
|
855
|
+
if (!arg || typeof arg !== 'string') continue
|
|
856
|
+
|
|
857
|
+
if (cssCache.has(arg)) {
|
|
858
|
+
objs.push(cssCache.get(arg))
|
|
859
|
+
continue
|
|
848
860
|
}
|
|
861
|
+
|
|
862
|
+
str && (str += ' ')
|
|
863
|
+
str += arg.toString()
|
|
849
864
|
}
|
|
850
|
-
|
|
865
|
+
|
|
866
|
+
const merged = mergeCss(...objs)
|
|
867
|
+
return [css(merged), str].join(' ')
|
|
851
868
|
}
|
|
852
|
-
|
|
869
|
+
|
|
853
870
|
export { cx }
|
|
854
871
|
`,
|
|
855
872
|
dts: import_outdent7.default`
|
|
@@ -901,14 +918,14 @@ function generateHelpers(ctx) {
|
|
|
901
918
|
|
|
902
919
|
// src/artifacts/generated/is-valid-prop.mjs.json
|
|
903
920
|
var is_valid_prop_mjs_default = {
|
|
904
|
-
content: '// src/index.ts\nvar userGeneratedStr = "";\nvar userGenerated = userGeneratedStr.split(",");\nvar cssPropertiesStr = "WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationTimingFunction,animationTimeline,appearance,aspectRatio,azimuth,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockOverflow,blockSize,border,borderBlock,borderBlockColor,borderBlockStyle,borderBlockWidth,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineEnd,borderInlineColor,borderInlineStyle,borderInlineWidth,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,color,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicSize,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,direction,display,emptyCells,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontVariationSettings,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inputSecurity,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,printColorAdjust,quotes,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockStart,scrollMarginBlockEnd,scrollMarginBottom,scrollMarginInline,scrollMarginInlineStart,scrollMarginInlineEnd,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineStart,scrollPaddingInlineEnd,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,shapeImageThreshold,shapeMargin,shapeOutside,tabSize,tableLayout,textAlign,textAlignLast,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textTransform,textUnderlineOffset,textUnderlinePosition,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,verticalAlign,viewTransitionName,visibility,whiteSpace,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,zIndex,zoom";\nvar allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);\nvar properties = new Map(allCssProperties.map((prop) => [prop, true]));\nfunction memo(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (arg) => {\n if (cache[arg] === void 0)\n cache[arg] = fn(arg);\n return cache[arg];\n };\n}\nvar
|
|
921
|
+
content: '// src/index.ts\nvar userGeneratedStr = "";\nvar userGenerated = userGeneratedStr.split(",");\nvar cssPropertiesStr = "WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationTimingFunction,animationTimeline,appearance,aspectRatio,azimuth,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockOverflow,blockSize,border,borderBlock,borderBlockColor,borderBlockStyle,borderBlockWidth,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineEnd,borderInlineColor,borderInlineStyle,borderInlineWidth,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,color,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicSize,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,direction,display,emptyCells,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontVariationSettings,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inputSecurity,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,printColorAdjust,quotes,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockStart,scrollMarginBlockEnd,scrollMarginBottom,scrollMarginInline,scrollMarginInlineStart,scrollMarginInlineEnd,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineStart,scrollPaddingInlineEnd,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,shapeImageThreshold,shapeMargin,shapeOutside,tabSize,tableLayout,textAlign,textAlignLast,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textTransform,textUnderlineOffset,textUnderlinePosition,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,verticalAlign,viewTransitionName,visibility,whiteSpace,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,zIndex,zoom,alignmentBaseline,baselineShift,clipRule,colorInterpolation,colorRendering,dominantBaseline,fill,fillOpacity,fillRule,floodColor,floodOpacity,glyphOrientationVertical,lightingColor,marker,markerEnd,markerMid,markerStart,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,textAnchor,vectorEffect";\nvar allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);\nvar properties = new Map(allCssProperties.map((prop) => [prop, true]));\nfunction memo(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (arg) => {\n if (cache[arg] === void 0)\n cache[arg] = fn(arg);\n return cache[arg];\n };\n}\nvar cssPropertySelectorRegex = /&|@/;\nvar isCssProperty = /* @__PURE__ */ memo((prop) => {\n return properties.has(prop) || prop.startsWith("--") || cssPropertySelectorRegex.test(prop);\n});\nexport {\n allCssProperties,\n isCssProperty\n};\n'
|
|
905
922
|
};
|
|
906
923
|
|
|
907
924
|
// src/artifacts/js/is-valid-prop.ts
|
|
908
925
|
var import_outdent9 = require("outdent");
|
|
909
926
|
var import_ts_pattern = require("ts-pattern");
|
|
910
927
|
var cssPropRegex = /var cssPropertiesStr = ".*?";/;
|
|
911
|
-
var memoFnDeclarationRegex = /function memo(.+?)\nvar
|
|
928
|
+
var memoFnDeclarationRegex = /function memo(.+?)\nvar cssPropertySelectorRegex/s;
|
|
912
929
|
function generateIsValidProp(ctx) {
|
|
913
930
|
if (ctx.isTemplateLiteralSyntax)
|
|
914
931
|
return;
|
|
@@ -917,7 +934,7 @@ function generateIsValidProp(ctx) {
|
|
|
917
934
|
'var userGeneratedStr = "";',
|
|
918
935
|
`var userGeneratedStr = "${(0, import_ts_pattern.match)(ctx.jsx.styleProps).with("all", () => Array.from(new Set(ctx.properties)).join(",")).with("minimal", () => "css").with("none", () => "").exhaustive()}"`
|
|
919
936
|
);
|
|
920
|
-
content = content.replace(memoFnDeclarationRegex, "var
|
|
937
|
+
content = content.replace(memoFnDeclarationRegex, "var cssPropertySelectorRegex");
|
|
921
938
|
if (ctx.jsx.styleProps === "minimal" || ctx.jsx.styleProps === "none") {
|
|
922
939
|
content = content.replace("/* @__PURE__ */ memo(", "/* @__PURE__ */ (");
|
|
923
940
|
content = content.replace(cssPropRegex, 'var cssPropertiesStr = "";');
|
|
@@ -957,8 +974,9 @@ function generatePattern(ctx) {
|
|
|
957
974
|
name: dashName,
|
|
958
975
|
dts: import_outdent10.outdent`
|
|
959
976
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
960
|
-
import type { PropertyValue } from '../types/prop-type'
|
|
961
977
|
import type { Properties } from '../types/csstype'
|
|
978
|
+
import type { PropertyValue } from '../types/prop-type'
|
|
979
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
962
980
|
import type { Tokens } from '../tokens'
|
|
963
981
|
|
|
964
982
|
export type ${upperName}Properties = {
|
|
@@ -979,13 +997,13 @@ function generatePattern(ctx) {
|
|
|
979
997
|
}).join("\n ")}
|
|
980
998
|
}
|
|
981
999
|
|
|
982
|
-
${strict ? import_outdent10.outdent`export declare function ${baseName}(
|
|
1000
|
+
${strict ? import_outdent10.outdent`export declare function ${baseName}(styles: ${upperName}Properties): string` : import_outdent10.outdent`
|
|
983
1001
|
|
|
984
|
-
type ${upperName}
|
|
1002
|
+
type ${upperName}Styles = ${upperName}Properties & DistributiveOmit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
985
1003
|
|
|
986
1004
|
interface ${upperName}PatternFn {
|
|
987
|
-
(
|
|
988
|
-
raw: (
|
|
1005
|
+
(styles?: ${upperName}Styles): string
|
|
1006
|
+
raw: (styles: ${upperName}Styles) => ${upperName}Styles
|
|
989
1007
|
}
|
|
990
1008
|
|
|
991
1009
|
${description ? `/** ${description} */` : ""}
|
|
@@ -1128,6 +1146,7 @@ function generateRecipes(ctx) {
|
|
|
1128
1146
|
dts: import_outdent11.outdent`
|
|
1129
1147
|
import type { ConditionalValue } from '../types'
|
|
1130
1148
|
import type { Pretty } from '../types/helpers'
|
|
1149
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
1131
1150
|
|
|
1132
1151
|
type ${upperName}Variant = {
|
|
1133
1152
|
${Object.keys(variantKeyMap).map((key) => {
|
|
@@ -1152,7 +1171,7 @@ function generateRecipes(ctx) {
|
|
|
1152
1171
|
raw: (props?: ${upperName}VariantProps) => ${upperName}VariantProps
|
|
1153
1172
|
variantMap: ${upperName}VariantMap
|
|
1154
1173
|
variantKeys: Array<keyof ${upperName}Variant>
|
|
1155
|
-
splitVariantProps<Props extends ${upperName}VariantProps>(props: Props): [${upperName}VariantProps, Pretty<
|
|
1174
|
+
splitVariantProps<Props extends ${upperName}VariantProps>(props: Props): [${upperName}VariantProps, Pretty<DistributiveOmit<Props, keyof ${upperName}VariantProps>>]
|
|
1156
1175
|
}
|
|
1157
1176
|
|
|
1158
1177
|
${description ? `/** ${description} */` : ""}
|
|
@@ -1342,8 +1361,9 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1342
1361
|
import type { FunctionComponent } from 'preact'
|
|
1343
1362
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1344
1363
|
import type { ${typeName} } from '../types/jsx'
|
|
1364
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
1345
1365
|
|
|
1346
|
-
export type ${upperName}Props = ${upperName}Properties &
|
|
1366
|
+
export type ${upperName}Props = ${upperName}Properties & DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
1347
1367
|
|
|
1348
1368
|
${description ? `/** ${description} */` : ""}
|
|
1349
1369
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
@@ -1579,18 +1599,15 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1579
1599
|
}
|
|
1580
1600
|
`,
|
|
1581
1601
|
dts: import_outdent20.outdent`
|
|
1582
|
-
import type {
|
|
1602
|
+
import type { Component } from '@builder.io/qwik'
|
|
1583
1603
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1584
1604
|
import type { ${typeName} } from '../types/jsx'
|
|
1585
|
-
|
|
1586
|
-
type Assign<T, U> = {
|
|
1587
|
-
[K in keyof T]?: K extends keyof T ? (K extends keyof U ? T[K] & U[K] : T[K]) : never
|
|
1588
|
-
} & U
|
|
1605
|
+
import type { Assign, DistributiveOmit } from '../types/system-types'
|
|
1589
1606
|
|
|
1590
|
-
export type ${upperName}Props = Assign<${typeName}<'${jsxElement}'>,
|
|
1607
|
+
export type ${upperName}Props = Assign<${typeName}<'${jsxElement}'>, DistributiveOmit<${upperName}Properties, ${blocklistType || '""'}>>
|
|
1591
1608
|
|
|
1592
1609
|
${description ? `/** ${description} */` : ""}
|
|
1593
|
-
export declare const ${jsxName}:
|
|
1610
|
+
export declare const ${jsxName}: Component<${upperName}Props>
|
|
1594
1611
|
`
|
|
1595
1612
|
};
|
|
1596
1613
|
});
|
|
@@ -1606,37 +1623,21 @@ import { ${upperName} } from '../types/jsx'
|
|
|
1606
1623
|
export declare const ${factoryName}: ${upperName}
|
|
1607
1624
|
`,
|
|
1608
1625
|
jsxType: import_outdent21.outdent`
|
|
1609
|
-
import type {
|
|
1610
|
-
import type { Assign
|
|
1626
|
+
import type { Component, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1627
|
+
import type { Assign, JsxStyleProps, PatchedHTMLProps } from './system-types'
|
|
1611
1628
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
1612
1629
|
|
|
1613
|
-
type ElementType = keyof QwikIntrinsicElements |
|
|
1630
|
+
type ElementType = keyof QwikIntrinsicElements | Component<any>
|
|
1614
1631
|
|
|
1615
1632
|
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1616
1633
|
? QwikIntrinsicElements[T]
|
|
1617
|
-
: T extends
|
|
1634
|
+
: T extends Component<infer P>
|
|
1618
1635
|
? P
|
|
1619
1636
|
: never
|
|
1620
1637
|
|
|
1621
1638
|
type Dict = Record<string, unknown>
|
|
1622
1639
|
|
|
1623
|
-
type
|
|
1624
|
-
|
|
1625
|
-
// Patch due to Omit<T, K> not working with Qwik JSX Types
|
|
1626
|
-
|
|
1627
|
-
type Assign<T, U> = {
|
|
1628
|
-
[K in keyof T]?: K extends Omitted
|
|
1629
|
-
? K extends keyof U
|
|
1630
|
-
? U[K]
|
|
1631
|
-
: never
|
|
1632
|
-
: K extends keyof T
|
|
1633
|
-
? K extends keyof U
|
|
1634
|
-
? T[K] & U[K]
|
|
1635
|
-
: T[K]
|
|
1636
|
-
: never
|
|
1637
|
-
} & U & PatchedHTMLProps
|
|
1638
|
-
|
|
1639
|
-
export type ${componentName}<T extends ElementType, P extends Dict = {}> = FunctionComponent<Assign<ComponentProps<T>, _Assign<JsxStyleProps, P>>>
|
|
1640
|
+
export type ${componentName}<T extends ElementType, P extends Dict = {}> = Component<Assign<ComponentProps<T> & PatchedHTMLProps, Assign<JsxStyleProps, P>>>
|
|
1640
1641
|
|
|
1641
1642
|
type RecipeFn = { __type: any }
|
|
1642
1643
|
|
|
@@ -1717,13 +1718,13 @@ import { ${upperName} } from '../types/jsx'
|
|
|
1717
1718
|
export declare const ${factoryName}: ${upperName}
|
|
1718
1719
|
`,
|
|
1719
1720
|
jsxType: import_outdent23.outdent`
|
|
1720
|
-
import type {
|
|
1721
|
+
import type { Component, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1721
1722
|
|
|
1722
|
-
type ElementType = keyof QwikIntrinsicElements |
|
|
1723
|
+
type ElementType = keyof QwikIntrinsicElements | Component<any>
|
|
1723
1724
|
|
|
1724
1725
|
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1725
1726
|
? QwikIntrinsicElements[T]
|
|
1726
|
-
: T extends
|
|
1727
|
+
: T extends Component<infer P>
|
|
1727
1728
|
? P
|
|
1728
1729
|
: never
|
|
1729
1730
|
|
|
@@ -1886,8 +1887,9 @@ function generateReactJsxPattern(ctx) {
|
|
|
1886
1887
|
import type { FunctionComponent } from 'react'
|
|
1887
1888
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1888
1889
|
import type { ${typeName} } from '../types/jsx'
|
|
1890
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
1889
1891
|
|
|
1890
|
-
export type ${upperName}Props = ${upperName}Properties &
|
|
1892
|
+
export type ${upperName}Props = ${upperName}Properties & DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
1891
1893
|
|
|
1892
1894
|
${description ? `/** ${description} */` : ""}
|
|
1893
1895
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
@@ -1907,12 +1909,12 @@ export declare const ${factoryName}: ${upperName}
|
|
|
1907
1909
|
`,
|
|
1908
1910
|
jsxType: import_outdent26.outdent`
|
|
1909
1911
|
import type { ComponentPropsWithoutRef, ElementType, ElementRef, Ref } from 'react'
|
|
1910
|
-
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1912
|
+
import type { Assign, DistributiveOmit, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1911
1913
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
1912
1914
|
|
|
1913
1915
|
type Dict = Record<string, unknown>
|
|
1914
1916
|
|
|
1915
|
-
type ComponentProps<T extends ElementType> =
|
|
1917
|
+
type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1916
1918
|
ref?: Ref<ElementRef<T>>
|
|
1917
1919
|
}
|
|
1918
1920
|
|
|
@@ -2002,10 +2004,11 @@ export declare const ${factoryName}: ${upperName}
|
|
|
2002
2004
|
`,
|
|
2003
2005
|
jsxType: import_outdent28.outdent`
|
|
2004
2006
|
import type { ComponentPropsWithoutRef, ElementType, ElementRef, Ref } from 'react'
|
|
2007
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
2005
2008
|
|
|
2006
2009
|
type Dict = Record<string, unknown>
|
|
2007
2010
|
|
|
2008
|
-
type ComponentProps<T extends ElementType> =
|
|
2011
|
+
type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
2009
2012
|
ref?: Ref<ElementRef<T>>
|
|
2010
2013
|
}
|
|
2011
2014
|
|
|
@@ -2041,7 +2044,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2041
2044
|
${ctx.file.import("allCssProperties", "./is-valid-prop")}
|
|
2042
2045
|
|
|
2043
2046
|
function styledFn(element, configOrCva = {}) {
|
|
2044
|
-
const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
|
|
2047
|
+
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
2045
2048
|
|
|
2046
2049
|
return function ${componentName}(props) {
|
|
2047
2050
|
const mergedProps = mergeProps({ as: element }, props)
|
|
@@ -2144,8 +2147,9 @@ function generateSolidJsxPattern(ctx) {
|
|
|
2144
2147
|
import { Component } from 'solid-js'
|
|
2145
2148
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
2146
2149
|
import { ${typeName} } from '../types/jsx'
|
|
2150
|
+
import { DistributiveOmit } from '../types/system-types'
|
|
2147
2151
|
|
|
2148
|
-
export type ${upperName}Props = ${upperName}Properties &
|
|
2152
|
+
export type ${upperName}Props = ${upperName}Properties & DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
2149
2153
|
|
|
2150
2154
|
${description ? `/** ${description} */` : ""}
|
|
2151
2155
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
@@ -2451,8 +2455,9 @@ function generateVueJsxPattern(ctx) {
|
|
|
2451
2455
|
import { FunctionalComponent } from 'vue'
|
|
2452
2456
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
2453
2457
|
import { ${typeName} } from '../types/jsx'
|
|
2458
|
+
import { DistributiveOmit } from '../types/system-types'
|
|
2454
2459
|
|
|
2455
|
-
export type ${upperName}Props = ${upperName}Properties &
|
|
2460
|
+
export type ${upperName}Props = ${upperName}Properties & DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
2456
2461
|
|
|
2457
2462
|
${description ? `/** ${description} */` : ""}
|
|
2458
2463
|
export declare const ${jsxName}: FunctionalComponent<${upperName}Props>
|
|
@@ -2889,7 +2894,7 @@ var csstype_d_ts_default = {
|
|
|
2889
2894
|
|
|
2890
2895
|
// src/artifacts/generated/system-types.d.ts.json
|
|
2891
2896
|
var system_types_d_ts_default = {
|
|
2892
|
-
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 type CssProperties = PropertiesFallback<String | Number> & 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 & 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 * -----------------------------------------------------------------------------*/\ntype WithCss = { css?: SystemStyleObject }\ntype StyleProps = SystemProperties & MinimalNested<SystemStyleObject>\n\nexport type JsxStyleProps = StyleProps & WithCss\n\nexport type
|
|
2897
|
+
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 type CssProperties = PropertiesFallback<String | Number> & 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 & 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 * -----------------------------------------------------------------------------*/\ntype WithCss = { css?: SystemStyleObject }\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 type 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"
|
|
2893
2898
|
};
|
|
2894
2899
|
|
|
2895
2900
|
// src/artifacts/generated/composition.d.ts.json
|
|
@@ -2899,7 +2904,7 @@ var composition_d_ts_default = {
|
|
|
2899
2904
|
|
|
2900
2905
|
// src/artifacts/generated/recipe.d.ts.json
|
|
2901
2906
|
var recipe_d_ts_default = {
|
|
2902
|
-
content: "import type { SystemStyleObject } 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 type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n resolve: (props: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<
|
|
2907
|
+
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 type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n resolve: (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 type 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\ntype 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 type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & 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 type SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>> = SlotRecipeVariantFn<S, T> & {\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 type 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"
|
|
2903
2908
|
};
|
|
2904
2909
|
|
|
2905
2910
|
// src/artifacts/generated/pattern.d.ts.json
|
|
@@ -3054,7 +3059,10 @@ var categories = [
|
|
|
3054
3059
|
"assets"
|
|
3055
3060
|
];
|
|
3056
3061
|
function generateTokenTypes(ctx) {
|
|
3057
|
-
const {
|
|
3062
|
+
const {
|
|
3063
|
+
tokens,
|
|
3064
|
+
config: { theme }
|
|
3065
|
+
} = ctx;
|
|
3058
3066
|
const set = /* @__PURE__ */ new Set();
|
|
3059
3067
|
set.add(`export type Token = ${tokens.isEmpty ? "string" : (0, import_shared3.unionType)(tokens.allNames)}`);
|
|
3060
3068
|
const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
|
|
@@ -3070,6 +3078,9 @@ function generateTokenTypes(ctx) {
|
|
|
3070
3078
|
set.add(`export type ${typeName}Token = ${(0, import_shared3.unionType)(value.keys())}`);
|
|
3071
3079
|
result.add(` ${key}: ${typeName}Token`);
|
|
3072
3080
|
}
|
|
3081
|
+
const keyframes = Object.keys(theme?.keyframes ?? {});
|
|
3082
|
+
set.add(`export type AnimationName = ${(0, import_shared3.unionType)(keyframes)}`);
|
|
3083
|
+
result.add(` animationName: AnimationName`);
|
|
3073
3084
|
}
|
|
3074
3085
|
result.add("} & { [token: string]: never }");
|
|
3075
3086
|
set.add(Array.from(result).join("\n"));
|
|
@@ -3168,7 +3179,7 @@ function setupSva(ctx) {
|
|
|
3168
3179
|
};
|
|
3169
3180
|
}
|
|
3170
3181
|
function setupCx(ctx) {
|
|
3171
|
-
const code = generateCx();
|
|
3182
|
+
const code = generateCx(ctx);
|
|
3172
3183
|
return {
|
|
3173
3184
|
dir: ctx.paths.css,
|
|
3174
3185
|
files: [
|
|
@@ -3334,7 +3345,7 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
3334
3345
|
const { files, resolve } = options;
|
|
3335
3346
|
const { theme: { keyframes } = {}, preflight, minify, staticCss } = ctx.config;
|
|
3336
3347
|
const unresolved = [
|
|
3337
|
-
|
|
3348
|
+
ctx.layerString,
|
|
3338
3349
|
preflight && "@import './reset.css';",
|
|
3339
3350
|
"@import './global.css';",
|
|
3340
3351
|
staticCss && "@import './static.css';",
|
|
@@ -3485,12 +3496,20 @@ var getBaseEngine = (conf) => {
|
|
|
3485
3496
|
});
|
|
3486
3497
|
const compositionContext = { conditions, utility };
|
|
3487
3498
|
(0, import_core5.assignCompositions)(compositions, compositionContext);
|
|
3499
|
+
const layers = config.layers;
|
|
3500
|
+
const layerNames = Object.values(layers);
|
|
3501
|
+
const isValidLayerRule = (0, import_shared5.memo)((layerRule) => {
|
|
3502
|
+
const names = new Set(layerRule.split(",").map((name) => name.trim()));
|
|
3503
|
+
return names.size >= 5 && layerNames.every((name) => names.has(name));
|
|
3504
|
+
});
|
|
3505
|
+
const layerString = `@layer ${layerNames.join(", ")};`;
|
|
3488
3506
|
const createSheetContext = () => ({
|
|
3489
3507
|
root: import_postcss3.default.root(),
|
|
3490
3508
|
conditions,
|
|
3491
3509
|
utility,
|
|
3492
3510
|
hash: hash.className,
|
|
3493
|
-
helpers
|
|
3511
|
+
helpers,
|
|
3512
|
+
layers
|
|
3494
3513
|
});
|
|
3495
3514
|
const createSheet = (options) => {
|
|
3496
3515
|
const sheetContext = createSheetContext();
|
|
@@ -3526,7 +3545,12 @@ var getBaseEngine = (conf) => {
|
|
|
3526
3545
|
recipes,
|
|
3527
3546
|
conditions,
|
|
3528
3547
|
createSheetContext,
|
|
3529
|
-
createSheet
|
|
3548
|
+
createSheet,
|
|
3549
|
+
// cascade layer
|
|
3550
|
+
layers,
|
|
3551
|
+
isValidLayerRule,
|
|
3552
|
+
layerString,
|
|
3553
|
+
layerNames
|
|
3530
3554
|
};
|
|
3531
3555
|
};
|
|
3532
3556
|
|
|
@@ -3635,7 +3659,15 @@ var defaults = (conf) => ({
|
|
|
3635
3659
|
outExtension: "mjs",
|
|
3636
3660
|
shorthands: true,
|
|
3637
3661
|
syntax: "object-literal",
|
|
3638
|
-
...conf.config
|
|
3662
|
+
...conf.config,
|
|
3663
|
+
layers: {
|
|
3664
|
+
reset: "reset",
|
|
3665
|
+
base: "base",
|
|
3666
|
+
tokens: "tokens",
|
|
3667
|
+
recipes: "recipes",
|
|
3668
|
+
utilities: "utilities",
|
|
3669
|
+
...conf.config.layers
|
|
3670
|
+
}
|
|
3639
3671
|
}
|
|
3640
3672
|
});
|
|
3641
3673
|
var getImportMap = (outdir) => ({
|
package/dist/index.mjs
CHANGED
|
@@ -175,7 +175,7 @@ function generateKeyframeCss(ctx) {
|
|
|
175
175
|
var css = String.raw;
|
|
176
176
|
function generateResetCss(ctx, scope = "") {
|
|
177
177
|
const selector = scope ? `${scope} ` : "";
|
|
178
|
-
const output = css`@layer reset {
|
|
178
|
+
const output = css`@layer ${ctx.layers.reset} {
|
|
179
179
|
${selector}* {
|
|
180
180
|
margin: 0;
|
|
181
181
|
padding: 0;
|
|
@@ -442,7 +442,7 @@ function generateTokenCss(ctx) {
|
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
const css2 = results.join("\n\n");
|
|
445
|
-
const output = `@layer tokens {
|
|
445
|
+
const output = `@layer ${ctx.layers.tokens} {
|
|
446
446
|
${prettifyCss(cleanupSelectors(css2, root))}
|
|
447
447
|
}
|
|
448
448
|
`;
|
|
@@ -623,13 +623,13 @@ function generateCssFn(ctx) {
|
|
|
623
623
|
return result;
|
|
624
624
|
}).join(",")}"
|
|
625
625
|
|
|
626
|
-
const
|
|
626
|
+
const classNameByProp = new Map()
|
|
627
627
|
${utility.hasShorthand ? outdent4`
|
|
628
628
|
const shorthands = new Map()
|
|
629
629
|
utilities.split(',').forEach((utility) => {
|
|
630
630
|
const [prop, meta] = utility.split(':')
|
|
631
631
|
const [className, ...shorthandList] = meta.split('/')
|
|
632
|
-
|
|
632
|
+
classNameByProp.set(prop, className)
|
|
633
633
|
if (shorthandList.length) {
|
|
634
634
|
shorthandList.forEach((shorthand) => {
|
|
635
635
|
shorthands.set(shorthand === '1' ? className : shorthand, prop)
|
|
@@ -641,7 +641,7 @@ function generateCssFn(ctx) {
|
|
|
641
641
|
` : outdent4`
|
|
642
642
|
utilities.split(',').forEach((utility) => {
|
|
643
643
|
const [prop, className] = utility.split(':')
|
|
644
|
-
|
|
644
|
+
classNameByProp.set(prop, className)
|
|
645
645
|
})
|
|
646
646
|
`}
|
|
647
647
|
|
|
@@ -656,15 +656,21 @@ function generateCssFn(ctx) {
|
|
|
656
656
|
${prefix ? "prefix: " + JSON.stringify(prefix) + "," : ""}
|
|
657
657
|
transform: ${utility.hasShorthand ? `(prop, value) => {
|
|
658
658
|
const key = resolveShorthand(prop)
|
|
659
|
-
const propKey =
|
|
659
|
+
const propKey = classNameByProp.get(key) || hypenateProperty(key)
|
|
660
660
|
return { className: \`\${propKey}${separator}\${withoutSpace(value)}\` }
|
|
661
|
-
}` : `(key, value) => ({ className: \`\${
|
|
661
|
+
}` : `(key, value) => ({ className: \`\${classNameByProp.get(key) || hypenateProperty(key)}${separator}\${withoutSpace(value)}\` })`},
|
|
662
662
|
${utility.hasShorthand ? "hasShorthand: true," : ""}
|
|
663
663
|
resolveShorthand: ${utility.hasShorthand ? "resolveShorthand" : "prop => prop"},
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
|
|
667
|
-
|
|
667
|
+
const cssFn = createCss(context)
|
|
668
|
+
export const cssCache = new Map()
|
|
669
|
+
export const css = (styles) => {
|
|
670
|
+
const classNames = cssFn(styles)
|
|
671
|
+
cssCache.set(classNames, styles)
|
|
672
|
+
return classNames
|
|
673
|
+
}
|
|
668
674
|
css.raw = (styles) => styles
|
|
669
675
|
|
|
670
676
|
export const { mergeCss, assignCss } = createMergeCss(context)
|
|
@@ -802,23 +808,34 @@ function generateCvaFn(ctx) {
|
|
|
802
808
|
|
|
803
809
|
// src/artifacts/js/cx.ts
|
|
804
810
|
import outdent7 from "outdent";
|
|
805
|
-
function generateCx() {
|
|
811
|
+
function generateCx(ctx) {
|
|
806
812
|
return {
|
|
807
813
|
js: outdent7`
|
|
814
|
+
${ctx.file.import("cssCache, css, mergeCss", "./css")}
|
|
815
|
+
|
|
808
816
|
function cx() {
|
|
817
|
+
const objs = []
|
|
809
818
|
let str = '',
|
|
810
819
|
i = 0,
|
|
811
820
|
arg
|
|
812
|
-
|
|
821
|
+
|
|
813
822
|
for (; i < arguments.length; ) {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
823
|
+
arg = arguments[i++]
|
|
824
|
+
if (!arg || typeof arg !== 'string') continue
|
|
825
|
+
|
|
826
|
+
if (cssCache.has(arg)) {
|
|
827
|
+
objs.push(cssCache.get(arg))
|
|
828
|
+
continue
|
|
817
829
|
}
|
|
830
|
+
|
|
831
|
+
str && (str += ' ')
|
|
832
|
+
str += arg.toString()
|
|
818
833
|
}
|
|
819
|
-
|
|
834
|
+
|
|
835
|
+
const merged = mergeCss(...objs)
|
|
836
|
+
return [css(merged), str].join(' ')
|
|
820
837
|
}
|
|
821
|
-
|
|
838
|
+
|
|
822
839
|
export { cx }
|
|
823
840
|
`,
|
|
824
841
|
dts: outdent7`
|
|
@@ -870,14 +887,14 @@ function generateHelpers(ctx) {
|
|
|
870
887
|
|
|
871
888
|
// src/artifacts/generated/is-valid-prop.mjs.json
|
|
872
889
|
var is_valid_prop_mjs_default = {
|
|
873
|
-
content: '// src/index.ts\nvar userGeneratedStr = "";\nvar userGenerated = userGeneratedStr.split(",");\nvar cssPropertiesStr = "WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationTimingFunction,animationTimeline,appearance,aspectRatio,azimuth,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockOverflow,blockSize,border,borderBlock,borderBlockColor,borderBlockStyle,borderBlockWidth,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineEnd,borderInlineColor,borderInlineStyle,borderInlineWidth,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,color,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicSize,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,direction,display,emptyCells,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontVariationSettings,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inputSecurity,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,printColorAdjust,quotes,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockStart,scrollMarginBlockEnd,scrollMarginBottom,scrollMarginInline,scrollMarginInlineStart,scrollMarginInlineEnd,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineStart,scrollPaddingInlineEnd,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,shapeImageThreshold,shapeMargin,shapeOutside,tabSize,tableLayout,textAlign,textAlignLast,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textTransform,textUnderlineOffset,textUnderlinePosition,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,verticalAlign,viewTransitionName,visibility,whiteSpace,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,zIndex,zoom";\nvar allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);\nvar properties = new Map(allCssProperties.map((prop) => [prop, true]));\nfunction memo(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (arg) => {\n if (cache[arg] === void 0)\n cache[arg] = fn(arg);\n return cache[arg];\n };\n}\nvar
|
|
890
|
+
content: '// src/index.ts\nvar userGeneratedStr = "";\nvar userGenerated = userGeneratedStr.split(",");\nvar cssPropertiesStr = "WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationTimingFunction,animationTimeline,appearance,aspectRatio,azimuth,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockOverflow,blockSize,border,borderBlock,borderBlockColor,borderBlockStyle,borderBlockWidth,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineEnd,borderInlineColor,borderInlineStyle,borderInlineWidth,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,color,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicSize,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,direction,display,emptyCells,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontVariationSettings,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inputSecurity,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,printColorAdjust,quotes,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockStart,scrollMarginBlockEnd,scrollMarginBottom,scrollMarginInline,scrollMarginInlineStart,scrollMarginInlineEnd,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineStart,scrollPaddingInlineEnd,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,shapeImageThreshold,shapeMargin,shapeOutside,tabSize,tableLayout,textAlign,textAlignLast,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textTransform,textUnderlineOffset,textUnderlinePosition,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,verticalAlign,viewTransitionName,visibility,whiteSpace,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,zIndex,zoom,alignmentBaseline,baselineShift,clipRule,colorInterpolation,colorRendering,dominantBaseline,fill,fillOpacity,fillRule,floodColor,floodOpacity,glyphOrientationVertical,lightingColor,marker,markerEnd,markerMid,markerStart,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,textAnchor,vectorEffect";\nvar allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);\nvar properties = new Map(allCssProperties.map((prop) => [prop, true]));\nfunction memo(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (arg) => {\n if (cache[arg] === void 0)\n cache[arg] = fn(arg);\n return cache[arg];\n };\n}\nvar cssPropertySelectorRegex = /&|@/;\nvar isCssProperty = /* @__PURE__ */ memo((prop) => {\n return properties.has(prop) || prop.startsWith("--") || cssPropertySelectorRegex.test(prop);\n});\nexport {\n allCssProperties,\n isCssProperty\n};\n'
|
|
874
891
|
};
|
|
875
892
|
|
|
876
893
|
// src/artifacts/js/is-valid-prop.ts
|
|
877
894
|
import { outdent as outdent9 } from "outdent";
|
|
878
895
|
import { match } from "ts-pattern";
|
|
879
896
|
var cssPropRegex = /var cssPropertiesStr = ".*?";/;
|
|
880
|
-
var memoFnDeclarationRegex = /function memo(.+?)\nvar
|
|
897
|
+
var memoFnDeclarationRegex = /function memo(.+?)\nvar cssPropertySelectorRegex/s;
|
|
881
898
|
function generateIsValidProp(ctx) {
|
|
882
899
|
if (ctx.isTemplateLiteralSyntax)
|
|
883
900
|
return;
|
|
@@ -886,7 +903,7 @@ function generateIsValidProp(ctx) {
|
|
|
886
903
|
'var userGeneratedStr = "";',
|
|
887
904
|
`var userGeneratedStr = "${match(ctx.jsx.styleProps).with("all", () => Array.from(new Set(ctx.properties)).join(",")).with("minimal", () => "css").with("none", () => "").exhaustive()}"`
|
|
888
905
|
);
|
|
889
|
-
content = content.replace(memoFnDeclarationRegex, "var
|
|
906
|
+
content = content.replace(memoFnDeclarationRegex, "var cssPropertySelectorRegex");
|
|
890
907
|
if (ctx.jsx.styleProps === "minimal" || ctx.jsx.styleProps === "none") {
|
|
891
908
|
content = content.replace("/* @__PURE__ */ memo(", "/* @__PURE__ */ (");
|
|
892
909
|
content = content.replace(cssPropRegex, 'var cssPropertiesStr = "";');
|
|
@@ -926,8 +943,9 @@ function generatePattern(ctx) {
|
|
|
926
943
|
name: dashName,
|
|
927
944
|
dts: outdent10`
|
|
928
945
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
929
|
-
import type { PropertyValue } from '../types/prop-type'
|
|
930
946
|
import type { Properties } from '../types/csstype'
|
|
947
|
+
import type { PropertyValue } from '../types/prop-type'
|
|
948
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
931
949
|
import type { Tokens } from '../tokens'
|
|
932
950
|
|
|
933
951
|
export type ${upperName}Properties = {
|
|
@@ -948,13 +966,13 @@ function generatePattern(ctx) {
|
|
|
948
966
|
}).join("\n ")}
|
|
949
967
|
}
|
|
950
968
|
|
|
951
|
-
${strict ? outdent10`export declare function ${baseName}(
|
|
969
|
+
${strict ? outdent10`export declare function ${baseName}(styles: ${upperName}Properties): string` : outdent10`
|
|
952
970
|
|
|
953
|
-
type ${upperName}
|
|
971
|
+
type ${upperName}Styles = ${upperName}Properties & DistributiveOmit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
954
972
|
|
|
955
973
|
interface ${upperName}PatternFn {
|
|
956
|
-
(
|
|
957
|
-
raw: (
|
|
974
|
+
(styles?: ${upperName}Styles): string
|
|
975
|
+
raw: (styles: ${upperName}Styles) => ${upperName}Styles
|
|
958
976
|
}
|
|
959
977
|
|
|
960
978
|
${description ? `/** ${description} */` : ""}
|
|
@@ -1097,6 +1115,7 @@ function generateRecipes(ctx) {
|
|
|
1097
1115
|
dts: outdent11`
|
|
1098
1116
|
import type { ConditionalValue } from '../types'
|
|
1099
1117
|
import type { Pretty } from '../types/helpers'
|
|
1118
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
1100
1119
|
|
|
1101
1120
|
type ${upperName}Variant = {
|
|
1102
1121
|
${Object.keys(variantKeyMap).map((key) => {
|
|
@@ -1121,7 +1140,7 @@ function generateRecipes(ctx) {
|
|
|
1121
1140
|
raw: (props?: ${upperName}VariantProps) => ${upperName}VariantProps
|
|
1122
1141
|
variantMap: ${upperName}VariantMap
|
|
1123
1142
|
variantKeys: Array<keyof ${upperName}Variant>
|
|
1124
|
-
splitVariantProps<Props extends ${upperName}VariantProps>(props: Props): [${upperName}VariantProps, Pretty<
|
|
1143
|
+
splitVariantProps<Props extends ${upperName}VariantProps>(props: Props): [${upperName}VariantProps, Pretty<DistributiveOmit<Props, keyof ${upperName}VariantProps>>]
|
|
1125
1144
|
}
|
|
1126
1145
|
|
|
1127
1146
|
${description ? `/** ${description} */` : ""}
|
|
@@ -1311,8 +1330,9 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1311
1330
|
import type { FunctionComponent } from 'preact'
|
|
1312
1331
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1313
1332
|
import type { ${typeName} } from '../types/jsx'
|
|
1333
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
1314
1334
|
|
|
1315
|
-
export type ${upperName}Props = ${upperName}Properties &
|
|
1335
|
+
export type ${upperName}Props = ${upperName}Properties & DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
1316
1336
|
|
|
1317
1337
|
${description ? `/** ${description} */` : ""}
|
|
1318
1338
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
@@ -1548,18 +1568,15 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1548
1568
|
}
|
|
1549
1569
|
`,
|
|
1550
1570
|
dts: outdent20`
|
|
1551
|
-
import type {
|
|
1571
|
+
import type { Component } from '@builder.io/qwik'
|
|
1552
1572
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1553
1573
|
import type { ${typeName} } from '../types/jsx'
|
|
1554
|
-
|
|
1555
|
-
type Assign<T, U> = {
|
|
1556
|
-
[K in keyof T]?: K extends keyof T ? (K extends keyof U ? T[K] & U[K] : T[K]) : never
|
|
1557
|
-
} & U
|
|
1574
|
+
import type { Assign, DistributiveOmit } from '../types/system-types'
|
|
1558
1575
|
|
|
1559
|
-
export type ${upperName}Props = Assign<${typeName}<'${jsxElement}'>,
|
|
1576
|
+
export type ${upperName}Props = Assign<${typeName}<'${jsxElement}'>, DistributiveOmit<${upperName}Properties, ${blocklistType || '""'}>>
|
|
1560
1577
|
|
|
1561
1578
|
${description ? `/** ${description} */` : ""}
|
|
1562
|
-
export declare const ${jsxName}:
|
|
1579
|
+
export declare const ${jsxName}: Component<${upperName}Props>
|
|
1563
1580
|
`
|
|
1564
1581
|
};
|
|
1565
1582
|
});
|
|
@@ -1575,37 +1592,21 @@ import { ${upperName} } from '../types/jsx'
|
|
|
1575
1592
|
export declare const ${factoryName}: ${upperName}
|
|
1576
1593
|
`,
|
|
1577
1594
|
jsxType: outdent21`
|
|
1578
|
-
import type {
|
|
1579
|
-
import type { Assign
|
|
1595
|
+
import type { Component, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1596
|
+
import type { Assign, JsxStyleProps, PatchedHTMLProps } from './system-types'
|
|
1580
1597
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
1581
1598
|
|
|
1582
|
-
type ElementType = keyof QwikIntrinsicElements |
|
|
1599
|
+
type ElementType = keyof QwikIntrinsicElements | Component<any>
|
|
1583
1600
|
|
|
1584
1601
|
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1585
1602
|
? QwikIntrinsicElements[T]
|
|
1586
|
-
: T extends
|
|
1603
|
+
: T extends Component<infer P>
|
|
1587
1604
|
? P
|
|
1588
1605
|
: never
|
|
1589
1606
|
|
|
1590
1607
|
type Dict = Record<string, unknown>
|
|
1591
1608
|
|
|
1592
|
-
type
|
|
1593
|
-
|
|
1594
|
-
// Patch due to Omit<T, K> not working with Qwik JSX Types
|
|
1595
|
-
|
|
1596
|
-
type Assign<T, U> = {
|
|
1597
|
-
[K in keyof T]?: K extends Omitted
|
|
1598
|
-
? K extends keyof U
|
|
1599
|
-
? U[K]
|
|
1600
|
-
: never
|
|
1601
|
-
: K extends keyof T
|
|
1602
|
-
? K extends keyof U
|
|
1603
|
-
? T[K] & U[K]
|
|
1604
|
-
: T[K]
|
|
1605
|
-
: never
|
|
1606
|
-
} & U & PatchedHTMLProps
|
|
1607
|
-
|
|
1608
|
-
export type ${componentName}<T extends ElementType, P extends Dict = {}> = FunctionComponent<Assign<ComponentProps<T>, _Assign<JsxStyleProps, P>>>
|
|
1609
|
+
export type ${componentName}<T extends ElementType, P extends Dict = {}> = Component<Assign<ComponentProps<T> & PatchedHTMLProps, Assign<JsxStyleProps, P>>>
|
|
1609
1610
|
|
|
1610
1611
|
type RecipeFn = { __type: any }
|
|
1611
1612
|
|
|
@@ -1686,13 +1687,13 @@ import { ${upperName} } from '../types/jsx'
|
|
|
1686
1687
|
export declare const ${factoryName}: ${upperName}
|
|
1687
1688
|
`,
|
|
1688
1689
|
jsxType: outdent23`
|
|
1689
|
-
import type {
|
|
1690
|
+
import type { Component, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1690
1691
|
|
|
1691
|
-
type ElementType = keyof QwikIntrinsicElements |
|
|
1692
|
+
type ElementType = keyof QwikIntrinsicElements | Component<any>
|
|
1692
1693
|
|
|
1693
1694
|
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1694
1695
|
? QwikIntrinsicElements[T]
|
|
1695
|
-
: T extends
|
|
1696
|
+
: T extends Component<infer P>
|
|
1696
1697
|
? P
|
|
1697
1698
|
: never
|
|
1698
1699
|
|
|
@@ -1855,8 +1856,9 @@ function generateReactJsxPattern(ctx) {
|
|
|
1855
1856
|
import type { FunctionComponent } from 'react'
|
|
1856
1857
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1857
1858
|
import type { ${typeName} } from '../types/jsx'
|
|
1859
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
1858
1860
|
|
|
1859
|
-
export type ${upperName}Props = ${upperName}Properties &
|
|
1861
|
+
export type ${upperName}Props = ${upperName}Properties & DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
1860
1862
|
|
|
1861
1863
|
${description ? `/** ${description} */` : ""}
|
|
1862
1864
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
@@ -1876,12 +1878,12 @@ export declare const ${factoryName}: ${upperName}
|
|
|
1876
1878
|
`,
|
|
1877
1879
|
jsxType: outdent26`
|
|
1878
1880
|
import type { ComponentPropsWithoutRef, ElementType, ElementRef, Ref } from 'react'
|
|
1879
|
-
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1881
|
+
import type { Assign, DistributiveOmit, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1880
1882
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
1881
1883
|
|
|
1882
1884
|
type Dict = Record<string, unknown>
|
|
1883
1885
|
|
|
1884
|
-
type ComponentProps<T extends ElementType> =
|
|
1886
|
+
type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1885
1887
|
ref?: Ref<ElementRef<T>>
|
|
1886
1888
|
}
|
|
1887
1889
|
|
|
@@ -1971,10 +1973,11 @@ export declare const ${factoryName}: ${upperName}
|
|
|
1971
1973
|
`,
|
|
1972
1974
|
jsxType: outdent28`
|
|
1973
1975
|
import type { ComponentPropsWithoutRef, ElementType, ElementRef, Ref } from 'react'
|
|
1976
|
+
import type { DistributiveOmit } from '../types/system-types'
|
|
1974
1977
|
|
|
1975
1978
|
type Dict = Record<string, unknown>
|
|
1976
1979
|
|
|
1977
|
-
type ComponentProps<T extends ElementType> =
|
|
1980
|
+
type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
1978
1981
|
ref?: Ref<ElementRef<T>>
|
|
1979
1982
|
}
|
|
1980
1983
|
|
|
@@ -2010,7 +2013,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2010
2013
|
${ctx.file.import("allCssProperties", "./is-valid-prop")}
|
|
2011
2014
|
|
|
2012
2015
|
function styledFn(element, configOrCva = {}) {
|
|
2013
|
-
const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
|
|
2016
|
+
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
2014
2017
|
|
|
2015
2018
|
return function ${componentName}(props) {
|
|
2016
2019
|
const mergedProps = mergeProps({ as: element }, props)
|
|
@@ -2113,8 +2116,9 @@ function generateSolidJsxPattern(ctx) {
|
|
|
2113
2116
|
import { Component } from 'solid-js'
|
|
2114
2117
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
2115
2118
|
import { ${typeName} } from '../types/jsx'
|
|
2119
|
+
import { DistributiveOmit } from '../types/system-types'
|
|
2116
2120
|
|
|
2117
|
-
export type ${upperName}Props = ${upperName}Properties &
|
|
2121
|
+
export type ${upperName}Props = ${upperName}Properties & DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
2118
2122
|
|
|
2119
2123
|
${description ? `/** ${description} */` : ""}
|
|
2120
2124
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
@@ -2420,8 +2424,9 @@ function generateVueJsxPattern(ctx) {
|
|
|
2420
2424
|
import { FunctionalComponent } from 'vue'
|
|
2421
2425
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
2422
2426
|
import { ${typeName} } from '../types/jsx'
|
|
2427
|
+
import { DistributiveOmit } from '../types/system-types'
|
|
2423
2428
|
|
|
2424
|
-
export type ${upperName}Props = ${upperName}Properties &
|
|
2429
|
+
export type ${upperName}Props = ${upperName}Properties & DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
2425
2430
|
|
|
2426
2431
|
${description ? `/** ${description} */` : ""}
|
|
2427
2432
|
export declare const ${jsxName}: FunctionalComponent<${upperName}Props>
|
|
@@ -2858,7 +2863,7 @@ var csstype_d_ts_default = {
|
|
|
2858
2863
|
|
|
2859
2864
|
// src/artifacts/generated/system-types.d.ts.json
|
|
2860
2865
|
var system_types_d_ts_default = {
|
|
2861
|
-
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 type CssProperties = PropertiesFallback<String | Number> & 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 & 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 * -----------------------------------------------------------------------------*/\ntype WithCss = { css?: SystemStyleObject }\ntype StyleProps = SystemProperties & MinimalNested<SystemStyleObject>\n\nexport type JsxStyleProps = StyleProps & WithCss\n\nexport type
|
|
2866
|
+
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 type CssProperties = PropertiesFallback<String | Number> & 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 & 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 * -----------------------------------------------------------------------------*/\ntype WithCss = { css?: SystemStyleObject }\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 type 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"
|
|
2862
2867
|
};
|
|
2863
2868
|
|
|
2864
2869
|
// src/artifacts/generated/composition.d.ts.json
|
|
@@ -2868,7 +2873,7 @@ var composition_d_ts_default = {
|
|
|
2868
2873
|
|
|
2869
2874
|
// src/artifacts/generated/recipe.d.ts.json
|
|
2870
2875
|
var recipe_d_ts_default = {
|
|
2871
|
-
content: "import type { SystemStyleObject } 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 type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n resolve: (props: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<
|
|
2876
|
+
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 type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n resolve: (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 type 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\ntype 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 type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & 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 type SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>> = SlotRecipeVariantFn<S, T> & {\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 type 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"
|
|
2872
2877
|
};
|
|
2873
2878
|
|
|
2874
2879
|
// src/artifacts/generated/pattern.d.ts.json
|
|
@@ -3023,7 +3028,10 @@ var categories = [
|
|
|
3023
3028
|
"assets"
|
|
3024
3029
|
];
|
|
3025
3030
|
function generateTokenTypes(ctx) {
|
|
3026
|
-
const {
|
|
3031
|
+
const {
|
|
3032
|
+
tokens,
|
|
3033
|
+
config: { theme }
|
|
3034
|
+
} = ctx;
|
|
3027
3035
|
const set = /* @__PURE__ */ new Set();
|
|
3028
3036
|
set.add(`export type Token = ${tokens.isEmpty ? "string" : unionType3(tokens.allNames)}`);
|
|
3029
3037
|
const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
|
|
@@ -3039,6 +3047,9 @@ function generateTokenTypes(ctx) {
|
|
|
3039
3047
|
set.add(`export type ${typeName}Token = ${unionType3(value.keys())}`);
|
|
3040
3048
|
result.add(` ${key}: ${typeName}Token`);
|
|
3041
3049
|
}
|
|
3050
|
+
const keyframes = Object.keys(theme?.keyframes ?? {});
|
|
3051
|
+
set.add(`export type AnimationName = ${unionType3(keyframes)}`);
|
|
3052
|
+
result.add(` animationName: AnimationName`);
|
|
3042
3053
|
}
|
|
3043
3054
|
result.add("} & { [token: string]: never }");
|
|
3044
3055
|
set.add(Array.from(result).join("\n"));
|
|
@@ -3137,7 +3148,7 @@ function setupSva(ctx) {
|
|
|
3137
3148
|
};
|
|
3138
3149
|
}
|
|
3139
3150
|
function setupCx(ctx) {
|
|
3140
|
-
const code = generateCx();
|
|
3151
|
+
const code = generateCx(ctx);
|
|
3141
3152
|
return {
|
|
3142
3153
|
dir: ctx.paths.css,
|
|
3143
3154
|
files: [
|
|
@@ -3303,7 +3314,7 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
3303
3314
|
const { files, resolve } = options;
|
|
3304
3315
|
const { theme: { keyframes } = {}, preflight, minify, staticCss } = ctx.config;
|
|
3305
3316
|
const unresolved = [
|
|
3306
|
-
|
|
3317
|
+
ctx.layerString,
|
|
3307
3318
|
preflight && "@import './reset.css';",
|
|
3308
3319
|
"@import './global.css';",
|
|
3309
3320
|
staticCss && "@import './static.css';",
|
|
@@ -3460,12 +3471,20 @@ var getBaseEngine = (conf) => {
|
|
|
3460
3471
|
});
|
|
3461
3472
|
const compositionContext = { conditions, utility };
|
|
3462
3473
|
assignCompositions(compositions, compositionContext);
|
|
3474
|
+
const layers = config.layers;
|
|
3475
|
+
const layerNames = Object.values(layers);
|
|
3476
|
+
const isValidLayerRule = memo((layerRule) => {
|
|
3477
|
+
const names = new Set(layerRule.split(",").map((name) => name.trim()));
|
|
3478
|
+
return names.size >= 5 && layerNames.every((name) => names.has(name));
|
|
3479
|
+
});
|
|
3480
|
+
const layerString = `@layer ${layerNames.join(", ")};`;
|
|
3463
3481
|
const createSheetContext = () => ({
|
|
3464
3482
|
root: postcss3.root(),
|
|
3465
3483
|
conditions,
|
|
3466
3484
|
utility,
|
|
3467
3485
|
hash: hash.className,
|
|
3468
|
-
helpers
|
|
3486
|
+
helpers,
|
|
3487
|
+
layers
|
|
3469
3488
|
});
|
|
3470
3489
|
const createSheet = (options) => {
|
|
3471
3490
|
const sheetContext = createSheetContext();
|
|
@@ -3501,7 +3520,12 @@ var getBaseEngine = (conf) => {
|
|
|
3501
3520
|
recipes,
|
|
3502
3521
|
conditions,
|
|
3503
3522
|
createSheetContext,
|
|
3504
|
-
createSheet
|
|
3523
|
+
createSheet,
|
|
3524
|
+
// cascade layer
|
|
3525
|
+
layers,
|
|
3526
|
+
isValidLayerRule,
|
|
3527
|
+
layerString,
|
|
3528
|
+
layerNames
|
|
3505
3529
|
};
|
|
3506
3530
|
};
|
|
3507
3531
|
|
|
@@ -3610,7 +3634,15 @@ var defaults = (conf) => ({
|
|
|
3610
3634
|
outExtension: "mjs",
|
|
3611
3635
|
shorthands: true,
|
|
3612
3636
|
syntax: "object-literal",
|
|
3613
|
-
...conf.config
|
|
3637
|
+
...conf.config,
|
|
3638
|
+
layers: {
|
|
3639
|
+
reset: "reset",
|
|
3640
|
+
base: "base",
|
|
3641
|
+
tokens: "tokens",
|
|
3642
|
+
recipes: "recipes",
|
|
3643
|
+
utilities: "utilities",
|
|
3644
|
+
...conf.config.layers
|
|
3645
|
+
}
|
|
3614
3646
|
}
|
|
3615
3647
|
});
|
|
3616
3648
|
var getImportMap = (outdir) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "8.4.27",
|
|
22
22
|
"ts-pattern": "5.0.4",
|
|
23
|
-
"@pandacss/core": "0.
|
|
24
|
-
"@pandacss/is-valid-prop": "0.
|
|
25
|
-
"@pandacss/logger": "0.
|
|
26
|
-
"@pandacss/shared": "0.
|
|
27
|
-
"@pandacss/token-dictionary": "0.
|
|
28
|
-
"@pandacss/types": "0.
|
|
23
|
+
"@pandacss/core": "0.12.0",
|
|
24
|
+
"@pandacss/is-valid-prop": "0.12.0",
|
|
25
|
+
"@pandacss/logger": "0.12.0",
|
|
26
|
+
"@pandacss/shared": "0.12.0",
|
|
27
|
+
"@pandacss/token-dictionary": "0.12.0",
|
|
28
|
+
"@pandacss/types": "0.12.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.30",
|
|
32
32
|
"hookable": "5.5.3",
|
|
33
|
-
"@pandacss/fixture": "0.
|
|
33
|
+
"@pandacss/fixture": "0.12.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "tsx scripts/prebuild.ts",
|