@sit-onyx/storybook-utils 1.0.0-beta.86 → 1.0.0-beta.88
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/package.json +9 -11
- package/src/actions.ts +1 -1
- package/src/preview.ts +5 -2
- package/src/required.ts +0 -1
- package/src/style.css +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sit-onyx/storybook-utils",
|
|
3
3
|
"description": "Storybook utilities for Vue",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.88",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Schwarz IT KG",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -23,23 +23,21 @@
|
|
|
23
23
|
"url": "https://github.com/SchwarzIT/onyx/issues"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@storybook/
|
|
27
|
-
"@storybook
|
|
28
|
-
"storybook": ">=
|
|
29
|
-
"storybook-dark-mode": ">= 4",
|
|
26
|
+
"@storybook/vue3": ">= 9.0.0",
|
|
27
|
+
"@vueless/storybook-dark-mode": ">= 9.0.0",
|
|
28
|
+
"storybook": ">= 9.0.0",
|
|
30
29
|
"vue-component-type-helpers": ">= 2",
|
|
31
|
-
"@sit-onyx/icons": "^1.0.0-beta.
|
|
30
|
+
"@sit-onyx/icons": "^1.0.0-beta.17",
|
|
32
31
|
"@sit-onyx/shared": "^1.0.0-beta.3"
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
34
|
"deepmerge-ts": "^7.1.5"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"vue": "
|
|
41
|
-
"
|
|
42
|
-
"@sit-onyx/icons": "^1.0.0-beta.16",
|
|
37
|
+
"storybook": "^9.0.10",
|
|
38
|
+
"vue": "3.5.16",
|
|
39
|
+
"vue-component-type-helpers": "^2.2.10",
|
|
40
|
+
"@sit-onyx/icons": "^1.0.0-beta.17",
|
|
43
41
|
"@sit-onyx/shared": "^1.0.0-beta.3"
|
|
44
42
|
},
|
|
45
43
|
"scripts": {
|
package/src/actions.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { action } from "@storybook/addon-actions";
|
|
2
1
|
import type { Decorator } from "@storybook/vue3";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
3
|
import { useArgs } from "storybook/internal/preview-api";
|
|
4
4
|
import type { ArgTypes, ArgTypesEnhancer, StrictInputType } from "storybook/internal/types";
|
|
5
5
|
import { h, isReactive, reactive, watch, type Component, type Events } from "vue";
|
package/src/preview.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getIconImportName } from "@sit-onyx/icons";
|
|
2
2
|
import type { Preview } from "@storybook/vue3";
|
|
3
|
+
import { DARK_MODE_EVENT_NAME } from "@vueless/storybook-dark-mode";
|
|
3
4
|
import { deepmerge } from "deepmerge-ts";
|
|
4
|
-
import { DARK_MODE_EVENT_NAME } from "storybook-dark-mode";
|
|
5
5
|
import { DOCS_RENDERED } from "storybook/internal/core-events";
|
|
6
6
|
import { addons } from "storybook/internal/preview-api";
|
|
7
7
|
import type { ThemeVars } from "storybook/internal/theming";
|
|
@@ -13,7 +13,7 @@ import { ONYX_BREAKPOINTS, createTheme, type BrandDetails } from "./theme";
|
|
|
13
13
|
* Creates a default Storybook preview configuration for 'onyx' with the following features:
|
|
14
14
|
* - Improved controls (sorting and expanded controls so descriptions etc. are also shown in a single story)
|
|
15
15
|
* - Improved Vue-specific code highlighting (e.g. using `@` instead of `v-on:`)
|
|
16
|
-
* - Setup for dark mode (including docs page). Requires addon
|
|
16
|
+
* - Setup for dark mode (including docs page). Requires addon `@vueless/storybook-dark-mode` to be enabled in .storybook/main.ts file
|
|
17
17
|
* - Custom Storybook theme using onyx colors (light and dark mode)
|
|
18
18
|
* - Configure viewports / breakpoints as defined by onyx
|
|
19
19
|
* - Logs Vue emits as Storybook events
|
|
@@ -46,6 +46,9 @@ export const createPreview = <T extends Preview = Preview>(
|
|
|
46
46
|
|
|
47
47
|
const defaultPreview = {
|
|
48
48
|
argTypesEnhancers: [enhanceEventArgTypes],
|
|
49
|
+
initialGlobals: {
|
|
50
|
+
["requiredMode" satisfies keyof typeof requiredGlobalType]: "required",
|
|
51
|
+
},
|
|
49
52
|
globalTypes: {
|
|
50
53
|
...requiredGlobalType,
|
|
51
54
|
},
|
package/src/required.ts
CHANGED
package/src/style.css
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/* the Storybook table of content headline is always black so we need to manually set it for the dark mode */
|
|
21
|
-
#storybook-docs .sbdocs-wrapper >
|
|
21
|
+
#storybook-docs .sbdocs-wrapper > aside > nav > h2 {
|
|
22
22
|
/* same as Storybook color "textMuted" inside ./theme.ts */
|
|
23
23
|
color: var(--onyx-color-text-icons-neutral-medium);
|
|
24
24
|
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
display: none;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/*
|
|
37
|
+
/*
|
|
38
38
|
Copy of ../sit-onyx/src/styles/variables/themes/onyx.css
|
|
39
39
|
TODO: Find a way to automate this
|
|
40
40
|
*/
|