@pandacss/studio 0.15.5 → 0.17.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/studio.js +2 -2
- package/dist/studio.mjs +2 -2
- package/package.json +13 -13
- package/panda.config.ts +3 -3
- package/styled-system/css/conditions.mjs +1 -1
- package/styled-system/css/cva.mjs +24 -2
- package/styled-system/helpers.mjs +6 -1
- package/styled-system/jsx/factory-helper.mjs +22 -0
- package/styled-system/jsx/factory.mjs +15 -8
- package/styled-system/jsx/is-valid-prop.mjs +1 -1
- package/styled-system/types/composition.d.ts +1 -5
- package/styled-system/types/conditions.d.ts +2 -0
- package/styled-system/types/jsx.d.ts +20 -8
- package/styled-system/types/system-types.d.ts +12 -6
package/dist/studio.js
CHANGED
|
@@ -33,10 +33,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.
|
|
36
|
+
// ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.31_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
|
|
37
37
|
var getImportMetaUrl, importMetaUrl;
|
|
38
38
|
var init_cjs_shims = __esm({
|
|
39
|
-
"../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.
|
|
39
|
+
"../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.31_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
|
|
40
40
|
"use strict";
|
|
41
41
|
getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
42
42
|
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
package/dist/studio.mjs
CHANGED
|
@@ -34,12 +34,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
mod
|
|
35
35
|
));
|
|
36
36
|
|
|
37
|
-
// ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.
|
|
37
|
+
// ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.31_typescript@5.2.2/node_modules/tsup/assets/esm_shims.js
|
|
38
38
|
import { fileURLToPath } from "url";
|
|
39
39
|
import path from "path";
|
|
40
40
|
var getFilename, getDirname, __dirname;
|
|
41
41
|
var init_esm_shims = __esm({
|
|
42
|
-
"../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.
|
|
42
|
+
"../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.31_typescript@5.2.2/node_modules/tsup/assets/esm_shims.js"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
45
45
|
getDirname = () => path.dirname(getFilename());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "The automated token documentation for Panda CSS",
|
|
5
5
|
"main": "dist/studio.js",
|
|
6
6
|
"module": "dist/studio.mjs",
|
|
@@ -32,28 +32,28 @@
|
|
|
32
32
|
"javascript-stringify": "2.1.0",
|
|
33
33
|
"react": "18.2.0",
|
|
34
34
|
"react-dom": "18.2.0",
|
|
35
|
-
"vite": "4.4.
|
|
36
|
-
"@pandacss/config": "0.
|
|
37
|
-
"@pandacss/logger": "0.
|
|
38
|
-
"@pandacss/node": "0.
|
|
39
|
-
"@pandacss/shared": "0.
|
|
40
|
-
"@pandacss/token-dictionary": "0.
|
|
41
|
-
"@pandacss/types": "0.
|
|
35
|
+
"vite": "4.4.11",
|
|
36
|
+
"@pandacss/config": "0.17.0",
|
|
37
|
+
"@pandacss/logger": "0.17.0",
|
|
38
|
+
"@pandacss/node": "0.17.0",
|
|
39
|
+
"@pandacss/shared": "0.17.0",
|
|
40
|
+
"@pandacss/token-dictionary": "0.17.0",
|
|
41
|
+
"@pandacss/types": "0.17.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "18.2.22",
|
|
45
45
|
"@types/react-dom": "18.2.7",
|
|
46
46
|
"@vitejs/plugin-react": "4.0.4",
|
|
47
|
-
"execa": "7.2.0"
|
|
48
|
-
"@pandacss/dev": "0.15.5"
|
|
47
|
+
"execa": "7.2.0"
|
|
49
48
|
},
|
|
50
49
|
"scripts": {
|
|
51
|
-
"
|
|
50
|
+
"panda": "node ../cli/bin.js",
|
|
51
|
+
"codegen": "node ../cli/bin.js codegen",
|
|
52
52
|
"build": "tsup scripts --format=esm,cjs --dts --no-splitting --shims",
|
|
53
|
-
"postbuild": "panda",
|
|
53
|
+
"postbuild": "pnpm panda",
|
|
54
54
|
"build-fast": "tsup scripts --format=esm,cjs --no-dts --no-splitting --shims",
|
|
55
55
|
"dev": "pnpm build-fast --watch scripts",
|
|
56
|
-
"dev:panda": "
|
|
56
|
+
"dev:panda": "node ../cli/bin.js --clean --watch",
|
|
57
57
|
"dev:astro": "astro dev",
|
|
58
58
|
"start": "concurrently \"pnpm dev:panda\" \"pnpm dev:astro\""
|
|
59
59
|
}
|
package/panda.config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Config } from '@pandacss/types'
|
|
2
2
|
|
|
3
|
-
export default
|
|
3
|
+
export default {
|
|
4
4
|
gitignore: false,
|
|
5
5
|
preflight: true,
|
|
6
6
|
include: ['./src/**/*.{tsx,jsx,astro}'],
|
|
@@ -107,4 +107,4 @@ export default defineConfig({
|
|
|
107
107
|
minHeight: '100vh',
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
|
-
}
|
|
110
|
+
} satisfies Config
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withoutSpace } from '../helpers.mjs';
|
|
2
2
|
|
|
3
|
-
const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base"
|
|
3
|
+
const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base"
|
|
4
4
|
const conditions = new Set(conditionsStr.split(','))
|
|
5
5
|
|
|
6
6
|
export function isCondition(value){
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { compact, splitProps } from '../helpers.mjs';
|
|
1
|
+
import { compact, mergeProps, splitProps, uniq } from '../helpers.mjs';
|
|
2
2
|
import { css, mergeCss } from './css.mjs';
|
|
3
3
|
|
|
4
|
+
const defaults = (conf) => ({
|
|
5
|
+
base: {},
|
|
6
|
+
variants: {},
|
|
7
|
+
defaultVariants: {},
|
|
8
|
+
compoundVariants: [],
|
|
9
|
+
...conf,
|
|
10
|
+
})
|
|
11
|
+
|
|
4
12
|
export function cva(config) {
|
|
5
|
-
const { base
|
|
13
|
+
const { base, variants, defaultVariants, compoundVariants } = defaults(config)
|
|
6
14
|
|
|
7
15
|
function resolve(props = {}) {
|
|
8
16
|
const computedVariants = { ...defaultVariants, ...compact(props) }
|
|
@@ -16,6 +24,19 @@ export function cva(config) {
|
|
|
16
24
|
return mergeCss(variantCss, compoundVariantCss)
|
|
17
25
|
}
|
|
18
26
|
|
|
27
|
+
function merge(cvaConfig) {
|
|
28
|
+
const override = defaults(cvaConfig)
|
|
29
|
+
const variantKeys = uniq(override.variantKeys, Object.keys(variants))
|
|
30
|
+
return cva({
|
|
31
|
+
base: mergeCss(base, override.base),
|
|
32
|
+
variants: Object.fromEntries(
|
|
33
|
+
variantKeys.map((key) => [key, mergeCss(variants[key], override.variants[key])]),
|
|
34
|
+
),
|
|
35
|
+
defaultVariants: mergeProps(defaultVariants, override.defaultVariants),
|
|
36
|
+
compoundVariants: [...compoundVariants, ...override.compoundVariants],
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
19
40
|
function cvaFn(props) {
|
|
20
41
|
return css(resolve(props))
|
|
21
42
|
}
|
|
@@ -34,6 +55,7 @@ export function cva(config) {
|
|
|
34
55
|
variantKeys,
|
|
35
56
|
raw: resolve,
|
|
36
57
|
config,
|
|
58
|
+
merge,
|
|
37
59
|
splitVariantProps,
|
|
38
60
|
})
|
|
39
61
|
}
|
|
@@ -49,8 +49,9 @@ function toHash(value) {
|
|
|
49
49
|
|
|
50
50
|
// src/merge-props.ts
|
|
51
51
|
function mergeProps(...sources) {
|
|
52
|
+
const __sources = sources.filter(Boolean);
|
|
52
53
|
const result = {};
|
|
53
|
-
for (const source of
|
|
54
|
+
for (const source of __sources) {
|
|
54
55
|
for (const [key, value] of Object.entries(source)) {
|
|
55
56
|
if (isObject(value)) {
|
|
56
57
|
result[key] = mergeProps(result[key] || {}, value);
|
|
@@ -250,6 +251,9 @@ function splitProps(props, ...keys) {
|
|
|
250
251
|
const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
|
|
251
252
|
return keys.map(fn).concat(split(dKeys));
|
|
252
253
|
}
|
|
254
|
+
|
|
255
|
+
// src/uniq.ts
|
|
256
|
+
var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);
|
|
253
257
|
export {
|
|
254
258
|
compact,
|
|
255
259
|
createCss,
|
|
@@ -265,6 +269,7 @@ export {
|
|
|
265
269
|
mergeProps,
|
|
266
270
|
splitProps,
|
|
267
271
|
toHash,
|
|
272
|
+
uniq,
|
|
268
273
|
walkObject,
|
|
269
274
|
withoutSpace
|
|
270
275
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isCssProperty } from './is-valid-prop.mjs';
|
|
2
|
+
|
|
3
|
+
export const defaultShouldForwardProp = (prop, variantKeys) => !variantKeys.includes(prop) && !isCssProperty(prop)
|
|
4
|
+
|
|
5
|
+
export const composeShouldForwardProps = (tag, shouldForwardProp) =>
|
|
6
|
+
tag.__shouldForwardProps__ && shouldForwardProp
|
|
7
|
+
? (propName) => tag.__shouldForwardProps__(propName) && shouldForwardProp(propName)
|
|
8
|
+
: shouldForwardProp
|
|
9
|
+
|
|
10
|
+
export const composeCvaFn = (cvaA, cvaB) => {
|
|
11
|
+
if (cvaA && !cvaB) return cvaA
|
|
12
|
+
if (!cvaA && cvaB) return cvaB
|
|
13
|
+
if ((cvaA.__cva__ && cvaB.__cva__) || (cvaA.__recipe__ && cvaB.__recipe__)) return cvaA.merge(cvaB.config)
|
|
14
|
+
const error = new TypeError('Cannot merge cva with recipe. Please use either cva or recipe.')
|
|
15
|
+
TypeError.captureStackTrace?.(error)
|
|
16
|
+
throw error
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const getDisplayName = (Component) => {
|
|
20
|
+
if (typeof Component === 'string') return Component
|
|
21
|
+
return Component?.displayName || Component?.name || 'Component'
|
|
22
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { createElement, forwardRef, useMemo } from 'react'
|
|
2
2
|
import { css, cx, cva } from '../css/index.mjs';
|
|
3
|
+
import { defaultShouldForwardProp, composeShouldForwardProps, composeCvaFn, getDisplayName } from './factory-helper.mjs';
|
|
3
4
|
import { splitProps, normalizeHTMLProps } from '../helpers.mjs';
|
|
4
5
|
import { isCssProperty } from './is-valid-prop.mjs';
|
|
5
6
|
|
|
6
|
-
const defaultShouldForwardProp = (prop, variantKeys) => !variantKeys.includes(prop) && !isCssProperty(prop)
|
|
7
|
-
|
|
8
7
|
function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
|
9
8
|
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
10
9
|
|
|
@@ -17,23 +16,26 @@ function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
|
|
17
16
|
)
|
|
18
17
|
|
|
19
18
|
const PandaComponent = /* @__PURE__ */ forwardRef(function PandaComponent(props, ref) {
|
|
20
|
-
const { as: Element = Dynamic, children, ...restProps } = props
|
|
19
|
+
const { as: Element = Dynamic.__base__ || Dynamic, children, ...restProps } = props
|
|
20
|
+
|
|
21
|
+
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
|
|
22
|
+
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
21
23
|
|
|
22
24
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
23
25
|
|
|
24
26
|
const [forwardedProps, variantProps, styleProps, htmlProps, elementProps] = useMemo(() => {
|
|
25
|
-
return splitProps(combinedProps,
|
|
27
|
+
return splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty, normalizeHTMLProps.keys)
|
|
26
28
|
}, [combinedProps])
|
|
27
29
|
|
|
28
30
|
function recipeClass() {
|
|
29
31
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
30
|
-
const compoundVariantStyles =
|
|
31
|
-
return cx(
|
|
32
|
+
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
33
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.className)
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
function cvaClass() {
|
|
35
37
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
36
|
-
const cvaStyles =
|
|
38
|
+
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
37
39
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.className)
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -49,8 +51,13 @@ function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
|
|
49
51
|
})
|
|
50
52
|
})
|
|
51
53
|
|
|
52
|
-
const name = (
|
|
54
|
+
const name = getDisplayName(Dynamic)
|
|
55
|
+
|
|
53
56
|
PandaComponent.displayName = `panda.${name}`
|
|
57
|
+
PandaComponent.__cva__ = cvaFn
|
|
58
|
+
PandaComponent.__base__ = Dynamic
|
|
59
|
+
PandaComponent.__shouldForwardProps__ = shouldForwardProp
|
|
60
|
+
|
|
54
61
|
return PandaComponent
|
|
55
62
|
}
|
|
56
63
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { memo } from '../helpers.mjs';
|
|
2
2
|
// src/index.ts
|
|
3
|
-
var userGeneratedStr = "css,pos,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,insetInline,insetBlock,inset,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,insetX,insetY,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,outlineWidth,outlineColor,outline,outlineOffset,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,color,fontFamily,fontSize,fontWeight,fontSmoothing,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,textGradient,gradientFrom,gradientTo,gradientVia,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationDelay,transformOrigin,scale,scaleX,scaleY,translate,translateX,translateY,accentColor,caretColor,scrollBehavior,scrollbar,scrollMargin,scrollMarginX,scrollMarginY,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingX,scrollPaddingY,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,touchAction,userSelect,fill,stroke,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,colorPalette,textStyle,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl"
|
|
3
|
+
var userGeneratedStr = "css,pos,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,insetInline,insetBlock,inset,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,insetX,insetY,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,outlineWidth,outlineColor,outline,outlineOffset,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,color,fontFamily,fontSize,fontWeight,fontSmoothing,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,textGradient,gradientFrom,gradientTo,gradientVia,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationDelay,transformOrigin,scale,scaleX,scaleY,translate,translateX,translateY,accentColor,caretColor,scrollBehavior,scrollbar,scrollMargin,scrollMarginX,scrollMarginY,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingX,scrollPaddingY,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,touchAction,userSelect,fill,stroke,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,colorPalette,textStyle,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl"
|
|
4
4
|
var userGenerated = userGeneratedStr.split(",");
|
|
5
5
|
var 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";
|
|
6
6
|
var allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import type { CompositionStyleObject } from './system-types';
|
|
3
|
+
import type { Token } from '../tokens';
|
|
3
4
|
|
|
4
5
|
interface Recursive<T> {
|
|
5
6
|
[key: string]: Recursive<T> | T
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
export interface Token<Value = any> {
|
|
9
|
-
value: Value
|
|
10
|
-
description?: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
9
|
/* -----------------------------------------------------------------------------
|
|
14
10
|
* Text styles
|
|
15
11
|
* -----------------------------------------------------------------------------*/
|
|
@@ -130,6 +130,8 @@ export interface Conditions {
|
|
|
130
130
|
"_optional": string
|
|
131
131
|
/** `&:is([open], [data-open], [data-state="open"])` */
|
|
132
132
|
"_open": string
|
|
133
|
+
/** `&:is([closed], [data-closed], [data-state="closed"])` */
|
|
134
|
+
"_closed": string
|
|
133
135
|
/** `&:fullscreen` */
|
|
134
136
|
"_fullscreen": string
|
|
135
137
|
/** `&:is([data-loading], [aria-busy=true])` */
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import type { ComponentPropsWithoutRef, ElementType, ElementRef, Ref } from 'react'
|
|
3
|
-
import type { Assign, DistributiveOmit, JsxHTMLProps, JsxStyleProps } from './system-types';
|
|
4
3
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe';
|
|
4
|
+
import type { Assign, DistributiveOmit, DistributiveUnion, JsxHTMLProps, JsxStyleProps, Pretty } from './system-types';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
interface Dict {
|
|
7
|
+
[k: string]: unknown
|
|
8
|
+
}
|
|
7
9
|
|
|
8
10
|
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
9
11
|
ref?: Ref<ElementRef<T>>
|
|
@@ -14,7 +16,9 @@ export interface PandaComponent<T extends ElementType, P extends Dict = {}> {
|
|
|
14
16
|
displayName?: string
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
interface RecipeFn {
|
|
19
|
+
interface RecipeFn {
|
|
20
|
+
__type: any
|
|
21
|
+
}
|
|
18
22
|
|
|
19
23
|
interface JsxFactoryOptions<TProps extends Dict> {
|
|
20
24
|
dataAttr?: boolean
|
|
@@ -24,17 +28,25 @@ interface JsxFactoryOptions<TProps extends Dict> {
|
|
|
24
28
|
|
|
25
29
|
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T>, P>;
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
export type JsxElement<T extends ElementType, P> = T extends PandaComponent<infer A, infer B>
|
|
32
|
+
? PandaComponent<A, Pretty<DistributiveUnion<P, B>>>
|
|
33
|
+
: PandaComponent<T, P>
|
|
34
|
+
|
|
35
|
+
export interface JsxFactory {
|
|
28
36
|
<T extends ElementType>(component: T): PandaComponent<T, {}>
|
|
29
|
-
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>, options?: JsxFactoryOptions<JsxRecipeProps<T, RecipeSelection<P>>>):
|
|
37
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>, options?: JsxFactoryOptions<JsxRecipeProps<T, RecipeSelection<P>>>): JsxElement<
|
|
30
38
|
T,
|
|
31
39
|
RecipeSelection<P>
|
|
32
40
|
>
|
|
33
|
-
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P, options?: JsxFactoryOptions<JsxRecipeProps<T, P['__type']>>):
|
|
41
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P, options?: JsxFactoryOptions<JsxRecipeProps<T, P['__type']>>): JsxElement<T, P['__type']>
|
|
34
42
|
}
|
|
35
43
|
|
|
36
|
-
type JsxElements = {
|
|
44
|
+
export type JsxElements = {
|
|
45
|
+
[K in keyof JSX.IntrinsicElements]: PandaComponent<K, {}>
|
|
46
|
+
}
|
|
37
47
|
|
|
38
48
|
export type Panda = JsxFactory & JsxElements
|
|
39
49
|
|
|
40
|
-
export type HTMLPandaProps<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
50
|
+
export type HTMLPandaProps<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
51
|
+
|
|
52
|
+
export type PandaVariantProps<T extends PandaComponent<any, any>> = T extends PandaComponent<any, infer Props> ? Props : never
|
|
@@ -6,6 +6,18 @@ import type { SystemProperties, CssVarProperties } from './style-props';
|
|
|
6
6
|
type String = string & {}
|
|
7
7
|
type Number = number & {}
|
|
8
8
|
|
|
9
|
+
export type Pretty<T> = { [K in keyof T]: T[K] } & {}
|
|
10
|
+
|
|
11
|
+
export type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never
|
|
12
|
+
|
|
13
|
+
export type DistributiveUnion<T, U> = {
|
|
14
|
+
[K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]
|
|
15
|
+
} & DistributiveOmit<U, keyof T>
|
|
16
|
+
|
|
17
|
+
export type Assign<T, U> = {
|
|
18
|
+
[K in keyof T]: K extends keyof U ? U[K] : T[K]
|
|
19
|
+
} & U
|
|
20
|
+
|
|
9
21
|
/* -----------------------------------------------------------------------------
|
|
10
22
|
* Native css properties
|
|
11
23
|
* -----------------------------------------------------------------------------*/
|
|
@@ -62,12 +74,6 @@ type StyleProps = SystemProperties & MinimalNested<SystemStyleObject>
|
|
|
62
74
|
|
|
63
75
|
export type JsxStyleProps = StyleProps & WithCss
|
|
64
76
|
|
|
65
|
-
export type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never
|
|
66
|
-
|
|
67
|
-
export type Assign<T, U> = {
|
|
68
|
-
[K in keyof T]: K extends keyof U ? U[K] : T[K]
|
|
69
|
-
} & U
|
|
70
|
-
|
|
71
77
|
export interface PatchedHTMLProps {
|
|
72
78
|
htmlWidth?: string | number
|
|
73
79
|
htmlHeight?: string | number
|