tailwind-styled-v4 5.0.37 → 5.0.39
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/dist/analyzer.js +213 -161
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +121 -83
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +131 -87
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +31 -15
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +107 -67
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +47 -14
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +601 -428
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +504 -313
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.js +833 -508
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +298 -30
- package/dist/compiler.mjs.map +1 -1
- package/dist/dashboard.js +72 -41
- package/dist/dashboard.js.map +1 -1
- package/dist/dashboard.mjs +12 -6
- package/dist/dashboard.mjs.map +1 -1
- package/dist/devtools.js +335 -289
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +28 -11
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.js +719 -506
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +520 -318
- package/dist/engine.mjs.map +1 -1
- package/dist/index.d.mts +145 -319
- package/dist/index.d.ts +145 -319
- package/dist/index.js +1337 -7442
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1275 -7386
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +327 -242
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +272 -184
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.js +94 -49
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-api.mjs +26 -6
- package/dist/plugin-api.mjs.map +1 -1
- package/dist/plugin-registry.js +68 -40
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +14 -10
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.js +102 -53
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +30 -6
- package/dist/plugin.mjs.map +1 -1
- package/dist/preset.js +48 -15
- package/dist/preset.js.map +1 -1
- package/dist/preset.mjs +13 -5
- package/dist/preset.mjs.map +1 -1
- package/dist/rspack.js +108 -53
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +50 -18
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.js +63 -24
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +15 -7
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/runtime.js +98 -44
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +31 -8
- package/dist/runtime.mjs.map +1 -1
- package/dist/scanner.js +164 -120
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +70 -40
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +0 -12
- package/dist/shared.d.ts +0 -12
- package/dist/shared.js +481 -299
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +304 -133
- package/dist/shared.mjs.map +1 -1
- package/dist/storybook-addon.js +40 -10
- package/dist/storybook-addon.js.map +1 -1
- package/dist/storybook-addon.mjs +8 -3
- package/dist/storybook-addon.mjs.map +1 -1
- package/dist/svelte.js +95 -64
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +37 -14
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +69 -37
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +8 -7
- package/dist/syntax.mjs.map +1 -1
- package/dist/testing.js +56 -18
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +16 -3
- package/dist/testing.mjs.map +1 -1
- package/dist/theme.js +133 -74
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +45 -14
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +156 -115
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +135 -82
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +584 -423
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +498 -311
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +599 -450
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +484 -332
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +102 -70
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +39 -15
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +112 -77
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +52 -18
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +3 -1
package/dist/storybook-addon.js
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const __importMetaUrl = typeof __filename !== "undefined" ? require("node:url").pathToFileURL(__filename).href : "file://unknown";
|
|
3
2
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/umbrella/storybook-addon.ts
|
|
23
|
+
var storybook_addon_exports = {};
|
|
24
|
+
__export(storybook_addon_exports, {
|
|
25
|
+
createVariantStoryArgs: () => createVariantStoryArgs,
|
|
26
|
+
enumerateVariantProps: () => enumerateVariantProps,
|
|
27
|
+
generateArgTypes: () => generateArgTypes,
|
|
28
|
+
generateDefaultArgs: () => generateDefaultArgs,
|
|
29
|
+
getVariantClass: () => getVariantClass,
|
|
30
|
+
withTailwindStyled: () => withTailwindStyled
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(storybook_addon_exports);
|
|
4
33
|
|
|
5
34
|
// packages/infrastructure/storybook-addon/src/index.ts
|
|
6
35
|
function enumerateVariantProps(matrix) {
|
|
@@ -84,12 +113,13 @@ function getVariantClass(config, props) {
|
|
|
84
113
|
}
|
|
85
114
|
return classes.join(" ");
|
|
86
115
|
}
|
|
87
|
-
|
|
88
|
-
exports
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
116
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
117
|
+
0 && (module.exports = {
|
|
118
|
+
createVariantStoryArgs,
|
|
119
|
+
enumerateVariantProps,
|
|
120
|
+
generateArgTypes,
|
|
121
|
+
generateDefaultArgs,
|
|
122
|
+
getVariantClass,
|
|
123
|
+
withTailwindStyled
|
|
124
|
+
});
|
|
95
125
|
//# sourceMappingURL=storybook-addon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/infrastructure/storybook-addon/src/index.ts"],"
|
|
1
|
+
{"version":3,"sources":["../src/umbrella/storybook-addon.ts","../packages/infrastructure/storybook-addon/src/index.ts"],"sourcesContent":["export * from \"@tailwind-styled/storybook-addon\"\n","/**\n * tailwind-styled-v4 — Storybook Addon\n *\n * Integrasi Storybook untuk komponen tw().\n * Fitur:\n * - withTailwindStyled decorator: inject className ke story\n * - generateArgTypes: auto-generate controls dari ComponentConfig\n * - enumerateVariantProps: buat semua kombinasi variant untuk testing\n */\n\nimport type { VariantMatrix } from \"@tailwind-styled/shared\"\nexport type { VariantMatrix } from \"@tailwind-styled/shared\"\n\nexport interface ComponentConfig {\n base?: string\n variants?: Record<string, Record<string, string>>\n defaultVariants?: Record<string, string>\n compoundVariants?: Array<{ class: string; [key: string]: string }>\n}\n\n// ─── Variant enumeration (core utility) ──────────────────────────────────────\n\n/**\n * Enumerate semua kombinasi variant dari matrix.\n *\n * @example\n * enumerateVariantProps({ size: ['sm','lg'], intent: ['primary','danger'] })\n * // → [{ size:'sm', intent:'primary' }, { size:'sm', intent:'danger' }, ...]\n */\nexport function enumerateVariantProps(\n matrix: VariantMatrix\n): Array<Record<string, string | number | boolean>> {\n const keys = Object.keys(matrix)\n if (keys.length === 0) return [{}]\n\n const result: Array<Record<string, string | number | boolean>> = []\n\n function walk(index: number, current: Record<string, string | number | boolean>) {\n if (index >= keys.length) {\n result.push({ ...current })\n return\n }\n const key = keys[index]!\n for (const value of matrix[key] ?? []) {\n current[key] = value\n walk(index + 1, current)\n }\n }\n\n walk(0, {})\n return result\n}\n\n// ─── Storybook argTypes generator ─────────────────────────────────────────────\n\n/**\n * Generate Storybook argTypes dari ComponentConfig.\n * Otomatis membuat kontrol dropdown untuk setiap variant.\n */\nexport function generateArgTypes(config: ComponentConfig): Record<string, unknown> {\n if (!config.variants) return {}\n\n const argTypes: Record<string, unknown> = {}\n\n for (const [variantKey, variantValues] of Object.entries(config.variants)) {\n const options = Object.keys(variantValues)\n const defaultValue = config.defaultVariants?.[variantKey]\n\n argTypes[variantKey] = {\n control: { type: \"select\" },\n options,\n defaultValue,\n description: `Variant: **${variantKey}**`,\n table: {\n type: { summary: options.join(\" | \") },\n defaultValue: defaultValue ? { summary: defaultValue } : undefined,\n category: \"Variants\",\n },\n }\n }\n\n return argTypes\n}\n\nexport function generateDefaultArgs(config: ComponentConfig): Record<string, string> {\n return { ...(config.defaultVariants ?? undefined) }\n}\n\n// ─── Storybook decorator ───────────────────────────────────────────────────────\n\nexport function withTailwindStyled(\n StoryFn: () => unknown,\n context: {\n args?: Record<string, unknown>\n parameters?: { tailwindStyled?: { wrapperClass?: string; padding?: string } }\n }\n): unknown {\n const wrapperClass = context.parameters?.tailwindStyled?.wrapperClass ?? \"\"\n const padding = context.parameters?.tailwindStyled?.padding ?? \"p-8\"\n\n if (typeof document !== \"undefined\") {\n const wrapper = document.createElement(\"div\")\n wrapper.className = [padding, wrapperClass].filter(Boolean).join(\" \")\n return wrapper\n }\n\n return StoryFn()\n}\n\n// ─── Story template helpers ────────────────────────────────────────────────────\n\nexport function createVariantStoryArgs(config: ComponentConfig): {\n combinations: Array<Record<string, string | number | boolean>>\n matrix: VariantMatrix\n} {\n if (!config.variants) return { combinations: [{}], matrix: {} }\n\n const matrix: VariantMatrix = {}\n for (const [key, values] of Object.entries(config.variants)) {\n matrix[key] = Object.keys(values)\n }\n\n return {\n combinations: enumerateVariantProps(matrix),\n matrix,\n }\n}\n\nexport function getVariantClass(config: ComponentConfig, props: Record<string, string>): string {\n const classes: string[] = []\n\n if (config.base) classes.push(config.base)\n\n if (config.variants) {\n for (const [key, values] of Object.entries(config.variants)) {\n const val = props[key] ?? config.defaultVariants?.[key]\n if (val && values[val]) classes.push(values[val])\n }\n }\n\n if (config.compoundVariants) {\n for (const compound of config.compoundVariants) {\n const { class: cls, ...conditions } = compound\n if (Object.entries(conditions).every(([k, v]) => props[k] === v)) {\n classes.push(cls)\n }\n }\n }\n\n return classes.join(\" \")\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC6BO,SAAS,sBACd,QACkD;AAClD,QAAM,OAAO,OAAO,KAA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join(" ");
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
export {
|
|
86
|
+
createVariantStoryArgs,
|
|
87
|
+
enumerateVariantProps,
|
|
88
|
+
generateArgTypes,
|
|
89
|
+
generateDefaultArgs,
|
|
90
|
+
getVariantClass,
|
|
91
|
+
withTailwindStyled
|
|
92
|
+
};
|
|
88
93
|
//# sourceMappingURL=storybook-addon.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/infrastructure/storybook-addon/src/index.ts"],"
|
|
1
|
+
{"version":3,"sources":["../packages/infrastructure/storybook-addon/src/index.ts"],"sourcesContent":["/**\n * tailwind-styled-v4 — Storybook Addon\n *\n * Integrasi Storybook untuk komponen tw().\n * Fitur:\n * - withTailwindStyled decorator: inject className ke story\n * - generateArgTypes: auto-generate controls dari ComponentConfig\n * - enumerateVariantProps: buat semua kombinasi variant untuk testing\n */\n\nimport type { VariantMatrix } from \"@tailwind-styled/shared\"\nexport type { VariantMatrix } from \"@tailwind-styled/shared\"\n\nexport interface ComponentConfig {\n base?: string\n variants?: Record<string, Record<string, string>>\n defaultVariants?: Record<string, string>\n compoundVariants?: Array<{ class: string; [key: string]: string }>\n}\n\n// ─── Variant enumeration (core utility) ──────────────────────────────────────\n\n/**\n * Enumerate semua kombinasi variant dari matrix.\n *\n * @example\n * enumerateVariantProps({ size: ['sm','lg'], intent: ['primary','danger'] })\n * // → [{ size:'sm', intent:'primary' }, { size:'sm', intent:'danger' }, ...]\n */\nexport function enumerateVariantProps(\n matrix: VariantMatrix\n): Array<Record<string, string | number | boolean>> {\n const keys = Object.keys(matrix)\n if (keys.length === 0) return [{}]\n\n const result: Array<Record<string, string | number | boolean>> = []\n\n function walk(index: number, current: Record<string, string | number | boolean>) {\n if (index >= keys.length) {\n result.push({ ...current })\n return\n }\n const key = keys[index]!\n for (const value of matrix[key] ?? []) {\n current[key] = value\n walk(index + 1, current)\n }\n }\n\n walk(0, {})\n return result\n}\n\n// ─── Storybook argTypes generator ─────────────────────────────────────────────\n\n/**\n * Generate Storybook argTypes dari ComponentConfig.\n * Otomatis membuat kontrol dropdown untuk setiap variant.\n */\nexport function generateArgTypes(config: ComponentConfig): Record<string, unknown> {\n if (!config.variants) return {}\n\n const argTypes: Record<string, unknown> = {}\n\n for (const [variantKey, variantValues] of Object.entries(config.variants)) {\n const options = Object.keys(variantValues)\n const defaultValue = config.defaultVariants?.[variantKey]\n\n argTypes[variantKey] = {\n control: { type: \"select\" },\n options,\n defaultValue,\n description: `Variant: **${variantKey}**`,\n table: {\n type: { summary: options.join(\" | \") },\n defaultValue: defaultValue ? { summary: defaultValue } : undefined,\n category: \"Variants\",\n },\n }\n }\n\n return argTypes\n}\n\nexport function generateDefaultArgs(config: ComponentConfig): Record<string, string> {\n return { ...(config.defaultVariants ?? undefined) }\n}\n\n// ─── Storybook decorator ───────────────────────────────────────────────────────\n\nexport function withTailwindStyled(\n StoryFn: () => unknown,\n context: {\n args?: Record<string, unknown>\n parameters?: { tailwindStyled?: { wrapperClass?: string; padding?: string } }\n }\n): unknown {\n const wrapperClass = context.parameters?.tailwindStyled?.wrapperClass ?? \"\"\n const padding = context.parameters?.tailwindStyled?.padding ?? \"p-8\"\n\n if (typeof document !== \"undefined\") {\n const wrapper = document.createElement(\"div\")\n wrapper.className = [padding, wrapperClass].filter(Boolean).join(\" \")\n return wrapper\n }\n\n return StoryFn()\n}\n\n// ─── Story template helpers ────────────────────────────────────────────────────\n\nexport function createVariantStoryArgs(config: ComponentConfig): {\n combinations: Array<Record<string, string | number | boolean>>\n matrix: VariantMatrix\n} {\n if (!config.variants) return { combinations: [{}], matrix: {} }\n\n const matrix: VariantMatrix = {}\n for (const [key, values] of Object.entries(config.variants)) {\n matrix[key] = Object.keys(values)\n }\n\n return {\n combinations: enumerateVariantProps(matrix),\n matrix,\n }\n}\n\nexport function getVariantClass(config: ComponentConfig, props: Record<string, string>): string {\n const classes: string[] = []\n\n if (config.base) classes.push(config.base)\n\n if (config.variants) {\n for (const [key, values] of Object.entries(config.variants)) {\n const val = props[key] ?? config.defaultVariants?.[key]\n if (val && values[val]) classes.push(values[val])\n }\n }\n\n if (config.compoundVariants) {\n for (const compound of config.compoundVariants) {\n const { class: cls, ...conditions } = compound\n if (Object.entries(conditions).every(([k, v]) => props[k] === v)) {\n classes.push(cls)\n }\n }\n }\n\n return classes.join(\" \")\n}\n\n"],"mappings":";;;AA6BO,SAAS,sBACd,QACkD;AAClD,QAAM,OAAO,OAAO,KAAK,MAAM;AAC/B,MAAI,KAAK,WAAW,EAAG,QAAO,CAAC,CAAC,CAAC;AAEjC,QAAM,SAA2D,CAAC;AAElE,WAAS,KAAK,OAAe,SAAoD;AAC/E,QAAI,SAAS,KAAK,QAAQ;AACxB,aAAO,KAAK,EAAE,GAAG,QAAQ,CAAC;AAC1B;AAAA,IACF;AACA,UAAM,MAAM,KAAK,KAAK;AACtB,eAAW,SAAS,OAAO,GAAG,KAAK,CAAC,GAAG;AACrC,cAAQ,GAAG,IAAI;AACf,WAAK,QAAQ,GAAG,OAAO;AAAA,IACzB;AAAA,EACF;AAEA,OAAK,GAAG,CAAC,CAAC;AACV,SAAO;AACT;AAQO,SAAS,iBAAiB,QAAkD;AACjF,MAAI,CAAC,OAAO,SAAU,QAAO,CAAC;AAE9B,QAAM,WAAoC,CAAC;AAE3C,aAAW,CAAC,YAAY,aAAa,KAAK,OAAO,QAAQ,OAAO,QAAQ,GAAG;AACzE,UAAM,UAAU,OAAO,KAAK,aAAa;AACzC,UAAM,eAAe,OAAO,kBAAkB,UAAU;AAExD,aAAS,UAAU,IAAI;AAAA,MACrB,SAAS,EAAE,MAAM,SAAS;AAAA,MAC1B;AAAA,MACA;AAAA,MACA,aAAa,cAAc,UAAU;AAAA,MACrC,OAAO;AAAA,QACL,MAAM,EAAE,SAAS,QAAQ,KAAK,KAAK,EAAE;AAAA,QACrC,cAAc,eAAe,EAAE,SAAS,aAAa,IAAI;AAAA,QACzD,UAA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AG,WAAW,IAAI;AACtC,UAAI,OAAO,QAAQ,UAAU,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG;AAChE,gBAAQ,KAAK,GAAG;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAEA,SAAO,QAAQ,KAAK,GAAG;AACzB;","names":[]}
|
package/dist/svelte.js
CHANGED
|
@@ -1,44 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var module$1 = require('module');
|
|
4
|
-
var fs = require('fs');
|
|
5
|
-
var path = require('path');
|
|
6
|
-
require('crypto');
|
|
7
|
-
var url = require('url');
|
|
8
|
-
|
|
9
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
10
|
-
function _interopNamespace(e) {
|
|
11
|
-
if (e && e.__esModule) return e;
|
|
12
|
-
var n = Object.create(null);
|
|
13
|
-
if (e) {
|
|
14
|
-
Object.keys(e).forEach(function (k) {
|
|
15
|
-
if (k !== 'default') {
|
|
16
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function () { return e[k]; }
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
n.default = e;
|
|
25
|
-
return Object.freeze(n);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
29
|
-
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
30
|
-
|
|
1
|
+
const __importMetaUrl = typeof __filename !== "undefined" ? require("node:url").pathToFileURL(__filename).href : "file://unknown";
|
|
31
2
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
3
|
+
"use strict";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
32
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
}) : x)(function(x) {
|
|
36
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
37
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
38
|
-
});
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
39
10
|
var __esm = (fn, res) => function __init() {
|
|
40
11
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
41
12
|
};
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
+
mod
|
|
32
|
+
));
|
|
33
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
|
+
|
|
35
|
+
// packages/domain/shared/src/native-resolution.ts
|
|
42
36
|
function platformKey() {
|
|
43
37
|
if (isBrowser) return "browser";
|
|
44
38
|
return `${process.platform}-${process.arch}`;
|
|
@@ -54,7 +48,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
54
48
|
}
|
|
55
49
|
const envPath = process.env.TW_NATIVE_PATH?.trim();
|
|
56
50
|
if (envPath) {
|
|
57
|
-
if (
|
|
51
|
+
if (fs.existsSync(envPath)) {
|
|
58
52
|
return { path: envPath, source: "env", platform, tried };
|
|
59
53
|
}
|
|
60
54
|
tried.push(`env:${envPath} (not found)`);
|
|
@@ -63,7 +57,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
63
57
|
for (const pkg of prebuiltPkgs) {
|
|
64
58
|
try {
|
|
65
59
|
const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
|
|
66
|
-
if (
|
|
60
|
+
if (fs.existsSync(candidate)) {
|
|
67
61
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
68
62
|
}
|
|
69
63
|
tried.push(`prebuilt:${pkg} (resolved but missing)`);
|
|
@@ -74,13 +68,13 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
74
68
|
const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
|
|
75
69
|
const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
76
70
|
if (runtimeDir) {
|
|
77
|
-
for (const depth of ["..",
|
|
78
|
-
const pkgRoot =
|
|
71
|
+
for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
|
|
72
|
+
const pkgRoot = path.resolve(runtimeDir, depth);
|
|
79
73
|
for (const bin of BINARY_NAMES_SELF) {
|
|
80
74
|
for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
|
|
81
|
-
const candidate =
|
|
75
|
+
const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
|
|
82
76
|
tried.push(`self-bundled:${candidate}`);
|
|
83
|
-
if (
|
|
77
|
+
if (fs.existsSync(candidate)) {
|
|
84
78
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
85
79
|
}
|
|
86
80
|
}
|
|
@@ -92,39 +86,45 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
92
86
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
93
87
|
const localCandidates = [];
|
|
94
88
|
for (const bin of BINARY_NAMES) {
|
|
95
|
-
localCandidates.push(
|
|
96
|
-
localCandidates.push(
|
|
97
|
-
localCandidates.push(
|
|
98
|
-
localCandidates.push(
|
|
89
|
+
localCandidates.push(path.resolve(base, `${bin}.node`));
|
|
90
|
+
localCandidates.push(path.resolve(base, "..", `${bin}.node`));
|
|
91
|
+
localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
|
|
92
|
+
localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
|
|
99
93
|
}
|
|
100
94
|
for (const startDir of [cwd, base]) {
|
|
101
95
|
let dir = startDir;
|
|
102
96
|
for (let i = 0; i < 6; i++) {
|
|
103
|
-
const nativeDir =
|
|
97
|
+
const nativeDir = path.resolve(dir, "native");
|
|
104
98
|
for (const bin of BINARY_NAMES) {
|
|
105
|
-
localCandidates.push(
|
|
106
|
-
localCandidates.push(
|
|
107
|
-
localCandidates.push(
|
|
108
|
-
localCandidates.push(
|
|
99
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
|
|
100
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
|
|
101
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
|
|
102
|
+
localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
|
|
109
103
|
}
|
|
110
|
-
const parent =
|
|
104
|
+
const parent = path.resolve(dir, "..");
|
|
111
105
|
if (parent === dir) break;
|
|
112
106
|
dir = parent;
|
|
113
107
|
}
|
|
114
108
|
}
|
|
115
109
|
for (const candidate of localCandidates) {
|
|
116
110
|
tried.push(`local:${candidate}`);
|
|
117
|
-
if (
|
|
111
|
+
if (fs.existsSync(candidate)) {
|
|
118
112
|
return { path: candidate, source: "local", platform, tried };
|
|
119
113
|
}
|
|
120
114
|
}
|
|
121
115
|
return { path: null, source: "not-found", platform, tried };
|
|
122
116
|
}
|
|
123
|
-
var isBrowser, _require, PLATFORM_MAP;
|
|
117
|
+
var import_node_module, fs, path, isBrowser, _require, PLATFORM_MAP;
|
|
124
118
|
var init_native_resolution = __esm({
|
|
125
119
|
"packages/domain/shared/src/native-resolution.ts"() {
|
|
120
|
+
"use strict";
|
|
121
|
+
import_node_module = require("module");
|
|
122
|
+
fs = __toESM(require("fs"));
|
|
123
|
+
path = __toESM(require("path"));
|
|
126
124
|
isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
|
|
127
|
-
_require =
|
|
125
|
+
_require = (0, import_node_module.createRequire)(
|
|
126
|
+
typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : __importMetaUrl
|
|
127
|
+
);
|
|
128
128
|
PLATFORM_MAP = {
|
|
129
129
|
"linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
|
|
130
130
|
"linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
|
|
@@ -135,18 +135,45 @@ var init_native_resolution = __esm({
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
+
|
|
139
|
+
// packages/domain/shared/src/index.ts
|
|
140
|
+
var import_node_crypto, import_node_fs, import_node_path, import_node_url, import_node_module2, _require2;
|
|
138
141
|
var init_src = __esm({
|
|
139
142
|
"packages/domain/shared/src/index.ts"() {
|
|
143
|
+
"use strict";
|
|
144
|
+
import_node_crypto = require("crypto");
|
|
145
|
+
import_node_fs = __toESM(require("fs"));
|
|
146
|
+
import_node_path = __toESM(require("path"));
|
|
147
|
+
import_node_url = require("url");
|
|
148
|
+
import_node_module2 = require("module");
|
|
140
149
|
init_native_resolution();
|
|
141
|
-
|
|
150
|
+
_require2 = (0, import_node_module2.createRequire)(
|
|
151
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : __importMetaUrl ?? "file://unknown"
|
|
152
|
+
);
|
|
142
153
|
}
|
|
143
154
|
});
|
|
144
155
|
|
|
156
|
+
// src/umbrella/svelte.ts
|
|
157
|
+
var svelte_exports = {};
|
|
158
|
+
__export(svelte_exports, {
|
|
159
|
+
createVariants: () => createVariants,
|
|
160
|
+
cv: () => cv2,
|
|
161
|
+
styled: () => styled,
|
|
162
|
+
tw: () => tw
|
|
163
|
+
});
|
|
164
|
+
module.exports = __toCommonJS(svelte_exports);
|
|
165
|
+
|
|
145
166
|
// packages/domain/core/src/native.ts
|
|
167
|
+
var import_node_module3 = require("module");
|
|
168
|
+
var import_node_path2 = require("path");
|
|
169
|
+
var import_node_url2 = require("url");
|
|
146
170
|
init_src();
|
|
171
|
+
var import_meta = {};
|
|
147
172
|
var isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
148
173
|
var NATIVE_UNAVAILABLE_MESSAGE = "[tailwind-styled/core] Native binding is required but not available.\nPlease ensure you have run: npm run build:rust";
|
|
149
|
-
var _nodeRequire =
|
|
174
|
+
var _nodeRequire = (0, import_node_module3.createRequire)(
|
|
175
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
|
|
176
|
+
);
|
|
150
177
|
var _loadNative = (path3) => _nodeRequire(path3);
|
|
151
178
|
var nativeBinding = null;
|
|
152
179
|
var bindingLoadAttempted = false;
|
|
@@ -160,7 +187,9 @@ var getBinding = () => {
|
|
|
160
187
|
}
|
|
161
188
|
bindingLoadAttempted = true;
|
|
162
189
|
try {
|
|
163
|
-
const runtimeDir = isBrowser2 ? "" :
|
|
190
|
+
const runtimeDir = isBrowser2 ? "" : (0, import_node_path2.dirname)(
|
|
191
|
+
typeof __filename !== "undefined" ? __filename : typeof import_meta !== "undefined" && __importMetaUrl ? (0, import_node_url2.fileURLToPath)(__importMetaUrl) : process.cwd()
|
|
192
|
+
);
|
|
164
193
|
const result = isBrowser2 ? { path: null, source: "not-found", platform: "browser", tried: [] } : resolveNativeBinary(runtimeDir);
|
|
165
194
|
if (result.path && result.path.endsWith(".node")) {
|
|
166
195
|
const mod = _loadNative(result.path);
|
|
@@ -231,6 +260,7 @@ function tw(...classes) {
|
|
|
231
260
|
return twMerge(...classes.filter(Boolean));
|
|
232
261
|
}
|
|
233
262
|
function styled(node, { config, props = {} }) {
|
|
263
|
+
const _resolver = cv2(config);
|
|
234
264
|
function update({
|
|
235
265
|
config: cfg,
|
|
236
266
|
props: p = {}
|
|
@@ -252,10 +282,11 @@ function createVariants(config, getProps) {
|
|
|
252
282
|
config
|
|
253
283
|
};
|
|
254
284
|
}
|
|
255
|
-
|
|
256
|
-
exports
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
285
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
286
|
+
0 && (module.exports = {
|
|
287
|
+
createVariants,
|
|
288
|
+
cv,
|
|
289
|
+
styled,
|
|
290
|
+
tw
|
|
291
|
+
});
|
|
261
292
|
//# sourceMappingURL=svelte.js.map
|