@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 CHANGED
@@ -1,9 +1,11 @@
1
- type BuildOpts = {
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
- type BuildOpts = {
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.0",
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.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"
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",
@@ -1,6 +1,6 @@
1
1
  import { panda, Stack } from '../../styled-system/jsx'
2
2
 
3
- type EmptyStateProps = {
3
+ interface EmptyStateProps {
4
4
  title: string
5
5
  children: React.ReactNode
6
6
  icon: React.ReactElement
@@ -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
- type FontTokensProps = {
7
+ interface FontTokensProps {
8
8
  text?: string
9
9
  largeText?: boolean
10
10
  token: string
@@ -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 type SizesProps = { sizes: Map<string, any> }
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
- type Pair = { colorA: string; colorB: string; fontSize: number }
4
- type Rgb = { r: number; g: number; b: number }
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
@@ -30,7 +30,7 @@ export enum NavKeys {
30
30
  CONTRAST_CHECKER = 'playground/contrast-checker',
31
31
  }
32
32
 
33
- export type NavItemData = {
33
+ export interface NavItemData {
34
34
  label: string
35
35
  id: NavKeys
36
36
  description: string
@@ -2,7 +2,7 @@ import type { Token } from '@pandacss/types'
2
2
  import { useState } from 'react'
3
3
  import context from './panda.context'
4
4
 
5
- type Color = {
5
+ interface Color {
6
6
  isConditional?: boolean
7
7
  isReference?: boolean
8
8
  name: string
@@ -49,18 +49,19 @@ function toHash(value) {
49
49
 
50
50
  // src/merge-props.ts
51
51
  function mergeProps(...sources) {
52
- const __sources = sources.filter(Boolean);
53
- const result = {};
54
- for (const source of __sources) {
55
- for (const [key, value] of Object.entries(source)) {
56
- if (isObject(value)) {
57
- result[key] = mergeProps(result[key] || {}, value);
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
- result[key] = value;
60
+ prev[key] = value;
60
61
  }
61
- }
62
- }
63
- return result;
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, htmlProps, elementProps] = useMemo(() => {
27
- return splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty, normalizeHTMLProps.keys)
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
 
@@ -90,6 +90,14 @@
90
90
  background-color: transparent;
91
91
  background-image: none;
92
92
  }
93
+
94
+ button,
95
+ input,
96
+ optgroup,
97
+ select,
98
+ textarea {
99
+ color: inherit;
100
+ }
93
101
 
94
102
  button,
95
103
  select {
@@ -5,4 +5,4 @@ export * from './pattern';
5
5
  export * from './recipe';
6
6
  export * from './system-types';
7
7
  export * from './jsx';
8
- export * from './style-props';
8
+ export * from './style-props';
@@ -3,4 +3,6 @@ export interface Part {
3
3
  selector: string
4
4
  }
5
5
 
6
- export type Parts = Record<string, Part>
6
+ export interface Parts {
7
+ [key: string]: Part
8
+ }
@@ -15,7 +15,9 @@ export interface PatternHelpers {
15
15
  map: (value: any, fn: (value: string) => string | undefined) => any
16
16
  }
17
17
 
18
- export type PatternProperties = Record<string, PatternProperty>
18
+ export interface PatternProperties {
19
+ [key: string]: PatternProperty
20
+ }
19
21
 
20
22
  type Props<T> = Record<LiteralUnion<keyof T>, any>
21
23