@pandacss/studio 0.0.0-dev-20230919122009 → 0.0.0-dev-20230922200913

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 (44) hide show
  1. package/astro.config.mjs +1 -1
  2. package/dist/studio.d.mts +3 -2
  3. package/dist/studio.d.ts +3 -2
  4. package/dist/studio.js +10 -4
  5. package/dist/studio.mjs +10 -4
  6. package/package.json +8 -8
  7. package/src/lib/panda.context.ts +3 -5
  8. package/src/lib/virtual-panda.d.ts +3 -0
  9. package/styled-system/chunks/src__components__analyzer__category-utilities.css +61 -168
  10. package/styled-system/chunks/src__components__analyzer__data-combobox.css +69 -114
  11. package/styled-system/chunks/src__components__analyzer__data-table.css +24 -23
  12. package/styled-system/chunks/src__components__analyzer__file-details.css +53 -112
  13. package/styled-system/chunks/src__components__analyzer__report-item-columns.css +20 -19
  14. package/styled-system/chunks/src__components__analyzer__report-item-link.css +39 -222
  15. package/styled-system/chunks/src__components__analyzer__section.css +16 -15
  16. package/styled-system/chunks/src__components__analyzer__text-with-count.css +18 -17
  17. package/styled-system/chunks/src__components__analyzer__truncated-text.css +10 -9
  18. package/styled-system/chunks/src__components__analyzer__utility-details.css +71 -178
  19. package/styled-system/chunks/src__components__color-constrast.css +54 -61
  20. package/styled-system/chunks/src__components__color-item.css +12 -11
  21. package/styled-system/chunks/src__components__color-wrapper.css +37 -196
  22. package/styled-system/chunks/src__components__colors.css +54 -53
  23. package/styled-system/chunks/src__components__empty-state.css +24 -23
  24. package/styled-system/chunks/src__components__font-family.css +44 -43
  25. package/styled-system/chunks/src__components__font-tokens.css +32 -31
  26. package/styled-system/chunks/src__components__input.css +34 -137
  27. package/styled-system/chunks/src__components__layer-styles.css +34 -76
  28. package/styled-system/chunks/src__components__nav-item.css +37 -161
  29. package/styled-system/chunks/src__components__overview.css +63 -102
  30. package/styled-system/chunks/src__components__radii.css +26 -25
  31. package/styled-system/chunks/src__components__semantic-color.css +34 -33
  32. package/styled-system/chunks/src__components__side-nav-item.css +17 -56
  33. package/styled-system/chunks/src__components__side-nav.css +26 -25
  34. package/styled-system/chunks/src__components__sizes.css +22 -21
  35. package/styled-system/chunks/src__components__text-styles.css +16 -15
  36. package/styled-system/chunks/src__components__theme-toggle.css +28 -47
  37. package/styled-system/chunks/src__components__token-analyzer.css +114 -379
  38. package/styled-system/chunks/src__components__token-content.css +8 -7
  39. package/styled-system/chunks/src__components__token-group.css +12 -11
  40. package/styled-system/chunks/src__components__typography-playground.css +32 -31
  41. package/styled-system/chunks/src__layouts__Sidebar.css +59 -94
  42. package/styled-system/styles.css +507 -516
  43. package/styled-system/tokens/index.css +8 -8
  44. package/{virtual-panda.mjs → virtual-panda.ts} +24 -28
@@ -420,18 +420,18 @@
420
420
  --breakpoints-xl: 1280px;
421
421
  --breakpoints-2xl: 1536px;
422
422
  --shadows-inset: inset 0 0 0 1px rgba(0,0,0,0.1);
423
- --colors-text: #000;
424
- --colors-bg: #fff;
425
- --colors-card: #e5e5e5;
426
- --colors-border: #d4d4d4
423
+ --colors-text: var(--colors-black);
424
+ --colors-bg: var(--colors-white);
425
+ --colors-card: var(--colors-neutral-200);
426
+ --colors-border: var(--colors-neutral-300)
427
427
  }
428
428
 
429
429
  .dark {
430
430
  --shadows-inset: inset 0 0 0 1px rgba(255,255,255,0.2);
431
- --colors-text: #e5e5e5;
432
- --colors-bg: #171717;
433
- --colors-card: #262626;
434
- --colors-border: #404040
431
+ --colors-text: var(--colors-neutral-200);
432
+ --colors-bg: var(--colors-neutral-900);
433
+ --colors-card: var(--colors-neutral-800);
434
+ --colors-border: var(--colors-neutral-700)
435
435
  }
436
436
  }
437
437
 
@@ -1,5 +1,7 @@
1
- import { analyzeTokens, findConfig, loadConfigAndCreateContext, writeAnalyzeJSON } from '@pandacss/node'
1
+ import { type PandaContext, analyzeTokens, loadConfigAndCreateContext, writeAnalyzeJSON } from '@pandacss/node'
2
2
  import { stringify } from 'javascript-stringify'
3
+ import type { AstroIntegration } from 'astro'
4
+ import type { PluginOption } from 'vite'
3
5
 
4
6
  import { dirname, resolve } from 'path'
5
7
  import { fileURLToPath } from 'url'
@@ -11,38 +13,39 @@ const _dirname = dirname(fileURLToPath(import.meta.url))
11
13
  const analysisDataFilepath = 'src/lib/analysis.json'
12
14
  const jsonPath = resolve(_dirname, analysisDataFilepath)
13
15
 
14
- /**
15
- * @returns import('vite').VitePlugin
16
- */
17
- function vitePlugin() {
18
- let config
16
+ function vitePlugin(configPath: string): PluginOption {
17
+ let config: PandaContext['config']
18
+
19
+ async function loadPandaConfig() {
20
+ const ctx = await loadConfigAndCreateContext({ configPath })
21
+ config = ctx.config
22
+
23
+ const result = analyzeTokens(ctx)
24
+ await writeAnalyzeJSON(jsonPath, result, ctx)
25
+ }
19
26
 
20
27
  return {
21
28
  name: 'vite:panda',
22
- async configResolved() {
23
- const ctx = await loadConfigAndCreateContext()
24
- config = ctx.config
25
29
 
26
- const result = analyzeTokens(ctx)
27
- await writeAnalyzeJSON(jsonPath, result, ctx)
28
- },
29
30
  async configureServer(server) {
30
- const file = config.path
31
- server.watcher.add(file).on('change', async () => {
31
+ server.watcher.add(configPath).on('change', async (path) => {
32
+ if (path !== configPath) return
33
+ await loadPandaConfig()
32
34
  const module = server.moduleGraph.getModuleById(resolvedVirtualModuleId)
33
- if (module) {
34
- await server.reloadModule(module)
35
- }
35
+ if (module) await server.reloadModule(module)
36
36
  })
37
37
  },
38
+
38
39
  resolveId(id) {
39
40
  if (id === virtualModuleId) {
40
41
  return resolvedVirtualModuleId
41
42
  }
42
43
  return null
43
44
  },
45
+
44
46
  async load(id) {
45
47
  if (id === resolvedVirtualModuleId) {
48
+ await loadPandaConfig()
46
49
  return {
47
50
  code: `export const config = ${stringify(config)}`,
48
51
  }
@@ -51,22 +54,15 @@ function vitePlugin() {
51
54
  }
52
55
  }
53
56
 
54
- /**
55
- * @returns import('astro').AstroIntegration
56
- */
57
- const virtualPanda = () => ({
57
+ const virtualPanda = (): AstroIntegration => ({
58
58
  name: 'virtual:panda',
59
59
  hooks: {
60
- 'astro:config:setup': ({ updateConfig, addWatchFile }) => {
61
- const configPath = findConfig()
62
-
63
- if (configPath) {
64
- addWatchFile(configPath)
65
- }
60
+ 'astro:config:setup': ({ updateConfig }) => {
61
+ const configPath = process.env.PUBLIC_CONFIG_PATH
66
62
 
67
63
  updateConfig({
68
64
  vite: {
69
- plugins: [vitePlugin()],
65
+ plugins: [vitePlugin(configPath!)],
70
66
  },
71
67
  })
72
68
  },