@vueless/storybook 1.1.3-beta.0 → 1.1.3-beta.10
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/.storybook-js/main.js +10 -0
- package/.storybook-js/manager-head.html +34 -0
- package/.storybook-js/manager.js +34 -0
- package/.storybook-js/preview.js +70 -0
- package/.storybook-js/public/favicons/favicon.ico +0 -0
- package/.storybook-js/public/favicons/favicon.svg +4 -0
- package/.storybook-js/public/images/vueless-logo-dark.svg +12 -0
- package/.storybook-js/public/images/vueless-logo-light.svg +12 -0
- package/.storybook-js/themes/manager.css +177 -0
- package/{.storybook/index.css → .storybook-js/themes/preview.css} +0 -1
- package/.storybook-js/themes/themeDark.js +44 -0
- package/.storybook-js/themes/themeLight.js +44 -0
- package/.storybook-js/themes/themeLightPreview.js +40 -0
- package/{.storybook → .storybook-js}/vite.config.js +1 -0
- package/.storybook-ts/env.d.ts +4 -0
- package/.storybook-ts/main.ts +10 -0
- package/.storybook-ts/manager-head.html +34 -0
- package/.storybook-ts/manager.ts +34 -0
- package/.storybook-ts/preview-head.html +11 -0
- package/.storybook-ts/preview.ts +73 -0
- package/.storybook-ts/public/favicons/favicon.ico +0 -0
- package/.storybook-ts/public/favicons/favicon.svg +4 -0
- package/.storybook-ts/public/images/vueless-logo-dark.svg +12 -0
- package/.storybook-ts/public/images/vueless-logo-light.svg +12 -0
- package/.storybook-ts/themes/manager.css +177 -0
- package/.storybook-ts/themes/preview.css +612 -0
- package/.storybook-ts/themes/themeDark.ts +45 -0
- package/.storybook-ts/themes/themeLight.ts +45 -0
- package/.storybook-ts/themes/themeLightPreview.ts +41 -0
- package/.storybook-ts/tsconfig.app.json +35 -0
- package/.storybook-ts/tsconfig.json +11 -0
- package/.storybook-ts/tsconfig.node.json +13 -0
- package/.storybook-ts/vite.config.ts +24 -0
- package/LICENSE +1 -1
- package/README.md +29 -2
- package/bin/index.js +89 -0
- package/decorators/storyDarkModeDecorator.js +37 -0
- package/index.d.ts +2 -0
- package/index.js +2 -114
- package/package.json +32 -27
- package/webTypes/index.js +0 -0
- package/.storybook/decorators/storyDarkModeDecorator.js +0 -49
- package/.storybook/main.js +0 -28
- package/.storybook/manager-head.html +0 -215
- package/.storybook/manager.js +0 -18
- package/.storybook/preview.js +0 -72
- package/.storybook/themes/tailwindColors.js +0 -290
- package/.storybook/themes/themeDark.js +0 -46
- package/.storybook/themes/themeLight.js +0 -46
- package/.storybook/themes/themeLightDocs.js +0 -41
- /package/{.storybook → .storybook-js}/preview-head.html +0 -0
- /package/{.storybook/decorators → decorators}/vue3SourceDecorator.js +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { create } from "storybook/theming/create";
|
|
2
|
+
import type { ThemeVars } from "storybook/theming";
|
|
3
|
+
|
|
4
|
+
export const themeLightPreview: ThemeVars = create({
|
|
5
|
+
base: "light",
|
|
6
|
+
// Typography
|
|
7
|
+
fontBase: '"Roboto", sans-serif',
|
|
8
|
+
fontCode: "monospace",
|
|
9
|
+
|
|
10
|
+
// Main colors
|
|
11
|
+
colorPrimary: "#111827", // gray-900
|
|
12
|
+
colorSecondary: "#6b7280", // gray-500
|
|
13
|
+
|
|
14
|
+
// UI
|
|
15
|
+
appBg: "#f3f4f6", // gray-100
|
|
16
|
+
appPreviewBg: "#f9fafb", // gray-50
|
|
17
|
+
appBorderColor: "#e5e7eb", // gray-200
|
|
18
|
+
appContentBg: "#f9fafb", // gray-50
|
|
19
|
+
appBorderRadius: 8,
|
|
20
|
+
|
|
21
|
+
// Text colors
|
|
22
|
+
textColor: "#111827", // gray-900
|
|
23
|
+
textInverseColor: "#f9fafb", // gray-50
|
|
24
|
+
|
|
25
|
+
// Toolbar default and active colors
|
|
26
|
+
barTextColor: "#6b7280", // gray-500
|
|
27
|
+
barHoverColor: "#4b5563", // gray-600
|
|
28
|
+
barSelectedColor: "#374151", // gray-700
|
|
29
|
+
barBg: "#ffffff", // white
|
|
30
|
+
|
|
31
|
+
// Form colors
|
|
32
|
+
inputBg: "#ffffff", // white
|
|
33
|
+
inputBorder: "#d1d5db", // gray-300
|
|
34
|
+
inputTextColor: "#111827", // gray-900
|
|
35
|
+
inputBorderRadius: 4,
|
|
36
|
+
|
|
37
|
+
buttonBg: "#f3f4f6", // gray-100
|
|
38
|
+
buttonBorder: "#e5e7eb", // gray-200
|
|
39
|
+
booleanBg: "#f9fafb", // gray-50
|
|
40
|
+
booleanSelectedBg: "#e5e7eb", // gray-200
|
|
41
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": [
|
|
3
|
+
"env.d.ts",
|
|
4
|
+
"**/*"
|
|
5
|
+
],
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
/* General */
|
|
8
|
+
"module": "ESNext",
|
|
9
|
+
"target": "ESNext",
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"useDefineForClassFields": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"verbatimModuleSyntax": true, // This is important for `<script setup>`.
|
|
14
|
+
"tsBuildInfoFile": "./node_modules/.tmp/storybookTsconfig.app.tsbuildinfo",
|
|
15
|
+
"removeComments": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"composite": true,
|
|
18
|
+
"noEmit": true,
|
|
19
|
+
|
|
20
|
+
/* Path settings */
|
|
21
|
+
"baseUrl": ".",
|
|
22
|
+
"rootDir": "./",
|
|
23
|
+
|
|
24
|
+
/* Enables all strict type-checking options. */
|
|
25
|
+
"strict": true,
|
|
26
|
+
"noImplicitThis": true,
|
|
27
|
+
|
|
28
|
+
/* Bundlers settings */
|
|
29
|
+
"moduleResolution": "bundler",
|
|
30
|
+
"resolveJsonModule": true,
|
|
31
|
+
|
|
32
|
+
/* JS file support. */
|
|
33
|
+
"allowJs": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
|
|
3
|
+
// Plugins
|
|
4
|
+
import Vue from "@vitejs/plugin-vue";
|
|
5
|
+
import { Vueless, TailwindCSS } from "vueless/plugin-vite";
|
|
6
|
+
import { STORYBOOK_ENV } from "vueless/constants.js";
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [Vue(), TailwindCSS(), Vueless({ env: STORYBOOK_ENV })],
|
|
10
|
+
optimizeDeps: {
|
|
11
|
+
include: [
|
|
12
|
+
"cva",
|
|
13
|
+
"tailwind-merge",
|
|
14
|
+
"prettier2",
|
|
15
|
+
"prettier2/parser-html",
|
|
16
|
+
"@storybook/addon-docs/blocks",
|
|
17
|
+
"storybook/theming/create",
|
|
18
|
+
"storybook/internal/docs-tools",
|
|
19
|
+
"@storybook/addon-themes",
|
|
20
|
+
"@storybook/vue3-vite",
|
|
21
|
+
"@vueless/storybook",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
});
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
1
3
|
# Vueless Storybook preset
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
Zero config preset to launch a tailored Storybook instance for a [Vueless](https://github.com/vuelessjs/vueless) UI library.
|
|
6
|
+
|
|
7
|
+
[Documentation](https://docs.vueless.com/installation/storybook/) | [Demo](https://ui.vueless.com/) | [About Vueless UI](http://vueless.com/)
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Install Vueless UI.
|
|
13
|
+
npm install vueless
|
|
14
|
+
|
|
15
|
+
# Install Vueless Storybook preset.
|
|
16
|
+
npm install -D @vueless/storybook
|
|
17
|
+
|
|
18
|
+
# Copy Vueless Storybook preset into your project.
|
|
19
|
+
npx @vueless/storybook
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Contributing
|
|
23
|
+
|
|
24
|
+
* We encourage you to contribute to Vueless! Please check out the
|
|
25
|
+
[contributing to Vueless](CONTRIBUTING.md) for guidelines.
|
|
26
|
+
* Trying to report a possible security vulnerability in Vueless? Please
|
|
27
|
+
check out our [security policy](SECURITY.md) for guidelines.
|
|
28
|
+
* Everyone interacting in Vueless and its sub-projects' codebases, issue trackers, chats, and mailing lists is expected to follow our [code of conduct](CODE_OF_CONDUCT.md) rules.
|
|
29
|
+
|
|
30
|
+
## License
|
|
4
31
|
|
|
5
|
-
[
|
|
32
|
+
Vueless is released under the [MIT License](https://opensource.org/licenses/MIT).
|
package/bin/index.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { cwd } from "node:process";
|
|
6
|
+
import { styleText } from "node:util";
|
|
7
|
+
import fs, { promises } from "node:fs";
|
|
8
|
+
import { detectTypeScript } from "vueless/utils/node/helper.js";
|
|
9
|
+
|
|
10
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
11
|
+
const sourceTs = path.join(__dirname, "..", ".storybook-ts");
|
|
12
|
+
const sourceJs = path.join(__dirname, "..", ".storybook-js");
|
|
13
|
+
const target = path.join(cwd(), ".storybook");
|
|
14
|
+
|
|
15
|
+
const hasTypeScript = await detectTypeScript();
|
|
16
|
+
|
|
17
|
+
hasTypeScript ? copyStorybookPreset(sourceTs, target) : copyStorybookPreset(sourceJs, target);
|
|
18
|
+
|
|
19
|
+
await addStorybookCommands();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Copy Storybook preset to target directory.
|
|
23
|
+
* @param {string} source - Source directory.
|
|
24
|
+
* @param {string} target - Target directory.
|
|
25
|
+
* @param {Object} options - Options object.
|
|
26
|
+
* @param {boolean} options.consoles - Show console messages.
|
|
27
|
+
*/
|
|
28
|
+
function copyStorybookPreset(source, target, { consoles = true } = {}) {
|
|
29
|
+
if (fs.existsSync(target)) {
|
|
30
|
+
const timestamp = new Date().valueOf();
|
|
31
|
+
const renamedTarget = `${target}-backup-${timestamp}`;
|
|
32
|
+
|
|
33
|
+
fs.renameSync(target, renamedTarget);
|
|
34
|
+
|
|
35
|
+
const warnMessage = styleText(
|
|
36
|
+
"yellow",
|
|
37
|
+
`Current Storybook preset backed into : '${path.basename(renamedTarget)}' folder. Remove it before commit.`,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
console.log(warnMessage);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fs.mkdirSync(target, { recursive: true });
|
|
44
|
+
|
|
45
|
+
const files = fs.readdirSync(source);
|
|
46
|
+
|
|
47
|
+
files.forEach((file) => {
|
|
48
|
+
const srcFile = path.join(source, file);
|
|
49
|
+
const destFile = path.join(target, file);
|
|
50
|
+
const stat = fs.lstatSync(srcFile);
|
|
51
|
+
|
|
52
|
+
stat.isDirectory()
|
|
53
|
+
? copyStorybookPreset(srcFile, destFile, { consoles: false })
|
|
54
|
+
: fs.copyFileSync(srcFile, destFile);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (consoles) {
|
|
58
|
+
const successMessage = styleText(
|
|
59
|
+
"green",
|
|
60
|
+
`Storybook preset successfully saved into '${path.basename(target)}' folder.`,
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
console.log(successMessage);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Add Storybook commands to package.json.
|
|
69
|
+
*/
|
|
70
|
+
async function addStorybookCommands() {
|
|
71
|
+
try {
|
|
72
|
+
const storybookCommands = {
|
|
73
|
+
"sb:dev": "storybook dev -p 6006 --no-open",
|
|
74
|
+
"sb:dev:docs": "storybook dev -p 6006 --docs --no-open",
|
|
75
|
+
"sb:build": "storybook build --docs",
|
|
76
|
+
"sb:preview": "vite preview --host --outDir=storybook-static",
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const packageJsonPath = path.resolve(cwd(), "package.json");
|
|
80
|
+
const data = await promises.readFile(packageJsonPath, "utf8");
|
|
81
|
+
const packageJson = JSON.parse(data);
|
|
82
|
+
|
|
83
|
+
packageJson.scripts = { ...packageJson.scripts, ...storybookCommands };
|
|
84
|
+
|
|
85
|
+
await promises.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + "\n", "utf8");
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error("Error:", error);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DecoratorHelpers } from "@storybook/addon-themes";
|
|
2
|
+
import { makeDecorator } from "storybook/preview-api";
|
|
3
|
+
import { setTheme } from "vueless";
|
|
4
|
+
|
|
5
|
+
/* Cache preview color mode. */
|
|
6
|
+
let previewColorMode = "";
|
|
7
|
+
|
|
8
|
+
/* Set Storybook color mode when system color mode changed. */
|
|
9
|
+
const prefersColorSchemeDark = window.matchMedia("(prefers-color-scheme: dark)");
|
|
10
|
+
|
|
11
|
+
prefersColorSchemeDark.addEventListener("change", (event) => {
|
|
12
|
+
const systemColorMode = event.matches ? "dark" : "light";
|
|
13
|
+
|
|
14
|
+
setTheme({ colorMode: previewColorMode || systemColorMode });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/* Define color mode decorator. */
|
|
18
|
+
export const storyDarkModeDecorator = makeDecorator({
|
|
19
|
+
name: "storyDarkModeDecorator",
|
|
20
|
+
wrapper: (storyFn, context) => {
|
|
21
|
+
const sbAddonThemesConfig = localStorage.getItem("sb-addon-themes-3") || "{}";
|
|
22
|
+
const storybookColorMode = JSON.parse(sbAddonThemesConfig).current || "light";
|
|
23
|
+
const systemColorMode = prefersColorSchemeDark.matches ? "dark" : "light";
|
|
24
|
+
|
|
25
|
+
DecoratorHelpers.initializeThemeState(["light", "dark"], storybookColorMode || systemColorMode);
|
|
26
|
+
|
|
27
|
+
previewColorMode = DecoratorHelpers.pluckThemeFromContext(context);
|
|
28
|
+
|
|
29
|
+
setTheme({ colorMode: previewColorMode || systemColorMode });
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
components: { storyFn },
|
|
33
|
+
setup: () => ({ theme: previewColorMode }),
|
|
34
|
+
template: `<story />`,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
package/index.d.ts
ADDED
package/index.js
CHANGED
|
@@ -1,114 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import fs, { promises } from "node:fs";
|
|
5
|
-
import { styleText } from "node:util";
|
|
6
|
-
import { cwd } from "node:process";
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
|
|
9
|
-
// Get the command-line arguments
|
|
10
|
-
const args = process.argv.slice(2);
|
|
11
|
-
const parsedArgs = parseArgs(args);
|
|
12
|
-
|
|
13
|
-
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
14
|
-
const source = path.join(__dirname, ".storybook");
|
|
15
|
-
const target = path.join(cwd(), ".storybook");
|
|
16
|
-
|
|
17
|
-
copyStorybookPreset(source, target);
|
|
18
|
-
|
|
19
|
-
await addStorybookCommands();
|
|
20
|
-
|
|
21
|
-
if (parsedArgs.pnpm) {
|
|
22
|
-
await createNpmrc();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function copyStorybookPreset(source, target, { consoles = true } = {}) {
|
|
26
|
-
if (fs.existsSync(target)) {
|
|
27
|
-
const timestamp = new Date().valueOf();
|
|
28
|
-
const renamedTarget = `${target}-backup-${timestamp}`;
|
|
29
|
-
|
|
30
|
-
fs.renameSync(target, renamedTarget);
|
|
31
|
-
|
|
32
|
-
const warnMessage = styleText(
|
|
33
|
-
"yellow",
|
|
34
|
-
`Current Storybook preset backed into : '${path.basename(renamedTarget)}' folder. Don't forget to remove it before commit.`,
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
console.log(warnMessage);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
fs.mkdirSync(target, { recursive: true });
|
|
41
|
-
|
|
42
|
-
const files = fs.readdirSync(source);
|
|
43
|
-
|
|
44
|
-
files.forEach((file) => {
|
|
45
|
-
const srcFile = path.join(source, file);
|
|
46
|
-
const destFile = path.join(target, file);
|
|
47
|
-
const stat = fs.lstatSync(srcFile);
|
|
48
|
-
|
|
49
|
-
stat.isDirectory()
|
|
50
|
-
? copyStorybookPreset(srcFile, destFile, { consoles: false })
|
|
51
|
-
: fs.copyFileSync(srcFile, destFile);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
if (consoles) {
|
|
55
|
-
const successMessage = styleText(
|
|
56
|
-
"green",
|
|
57
|
-
`Storybook preset successfully saved into '${path.basename(target)}' folder.`,
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
console.log(successMessage);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async function addStorybookCommands() {
|
|
65
|
-
try {
|
|
66
|
-
const storybookCommands = {
|
|
67
|
-
"sb:dev": "storybook dev -p 6006 --no-open",
|
|
68
|
-
"sb:dev:docs": "storybook dev -p 6006 --docs --no-open",
|
|
69
|
-
"sb:build": "storybook build --docs",
|
|
70
|
-
"sb:preview": "vite preview --host --outDir=storybook-static",
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const packageJsonPath = path.resolve(cwd(), "package.json");
|
|
74
|
-
const data = await promises.readFile(packageJsonPath, "utf8");
|
|
75
|
-
const packageJson = JSON.parse(data);
|
|
76
|
-
|
|
77
|
-
packageJson.scripts = { ...packageJson.scripts, ...storybookCommands };
|
|
78
|
-
|
|
79
|
-
await promises.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + "\n", "utf8");
|
|
80
|
-
} catch (error) {
|
|
81
|
-
console.error("Error:", error);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async function createNpmrc() {
|
|
86
|
-
const npmrcContent = [
|
|
87
|
-
"# @vueless/storybook: pnpm: disable hoisting for the package related modules.",
|
|
88
|
-
"public-hoist-pattern[] = *storybook*",
|
|
89
|
-
"public-hoist-pattern[] = prettier2",
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
const npmrcPath = path.join(cwd(), ".npmrc");
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
await promises.writeFile(npmrcPath, npmrcContent.join("\n"));
|
|
96
|
-
} catch (err) {
|
|
97
|
-
console.error("Error writing .npmrc file:", err);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function parseArgs(args) {
|
|
102
|
-
const result = {};
|
|
103
|
-
|
|
104
|
-
args.forEach((arg) => {
|
|
105
|
-
if (arg.startsWith("--")) {
|
|
106
|
-
const [key, value] = arg.split("=");
|
|
107
|
-
const normalizedKey = key.substring(2);
|
|
108
|
-
|
|
109
|
-
result[normalizedKey] = value !== undefined ? value : true;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
1
|
+
export { storyDarkModeDecorator } from "./decorators/storyDarkModeDecorator";
|
|
2
|
+
export { vue3SourceDecorator } from "./decorators/vue3SourceDecorator";
|
package/package.json
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueless/storybook",
|
|
3
|
-
"version": "1.1.3-beta.
|
|
3
|
+
"version": "1.1.3-beta.10",
|
|
4
4
|
"description": "Simplifies Storybook configuration for Vueless UI library.",
|
|
5
|
+
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
5
6
|
"homepage": "https://vueless.com",
|
|
6
|
-
"author": "Johnny Grid",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"type": "module",
|
|
9
8
|
"main": "index.js",
|
|
10
|
-
"
|
|
9
|
+
"type": "module",
|
|
11
10
|
"publishConfig": {
|
|
12
|
-
"access": "public"
|
|
13
|
-
"registry": "https://registry.npmjs.org/"
|
|
11
|
+
"access": "public"
|
|
14
12
|
},
|
|
15
13
|
"bin": {
|
|
16
|
-
"copy": "./index.js"
|
|
14
|
+
"copy": "./bin/index.js"
|
|
17
15
|
},
|
|
18
16
|
"scripts": {
|
|
19
|
-
"
|
|
20
|
-
"lint
|
|
21
|
-
"lint:
|
|
17
|
+
"ts:check": "vue-tsc --build --force",
|
|
18
|
+
"lint": "eslint --no-fix src/",
|
|
19
|
+
"lint:fix": "eslint --fix src/",
|
|
20
|
+
"lint:ci": "eslint --no-fix --max-warnings=0",
|
|
22
21
|
"release:prepare": "rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE README.md dist/",
|
|
23
22
|
"release:beta": "release-it --ci --npm.publish --preRelease=beta --increment=prerelease",
|
|
24
23
|
"release:patch": "release-it patch --ci --npm.publish --git.tag --github.release",
|
|
@@ -26,32 +25,38 @@
|
|
|
26
25
|
"release:major": "release-it major --ci --npm.publish --git.tag --github.release"
|
|
27
26
|
},
|
|
28
27
|
"dependencies": {
|
|
29
|
-
"@storybook/addon-docs": "9.
|
|
30
|
-
"@storybook/addon-links": "9.
|
|
31
|
-
"@storybook/addon-themes": "9.
|
|
32
|
-
"@storybook/vue3-vite": "9.
|
|
33
|
-
"@vueless/storybook-dark-mode": "^9.0.
|
|
28
|
+
"@storybook/addon-docs": "9.1.3",
|
|
29
|
+
"@storybook/addon-links": "9.1.3",
|
|
30
|
+
"@storybook/addon-themes": "9.1.3",
|
|
31
|
+
"@storybook/vue3-vite": "9.1.3",
|
|
32
|
+
"@vueless/storybook-dark-mode": "^9.0.7",
|
|
34
33
|
"chokidar": "^4.0.3",
|
|
35
|
-
"esbuild": "^0.25.
|
|
34
|
+
"esbuild": "^0.25.9",
|
|
36
35
|
"globby": "^14.1.0",
|
|
37
36
|
"mkdirp": "^3.0.1",
|
|
38
37
|
"prettier2": "npm:prettier@2.8.8",
|
|
39
|
-
"storybook": "9.
|
|
38
|
+
"storybook": "9.1.3",
|
|
40
39
|
"vue-docgen-api": "^4.79.2"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
42
|
"@release-it/bumper": "^7.0.5",
|
|
44
|
-
"eslint": "^
|
|
45
|
-
"
|
|
43
|
+
"@stylistic/eslint-plugin": "^5.2.3",
|
|
44
|
+
"@types/node": "^24.3.0",
|
|
45
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
46
|
+
"eslint": "^9.33.0",
|
|
47
|
+
"eslint-config-prettier": "^10.1.8",
|
|
46
48
|
"eslint-plugin-node": "^11.1.0",
|
|
47
|
-
"eslint-plugin-prettier": "^5.
|
|
48
|
-
"
|
|
49
|
-
"prettier
|
|
50
|
-
"release-it": "^19.0.
|
|
51
|
-
"tailwindcss": "^4.1.
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
49
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
50
|
+
"eslint-plugin-storybook": "9.1.3",
|
|
51
|
+
"prettier": "^3.6.2",
|
|
52
|
+
"release-it": "^19.0.4",
|
|
53
|
+
"tailwindcss": "^4.1.12",
|
|
54
|
+
"typescript": "^5.9.2",
|
|
55
|
+
"typescript-eslint": "^8.40.0",
|
|
56
|
+
"vue": "latest",
|
|
57
|
+
"vue-router": "latest",
|
|
58
|
+
"vue-tsc": "^3.0.6",
|
|
59
|
+
"vueless": "^1.2.1-beta.2"
|
|
55
60
|
},
|
|
56
61
|
"overrides": {
|
|
57
62
|
"vue-docgen-api": {
|
package/webTypes/index.js
CHANGED
|
File without changes
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { DecoratorHelpers } from "@storybook/addon-themes";
|
|
2
|
-
import { setTheme } from "vueless";
|
|
3
|
-
import { COLOR_MODE_KEY } from "vueless/constants.js";
|
|
4
|
-
|
|
5
|
-
const { initializeThemeState, pluckThemeFromContext } = DecoratorHelpers;
|
|
6
|
-
|
|
7
|
-
const prefersColorSchemeDark = window.matchMedia("(prefers-color-scheme: dark)");
|
|
8
|
-
|
|
9
|
-
prefersColorSchemeDark.addEventListener("change", (event) => {
|
|
10
|
-
setTheme({ colorMode: event.matches ? "dark" : "light" });
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const storyDarkModeDecorator = () => {
|
|
14
|
-
/* Set theme className to html tag before initialization (fix white blink issue). */
|
|
15
|
-
const sbAddonThemesConfig = localStorage.getItem("sb-addon-themes-3") || "{}";
|
|
16
|
-
const storybookTheme = JSON.parse(sbAddonThemesConfig).current || "light";
|
|
17
|
-
|
|
18
|
-
// this fixing first load
|
|
19
|
-
document.body.classList.add(storybookTheme);
|
|
20
|
-
|
|
21
|
-
// this fixing white blink issue
|
|
22
|
-
if (window.location.toString().includes("viewMode=docs")) {
|
|
23
|
-
document.documentElement.classList.add(storybookTheme);
|
|
24
|
-
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
document.documentElement.classList.remove("light", "dark");
|
|
27
|
-
}, 4000);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* Initialize theme state. */
|
|
31
|
-
const colorMode = prefersColorSchemeDark.matches ? "dark" : "light";
|
|
32
|
-
const cachedColorMode = localStorage.getItem(COLOR_MODE_KEY) || colorMode;
|
|
33
|
-
|
|
34
|
-
initializeThemeState(["light", "dark"], cachedColorMode);
|
|
35
|
-
|
|
36
|
-
return (story, context) => {
|
|
37
|
-
const theme = pluckThemeFromContext(context);
|
|
38
|
-
|
|
39
|
-
setTheme({ colorMode: theme });
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
components: { story },
|
|
43
|
-
setup() {
|
|
44
|
-
return { theme };
|
|
45
|
-
},
|
|
46
|
-
template: `<story />`,
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
};
|
package/.storybook/main.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** @type { import('@storybook/vue3-vite').StorybookConfig } */
|
|
2
|
-
export default {
|
|
3
|
-
stories: [
|
|
4
|
-
"../node_modules/vueless/**/stories.{js,jsx,ts,tsx}",
|
|
5
|
-
"../node_modules/vueless/**/docs.mdx",
|
|
6
|
-
/* Define a path to your own component stories. */
|
|
7
|
-
// "../src/**/stories.{js,jsx,ts,tsx}",
|
|
8
|
-
// "../src/**/docs.mdx",
|
|
9
|
-
],
|
|
10
|
-
addons: [
|
|
11
|
-
"@storybook/addon-docs",
|
|
12
|
-
"@storybook/addon-links",
|
|
13
|
-
"@vueless/storybook-dark-mode",
|
|
14
|
-
"@storybook/addon-themes",
|
|
15
|
-
],
|
|
16
|
-
framework: {
|
|
17
|
-
name: "@storybook/vue3-vite",
|
|
18
|
-
options: {
|
|
19
|
-
builder: {
|
|
20
|
-
viteConfigPath: ".storybook/vite.config.js",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
env: (config) => ({
|
|
25
|
-
...config,
|
|
26
|
-
BASE_URL: "/",
|
|
27
|
-
}),
|
|
28
|
-
};
|