@sit-onyx/storybook-utils 1.0.0-beta.95 → 1.0.0-beta.97
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 +11 -8
- package/src/actions.spec.ts +1 -1
- package/src/actions.ts +1 -1
- package/src/index.ts +5 -5
- package/src/preview.spec.ts +1 -1
- package/src/preview.ts +7 -5
- package/src/required.ts +1 -1
- package/src/sbType.spec.ts +1 -1
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
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.97",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Schwarz IT KG",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=20"
|
|
10
|
+
},
|
|
8
11
|
"files": [
|
|
9
12
|
"src"
|
|
10
13
|
],
|
|
@@ -27,18 +30,18 @@
|
|
|
27
30
|
"@vueless/storybook-dark-mode": ">= 9.0.0",
|
|
28
31
|
"storybook": ">= 9.0.0",
|
|
29
32
|
"vue-component-type-helpers": ">= 2",
|
|
30
|
-
"@sit-onyx/icons": "^1.0.0-beta.
|
|
31
|
-
"@sit-onyx/shared": "^1.0.0-beta.
|
|
33
|
+
"@sit-onyx/icons": "^1.0.0-beta.21",
|
|
34
|
+
"@sit-onyx/shared": "^1.0.0-beta.4"
|
|
32
35
|
},
|
|
33
36
|
"dependencies": {
|
|
34
37
|
"deepmerge-ts": "^7.1.5"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
37
|
-
"storybook": "^9.0.
|
|
38
|
-
"vue": "3.5.
|
|
39
|
-
"vue-component-type-helpers": "^
|
|
40
|
-
"@sit-onyx/icons": "^1.0.0-beta.
|
|
41
|
-
"@sit-onyx/shared": "^1.0.0-beta.
|
|
40
|
+
"storybook": "^9.0.17",
|
|
41
|
+
"vue": "3.5.17",
|
|
42
|
+
"vue-component-type-helpers": "^3.0.3",
|
|
43
|
+
"@sit-onyx/icons": "^1.0.0-beta.21",
|
|
44
|
+
"@sit-onyx/shared": "^1.0.0-beta.4"
|
|
42
45
|
},
|
|
43
46
|
"scripts": {
|
|
44
47
|
"build": "tsc --noEmit",
|
package/src/actions.spec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StoryContextForEnhancers } from "storybook/internal/types";
|
|
2
2
|
import { expect, test } from "vitest";
|
|
3
|
-
import { enhanceEventArgTypes } from "./actions";
|
|
3
|
+
import { enhanceEventArgTypes } from "./actions.js";
|
|
4
4
|
|
|
5
5
|
test("should enhance event arg types", () => {
|
|
6
6
|
const argTypes = {
|
package/src/actions.ts
CHANGED
|
@@ -4,7 +4,7 @@ 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";
|
|
6
6
|
import type { ComponentProps, ComponentSlots } from "vue-component-type-helpers";
|
|
7
|
-
import { EVENT_DOC_MAP } from "./events";
|
|
7
|
+
import { EVENT_DOC_MAP } from "./events.js";
|
|
8
8
|
|
|
9
9
|
type ComponentEmits<Props extends ComponentProps<unknown>> = keyof {
|
|
10
10
|
[Key in keyof Props as Key extends `on${string}` ? Key : never]: true;
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./actions";
|
|
2
|
-
export * from "./preview";
|
|
3
|
-
export * from "./sbType";
|
|
4
|
-
export * from "./theme";
|
|
5
|
-
export * from "./types";
|
|
1
|
+
export * from "./actions.js";
|
|
2
|
+
export * from "./preview.js";
|
|
3
|
+
export * from "./sbType.js";
|
|
4
|
+
export * from "./theme.js";
|
|
5
|
+
export * from "./types.js";
|
package/src/preview.spec.ts
CHANGED
|
@@ -2,7 +2,7 @@ import bellRing from "@sit-onyx/icons/bell-ring.svg?raw";
|
|
|
2
2
|
import calendar from "@sit-onyx/icons/calendar.svg?raw";
|
|
3
3
|
import placeholder from "@sit-onyx/icons/placeholder.svg?raw";
|
|
4
4
|
import { describe, expect, test } from "vitest";
|
|
5
|
-
import { replaceAll, sourceCodeTransformer } from "./preview";
|
|
5
|
+
import { replaceAll, sourceCodeTransformer } from "./preview.js";
|
|
6
6
|
|
|
7
7
|
describe("preview.ts", () => {
|
|
8
8
|
test("should transform source code and add icon/onyx imports", () => {
|
package/src/preview.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { deepmerge } from "deepmerge-ts";
|
|
|
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";
|
|
8
|
-
import { enhanceEventArgTypes } from "./actions";
|
|
9
|
-
import { requiredGlobalType, withRequired } from "./required";
|
|
10
|
-
import { ONYX_BREAKPOINTS, createTheme, type BrandDetails } from "./theme";
|
|
8
|
+
import { enhanceEventArgTypes } from "./actions.js";
|
|
9
|
+
import { requiredGlobalType, withRequired } from "./required.js";
|
|
10
|
+
import { ONYX_BREAKPOINTS, createTheme, type BrandDetails } from "./theme.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Creates a default Storybook preview configuration for 'onyx' with the following features:
|
|
@@ -48,6 +48,7 @@ export const createPreview = <T extends Preview = Preview>(
|
|
|
48
48
|
argTypesEnhancers: [enhanceEventArgTypes],
|
|
49
49
|
initialGlobals: {
|
|
50
50
|
["requiredMode" satisfies keyof typeof requiredGlobalType]: "required",
|
|
51
|
+
backgrounds: { value: "currentTheme" },
|
|
51
52
|
},
|
|
52
53
|
globalTypes: {
|
|
53
54
|
...requiredGlobalType,
|
|
@@ -96,8 +97,9 @@ export const createPreview = <T extends Preview = Preview>(
|
|
|
96
97
|
dark: themes.dark,
|
|
97
98
|
},
|
|
98
99
|
backgrounds: {
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
options: {
|
|
101
|
+
currentTheme: { name: "Dynamic", value: "var(--onyx-color-base-background-tinted)" },
|
|
102
|
+
},
|
|
101
103
|
},
|
|
102
104
|
viewport: {
|
|
103
105
|
options: ONYX_BREAKPOINTS,
|
package/src/required.ts
CHANGED
package/src/sbType.spec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SBType } from "storybook/internal/types";
|
|
2
2
|
import { describe, expect, test, vi } from "vitest";
|
|
3
|
-
import { walkTree } from "./sbType";
|
|
3
|
+
import { walkTree } from "./sbType.js";
|
|
4
4
|
|
|
5
5
|
describe("walkTree", () => {
|
|
6
6
|
test.each<{ input: SBType; expected: SBType["name"][] }>([
|