storybook-addon-yak 9.0.0
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/LICENSE +21 -0
- package/README.md +40 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/preset.d.ts +37 -0
- package/dist/preset.js +146 -0
- package/dist/preset.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Digitec Galaxus AG
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# storybook-addon-yak
|
|
2
|
+
|
|
3
|
+
Storybook addon for [next-yak](https://yak.js.org/) - a CSS-in-JS library that combines styled-components syntax with build-time CSS extraction.
|
|
4
|
+
|
|
5
|
+
Supports both Vite and Webpack Storybook builders.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-dev storybook-addon-yak
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Add the addon to your Storybook configuration:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// .storybook/main.ts
|
|
19
|
+
import type { StorybookConfig } from "@storybook/react-vite";
|
|
20
|
+
|
|
21
|
+
const config: StorybookConfig = {
|
|
22
|
+
addons: ["storybook-addon-yak"],
|
|
23
|
+
// ...
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default config;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For Webpack, ensure you also have the SWC compiler addon:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
addons: [
|
|
33
|
+
"@storybook/addon-webpack5-compiler-swc",
|
|
34
|
+
"storybook-addon-yak",
|
|
35
|
+
],
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
See the full documentation at [yak.js.org/docs/storybook](https://yak.js.org/docs/storybook).
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { dirname, join } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
function presets() {
|
|
5
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
return [join(currentDir, "preset.js")];
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
presets
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nexport type { YakAddonOptions } from \"./preset.js\";\n\n/**\n * Returns the preset paths for Storybook\n * This tells Storybook where to find our viteFinal/webpackFinal configuration\n */\nexport function presets() {\n const currentDir = dirname(fileURLToPath(import.meta.url)); // esm only\n return [join(currentDir, \"preset.js\")];\n}\n"],"mappings":";AAAA,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAQvB,SAAS,UAAU;AACxB,QAAM,aAAa,QAAQ,cAAc,YAAY,GAAG,CAAC;AACzD,SAAO,CAAC,KAAK,YAAY,WAAW,CAAC;AACvC;","names":[]}
|
package/dist/preset.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
interface YakAddonOptions {
|
|
2
|
+
/** Path to custom yak context file for theming */
|
|
3
|
+
contextPath?: string;
|
|
4
|
+
/** Whether to minify CSS output (defaults to NODE_ENV === 'production') */
|
|
5
|
+
minify?: boolean;
|
|
6
|
+
/** Prefix for generated class names */
|
|
7
|
+
prefix?: string;
|
|
8
|
+
/** Whether to include display names for debugging */
|
|
9
|
+
displayNames?: boolean;
|
|
10
|
+
/** Experimental options */
|
|
11
|
+
experiments?: {
|
|
12
|
+
/** CSS transpilation mode: "Css" or "CssModule" */
|
|
13
|
+
transpilationMode?: "Css" | "CssModule";
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
interface StorybookOptions {
|
|
17
|
+
presetsList?: Array<{
|
|
18
|
+
name: string;
|
|
19
|
+
options?: YakAddonOptions;
|
|
20
|
+
preset?: {
|
|
21
|
+
name: string;
|
|
22
|
+
options?: YakAddonOptions;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Vite builder configuration
|
|
29
|
+
*/
|
|
30
|
+
declare function viteFinal(config: any, options: StorybookOptions): Promise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Webpack builder configuration
|
|
33
|
+
* Requires @storybook/addon-webpack5-compiler-swc for SWC support
|
|
34
|
+
*/
|
|
35
|
+
declare function webpackFinal(config: any, options: StorybookOptions): Promise<any>;
|
|
36
|
+
|
|
37
|
+
export { type YakAddonOptions, viteFinal, webpackFinal };
|
package/dist/preset.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// src/preset.ts
|
|
2
|
+
import { resolveYakContext } from "next-yak/withYak";
|
|
3
|
+
import { readFileSync } from "fs";
|
|
4
|
+
import { createRequire } from "module";
|
|
5
|
+
import path, { dirname } from "path";
|
|
6
|
+
var require2 = createRequire(import.meta.url);
|
|
7
|
+
function getYakOptions(options) {
|
|
8
|
+
const yakAddon = options.presetsList?.find(
|
|
9
|
+
(p) => p.name === "storybook-addon-yak" || p.preset?.name === "storybook-addon-yak"
|
|
10
|
+
);
|
|
11
|
+
return yakAddon?.options ?? yakAddon?.preset?.options ?? {};
|
|
12
|
+
}
|
|
13
|
+
async function findYakSwcPlugin() {
|
|
14
|
+
try {
|
|
15
|
+
const packageJsonPath = require2.resolve("yak-swc/package.json");
|
|
16
|
+
const packageRoot = dirname(packageJsonPath);
|
|
17
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
18
|
+
return path.resolve(packageRoot, packageJson.main);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw new Error(`Could not resolve yak-swc plugin: ${e}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function viteFinal(config, options) {
|
|
24
|
+
const yakOptions = getYakOptions(options);
|
|
25
|
+
try {
|
|
26
|
+
const { viteYak } = await import("next-yak/vite");
|
|
27
|
+
const yakPlugin = await viteYak({
|
|
28
|
+
minify: yakOptions.minify,
|
|
29
|
+
contextPath: yakOptions.contextPath,
|
|
30
|
+
prefix: yakOptions.prefix,
|
|
31
|
+
displayNames: yakOptions.displayNames,
|
|
32
|
+
experiments: yakOptions.experiments
|
|
33
|
+
});
|
|
34
|
+
config.plugins = config.plugins || [];
|
|
35
|
+
config.plugins.push(yakPlugin);
|
|
36
|
+
} catch (e) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`Failed to load vite-plugin for next-yak. Make sure you have vite installed. Error: ${e}`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return config;
|
|
42
|
+
}
|
|
43
|
+
async function webpackFinal(config, options) {
|
|
44
|
+
const yakOptions = getYakOptions(options);
|
|
45
|
+
const yakSwcPath = await findYakSwcPlugin();
|
|
46
|
+
const minify = yakOptions.minify ?? process.env.NODE_ENV === "production";
|
|
47
|
+
const displayNames = yakOptions.displayNames ?? !minify;
|
|
48
|
+
const transpilation = yakOptions.experiments?.transpilationMode ?? "Css";
|
|
49
|
+
const cssExtension = transpilation === "Css" ? ".yak.css" : ".yak.module.css";
|
|
50
|
+
const yakPluginOptions = {
|
|
51
|
+
minify,
|
|
52
|
+
basePath: process.cwd(),
|
|
53
|
+
prefix: yakOptions.prefix,
|
|
54
|
+
displayNames,
|
|
55
|
+
importMode: {
|
|
56
|
+
// Webpack inline match resource pattern for CSS extraction
|
|
57
|
+
value: `./{{__BASE_NAME__}}${cssExtension}!=!./{{__BASE_NAME__}}?./{{__BASE_NAME__}}${cssExtension}`,
|
|
58
|
+
transpilation,
|
|
59
|
+
encoding: "None"
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const testPattern = transpilation === "Css" ? /\.yak\.css$/ : /\.yak\.module\.css$/;
|
|
63
|
+
config.module = config.module || {};
|
|
64
|
+
config.module.rules = config.module.rules || [];
|
|
65
|
+
config.module.rules.push({
|
|
66
|
+
test: testPattern,
|
|
67
|
+
loader: require2.resolve("next-yak/loaders/webpack-loader"),
|
|
68
|
+
options: yakOptions
|
|
69
|
+
});
|
|
70
|
+
const isSwcLoader = (loader) => {
|
|
71
|
+
if (!loader || typeof loader !== "string") return false;
|
|
72
|
+
return loader.includes("swc-loader") && !loader.includes("css-loader");
|
|
73
|
+
};
|
|
74
|
+
const modifySwcLoader = (use) => {
|
|
75
|
+
if (!use || typeof use !== "object") return;
|
|
76
|
+
if (!isSwcLoader(use.loader)) return;
|
|
77
|
+
use.options = use.options || {};
|
|
78
|
+
use.options.jsc = use.options.jsc || {};
|
|
79
|
+
use.options.jsc.transform = use.options.jsc.transform || {};
|
|
80
|
+
use.options.jsc.transform.react = use.options.jsc.transform.react || {};
|
|
81
|
+
use.options.jsc.transform.react.runtime = use.options.jsc.transform.react.runtime || "automatic";
|
|
82
|
+
use.options.jsc.experimental = use.options.jsc.experimental || {};
|
|
83
|
+
use.options.jsc.experimental.plugins = use.options.jsc.experimental.plugins || [];
|
|
84
|
+
const hasYakPlugin = use.options.jsc.experimental.plugins.some(
|
|
85
|
+
(p) => Array.isArray(p) && p[0]?.includes?.("yak-swc")
|
|
86
|
+
);
|
|
87
|
+
if (!hasYakPlugin) {
|
|
88
|
+
use.options.jsc.experimental.plugins.push([yakSwcPath, yakPluginOptions]);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const processRule = (rule) => {
|
|
92
|
+
if (!rule) return;
|
|
93
|
+
if (rule.use) {
|
|
94
|
+
const uses = Array.isArray(rule.use) ? rule.use : [rule.use];
|
|
95
|
+
for (const use of uses) {
|
|
96
|
+
modifySwcLoader(use);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (rule.loader && isSwcLoader(rule.loader)) {
|
|
100
|
+
rule.options = rule.options || {};
|
|
101
|
+
rule.options.jsc = rule.options.jsc || {};
|
|
102
|
+
rule.options.jsc.transform = rule.options.jsc.transform || {};
|
|
103
|
+
rule.options.jsc.transform.react = rule.options.jsc.transform.react || {};
|
|
104
|
+
rule.options.jsc.transform.react.runtime = rule.options.jsc.transform.react.runtime || "automatic";
|
|
105
|
+
rule.options.jsc.experimental = rule.options.jsc.experimental || {};
|
|
106
|
+
rule.options.jsc.experimental.plugins = rule.options.jsc.experimental.plugins || [];
|
|
107
|
+
const hasYakPlugin = rule.options.jsc.experimental.plugins.some(
|
|
108
|
+
(p) => Array.isArray(p) && p[0]?.includes?.("yak-swc")
|
|
109
|
+
);
|
|
110
|
+
if (!hasYakPlugin) {
|
|
111
|
+
rule.options.jsc.experimental.plugins.push([
|
|
112
|
+
yakSwcPath,
|
|
113
|
+
yakPluginOptions
|
|
114
|
+
]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (rule.oneOf) {
|
|
118
|
+
for (const nestedRule of rule.oneOf) {
|
|
119
|
+
processRule(nestedRule);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (rule.rules) {
|
|
123
|
+
for (const nestedRule of rule.rules) {
|
|
124
|
+
processRule(nestedRule);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
for (const rule of config.module.rules) {
|
|
129
|
+
processRule(rule);
|
|
130
|
+
}
|
|
131
|
+
const yakContext = resolveYakContext(
|
|
132
|
+
yakOptions.contextPath,
|
|
133
|
+
config.context || process.cwd()
|
|
134
|
+
);
|
|
135
|
+
if (yakContext) {
|
|
136
|
+
config.resolve = config.resolve || {};
|
|
137
|
+
config.resolve.alias = config.resolve.alias || {};
|
|
138
|
+
config.resolve.alias["next-yak/context/baseContext"] = yakContext;
|
|
139
|
+
}
|
|
140
|
+
return config;
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
viteFinal,
|
|
144
|
+
webpackFinal
|
|
145
|
+
};
|
|
146
|
+
//# sourceMappingURL=preset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/preset.ts"],"sourcesContent":["import { resolveYakContext } from \"next-yak/withYak\";\nimport { readFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path, { dirname } from \"node:path\";\n\nconst require = createRequire(import.meta.url); // esm only\n\nexport interface YakAddonOptions {\n /** Path to custom yak context file for theming */\n contextPath?: string;\n /** Whether to minify CSS output (defaults to NODE_ENV === 'production') */\n minify?: boolean;\n /** Prefix for generated class names */\n prefix?: string;\n /** Whether to include display names for debugging */\n displayNames?: boolean;\n /** Experimental options */\n experiments?: {\n /** CSS transpilation mode: \"Css\" or \"CssModule\" */\n transpilationMode?: \"Css\" | \"CssModule\";\n };\n}\n\ninterface StorybookOptions {\n presetsList?: Array<{\n name: string;\n options?: YakAddonOptions;\n preset?: { name: string; options?: YakAddonOptions };\n }>;\n [key: string]: unknown;\n}\n\n/**\n * Extracts yak addon options from Storybook's options\n */\nfunction getYakOptions(options: StorybookOptions): YakAddonOptions {\n const yakAddon = options.presetsList?.find(\n (p) =>\n p.name === \"storybook-addon-yak\" ||\n p.preset?.name === \"storybook-addon-yak\",\n );\n return yakAddon?.options ?? yakAddon?.preset?.options ?? {};\n}\n\n/**\n * Finds the path to the yak-swc WASM plugin\n */\nasync function findYakSwcPlugin(): Promise<string> {\n try {\n const packageJsonPath = require.resolve(\"yak-swc/package.json\");\n const packageRoot = dirname(packageJsonPath);\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n return path.resolve(packageRoot, packageJson.main);\n } catch (e) {\n throw new Error(`Could not resolve yak-swc plugin: ${e}`);\n }\n}\n\n/**\n * Vite builder configuration\n */\nexport async function viteFinal(config: any, options: StorybookOptions) {\n const yakOptions = getYakOptions(options);\n\n try {\n const { viteYak } = await import(\"next-yak/vite\");\n const yakPlugin = await viteYak({\n minify: yakOptions.minify,\n contextPath: yakOptions.contextPath,\n prefix: yakOptions.prefix,\n displayNames: yakOptions.displayNames,\n experiments: yakOptions.experiments,\n });\n\n config.plugins = config.plugins || [];\n config.plugins.push(yakPlugin);\n } catch (e) {\n throw new Error(\n `Failed to load vite-plugin for next-yak. ` +\n `Make sure you have vite installed. Error: ${e}`,\n );\n }\n\n return config;\n}\n\n/**\n * Webpack builder configuration\n * Requires @storybook/addon-webpack5-compiler-swc for SWC support\n */\nexport async function webpackFinal(config: any, options: StorybookOptions) {\n const yakOptions = getYakOptions(options);\n const yakSwcPath = await findYakSwcPlugin();\n\n const minify = yakOptions.minify ?? process.env.NODE_ENV === \"production\";\n const displayNames = yakOptions.displayNames ?? !minify;\n // Default to \"Css\" mode for webpack (simpler, no CSS modules complexity)\n const transpilation = yakOptions.experiments?.transpilationMode ?? \"Css\";\n\n // Determine CSS extension based on transpilation mode\n const cssExtension = transpilation === \"Css\" ? \".yak.css\" : \".yak.module.css\";\n\n const yakPluginOptions = {\n minify,\n basePath: process.cwd(),\n prefix: yakOptions.prefix,\n displayNames,\n importMode: {\n // Webpack inline match resource pattern for CSS extraction\n value: `./{{__BASE_NAME__}}${cssExtension}!=!./{{__BASE_NAME__}}?./{{__BASE_NAME__}}${cssExtension}`,\n transpilation,\n encoding: \"None\",\n },\n };\n\n // Add webpack loader for yak CSS extraction\n const testPattern =\n transpilation === \"Css\" ? /\\.yak\\.css$/ : /\\.yak\\.module\\.css$/;\n\n config.module = config.module || {};\n config.module.rules = config.module.rules || [];\n config.module.rules.push({\n test: testPattern,\n loader: require.resolve(\"next-yak/loaders/webpack-loader\"),\n options: yakOptions,\n });\n\n // Find and modify swc-loader to add yak-swc plugin\n const isSwcLoader = (loader: string | undefined) => {\n if (!loader || typeof loader !== \"string\") return false;\n return loader.includes(\"swc-loader\") && !loader.includes(\"css-loader\");\n };\n\n const modifySwcLoader = (use: any) => {\n if (!use || typeof use !== \"object\") return;\n if (!isSwcLoader(use.loader)) return;\n\n use.options = use.options || {};\n use.options.jsc = use.options.jsc || {};\n // Ensure React transform uses automatic runtime\n use.options.jsc.transform = use.options.jsc.transform || {};\n use.options.jsc.transform.react = use.options.jsc.transform.react || {};\n use.options.jsc.transform.react.runtime =\n use.options.jsc.transform.react.runtime || \"automatic\";\n // Add yak-swc plugin\n use.options.jsc.experimental = use.options.jsc.experimental || {};\n use.options.jsc.experimental.plugins =\n use.options.jsc.experimental.plugins || [];\n // Check if plugin is already added\n const hasYakPlugin = use.options.jsc.experimental.plugins.some(\n (p: any) => Array.isArray(p) && p[0]?.includes?.(\"yak-swc\"),\n );\n if (!hasYakPlugin) {\n use.options.jsc.experimental.plugins.push([yakSwcPath, yakPluginOptions]);\n }\n };\n\n const processRule = (rule: any) => {\n if (!rule) return;\n // Handle direct use\n if (rule.use) {\n const uses = Array.isArray(rule.use) ? rule.use : [rule.use];\n for (const use of uses) {\n modifySwcLoader(use);\n }\n }\n // Handle loader directly on rule\n if (rule.loader && isSwcLoader(rule.loader)) {\n rule.options = rule.options || {};\n rule.options.jsc = rule.options.jsc || {};\n rule.options.jsc.transform = rule.options.jsc.transform || {};\n rule.options.jsc.transform.react = rule.options.jsc.transform.react || {};\n rule.options.jsc.transform.react.runtime =\n rule.options.jsc.transform.react.runtime || \"automatic\";\n rule.options.jsc.experimental = rule.options.jsc.experimental || {};\n rule.options.jsc.experimental.plugins =\n rule.options.jsc.experimental.plugins || [];\n const hasYakPlugin = rule.options.jsc.experimental.plugins.some(\n (p: any) => Array.isArray(p) && p[0]?.includes?.(\"yak-swc\"),\n );\n if (!hasYakPlugin) {\n rule.options.jsc.experimental.plugins.push([\n yakSwcPath,\n yakPluginOptions,\n ]);\n }\n }\n // Handle oneOf rules\n if (rule.oneOf) {\n for (const nestedRule of rule.oneOf) {\n processRule(nestedRule);\n }\n }\n // Handle rules array\n if (rule.rules) {\n for (const nestedRule of rule.rules) {\n processRule(nestedRule);\n }\n }\n };\n\n for (const rule of config.module.rules) {\n processRule(rule);\n }\n\n // Set up context alias for theming\n const yakContext = resolveYakContext(\n yakOptions.contextPath,\n config.context || process.cwd(),\n );\n if (yakContext) {\n config.resolve = config.resolve || {};\n config.resolve.alias = config.resolve.alias || {};\n config.resolve.alias[\"next-yak/context/baseContext\"] = yakContext;\n }\n\n return config;\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,OAAO,QAAQ,eAAe;AAE9B,IAAMA,WAAU,cAAc,YAAY,GAAG;AA8B7C,SAAS,cAAc,SAA4C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,KAAK,OAAO;AACnC,oBAAY,UAAU;AAAA,MACxB;AAAA,IACF;AAEA,QAAI,KAAK,OAAO;AACd,iBAAW,cAAc,KAAK,OAAO;AACnC,oBAAY,UAAU;AAAA,MACxB;AAAA,IACF;AAAA,EACF;AAEA,aAAW,QAAQ,OAAO,OAAO,OAAO;AACtC,gBAAY,IAAI;AAAA,EAClB;AAGA,QAAM,aAAa;AAAA,IACjB,WAAW;AAAA,IACX,OAAO,WAAW,QAAQ,IAAI;AAAA,EAChC;AACA,MAAI,YAAY;AACd,WAAO,UAAU,OAAO,WAAW,CAAC;AACpC,WAAO,QAAQ,QAAQ,OAAO,QAAQ,SAAS,CAAC;AAChD,WAAO,QAAQ,MAAM,8BAA8B,IAAI;AAAA,EACzD;AAEA,SAAO;AACT;","names":["require"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "storybook-addon-yak",
|
|
3
|
+
"version": "9.0.0",
|
|
4
|
+
"description": "Storybook addon for next-yak CSS-in-JS",
|
|
5
|
+
"homepage": "https://yak.js.org/",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/DigitecGalaxus/next-yak"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/DigitecGalaxus/next-yak/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"storybook",
|
|
17
|
+
"storybook-addon",
|
|
18
|
+
"next-yak",
|
|
19
|
+
"css-in-js",
|
|
20
|
+
"react"
|
|
21
|
+
],
|
|
22
|
+
"main": "dist/index.js",
|
|
23
|
+
"types": "dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./preset": {
|
|
30
|
+
"types": "./dist/preset.d.ts",
|
|
31
|
+
"import": "./dist/preset.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md"
|
|
38
|
+
],
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "24.9.2",
|
|
41
|
+
"tsup": "8.5.0",
|
|
42
|
+
"typescript": "5.9.3",
|
|
43
|
+
"next-yak": "9.0.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"storybook": "^10.0.0",
|
|
47
|
+
"next-yak": "9.0.0"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"maintainers": [
|
|
53
|
+
{
|
|
54
|
+
"name": "Luca Schneider"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"author": {
|
|
58
|
+
"name": "Jan Nicklas"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsup",
|
|
62
|
+
"dev": "tsup --watch"
|
|
63
|
+
}
|
|
64
|
+
}
|