tailwind-styled-v4 5.0.0 → 5.0.2
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/CHANGELOG.md +398 -0
- package/LICENSE +21 -0
- package/README.md +532 -0
- package/dist/analyzer.d.mts +114 -0
- package/dist/analyzer.d.ts +114 -0
- package/dist/analyzer.js +6808 -0
- package/dist/analyzer.js.map +1 -0
- package/dist/analyzer.mjs +6798 -0
- package/dist/analyzer.mjs.map +1 -0
- package/dist/{animate.d.cts → animate.d.mts} +3 -30
- package/dist/animate.d.ts +3 -30
- package/dist/animate.js +7096 -352
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +7482 -0
- package/dist/animate.mjs.map +1 -0
- package/dist/atomic.d.mts +18 -0
- package/dist/atomic.d.ts +18 -0
- package/dist/atomic.js +191 -0
- package/dist/atomic.js.map +1 -0
- package/dist/atomic.mjs +185 -0
- package/dist/atomic.mjs.map +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +45008 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.mjs +44980 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/compiler.d.mts +1009 -0
- package/dist/compiler.d.ts +1009 -0
- package/dist/compiler.js +4937 -0
- package/dist/compiler.js.map +1 -0
- package/dist/compiler.mjs +4862 -0
- package/dist/compiler.mjs.map +1 -0
- package/dist/dashboard.d.mts +272 -0
- package/dist/dashboard.d.ts +272 -0
- package/dist/dashboard.js +249 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/dashboard.mjs +239 -0
- package/dist/dashboard.mjs.map +1 -0
- package/dist/devtools.js +171 -158
- package/dist/devtools.js.map +1 -1
- package/dist/{devtools.cjs → devtools.mjs} +166 -167
- package/dist/devtools.mjs.map +1 -0
- package/dist/engine.d.mts +398 -0
- package/dist/engine.d.ts +398 -0
- package/dist/engine.js +19264 -0
- package/dist/engine.js.map +1 -0
- package/dist/engine.mjs +19227 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/{index.d.cts → index.d.mts} +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +7178 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8408 -0
- package/dist/index.mjs.map +1 -0
- package/dist/liveTokenEngine-DYN3Zale.d.mts +34 -0
- package/dist/liveTokenEngine-DYN3Zale.d.ts +34 -0
- package/dist/{next.d.cts → next.d.mts} +2 -1
- package/dist/next.d.ts +2 -1
- package/dist/next.js +24027 -28
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +24232 -0
- package/dist/next.mjs.map +1 -0
- package/dist/plugin.d.mts +90 -0
- package/dist/plugin.d.ts +90 -0
- package/dist/plugin.js +185 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugin.mjs +174 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/pluginRegistry.d.mts +83 -0
- package/dist/pluginRegistry.d.ts +83 -0
- package/dist/pluginRegistry.js +303 -0
- package/dist/pluginRegistry.js.map +1 -0
- package/dist/pluginRegistry.mjs +298 -0
- package/dist/pluginRegistry.mjs.map +1 -0
- package/dist/preset.js +9 -4
- package/dist/preset.js.map +1 -1
- package/dist/{preset.cjs → preset.mjs} +5 -14
- package/dist/preset.mjs.map +1 -0
- package/dist/rspack.d.mts +33 -0
- package/dist/rspack.d.ts +33 -0
- package/dist/rspack.js +66 -0
- package/dist/rspack.js.map +1 -0
- package/dist/rspack.mjs +55 -0
- package/dist/rspack.mjs.map +1 -0
- package/dist/runtime.d.mts +62 -0
- package/dist/runtime.d.ts +62 -0
- package/dist/runtime.js +455 -0
- package/dist/runtime.js.map +1 -0
- package/dist/runtime.mjs +436 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/runtimeCss.d.mts +65 -0
- package/dist/runtimeCss.d.ts +65 -0
- package/dist/{css.cjs → runtimeCss.js} +71 -4
- package/dist/runtimeCss.js.map +1 -0
- package/dist/{css.js → runtimeCss.mjs} +66 -5
- package/dist/runtimeCss.mjs.map +1 -0
- package/dist/scanner.d.mts +25 -0
- package/dist/scanner.d.ts +25 -0
- package/dist/scanner.js +5774 -0
- package/dist/scanner.js.map +1 -0
- package/dist/scanner.mjs +5760 -0
- package/dist/scanner.mjs.map +1 -0
- package/dist/shared.d.mts +85 -0
- package/dist/shared.d.ts +85 -0
- package/dist/shared.js +255 -0
- package/dist/shared.js.map +1 -0
- package/dist/shared.mjs +233 -0
- package/dist/shared.mjs.map +1 -0
- package/dist/storybookAddon.d.mts +108 -0
- package/dist/storybookAddon.d.ts +108 -0
- package/dist/storybookAddon.js +95 -0
- package/dist/storybookAddon.js.map +1 -0
- package/dist/storybookAddon.mjs +88 -0
- package/dist/storybookAddon.mjs.map +1 -0
- package/dist/svelte.d.mts +114 -0
- package/dist/svelte.d.ts +114 -0
- package/dist/svelte.js +67 -0
- package/dist/svelte.js.map +1 -0
- package/dist/svelte.mjs +59 -0
- package/dist/svelte.mjs.map +1 -0
- package/dist/testing.d.mts +185 -0
- package/dist/testing.d.ts +185 -0
- package/dist/testing.js +173 -0
- package/dist/testing.js.map +1 -0
- package/dist/testing.mjs +158 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/theme.d.mts +188 -0
- package/dist/theme.d.ts +188 -0
- package/dist/theme.js +334 -0
- package/dist/theme.js.map +1 -0
- package/dist/theme.mjs +311 -0
- package/dist/theme.mjs.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types-DXr2PmGP.d.mts +31 -0
- package/dist/types-DXr2PmGP.d.ts +31 -0
- package/dist/vite.js +29611 -17
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +29712 -0
- package/dist/vite.mjs.map +1 -0
- package/dist/vue.d.mts +89 -0
- package/dist/vue.d.ts +89 -0
- package/dist/vue.js +104 -0
- package/dist/vue.js.map +1 -0
- package/dist/vue.mjs +96 -0
- package/dist/vue.mjs.map +1 -0
- package/package.json +170 -64
- package/dist/animate.cjs +0 -771
- package/dist/animate.cjs.map +0 -1
- package/dist/chunk-VZEJV27B.js +0 -11
- package/dist/chunk-VZEJV27B.js.map +0 -1
- package/dist/chunk-Y5D3E72P.cjs +0 -13
- package/dist/chunk-Y5D3E72P.cjs.map +0 -1
- package/dist/css.cjs.map +0 -1
- package/dist/css.d.cts +0 -30
- package/dist/css.d.ts +0 -30
- package/dist/css.js.map +0 -1
- package/dist/devtools.cjs.map +0 -1
- package/dist/index.cjs +0 -1353
- package/dist/index.cjs.map +0 -1
- package/dist/next.cjs +0 -248
- package/dist/next.cjs.map +0 -1
- package/dist/preset.cjs.map +0 -1
- package/dist/turbopackLoader.cjs +0 -37
- package/dist/turbopackLoader.cjs.map +0 -1
- package/dist/turbopackLoader.d.cts +0 -12
- package/dist/turbopackLoader.d.ts +0 -12
- package/dist/turbopackLoader.js +0 -35
- package/dist/turbopackLoader.js.map +0 -1
- package/dist/vite.cjs +0 -138
- package/dist/vite.cjs.map +0 -1
- package/dist/webpackLoader.cjs +0 -51
- package/dist/webpackLoader.cjs.map +0 -1
- package/dist/webpackLoader.d.cts +0 -17
- package/dist/webpackLoader.d.ts +0 -17
- package/dist/webpackLoader.js +0 -49
- package/dist/webpackLoader.js.map +0 -1
- /package/dist/{devtools.d.cts → devtools.d.mts} +0 -0
- /package/dist/{preset.d.cts → preset.d.mts} +0 -0
- /package/dist/{vite.d.cts → vite.d.mts} +0 -0
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
5
|
-
|
|
6
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
-
|
|
8
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
9
|
-
|
|
10
|
-
/* tailwind-styled-v4 v4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
3
|
+
/* tailwind-styled-v4 v5.0.1 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
11
4
|
function parseDataTw(dataTw) {
|
|
12
5
|
if (!dataTw) return { name: "Unknown", classes: [] };
|
|
13
6
|
const colonIdx = dataTw.indexOf(":");
|
|
@@ -74,53 +67,53 @@ function InspectorPanel({
|
|
|
74
67
|
pinned: _pinned
|
|
75
68
|
}) {
|
|
76
69
|
if (!inspected) {
|
|
77
|
-
return
|
|
70
|
+
return React.createElement(
|
|
78
71
|
"div",
|
|
79
72
|
{ style: S.emptyPanel },
|
|
80
|
-
|
|
73
|
+
React.createElement("span", { style: { opacity: 0.4 } }, "Hover an element to inspect")
|
|
81
74
|
);
|
|
82
75
|
}
|
|
83
|
-
return
|
|
76
|
+
return React.createElement(
|
|
84
77
|
"div",
|
|
85
78
|
{ style: S.scrollArea },
|
|
86
79
|
// Variant props
|
|
87
|
-
Object.keys(inspected.variantProps).length > 0 &&
|
|
80
|
+
Object.keys(inspected.variantProps).length > 0 && React.createElement(
|
|
88
81
|
"div",
|
|
89
82
|
{ style: S.section },
|
|
90
|
-
|
|
83
|
+
React.createElement("div", { style: S.sectionTitle }, "Variants"),
|
|
91
84
|
Object.entries(inspected.variantProps).map(
|
|
92
|
-
([k, v]) =>
|
|
85
|
+
([k, v]) => React.createElement(
|
|
93
86
|
"div",
|
|
94
87
|
{ key: k, style: S.row },
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
React.createElement("span", { style: S.varKey }, k),
|
|
89
|
+
React.createElement("span", { style: S.varValue }, `"${v}"`)
|
|
97
90
|
)
|
|
98
91
|
)
|
|
99
92
|
),
|
|
100
93
|
// Active states
|
|
101
|
-
Object.keys(inspected.activeStates).length > 0 &&
|
|
94
|
+
Object.keys(inspected.activeStates).length > 0 && React.createElement(
|
|
102
95
|
"div",
|
|
103
96
|
{ style: S.section },
|
|
104
|
-
|
|
97
|
+
React.createElement("div", { style: S.sectionTitle }, "Active Data Attrs"),
|
|
105
98
|
Object.entries(inspected.activeStates).map(
|
|
106
|
-
([k, v]) =>
|
|
99
|
+
([k, v]) => React.createElement(
|
|
107
100
|
"div",
|
|
108
101
|
{ key: k, style: S.row },
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
React.createElement("code", { style: { ...S.varKey, color: "#f59e0b" } }, `data-${k}`),
|
|
103
|
+
React.createElement("span", { style: { ...S.varValue, color: "#34d399" } }, `"${v}"`)
|
|
111
104
|
)
|
|
112
105
|
)
|
|
113
106
|
),
|
|
114
107
|
// State names
|
|
115
|
-
inspected.stateNames.length > 0 &&
|
|
108
|
+
inspected.stateNames.length > 0 && React.createElement(
|
|
116
109
|
"div",
|
|
117
110
|
{ style: S.section },
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
React.createElement("div", { style: S.sectionTitle }, "Reactive States"),
|
|
112
|
+
React.createElement(
|
|
120
113
|
"div",
|
|
121
114
|
{ style: S.classGrid },
|
|
122
115
|
inspected.stateNames.map(
|
|
123
|
-
(s) =>
|
|
116
|
+
(s) => React.createElement(
|
|
124
117
|
"code",
|
|
125
118
|
{
|
|
126
119
|
key: s,
|
|
@@ -136,15 +129,15 @@ function InspectorPanel({
|
|
|
136
129
|
)
|
|
137
130
|
),
|
|
138
131
|
// Container breakpoints
|
|
139
|
-
inspected.containerBps.length > 0 &&
|
|
132
|
+
inspected.containerBps.length > 0 && React.createElement(
|
|
140
133
|
"div",
|
|
141
134
|
{ style: S.section },
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
React.createElement("div", { style: S.sectionTitle }, "Container Breakpoints"),
|
|
136
|
+
React.createElement(
|
|
144
137
|
"div",
|
|
145
138
|
{ style: S.classGrid },
|
|
146
139
|
inspected.containerBps.map(
|
|
147
|
-
(bp) =>
|
|
140
|
+
(bp) => React.createElement(
|
|
148
141
|
"code",
|
|
149
142
|
{ key: bp, style: { ...S.classChip, color: "#818cf8" } },
|
|
150
143
|
bp
|
|
@@ -153,15 +146,15 @@ function InspectorPanel({
|
|
|
153
146
|
)
|
|
154
147
|
),
|
|
155
148
|
// Tailwind classes
|
|
156
|
-
inspected.twClasses.length > 0 &&
|
|
149
|
+
inspected.twClasses.length > 0 && React.createElement(
|
|
157
150
|
"div",
|
|
158
151
|
{ style: S.section },
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
React.createElement("div", { style: S.sectionTitle }, "Classes"),
|
|
153
|
+
React.createElement(
|
|
161
154
|
"div",
|
|
162
155
|
{ style: S.classGrid },
|
|
163
156
|
inspected.twClasses.map(
|
|
164
|
-
(cls) =>
|
|
157
|
+
(cls) => React.createElement(
|
|
165
158
|
"code",
|
|
166
159
|
{ key: cls, style: S.classChip, title: inspected.atomicMap[cls] },
|
|
167
160
|
cls
|
|
@@ -170,7 +163,7 @@ function InspectorPanel({
|
|
|
170
163
|
)
|
|
171
164
|
),
|
|
172
165
|
// Copy
|
|
173
|
-
|
|
166
|
+
React.createElement(
|
|
174
167
|
"button",
|
|
175
168
|
{
|
|
176
169
|
style: S.copyBtn,
|
|
@@ -194,8 +187,8 @@ function InspectorPanel({
|
|
|
194
187
|
);
|
|
195
188
|
}
|
|
196
189
|
function StatePanel() {
|
|
197
|
-
const [entries, setEntries] =
|
|
198
|
-
|
|
190
|
+
const [entries, setEntries] = useState([]);
|
|
191
|
+
useEffect(() => {
|
|
199
192
|
const refresh = () => {
|
|
200
193
|
const reg = window.__TW_STATE_REGISTRY__;
|
|
201
194
|
setEntries(reg ? Array.from(reg.values()) : []);
|
|
@@ -205,54 +198,54 @@ function StatePanel() {
|
|
|
205
198
|
return () => clearInterval(interval);
|
|
206
199
|
}, []);
|
|
207
200
|
if (entries.length === 0) {
|
|
208
|
-
return
|
|
201
|
+
return React.createElement(
|
|
209
202
|
"div",
|
|
210
203
|
{ style: S.emptyPanel },
|
|
211
|
-
|
|
204
|
+
React.createElement(
|
|
212
205
|
"span",
|
|
213
206
|
{ style: { opacity: 0.4 } },
|
|
214
207
|
"No state-enabled components found."
|
|
215
208
|
),
|
|
216
|
-
|
|
217
|
-
|
|
209
|
+
React.createElement("br", null),
|
|
210
|
+
React.createElement(
|
|
218
211
|
"span",
|
|
219
212
|
{ style: { opacity: 0.3, fontSize: "11px" } },
|
|
220
213
|
'Use tw.button({ state: { active: "..." } }) to register.'
|
|
221
214
|
)
|
|
222
215
|
);
|
|
223
216
|
}
|
|
224
|
-
return
|
|
217
|
+
return React.createElement(
|
|
225
218
|
"div",
|
|
226
219
|
{ style: S.scrollArea },
|
|
227
220
|
entries.map(
|
|
228
|
-
(entry) =>
|
|
221
|
+
(entry) => React.createElement(
|
|
229
222
|
"div",
|
|
230
223
|
{ key: entry.id, style: S.section },
|
|
231
|
-
|
|
224
|
+
React.createElement(
|
|
232
225
|
"div",
|
|
233
226
|
{ style: S.sectionTitle },
|
|
234
|
-
|
|
235
|
-
|
|
227
|
+
React.createElement("span", { style: { color: "#60a5fa" } }, entry.tag.toUpperCase()),
|
|
228
|
+
React.createElement(
|
|
236
229
|
"span",
|
|
237
230
|
{ style: { marginLeft: "8px", color: "#52525b", fontSize: "10px" } },
|
|
238
231
|
entry.id
|
|
239
232
|
)
|
|
240
233
|
),
|
|
241
|
-
|
|
234
|
+
React.createElement(
|
|
242
235
|
"div",
|
|
243
236
|
{ style: S.classGrid },
|
|
244
237
|
entry.states.map(
|
|
245
|
-
(s) =>
|
|
238
|
+
(s) => React.createElement(
|
|
246
239
|
"code",
|
|
247
240
|
{ key: s, style: { ...S.classChip, color: "#f59e0b" } },
|
|
248
241
|
`data-${s}`
|
|
249
242
|
)
|
|
250
243
|
)
|
|
251
244
|
),
|
|
252
|
-
|
|
245
|
+
React.createElement(
|
|
253
246
|
"div",
|
|
254
247
|
{ style: { ...S.row, marginTop: "4px" } },
|
|
255
|
-
|
|
248
|
+
React.createElement(
|
|
256
249
|
"span",
|
|
257
250
|
{
|
|
258
251
|
style: {
|
|
@@ -269,8 +262,8 @@ function StatePanel() {
|
|
|
269
262
|
);
|
|
270
263
|
}
|
|
271
264
|
function ContainerPanel() {
|
|
272
|
-
const [entries, setEntries] =
|
|
273
|
-
|
|
265
|
+
const [entries, setEntries] = useState([]);
|
|
266
|
+
useEffect(() => {
|
|
274
267
|
const refresh = () => {
|
|
275
268
|
const reg = window.__TW_CONTAINER_REGISTRY__;
|
|
276
269
|
setEntries(reg ? Array.from(reg.values()) : []);
|
|
@@ -280,57 +273,57 @@ function ContainerPanel() {
|
|
|
280
273
|
return () => clearInterval(interval);
|
|
281
274
|
}, []);
|
|
282
275
|
if (entries.length === 0) {
|
|
283
|
-
return
|
|
276
|
+
return React.createElement(
|
|
284
277
|
"div",
|
|
285
278
|
{ style: S.emptyPanel },
|
|
286
|
-
|
|
279
|
+
React.createElement(
|
|
287
280
|
"span",
|
|
288
281
|
{ style: { opacity: 0.4 } },
|
|
289
282
|
"No container query components found."
|
|
290
283
|
),
|
|
291
|
-
|
|
292
|
-
|
|
284
|
+
React.createElement("br", null),
|
|
285
|
+
React.createElement(
|
|
293
286
|
"span",
|
|
294
287
|
{ style: { opacity: 0.3, fontSize: "11px" } },
|
|
295
288
|
'Use tw.div({ container: { md: "flex-row" } }) to register.'
|
|
296
289
|
)
|
|
297
290
|
);
|
|
298
291
|
}
|
|
299
|
-
return
|
|
292
|
+
return React.createElement(
|
|
300
293
|
"div",
|
|
301
294
|
{ style: S.scrollArea },
|
|
302
295
|
entries.map(
|
|
303
|
-
(entry) =>
|
|
296
|
+
(entry) => React.createElement(
|
|
304
297
|
"div",
|
|
305
298
|
{ key: entry.id, style: S.section },
|
|
306
|
-
|
|
299
|
+
React.createElement(
|
|
307
300
|
"div",
|
|
308
301
|
{ style: S.sectionTitle },
|
|
309
|
-
|
|
310
|
-
entry.containerName &&
|
|
302
|
+
React.createElement("span", { style: { color: "#60a5fa" } }, entry.tag.toUpperCase()),
|
|
303
|
+
entry.containerName && React.createElement(
|
|
311
304
|
"span",
|
|
312
305
|
{ style: { marginLeft: "6px", color: "#818cf8" } },
|
|
313
306
|
`[${entry.containerName}]`
|
|
314
307
|
),
|
|
315
|
-
|
|
308
|
+
React.createElement(
|
|
316
309
|
"span",
|
|
317
310
|
{ style: { marginLeft: "8px", color: "#52525b", fontSize: "10px" } },
|
|
318
311
|
entry.id
|
|
319
312
|
)
|
|
320
313
|
),
|
|
321
|
-
|
|
314
|
+
React.createElement(
|
|
322
315
|
"div",
|
|
323
316
|
null,
|
|
324
317
|
entry.breakpoints.map(
|
|
325
|
-
(bp, i) =>
|
|
318
|
+
(bp, i) => React.createElement(
|
|
326
319
|
"div",
|
|
327
320
|
{ key: i, style: { ...S.row, marginBottom: "2px" } },
|
|
328
|
-
|
|
321
|
+
React.createElement(
|
|
329
322
|
"code",
|
|
330
323
|
{ style: { color: "#818cf8", fontSize: "11px" } },
|
|
331
324
|
`\u2265 ${bp.minWidth}`
|
|
332
325
|
),
|
|
333
|
-
|
|
326
|
+
React.createElement(
|
|
334
327
|
"span",
|
|
335
328
|
{ style: { color: "#6b7280", fontSize: "11px" } },
|
|
336
329
|
bp.classes
|
|
@@ -343,8 +336,8 @@ function ContainerPanel() {
|
|
|
343
336
|
);
|
|
344
337
|
}
|
|
345
338
|
function TokensPanel() {
|
|
346
|
-
const [tokens, setTokens_] =
|
|
347
|
-
|
|
339
|
+
const [tokens, setTokens_] = useState({});
|
|
340
|
+
useEffect(() => {
|
|
348
341
|
const engine = window.__TW_TOKEN_ENGINE__;
|
|
349
342
|
if (!engine) return;
|
|
350
343
|
setTokens_(engine.getTokens());
|
|
@@ -353,35 +346,35 @@ function TokensPanel() {
|
|
|
353
346
|
}, []);
|
|
354
347
|
const entries = Object.entries(tokens);
|
|
355
348
|
if (entries.length === 0) {
|
|
356
|
-
return
|
|
349
|
+
return React.createElement(
|
|
357
350
|
"div",
|
|
358
351
|
{ style: S.emptyPanel },
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
352
|
+
React.createElement("span", { style: { opacity: 0.4 } }, "No live tokens registered."),
|
|
353
|
+
React.createElement("br", null),
|
|
354
|
+
React.createElement(
|
|
362
355
|
"span",
|
|
363
356
|
{ style: { opacity: 0.3, fontSize: "11px" } },
|
|
364
357
|
'Use liveToken({ primary: "#3b82f6" }) to register tokens.'
|
|
365
358
|
)
|
|
366
359
|
);
|
|
367
360
|
}
|
|
368
|
-
return
|
|
361
|
+
return React.createElement(
|
|
369
362
|
"div",
|
|
370
363
|
{ style: S.scrollArea },
|
|
371
|
-
|
|
364
|
+
React.createElement(
|
|
372
365
|
"div",
|
|
373
366
|
{ style: { ...S.sectionTitle, padding: "8px 12px 4px", color: "#52525b" } },
|
|
374
367
|
"Click color to edit \xB7 Changes apply instantly"
|
|
375
368
|
),
|
|
376
369
|
entries.map(([name, value]) => {
|
|
377
370
|
const isColor = value.startsWith("#") || value.startsWith("rgb") || value.startsWith("hsl");
|
|
378
|
-
return
|
|
371
|
+
return React.createElement(
|
|
379
372
|
"div",
|
|
380
373
|
{ key: name, style: { ...S.row, padding: "6px 12px", borderBottom: "1px solid #18181b" } },
|
|
381
|
-
|
|
374
|
+
React.createElement(
|
|
382
375
|
"div",
|
|
383
376
|
{ style: { display: "flex", alignItems: "center", gap: "8px" } },
|
|
384
|
-
isColor &&
|
|
377
|
+
isColor && React.createElement("div", {
|
|
385
378
|
style: {
|
|
386
379
|
width: "16px",
|
|
387
380
|
height: "16px",
|
|
@@ -391,9 +384,9 @@ function TokensPanel() {
|
|
|
391
384
|
flexShrink: 0
|
|
392
385
|
}
|
|
393
386
|
}),
|
|
394
|
-
|
|
387
|
+
React.createElement("span", { style: { color: "#a1a1aa", fontSize: "12px" } }, name)
|
|
395
388
|
),
|
|
396
|
-
isColor ?
|
|
389
|
+
isColor ? React.createElement("input", {
|
|
397
390
|
type: "color",
|
|
398
391
|
defaultValue: value.startsWith("#") ? value : "#000000",
|
|
399
392
|
style: {
|
|
@@ -407,7 +400,7 @@ function TokensPanel() {
|
|
|
407
400
|
const engine = window.__TW_TOKEN_ENGINE__;
|
|
408
401
|
if (engine) engine.setToken(name, e.target.value);
|
|
409
402
|
}
|
|
410
|
-
}) :
|
|
403
|
+
}) : React.createElement("input", {
|
|
411
404
|
type: "text",
|
|
412
405
|
defaultValue: value,
|
|
413
406
|
style: {
|
|
@@ -430,16 +423,18 @@ function TokensPanel() {
|
|
|
430
423
|
);
|
|
431
424
|
}
|
|
432
425
|
function AnalyzerPanel() {
|
|
433
|
-
const [scanning, setScanning] =
|
|
434
|
-
const [results, setResults] =
|
|
435
|
-
const [engineMetrics, setEngineMetrics] =
|
|
436
|
-
const [metricsFetching, setMetricsFetching] =
|
|
437
|
-
const [metricsError, setMetricsError] =
|
|
438
|
-
const loadEngineMetrics =
|
|
426
|
+
const [scanning, setScanning] = useState(false);
|
|
427
|
+
const [results, setResults] = useState(null);
|
|
428
|
+
const [engineMetrics, setEngineMetrics] = useState(null);
|
|
429
|
+
const [metricsFetching, setMetricsFetching] = useState(false);
|
|
430
|
+
const [metricsError, setMetricsError] = useState(null);
|
|
431
|
+
const loadEngineMetrics = useCallback(async () => {
|
|
439
432
|
setMetricsFetching(true);
|
|
440
433
|
setMetricsError(null);
|
|
441
434
|
try {
|
|
442
|
-
const res = await fetch("http://localhost:3000/metrics", {
|
|
435
|
+
const res = await fetch("http://localhost:3000/metrics", {
|
|
436
|
+
signal: AbortSignal.timeout(2e3)
|
|
437
|
+
});
|
|
443
438
|
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
444
439
|
const data = await res.json();
|
|
445
440
|
setEngineMetrics(data);
|
|
@@ -453,7 +448,7 @@ function AnalyzerPanel() {
|
|
|
453
448
|
setMetricsFetching(false);
|
|
454
449
|
}
|
|
455
450
|
}, []);
|
|
456
|
-
const runScan =
|
|
451
|
+
const runScan = useCallback(() => {
|
|
457
452
|
setScanning(true);
|
|
458
453
|
setTimeout(() => {
|
|
459
454
|
const twEls = document.querySelectorAll("[data-tw]");
|
|
@@ -485,14 +480,14 @@ function AnalyzerPanel() {
|
|
|
485
480
|
setScanning(false);
|
|
486
481
|
}, 100);
|
|
487
482
|
}, []);
|
|
488
|
-
return
|
|
483
|
+
return React.createElement(
|
|
489
484
|
"div",
|
|
490
485
|
{ style: S.scrollArea },
|
|
491
|
-
|
|
486
|
+
React.createElement(
|
|
492
487
|
"div",
|
|
493
488
|
{ style: { padding: "10px 12px" } },
|
|
494
489
|
// ── DOM Scan ──────────────────────────────────────────────────────────
|
|
495
|
-
|
|
490
|
+
React.createElement(
|
|
496
491
|
"button",
|
|
497
492
|
{
|
|
498
493
|
style: { ...S.copyBtn, borderTop: "none", color: "#60a5fa", fontWeight: "600" },
|
|
@@ -502,58 +497,58 @@ function AnalyzerPanel() {
|
|
|
502
497
|
scanning ? "Scanning DOM..." : "\u25B6 Run DOM Scan"
|
|
503
498
|
),
|
|
504
499
|
// ── Engine Metrics (dari dashboard) ───────────────────────────────────
|
|
505
|
-
|
|
500
|
+
React.createElement(
|
|
506
501
|
"div",
|
|
507
502
|
{ style: { ...S.section, marginTop: "8px" } },
|
|
508
|
-
|
|
503
|
+
React.createElement(
|
|
509
504
|
"div",
|
|
510
505
|
{ style: { ...S.sectionTitle, marginBottom: "6px" } },
|
|
511
506
|
"\u26A1 Engine Metrics"
|
|
512
507
|
),
|
|
513
|
-
engineMetrics ?
|
|
508
|
+
engineMetrics ? React.createElement(
|
|
514
509
|
"div",
|
|
515
510
|
null,
|
|
516
|
-
|
|
511
|
+
React.createElement(
|
|
517
512
|
"div",
|
|
518
513
|
{ style: S.row },
|
|
519
|
-
|
|
520
|
-
|
|
514
|
+
React.createElement("span", { style: S.varKey }, "Build"),
|
|
515
|
+
React.createElement(
|
|
521
516
|
"span",
|
|
522
517
|
{ style: { ...S.varValue, color: "#34d399" } },
|
|
523
|
-
engineMetrics.buildMs
|
|
518
|
+
engineMetrics.buildMs !== null ? `${engineMetrics.buildMs}ms` : "\u2014"
|
|
524
519
|
)
|
|
525
520
|
),
|
|
526
|
-
|
|
521
|
+
React.createElement(
|
|
527
522
|
"div",
|
|
528
523
|
{ style: S.row },
|
|
529
|
-
|
|
530
|
-
|
|
524
|
+
React.createElement("span", { style: S.varKey }, "Classes"),
|
|
525
|
+
React.createElement(
|
|
531
526
|
"span",
|
|
532
527
|
{ style: { ...S.varValue, color: "#34d399" } },
|
|
533
528
|
String(engineMetrics.classCount ?? "\u2014")
|
|
534
529
|
)
|
|
535
530
|
),
|
|
536
|
-
|
|
531
|
+
React.createElement(
|
|
537
532
|
"div",
|
|
538
533
|
{ style: S.row },
|
|
539
|
-
|
|
540
|
-
|
|
534
|
+
React.createElement("span", { style: S.varKey }, "Files"),
|
|
535
|
+
React.createElement(
|
|
541
536
|
"span",
|
|
542
537
|
{ style: { ...S.varValue, color: "#34d399" } },
|
|
543
538
|
String(engineMetrics.fileCount ?? "\u2014")
|
|
544
539
|
)
|
|
545
540
|
),
|
|
546
|
-
|
|
541
|
+
React.createElement(
|
|
547
542
|
"div",
|
|
548
543
|
{ style: S.row },
|
|
549
|
-
|
|
550
|
-
|
|
544
|
+
React.createElement("span", { style: S.varKey }, "Mode"),
|
|
545
|
+
React.createElement(
|
|
551
546
|
"span",
|
|
552
547
|
{ style: { color: "#a1a1aa", fontSize: "11px" } },
|
|
553
548
|
String(engineMetrics.mode ?? "\u2014")
|
|
554
549
|
)
|
|
555
550
|
),
|
|
556
|
-
|
|
551
|
+
React.createElement(
|
|
557
552
|
"button",
|
|
558
553
|
{
|
|
559
554
|
style: {
|
|
@@ -568,15 +563,15 @@ function AnalyzerPanel() {
|
|
|
568
563
|
},
|
|
569
564
|
"\u21BB Refresh"
|
|
570
565
|
)
|
|
571
|
-
) : metricsError ?
|
|
566
|
+
) : metricsError ? React.createElement(
|
|
572
567
|
"div",
|
|
573
568
|
null,
|
|
574
|
-
|
|
569
|
+
React.createElement(
|
|
575
570
|
"div",
|
|
576
571
|
{ style: { color: "#f87171", fontSize: "11px", marginBottom: "6px" } },
|
|
577
572
|
metricsError
|
|
578
573
|
),
|
|
579
|
-
|
|
574
|
+
React.createElement(
|
|
580
575
|
"button",
|
|
581
576
|
{
|
|
582
577
|
style: { ...S.copyBtn, borderTop: "none", color: "#34d399", fontWeight: "600" },
|
|
@@ -585,23 +580,28 @@ function AnalyzerPanel() {
|
|
|
585
580
|
},
|
|
586
581
|
metricsFetching ? "Connecting..." : "\u21BB Retry"
|
|
587
582
|
)
|
|
588
|
-
) :
|
|
583
|
+
) : React.createElement(
|
|
589
584
|
"div",
|
|
590
585
|
null,
|
|
591
|
-
|
|
586
|
+
React.createElement(
|
|
592
587
|
"div",
|
|
593
588
|
{
|
|
594
|
-
style: {
|
|
589
|
+
style: {
|
|
590
|
+
color: "#71717a",
|
|
591
|
+
fontSize: "11px",
|
|
592
|
+
lineHeight: 1.6,
|
|
593
|
+
marginBottom: "6px"
|
|
594
|
+
}
|
|
595
595
|
},
|
|
596
596
|
"Rust analyzer hanya tersedia via CLI atau dashboard.",
|
|
597
|
-
|
|
598
|
-
|
|
597
|
+
React.createElement("br", null),
|
|
598
|
+
React.createElement(
|
|
599
599
|
"code",
|
|
600
600
|
{ style: { color: "#52525b", fontSize: "10px" } },
|
|
601
601
|
"tw analyze . | tw dashboard"
|
|
602
602
|
)
|
|
603
603
|
),
|
|
604
|
-
|
|
604
|
+
React.createElement(
|
|
605
605
|
"button",
|
|
606
606
|
{
|
|
607
607
|
style: { ...S.copyBtn, borderTop: "none", color: "#34d399", fontWeight: "600" },
|
|
@@ -613,46 +613,46 @@ function AnalyzerPanel() {
|
|
|
613
613
|
)
|
|
614
614
|
),
|
|
615
615
|
// ── DOM Scan Results ──────────────────────────────────────────────────
|
|
616
|
-
results &&
|
|
616
|
+
results && React.createElement(
|
|
617
617
|
"div",
|
|
618
618
|
null,
|
|
619
|
-
|
|
619
|
+
React.createElement(
|
|
620
620
|
"div",
|
|
621
621
|
{ style: S.section },
|
|
622
|
-
|
|
623
|
-
|
|
622
|
+
React.createElement("div", { style: S.sectionTitle }, "Summary"),
|
|
623
|
+
React.createElement(
|
|
624
624
|
"div",
|
|
625
625
|
{ style: S.row },
|
|
626
|
-
|
|
627
|
-
|
|
626
|
+
React.createElement("span", { style: S.varKey }, "State components"),
|
|
627
|
+
React.createElement("span", { style: S.varValue }, String(results.stateCount))
|
|
628
628
|
),
|
|
629
|
-
|
|
629
|
+
React.createElement(
|
|
630
630
|
"div",
|
|
631
631
|
{ style: S.row },
|
|
632
|
-
|
|
633
|
-
|
|
632
|
+
React.createElement("span", { style: S.varKey }, "Container components"),
|
|
633
|
+
React.createElement("span", { style: S.varValue }, String(results.containerCount))
|
|
634
634
|
),
|
|
635
|
-
|
|
635
|
+
React.createElement(
|
|
636
636
|
"div",
|
|
637
637
|
{ style: S.row },
|
|
638
|
-
|
|
639
|
-
|
|
638
|
+
React.createElement("span", { style: S.varKey }, "Live tokens"),
|
|
639
|
+
React.createElement("span", { style: S.varValue }, String(results.tokenCount))
|
|
640
640
|
)
|
|
641
641
|
),
|
|
642
|
-
results.duplicates.length > 0 ?
|
|
642
|
+
results.duplicates.length > 0 ? React.createElement(
|
|
643
643
|
"div",
|
|
644
644
|
{ style: S.section },
|
|
645
|
-
|
|
645
|
+
React.createElement("div", { style: S.sectionTitle }, "Duplicate Class Sets"),
|
|
646
646
|
results.duplicates.map(
|
|
647
|
-
(d, i) =>
|
|
647
|
+
(d, i) => React.createElement(
|
|
648
648
|
"div",
|
|
649
649
|
{ key: i, style: { marginBottom: "8px" } },
|
|
650
|
-
|
|
650
|
+
React.createElement(
|
|
651
651
|
"div",
|
|
652
652
|
{ style: { color: "#f59e0b", fontSize: "11px", marginBottom: "2px" } },
|
|
653
653
|
d.names.join(", ")
|
|
654
654
|
),
|
|
655
|
-
|
|
655
|
+
React.createElement(
|
|
656
656
|
"code",
|
|
657
657
|
{
|
|
658
658
|
style: {
|
|
@@ -665,10 +665,10 @@ function AnalyzerPanel() {
|
|
|
665
665
|
)
|
|
666
666
|
)
|
|
667
667
|
)
|
|
668
|
-
) :
|
|
668
|
+
) : React.createElement(
|
|
669
669
|
"div",
|
|
670
670
|
{ style: S.section },
|
|
671
|
-
|
|
671
|
+
React.createElement(
|
|
672
672
|
"span",
|
|
673
673
|
{ style: { color: "#34d399", fontSize: "12px" } },
|
|
674
674
|
"\u2713 No duplicate class sets in current DOM"
|
|
@@ -680,16 +680,16 @@ function AnalyzerPanel() {
|
|
|
680
680
|
}
|
|
681
681
|
function TwDevTools() {
|
|
682
682
|
if (process.env.NODE_ENV === "production") return null;
|
|
683
|
-
const [state, setState] =
|
|
683
|
+
const [state, setState] = useState({
|
|
684
684
|
open: false,
|
|
685
685
|
panel: "inspector",
|
|
686
686
|
pinned: false,
|
|
687
687
|
inspected: null,
|
|
688
688
|
position: { x: 0, y: 0 }
|
|
689
689
|
});
|
|
690
|
-
const overlayRef =
|
|
690
|
+
const overlayRef = useRef(null);
|
|
691
691
|
const isInspecting = state.open && state.panel === "inspector";
|
|
692
|
-
|
|
692
|
+
useEffect(() => {
|
|
693
693
|
const onKey = (e) => {
|
|
694
694
|
if (e.ctrlKey && e.shiftKey && e.key === "D") {
|
|
695
695
|
e.preventDefault();
|
|
@@ -706,7 +706,7 @@ function TwDevTools() {
|
|
|
706
706
|
window.addEventListener("keydown", onKey);
|
|
707
707
|
return () => window.removeEventListener("keydown", onKey);
|
|
708
708
|
}, []);
|
|
709
|
-
const onMouseMove =
|
|
709
|
+
const onMouseMove = useCallback(
|
|
710
710
|
(e) => {
|
|
711
711
|
if (!isInspecting || state.pinned) return;
|
|
712
712
|
const twEl = findNearestTwElement(e.target);
|
|
@@ -734,7 +734,7 @@ function TwDevTools() {
|
|
|
734
734
|
},
|
|
735
735
|
[isInspecting, state.pinned]
|
|
736
736
|
);
|
|
737
|
-
const onClick =
|
|
737
|
+
const onClick = useCallback(
|
|
738
738
|
(e) => {
|
|
739
739
|
if (!isInspecting) return;
|
|
740
740
|
if (overlayRef.current?.contains(e.target)) return;
|
|
@@ -742,7 +742,7 @@ function TwDevTools() {
|
|
|
742
742
|
},
|
|
743
743
|
[isInspecting]
|
|
744
744
|
);
|
|
745
|
-
|
|
745
|
+
useEffect(() => {
|
|
746
746
|
if (!isInspecting) return;
|
|
747
747
|
window.addEventListener("mousemove", onMouseMove);
|
|
748
748
|
window.addEventListener("click", onClick);
|
|
@@ -752,7 +752,7 @@ function TwDevTools() {
|
|
|
752
752
|
};
|
|
753
753
|
}, [isInspecting, onMouseMove, onClick]);
|
|
754
754
|
if (!state.open) {
|
|
755
|
-
return
|
|
755
|
+
return React.createElement(
|
|
756
756
|
"button",
|
|
757
757
|
{
|
|
758
758
|
onClick: () => setState((s) => ({ ...s, open: true })),
|
|
@@ -769,11 +769,11 @@ function TwDevTools() {
|
|
|
769
769
|
{ id: "tokens", label: "Tokens", icon: "\u{1F3A8}" },
|
|
770
770
|
{ id: "analyzer", label: "Analyzer", icon: "\u{1F4CA}" }
|
|
771
771
|
];
|
|
772
|
-
return
|
|
772
|
+
return React.createElement(
|
|
773
773
|
"div",
|
|
774
774
|
{ style: S.root },
|
|
775
775
|
// ── Element highlight (inspector only) ──────────────────────────────
|
|
776
|
-
isInspecting && state.inspected &&
|
|
776
|
+
isInspecting && state.inspected && React.createElement("div", {
|
|
777
777
|
style: {
|
|
778
778
|
...S.highlight,
|
|
779
779
|
top: state.inspected.rect.top + window.scrollY,
|
|
@@ -783,7 +783,7 @@ function TwDevTools() {
|
|
|
783
783
|
}
|
|
784
784
|
}),
|
|
785
785
|
// ── Component name label ────────────────────────────────────────────
|
|
786
|
-
isInspecting && state.inspected &&
|
|
786
|
+
isInspecting && state.inspected && React.createElement(
|
|
787
787
|
"div",
|
|
788
788
|
{
|
|
789
789
|
style: {
|
|
@@ -803,7 +803,7 @@ function TwDevTools() {
|
|
|
803
803
|
state.inspected.componentName
|
|
804
804
|
),
|
|
805
805
|
// ── Main DevTools panel ─────────────────────────────────────────────
|
|
806
|
-
|
|
806
|
+
React.createElement(
|
|
807
807
|
"div",
|
|
808
808
|
{
|
|
809
809
|
ref: overlayRef,
|
|
@@ -820,19 +820,19 @@ function TwDevTools() {
|
|
|
820
820
|
}
|
|
821
821
|
},
|
|
822
822
|
// Header
|
|
823
|
-
|
|
823
|
+
React.createElement(
|
|
824
824
|
"div",
|
|
825
825
|
{ style: S.header },
|
|
826
|
-
|
|
826
|
+
React.createElement(
|
|
827
827
|
"span",
|
|
828
828
|
{ style: S.componentName },
|
|
829
829
|
state.inspected && state.panel === "inspector" ? state.inspected.componentName : "tailwind-styled-v4"
|
|
830
830
|
),
|
|
831
|
-
|
|
831
|
+
React.createElement(
|
|
832
832
|
"div",
|
|
833
833
|
{ style: S.headerActions },
|
|
834
|
-
state.pinned &&
|
|
835
|
-
|
|
834
|
+
state.pinned && React.createElement("span", { style: S.pinBadge }, "\u{1F4CC}"),
|
|
835
|
+
React.createElement(
|
|
836
836
|
"button",
|
|
837
837
|
{
|
|
838
838
|
style: S.closeBtn,
|
|
@@ -843,11 +843,11 @@ function TwDevTools() {
|
|
|
843
843
|
)
|
|
844
844
|
),
|
|
845
845
|
// Tab bar
|
|
846
|
-
|
|
846
|
+
React.createElement(
|
|
847
847
|
"div",
|
|
848
848
|
{ style: S.tabBar },
|
|
849
849
|
PANELS.map(
|
|
850
|
-
(p) =>
|
|
850
|
+
(p) => React.createElement(
|
|
851
851
|
"button",
|
|
852
852
|
{
|
|
853
853
|
key: p.id,
|
|
@@ -865,22 +865,22 @@ function TwDevTools() {
|
|
|
865
865
|
)
|
|
866
866
|
),
|
|
867
867
|
// Panel content
|
|
868
|
-
state.panel === "inspector" &&
|
|
868
|
+
state.panel === "inspector" && React.createElement(InspectorPanel, {
|
|
869
869
|
inspected: state.inspected,
|
|
870
870
|
position: state.position,
|
|
871
871
|
pinned: state.pinned
|
|
872
872
|
}),
|
|
873
|
-
state.panel === "state" &&
|
|
874
|
-
state.panel === "container" &&
|
|
875
|
-
state.panel === "tokens" &&
|
|
876
|
-
state.panel === "analyzer" &&
|
|
873
|
+
state.panel === "state" && React.createElement(StatePanel, null),
|
|
874
|
+
state.panel === "container" && React.createElement(ContainerPanel, null),
|
|
875
|
+
state.panel === "tokens" && React.createElement(TokensPanel, null),
|
|
876
|
+
state.panel === "analyzer" && React.createElement(AnalyzerPanel, null)
|
|
877
877
|
),
|
|
878
878
|
// ── Status bar ──────────────────────────────────────────────────────
|
|
879
|
-
|
|
879
|
+
React.createElement(
|
|
880
880
|
"div",
|
|
881
881
|
{ style: S.statusBar },
|
|
882
|
-
|
|
883
|
-
|
|
882
|
+
React.createElement("span", null, "\u{1F3A8} tailwind-styled-v4 DevTools"),
|
|
883
|
+
React.createElement(
|
|
884
884
|
"span",
|
|
885
885
|
{ style: { opacity: 0.6, fontSize: "10px" } },
|
|
886
886
|
state.pinned ? "Click to unpin" : isInspecting ? "Hover to inspect \xB7 Click to pin \xB7 1-5 switch panel \xB7 Esc close" : "Ctrl+Shift+D close \xB7 1-5 switch panel"
|
|
@@ -1062,10 +1062,9 @@ var S = {
|
|
|
1062
1062
|
};
|
|
1063
1063
|
function DevToolsProvider() {
|
|
1064
1064
|
if (process.env.NODE_ENV === "production") return null;
|
|
1065
|
-
return
|
|
1065
|
+
return React.createElement(TwDevTools);
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
//# sourceMappingURL=devtools.
|
|
1071
|
-
//# sourceMappingURL=devtools.cjs.map
|
|
1068
|
+
export { DevToolsProvider, TwDevTools };
|
|
1069
|
+
//# sourceMappingURL=devtools.mjs.map
|
|
1070
|
+
//# sourceMappingURL=devtools.mjs.map
|