@pandacss/studio 0.15.2 → 0.15.4
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/package.json +8 -8
- package/src/lib/panda.context.ts +0 -2
- package/styled-system/chunks/src__components__color-wrapper.css +16 -25
- package/styled-system/chunks/src__components__colors.css +0 -1
- package/styled-system/chunks/src__components__empty-state.css +0 -1
- package/styled-system/chunks/src__components__font-family.css +0 -1
- package/styled-system/chunks/src__components__font-tokens.css +0 -1
- package/styled-system/chunks/src__components__input.css +10 -16
- package/styled-system/chunks/src__components__layer-styles.css +5 -7
- package/styled-system/chunks/src__components__nav-item.css +3 -5
- package/styled-system/chunks/src__components__overview.css +4 -7
- package/styled-system/chunks/src__components__radii.css +0 -1
- package/styled-system/chunks/src__components__semantic-color.css +0 -1
- package/styled-system/chunks/src__components__side-nav-item.css +4 -7
- package/styled-system/chunks/src__components__side-nav.css +0 -1
- package/styled-system/chunks/src__components__text-styles.css +0 -1
- package/styled-system/chunks/src__components__theme-toggle.css +2 -4
- package/styled-system/chunks/src__components__token-content.css +0 -1
- package/styled-system/chunks/src__components__token-group.css +0 -1
- package/styled-system/chunks/src__components__typography-playground.css +0 -1
- package/styled-system/chunks/src__layouts__Sidebar.css +4 -4
- package/styled-system/jsx/factory.mjs +29 -17
- package/styled-system/styles.css +50 -319
- package/styled-system/types/jsx.d.ts +10 -2
- package/styled-system/types/recipe.d.ts +10 -8
- package/virtual-panda.ts +2 -12
- package/src/components/analyzer/category-utilities.tsx +0 -156
- package/src/components/analyzer/data-combobox.tsx +0 -154
- package/src/components/analyzer/data-table.tsx +0 -39
- package/src/components/analyzer/external-icon.tsx +0 -8
- package/src/components/analyzer/file-details.tsx +0 -101
- package/src/components/analyzer/get-report-infos-from.ts +0 -80
- package/src/components/analyzer/quick-tooltip.tsx +0 -15
- package/src/components/analyzer/report-item-columns.tsx +0 -52
- package/src/components/analyzer/report-item-link.tsx +0 -98
- package/src/components/analyzer/section.tsx +0 -24
- package/src/components/analyzer/sort-icon.tsx +0 -10
- package/src/components/analyzer/text-with-count.tsx +0 -28
- package/src/components/analyzer/token-search-combobox.tsx +0 -39
- package/src/components/analyzer/truncated-text.tsx +0 -28
- package/src/components/analyzer/utility-details.tsx +0 -325
- package/src/components/color-item.tsx +0 -37
- package/src/components/token-analyzer.tsx +0 -397
- package/src/lib/analysis-data.ts +0 -17
- package/src/lib/get-report-item.tsx +0 -41
- package/src/pages/token-analyzer/file.astro +0 -11
- package/src/pages/token-analyzer/index.astro +0 -11
- package/src/pages/token-analyzer/utility.astro +0 -11
- package/styled-system/chunks/src__components__analyzer__category-utilities.css +0 -118
- package/styled-system/chunks/src__components__analyzer__data-combobox.css +0 -137
- package/styled-system/chunks/src__components__analyzer__data-table.css +0 -46
- package/styled-system/chunks/src__components__analyzer__file-details.css +0 -98
- package/styled-system/chunks/src__components__analyzer__report-item-columns.css +0 -39
- package/styled-system/chunks/src__components__analyzer__report-item-link.css +0 -78
- package/styled-system/chunks/src__components__analyzer__section.css +0 -30
- package/styled-system/chunks/src__components__analyzer__text-with-count.css +0 -34
- package/styled-system/chunks/src__components__analyzer__truncated-text.css +0 -18
- package/styled-system/chunks/src__components__analyzer__utility-details.css +0 -139
- package/styled-system/chunks/src__components__color-item.css +0 -22
- package/styled-system/chunks/src__components__token-analyzer.css +0 -220
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
import { css, cx } from '../../styled-system/css'
|
|
2
|
-
import { panda, Stack, Wrap } from '../../styled-system/jsx'
|
|
3
|
-
import { analysisData } from '../lib/analysis-data'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Portal,
|
|
7
|
-
Select,
|
|
8
|
-
SelectContent,
|
|
9
|
-
SelectLabel,
|
|
10
|
-
SelectOption,
|
|
11
|
-
SelectPositioner,
|
|
12
|
-
SelectTrigger,
|
|
13
|
-
Tooltip,
|
|
14
|
-
TooltipContent,
|
|
15
|
-
TooltipPositioner,
|
|
16
|
-
TooltipTrigger,
|
|
17
|
-
} from '@ark-ui/react'
|
|
18
|
-
|
|
19
|
-
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@ark-ui/react'
|
|
20
|
-
import { stack } from '../../styled-system/patterns/stack'
|
|
21
|
-
|
|
22
|
-
import { styledLink } from '../../styled-system/patterns'
|
|
23
|
-
import { getReportItem, getUtilityLink, getReportRelativeFilePath, getFileLink } from '../lib/get-report-item'
|
|
24
|
-
import { pick } from '../lib/pick'
|
|
25
|
-
import { ReportItemLink } from './analyzer/report-item-link'
|
|
26
|
-
import { Section } from './analyzer/section'
|
|
27
|
-
import { TextWithCount } from './analyzer/text-with-count'
|
|
28
|
-
import { TruncatedText } from './analyzer/truncated-text'
|
|
29
|
-
import { ByCategory } from './analyzer/category-utilities'
|
|
30
|
-
import { ColorItem } from './color-item'
|
|
31
|
-
import { TokenSearchCombobox } from './analyzer/token-search-combobox'
|
|
32
|
-
import { useState } from 'react'
|
|
33
|
-
import { SortIcon } from './analyzer/sort-icon'
|
|
34
|
-
|
|
35
|
-
export function TokenAnalyzer() {
|
|
36
|
-
// console.log(tokenDictionary)
|
|
37
|
-
// console.log(analysisData)
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div className={css({ width: '100%', py: '20px', debug: false })}>
|
|
41
|
-
<panda.div px="24" w="100%">
|
|
42
|
-
<HeadlineSummary />
|
|
43
|
-
<TokenSearchCombobox />
|
|
44
|
-
<MostUsedList />
|
|
45
|
-
<ColorPalette />
|
|
46
|
-
<ByCategory byCategory={analysisData.details.globalMaps.byCategory} />
|
|
47
|
-
<FilesAccordionList />
|
|
48
|
-
</panda.div>
|
|
49
|
-
</div>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const [topKind, secondKind] = analysisData.stats.mostUseds.instanceOfKinds
|
|
54
|
-
|
|
55
|
-
const values = Object.values(analysisData.details.byId)
|
|
56
|
-
const withImportant = values.filter((reportItem) => String(reportItem.value).endsWith('!'))
|
|
57
|
-
|
|
58
|
-
const knownValues = values.filter((reportItem) => reportItem.isKnown)
|
|
59
|
-
const unknownValuesCount = values.length - knownValues.length
|
|
60
|
-
const formater = new Intl.NumberFormat('en-US', {
|
|
61
|
-
maximumFractionDigits: 2,
|
|
62
|
-
minimumFractionDigits: 2,
|
|
63
|
-
style: 'percent',
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
const HeadlineSummary = () => {
|
|
67
|
-
return (
|
|
68
|
-
<Stack mb="4" direction="column" align="center" p="20px" fontSize="lg">
|
|
69
|
-
<div>
|
|
70
|
-
<panda.span fontSize="xl" fontWeight="bold">
|
|
71
|
-
{Object.keys(analysisData.details.byId).length}
|
|
72
|
-
</panda.span>{' '}
|
|
73
|
-
token usage including{' '}
|
|
74
|
-
<panda.span fontSize="xl" fontWeight="bold">
|
|
75
|
-
<panda.a className={styledLink({})} href={getUtilityLink({ category: 'colors' })}>
|
|
76
|
-
{analysisData.counts.colorsUsed}
|
|
77
|
-
</panda.a>
|
|
78
|
-
</panda.span>{' '}
|
|
79
|
-
colors found in{' '}
|
|
80
|
-
<panda.span fontSize="xl" fontWeight="bold">
|
|
81
|
-
{analysisData.counts.filesWithTokens}
|
|
82
|
-
</panda.span>{' '}
|
|
83
|
-
files
|
|
84
|
-
</div>
|
|
85
|
-
<panda.div fontSize="md">
|
|
86
|
-
with{' '}
|
|
87
|
-
<Tooltip openDelay={0} closeDelay={100} positioning={{ placement: 'bottom-start', gutter: 20 }}>
|
|
88
|
-
<TooltipTrigger>
|
|
89
|
-
<span>
|
|
90
|
-
<panda.span fontSize="lg" fontWeight="bold">
|
|
91
|
-
{analysisData.fileSizes.gzip.minified}
|
|
92
|
-
</panda.span>{' '}
|
|
93
|
-
KB corresponding CSS generated (min+gzip)
|
|
94
|
-
</span>
|
|
95
|
-
</TooltipTrigger>
|
|
96
|
-
<Portal>
|
|
97
|
-
<TooltipPositioner>
|
|
98
|
-
<TooltipContent>
|
|
99
|
-
<panda.span p="2" bg="gray.100" border="1px solid rgba(0, 0, 0, 0.1)" rounded="md">
|
|
100
|
-
<panda.span fontSize="lg" fontWeight="bold">
|
|
101
|
-
{analysisData.fileSizes.normal}
|
|
102
|
-
</panda.span>{' '}
|
|
103
|
-
(unmin+uncompressed)
|
|
104
|
-
</panda.span>
|
|
105
|
-
</TooltipContent>
|
|
106
|
-
</TooltipPositioner>
|
|
107
|
-
</Portal>
|
|
108
|
-
</Tooltip>
|
|
109
|
-
</panda.div>
|
|
110
|
-
{topKind && (
|
|
111
|
-
<panda.div fontSize="md">
|
|
112
|
-
<span>Mostly </span>
|
|
113
|
-
{
|
|
114
|
-
<TextWithCount display="inline-block" count={topKind.count}>
|
|
115
|
-
{topKind.key === 'function' ? 'using functions' : 'using style props'}
|
|
116
|
-
</TextWithCount>
|
|
117
|
-
}
|
|
118
|
-
{secondKind && (
|
|
119
|
-
<>
|
|
120
|
-
, and others{' '}
|
|
121
|
-
<TextWithCount display="inline-block" count={secondKind.count}>
|
|
122
|
-
{secondKind.key === 'function' ? 'using functions' : 'using style props'}.
|
|
123
|
-
</TextWithCount>
|
|
124
|
-
</>
|
|
125
|
-
)}
|
|
126
|
-
</panda.div>
|
|
127
|
-
)}
|
|
128
|
-
<panda.div fontSize="sm">
|
|
129
|
-
<span>
|
|
130
|
-
With{' '}
|
|
131
|
-
<panda.span fontSize="md" fontWeight="bold">
|
|
132
|
-
{unknownValuesCount}
|
|
133
|
-
</panda.span>{' '}
|
|
134
|
-
unknown token values (
|
|
135
|
-
<panda.span fontSize="md" fontWeight="bold">
|
|
136
|
-
{formater.format(unknownValuesCount / values.length)}
|
|
137
|
-
</panda.span>
|
|
138
|
-
) and{' '}
|
|
139
|
-
<panda.span fontSize="md" fontWeight="bold">
|
|
140
|
-
{withImportant.length}
|
|
141
|
-
</panda.span>{' '}
|
|
142
|
-
values marked as important (
|
|
143
|
-
<panda.span fontSize="md" fontWeight="bold">
|
|
144
|
-
{formater.format(withImportant.length / values.length)}
|
|
145
|
-
</panda.span>
|
|
146
|
-
)
|
|
147
|
-
</span>
|
|
148
|
-
</panda.div>
|
|
149
|
-
</Stack>
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const selectOptionClass = css({
|
|
154
|
-
padding: '4px 8px',
|
|
155
|
-
bg: 'card',
|
|
156
|
-
rounded: 'md',
|
|
157
|
-
'& li': {
|
|
158
|
-
cursor: 'pointer',
|
|
159
|
-
_hover: { opacity: 0.8 },
|
|
160
|
-
},
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
const MostUsedList = () => {
|
|
164
|
-
return (
|
|
165
|
-
<>
|
|
166
|
-
<Select defaultValue={{ label: 'tokens', value: 'tokens' }}>
|
|
167
|
-
{({ selectedOption }) => (
|
|
168
|
-
<Section
|
|
169
|
-
title={
|
|
170
|
-
<>
|
|
171
|
-
<SelectLabel>Top 10 </SelectLabel>
|
|
172
|
-
<SelectTrigger>
|
|
173
|
-
<button>{selectedOption?.label}</button>
|
|
174
|
-
</SelectTrigger>
|
|
175
|
-
</>
|
|
176
|
-
}
|
|
177
|
-
bg="card"
|
|
178
|
-
>
|
|
179
|
-
{mostUsedByName[selectedOption?.value as keyof typeof mostUsedByName]}
|
|
180
|
-
<>
|
|
181
|
-
<Portal>
|
|
182
|
-
<SelectPositioner>
|
|
183
|
-
<SelectContent className={cx(selectOptionClass, css({ listStyle: 'none' }))}>
|
|
184
|
-
<SelectOption className={selectOptionClass} value="tokens" label="tokens" />
|
|
185
|
-
<SelectOption className={selectOptionClass} value="properties" label="properties" />
|
|
186
|
-
<SelectOption className={selectOptionClass} value="categories" label="categories" />
|
|
187
|
-
<SelectOption className={selectOptionClass} value="conditions" label="conditions" />
|
|
188
|
-
<SelectOption className={selectOptionClass} value="propertyPaths" label="property paths" />
|
|
189
|
-
<SelectOption className={selectOptionClass} value="shorthands" label="shorthands" />
|
|
190
|
-
<SelectOption className={selectOptionClass} value="instances" label="instances" />
|
|
191
|
-
<SelectOption className={selectOptionClass} value="types" label="types" />
|
|
192
|
-
</SelectContent>
|
|
193
|
-
</SelectPositioner>
|
|
194
|
-
</Portal>
|
|
195
|
-
</>
|
|
196
|
-
</Section>
|
|
197
|
-
)}
|
|
198
|
-
</Select>
|
|
199
|
-
</>
|
|
200
|
-
)
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const MostUsedItem = ({
|
|
204
|
-
entries,
|
|
205
|
-
}: {
|
|
206
|
-
entries: Array<{
|
|
207
|
-
key: string
|
|
208
|
-
count: number
|
|
209
|
-
}>
|
|
210
|
-
}) => {
|
|
211
|
-
return (
|
|
212
|
-
<Wrap gap="4" fontSize="sm">
|
|
213
|
-
{entries.map(({ key, count }) => {
|
|
214
|
-
return (
|
|
215
|
-
<panda.a className={styledLink({})} key={key} href={getUtilityLink({ value: key })}>
|
|
216
|
-
<TextWithCount count={count}>{key}</TextWithCount>
|
|
217
|
-
</panda.a>
|
|
218
|
-
)
|
|
219
|
-
})}
|
|
220
|
-
</Wrap>
|
|
221
|
-
)
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
const mostUsedByName = {
|
|
225
|
-
tokens: <MostUsedItem entries={analysisData.stats.mostUseds.tokens} />,
|
|
226
|
-
properties: <MostUsedItem entries={analysisData.stats.mostUseds.propNames} />,
|
|
227
|
-
shorthands: <MostUsedItem entries={analysisData.stats.mostUseds.shorthands} />,
|
|
228
|
-
categories: <MostUsedItem entries={analysisData.stats.mostUseds.categories} />,
|
|
229
|
-
conditions: <MostUsedItem entries={analysisData.stats.mostUseds.conditions} />,
|
|
230
|
-
propertyPaths: <MostUsedItem entries={analysisData.stats.mostUseds.propertyPaths} />,
|
|
231
|
-
instances: <MostUsedItem entries={analysisData.stats.mostUseds.instanceNames} />,
|
|
232
|
-
types: <MostUsedItem entries={analysisData.stats.mostUseds.types} />,
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const ColorPalette = () => {
|
|
236
|
-
return (
|
|
237
|
-
<Section
|
|
238
|
-
title={<TextWithCount count={analysisData.stats.mostUseds.colors.length}>Color palette</TextWithCount>}
|
|
239
|
-
bg="card"
|
|
240
|
-
>
|
|
241
|
-
<Wrap gap="2" fontSize="sm">
|
|
242
|
-
{analysisData.stats.mostUseds.colors.map(({ key, count }) => (
|
|
243
|
-
<ColorItem
|
|
244
|
-
tokenName={key}
|
|
245
|
-
key={key}
|
|
246
|
-
py="2"
|
|
247
|
-
px="4"
|
|
248
|
-
transition="all 0.2s ease"
|
|
249
|
-
rounded="md"
|
|
250
|
-
_hover={{ bgColor: 'border' }}
|
|
251
|
-
>
|
|
252
|
-
<TextWithCount count={count}>
|
|
253
|
-
<TruncatedText text={key} />
|
|
254
|
-
</TextWithCount>
|
|
255
|
-
</ColorItem>
|
|
256
|
-
))}
|
|
257
|
-
</Wrap>
|
|
258
|
-
</Section>
|
|
259
|
-
)
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
const FilesAccordionList = () => {
|
|
263
|
-
const entries = Object.entries(analysisData.details.byFilepath)
|
|
264
|
-
|
|
265
|
-
const [sortedBy, setSortedBy] = useState<'name' | 'tokens count' | 'file path'>('file path')
|
|
266
|
-
const sorted = entries.sort((a, b) => {
|
|
267
|
-
if (sortedBy === 'name') {
|
|
268
|
-
return a[0].localeCompare(b[0])
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (sortedBy === 'tokens count') {
|
|
272
|
-
return b[1].length - a[1].length
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
return 0
|
|
276
|
-
})
|
|
277
|
-
|
|
278
|
-
return (
|
|
279
|
-
<Section
|
|
280
|
-
p="0"
|
|
281
|
-
title={<TextWithCount count={sorted.length}>Files</TextWithCount>}
|
|
282
|
-
subTitle={
|
|
283
|
-
<panda.div ml="auto">
|
|
284
|
-
<Select onChange={(option) => setSortedBy((option?.value as any) ?? 'file path')}>
|
|
285
|
-
{({ selectedOption }) => (
|
|
286
|
-
<>
|
|
287
|
-
<SelectTrigger>
|
|
288
|
-
<panda.button display="flex" alignItems="center" cursor="pointer" _hover={{ opacity: 0.6 }}>
|
|
289
|
-
Sort by {selectedOption?.label}
|
|
290
|
-
<panda.div w="5" ml="2" color="text">
|
|
291
|
-
<SortIcon />
|
|
292
|
-
</panda.div>
|
|
293
|
-
</panda.button>
|
|
294
|
-
</SelectTrigger>
|
|
295
|
-
<Portal>
|
|
296
|
-
<SelectPositioner>
|
|
297
|
-
<SelectContent className={cx(selectOptionClass, css({ listStyle: 'none' }))}>
|
|
298
|
-
<SelectOption className={selectOptionClass} value="name" label="name" />
|
|
299
|
-
<SelectOption className={selectOptionClass} value="tokens count" label="tokens count" />
|
|
300
|
-
<SelectOption className={selectOptionClass} value="file path" label="file path" />
|
|
301
|
-
</SelectContent>
|
|
302
|
-
</SelectPositioner>
|
|
303
|
-
</Portal>
|
|
304
|
-
</>
|
|
305
|
-
)}
|
|
306
|
-
</Select>
|
|
307
|
-
</panda.div>
|
|
308
|
-
}
|
|
309
|
-
>
|
|
310
|
-
<Accordion className={stack({ gap: '2', px: '2', fontSize: 'sm', width: 'full' })} multiple>
|
|
311
|
-
{sorted.map(([filepath, reportItemIdList]) => {
|
|
312
|
-
const values = reportItemIdList.map(getReportItem)
|
|
313
|
-
const localMaps =
|
|
314
|
-
analysisData.details.byFilePathMaps[filepath as keyof typeof analysisData.details.byFilePathMaps]
|
|
315
|
-
const colors = Object.entries(localMaps.colorsUsed)
|
|
316
|
-
// console.log(localMaps, values)
|
|
317
|
-
|
|
318
|
-
return (
|
|
319
|
-
<AccordionItem
|
|
320
|
-
key={filepath}
|
|
321
|
-
value={filepath}
|
|
322
|
-
className={css({
|
|
323
|
-
width: 'full',
|
|
324
|
-
rounded: 'md',
|
|
325
|
-
bg: 'card',
|
|
326
|
-
_hover: { opacity: '0.8' },
|
|
327
|
-
cursor: 'pointer',
|
|
328
|
-
})}
|
|
329
|
-
>
|
|
330
|
-
{(props) => (
|
|
331
|
-
<>
|
|
332
|
-
<AccordionTrigger asChild>
|
|
333
|
-
<panda.button display="flex" bg="none" w="full" pt="6" pl="6" pr="4" cursor="pointer" color="text">
|
|
334
|
-
<panda.a
|
|
335
|
-
className={styledLink({})}
|
|
336
|
-
href={getFileLink({ filepath })}
|
|
337
|
-
onClick={(e) => e.stopPropagation()}
|
|
338
|
-
>
|
|
339
|
-
<TextWithCount key={filepath} count={reportItemIdList.length}>
|
|
340
|
-
{getReportRelativeFilePath(filepath)}
|
|
341
|
-
</TextWithCount>
|
|
342
|
-
</panda.a>
|
|
343
|
-
<panda.div ml="auto" mb="4">
|
|
344
|
-
<panda.span fontWeight="bold">{values.length}</panda.span> utilities and{' '}
|
|
345
|
-
<panda.span fontWeight="bold">{Object.keys(localMaps.colorsUsed).length}</panda.span> colors
|
|
346
|
-
used
|
|
347
|
-
</panda.div>
|
|
348
|
-
<panda.span ml="2">{props.isOpen ? '▲' : '▼'}</panda.span>
|
|
349
|
-
</panda.button>
|
|
350
|
-
</AccordionTrigger>
|
|
351
|
-
<AccordionContent className={css({ p: '6', cursor: 'default' })}>
|
|
352
|
-
<panda.div>
|
|
353
|
-
<panda.h5>Utilities</panda.h5>
|
|
354
|
-
<Wrap gap="2" mt="4">
|
|
355
|
-
{values.map((reportItem) => (
|
|
356
|
-
<ReportItemLink
|
|
357
|
-
key={reportItem.id}
|
|
358
|
-
{...pick(reportItem, ['value', 'propName', 'filepath'])}
|
|
359
|
-
/>
|
|
360
|
-
))}
|
|
361
|
-
</Wrap>
|
|
362
|
-
</panda.div>
|
|
363
|
-
|
|
364
|
-
{colors.length ? (
|
|
365
|
-
<panda.div mt="8">
|
|
366
|
-
<panda.h5>
|
|
367
|
-
<TextWithCount count={colors.length}>Color palette</TextWithCount>
|
|
368
|
-
</panda.h5>
|
|
369
|
-
<Wrap gap="2" mt="4">
|
|
370
|
-
{colors.map(([key]) => {
|
|
371
|
-
return (
|
|
372
|
-
<ColorItem
|
|
373
|
-
tokenName={key}
|
|
374
|
-
key={key}
|
|
375
|
-
py="2"
|
|
376
|
-
px="4"
|
|
377
|
-
transition="all 0.2s ease"
|
|
378
|
-
_hover={{ bg: 'border' }}
|
|
379
|
-
rounded="md"
|
|
380
|
-
>
|
|
381
|
-
<TruncatedText text={key} />
|
|
382
|
-
</ColorItem>
|
|
383
|
-
)
|
|
384
|
-
})}
|
|
385
|
-
</Wrap>
|
|
386
|
-
</panda.div>
|
|
387
|
-
) : null}
|
|
388
|
-
</AccordionContent>
|
|
389
|
-
</>
|
|
390
|
-
)}
|
|
391
|
-
</AccordionItem>
|
|
392
|
-
)
|
|
393
|
-
})}
|
|
394
|
-
</Accordion>
|
|
395
|
-
</Section>
|
|
396
|
-
)
|
|
397
|
-
}
|
package/src/lib/analysis-data.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TokenDictionary } from '@pandacss/token-dictionary'
|
|
2
|
-
import type { AnalysisReportJSON } from '@pandacss/types'
|
|
3
|
-
|
|
4
|
-
//@ts-ignore
|
|
5
|
-
import analysisData from './analysis.json' assert { type: 'json' }
|
|
6
|
-
|
|
7
|
-
const typedData = analysisData as any as AnalysisReportJSON
|
|
8
|
-
export { typedData as analysisData }
|
|
9
|
-
|
|
10
|
-
export const tokenDictionary = new TokenDictionary(analysisData.theme)
|
|
11
|
-
|
|
12
|
-
if (typeof window !== 'undefined') {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
window.PANDA_TOKEN_DICTIONNARY = tokenDictionary
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
window.PANDA_ANALYSIS_DATA = analysisData
|
|
17
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ReportItemJSON } from '@pandacss/types'
|
|
2
|
-
import { analysisData } from './analysis-data'
|
|
3
|
-
import { pick } from './pick'
|
|
4
|
-
|
|
5
|
-
export const getReportItem = (id: ReportItemJSON['id']) =>
|
|
6
|
-
(analysisData.details.byId as Record<string, any>)[id] as ReportItemJSON
|
|
7
|
-
|
|
8
|
-
export type SearchableReportItemAttributes = Partial<
|
|
9
|
-
Pick<ReportItemJSON, 'value' | 'category' | 'propName' | 'filepath' | 'from' | 'isKnown'> & {
|
|
10
|
-
important?: boolean
|
|
11
|
-
}
|
|
12
|
-
>
|
|
13
|
-
|
|
14
|
-
export const getUtilityLink = (reportItem: SearchableReportItemAttributes) => {
|
|
15
|
-
const searchParams = new URLSearchParams(
|
|
16
|
-
pick(reportItem, ['value', 'category', 'propName', 'from', 'filepath', 'isKnown', 'important']) as any,
|
|
17
|
-
)
|
|
18
|
-
return `/token-analyzer/utility?${searchParams.toString()}`
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const getFileLink = (reportItem: SearchableReportItemAttributes) => {
|
|
22
|
-
const searchParams = new URLSearchParams(pick(reportItem, ['filepath']) as any)
|
|
23
|
-
return `/token-analyzer/file?${searchParams.toString()}`
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const getReportItemFromTokenName = (tokenName: string) => {
|
|
27
|
-
const reportItem = analysisData.details.globalMaps.byTokenName[tokenName]?.[0]
|
|
28
|
-
return getReportItem(reportItem)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const getReportRelativeFilePath = (filePath: string) => filePath.replace(analysisData.cwd + '/', '')
|
|
32
|
-
export const getReportRange = (reportItem: ReportItemJSON) => `:${reportItem.box.line}:${reportItem.box.column}`
|
|
33
|
-
|
|
34
|
-
const openInEditor = (filepath: string, line: number, column: number) => {
|
|
35
|
-
return fetch(`/__open-in-editor?file=${encodeURIComponent(`${filepath}:${line}:${column}`)}`)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const openReportItemInEditor = (reportItem: ReportItemJSON) => {
|
|
39
|
-
console.log(reportItem)
|
|
40
|
-
return openInEditor(reportItem.filepath, reportItem.box.line, reportItem.box.column)
|
|
41
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { FileDetails } from '../../components/analyzer/file-details'
|
|
3
|
-
import Layout from '../../layouts/Layout.astro'
|
|
4
|
-
import Sidebar from '../../layouts/Sidebar.astro'
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
<Layout>
|
|
8
|
-
<Sidebar title="Token Analyzer - Files">
|
|
9
|
-
<FileDetails client:only />
|
|
10
|
-
</Sidebar>
|
|
11
|
-
</Layout>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { TokenAnalyzer } from '../../components/token-analyzer'
|
|
3
|
-
import Layout from '../../layouts/Layout.astro'
|
|
4
|
-
import Sidebar from '../../layouts/Sidebar.astro'
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
<Layout>
|
|
8
|
-
<Sidebar title="Token Analyzer">
|
|
9
|
-
<TokenAnalyzer client:load />
|
|
10
|
-
</Sidebar>
|
|
11
|
-
</Layout>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { UtilityDetails } from '../../components/analyzer/utility-details'
|
|
3
|
-
import Layout from '../../layouts/Layout.astro'
|
|
4
|
-
import Sidebar from '../../layouts/Sidebar.astro'
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
<Layout>
|
|
8
|
-
<Sidebar title="Token Analyzer - Utilities">
|
|
9
|
-
<UtilityDetails client:only />
|
|
10
|
-
</Sidebar>
|
|
11
|
-
</Layout>
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
@layer utilities {
|
|
2
|
-
|
|
3
|
-
.p_4px_8px {
|
|
4
|
-
padding: 4px 8px
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.\[\&_li\]\:cursor_pointer li {
|
|
8
|
-
cursor: pointer
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.list-style_none {
|
|
12
|
-
list-style: none
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.p_0 {
|
|
16
|
-
padding: var(--spacing-0)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.ml_auto {
|
|
20
|
-
margin-left: auto
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.w_26px {
|
|
24
|
-
width: 26px
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.ml_2 {
|
|
28
|
-
margin-left: var(--spacing-2)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.font_semibold {
|
|
32
|
-
font-weight: var(--font-weights-semibold)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.d_grid {
|
|
36
|
-
display: grid
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.grid-cols_repeat\(2\,_minmax\(0\,_1fr\)\) {
|
|
40
|
-
grid-template-columns: repeat(2, minmax(0, 1fr))
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.gap_4 {
|
|
44
|
-
gap: var(--spacing-4)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.col-span_span_2 {
|
|
48
|
-
grid-column: span 2
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.flex_column {
|
|
52
|
-
flex-direction: column
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.p_4 {
|
|
56
|
-
padding: var(--spacing-4)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.bg_card {
|
|
60
|
-
background: var(--colors-card)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.text_text {
|
|
64
|
-
color: var(--colors-text)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.rounded_md {
|
|
68
|
-
border-radius: var(--radii-md)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.d_inline-flex {
|
|
72
|
-
display: inline-flex
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.items_center {
|
|
76
|
-
align-items: center
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.opacity_0\.5 {
|
|
80
|
-
opacity: 0.5
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.border-b_1px_solid_transparent {
|
|
84
|
-
border-bottom: 1px solid transparent
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.cursor_pointer {
|
|
88
|
-
cursor: pointer
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.d_flex {
|
|
92
|
-
display: flex
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.flex-wrap_wrap {
|
|
96
|
-
flex-wrap: wrap
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.gap_2 {
|
|
100
|
-
gap: var(--spacing-2)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.hover\:opacity_0\.6:is(:hover, [data-hover]) {
|
|
104
|
-
opacity: 0.6
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.hover\:opacity_1:is(:hover, [data-hover]) {
|
|
108
|
-
opacity: 1
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.hover\:border-b_black:is(:hover, [data-hover]) {
|
|
112
|
-
border-bottom-color: var(--colors-black)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.\[\&_li\]\:hover\:opacity_0\.8 li:is(:hover, [data-hover]) {
|
|
116
|
-
opacity: 0.8
|
|
117
|
-
}
|
|
118
|
-
}
|