@pandacss/studio 0.27.3 → 0.29.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.
Files changed (92) hide show
  1. package/dist/studio.js +6 -3
  2. package/dist/studio.mjs +6 -3
  3. package/package.json +10 -9
  4. package/panda.config.ts +5 -27
  5. package/src/components/color-constrast.tsx +40 -67
  6. package/src/components/color-wrapper.tsx +21 -24
  7. package/src/components/colors.tsx +57 -50
  8. package/src/components/empty-state.tsx +4 -2
  9. package/src/components/font-family.tsx +4 -4
  10. package/src/components/font-tokens.tsx +17 -26
  11. package/src/components/icons.tsx +2 -0
  12. package/src/components/input.tsx +4 -2
  13. package/src/components/layer-styles.tsx +4 -3
  14. package/src/components/overview.tsx +77 -57
  15. package/src/components/radii.tsx +6 -5
  16. package/src/components/semantic-color.tsx +4 -6
  17. package/src/components/side-nav-item.astro +1 -1
  18. package/src/components/side-nav.astro +3 -3
  19. package/src/components/sizes.tsx +7 -6
  20. package/src/components/sticky-top.tsx +10 -0
  21. package/src/components/test-score.tsx +35 -0
  22. package/src/components/text-styles.tsx +3 -2
  23. package/src/components/theme-toggle.astro +1 -1
  24. package/src/components/token-content.tsx +8 -4
  25. package/src/components/token-group.tsx +9 -4
  26. package/src/components/typography-playground.tsx +17 -16
  27. package/src/{components → icons}/logo.tsx +6 -1
  28. package/src/icons/moon.tsx +1 -0
  29. package/src/icons/sun.tsx +1 -0
  30. package/src/icons/yums.tsx +1144 -0
  31. package/src/layouts/Layout.astro +2 -1
  32. package/src/layouts/Sidebar.astro +6 -6
  33. package/src/lib/constants.ts +0 -7
  34. package/src/lib/panda-context.ts +33 -0
  35. package/src/lib/truncate.ts +4 -0
  36. package/src/lib/use-color-docs.ts +20 -14
  37. package/src/pages/colors.astro +1 -1
  38. package/src/pages/font-sizes.astro +4 -4
  39. package/src/pages/font-weights.astro +3 -4
  40. package/src/pages/index.astro +1 -1
  41. package/src/pages/layer-styles.astro +1 -1
  42. package/src/pages/letter-spacings.astro +4 -3
  43. package/src/pages/line-heights.astro +3 -4
  44. package/src/pages/playground/contrast-checker.astro +2 -2
  45. package/src/pages/playground/typography.astro +2 -2
  46. package/src/pages/radii.astro +1 -1
  47. package/src/pages/sizes.astro +4 -3
  48. package/src/pages/spacing.astro +3 -3
  49. package/src/pages/text-styles.astro +1 -1
  50. package/styled-system/css/conditions.mjs +1 -1
  51. package/styled-system/css/css.mjs +1 -1
  52. package/styled-system/helpers.mjs +31 -1
  53. package/styled-system/jsx/cq.d.ts +10 -0
  54. package/styled-system/jsx/cq.mjs +14 -0
  55. package/styled-system/jsx/index.d.ts +1 -1
  56. package/styled-system/jsx/index.mjs +1 -1
  57. package/styled-system/jsx/is-valid-prop.mjs +2 -2
  58. package/styled-system/patterns/aspect-ratio.mjs +5 -2
  59. package/styled-system/patterns/bleed.mjs +12 -7
  60. package/styled-system/patterns/box.mjs +5 -2
  61. package/styled-system/patterns/center.mjs +5 -2
  62. package/styled-system/patterns/circle.mjs +5 -2
  63. package/styled-system/patterns/container.mjs +5 -2
  64. package/styled-system/patterns/cq.d.ts +22 -0
  65. package/styled-system/patterns/cq.mjs +21 -0
  66. package/styled-system/patterns/divider.mjs +8 -4
  67. package/styled-system/patterns/flex.mjs +5 -2
  68. package/styled-system/patterns/float.mjs +10 -3
  69. package/styled-system/patterns/grid-item.mjs +5 -2
  70. package/styled-system/patterns/grid.mjs +11 -6
  71. package/styled-system/patterns/hstack.mjs +8 -4
  72. package/styled-system/patterns/index.d.ts +1 -1
  73. package/styled-system/patterns/index.mjs +1 -1
  74. package/styled-system/patterns/link-box.mjs +5 -2
  75. package/styled-system/patterns/link-overlay.mjs +5 -2
  76. package/styled-system/patterns/spacer.mjs +5 -2
  77. package/styled-system/patterns/square.mjs +5 -2
  78. package/styled-system/patterns/stack.mjs +8 -4
  79. package/styled-system/patterns/visually-hidden.mjs +5 -2
  80. package/styled-system/patterns/vstack.mjs +8 -4
  81. package/styled-system/patterns/wrap.mjs +5 -2
  82. package/styled-system/styles.css +708 -599
  83. package/styled-system/tokens/index.mjs +4 -0
  84. package/styled-system/tokens/tokens.d.ts +4 -4
  85. package/styled-system/types/conditions.d.ts +24 -0
  86. package/styled-system/types/pattern.d.ts +13 -2
  87. package/styled-system/types/prop-type.d.ts +2 -1
  88. package/tsconfig.json +8 -0
  89. package/src/components/nav-item.tsx +0 -39
  90. package/src/lib/create-context.ts +0 -27
  91. package/src/lib/panda.context.ts +0 -19
  92. package/src/lib/truncate.tsx +0 -7
package/dist/studio.js CHANGED
@@ -48,7 +48,8 @@ async function buildStudio({ outDir, configPath }) {
48
48
  await astro.build({
49
49
  outDir,
50
50
  root: appPath,
51
- integrations: [react(), studio()]
51
+ integrations: [react(), studio()],
52
+ devToolbar: { enabled: false }
52
53
  });
53
54
  } catch (error) {
54
55
  console.log(error);
@@ -67,7 +68,8 @@ async function serveStudio({ configPath, port, host, outDir }) {
67
68
  server: {
68
69
  port: port ? Number(port) : void 0,
69
70
  host
70
- }
71
+ },
72
+ devToolbar: { enabled: false }
71
73
  });
72
74
  } catch (error) {
73
75
  console.log(error);
@@ -81,7 +83,8 @@ async function previewStudio({ outDir }) {
81
83
  await astro.preview({
82
84
  outDir,
83
85
  root: appPath,
84
- integrations: [react(), studio()]
86
+ integrations: [react(), studio()],
87
+ devToolbar: { enabled: false }
85
88
  });
86
89
  } catch (error) {
87
90
  console.log(error);
package/dist/studio.mjs CHANGED
@@ -18,7 +18,8 @@ async function buildStudio({ outDir, configPath }) {
18
18
  await astro.build({
19
19
  outDir,
20
20
  root: appPath,
21
- integrations: [react(), studio()]
21
+ integrations: [react(), studio()],
22
+ devToolbar: { enabled: false }
22
23
  });
23
24
  } catch (error) {
24
25
  console.log(error);
@@ -37,7 +38,8 @@ async function serveStudio({ configPath, port, host, outDir }) {
37
38
  server: {
38
39
  port: port ? Number(port) : void 0,
39
40
  host
40
- }
41
+ },
42
+ devToolbar: { enabled: false }
41
43
  });
42
44
  } catch (error) {
43
45
  console.log(error);
@@ -51,7 +53,8 @@ async function previewStudio({ outDir }) {
51
53
  await astro.preview({
52
54
  outDir,
53
55
  root: appPath,
54
- integrations: [react(), studio()]
56
+ integrations: [react(), studio()],
57
+ devToolbar: { enabled: false }
55
58
  });
56
59
  } catch (error) {
57
60
  console.log(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/studio",
3
- "version": "0.27.3",
3
+ "version": "0.29.0",
4
4
  "description": "The automated token documentation for Panda CSS",
5
5
  "main": "dist/studio.js",
6
6
  "module": "dist/studio.mjs",
@@ -30,6 +30,7 @@
30
30
  "src",
31
31
  "public",
32
32
  "styled-system",
33
+ "tsconfig.json",
33
34
  "*.ts",
34
35
  "*.mjs"
35
36
  ],
@@ -43,16 +44,16 @@
43
44
  "license": "MIT",
44
45
  "dependencies": {
45
46
  "@astrojs/react": "2.3.2",
46
- "astro": "4.0.6",
47
+ "astro": "4.2.6",
47
48
  "react": "18.2.0",
48
49
  "react-dom": "18.2.0",
49
- "vite": "5.0.7",
50
- "@pandacss/config": "0.27.3",
51
- "@pandacss/logger": "0.27.3",
52
- "@pandacss/shared": "0.27.3",
53
- "@pandacss/token-dictionary": "0.27.3",
54
- "@pandacss/types": "0.27.3",
55
- "@pandacss/astro-plugin-studio": "0.27.3"
50
+ "vite": "5.0.12",
51
+ "@pandacss/config": "0.29.0",
52
+ "@pandacss/logger": "0.29.0",
53
+ "@pandacss/shared": "0.29.0",
54
+ "@pandacss/token-dictionary": "0.29.0",
55
+ "@pandacss/types": "0.29.0",
56
+ "@pandacss/astro-plugin-studio": "0.29.0"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/react": "18.2.42",
package/panda.config.ts CHANGED
@@ -55,41 +55,19 @@ export default {
55
55
  border: {
56
56
  value: { base: '{colors.neutral.300}', _dark: '{colors.neutral.700}' },
57
57
  },
58
+ accent: {
59
+ value: { base: '{colors.yellow.600}', _dark: '{colors.yellow.300}' },
60
+ },
58
61
  },
59
62
  },
60
63
  },
61
64
  },
62
- patterns: {
63
- extend: {
64
- styledLink: {
65
- properties: {},
66
- transform: (props: any) => ({
67
- display: 'inline-flex',
68
- alignItems: 'center',
69
- opacity: '0.5',
70
- borderBottom: '1px solid transparent',
71
- cursor: 'pointer',
72
- _hover: { opacity: 1, borderBottomColor: 'black' },
73
- ...props,
74
- }),
75
- },
76
- },
77
- },
78
- staticCss: {
79
- css: [
80
- {
81
- properties: {
82
- color: ['red.400'],
83
- },
84
- },
85
- ],
86
- },
87
65
  globalCss: {
88
66
  ':root': {
89
67
  '--global-color-border': 'colors.border',
90
68
  '--global-color-placeholder': 'colors.neutral.500',
91
69
  fontFamily: 'Inter, Avenir, Helvetica, Arial, sans-serif',
92
- fontSize: 'md',
70
+ fontSize: '0.84em',
93
71
  lineHeight: 'normal',
94
72
  fontWeight: 'normal',
95
73
  colorScheme: 'light dark',
@@ -104,7 +82,7 @@ export default {
104
82
 
105
83
  body: {
106
84
  margin: 0,
107
- minHeight: '100vh',
85
+ minHeight: '100dvh',
108
86
  },
109
87
  },
110
88
  } satisfies Config
@@ -1,46 +1,51 @@
1
- import { useState } from 'react'
1
+ import * as React from 'react'
2
2
  import { HStack, Stack, VStack, panda } from '../../styled-system/jsx'
3
3
  import { getContrastPairs, getContrastRatio } from '../lib/color'
4
- import context from '../lib/panda.context'
5
- import { ErrorIcon, SuccessIcon } from './icons'
4
+ import * as context from '../lib/panda-context'
5
+ import { Select } from './input'
6
+ import { TestScore } from './test-score'
6
7
  import { TokenContent } from './token-content'
7
8
  import { TokenGroup } from './token-group'
8
9
 
9
- function TestScore(props: { score: { WCAG_AA: boolean; WCAG_AAA: boolean }; size: 'regular' | 'large' }) {
10
- const { score, size } = props
10
+ interface ColorSelectProps {
11
+ title: string
12
+ value: string
13
+ colors: {
14
+ label: string
15
+ value: string
16
+ }[]
17
+ onChange: (value: string) => void
18
+ }
19
+
20
+ function ColorSelect(props: ColorSelectProps) {
21
+ const { title, colors, onChange, value } = props
11
22
  return (
12
- <>
13
- <HStack justify="space-between" fontWeight="medium">
14
- <HStack gap="2">
15
- <span>{score.WCAG_AA ? <SuccessIcon /> : <ErrorIcon />}</span>
16
- <span>AA</span>
17
- </HStack>
18
- <span>{size === 'regular' ? '4.5:1' : '3:1'}</span>
19
- </HStack>
20
- <HStack justify="space-between" fontWeight="medium">
21
- <HStack gap="2">
22
- <span>{score.WCAG_AAA ? <SuccessIcon /> : <ErrorIcon />}</span>
23
- <span>AAA</span>
24
- </HStack>
25
- <span>{size === 'regular' ? '7:1' : '4.5:1'}</span>
26
- </HStack>
27
- </>
23
+ <Stack flex="1">
24
+ <panda.span fontWeight="semibold">{title}</panda.span>
25
+ <panda.div
26
+ display="flex"
27
+ flexDirection="column"
28
+ borderWidth="1px"
29
+ borderColor="card"
30
+ pt="16"
31
+ style={{ background: value }}
32
+ />
33
+ <Select value={value} onChange={(e) => onChange(e.currentTarget.value)}>
34
+ {colors.map((color) => (
35
+ <option key={color.label} value={color.label}>
36
+ {color.label}
37
+ </option>
38
+ ))}
39
+ </Select>
40
+ </Stack>
28
41
  )
29
42
  }
30
43
 
31
- export function ColorContrastChecker() {
32
- const colorsMap = context.getCategory('colors')
33
- const values = Array.from(colorsMap.values())
34
-
35
- const colors = values
36
- .filter((color) => !color.isConditional && !color.extensions.isVirtual)
37
- .map((color) => ({
38
- label: color.extensions.prop,
39
- value: color.value,
40
- }))
44
+ export default function ColorContrastChecker() {
45
+ const colors = context.colors
41
46
 
42
- const [foreground, setForeGround] = useState('#000000')
43
- const [background, setBackground] = useState('#ffffff')
47
+ const [foreground, setForeGround] = React.useState('#000000')
48
+ const [background, setBackground] = React.useState('#ffffff')
44
49
 
45
50
  const activeForeground = (colors.find((col) => col.label === foreground)?.value || foreground) as string
46
51
  const activeBackground = (colors.find((col) => col.label === background)?.value || background) as string
@@ -52,40 +57,8 @@ export function ColorContrastChecker() {
52
57
  <TokenGroup>
53
58
  <TokenContent>
54
59
  <HStack gap="3" p="2">
55
- <panda.div
56
- display="flex"
57
- flexDirection="column"
58
- borderWidth="1px"
59
- borderColor="card"
60
- flex="1"
61
- pt="16"
62
- style={{ background: activeForeground }}
63
- >
64
- <select value={foreground} onChange={(e: any) => setForeGround(e.currentTarget.value)}>
65
- {colors.map((color) => (
66
- <option key={color.label} value={color.label}>
67
- {color.label}
68
- </option>
69
- ))}
70
- </select>
71
- </panda.div>
72
- <panda.div
73
- display="flex"
74
- flexDirection="column"
75
- borderWidth="1px"
76
- borderColor="card"
77
- flex="1"
78
- pt="16"
79
- style={{ background: activeBackground }}
80
- >
81
- <select value={background} onChange={(e: any) => setBackground(e.currentTarget.value)}>
82
- {colors.map((color) => (
83
- <option key={color.label} value={color.label}>
84
- {color.label}
85
- </option>
86
- ))}
87
- </select>
88
- </panda.div>
60
+ <ColorSelect title="Background" value={activeBackground} onChange={setBackground} colors={colors} />
61
+ <ColorSelect title="Foreground" value={activeForeground} onChange={setForeGround} colors={colors} />
89
62
  </HStack>
90
63
 
91
64
  <HStack
@@ -1,25 +1,22 @@
1
- import { type HTMLPandaProps, panda } from '../../styled-system/jsx'
1
+ import { panda } from '../../styled-system/jsx'
2
2
 
3
- export function ColorWrapper(props: HTMLPandaProps<'div'>) {
4
- return (
5
- <panda.div
6
- width="full"
7
- height="10"
8
- borderRadius="sm"
9
- position="relative"
10
- overflow="hidden"
11
- shadow="inset"
12
- _before={{
13
- content: "''",
14
- position: 'absolute',
15
- borderRadius: 'sm',
16
- width: '100%',
17
- height: '100%',
18
- backgroundSize: '24px',
19
- zIndex: '-1',
20
- backgroundImage: 'check',
21
- }}
22
- {...props}
23
- />
24
- )
25
- }
3
+ export const ColorWrapper = panda('div', {
4
+ base: {
5
+ width: 'full',
6
+ height: '10',
7
+ borderRadius: 'sm',
8
+ position: 'relative',
9
+ overflow: 'hidden',
10
+ shadow: 'inset',
11
+ _before: {
12
+ content: "''",
13
+ position: 'absolute',
14
+ borderRadius: 'sm',
15
+ width: '100%',
16
+ height: '100%',
17
+ backgroundSize: '24px',
18
+ zIndex: '-1',
19
+ backgroundImage: 'check',
20
+ },
21
+ },
22
+ })
@@ -1,3 +1,5 @@
1
+ import type { Token } from '@pandacss/token-dictionary'
2
+ import * as React from 'react'
1
3
  import { Grid, HStack, Stack, panda } from '../../styled-system/jsx'
2
4
  import { ColorWrapper } from '../components/color-wrapper'
3
5
  import { TokenContent } from '../components/token-content'
@@ -5,6 +7,7 @@ import { TokenGroup } from '../components/token-group'
5
7
  import { useColorDocs } from '../lib/use-color-docs'
6
8
  import { Input } from './input'
7
9
  import { SemanticColorDisplay } from './semantic-color'
10
+ import { StickyTop } from './sticky-top'
8
11
 
9
12
  const UNCATEGORIZED_ID = 'uncategorized' as const
10
13
 
@@ -12,14 +15,14 @@ function getColorFromReference(reference: string) {
12
15
  return reference.match(/{colors\.(.*?)}/)?.[1]
13
16
  }
14
17
 
15
- export function Colors() {
18
+ export default function Colors() {
16
19
  const { filterQuery, setFilterQuery, semanticTokens, hasResults, uncategorizedColors, categorizedColors } =
17
20
  useColorDocs()
18
21
 
19
22
  const renderSemanticTokens = () => {
20
23
  return semanticTokens.map(([name, colors], i) => {
21
24
  return (
22
- <Stack gap="1" key={i} width="full">
25
+ <Stack gap="2" key={i} width="full">
23
26
  <HStack gap="1">
24
27
  <SemanticColorDisplay
25
28
  value={colors.base.value}
@@ -38,68 +41,72 @@ export function Colors() {
38
41
  )
39
42
  })
40
43
  }
41
- const renderColors = (values: any[]) => {
42
- return values?.map((color, i) => {
43
- return (
44
- <Stack gap="1" key={i}>
45
- <ColorWrapper style={{ background: color.value }} />
46
- <Stack mt="2" gap="0.5">
47
- <panda.div fontWeight="medium">{color.extensions.prop}</panda.div>
48
- <panda.div opacity="0.7" fontSize="sm" textTransform="uppercase">
49
- {color.value}
50
- </panda.div>
51
- </Stack>
52
- </Stack>
53
- )
54
- })
55
- }
56
44
 
57
45
  return (
58
46
  <TokenGroup>
59
- <panda.div mb="3.5" position="sticky" top="0" zIndex="1">
47
+ <StickyTop>
60
48
  <Input
61
49
  value={filterQuery}
62
50
  onChange={(e) => setFilterQuery(e.target.value)}
63
51
  placeholder="Filter tokens by text, property or value"
64
52
  />
65
- </panda.div>
53
+ </StickyTop>
54
+
66
55
  <TokenContent>
67
56
  <Stack gap="10">
68
- {!!categorizedColors.length &&
69
- categorizedColors.map(([category, colors]) => (
70
- <div key={category}>
71
- <panda.span fontWeight="medium" textTransform="capitalize" fontSize="xl">
72
- {category}
73
- </panda.span>
57
+ {categorizedColors.map(([category, colors]) => (
58
+ <ColorGroup key={category} title={category} colors={colors} />
59
+ ))}
60
+
61
+ <ColorGroup title={UNCATEGORIZED_ID} colors={uncategorizedColors} />
62
+
63
+ {!!semanticTokens.length && <ColorGroup title="Semantic Tokens">{renderSemanticTokens()}</ColorGroup>}
74
64
 
75
- <Grid gap="4" minChildWidth="13rem" my="5" mx="0" key={category}>
76
- {renderColors(colors)}
77
- </Grid>
78
- </div>
79
- ))}
80
- {!!uncategorizedColors?.length && (
81
- <div>
82
- <panda.span fontWeight="medium" textTransform="capitalize" fontSize="xl">
83
- {UNCATEGORIZED_ID}
84
- </panda.span>
85
- <Grid gap="4" minChildWidth="13rem" my="5" mx="0">
86
- {renderColors(uncategorizedColors)}
87
- </Grid>
88
- </div>
89
- )}
90
- {!!semanticTokens.length && (
91
- <div>
92
- <panda.span fontWeight="medium" textTransform="capitalize" fontSize="xl">
93
- Semantic tokens
94
- </panda.span>
95
- <Grid gap="4" minChildWidth="30rem" my="5" mx="0">
96
- {renderSemanticTokens()}
97
- </Grid>
98
- </div>
99
- )}
100
65
  {!hasResults && <div>No result found! 🐼</div>}
101
66
  </Stack>
102
67
  </TokenContent>
103
68
  </TokenGroup>
104
69
  )
105
70
  }
71
+
72
+ function PrimitiveColors(props: { values?: Token[] }) {
73
+ const { values = [] } = props
74
+ return values.map((color, i) => {
75
+ return (
76
+ <Stack gap="1" key={i}>
77
+ <ColorWrapper style={{ background: color.value }} />
78
+ <Stack mt="2" gap="0.5">
79
+ <panda.div fontWeight="medium">{color.extensions.prop}</panda.div>
80
+ <panda.div opacity="0.7" fontSize="sm" textTransform="uppercase">
81
+ {color.value}
82
+ </panda.div>
83
+ </Stack>
84
+ </Stack>
85
+ )
86
+ })
87
+ }
88
+
89
+ function ColorGroup(props: { colors?: Token[]; title: string; children?: React.ReactNode }) {
90
+ const { children, colors, title } = props
91
+
92
+ const isEmpty = colors == null || colors.length === 0
93
+
94
+ if (!children && isEmpty) return null
95
+
96
+ return (
97
+ <div>
98
+ <panda.span fontWeight="medium" textTransform="capitalize" fontSize="xl">
99
+ {title}
100
+ </panda.span>
101
+ {children ? (
102
+ <Stack gap="10" mt="10">
103
+ {children}
104
+ </Stack>
105
+ ) : (
106
+ <Grid gap="4" minChildWidth="13rem" my="5" mx="0">
107
+ <PrimitiveColors values={colors} />
108
+ </Grid>
109
+ )}
110
+ </div>
111
+ )
112
+ }
@@ -1,3 +1,4 @@
1
+ import * as React from 'react'
1
2
  import { panda, Stack } from '../../styled-system/jsx'
2
3
 
3
4
  interface EmptyStateProps {
@@ -6,13 +7,14 @@ interface EmptyStateProps {
6
7
  icon: React.ReactElement
7
8
  }
8
9
 
9
- export function EmptyState({ title, children, icon }: EmptyStateProps) {
10
+ export function EmptyState(props: EmptyStateProps) {
11
+ const { title, children, icon } = props
10
12
  return (
11
13
  <Stack align="center" gap="5" justify="center" height="full" minHeight="40vh">
12
14
  <panda.span fontSize="5xl">{icon}</panda.span>
13
15
  <Stack opacity="0.8" align="center">
14
16
  <panda.span fontWeight="semibold">{title}</panda.span>
15
- <p>{children}</p>
17
+ <div>{children}</div>
16
18
  </Stack>
17
19
  </Stack>
18
20
  )
@@ -1,17 +1,17 @@
1
+ import * as React from 'react'
1
2
  import { Flex, HStack, Square, Stack, panda } from '../../styled-system/jsx'
2
- import context from '../lib/panda.context'
3
+ import * as context from '../lib/panda-context'
3
4
 
4
- const fonts = context.getCategory('fonts')
5
+ const fonts = context.getTokens('fonts')
5
6
 
6
7
  const letters = Array.from({ length: 26 }, (_, i) => String.fromCharCode(65 + i))
7
8
  const symbols = Array.from({ length: 10 }, (_, i) => String.fromCharCode(48 + i))
8
9
  const specials = ['@', '#', '$', '%', '&', '!', '?', '+', '-']
9
10
 
10
11
  export const FontFamily = () => {
11
- const values = Array.from(fonts.values())
12
12
  return (
13
13
  <Stack gap="10">
14
- {values.map((font) => (
14
+ {fonts.map((font) => (
15
15
  <Stack key={font.name} gap="8">
16
16
  <HStack gap="10" style={{ fontFamily: font.value }}>
17
17
  <panda.p fontSize="100px" fontWeight="bold" lineHeight="1">
@@ -1,50 +1,41 @@
1
- import { Fragment, useState } from 'react'
1
+ import type { Token } from '@pandacss/token-dictionary'
2
+ import * as React from 'react'
2
3
  import { HStack, panda, Stack } from '../../styled-system/jsx'
3
4
  import { TokenContent } from '../components/token-content'
4
5
  import { TokenGroup } from '../components/token-group'
5
6
  import { Input, Textarea } from './input'
7
+ import { StickyTop } from './sticky-top'
6
8
 
7
9
  interface FontTokensProps {
8
10
  text?: string
9
11
  largeText?: boolean
10
12
  token: string
11
- fontTokens: Map<string, any>
13
+ fontTokens: Token[]
12
14
  css?: any
13
15
  }
14
16
 
15
- export function FontTokens(props: FontTokensProps) {
17
+ export default function FontTokens(props: FontTokensProps) {
16
18
  const { text: textProp = 'Hello World', largeText = false, token, fontTokens } = props
17
- const [text, setText] = useState(textProp)
18
19
 
19
- const values = Array.from(fontTokens.values())
20
+ const [text, setText] = React.useState(textProp)
21
+
22
+ const handleChange = (event: React.ChangeEvent<any>) => {
23
+ setText(event.target.value)
24
+ }
20
25
 
21
26
  return (
22
27
  <TokenGroup>
23
- <panda.div mb="3.5" position="sticky" top="0" zIndex={1}>
28
+ <StickyTop>
24
29
  {largeText ? (
25
- <Textarea
26
- resize="vertical"
27
- onChange={(event) => {
28
- setText(event.currentTarget.value)
29
- }}
30
- rows={5}
31
- value={text}
32
- placeholder="Preview Text"
33
- />
30
+ <Textarea resize="vertical" onChange={handleChange} rows={5} value={text} placeholder="Preview Text" />
34
31
  ) : (
35
- <Input
36
- value={text}
37
- onChange={(event) => {
38
- setText(event.currentTarget.value)
39
- }}
40
- placeholder="Preview Text"
41
- />
32
+ <Input value={text} onChange={handleChange} placeholder="Preview Text" />
42
33
  )}
43
- </panda.div>
34
+ </StickyTop>
44
35
 
45
36
  <TokenContent>
46
- {values.map((fontToken) => (
47
- <Fragment key={fontToken.extensions.prop}>
37
+ {fontTokens.map((fontToken) => (
38
+ <React.Fragment key={fontToken.extensions.prop}>
48
39
  <Stack gap="3.5">
49
40
  <HStack gap="1">
50
41
  <panda.span fontWeight="medium">{fontToken.extensions.prop}</panda.span>
@@ -61,7 +52,7 @@ export function FontTokens(props: FontTokensProps) {
61
52
  {text}
62
53
  </panda.span>
63
54
  </Stack>
64
- </Fragment>
55
+ </React.Fragment>
65
56
  ))}
66
57
  </TokenContent>
67
58
  </TokenGroup>
@@ -1,3 +1,5 @@
1
+ import * as React from 'react'
2
+
1
3
  export function ErrorIcon() {
2
4
  return (
3
5
  <svg width="16" height="16" viewBox="0 0 16 16" fill="red">
@@ -3,9 +3,9 @@ import { panda } from '../../styled-system/jsx'
3
3
 
4
4
  export const inputRecipe = cva({
5
5
  base: {
6
- bg: 'transparent',
6
+ bg: 'card',
7
7
  width: 'full',
8
- px: '4',
8
+ px: '3',
9
9
  py: '2',
10
10
  rounded: 'md',
11
11
  color: { base: 'neutral.600', _dark: 'neutral.300' },
@@ -25,3 +25,5 @@ export const inputRecipe = cva({
25
25
  export const Input = panda('input', inputRecipe)
26
26
 
27
27
  export const Textarea = panda('textarea', inputRecipe)
28
+
29
+ export const Select = panda('select', inputRecipe)
@@ -1,11 +1,12 @@
1
+ import * as React from 'react'
1
2
  import { panda } from '../../styled-system/jsx'
2
- import context from '../lib/panda.context'
3
+ import * as context from '../lib/panda-context'
3
4
  import { EmptyState } from './empty-state'
4
5
  import { LayerStylesIcon } from './icons'
5
6
  import { TokenContent } from './token-content'
6
7
  import { TokenGroup } from './token-group'
7
8
 
8
- export function LayerStyles() {
9
+ export default function LayerStyles() {
9
10
  const values = Object.entries(context.layerStyles)
10
11
 
11
12
  return (
@@ -29,7 +30,7 @@ export function LayerStyles() {
29
30
  ))
30
31
  ) : (
31
32
  <EmptyState title="No Layer Styles" icon={<LayerStylesIcon />}>
32
- The config does not contain any Layer Styles
33
+ The panda config does not contain any layer styles
33
34
  </EmptyState>
34
35
  )}
35
36
  </TokenContent>