@repobuddy/storybook 1.0.0 → 2.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.
Files changed (105) hide show
  1. package/cjs/components/show_html.d.ts +16 -0
  2. package/cjs/components/show_html.js +29 -0
  3. package/cjs/decorators/show_doc_source.d.ts +6 -0
  4. package/cjs/decorators/show_doc_source.js +38 -0
  5. package/cjs/index.d.ts +13 -0
  6. package/cjs/index.js +137 -0
  7. package/cjs/manager/brand_title.d.ts +35 -0
  8. package/cjs/manager/brand_title.js +12 -0
  9. package/cjs/manager/index.d.ts +1 -0
  10. package/cjs/manager/index.js +16 -0
  11. package/cjs/parameters/define_actions_param.d.ts +24 -0
  12. package/cjs/parameters/define_actions_param.js +11 -0
  13. package/cjs/parameters/define_backgrounds_param.d.ts +45 -0
  14. package/cjs/parameters/define_backgrounds_param.js +10 -0
  15. package/cjs/parameters/define_docs_param.d.ts +217 -0
  16. package/cjs/parameters/define_docs_param.js +11 -0
  17. package/cjs/parameters/define_layout_param.d.ts +20 -0
  18. package/cjs/parameters/define_layout_param.js +10 -0
  19. package/cjs/parameters/define_parameters.d.ts +39 -0
  20. package/cjs/parameters/define_parameters.js +9 -0
  21. package/cjs/parameters/define_test_param.d.ts +34 -0
  22. package/cjs/parameters/define_test_param.js +11 -0
  23. package/cjs/parameters/define_viewport_param.d.ts +78 -0
  24. package/cjs/parameters/define_viewport_param.js +11 -0
  25. package/cjs/parameters/story_sort.d.ts +27 -0
  26. package/cjs/parameters/story_sort.js +1 -0
  27. package/cjs/storybook-addon-tag-badges/index.d.ts +2 -0
  28. package/cjs/storybook-addon-tag-badges/index.js +16 -0
  29. package/cjs/storybook-addon-tag-badges/tag_badges.d.ts +41 -0
  30. package/cjs/storybook-addon-tag-badges/tag_badges.js +179 -0
  31. package/cjs/storybook-addon-tag-badges/types.d.ts +9 -0
  32. package/cjs/storybook-addon-tag-badges/types.js +1 -0
  33. package/cjs/storybook-dark-mode/dark_mode_docs_container.d.ts +26 -0
  34. package/cjs/storybook-dark-mode/dark_mode_docs_container.js +23 -0
  35. package/cjs/storybook-dark-mode/define_dark_mode.d.ts +54 -0
  36. package/cjs/storybook-dark-mode/define_dark_mode.js +11 -0
  37. package/cjs/storybook-dark-mode/index.d.ts +3 -0
  38. package/cjs/storybook-dark-mode/index.js +38 -0
  39. package/cjs/storybook-dark-mode/with_dark_mode.d.ts +22 -0
  40. package/cjs/storybook-dark-mode/with_dark_mode.js +54 -0
  41. package/cjs/testing/decorators/when_running_in_test.d.ts +5 -0
  42. package/cjs/testing/decorators/when_running_in_test.js +12 -0
  43. package/cjs/testing/decorators/when_running_in_text.ctx.d.ts +3 -0
  44. package/cjs/testing/decorators/when_running_in_text.ctx.js +10 -0
  45. package/cjs/types.d.ts +41 -0
  46. package/cjs/types.js +1 -0
  47. package/cjs/variants/index.d.ts +1 -0
  48. package/cjs/variants/index.js +8 -0
  49. package/cjs/variants/package.json +3 -0
  50. package/cjs/variants/preset.d.ts +11 -0
  51. package/cjs/variants/preset.js +3 -0
  52. package/esm/components/show_html.d.ts +1 -1
  53. package/esm/components/show_html.js +17 -26
  54. package/esm/decorators/show_doc_source.js +26 -12
  55. package/esm/index.d.ts +1 -0
  56. package/esm/index.js +12 -12
  57. package/esm/manager/brand_title.js +2 -24
  58. package/esm/manager/index.js +1 -1
  59. package/esm/parameters/define_actions_param.js +1 -9
  60. package/esm/parameters/define_backgrounds_param.js +1 -7
  61. package/esm/parameters/define_docs_param.d.ts +2 -2
  62. package/esm/parameters/define_docs_param.js +1 -28
  63. package/esm/parameters/define_layout_param.js +1 -15
  64. package/esm/parameters/define_parameters.d.ts +1 -1
  65. package/esm/parameters/define_parameters.js +1 -30
  66. package/esm/parameters/define_test_param.js +1 -17
  67. package/esm/parameters/define_viewport_param.js +1 -28
  68. package/esm/parameters/story_sort.js +0 -1
  69. package/esm/storybook-addon-tag-badges/index.js +1 -1
  70. package/esm/storybook-addon-tag-badges/tag_badges.d.ts +1 -1
  71. package/esm/storybook-addon-tag-badges/tag_badges.js +153 -172
  72. package/esm/storybook-addon-tag-badges/types.d.ts +7 -6
  73. package/esm/storybook-addon-tag-badges/types.js +0 -1
  74. package/esm/storybook-dark-mode/dark_mode_docs_container.d.ts +2 -2
  75. package/esm/storybook-dark-mode/dark_mode_docs_container.js +19 -30
  76. package/esm/storybook-dark-mode/define_dark_mode.d.ts +3 -3
  77. package/esm/storybook-dark-mode/define_dark_mode.js +1 -17
  78. package/esm/storybook-dark-mode/index.js +3 -3
  79. package/esm/storybook-dark-mode/with_dark_mode.js +35 -60
  80. package/esm/testing/decorators/when_running_in_test.js +4 -8
  81. package/esm/testing/decorators/when_running_in_text.ctx.d.ts +1 -2
  82. package/esm/testing/decorators/when_running_in_text.ctx.js +2 -2
  83. package/esm/types.d.ts +41 -0
  84. package/esm/types.js +0 -0
  85. package/esm/variants/index.d.ts +1 -0
  86. package/esm/variants/index.js +2 -0
  87. package/esm/variants/package.json +3 -0
  88. package/esm/variants/preset.d.ts +11 -0
  89. package/esm/variants/preset.js +1 -0
  90. package/package.json +54 -34
  91. package/readme.md +3 -3
  92. package/src/decorators/show_doc_source.tsx +30 -11
  93. package/src/index.ts +1 -0
  94. package/src/parameters/define_docs_param.ts +2 -2
  95. package/src/storybook-addon-tag-badges/tag_badges.ts +1 -1
  96. package/src/storybook-addon-tag-badges/types.ts +7 -6
  97. package/src/storybook-dark-mode/dark_mode_docs_container.tsx +2 -2
  98. package/src/storybook-dark-mode/define_dark_mode.ts +3 -3
  99. package/src/storybook-dark-mode/with_dark_mode.tsx +2 -14
  100. package/src/types.ts +51 -0
  101. package/src/variants/index.ts +3 -0
  102. package/src/variants/package.json +3 -0
  103. package/src/variants/preset.ts +22 -0
  104. package/src/overview.mdx +0 -7
  105. package/src/storybook-dark-mode/dark_mode_docs_container.mdx +0 -33
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withDarkMode = withDarkMode;
7
+ var _css = require("@just-web/css");
8
+ var _storybookDarkMode = require("@storybook-community/storybook-dark-mode");
9
+ function withDarkMode(options) {
10
+ return function darkModeDecorator(Story, {
11
+ parameters
12
+ }) {
13
+ const darkMode = parameters.darkMode;
14
+ if (!darkMode) return /* @__PURE__ */React.createElement(Story, null);
15
+ const dark = (0, _storybookDarkMode.useDarkMode)();
16
+ const target = darkMode.classTarget === "html" ? document.documentElement : document.body;
17
+ if (dark) {
18
+ removeStyle(target, darkMode.lightStyle);
19
+ addStyle(target, darkMode.darkStyle);
20
+ } else {
21
+ removeStyle(target, darkMode.darkStyle);
22
+ addStyle(target, darkMode.lightStyle);
23
+ }
24
+ if (options?.bodyClass) {
25
+ addClass(document.body, options.bodyClass);
26
+ }
27
+ if (options?.bodyStyle) {
28
+ addStyle(document.body, options.bodyStyle);
29
+ }
30
+ return /* @__PURE__ */React.createElement(Story, null);
31
+ };
32
+ }
33
+ function addClass(target, className) {
34
+ if (!className) return;
35
+ if (typeof className === "string") {
36
+ target.classList.add(...className.split(" "));
37
+ } else if (Array.isArray(className)) {
38
+ target.classList.add(...className);
39
+ }
40
+ }
41
+ function addStyle(target, style) {
42
+ if (style) {
43
+ for (const [key, value] of Object.entries((0, _css.toDOMStyle)(style))) {
44
+ target.style.setProperty(key, value);
45
+ }
46
+ }
47
+ }
48
+ function removeStyle(target, style) {
49
+ if (style) {
50
+ for (const key of Object.keys((0, _css.toDOMStyle)(style))) {
51
+ target.style.removeProperty(key);
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,5 @@
1
+ import type { Decorator, StrictArgs } from '@storybook/react-vite';
2
+ /**
3
+ * executes the specified decorator or handler if the code is running in test.
4
+ */
5
+ export declare function whenRunningInTest<TArgs = StrictArgs>(decoratorOrHandler: ((...args: Parameters<Decorator<TArgs>>) => ReturnType<Decorator<TArgs>> | undefined | void) | (() => ReturnType<Decorator<TArgs>> | undefined | void)): Decorator<TArgs>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.whenRunningInTest = whenRunningInTest;
7
+ var _when_running_in_textCtx = require("./when_running_in_text.ctx.ts");
8
+ function whenRunningInTest(decoratorOrHandler) {
9
+ return function RunInTest(Story, context) {
10
+ return _when_running_in_textCtx.ctx.isRunningInTest() ? decoratorOrHandler(Story, context) ?? /* @__PURE__ */React.createElement(Story, null) : /* @__PURE__ */React.createElement(Story, null);
11
+ };
12
+ }
@@ -0,0 +1,3 @@
1
+ export declare const ctx: {
2
+ isRunningInTest: any;
3
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ctx = void 0;
7
+ var _test = require("@repobuddy/test");
8
+ const ctx = exports.ctx = {
9
+ isRunningInTest: _test.isRunningInTest
10
+ };
package/cjs/types.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ /**
3
+ * Extends the Storybook Meta type with custom tag types
4
+ * @template TCmpOrArgs - The component or args type
5
+ * @template M - The base Meta type
6
+ * @template E - The extension type containing tagType
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // Create a generic Meta type for a project
11
+ * type Meta<TCmpOrArgs = Args> = ExtendMeta<TCmpOrArgs, Meta<TCmpOrArgs>, { tagType: 'tag1' | 'tag2' }>
12
+ *
13
+ * // Create a specific Meta type for a component
14
+ * type Meta = ExtendMeta<typeof Component, Meta<typeof Component>, { tagType: 'tag1' | 'tag2' }>
15
+ * ```
16
+ */
17
+ export type ExtendMeta<TCmpOrArgs, M extends Meta<TCmpOrArgs>, E extends {
18
+ tag: string;
19
+ }> = Omit<M, 'tags'> & {
20
+ tags?: Array<E['tag'] | (string & {})> | undefined;
21
+ };
22
+ /**
23
+ * Extends the Storybook StoryObj type with custom tag types
24
+ * @template TMetaOrCmpOrArgs - The meta, component or args type
25
+ * @template S - The base StoryObj type
26
+ * @template E - The extension type containing tagType
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * // Create a generic StoryObj type for a project
31
+ * type StoryObj<TMetaOrCmpOrArgs = Args> = ExtendStoryObj<TMetaOrCmpOrArgs, StoryObj<TMetaOrCmpOrArgs>, { tagType: 'tag1' | 'tag2' }>
32
+ *
33
+ * // Create a specific StoryObj type for a component
34
+ * type StoryObj = ExtendStoryObj<typeof Component, StoryObj<typeof Component>, { tagType: 'tag1' | 'tag2' }>
35
+ * ```
36
+ */
37
+ export type ExtendStoryObj<TMetaOrCmpOrArgs, S extends StoryObj<TMetaOrCmpOrArgs>, E extends {
38
+ tag: string;
39
+ }> = Omit<S, 'tags'> & {
40
+ tags?: Array<E['tag'] | (string & {})> | undefined;
41
+ };
package/cjs/types.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export declare const empty: {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.empty = void 0;
7
+ console.info("variants.index.ts.load");
8
+ const empty = exports.empty = {};
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * User specifies `@repobuddy/storybook/variants/addon` in the `.storybook/main.ts`.
3
+ *
4
+ * Storybook loads it on the server side.
5
+ *
6
+ * It provides a default export (or in CJS, `module.exports =`) that contains:
7
+ *
8
+ * - `managerEntries` a function that returns an array of strings on where to load the manager (on the client side)
9
+ * - `previewAnnotations` a function that returns an array of strings on where to load the preview (on the client side)
10
+ * - `experimental_serverChannel` a function that handles the server-side channel
11
+ */
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ console.info("variants.preset.js.load");
@@ -13,4 +13,4 @@ export type ShowHtmlProps = ClassNameProps & StyleProps & {
13
13
  * @param props - Additional props (className, style) passed to the pre element
14
14
  * @returns A pre element containing the formatted HTML
15
15
  */
16
- export declare function ShowHtml({ selector, config, ...props }: ShowHtmlProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function ShowHtml({ selector, config, ...props }: ShowHtmlProps): import("react").JSX.Element;
@@ -1,28 +1,19 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { prettify } from 'htmlfy';
3
- import { useEffect, useState } from 'react';
4
- /**
5
- * A component that displays the HTML of a subject element.
6
- * Uses `htmlfy` internally to format and prettify the HTML output.
7
- *
8
- * @param selector - CSS selector to find the subject element. Defaults to '[data-testid="subject"]'
9
- * @param config - Configuration options passed to htmlfy's prettify function
10
- * @param props - Additional props (className, style) passed to the pre element
11
- * @returns A pre element containing the formatted HTML
12
- */
1
+ import { prettify } from "htmlfy";
2
+ import { useEffect, useState } from "react";
13
3
  export function ShowHtml({ selector = '[data-testid="subject"]', config, ...props }) {
14
- const [html, setHtml] = useState('');
15
- useEffect(() => {
16
- const subject = document.querySelector(selector);
17
- if (subject) {
18
- setHtml(prettify(subject.outerHTML, {
19
- tag_wrap: 40,
20
- ...config
21
- }));
22
- }
23
- else {
24
- setHtml('No subject found');
25
- }
26
- }, [selector]);
27
- return _jsx("pre", { ...props, children: html });
4
+ const [html, setHtml] = useState("");
5
+ useEffect(() => {
6
+ const subject = document.querySelector(selector);
7
+ if (subject) {
8
+ setHtml(
9
+ prettify(subject.outerHTML, {
10
+ tag_wrap: 40,
11
+ ...config
12
+ })
13
+ );
14
+ } else {
15
+ setHtml("No subject found");
16
+ }
17
+ }, [selector]);
18
+ return /* @__PURE__ */ React.createElement("pre", { ...props }, html);
28
19
  }
@@ -1,14 +1,28 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * A decorator that shows the source code of a story above the rendered story.
4
- * The source code is taken from the story's `parameters.docs.source.code`.
5
- */
1
+ import { useEffect, useState } from "react";
2
+ import { SyntaxHighlighter } from "storybook/internal/components";
3
+ import { addons } from "storybook/preview-api";
4
+ import { convert, ThemeProvider, themes } from "storybook/theming";
5
+ const channel = addons.getChannel();
6
6
  export function showDocSource() {
7
- return (Story, { parameters }) => {
8
- return (_jsxs("section", { style: {
9
- display: 'flex',
10
- flexDirection: 'column',
11
- gap: '1rem'
12
- }, children: [_jsx("pre", { children: parameters.docs?.source?.code }), _jsx(Story, {})] }));
13
- };
7
+ return (Story, { parameters: { docs, darkMode } }) => {
8
+ const storedItem = window.localStorage.getItem("sb-addon-themes-3");
9
+ const current = typeof storedItem === "string" ? JSON.parse(storedItem).current : darkMode?.current;
10
+ const [isDark, setIsDark] = useState((darkMode?.stylePreview && current === "dark") ?? false);
11
+ useEffect(() => {
12
+ channel.on("DARK_MODE", setIsDark);
13
+ return () => channel.off("DARK_MODE", setIsDark);
14
+ }, []);
15
+ return /* @__PURE__ */ React.createElement(ThemeProvider, { theme: convert(docs?.theme ?? (isDark ? themes.dark : themes.light)) }, /* @__PURE__ */ React.createElement(
16
+ "section",
17
+ {
18
+ style: {
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ gap: "1rem"
22
+ }
23
+ },
24
+ /* @__PURE__ */ React.createElement(SyntaxHighlighter, { language: docs?.source?.language }, docs?.source?.code),
25
+ /* @__PURE__ */ React.createElement(Story, null)
26
+ ));
27
+ };
14
28
  }
package/esm/index.d.ts CHANGED
@@ -10,3 +10,4 @@ export * from './parameters/define_test_param.ts';
10
10
  export * from './parameters/define_viewport_param.ts';
11
11
  export * from './parameters/story_sort.ts';
12
12
  export * from './testing/decorators/when_running_in_test.tsx';
13
+ export type * from './types.ts';
package/esm/index.js CHANGED
@@ -1,12 +1,12 @@
1
- export * from '@repobuddy/test';
2
- export * from "./components/show_html.js";
3
- export * from "./decorators/show_doc_source.js";
4
- export * from "./parameters/define_actions_param.js";
5
- export * from "./parameters/define_backgrounds_param.js";
6
- export * from "./parameters/define_docs_param.js";
7
- export * from "./parameters/define_layout_param.js";
8
- export * from "./parameters/define_parameters.js";
9
- export * from "./parameters/define_test_param.js";
10
- export * from "./parameters/define_viewport_param.js";
11
- export * from "./parameters/story_sort.js";
12
- export * from "./testing/decorators/when_running_in_test.js";
1
+ export * from "@repobuddy/test";
2
+ export * from "./components/show_html.tsx";
3
+ export * from "./decorators/show_doc_source.tsx";
4
+ export * from "./parameters/define_actions_param.ts";
5
+ export * from "./parameters/define_backgrounds_param.ts";
6
+ export * from "./parameters/define_docs_param.ts";
7
+ export * from "./parameters/define_layout_param.ts";
8
+ export * from "./parameters/define_parameters.ts";
9
+ export * from "./parameters/define_test_param.ts";
10
+ export * from "./parameters/define_viewport_param.ts";
11
+ export * from "./parameters/story_sort.ts";
12
+ export * from "./testing/decorators/when_running_in_test.tsx";
@@ -1,28 +1,6 @@
1
- /**
2
- * Creates a brand title element for the Storybook manager UI.
3
- *
4
- * @param options - The options for customizing the brand title
5
- * @param options.title - The title text or HTML to display
6
- * @param options.logo - Optional logo HTML to display before the title
7
- * @returns An HTML string containing the brand title element
8
- *
9
- * @example
10
- *
11
- * ```ts
12
- * import { brandTitle } from '@repobuddy/storybook'
13
- * import { addons } from 'storybook/manager-api'
14
- *
15
- * addons.setConfig({
16
- * brandTitle: brandTitle({
17
- * title: 'My Storybook',
18
- * logo: '<img src="logo.png" alt="Logo" width="24" height="24">'
19
- * })
20
- * })
21
- * ```
22
- */
23
1
  export function brandTitle(options) {
24
- return `<span style="display: flex; align-items: center; gap: 2px;">
25
- ${options.logo ?? ''}
2
+ return `<span style="display: flex; align-items: center; gap: 2px;">
3
+ ${options.logo ?? ""}
26
4
  ${options.title}
27
5
  </span>`;
28
6
  }
@@ -1 +1 @@
1
- export * from "./brand_title.js";
1
+ export * from "./brand_title.ts";
@@ -1,11 +1,3 @@
1
- /**
2
- * Defines actions parameters for Storybook stories.
3
- *
4
- * @see https://storybook.js.org/docs/essentials/actions#parameters
5
- *
6
- * @param actions - Configuration for actions parameters
7
- * @returns An object containing the actions parameter configuration
8
- */
9
1
  export function defineActionsParam(actions) {
10
- return { actions };
2
+ return { actions };
11
3
  }
@@ -1,9 +1,3 @@
1
- /**
2
- * Defines backgrounds parameters for Storybook stories.
3
- *
4
- * @param backgrounds - The backgrounds configuration
5
- * @returns An object containing the backgrounds parameter configuration
6
- */
7
1
  export const defineBackgroundsParam = (backgrounds) => ({
8
- backgrounds
2
+ backgrounds
9
3
  });
@@ -88,12 +88,12 @@ export interface DocsParam {
88
88
  /**
89
89
  * `docs.description.story` can be used to describe the story in doc.
90
90
  */
91
- story?: string | JSX.Element | undefined;
91
+ story?: string | undefined;
92
92
  /**
93
93
  * `docs.description.component` can be used to describe the component in meta.
94
94
  * It has no effect on the stories.
95
95
  */
96
- component?: string | JSX.Element | undefined;
96
+ component?: string | undefined;
97
97
  } | undefined;
98
98
  /**
99
99
  * Determines whether to show the code panel.
@@ -1,30 +1,3 @@
1
- /**
2
- * Defines docs parameters for Storybook stories.
3
- *
4
- * @param docs - Configuration for docs parameters including options for:
5
- * - Controls display and sorting
6
- * - Story rendering (autoplay, height, inline vs iframe)
7
- * - And other docs-related settings
8
- * @returns An object containing the docs parameter configuration
9
- *
10
- * @example
11
- * ```ts
12
- * import { defineDocsParam } from '@repobuddy/storybook'
13
- *
14
- * export default {
15
- * parameters: defineDocsParam({
16
- * controls: {
17
- * sort: 'alpha',
18
- * exclude: ['internal*']
19
- * },
20
- * story: {
21
- * inline: true,
22
- * height: '400px'
23
- * }
24
- * })
25
- * }
26
- * ```
27
- */
28
1
  export function defineDocsParam(docs) {
29
- return { docs };
2
+ return { docs };
30
3
  }
@@ -1,17 +1,3 @@
1
- /**
2
- * Helper function to define the layout parameter for a story
3
- *
4
- * @see https://storybook.js.org/docs/api/parameters#layout
5
- *
6
- * @param layout - The layout type to use ('padded', 'fullscreen', or 'centered')
7
- * @returns An object containing the layout parameter
8
- * @example
9
- * ```ts
10
- * export const MyStory = {
11
- * parameters: defineLayoutParam('centered')
12
- * }
13
- * ```
14
- */
15
1
  export const defineLayoutParam = (layout) => ({
16
- layout
2
+ layout
17
3
  });
@@ -36,4 +36,4 @@ export type StorybookBuiltInParams = Partial<BackgroundsParam | GlobalApiBackgro
36
36
  * }
37
37
  * ```
38
38
  */
39
- export declare function defineParameters<P extends Record<string, any>>(param: P & StorybookBuiltInParams, ...rest: Array<StorybookBuiltInParams>): StorybookBuiltInParams;
39
+ export declare function defineParameters<P extends Record<string, any>>(param: P & StorybookBuiltInParams, ...rest: Array<StorybookBuiltInParams>): any;
@@ -1,32 +1,3 @@
1
- /**
2
- * Defines parameters for Storybook stories, combining built-in parameters with custom ones.
3
- *
4
- * @param parameters - Configuration object containing both built-in Storybook parameters and custom parameters
5
- * @returns The combined parameters object
6
- *
7
- * @example
8
- * ```ts
9
- * import { defineParameters } from '@repobuddy/storybook'
10
- *
11
- * export default {
12
- * parameters: defineParameters({
13
- * // Built-in parameters
14
- * layout: 'centered',
15
- * backgrounds: {
16
- * default: 'light',
17
- * values: [
18
- * { name: 'light', value: '#ffffff' },
19
- * { name: 'dark', value: '#333333' }
20
- * ]
21
- * },
22
- * // Custom parameters
23
- * myCustomParam: {
24
- * someValue: true
25
- * }
26
- * })
27
- * }
28
- * ```
29
- */
30
1
  export function defineParameters(param, ...rest) {
31
- return rest.reduce((acc, param) => Object.assign(acc, param), param);
2
+ return rest.reduce((acc, param2) => Object.assign(acc, param2), param);
32
3
  }
@@ -1,19 +1,3 @@
1
- /**
2
- * Defines test parameters for Storybook stories.
3
- *
4
- * @see https://storybook.js.org/docs/api/parameters#test
5
- *
6
- * @param test - Configuration for test parameters
7
- * @returns An object containing the test parameter configuration
8
- *
9
- * @example
10
- * defineTestParam({
11
- * clearMocks: true,
12
- * mockReset: true,
13
- * restoreMocks: true,
14
- * dangerouslyIgnoreUnhandledErrors: true
15
- * })
16
- */
17
1
  export function defineTestParam(test) {
18
- return { test };
2
+ return { test };
19
3
  }
@@ -1,30 +1,3 @@
1
- /**
2
- * Defines viewport parameters for Storybook stories.
3
- *
4
- * @see https://storybook.js.org/docs/api/parameters#viewport
5
- *
6
- * @param viewport - Configuration for viewport parameters including:
7
- * - viewports: Custom viewport definitions
8
- * - defaultViewport: The default viewport to use
9
- * - defaultOrientation: Default orientation (landscape/portrait)
10
- * - disabled: Whether viewport controls are disabled
11
- * @returns An object containing the viewport parameter configuration
12
- *
13
- * @example
14
- * ```ts
15
- * defineViewportParam({
16
- * viewports: {
17
- * mobile: {
18
- * name: 'Mobile',
19
- * styles: { width: '320px', height: '568px' },
20
- * type: 'mobile'
21
- * }
22
- * },
23
- * defaultViewport: 'mobile',
24
- * defaultOrientation: 'portrait'
25
- * })
26
- * ```
27
- */
28
1
  export function defineViewportParam(viewport) {
29
- return { viewport };
2
+ return { viewport };
30
3
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +1 @@
1
- export * from "./tag_badges.js";
1
+ export * from "./tag_badges.ts";
@@ -1,4 +1,4 @@
1
- import { type TagBadgeParameters } from 'storybook-addon-tag-badges';
1
+ import { type TagBadgeParameters } from 'storybook-addon-tag-badges/manager-helpers';
2
2
  type TagBadgeParameter = TagBadgeParameters[0];
3
3
  /**
4
4
  * Type representing the names of predefined tags used in Storybook stories.