@pandacss/studio 0.17.0 → 0.17.1
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.d.mts +5 -3
- package/dist/studio.d.ts +5 -3
- package/dist/studio.js +2 -2
- package/dist/studio.mjs +2 -2
- package/package.json +7 -7
- package/src/components/empty-state.tsx +1 -1
- package/src/components/font-tokens.tsx +1 -1
- package/src/components/sizes.tsx +3 -1
- package/src/lib/color-contrast-checker.ts +10 -2
- package/src/lib/constants.ts +1 -1
- package/src/lib/use-color-docs.ts +1 -1
- package/styled-system/helpers.mjs +11 -10
- package/styled-system/jsx/factory.mjs +6 -6
- package/styled-system/reset.css +8 -0
- package/styled-system/types/index.d.ts +1 -1
- package/styled-system/types/parts.d.ts +3 -1
- package/styled-system/types/pattern.d.ts +3 -1
package/dist/studio.d.mts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
interface BuildOpts {
|
|
2
2
|
outDir: string;
|
|
3
3
|
configPath: string;
|
|
4
|
-
|
|
4
|
+
port?: string;
|
|
5
|
+
host?: boolean;
|
|
6
|
+
}
|
|
5
7
|
declare function buildStudio({ outDir, configPath }: BuildOpts): Promise<void>;
|
|
6
|
-
declare function serveStudio({ configPath }: BuildOpts): Promise<void>;
|
|
8
|
+
declare function serveStudio({ configPath, port, host }: BuildOpts): Promise<void>;
|
|
7
9
|
declare function previewStudio({ outDir }: BuildOpts): Promise<void>;
|
|
8
10
|
declare function printUrls(options: {
|
|
9
11
|
host: string;
|
package/dist/studio.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
interface BuildOpts {
|
|
2
2
|
outDir: string;
|
|
3
3
|
configPath: string;
|
|
4
|
-
|
|
4
|
+
port?: string;
|
|
5
|
+
host?: boolean;
|
|
6
|
+
}
|
|
5
7
|
declare function buildStudio({ outDir, configPath }: BuildOpts): Promise<void>;
|
|
6
|
-
declare function serveStudio({ configPath }: BuildOpts): Promise<void>;
|
|
8
|
+
declare function serveStudio({ configPath, port, host }: BuildOpts): Promise<void>;
|
|
7
9
|
declare function previewStudio({ outDir }: BuildOpts): Promise<void>;
|
|
8
10
|
declare function printUrls(options: {
|
|
9
11
|
host: string;
|
package/dist/studio.js
CHANGED
|
@@ -2079,8 +2079,8 @@ async function buildStudio({ outDir, configPath }) {
|
|
|
2079
2079
|
});
|
|
2080
2080
|
import_logger.logger.log(stdout);
|
|
2081
2081
|
}
|
|
2082
|
-
async function serveStudio({ configPath }) {
|
|
2083
|
-
const result = execa(astroBin, ["dev", "--root", appPath], {
|
|
2082
|
+
async function serveStudio({ configPath, port, host }) {
|
|
2083
|
+
const result = execa(astroBin, ["dev", "--root", appPath, "--port", port ?? "", host ? "--host" : ""], {
|
|
2084
2084
|
stdio: "inherit",
|
|
2085
2085
|
cwd: appPath,
|
|
2086
2086
|
env: {
|
package/dist/studio.mjs
CHANGED
|
@@ -2075,8 +2075,8 @@ async function buildStudio({ outDir, configPath }) {
|
|
|
2075
2075
|
});
|
|
2076
2076
|
logger.log(stdout);
|
|
2077
2077
|
}
|
|
2078
|
-
async function serveStudio({ configPath }) {
|
|
2079
|
-
const result = execa(astroBin, ["dev", "--root", appPath], {
|
|
2078
|
+
async function serveStudio({ configPath, port, host }) {
|
|
2079
|
+
const result = execa(astroBin, ["dev", "--root", appPath, "--port", port ?? "", host ? "--host" : ""], {
|
|
2080
2080
|
stdio: "inherit",
|
|
2081
2081
|
cwd: appPath,
|
|
2082
2082
|
env: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/studio",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "The automated token documentation for Panda CSS",
|
|
5
5
|
"main": "dist/studio.js",
|
|
6
6
|
"module": "dist/studio.mjs",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"react": "18.2.0",
|
|
34
34
|
"react-dom": "18.2.0",
|
|
35
35
|
"vite": "4.4.11",
|
|
36
|
-
"@pandacss/config": "0.17.
|
|
37
|
-
"@pandacss/
|
|
38
|
-
"@pandacss/
|
|
39
|
-
"@pandacss/
|
|
40
|
-
"@pandacss/
|
|
41
|
-
"@pandacss/
|
|
36
|
+
"@pandacss/config": "0.17.1",
|
|
37
|
+
"@pandacss/node": "0.17.1",
|
|
38
|
+
"@pandacss/types": "0.17.1",
|
|
39
|
+
"@pandacss/token-dictionary": "0.17.1",
|
|
40
|
+
"@pandacss/logger": "0.17.1",
|
|
41
|
+
"@pandacss/shared": "0.17.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "18.2.22",
|
|
@@ -4,7 +4,7 @@ import { TokenContent } from '../components/token-content'
|
|
|
4
4
|
import { TokenGroup } from '../components/token-group'
|
|
5
5
|
import { Input, Textarea } from './input'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
interface FontTokensProps {
|
|
8
8
|
text?: string
|
|
9
9
|
largeText?: boolean
|
|
10
10
|
token: string
|
package/src/components/sizes.tsx
CHANGED
|
@@ -3,7 +3,9 @@ import { Grid, panda } from '../../styled-system/jsx'
|
|
|
3
3
|
import { getSortedSizes } from '../lib/sizes-sort'
|
|
4
4
|
import { TokenGroup } from './token-group'
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export interface SizesProps {
|
|
7
|
+
sizes: Map<string, any>
|
|
8
|
+
}
|
|
7
9
|
|
|
8
10
|
const contentRegex = /^(min|max|fit)-content$/
|
|
9
11
|
const unitRegex = /(ch|%)$/
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
// Credits: https://github.com/bbc/color-contrast-checker
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
interface Pair {
|
|
4
|
+
colorA: string
|
|
5
|
+
colorB: string
|
|
6
|
+
fontSize: number
|
|
7
|
+
}
|
|
8
|
+
interface Rgb {
|
|
9
|
+
r: number
|
|
10
|
+
g: number
|
|
11
|
+
b: number
|
|
12
|
+
}
|
|
5
13
|
|
|
6
14
|
class RgbClass {
|
|
7
15
|
r = 0
|
package/src/lib/constants.ts
CHANGED
|
@@ -49,18 +49,19 @@ function toHash(value) {
|
|
|
49
49
|
|
|
50
50
|
// src/merge-props.ts
|
|
51
51
|
function mergeProps(...sources) {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
const objects = sources.filter(Boolean);
|
|
53
|
+
return objects.reduce((prev, obj) => {
|
|
54
|
+
Object.keys(obj).forEach((key) => {
|
|
55
|
+
const prevValue = prev[key];
|
|
56
|
+
const value = obj[key];
|
|
57
|
+
if (isObject(prevValue) && isObject(value)) {
|
|
58
|
+
prev[key] = mergeProps(prevValue, value);
|
|
58
59
|
} else {
|
|
59
|
-
|
|
60
|
+
prev[key] = value;
|
|
60
61
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
});
|
|
63
|
+
return prev;
|
|
64
|
+
}, {});
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
// src/walk-object.ts
|
|
@@ -9,7 +9,7 @@ function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
|
|
9
9
|
|
|
10
10
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
11
11
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
const defaultProps = Object.assign(
|
|
14
14
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
15
15
|
options.defaultProps,
|
|
@@ -17,14 +17,14 @@ function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
|
|
17
17
|
|
|
18
18
|
const PandaComponent = /* @__PURE__ */ forwardRef(function PandaComponent(props, ref) {
|
|
19
19
|
const { as: Element = Dynamic.__base__ || Dynamic, children, ...restProps } = props
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
|
|
22
22
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
23
23
|
|
|
24
24
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
25
25
|
|
|
26
|
-
const [forwardedProps, variantProps, styleProps,
|
|
27
|
-
return splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty
|
|
26
|
+
const [htmlProps, forwardedProps, variantProps, styleProps, elementProps] = useMemo(() => {
|
|
27
|
+
return splitProps(combinedProps, normalizeHTMLProps.keys, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty)
|
|
28
28
|
}, [combinedProps])
|
|
29
29
|
|
|
30
30
|
function recipeClass() {
|
|
@@ -52,12 +52,12 @@ function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
|
|
52
52
|
})
|
|
53
53
|
|
|
54
54
|
const name = getDisplayName(Dynamic)
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
PandaComponent.displayName = `panda.${name}`
|
|
57
57
|
PandaComponent.__cva__ = cvaFn
|
|
58
58
|
PandaComponent.__base__ = Dynamic
|
|
59
59
|
PandaComponent.__shouldForwardProps__ = shouldForwardProp
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
return PandaComponent
|
|
62
62
|
}
|
|
63
63
|
|
package/styled-system/reset.css
CHANGED
|
@@ -15,7 +15,9 @@ export interface PatternHelpers {
|
|
|
15
15
|
map: (value: any, fn: (value: string) => string | undefined) => any
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export
|
|
18
|
+
export interface PatternProperties {
|
|
19
|
+
[key: string]: PatternProperty
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
type Props<T> = Record<LiteralUnion<keyof T>, any>
|
|
21
23
|
|