@repobuddy/storybook 2.0.1 → 2.1.1
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/esm/index.d.ts +574 -13
- package/esm/index.js +251 -12
- package/esm/manager/index.d.ts +38 -1
- package/esm/manager/index.js +32 -1
- package/esm/storybook-addon-tag-badges/index.d.ts +95 -2
- package/esm/storybook-addon-tag-badges/index.js +207 -1
- package/esm/storybook-dark-mode/index.d.ts +110 -3
- package/esm/storybook-dark-mode/index.js +102 -3
- package/package.json +4 -12
- package/cjs/components/show_html.d.ts +0 -16
- package/cjs/components/show_html.js +0 -29
- package/cjs/decorators/show_doc_source.d.ts +0 -6
- package/cjs/decorators/show_doc_source.js +0 -38
- package/cjs/index.d.ts +0 -13
- package/cjs/index.js +0 -137
- package/cjs/manager/brand_title.d.ts +0 -35
- package/cjs/manager/brand_title.js +0 -12
- package/cjs/manager/index.d.ts +0 -1
- package/cjs/manager/index.js +0 -16
- package/cjs/parameters/define_actions_param.d.ts +0 -24
- package/cjs/parameters/define_actions_param.js +0 -11
- package/cjs/parameters/define_backgrounds_param.d.ts +0 -45
- package/cjs/parameters/define_backgrounds_param.js +0 -10
- package/cjs/parameters/define_docs_param.d.ts +0 -217
- package/cjs/parameters/define_docs_param.js +0 -11
- package/cjs/parameters/define_layout_param.d.ts +0 -20
- package/cjs/parameters/define_layout_param.js +0 -10
- package/cjs/parameters/define_parameters.d.ts +0 -39
- package/cjs/parameters/define_parameters.js +0 -9
- package/cjs/parameters/define_test_param.d.ts +0 -34
- package/cjs/parameters/define_test_param.js +0 -11
- package/cjs/parameters/define_viewport_param.d.ts +0 -78
- package/cjs/parameters/define_viewport_param.js +0 -11
- package/cjs/parameters/story_sort.d.ts +0 -27
- package/cjs/parameters/story_sort.js +0 -1
- package/cjs/storybook-addon-tag-badges/index.d.ts +0 -2
- package/cjs/storybook-addon-tag-badges/index.js +0 -16
- package/cjs/storybook-addon-tag-badges/tag_badges.d.ts +0 -41
- package/cjs/storybook-addon-tag-badges/tag_badges.js +0 -179
- package/cjs/storybook-addon-tag-badges/types.d.ts +0 -9
- package/cjs/storybook-addon-tag-badges/types.js +0 -1
- package/cjs/storybook-dark-mode/dark_mode_docs_container.d.ts +0 -26
- package/cjs/storybook-dark-mode/dark_mode_docs_container.js +0 -23
- package/cjs/storybook-dark-mode/define_dark_mode.d.ts +0 -54
- package/cjs/storybook-dark-mode/define_dark_mode.js +0 -11
- package/cjs/storybook-dark-mode/index.d.ts +0 -3
- package/cjs/storybook-dark-mode/index.js +0 -38
- package/cjs/storybook-dark-mode/with_dark_mode.d.ts +0 -22
- package/cjs/storybook-dark-mode/with_dark_mode.js +0 -54
- package/cjs/testing/decorators/when_running_in_test.d.ts +0 -5
- package/cjs/testing/decorators/when_running_in_test.js +0 -12
- package/cjs/testing/decorators/when_running_in_text.ctx.d.ts +0 -3
- package/cjs/testing/decorators/when_running_in_text.ctx.js +0 -10
- package/cjs/types.d.ts +0 -41
- package/cjs/types.js +0 -1
- package/cjs/variants/index.d.ts +0 -1
- package/cjs/variants/index.js +0 -8
- package/cjs/variants/package.json +0 -3
- package/cjs/variants/preset.d.ts +0 -11
- package/cjs/variants/preset.js +0 -3
- package/esm/components/show_html.d.ts +0 -16
- package/esm/components/show_html.js +0 -19
- package/esm/decorators/show_doc_source.d.ts +0 -6
- package/esm/decorators/show_doc_source.js +0 -28
- package/esm/manager/brand_title.d.ts +0 -35
- package/esm/manager/brand_title.js +0 -6
- package/esm/parameters/define_actions_param.d.ts +0 -24
- package/esm/parameters/define_actions_param.js +0 -3
- package/esm/parameters/define_backgrounds_param.d.ts +0 -45
- package/esm/parameters/define_backgrounds_param.js +0 -3
- package/esm/parameters/define_docs_param.d.ts +0 -217
- package/esm/parameters/define_docs_param.js +0 -3
- package/esm/parameters/define_layout_param.d.ts +0 -20
- package/esm/parameters/define_layout_param.js +0 -3
- package/esm/parameters/define_parameters.d.ts +0 -39
- package/esm/parameters/define_parameters.js +0 -3
- package/esm/parameters/define_test_param.d.ts +0 -34
- package/esm/parameters/define_test_param.js +0 -3
- package/esm/parameters/define_viewport_param.d.ts +0 -78
- package/esm/parameters/define_viewport_param.js +0 -3
- package/esm/parameters/story_sort.d.ts +0 -27
- package/esm/parameters/story_sort.js +0 -0
- package/esm/storybook-addon-tag-badges/tag_badges.d.ts +0 -41
- package/esm/storybook-addon-tag-badges/tag_badges.js +0 -189
- package/esm/storybook-addon-tag-badges/types.d.ts +0 -9
- package/esm/storybook-addon-tag-badges/types.js +0 -0
- package/esm/storybook-dark-mode/dark_mode_docs_container.d.ts +0 -26
- package/esm/storybook-dark-mode/dark_mode_docs_container.js +0 -21
- package/esm/storybook-dark-mode/define_dark_mode.d.ts +0 -54
- package/esm/storybook-dark-mode/define_dark_mode.js +0 -3
- package/esm/storybook-dark-mode/with_dark_mode.d.ts +0 -22
- package/esm/storybook-dark-mode/with_dark_mode.js +0 -46
- package/esm/testing/decorators/when_running_in_test.d.ts +0 -5
- package/esm/testing/decorators/when_running_in_test.js +0 -6
- package/esm/testing/decorators/when_running_in_text.ctx.d.ts +0 -3
- package/esm/testing/decorators/when_running_in_text.ctx.js +0 -4
- package/esm/types.d.ts +0 -41
- package/esm/types.js +0 -0
- package/esm/variants/index.d.ts +0 -1
- package/esm/variants/index.js +0 -2
- package/esm/variants/package.json +0 -3
- package/esm/variants/preset.d.ts +0 -11
- package/esm/variants/preset.js +0 -1
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import type { StoryContext } from '@storybook/react-vite';
|
|
2
|
-
declare global {
|
|
3
|
-
namespace JSX {
|
|
4
|
-
interface Element {
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export interface SourceProps {
|
|
9
|
-
/**
|
|
10
|
-
* Provides the source code to be rendered.
|
|
11
|
-
*
|
|
12
|
-
* This is useful when the story contains extra code that would be confusing in the docs.
|
|
13
|
-
*
|
|
14
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source#code
|
|
15
|
-
*/
|
|
16
|
-
code?: string | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* Specifies whether the source code should be rendered in dark mode.
|
|
19
|
-
*
|
|
20
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source#dark
|
|
21
|
-
*/
|
|
22
|
-
dark?: boolean | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Specifies whether decorators should be excluded from the source code.
|
|
25
|
-
*
|
|
26
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source#excludedecorators
|
|
27
|
-
*
|
|
28
|
-
* Note: Has no effect in React.
|
|
29
|
-
* @see https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#parameter-docssourceexcludedecorators-has-no-effect-in-react
|
|
30
|
-
*/
|
|
31
|
-
excludeDecorators?: boolean | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Specifies the language of the source code.
|
|
34
|
-
*
|
|
35
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source#language
|
|
36
|
-
*/
|
|
37
|
-
language?: string | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* A function to dynamically transform the source before being rendered,
|
|
40
|
-
* based on the original source and any story context necessary.
|
|
41
|
-
* The returned string is displayed as-is.
|
|
42
|
-
*
|
|
43
|
-
* If both code and transform are specified, transform will be ignored.
|
|
44
|
-
*
|
|
45
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source#transform
|
|
46
|
-
*/
|
|
47
|
-
transform?: ((code: string, storyContext: StoryContext) => string) | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Specifies how the source code is rendered.
|
|
50
|
-
*
|
|
51
|
-
* - auto: Same as dynamic, if the story's render function accepts args inputs and dynamic is supported by the framework in use; otherwise same as code
|
|
52
|
-
* - code: Renders the value of code prop, otherwise renders static story source
|
|
53
|
-
* - dynamic: Renders the story source with dynamically updated arg values
|
|
54
|
-
*
|
|
55
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source#type
|
|
56
|
-
*/
|
|
57
|
-
type?: 'auto' | 'code' | 'dynamic' | undefined;
|
|
58
|
-
}
|
|
59
|
-
export interface DocsParam {
|
|
60
|
-
docs: {
|
|
61
|
-
argTypes?: {
|
|
62
|
-
/**
|
|
63
|
-
* Specifies which controls to exclude from the args table.
|
|
64
|
-
* Any controls whose names match the regex or are part of the array will be left out.
|
|
65
|
-
*
|
|
66
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-argtypes#exclude
|
|
67
|
-
*/
|
|
68
|
-
exclude?: string[] | RegExp | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* Specifies which controls to include in the args table.
|
|
71
|
-
* Any controls whose names don't match the regex or are not part of the array will be left out.
|
|
72
|
-
*
|
|
73
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-argtypes#include
|
|
74
|
-
*/
|
|
75
|
-
include?: string[] | RegExp | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Specifies how the arg types are sorted.
|
|
78
|
-
*
|
|
79
|
-
* - none: Unsorted, displayed in the same order the arg types are processed in
|
|
80
|
-
* - alpha: Sorted alphabetically, by the arg type's name
|
|
81
|
-
* - requiredFirst: Same as alpha, with any required arg types displayed first
|
|
82
|
-
*
|
|
83
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-argtypes#sort
|
|
84
|
-
*/
|
|
85
|
-
sort?: 'alpha' | 'requiredFirst' | 'none' | undefined;
|
|
86
|
-
} | undefined;
|
|
87
|
-
description?: {
|
|
88
|
-
/**
|
|
89
|
-
* `docs.description.story` can be used to describe the story in doc.
|
|
90
|
-
*/
|
|
91
|
-
story?: string | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* `docs.description.component` can be used to describe the component in meta.
|
|
94
|
-
* It has no effect on the stories.
|
|
95
|
-
*/
|
|
96
|
-
component?: string | undefined;
|
|
97
|
-
} | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* Determines whether to show the code panel.
|
|
100
|
-
*
|
|
101
|
-
* @see https://storybook.js.org/docs/writing-docs/code-panel
|
|
102
|
-
*/
|
|
103
|
-
codePanel?: boolean | undefined;
|
|
104
|
-
source?: SourceProps | undefined;
|
|
105
|
-
canvas?: {
|
|
106
|
-
/**
|
|
107
|
-
* Provides any additional custom actions to show in the bottom right corner.
|
|
108
|
-
* These are simple buttons that do anything you specify in the onClick function.
|
|
109
|
-
*
|
|
110
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-canvas#additionalactions
|
|
111
|
-
*/
|
|
112
|
-
additionalActions?: Array<{
|
|
113
|
-
title: string | JSX.Element;
|
|
114
|
-
className?: string;
|
|
115
|
-
onClick: () => void;
|
|
116
|
-
disabled?: boolean;
|
|
117
|
-
}> | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* Provides HTML class(es) to the preview element, for custom styling.
|
|
120
|
-
*
|
|
121
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-canvas#classname
|
|
122
|
-
*/
|
|
123
|
-
className?: string | undefined;
|
|
124
|
-
/**
|
|
125
|
-
* Specifies how the canvas should layout the story.
|
|
126
|
-
*
|
|
127
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-canvas#layout
|
|
128
|
-
*/
|
|
129
|
-
layout?: 'centered' | 'padded' | 'fullscreen' | undefined;
|
|
130
|
-
/**
|
|
131
|
-
* Specifies the initial state of the source panel.
|
|
132
|
-
*
|
|
133
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-canvas#sourcestate
|
|
134
|
-
*/
|
|
135
|
-
sourceState?: 'hidden' | 'shown' | 'none' | undefined;
|
|
136
|
-
/**
|
|
137
|
-
* Determines whether to render a toolbar containing tools to interact with the story.
|
|
138
|
-
*
|
|
139
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-canvas#withtoolbar
|
|
140
|
-
*/
|
|
141
|
-
withToolbar?: boolean | undefined;
|
|
142
|
-
} | undefined;
|
|
143
|
-
controls?: {
|
|
144
|
-
/**
|
|
145
|
-
* Specifies which controls to exclude from the args table.
|
|
146
|
-
* Any controls whose names match the regex or are part of the array will be left out.
|
|
147
|
-
*
|
|
148
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-controls#exclude
|
|
149
|
-
*/
|
|
150
|
-
exclude?: string[] | RegExp | undefined;
|
|
151
|
-
/**
|
|
152
|
-
* Specifies which controls to include in the args table.
|
|
153
|
-
* Any controls whose names don't match the regex or are not part of the array will be left out.
|
|
154
|
-
*
|
|
155
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-controls#include
|
|
156
|
-
*/
|
|
157
|
-
include?: string[] | RegExp | undefined;
|
|
158
|
-
/**
|
|
159
|
-
*
|
|
160
|
-
* Specifies how the controls are sorted.
|
|
161
|
-
*
|
|
162
|
-
* - none: Unsorted, displayed in the same order the controls are processed in
|
|
163
|
-
* - alpha: Sorted alphabetically, by the arg type's name
|
|
164
|
-
* - requiredFirst: Same as alpha, with any required controls displayed first
|
|
165
|
-
*
|
|
166
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-controls#sort
|
|
167
|
-
*/
|
|
168
|
-
sort?: 'alpha' | 'requiredFirst' | 'none' | undefined;
|
|
169
|
-
} | undefined;
|
|
170
|
-
story?: {
|
|
171
|
-
/**
|
|
172
|
-
* Specifies whether the story should be autoplayed.
|
|
173
|
-
*
|
|
174
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-story#autoplay
|
|
175
|
-
*/
|
|
176
|
-
autoplay?: boolean | undefined;
|
|
177
|
-
/**
|
|
178
|
-
* Set a minimum height (note for an iframe this is the actual height) when rendering a story in an iframe or inline.
|
|
179
|
-
* This overrides parameters.docs.story.iframeHeight for iframes.
|
|
180
|
-
*/
|
|
181
|
-
height?: string | undefined;
|
|
182
|
-
/**
|
|
183
|
-
* Determines whether the story is rendered inline (in the same browser frame as the other docs content) or in an iframe.
|
|
184
|
-
*/
|
|
185
|
-
inline?: boolean | undefined;
|
|
186
|
-
} | undefined;
|
|
187
|
-
[k: string]: unknown;
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Defines docs parameters for Storybook stories.
|
|
192
|
-
*
|
|
193
|
-
* @param docs - Configuration for docs parameters including options for:
|
|
194
|
-
* - Controls display and sorting
|
|
195
|
-
* - Story rendering (autoplay, height, inline vs iframe)
|
|
196
|
-
* - And other docs-related settings
|
|
197
|
-
* @returns An object containing the docs parameter configuration
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```ts
|
|
201
|
-
* import { defineDocsParam } from '@repobuddy/storybook'
|
|
202
|
-
*
|
|
203
|
-
* export default {
|
|
204
|
-
* parameters: defineDocsParam({
|
|
205
|
-
* controls: {
|
|
206
|
-
* sort: 'alpha',
|
|
207
|
-
* exclude: ['internal*']
|
|
208
|
-
* },
|
|
209
|
-
* story: {
|
|
210
|
-
* inline: true,
|
|
211
|
-
* height: '400px'
|
|
212
|
-
* }
|
|
213
|
-
* })
|
|
214
|
-
* }
|
|
215
|
-
* ```
|
|
216
|
-
*/
|
|
217
|
-
export declare function defineDocsParam(docs: DocsParam['docs']): DocsParam['docs'];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface LayoutParam {
|
|
2
|
-
layout: 'padded' | 'fullscreen' | 'centered';
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Helper function to define the layout parameter for a story
|
|
6
|
-
*
|
|
7
|
-
* @see https://storybook.js.org/docs/api/parameters#layout
|
|
8
|
-
*
|
|
9
|
-
* @param layout - The layout type to use ('padded', 'fullscreen', or 'centered')
|
|
10
|
-
* @returns An object containing the layout parameter
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* export const MyStory = {
|
|
14
|
-
* parameters: defineLayoutParam('centered')
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare const defineLayoutParam: (layout: LayoutParam["layout"]) => {
|
|
19
|
-
layout: "centered" | "padded" | "fullscreen";
|
|
20
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { BackgroundsParam, GlobalApiBackgroundsParam } from './define_backgrounds_param.js';
|
|
2
|
-
import type { DocsParam } from './define_docs_param.js';
|
|
3
|
-
import type { LayoutParam } from './define_layout_param.js';
|
|
4
|
-
import type { TestParam } from './define_test_param.js';
|
|
5
|
-
import type { ViewportParam } from './define_viewport_param.js';
|
|
6
|
-
import type { StorySortParam } from './story_sort.js';
|
|
7
|
-
export type StorybookBuiltInParams = Partial<BackgroundsParam | GlobalApiBackgroundsParam> & Partial<DocsParam> & Partial<LayoutParam> & Partial<TestParam> & Partial<ViewportParam> & {
|
|
8
|
-
options?: StorySortParam & Record<string, any>;
|
|
9
|
-
} & Record<string, any>;
|
|
10
|
-
/**
|
|
11
|
-
* Defines parameters for Storybook stories, combining built-in parameters with custom ones.
|
|
12
|
-
*
|
|
13
|
-
* @param parameters - Configuration object containing both built-in Storybook parameters and custom parameters
|
|
14
|
-
* @returns The combined parameters object
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* import { defineParameters } from '@repobuddy/storybook'
|
|
19
|
-
*
|
|
20
|
-
* export default {
|
|
21
|
-
* parameters: defineParameters({
|
|
22
|
-
* // Built-in parameters
|
|
23
|
-
* layout: 'centered',
|
|
24
|
-
* backgrounds: {
|
|
25
|
-
* default: 'light',
|
|
26
|
-
* values: [
|
|
27
|
-
* { name: 'light', value: '#ffffff' },
|
|
28
|
-
* { name: 'dark', value: '#333333' }
|
|
29
|
-
* ]
|
|
30
|
-
* },
|
|
31
|
-
* // Custom parameters
|
|
32
|
-
* myCustomParam: {
|
|
33
|
-
* someValue: true
|
|
34
|
-
* }
|
|
35
|
-
* })
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare function defineParameters<P extends Record<string, any>>(param: P & StorybookBuiltInParams, ...rest: Array<StorybookBuiltInParams>): any;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface TestParam {
|
|
2
|
-
test: {
|
|
3
|
-
clearMocks?: boolean | undefined;
|
|
4
|
-
mockReset?: boolean | undefined;
|
|
5
|
-
restoreMocks?: boolean | undefined;
|
|
6
|
-
dangerouslyIgnoreUnhandledErrors?: boolean | undefined;
|
|
7
|
-
[k: string]: unknown;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Defines test parameters for Storybook stories.
|
|
12
|
-
*
|
|
13
|
-
* @see https://storybook.js.org/docs/api/parameters#test
|
|
14
|
-
*
|
|
15
|
-
* @param test - Configuration for test parameters
|
|
16
|
-
* @returns An object containing the test parameter configuration
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* defineTestParam({
|
|
20
|
-
* clearMocks: true,
|
|
21
|
-
* mockReset: true,
|
|
22
|
-
* restoreMocks: true,
|
|
23
|
-
* dangerouslyIgnoreUnhandledErrors: true
|
|
24
|
-
* })
|
|
25
|
-
*/
|
|
26
|
-
export declare function defineTestParam(test: TestParam['test']): {
|
|
27
|
-
test: {
|
|
28
|
-
[k: string]: unknown;
|
|
29
|
-
clearMocks?: boolean | undefined;
|
|
30
|
-
mockReset?: boolean | undefined;
|
|
31
|
-
restoreMocks?: boolean | undefined;
|
|
32
|
-
dangerouslyIgnoreUnhandledErrors?: boolean | undefined;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
export interface ViewportParam {
|
|
2
|
-
viewport: {
|
|
3
|
-
/**
|
|
4
|
-
* @see https://storybook.js.org/docs/essentials/viewport#viewports
|
|
5
|
-
*/
|
|
6
|
-
viewports?: Record<string, Viewport> | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* @see https://storybook.js.org/docs/essentials/viewport#defaultorientation
|
|
9
|
-
*/
|
|
10
|
-
defaultOrientation?: 'landscape' | 'portrait' | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* @see https://storybook.js.org/docs/essentials/viewport#defaultviewport
|
|
13
|
-
*/
|
|
14
|
-
defaultViewport?: string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Disables the viewport parameter.
|
|
17
|
-
* @deprecated Use `disabled` instead.
|
|
18
|
-
*/
|
|
19
|
-
disable?: boolean | undefined;
|
|
20
|
-
[k: string]: unknown;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface Viewport {
|
|
24
|
-
name: string;
|
|
25
|
-
styles: {
|
|
26
|
-
width: string;
|
|
27
|
-
height: string;
|
|
28
|
-
};
|
|
29
|
-
type: 'mobile' | 'tablet' | 'desktop';
|
|
30
|
-
}
|
|
31
|
-
export interface GlobalApiViewportParam {
|
|
32
|
-
viewport: {
|
|
33
|
-
/**
|
|
34
|
-
* @see https://storybook.js.org/docs/essentials/viewport#viewports
|
|
35
|
-
*/
|
|
36
|
-
options?: Record<string, Viewport> | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* @see https://storybook.js.org/docs/essentials/viewport#defaultviewport
|
|
39
|
-
*/
|
|
40
|
-
defaultViewport?: string | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* @see https://storybook.js.org/docs/essentials/viewport#defaultorientation
|
|
43
|
-
*/
|
|
44
|
-
defaultOrientation?: 'landscape' | 'portrait' | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* @see https://storybook.js.org/docs/essentials/viewport#disable
|
|
47
|
-
*/
|
|
48
|
-
disabled?: boolean | undefined;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Defines viewport parameters for Storybook stories.
|
|
53
|
-
*
|
|
54
|
-
* @see https://storybook.js.org/docs/api/parameters#viewport
|
|
55
|
-
*
|
|
56
|
-
* @param viewport - Configuration for viewport parameters including:
|
|
57
|
-
* - viewports: Custom viewport definitions
|
|
58
|
-
* - defaultViewport: The default viewport to use
|
|
59
|
-
* - defaultOrientation: Default orientation (landscape/portrait)
|
|
60
|
-
* - disabled: Whether viewport controls are disabled
|
|
61
|
-
* @returns An object containing the viewport parameter configuration
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```ts
|
|
65
|
-
* defineViewportParam({
|
|
66
|
-
* viewports: {
|
|
67
|
-
* mobile: {
|
|
68
|
-
* name: 'Mobile',
|
|
69
|
-
* styles: { width: '320px', height: '568px' },
|
|
70
|
-
* type: 'mobile'
|
|
71
|
-
* }
|
|
72
|
-
* },
|
|
73
|
-
* defaultViewport: 'mobile',
|
|
74
|
-
* defaultOrientation: 'portrait'
|
|
75
|
-
* })
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export declare function defineViewportParam(viewport: ViewportParam['viewport'] | GlobalApiViewportParam['viewport']): ViewportParam;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
type StorySortConfig = {
|
|
2
|
-
includeNames?: boolean;
|
|
3
|
-
locales?: string;
|
|
4
|
-
method?: 'alphabetical' | 'alphabetical-by-kind' | 'custom';
|
|
5
|
-
order?: string[];
|
|
6
|
-
[k: string]: unknown;
|
|
7
|
-
};
|
|
8
|
-
type Story = {
|
|
9
|
-
id: string;
|
|
10
|
-
importPath: string;
|
|
11
|
-
name: string;
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
14
|
-
type StorySortFn = (a: Story, b: Story) => number;
|
|
15
|
-
/**
|
|
16
|
-
* Interface for story sorting parameters in Storybook.
|
|
17
|
-
* Used to define how stories should be sorted in the navigation sidebar.
|
|
18
|
-
*/
|
|
19
|
-
export interface StorySortParam {
|
|
20
|
-
/**
|
|
21
|
-
* Configuration for story sorting. Can be either:
|
|
22
|
-
* - A StorySortConfig object specifying sort method and options
|
|
23
|
-
* - A custom sorting function that takes two stories and returns their sort order
|
|
24
|
-
*/
|
|
25
|
-
storySort: StorySortConfig | StorySortFn;
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _tag_badges = require("./tag_badges.js");
|
|
7
|
-
Object.keys(_tag_badges).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _tag_badges[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _tag_badges[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type TagBadgeParameters } from 'storybook-addon-tag-badges/manager-helpers';
|
|
2
|
-
type TagBadgeParameter = TagBadgeParameters[0];
|
|
3
|
-
/**
|
|
4
|
-
* Type representing the names of predefined tags used in Storybook stories.
|
|
5
|
-
*/
|
|
6
|
-
export type TagNames = 'editor' | 'new' | 'beta' | 'props' | 'deprecated' | 'outdated' | 'danger' | 'todo' | 'code-only' | 'snapshot' | 'unit' | 'integration' | 'keyboard' | 'internal';
|
|
7
|
-
/**
|
|
8
|
-
* Configuration for story tag badges that appear in the Storybook sidebar.
|
|
9
|
-
* Each badge is associated with a specific tag and displays an emoji with a tooltip.
|
|
10
|
-
*
|
|
11
|
-
* The badges help visually identify stories with certain characteristics:
|
|
12
|
-
* - ✏️ Editor - Stories with live editor
|
|
13
|
-
* - 🆕 New - Recently added stories
|
|
14
|
-
* - 🅱️ Beta - Stories for features in beta
|
|
15
|
-
* - 🪦 Deprecated - Stories for deprecated features
|
|
16
|
-
* - ⚠️ Outdated - Stories that need updating
|
|
17
|
-
* - 🚨 Danger - Stories demonstrating dangerous patterns
|
|
18
|
-
* - 📋 Todo - Stories marked as todo/incomplete
|
|
19
|
-
* - 📝 Code Only - Stories without visual examples
|
|
20
|
-
* - 📸 Snapshot - Stories with snapshot tests
|
|
21
|
-
* - 🧪 Unit - Stories with unit tests
|
|
22
|
-
* - 🔗 Integration - Stories with integration tests
|
|
23
|
-
*
|
|
24
|
-
* Also includes the default version badge from `storybook-addon-tag-badges`.
|
|
25
|
-
*/
|
|
26
|
-
export declare const editorBadge: TagBadgeParameter;
|
|
27
|
-
export declare const newBadge: TagBadgeParameter;
|
|
28
|
-
export declare const betaBadge: TagBadgeParameter;
|
|
29
|
-
export declare const propsBadge: TagBadgeParameter;
|
|
30
|
-
export declare const deprecatedBadge: TagBadgeParameter;
|
|
31
|
-
export declare const outdatedBadge: TagBadgeParameter;
|
|
32
|
-
export declare const dangerBadge: TagBadgeParameter;
|
|
33
|
-
export declare const todoBadge: TagBadgeParameter;
|
|
34
|
-
export declare const codeOnlyBadge: TagBadgeParameter;
|
|
35
|
-
export declare const snapshotBadge: TagBadgeParameter;
|
|
36
|
-
export declare const unitBadge: TagBadgeParameter;
|
|
37
|
-
export declare const integrationBadge: TagBadgeParameter;
|
|
38
|
-
export declare const keyboardBadge: TagBadgeParameter;
|
|
39
|
-
export declare const internalBadge: TagBadgeParameter;
|
|
40
|
-
export declare const tagBadges: TagBadgeParameters;
|
|
41
|
-
export {};
|