tailwind-styled-v4 4.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1555 -0
- package/dist/analyzer.js.map +1 -0
- package/dist/analyzer.mjs +1544 -0
- package/dist/analyzer.mjs.map +1 -0
- package/dist/animate.d.mts +46 -0
- package/dist/animate.d.ts +41 -112
- package/dist/animate.js +792 -235
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +782 -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 +6063 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.mjs +6053 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/{compiler.d.cts → compiler.d.mts} +503 -210
- package/dist/compiler.d.ts +503 -210
- package/dist/compiler.js +1549 -566
- package/dist/compiler.js.map +1 -1
- package/dist/{compiler.cjs → compiler.mjs} +1476 -627
- 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 +336 -211
- package/dist/devtools.js.map +1 -1
- package/dist/{devtools.cjs → devtools.mjs} +331 -220
- package/dist/devtools.mjs.map +1 -0
- package/dist/engine.d.mts +84 -0
- package/dist/engine.d.ts +84 -0
- package/dist/engine.js +3014 -0
- package/dist/engine.js.map +1 -0
- package/dist/engine.mjs +3005 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/{index.d.cts → index.d.mts} +75 -4
- package/dist/index.d.ts +75 -4
- package/dist/index.js +1341 -149
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2162 -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.mts +55 -0
- package/dist/next.d.ts +30 -20
- package/dist/next.js +6947 -149
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +7050 -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.d.cts → preset.d.mts} +29 -2
- package/dist/preset.d.ts +29 -2
- package/dist/preset.js +318 -21
- package/dist/preset.js.map +1 -1
- package/dist/preset.mjs +414 -0
- 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 +55 -0
- package/dist/rspack.js.map +1 -0
- package/dist/rspack.mjs +45 -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 +207 -0
- package/dist/runtime.js.map +1 -0
- package/dist/runtime.mjs +188 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/runtimeCss.d.mts +65 -0
- package/dist/runtimeCss.d.ts +65 -0
- package/dist/runtimeCss.js +188 -0
- package/dist/runtimeCss.js.map +1 -0
- package/dist/runtimeCss.mjs +173 -0
- 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 +717 -0
- package/dist/scanner.js.map +1 -0
- package/dist/scanner.mjs +703 -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.cts → theme.d.mts} +18 -11
- package/dist/theme.d.ts +18 -11
- package/dist/theme.js +205 -19
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +311 -0
- package/dist/theme.mjs.map +1 -0
- package/dist/types-DXr2PmGP.d.mts +31 -0
- package/dist/types-DXr2PmGP.d.ts +31 -0
- package/dist/vite.d.mts +51 -0
- package/dist/vite.d.ts +35 -6
- package/dist/vite.js +4254 -57
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +4281 -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 +173 -67
- package/dist/animate.cjs +0 -252
- package/dist/animate.cjs.map +0 -1
- package/dist/animate.d.cts +0 -117
- package/dist/astTransform-ua-eapqs.d.cts +0 -41
- package/dist/astTransform-ua-eapqs.d.ts +0 -41
- package/dist/compiler.cjs.map +0 -1
- package/dist/css.cjs +0 -71
- package/dist/css.cjs.map +0 -1
- package/dist/css.d.cts +0 -45
- package/dist/css.d.ts +0 -45
- package/dist/css.js +0 -62
- package/dist/css.js.map +0 -1
- package/dist/devtools.cjs.map +0 -1
- package/dist/index.cjs +0 -1058
- package/dist/index.cjs.map +0 -1
- package/dist/next.cjs +0 -268
- package/dist/next.cjs.map +0 -1
- package/dist/next.d.cts +0 -45
- package/dist/plugins.cjs +0 -396
- package/dist/plugins.cjs.map +0 -1
- package/dist/plugins.d.cts +0 -231
- package/dist/plugins.d.ts +0 -231
- package/dist/plugins.js +0 -381
- package/dist/plugins.js.map +0 -1
- package/dist/preset.cjs +0 -129
- package/dist/preset.cjs.map +0 -1
- package/dist/theme.cjs +0 -154
- package/dist/theme.cjs.map +0 -1
- package/dist/turbopackLoader.cjs +0 -2689
- package/dist/turbopackLoader.cjs.map +0 -1
- package/dist/turbopackLoader.d.cts +0 -22
- package/dist/turbopackLoader.d.ts +0 -22
- package/dist/turbopackLoader.js +0 -2681
- package/dist/turbopackLoader.js.map +0 -1
- package/dist/vite.cjs +0 -105
- package/dist/vite.cjs.map +0 -1
- package/dist/vite.d.cts +0 -22
- package/dist/webpackLoader.cjs +0 -2670
- package/dist/webpackLoader.cjs.map +0 -1
- package/dist/webpackLoader.d.cts +0 -24
- package/dist/webpackLoader.d.ts +0 -24
- package/dist/webpackLoader.js +0 -2662
- package/dist/webpackLoader.js.map +0 -1
- /package/dist/{devtools.d.cts → devtools.d.mts} +0 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { spawnSync } from 'child_process';
|
|
2
|
+
import { createHash } from 'crypto';
|
|
3
|
+
import { existsSync, readFileSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
|
|
6
|
+
/* tailwind-styled-v4 v5.0.1 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// packages/plugin-registry/registry.json
|
|
13
|
+
var require_registry = __commonJS({
|
|
14
|
+
"packages/plugin-registry/registry.json"(exports$1, module) {
|
|
15
|
+
module.exports = {
|
|
16
|
+
version: "5.0.0",
|
|
17
|
+
updatedAt: "2026-03-23",
|
|
18
|
+
official: [
|
|
19
|
+
{
|
|
20
|
+
name: "@tailwind-styled/plugin-animation",
|
|
21
|
+
description: "Animation presets and keyframes \u2014 enter/exit transitions, spring physics, scroll-triggered",
|
|
22
|
+
version: "5.0.0",
|
|
23
|
+
tags: ["animation", "motion", "transition", "keyframes"],
|
|
24
|
+
docs: "https://github.com/tailwind-styled/tailwind-styled-v5/tree/main/packages/animate",
|
|
25
|
+
install: "npm install @tailwind-styled/plugin-animation@5.0.0",
|
|
26
|
+
integrity: "sha256-abc123"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "@tailwind-styled/plugin-typography",
|
|
30
|
+
description: "Prose and typography utilities \u2014 headings, body, code blocks, with dark mode",
|
|
31
|
+
version: "5.0.0",
|
|
32
|
+
tags: ["typography", "prose", "markdown", "content"],
|
|
33
|
+
docs: "https://github.com/tailwind-styled/tailwind-styled-v5/tree/main/docs/plugins",
|
|
34
|
+
install: "npm install @tailwind-styled/plugin-typography@5.0.0",
|
|
35
|
+
integrity: "sha256-def456"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "@tailwind-styled/plugin-forms",
|
|
39
|
+
description: "Form input styling helpers \u2014 reset, validation states, custom checkboxes/radios",
|
|
40
|
+
version: "5.0.0",
|
|
41
|
+
tags: ["forms", "inputs", "validation", "checkbox", "radio"],
|
|
42
|
+
docs: "https://github.com/tailwind-styled/tailwind-styled-v5/tree/main/docs/plugins",
|
|
43
|
+
install: "npm install @tailwind-styled/plugin-forms@5.0.0",
|
|
44
|
+
integrity: "sha256-ghi789"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "@tailwind-styled/plugin-container-queries",
|
|
48
|
+
description: "Container query utilities \u2014 @container breakpoints for component-level responsiveness",
|
|
49
|
+
version: "5.0.0",
|
|
50
|
+
tags: ["container-queries", "responsive", "layout"],
|
|
51
|
+
docs: "https://github.com/tailwind-styled/tailwind-styled-v5/tree/main/docs/plugins",
|
|
52
|
+
install: "npm install @tailwind-styled/plugin-container-queries@5.0.0",
|
|
53
|
+
integrity: "sha256-jkl012"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
community: [
|
|
57
|
+
{
|
|
58
|
+
name: "tailwind-styled-animate",
|
|
59
|
+
description: "Community animation variants \u2014 bounce, pulse, wiggle, and more",
|
|
60
|
+
version: "0.1.0",
|
|
61
|
+
tags: ["animation", "community"],
|
|
62
|
+
author: "community",
|
|
63
|
+
install: "npm install tailwind-styled-animate"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "tailwind-styled-icons",
|
|
67
|
+
description: "SVG icon system integrated with tw() variant API",
|
|
68
|
+
version: "0.1.0",
|
|
69
|
+
tags: ["icons", "svg", "community"],
|
|
70
|
+
author: "community",
|
|
71
|
+
install: "npm install tailwind-styled-icons"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
var PLUGIN_NAME_REGEX = /^(@[a-z0-9-]+\/)?[a-z0-9-]+(@[0-9]+\.[0-9]+\.[0-9]+)?$/;
|
|
78
|
+
var PluginRegistryError = class extends Error {
|
|
79
|
+
constructor(payload) {
|
|
80
|
+
super(payload.message);
|
|
81
|
+
this.name = "PluginRegistryError";
|
|
82
|
+
this.code = payload.code;
|
|
83
|
+
this.context = payload.context;
|
|
84
|
+
}
|
|
85
|
+
toObject() {
|
|
86
|
+
return {
|
|
87
|
+
code: this.code,
|
|
88
|
+
message: this.message,
|
|
89
|
+
context: this.context
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var PluginRegistry = class _PluginRegistry {
|
|
94
|
+
constructor(registryData, options = {}) {
|
|
95
|
+
if (options.registryUrl) {
|
|
96
|
+
this.plugins = [];
|
|
97
|
+
this.registryVersion = "0.0.0";
|
|
98
|
+
} else {
|
|
99
|
+
const data = registryData;
|
|
100
|
+
const version = data?.version ?? "4.2.0";
|
|
101
|
+
const official = (data?.official ?? []).map((item) => ({
|
|
102
|
+
name: item.name,
|
|
103
|
+
description: item.description,
|
|
104
|
+
version: item.version,
|
|
105
|
+
tags: [...item.tags],
|
|
106
|
+
official: true,
|
|
107
|
+
docs: item.docs,
|
|
108
|
+
install: item.install,
|
|
109
|
+
integrity: item.integrity
|
|
110
|
+
}));
|
|
111
|
+
const community = (data?.community ?? []).map((item) => ({
|
|
112
|
+
name: item.name,
|
|
113
|
+
description: item.description,
|
|
114
|
+
version: item.version,
|
|
115
|
+
tags: [...item.tags],
|
|
116
|
+
official: false
|
|
117
|
+
}));
|
|
118
|
+
this.plugins = [...official, ...community];
|
|
119
|
+
this.registryVersion = version;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
static async loadFromUrl(url) {
|
|
123
|
+
try {
|
|
124
|
+
const response = await fetch(url);
|
|
125
|
+
if (!response.ok) {
|
|
126
|
+
throw new PluginRegistryError({
|
|
127
|
+
code: "NETWORK_ERROR",
|
|
128
|
+
message: `Failed to fetch registry: ${response.status} ${response.statusText}`,
|
|
129
|
+
context: { url, status: response.status }
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
const data = await response.json();
|
|
133
|
+
return new _PluginRegistry(data, { registryUrl: url });
|
|
134
|
+
} catch (error) {
|
|
135
|
+
if (error instanceof PluginRegistryError) throw error;
|
|
136
|
+
throw new PluginRegistryError({
|
|
137
|
+
code: "NETWORK_ERROR",
|
|
138
|
+
message: `Failed to load registry: ${error instanceof Error ? error.message : String(error)}`,
|
|
139
|
+
context: { url }
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
getVersion() {
|
|
144
|
+
return this.registryVersion;
|
|
145
|
+
}
|
|
146
|
+
search(query) {
|
|
147
|
+
const q = query.trim().toLowerCase();
|
|
148
|
+
if (!q) return [...this.plugins];
|
|
149
|
+
return this.plugins.filter((plugin) => {
|
|
150
|
+
return plugin.name.toLowerCase().includes(q) || plugin.description.toLowerCase().includes(q) || plugin.tags.some((tag) => tag.toLowerCase().includes(q));
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
getAll() {
|
|
154
|
+
return [...this.plugins];
|
|
155
|
+
}
|
|
156
|
+
getByName(pluginName) {
|
|
157
|
+
const nameWithoutVersion = pluginName.split("@").slice(0, 2).join("@");
|
|
158
|
+
return this.plugins.find((plugin) => plugin.name === nameWithoutVersion);
|
|
159
|
+
}
|
|
160
|
+
install(pluginName, options = {}) {
|
|
161
|
+
const npmBin = options.npmBin ?? process.env.TW_PLUGIN_NPM_BIN ?? "npm";
|
|
162
|
+
if (!PLUGIN_NAME_REGEX.test(pluginName)) {
|
|
163
|
+
throw new PluginRegistryError({
|
|
164
|
+
code: "INVALID_PLUGIN_NAME",
|
|
165
|
+
message: `Nama plugin tidak valid: '${pluginName}'.`,
|
|
166
|
+
context: {
|
|
167
|
+
pluginName,
|
|
168
|
+
expectedPattern: String(PLUGIN_NAME_REGEX)
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
const knownPlugin = this.getByName(pluginName);
|
|
173
|
+
const isExternal = !knownPlugin;
|
|
174
|
+
if (isExternal && !options.allowExternal) {
|
|
175
|
+
throw new PluginRegistryError({
|
|
176
|
+
code: "PLUGIN_NOT_FOUND",
|
|
177
|
+
message: `Plugin '${pluginName}' tidak ditemukan di registry. Coba cari dengan 'tw-plugin search <keyword>'.`,
|
|
178
|
+
context: {
|
|
179
|
+
pluginName,
|
|
180
|
+
allowExternal: false
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (isExternal && options.allowExternal && !options.confirmExternal) {
|
|
185
|
+
throw new PluginRegistryError({
|
|
186
|
+
code: "EXTERNAL_CONFIRMATION_REQUIRED",
|
|
187
|
+
message: `Plugin eksternal '${pluginName}' butuh konfirmasi. Jalankan ulang dengan --allow-external --yes.`,
|
|
188
|
+
context: {
|
|
189
|
+
pluginName,
|
|
190
|
+
allowExternal: true
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const command = `${npmBin} install ${pluginName}`;
|
|
195
|
+
if (options.dryRun) {
|
|
196
|
+
return { plugin: pluginName, installed: true, command, exitCode: 0 };
|
|
197
|
+
}
|
|
198
|
+
const child = spawnSync(npmBin, ["install", pluginName], { stdio: "inherit" });
|
|
199
|
+
if (child.error) {
|
|
200
|
+
throw new PluginRegistryError({
|
|
201
|
+
code: "INSTALL_COMMAND_FAILED",
|
|
202
|
+
message: `Gagal menjalankan perintah install: ${command}`,
|
|
203
|
+
context: {
|
|
204
|
+
pluginName,
|
|
205
|
+
command,
|
|
206
|
+
reason: child.error.message
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
if (child.status !== 0) {
|
|
211
|
+
throw new PluginRegistryError({
|
|
212
|
+
code: "INSTALL_FAILED",
|
|
213
|
+
message: `Install gagal (${child.status ?? 1}): ${command}`,
|
|
214
|
+
context: {
|
|
215
|
+
pluginName,
|
|
216
|
+
command,
|
|
217
|
+
exitCode: child.status ?? 1
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
plugin: pluginName,
|
|
223
|
+
installed: true,
|
|
224
|
+
command,
|
|
225
|
+
exitCode: 0
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
uninstall(pluginName, options = {}) {
|
|
229
|
+
const npmBin = options.npmBin ?? process.env.TW_PLUGIN_NPM_BIN ?? "npm";
|
|
230
|
+
const command = `${npmBin} uninstall ${pluginName}`;
|
|
231
|
+
if (options.dryRun) {
|
|
232
|
+
return { plugin: pluginName, uninstalled: true, command, exitCode: 0 };
|
|
233
|
+
}
|
|
234
|
+
const child = spawnSync(npmBin, ["uninstall", pluginName], { stdio: "inherit" });
|
|
235
|
+
if (child.status !== 0 && child.status !== null) {
|
|
236
|
+
throw new PluginRegistryError({
|
|
237
|
+
code: "INSTALL_FAILED",
|
|
238
|
+
message: `Uninstall gagal (${child.status}): ${command}`,
|
|
239
|
+
context: { pluginName, command, exitCode: child.status }
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
plugin: pluginName,
|
|
244
|
+
uninstalled: true,
|
|
245
|
+
command,
|
|
246
|
+
exitCode: child.status ?? 0
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
verifyIntegrity(pluginName) {
|
|
250
|
+
const plugin = this.getByName(pluginName);
|
|
251
|
+
if (!plugin) return { ok: false, reason: `Plugin '${pluginName}' not in registry` };
|
|
252
|
+
if (!plugin.integrity) {
|
|
253
|
+
return { ok: true, reason: "no checksum registered (skip)" };
|
|
254
|
+
}
|
|
255
|
+
try {
|
|
256
|
+
const pkgPath = join(process.cwd(), "node_modules", pluginName, "package.json");
|
|
257
|
+
if (!existsSync(pkgPath)) return { ok: false, reason: "plugin not installed" };
|
|
258
|
+
const content = readFileSync(pkgPath, "utf8");
|
|
259
|
+
const hash = "sha256-" + createHash("sha256").update(content).digest("base64");
|
|
260
|
+
return hash === plugin.integrity ? { ok: true } : { ok: false, reason: `Integrity mismatch: expected ${plugin.integrity}` };
|
|
261
|
+
} catch (e) {
|
|
262
|
+
return { ok: false, reason: `Integrity check failed: ${e.message}` };
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
checkForUpdate(pluginName) {
|
|
266
|
+
const plugin = this.getByName(pluginName);
|
|
267
|
+
if (!plugin) return { hasUpdate: false, error: `Plugin '${pluginName}' not in registry` };
|
|
268
|
+
try {
|
|
269
|
+
const pkgPath = join(process.cwd(), "node_modules", pluginName, "package.json");
|
|
270
|
+
if (!existsSync(pkgPath)) return { hasUpdate: false, error: "plugin not installed" };
|
|
271
|
+
const current = JSON.parse(readFileSync(pkgPath, "utf8")).version ?? "0.0.0";
|
|
272
|
+
const latest = plugin.version;
|
|
273
|
+
const parseV = (v) => v.replace(/[^0-9.]/g, "").split(".").map(Number);
|
|
274
|
+
const [ca, cb, cc] = parseV(current);
|
|
275
|
+
const [la, lb, lc] = parseV(latest);
|
|
276
|
+
const hasUpdate = la > ca || la === ca && lb > cb || la === ca && lb === cb && lc > cc;
|
|
277
|
+
return { hasUpdate, current, latest };
|
|
278
|
+
} catch (e) {
|
|
279
|
+
return { hasUpdate: false, error: `Update check failed: ${e.message}` };
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
checkAllUpdates() {
|
|
283
|
+
return this.plugins.map((p) => ({ name: p.name, ...this.checkForUpdate(p.name) }));
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
var defaultRegistry = null;
|
|
287
|
+
function getRegistry() {
|
|
288
|
+
if (!defaultRegistry) {
|
|
289
|
+
const registryData = require_registry();
|
|
290
|
+
defaultRegistry = new PluginRegistry(registryData);
|
|
291
|
+
}
|
|
292
|
+
return defaultRegistry;
|
|
293
|
+
}
|
|
294
|
+
var registry = getRegistry();
|
|
295
|
+
|
|
296
|
+
export { PluginRegistry, PluginRegistryError, getRegistry, registry };
|
|
297
|
+
//# sourceMappingURL=pluginRegistry.mjs.map
|
|
298
|
+
//# sourceMappingURL=pluginRegistry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../packages/plugin-registry/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A,EAAwB,CAAA,CAAE,OAAO,CAAA,CAAA,EAAG;AAAA,IACxE;AAAA,EACF;AAAA,EAEA,eAAA,GAMG;AACD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,GAAA,CAAI,CAAC,OAAO,EAAE,IAAA,EAAM,CAAA,CAAE,IAAA,EAAM,GAAG,IAAA,CAAK,cAAA,CAAe,CAAA,CAAE,IAAI,GAAE,CAAE,CAAA;AAAA,EACnF;AACF;AAEA,IAAI,eAAA,GAAyC,IAAA;AAEtC,SAAS,WAAA,GAA8B;AAC5C,EAAA,IAAI,CAAC,eAAA,EAAiB;AACpB,IAAA,MAAM,YAAA,GAAe,gBAAA,EAAA;AACrB,IAAA,eAAA,GAAkB,IAAI,eAAe,YAAY,CAAA;AAAA,EACnD;AACA,EAAA,OAAO,eAAA;AACT;AAEO,IAAM,WAAW,WAAA","file":"pluginRegistry.mjs","sourcesContent":["{\n \"version\": \"5.0.0\",\n \"updatedAt\": \"2026-03-23\",\n \"official\": [\n {\n \"name\": \"@tailwind-styled/plugin-animation\",\n \"description\": \"Animation presets and keyframes — enter/exit transitions, spring physics, scroll-triggered\",\n \"version\": \"5.0.0\",\n \"tags\": [\"animation\", \"motion\", \"transition\", \"keyframes\"],\n \"docs\": \"https://github.com/tailwind-styled/tailwind-styled-v5/tree/main/packages/animate\",\n \"install\": \"npm install @tailwind-styled/plugin-animation@5.0.0\",\n \"integrity\": \"sha256-abc123\"\n },\n {\n \"name\": \"@tailwind-styled/plugin-typography\",\n \"description\": \"Prose and typography utilities — headings, body, code blocks, with dark mode\",\n \"version\": \"5.0.0\",\n \"tags\": [\"typography\", \"prose\", \"markdown\", \"content\"],\n \"docs\": \"https://github.com/tailwind-styled/tailwind-styled-v5/tree/main/docs/plugins\",\n \"install\": \"npm install @tailwind-styled/plugin-typography@5.0.0\",\n \"integrity\": \"sha256-def456\"\n },\n {\n \"name\": \"@tailwind-styled/plugin-forms\",\n \"description\": \"Form input styling helpers — reset, validation states, custom checkboxes/radios\",\n \"version\": \"5.0.0\",\n \"tags\": [\"forms\", \"inputs\", \"validation\", \"checkbox\", \"radio\"],\n \"docs\": \"https://github.com/tailwind-styled/tailwind-styled-v5/tree/main/docs/plugins\",\n \"install\": \"npm install @tailwind-styled/plugin-forms@5.0.0\",\n \"integrity\": \"sha256-ghi789\"\n },\n {\n \"name\": \"@tailwind-styled/plugin-container-queries\",\n \"description\": \"Container query utilities — @container breakpoints for component-level responsiveness\",\n \"version\": \"5.0.0\",\n \"tags\": [\"container-queries\", \"responsive\", \"layout\"],\n \"docs\": \"https://github.com/tailwind-styled/tailwind-styled-v5/tree/main/docs/plugins\",\n \"install\": \"npm install @tailwind-styled/plugin-container-queries@5.0.0\",\n \"integrity\": \"sha256-jkl012\"\n }\n ],\n \"community\": [\n {\n \"name\": \"tailwind-styled-animate\",\n \"description\": \"Community animation variants — bounce, pulse, wiggle, and more\",\n \"version\": \"0.1.0\",\n \"tags\": [\"animation\", \"community\"],\n \"author\": \"community\",\n \"install\": \"npm install tailwind-styled-animate\"\n },\n {\n \"name\": \"tailwind-styled-icons\",\n \"description\": \"SVG icon system integrated with tw() variant API\",\n \"version\": \"0.1.0\",\n \"tags\": [\"icons\", \"svg\", \"community\"],\n \"author\": \"community\",\n \"install\": \"npm install tailwind-styled-icons\"\n }\n ]\n}\n","import { spawnSync } from \"node:child_process\"\nimport { createHash } from \"node:crypto\"\nimport { existsSync, readFileSync } from \"node:fs\"\nimport { join } from \"node:path\"\n\nconst PLUGIN_NAME_REGEX = /^(@[a-z0-9-]+\\/)?[a-z0-9-]+(@[0-9]+\\.[0-9]+\\.[0-9]+)?$/\n\nexport interface PluginInfo {\n name: string\n description: string\n version: string\n tags: string[]\n official?: boolean\n docs?: string\n install?: string\n integrity?: string\n}\n\ninterface RegistryData {\n version: string\n official: PluginInfo[]\n community: PluginInfo[]\n}\n\nexport interface InstallResult {\n plugin: string\n installed: boolean\n command: string\n exitCode: number\n}\n\nexport type PluginRegistryErrorCode =\n | \"INVALID_PLUGIN_NAME\"\n | \"PLUGIN_NOT_FOUND\"\n | \"EXTERNAL_CONFIRMATION_REQUIRED\"\n | \"INSTALL_COMMAND_FAILED\"\n | \"INSTALL_FAILED\"\n | \"NETWORK_ERROR\"\n | \"REGISTRY_LOAD_FAILED\"\n\nexport interface PluginRegistryErrorPayload {\n code: PluginRegistryErrorCode\n message: string\n context?: Record<string, unknown>\n}\n\nexport class PluginRegistryError extends Error {\n readonly code: PluginRegistryErrorCode\n readonly context?: Record<string, unknown>\n\n constructor(payload: PluginRegistryErrorPayload) {\n super(payload.message)\n this.name = \"PluginRegistryError\"\n this.code = payload.code\n this.context = payload.context\n }\n\n toObject(): PluginRegistryErrorPayload {\n return {\n code: this.code,\n message: this.message,\n context: this.context,\n }\n }\n}\n\nexport interface InstallOptions {\n dryRun?: boolean\n npmBin?: string\n allowExternal?: boolean\n confirmExternal?: boolean\n}\n\nexport interface RegistryOptions {\n registryUrl?: string\n}\n\nexport class PluginRegistry {\n private readonly plugins: PluginInfo[]\n private readonly registryVersion: string\n\n constructor(registryData?: RegistryData, options: RegistryOptions = {}) {\n if (options.registryUrl) {\n this.plugins = []\n this.registryVersion = \"0.0.0\"\n } else {\n const data = registryData\n const version = data?.version ?? \"4.2.0\"\n const official = (data?.official ?? []).map((item) => ({\n name: item.name,\n description: item.description,\n version: item.version,\n tags: [...item.tags],\n official: true,\n docs: item.docs,\n install: item.install,\n integrity: item.integrity,\n }))\n const community = (data?.community ?? []).map((item) => ({\n name: item.name,\n description: item.description,\n version: item.version,\n tags: [...item.tags],\n official: false,\n }))\n this.plugins = [...official, ...community]\n this.registryVersion = version\n }\n }\n\n static async loadFromUrl(url: string): Promise<PluginRegistry> {\n try {\n const response = await fetch(url)\n if (!response.ok) {\n throw new PluginRegistryError({\n code: \"NETWORK_ERROR\",\n message: `Failed to fetch registry: ${response.status} ${response.statusText}`,\n context: { url, status: response.status },\n })\n }\n const data = (await response.json()) as RegistryData\n return new PluginRegistry(data, { registryUrl: url })\n } catch (error) {\n if (error instanceof PluginRegistryError) throw error\n throw new PluginRegistryError({\n code: \"NETWORK_ERROR\",\n message: `Failed to load registry: ${error instanceof Error ? error.message : String(error)}`,\n context: { url },\n })\n }\n }\n\n getVersion(): string {\n return this.registryVersion\n }\n\n search(query: string): PluginInfo[] {\n const q = query.trim().toLowerCase()\n if (!q) return [...this.plugins]\n\n return this.plugins.filter((plugin) => {\n return (\n plugin.name.toLowerCase().includes(q) ||\n plugin.description.toLowerCase().includes(q) ||\n plugin.tags.some((tag) => tag.toLowerCase().includes(q))\n )\n })\n }\n\n getAll(): PluginInfo[] {\n return [...this.plugins]\n }\n\n getByName(pluginName: string): PluginInfo | undefined {\n const nameWithoutVersion = pluginName.split(\"@\").slice(0, 2).join(\"@\")\n return this.plugins.find((plugin) => plugin.name === nameWithoutVersion)\n }\n\n install(pluginName: string, options: InstallOptions = {}): InstallResult {\n const npmBin = options.npmBin ?? process.env.TW_PLUGIN_NPM_BIN ?? \"npm\"\n\n if (!PLUGIN_NAME_REGEX.test(pluginName)) {\n throw new PluginRegistryError({\n code: \"INVALID_PLUGIN_NAME\",\n message: `Nama plugin tidak valid: '${pluginName}'.`,\n context: {\n pluginName,\n expectedPattern: String(PLUGIN_NAME_REGEX),\n },\n })\n }\n\n const knownPlugin = this.getByName(pluginName)\n const isExternal = !knownPlugin\n\n if (isExternal && !options.allowExternal) {\n throw new PluginRegistryError({\n code: \"PLUGIN_NOT_FOUND\",\n message: `Plugin '${pluginName}' tidak ditemukan di registry. Coba cari dengan 'tw-plugin search <keyword>'.`,\n context: {\n pluginName,\n allowExternal: false,\n },\n })\n }\n\n if (isExternal && options.allowExternal && !options.confirmExternal) {\n throw new PluginRegistryError({\n code: \"EXTERNAL_CONFIRMATION_REQUIRED\",\n message: `Plugin eksternal '${pluginName}' butuh konfirmasi. Jalankan ulang dengan --allow-external --yes.`,\n context: {\n pluginName,\n allowExternal: true,\n },\n })\n }\n\n const command = `${npmBin} install ${pluginName}`\n if (options.dryRun) {\n return { plugin: pluginName, installed: true, command, exitCode: 0 }\n }\n\n const child = spawnSync(npmBin, [\"install\", pluginName], { stdio: \"inherit\" })\n if (child.error) {\n throw new PluginRegistryError({\n code: \"INSTALL_COMMAND_FAILED\",\n message: `Gagal menjalankan perintah install: ${command}`,\n context: {\n pluginName,\n command,\n reason: child.error.message,\n },\n })\n }\n\n if (child.status !== 0) {\n throw new PluginRegistryError({\n code: \"INSTALL_FAILED\",\n message: `Install gagal (${child.status ?? 1}): ${command}`,\n context: {\n pluginName,\n command,\n exitCode: child.status ?? 1,\n },\n })\n }\n\n return {\n plugin: pluginName,\n installed: true,\n command,\n exitCode: 0,\n }\n }\n\n uninstall(\n pluginName: string,\n options: { dryRun?: boolean; npmBin?: string } = {}\n ): {\n plugin: string\n uninstalled: boolean\n command: string\n exitCode: number\n } {\n const npmBin = options.npmBin ?? process.env.TW_PLUGIN_NPM_BIN ?? \"npm\"\n const command = `${npmBin} uninstall ${pluginName}`\n\n if (options.dryRun) {\n return { plugin: pluginName, uninstalled: true, command, exitCode: 0 }\n }\n\n const child = spawnSync(npmBin, [\"uninstall\", pluginName], { stdio: \"inherit\" })\n if (child.status !== 0 && child.status !== null) {\n throw new PluginRegistryError({\n code: \"INSTALL_FAILED\",\n message: `Uninstall gagal (${child.status}): ${command}`,\n context: { pluginName, command, exitCode: child.status },\n })\n }\n\n return {\n plugin: pluginName,\n uninstalled: true,\n command,\n exitCode: child.status ?? 0,\n }\n }\n\n verifyIntegrity(pluginName: string): { ok: boolean; reason?: string } {\n const plugin = this.getByName(pluginName)\n if (!plugin) return { ok: false, reason: `Plugin '${pluginName}' not in registry` }\n if (!plugin.integrity) {\n return { ok: true, reason: \"no checksum registered (skip)\" }\n }\n try {\n const pkgPath = join(process.cwd(), \"node_modules\", pluginName, \"package.json\")\n if (!existsSync(pkgPath)) return { ok: false, reason: \"plugin not installed\" }\n const content = readFileSync(pkgPath, \"utf8\")\n const hash = \"sha256-\" + createHash(\"sha256\").update(content).digest(\"base64\")\n return hash === plugin.integrity\n ? { ok: true }\n : { ok: false, reason: `Integrity mismatch: expected ${plugin.integrity}` }\n } catch (e: any) {\n return { ok: false, reason: `Integrity check failed: ${e.message}` }\n }\n }\n\n checkForUpdate(pluginName: string): {\n hasUpdate: boolean\n current?: string\n latest?: string\n error?: string\n } {\n const plugin = this.getByName(pluginName)\n if (!plugin) return { hasUpdate: false, error: `Plugin '${pluginName}' not in registry` }\n try {\n const pkgPath = join(process.cwd(), \"node_modules\", pluginName, \"package.json\")\n if (!existsSync(pkgPath)) return { hasUpdate: false, error: \"plugin not installed\" }\n const current = JSON.parse(readFileSync(pkgPath, \"utf8\")).version ?? \"0.0.0\"\n const latest = plugin.version\n const parseV = (v: string) =>\n v\n .replace(/[^0-9.]/g, \"\")\n .split(\".\")\n .map(Number)\n const [ca, cb, cc] = parseV(current)\n const [la, lb, lc] = parseV(latest)\n const hasUpdate = la > ca || (la === ca && lb > cb) || (la === ca && lb === cb && lc > cc)\n return { hasUpdate, current, latest }\n } catch (e: any) {\n return { hasUpdate: false, error: `Update check failed: ${e.message}` }\n }\n }\n\n checkAllUpdates(): Array<{\n name: string\n hasUpdate: boolean\n current?: string\n latest?: string\n error?: string\n }> {\n return this.plugins.map((p) => ({ name: p.name, ...this.checkForUpdate(p.name) }))\n }\n}\n\nlet defaultRegistry: PluginRegistry | null = null\n\nexport function getRegistry(): PluginRegistry {\n if (!defaultRegistry) {\n const registryData = require(\"../registry.json\") as RegistryData\n defaultRegistry = new PluginRegistry(registryData)\n }\n return defaultRegistry\n}\n\nexport const registry = getRegistry()\n"]}
|
|
@@ -57,6 +57,31 @@ declare const designTokens: {
|
|
|
57
57
|
readonly muted: "#71717a";
|
|
58
58
|
readonly subtle: "#3f3f46";
|
|
59
59
|
};
|
|
60
|
+
readonly spacing: {
|
|
61
|
+
readonly 1: "0.25rem";
|
|
62
|
+
readonly 2: "0.5rem";
|
|
63
|
+
readonly 3: "0.75rem";
|
|
64
|
+
readonly 4: "1rem";
|
|
65
|
+
readonly 5: "1.25rem";
|
|
66
|
+
readonly 6: "1.5rem";
|
|
67
|
+
readonly 8: "2rem";
|
|
68
|
+
readonly 10: "2.5rem";
|
|
69
|
+
readonly 12: "3rem";
|
|
70
|
+
readonly 16: "4rem";
|
|
71
|
+
};
|
|
72
|
+
readonly breakpoints: {
|
|
73
|
+
readonly sm: "40rem";
|
|
74
|
+
readonly md: "48rem";
|
|
75
|
+
readonly lg: "64rem";
|
|
76
|
+
readonly xl: "80rem";
|
|
77
|
+
readonly "2xl": "96rem";
|
|
78
|
+
};
|
|
79
|
+
readonly fontWeight: {
|
|
80
|
+
readonly normal: "400";
|
|
81
|
+
readonly medium: "500";
|
|
82
|
+
readonly semibold: "600";
|
|
83
|
+
readonly bold: "700";
|
|
84
|
+
};
|
|
60
85
|
readonly fontFamily: {
|
|
61
86
|
readonly sans: readonly ["InterVariable", "Inter", "system-ui", "sans-serif"];
|
|
62
87
|
readonly mono: readonly ["JetBrains Mono", "Fira Code", "Consolas", "monospace"];
|
|
@@ -243,7 +268,9 @@ declare const defaultPreset: {
|
|
|
243
268
|
};
|
|
244
269
|
plugins: never[];
|
|
245
270
|
};
|
|
271
|
+
declare const defaultThemeCss = "@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}";
|
|
272
|
+
declare const defaultGlobalCss = "@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}\n\n/* tailwind-styled-v4 \u2014 zero-config base styles */\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\nbody {\n margin: 0;\n font-family: var(--font-sans, system-ui, sans-serif);\n background: var(--color-surface, #18181b);\n color: var(--color-foreground, #fafafa);\n}\n";
|
|
273
|
+
declare function generateTailwindCss(contentPaths?: string[]): string;
|
|
246
274
|
declare function generateTailwindConfig(safelistPath?: string, contentPaths?: string[]): string;
|
|
247
|
-
declare const defaultGlobalCss = "@import \"tailwindcss\";\n\n/* tailwind-styled-v4 \u2014 zero-config base styles */\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\nbody {\n margin: 0;\n font-family: var(--font-sans, system-ui, sans-serif);\n background: var(--color-background, #09090b);\n color: var(--color-foreground, #fafafa);\n}\n";
|
|
248
275
|
|
|
249
|
-
export { defaultGlobalCss, defaultPreset, designTokens, generateTailwindConfig };
|
|
276
|
+
export { defaultGlobalCss, defaultPreset, defaultThemeCss, designTokens, generateTailwindConfig, generateTailwindCss };
|
package/dist/preset.d.ts
CHANGED
|
@@ -57,6 +57,31 @@ declare const designTokens: {
|
|
|
57
57
|
readonly muted: "#71717a";
|
|
58
58
|
readonly subtle: "#3f3f46";
|
|
59
59
|
};
|
|
60
|
+
readonly spacing: {
|
|
61
|
+
readonly 1: "0.25rem";
|
|
62
|
+
readonly 2: "0.5rem";
|
|
63
|
+
readonly 3: "0.75rem";
|
|
64
|
+
readonly 4: "1rem";
|
|
65
|
+
readonly 5: "1.25rem";
|
|
66
|
+
readonly 6: "1.5rem";
|
|
67
|
+
readonly 8: "2rem";
|
|
68
|
+
readonly 10: "2.5rem";
|
|
69
|
+
readonly 12: "3rem";
|
|
70
|
+
readonly 16: "4rem";
|
|
71
|
+
};
|
|
72
|
+
readonly breakpoints: {
|
|
73
|
+
readonly sm: "40rem";
|
|
74
|
+
readonly md: "48rem";
|
|
75
|
+
readonly lg: "64rem";
|
|
76
|
+
readonly xl: "80rem";
|
|
77
|
+
readonly "2xl": "96rem";
|
|
78
|
+
};
|
|
79
|
+
readonly fontWeight: {
|
|
80
|
+
readonly normal: "400";
|
|
81
|
+
readonly medium: "500";
|
|
82
|
+
readonly semibold: "600";
|
|
83
|
+
readonly bold: "700";
|
|
84
|
+
};
|
|
60
85
|
readonly fontFamily: {
|
|
61
86
|
readonly sans: readonly ["InterVariable", "Inter", "system-ui", "sans-serif"];
|
|
62
87
|
readonly mono: readonly ["JetBrains Mono", "Fira Code", "Consolas", "monospace"];
|
|
@@ -243,7 +268,9 @@ declare const defaultPreset: {
|
|
|
243
268
|
};
|
|
244
269
|
plugins: never[];
|
|
245
270
|
};
|
|
271
|
+
declare const defaultThemeCss = "@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}";
|
|
272
|
+
declare const defaultGlobalCss = "@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}\n\n/* tailwind-styled-v4 \u2014 zero-config base styles */\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\nbody {\n margin: 0;\n font-family: var(--font-sans, system-ui, sans-serif);\n background: var(--color-surface, #18181b);\n color: var(--color-foreground, #fafafa);\n}\n";
|
|
273
|
+
declare function generateTailwindCss(contentPaths?: string[]): string;
|
|
246
274
|
declare function generateTailwindConfig(safelistPath?: string, contentPaths?: string[]): string;
|
|
247
|
-
declare const defaultGlobalCss = "@import \"tailwindcss\";\n\n/* tailwind-styled-v4 \u2014 zero-config base styles */\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\nbody {\n margin: 0;\n font-family: var(--font-sans, system-ui, sans-serif);\n background: var(--color-background, #09090b);\n color: var(--color-foreground, #fafafa);\n}\n";
|
|
248
275
|
|
|
249
|
-
export { defaultGlobalCss, defaultPreset, designTokens, generateTailwindConfig };
|
|
276
|
+
export { defaultGlobalCss, defaultPreset, defaultThemeCss, designTokens, generateTailwindConfig, generateTailwindCss };
|