@storybook/addon-docs 10.6.0-alpha.0 → 10.6.0-alpha.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/dist/blocks.d.ts CHANGED
@@ -1,75 +1,115 @@
1
- import * as React from 'react';
2
- import React__default, { FC, ComponentProps, FunctionComponent, PropsWithChildren, ReactElement, Context, ReactNode } from 'react';
3
- import { Conditional, PreparedStory, DocsContextProps, ModuleExports, Renderer as Renderer$1, StoryId, Args as Args$1, ModuleExport, ResolvedModuleExportType, ResolvedModuleExportFromType, Parameters as Parameters$1, ProjectAnnotations, BaseAnnotations, ComponentTitle } from 'storybook/internal/types';
4
- export { DocsContextProps } from 'storybook/internal/types';
5
- import { Channel } from 'storybook/internal/channels';
6
- import { Renderer } from 'storybook/internal/csf';
7
- import { PropDescriptor } from 'storybook/preview-api';
8
- import { SupportedLanguage, SyntaxHighlighter, ActionItem, SyntaxHighlighterFormatTypes } from 'storybook/internal/components';
9
- import { SourceType } from 'storybook/internal/docs-tools';
10
- import { ThemeVars } from 'storybook/theming';
1
+ import { a as TableOfContents, i as DocsContextProps, n as DocsContainerProps, r as DocsContext, t as DocsContainer } from "./chunk-CQxGUEmv.js";
2
+ import * as React$1 from "react";
3
+ import React, { ComponentProps, Context, FC, FunctionComponent, PropsWithChildren, ReactElement, ReactNode } from "react";
4
+ import { Args, BaseAnnotations, ComponentTitle, Conditional, DocsContextProps as DocsContextProps$1, ModuleExport, ModuleExports, Parameters as Parameters$1, PreparedStory, ProjectAnnotations, Renderer, ResolvedModuleExportFromType, ResolvedModuleExportType, StoryId } from "storybook/internal/types";
5
+ import { ActionItem, SupportedLanguage, SyntaxHighlighter, SyntaxHighlighterFormatTypes } from "storybook/internal/components";
6
+ import { Renderer as Renderer$1 } from "storybook/internal/csf";
7
+ import { PropDescriptor } from "storybook/preview-api";
8
+ import { SourceType } from "storybook/internal/docs-tools";
11
9
 
10
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/components/Source.d.ts
11
+ declare enum SourceError {
12
+ NO_STORY = "There\u2019s no story here.",
13
+ SOURCE_UNAVAILABLE = "Oh no! The source is not available."
14
+ }
15
+ interface SourceCodeProps {
16
+ /** The language the syntax highlighter uses for your story’s code */
17
+ language?: SupportedLanguage;
18
+ /** Use this to override the content of the source block. */
19
+ code?: string;
20
+ /** The formatter the syntax highlighter uses for your story’s code. */
21
+ format?: ComponentProps<typeof SyntaxHighlighter>['format'];
22
+ /** Display the source snippet in a dark mode. */
23
+ dark?: boolean;
24
+ /** Whether to show the copy button. Defaults to true. */
25
+ copyable?: boolean;
26
+ }
27
+ interface SourceProps$1 extends SourceCodeProps {
28
+ isLoading?: boolean;
29
+ error?: SourceError;
30
+ }
31
+ /** Syntax-highlighted source code for a component (or anything!) */
32
+ declare const Source$1: FunctionComponent<SourceProps$1>;
33
+ //#endregion
34
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/components/Preview.d.ts
35
+ type PreviewProps = PropsWithChildren<{
36
+ isLoading?: true;
37
+ layout?: Layout;
38
+ inline?: boolean;
39
+ isColumn?: boolean;
40
+ columns?: number;
41
+ withSource?: SourceProps$1;
42
+ isExpanded?: boolean;
43
+ withToolbar?: boolean;
44
+ className?: string;
45
+ additionalActions?: ActionItem[];
46
+ onReloadStory?: () => void;
47
+ }>;
48
+ type Layout = 'padded' | 'fullscreen' | 'centered';
49
+ //#endregion
50
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/components/ArgsTable/types.d.ts
12
51
  interface ArgType {
13
- name?: string;
14
- description?: string;
15
- defaultValue?: any;
16
- if?: Conditional;
17
- table?: {
18
- category?: string;
19
- disable?: boolean;
20
- subcategory?: string;
21
- defaultValue?: {
22
- summary?: string | undefined;
23
- detail?: string | undefined;
24
- };
25
- type?: {
26
- summary?: string | undefined;
27
- detail?: string | undefined;
28
- };
29
- readonly?: boolean;
30
- [key: string]: any;
52
+ name?: string;
53
+ description?: string;
54
+ defaultValue?: any;
55
+ if?: Conditional;
56
+ table?: {
57
+ category?: string;
58
+ disable?: boolean;
59
+ subcategory?: string;
60
+ defaultValue?: {
61
+ summary?: string | undefined;
62
+ detail?: string | undefined;
63
+ };
64
+ type?: {
65
+ summary?: string | undefined;
66
+ detail?: string | undefined;
31
67
  };
68
+ readonly?: boolean;
32
69
  [key: string]: any;
70
+ };
71
+ [key: string]: any;
33
72
  }
34
73
  interface ArgTypes$1 {
35
- [key: string]: ArgType;
74
+ [key: string]: ArgType;
36
75
  }
37
- interface Args {
38
- [key: string]: any;
76
+ interface Args$1 {
77
+ [key: string]: any;
39
78
  }
40
79
  type Globals = {
41
- [name: string]: any;
80
+ [name: string]: any;
42
81
  };
43
-
82
+ //#endregion
83
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.d.ts
44
84
  declare enum ArgsTableError {
45
- NO_COMPONENT = "No component found.",
46
- ARGS_UNSUPPORTED = "Args unsupported. See Args documentation for your framework."
85
+ NO_COMPONENT = "No component found.",
86
+ ARGS_UNSUPPORTED = "Args unsupported. See Args documentation for your framework."
47
87
  }
48
88
  type SortType = 'alpha' | 'requiredFirst' | 'none';
49
89
  interface ArgsTableOptionProps {
50
- children?: React__default.ReactNode;
51
- updateArgs?: (args: Args) => void;
52
- resetArgs?: (argNames?: string[]) => void;
53
- compact?: boolean;
54
- inAddonPanel?: boolean;
55
- inTabPanel?: boolean;
56
- initialExpandedArgs?: boolean;
57
- isLoading?: boolean;
58
- sort?: SortType;
59
- storyId?: string;
60
- controlsId?: string;
61
- docsLang?: string;
90
+ children?: React.ReactNode;
91
+ updateArgs?: (args: Args$1) => void;
92
+ resetArgs?: (argNames?: string[]) => void;
93
+ compact?: boolean;
94
+ inAddonPanel?: boolean;
95
+ inTabPanel?: boolean;
96
+ initialExpandedArgs?: boolean;
97
+ isLoading?: boolean;
98
+ sort?: SortType;
99
+ storyId?: string;
100
+ controlsId?: string;
101
+ docsLang?: string;
62
102
  }
63
103
  interface ArgsTableDataProps {
64
- rows: ArgTypes$1;
65
- args?: Args;
66
- globals?: Globals;
104
+ rows: ArgTypes$1;
105
+ args?: Args$1;
106
+ globals?: Globals;
67
107
  }
68
108
  interface ArgsTableErrorProps {
69
- error: ArgsTableError;
109
+ error: ArgsTableError;
70
110
  }
71
111
  interface ArgsTableLoadingProps {
72
- isLoading: boolean;
112
+ isLoading: boolean;
73
113
  }
74
114
  type ArgsTableProps = ArgsTableOptionProps & (ArgsTableDataProps | ArgsTableErrorProps | ArgsTableLoadingProps);
75
115
  /**
@@ -77,83 +117,48 @@ type ArgsTableProps = ArgsTableOptionProps & (ArgsTableDataProps | ArgsTableErro
77
117
  * derived from docgen info for the component.
78
118
  */
79
119
  declare const ArgsTable: FC<ArgsTableProps>;
80
-
81
- declare enum SourceError {
82
- NO_STORY = "There\u2019s no story here.",
83
- SOURCE_UNAVAILABLE = "Oh no! The source is not available."
84
- }
85
- interface SourceCodeProps {
86
- /** The language the syntax highlighter uses for your story’s code */
87
- language?: SupportedLanguage;
88
- /** Use this to override the content of the source block. */
89
- code?: string;
90
- /** The formatter the syntax highlighter uses for your story’s code. */
91
- format?: ComponentProps<typeof SyntaxHighlighter>['format'];
92
- /** Display the source snippet in a dark mode. */
93
- dark?: boolean;
94
- /** Whether to show the copy button. Defaults to true. */
95
- copyable?: boolean;
96
- }
97
- interface SourceProps$1 extends SourceCodeProps {
98
- isLoading?: boolean;
99
- error?: SourceError;
100
- }
101
- /** Syntax-highlighted source code for a component (or anything!) */
102
- declare const Source$1: FunctionComponent<SourceProps$1>;
103
-
104
- type PreviewProps = PropsWithChildren<{
105
- isLoading?: true;
106
- layout?: Layout;
107
- inline?: boolean;
108
- isColumn?: boolean;
109
- columns?: number;
110
- withSource?: SourceProps$1;
111
- isExpanded?: boolean;
112
- withToolbar?: boolean;
113
- className?: string;
114
- additionalActions?: ActionItem[];
115
- onReloadStory?: () => void;
116
- }>;
117
- type Layout = 'padded' | 'fullscreen' | 'centered';
118
-
120
+ //#endregion
121
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/components/Story.d.ts
119
122
  interface CommonProps {
120
- story: PreparedStory;
121
- inline: boolean;
122
- primary: boolean;
123
+ story: PreparedStory;
124
+ inline: boolean;
125
+ primary: boolean;
123
126
  }
124
127
  interface InlineStoryProps extends CommonProps {
125
- inline: true;
126
- height?: string;
127
- autoplay: boolean;
128
- forceInitialArgs: boolean;
129
- renderStoryToElement: DocsContextProps['renderStoryToElement'];
128
+ inline: true;
129
+ height?: string;
130
+ autoplay: boolean;
131
+ forceInitialArgs: boolean;
132
+ renderStoryToElement: DocsContextProps$1['renderStoryToElement'];
130
133
  }
131
134
  interface IFrameStoryProps extends CommonProps {
132
- inline: false;
133
- height: string;
135
+ inline: false;
136
+ height: string;
134
137
  }
135
138
  type StoryProps$1 = InlineStoryProps | IFrameStoryProps;
136
139
  declare const Story$1: FunctionComponent<StoryProps$1>;
137
-
140
+ //#endregion
141
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/components/Typeset.d.ts
138
142
  interface TypesetProps {
139
- fontFamily?: string;
140
- fontSizes: (string | number)[];
141
- fontWeight?: number;
142
- sampleText?: string;
143
+ fontFamily?: string;
144
+ fontSizes: (string | number)[];
145
+ fontWeight?: number;
146
+ sampleText?: string;
143
147
  }
144
148
  /**
145
149
  * Convenient styleguide documentation showing examples of type with different sizes and weights and
146
150
  * configurable sample text.
147
151
  */
148
152
  declare const Typeset: FC<TypesetProps>;
149
-
153
+ //#endregion
154
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/components/ColorPalette.d.ts
150
155
  type Colors = string[] | {
151
- [key: string]: string;
156
+ [key: string]: string;
152
157
  };
153
158
  interface ColorItemProps {
154
- title: string;
155
- subtitle: string;
156
- colors: Colors;
159
+ title: string;
160
+ subtitle: string;
161
+ colors: Colors;
157
162
  }
158
163
  /**
159
164
  * A single color row your styleguide showing title, subtitle and one or more colors, used as a
@@ -161,849 +166,799 @@ interface ColorItemProps {
161
166
  */
162
167
  declare const ColorItem: FunctionComponent<ColorItemProps>;
163
168
  interface ColorPaletteProps {
164
- children?: React__default.ReactNode;
169
+ children?: React.ReactNode;
165
170
  }
166
171
  /**
167
172
  * Styleguide documentation for colors, including names, captions, and color swatches, all specified
168
173
  * as `ColorItem` children of this wrapper component.
169
174
  */
170
175
  declare const ColorPalette: FunctionComponent<ColorPaletteProps>;
171
-
176
+ //#endregion
177
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/components/IconGallery.d.ts
172
178
  interface IconItemProps {
173
- name: string;
174
- children?: React__default.ReactNode;
179
+ name: string;
180
+ children?: React.ReactNode;
175
181
  }
176
182
  /** An individual icon with a caption and an example (passed as `children`). */
177
183
  declare const IconItem: FunctionComponent<IconItemProps>;
178
184
  interface IconGalleryProps {
179
- children?: React__default.ReactNode;
185
+ children?: React.ReactNode;
180
186
  }
181
187
  /** Show a grid of icons, as specified by `IconItem`. */
182
188
  declare const IconGallery: FunctionComponent<IconGalleryProps>;
183
-
184
- interface TocbotOptions {
185
- tocSelector: string;
186
- contentSelector: string;
187
- headingSelector: string;
188
- ignoreSelector?: string;
189
- headingsOffset?: number;
190
- scrollSmoothOffset?: number;
191
- orderedList?: boolean;
192
- onClick?: (e: MouseEvent) => void;
193
- scrollEndCallback?: () => void;
194
- [key: string]: unknown;
195
- }
196
- interface TocParameters {
197
- /** CSS selector for the container to search for headings. */
198
- contentsSelector?: string;
199
- /**
200
- * When true, hide the TOC. We still show the empty container (as opposed to showing nothing at
201
- * all) because it affects the page layout and we want to preserve the layout across pages.
202
- */
203
- disable?: boolean;
204
- /** CSS selector to match headings to list in the TOC. */
205
- headingSelector?: string;
206
- /** Headings that match the ignoreSelector will be skipped. */
207
- ignoreSelector?: string;
208
- /** Custom title ReactElement or string to display above the TOC. */
209
- title?: ReactElement | string | null;
210
- /**
211
- * TocBot options, not guaranteed to be available in future versions.
212
- *
213
- * @see tocbot docs {@link https://tscanlin.github.io/tocbot/#usage}
214
- */
215
- unsafeTocbotOptions?: Omit<TocbotOptions, 'onClick' | 'scrollEndCallback'>;
216
- }
217
- type TableOfContentsProps = React__default.PropsWithChildren<TocParameters & {
218
- className?: string;
219
- channel: Channel;
220
- }>;
221
- declare const TableOfContents: ({ title, disable, headingSelector, contentsSelector, ignoreSelector, unsafeTocbotOptions, channel, className, }: TableOfContentsProps) => React__default.JSX.Element;
222
-
189
+ //#endregion
190
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Anchor.d.ts
223
191
  declare const anchorBlockIdFromId: (storyId: string) => string;
224
192
  interface AnchorProps {
225
- storyId: string;
193
+ storyId: string;
226
194
  }
227
195
  declare const Anchor: FC<PropsWithChildren<AnchorProps>>;
228
-
196
+ //#endregion
197
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/ArgTypes.d.ts
229
198
  type ArgTypesParameters = {
230
- include?: PropDescriptor;
231
- exclude?: PropDescriptor;
232
- sort?: SortType;
199
+ include?: PropDescriptor;
200
+ exclude?: PropDescriptor;
201
+ sort?: SortType;
233
202
  };
234
203
  type ArgTypesProps = ArgTypesParameters & {
235
- of?: Renderer['component'] | ModuleExports;
204
+ of?: Renderer$1['component'] | ModuleExports;
236
205
  };
237
- declare const ArgTypes: React__default.ComponentType<ArgTypesProps>;
238
-
239
- declare const DocsContext: Context<DocsContextProps<Renderer$1>>;
240
-
206
+ declare const ArgTypes: React.ComponentType<ArgTypesProps>;
207
+ //#endregion
208
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/SourceContainer.d.ts
241
209
  type ArgsHash = string;
242
- declare function argsHash(args: Args$1): ArgsHash;
210
+ declare function argsHash(args: Args): ArgsHash;
243
211
  interface SourceItem {
244
- code: string;
245
- format?: SyntaxHighlighterFormatTypes;
212
+ code: string;
213
+ format?: SyntaxHighlighterFormatTypes;
246
214
  }
247
215
  type StorySources = Record<StoryId, Record<ArgsHash, SourceItem>>;
248
216
  interface SourceContextProps {
249
- sources: StorySources;
250
- setSource?: (id: StoryId, item: SourceItem) => void;
217
+ sources: StorySources;
218
+ setSource?: (id: StoryId, item: SourceItem) => void;
251
219
  }
252
220
  declare const SourceContext: Context<SourceContextProps>;
253
221
  declare const UNKNOWN_ARGS_HASH = "--unknown--";
254
222
  declare const SourceContainer: FC<PropsWithChildren<{
255
- channel: DocsContextProps['channel'];
223
+ channel: DocsContextProps$1['channel'];
256
224
  }>>;
257
-
225
+ //#endregion
226
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Source.d.ts
258
227
  type SourceParameters = SourceCodeProps & {
259
- /** Where to read the source code from, see `SourceType` */
260
- type?: SourceType;
261
- /** Transform the detected source for display */
262
- transform?: (code: string, storyContext: ReturnType<DocsContextProps['getStoryContext']>) => string | Promise<string>;
263
- /** Internal: set by our CSF loader (`enrichCsf` in `storybook/internal/csf-tools`). */
264
- originalSource?: string;
228
+ /** Where to read the source code from, see `SourceType` */type?: SourceType; /** Transform the detected source for display */
229
+ transform?: (code: string, storyContext: ReturnType<DocsContextProps['getStoryContext']>) => string | Promise<string>; /** Internal: set by our CSF loader (`enrichCsf` in `storybook/internal/csf-tools`). */
230
+ originalSource?: string;
265
231
  };
266
232
  type SourceProps = SourceParameters & {
267
- /**
268
- * Pass the export defining a story to render its source
269
- *
270
- * ```jsx
271
- * import { Source } from '@storybook/addon-docs/blocks';
272
- * import * as ButtonStories from './Button.stories';
273
- *
274
- * <Source of={ButtonStories.Primary} />;
275
- * ```
276
- */
277
- of?: ModuleExport;
278
- /** Internal prop to control if a story re-renders on args updates */
279
- __forceInitialArgs?: boolean;
233
+ /**
234
+ * Pass the export defining a story to render its source
235
+ *
236
+ * ```jsx
237
+ * import { Source } from '@storybook/addon-docs/blocks';
238
+ * import * as ButtonStories from './Button.stories';
239
+ *
240
+ * <Source of={ButtonStories.Primary} />;
241
+ * ```
242
+ */
243
+ of?: ModuleExport; /** Internal prop to control if a story re-renders on args updates */
244
+ __forceInitialArgs?: boolean;
280
245
  };
281
246
  type PureSourceProps = ComponentProps<typeof Source$1>;
282
247
  declare const useSourceProps: (props: SourceProps, docsContext: DocsContextProps, sourceContext: SourceContextProps, serviceSnippet?: string) => PureSourceProps;
283
- declare const Source: React__default.ComponentType<SourceProps>;
284
-
248
+ declare const Source: React.ComponentType<SourceProps>;
249
+ //#endregion
250
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Story.d.ts
285
251
  type PureStoryProps = ComponentProps<typeof Story$1>;
286
252
  /** Props to reference another story */
287
253
  type StoryRefProps = {
288
- /**
289
- * Pass the export defining a story to render that story
290
- *
291
- * ```jsx
292
- * import { Meta, Story } from '@storybook/addon-docs/blocks';
293
- * import * as ButtonStories from './Button.stories';
294
- *
295
- * <Meta of={ButtonStories} />
296
- * <Story of={ButtonStories.Primary} />
297
- * ```
298
- */
299
- of?: ModuleExport;
300
- /**
301
- * Pass all exports of the CSF file if this MDX file is unattached
302
- *
303
- * ```jsx
304
- * import { Story } from '@storybook/addon-docs/blocks';
305
- * import * as ButtonStories from './Button.stories';
306
- *
307
- * <Story of={ButtonStories.Primary} meta={ButtonStories} />;
308
- * ```
309
- */
310
- meta?: ModuleExports;
254
+ /**
255
+ * Pass the export defining a story to render that story
256
+ *
257
+ * ```jsx
258
+ * import { Meta, Story } from '@storybook/addon-docs/blocks';
259
+ * import * as ButtonStories from './Button.stories';
260
+ *
261
+ * <Meta of={ButtonStories} />
262
+ * <Story of={ButtonStories.Primary} />
263
+ * ```
264
+ */
265
+ of?: ModuleExport;
266
+ /**
267
+ * Pass all exports of the CSF file if this MDX file is unattached
268
+ *
269
+ * ```jsx
270
+ * import { Story } from '@storybook/addon-docs/blocks';
271
+ * import * as ButtonStories from './Button.stories';
272
+ *
273
+ * <Story of={ButtonStories.Primary} meta={ButtonStories} />;
274
+ * ```
275
+ */
276
+ meta?: ModuleExports;
311
277
  };
312
278
  type StoryParameters = {
313
- /** Render the story inline or in an iframe */
314
- inline?: boolean;
315
- /** When rendering in an iframe (`inline={false}`), set the story height */
316
- height?: string;
317
- /** Whether to run the story's play function */
318
- autoplay?: boolean;
319
- /** Internal prop to control if a story re-renders on args updates */
320
- __forceInitialArgs?: boolean;
321
- /** Internal prop if this story is the primary story */
322
- __primary?: boolean;
279
+ /** Render the story inline or in an iframe */inline?: boolean; /** When rendering in an iframe (`inline={false}`), set the story height */
280
+ height?: string; /** Whether to run the story's play function */
281
+ autoplay?: boolean; /** Internal prop to control if a story re-renders on args updates */
282
+ __forceInitialArgs?: boolean; /** Internal prop if this story is the primary story */
283
+ __primary?: boolean;
323
284
  };
324
285
  type StoryProps = StoryRefProps & StoryParameters;
325
286
  declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
326
- declare const getStoryProps: <TFramework extends Renderer$1>(props: StoryParameters, story: PreparedStory<TFramework>, context: DocsContextProps<TFramework>) => PureStoryProps;
327
- declare const Story: React__default.ComponentType<StoryProps>;
328
-
287
+ declare const getStoryProps: <TFramework extends Renderer>(props: StoryParameters, story: PreparedStory<TFramework>, context: DocsContextProps<TFramework>) => PureStoryProps;
288
+ declare const Story: React.ComponentType<StoryProps>;
289
+ //#endregion
290
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Canvas.d.ts
329
291
  type CanvasProps = Pick<PreviewProps, 'withToolbar' | 'additionalActions' | 'className'> & {
330
- /**
331
- * Pass the export defining a story to render that story
332
- *
333
- * ```jsx
334
- * import { Meta, Canvas } from '@storybook/addon-docs/blocks';
335
- * import * as ButtonStories from './Button.stories';
336
- *
337
- * <Meta of={ButtonStories} />
338
- * <Canvas of={ButtonStories.Primary} />
339
- * ```
340
- */
341
- of?: ModuleExport;
342
- /**
343
- * Pass all exports of the CSF file if this MDX file is unattached
344
- *
345
- * ```jsx
346
- * import { Canvas } from '@storybook/addon-docs/blocks';
347
- * import * as ButtonStories from './Button.stories';
348
- *
349
- * <Canvas of={ButtonStories.Primary} meta={ButtonStories} />;
350
- * ```
351
- */
352
- meta?: ModuleExports;
353
- /**
354
- * Specify the initial state of the source panel hidden: the source panel is hidden by default
355
- * shown: the source panel is shown by default none: the source panel is not available and the
356
- * button to show it is hidden
357
- *
358
- * @default 'hidden'
359
- */
360
- sourceState?: 'hidden' | 'shown' | 'none';
361
- /**
362
- * How to layout the story within the canvas padded: the story has padding within the canvas
363
- * fullscreen: the story is rendered edge to edge within the canvas centered: the story is
364
- * centered within the canvas
365
- *
366
- * @default 'padded'
367
- */
368
- layout?: Layout;
369
- /** @see {SourceProps} */
370
- source?: Omit<SourceProps, 'dark'>;
371
- /** @see {StoryProps} */
372
- story?: Pick<StoryProps, 'inline' | 'height' | 'autoplay' | '__forceInitialArgs' | '__primary'>;
292
+ /**
293
+ * Pass the export defining a story to render that story
294
+ *
295
+ * ```jsx
296
+ * import { Meta, Canvas } from '@storybook/addon-docs/blocks';
297
+ * import * as ButtonStories from './Button.stories';
298
+ *
299
+ * <Meta of={ButtonStories} />
300
+ * <Canvas of={ButtonStories.Primary} />
301
+ * ```
302
+ */
303
+ of?: ModuleExport;
304
+ /**
305
+ * Pass all exports of the CSF file if this MDX file is unattached
306
+ *
307
+ * ```jsx
308
+ * import { Canvas } from '@storybook/addon-docs/blocks';
309
+ * import * as ButtonStories from './Button.stories';
310
+ *
311
+ * <Canvas of={ButtonStories.Primary} meta={ButtonStories} />;
312
+ * ```
313
+ */
314
+ meta?: ModuleExports;
315
+ /**
316
+ * Specify the initial state of the source panel hidden: the source panel is hidden by default
317
+ * shown: the source panel is shown by default none: the source panel is not available and the
318
+ * button to show it is hidden
319
+ *
320
+ * @default 'hidden'
321
+ */
322
+ sourceState?: 'hidden' | 'shown' | 'none';
323
+ /**
324
+ * How to layout the story within the canvas padded: the story has padding within the canvas
325
+ * fullscreen: the story is rendered edge to edge within the canvas centered: the story is
326
+ * centered within the canvas
327
+ *
328
+ * @default 'padded'
329
+ */
330
+ layout?: Layout; /** @see {SourceProps} */
331
+ source?: Omit<SourceProps, 'dark'>; /** @see {StoryProps} */
332
+ story?: Pick<StoryProps, 'inline' | 'height' | 'autoplay' | '__forceInitialArgs' | '__primary'>;
373
333
  };
374
- declare const Canvas: React__default.ComponentType<CanvasProps>;
375
-
334
+ declare const Canvas: React.ComponentType<CanvasProps>;
335
+ //#endregion
336
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Controls.d.ts
376
337
  type ControlsParameters = {
377
- include?: PropDescriptor;
378
- exclude?: PropDescriptor;
379
- sort?: SortType;
338
+ include?: PropDescriptor;
339
+ exclude?: PropDescriptor;
340
+ sort?: SortType;
380
341
  };
381
342
  type ControlsProps = ControlsParameters & {
382
- of?: Renderer['component'] | ModuleExports;
343
+ of?: Renderer$1['component'] | ModuleExports;
383
344
  };
384
- declare const Controls: React__default.ComponentType<ControlsProps>;
385
-
386
- type Of = Parameters<DocsContextProps['resolveOf']>[0];
345
+ declare const Controls: React.ComponentType<ControlsProps>;
346
+ //#endregion
347
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/useOf.d.ts
348
+ type Of = Parameters<DocsContextProps$1['resolveOf']>[0];
387
349
  /**
388
350
  * A hook to resolve the `of` prop passed to a block. will return the resolved module if the
389
351
  * resolved module is a meta it will include a preparedMeta property similar to a preparedStory if
390
352
  * the resolved module is a component it will include the project annotations
391
353
  */
392
354
  declare const useOf: <TType extends ResolvedModuleExportType>(moduleExportOrType: Of, validTypes?: TType[]) => ResolvedModuleExportFromType<TType>;
393
-
355
+ //#endregion
356
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Description.d.ts
394
357
  declare enum DescriptionType {
395
- INFO = "info",
396
- NOTES = "notes",
397
- DOCGEN = "docgen",
398
- AUTO = "auto"
358
+ INFO = "info",
359
+ NOTES = "notes",
360
+ DOCGEN = "docgen",
361
+ AUTO = "auto"
399
362
  }
400
363
  interface DescriptionProps {
401
- /**
402
- * Specify where to get the description from. Can be a component, a CSF file or a story. If not
403
- * specified, the description will be extracted from the meta of the attached CSF file.
404
- */
405
- of?: Of;
364
+ /**
365
+ * Specify where to get the description from. Can be a component, a CSF file or a story. If not
366
+ * specified, the description will be extracted from the meta of the attached CSF file.
367
+ */
368
+ of?: Of;
406
369
  }
407
- declare const Description: React__default.ComponentType<DescriptionProps>;
408
-
409
- type DocsProps<TRenderer extends Renderer$1 = Renderer$1> = {
410
- docsParameter: Parameters$1;
411
- context: DocsContextProps<TRenderer>;
370
+ declare const Description: React.ComponentType<DescriptionProps>;
371
+ //#endregion
372
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Docs.d.ts
373
+ type DocsProps<TRenderer extends Renderer = Renderer> = {
374
+ docsParameter: Parameters$1;
375
+ context: DocsContextProps<TRenderer>;
412
376
  };
413
- declare function Docs<TRenderer extends Renderer$1 = Renderer$1>({ context, docsParameter, }: DocsProps<TRenderer>): React__default.JSX.Element;
414
-
377
+ declare function Docs<TRenderer extends Renderer = Renderer>({
378
+ context,
379
+ docsParameter
380
+ }: DocsProps<TRenderer>): React.JSX.Element;
381
+ //#endregion
382
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/DocsPage.d.ts
415
383
  declare const DocsPage: FC;
416
-
417
- interface DocsContainerProps<TFramework extends Renderer$1 = Renderer$1> {
418
- context: DocsContextProps<TFramework>;
419
- theme?: ThemeVars;
420
- }
421
- declare const DocsContainer: FC<PropsWithChildren<DocsContainerProps>>;
422
-
384
+ //#endregion
385
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/types.d.ts
423
386
  declare const PRIMARY_STORY = "^";
424
387
  type Component = any;
425
388
  type DocsStoryProps = {
426
- of: ModuleExport;
427
- expanded?: boolean;
428
- withToolbar?: boolean;
429
- __forceInitialArgs?: boolean;
430
- __primary?: boolean;
389
+ of: ModuleExport;
390
+ expanded?: boolean;
391
+ withToolbar?: boolean;
392
+ __forceInitialArgs?: boolean;
393
+ __primary?: boolean;
431
394
  };
432
-
433
- declare const DocsStory: React__default.ComponentType<DocsStoryProps>;
434
-
435
- type ExternalDocsProps<TRenderer extends Renderer$1 = Renderer$1> = {
436
- projectAnnotationsList: ProjectAnnotations<TRenderer>[];
395
+ //#endregion
396
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/DocsStory.d.ts
397
+ declare const DocsStory: React.ComponentType<DocsStoryProps>;
398
+ //#endregion
399
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/external/ExternalDocs.d.ts
400
+ type ExternalDocsProps<TRenderer extends Renderer = Renderer> = {
401
+ projectAnnotationsList: ProjectAnnotations<TRenderer>[];
437
402
  };
438
- declare function ExternalDocs<TRenderer extends Renderer$1 = Renderer$1>({ projectAnnotationsList, children, }: PropsWithChildren<ExternalDocsProps<TRenderer>>): React__default.JSX.Element;
439
-
440
- declare const ExternalDocsContainer: React__default.FC<React__default.PropsWithChildren<{
441
- projectAnnotations: any;
403
+ declare function ExternalDocs<TRenderer extends Renderer = Renderer>({
404
+ projectAnnotationsList,
405
+ children
406
+ }: PropsWithChildren<ExternalDocsProps<TRenderer>>): React.JSX.Element;
407
+ //#endregion
408
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/external/ExternalDocsContainer.d.ts
409
+ declare const ExternalDocsContainer: React.FC<React.PropsWithChildren<{
410
+ projectAnnotations: any;
442
411
  }>>;
443
-
412
+ //#endregion
413
+ //#region node_modules/github-slugger/index.d.ts
444
414
  /**
445
415
  * Slugger.
446
416
  */
447
417
  declare class BananaSlug {
448
- /** @type {Record<string, number>} */
449
- occurrences: Record<string, number>;
450
- /**
451
- * Generate a unique slug.
452
- *
453
- * Tracks previously generated slugs: repeated calls with the same value
454
- * will result in different slugs.
455
- * Use the `slug` function to get same slugs.
456
- *
457
- * @param {string} value
458
- * String of text to slugify
459
- * @param {boolean} [maintainCase=false]
460
- * Keep the current case, otherwise make all lowercase
461
- * @return {string}
462
- * A unique slug string
463
- */
464
- slug(value: string, maintainCase?: boolean | undefined): string;
465
- /**
466
- * Reset - Forget all previous slugs
467
- *
468
- * @return void
469
- */
470
- reset(): void;
418
+ /** @type {Record<string, number>} */
419
+ occurrences: Record<string, number>;
420
+ /**
421
+ * Generate a unique slug.
422
+ *
423
+ * Tracks previously generated slugs: repeated calls with the same value
424
+ * will result in different slugs.
425
+ * Use the `slug` function to get same slugs.
426
+ *
427
+ * @param {string} value
428
+ * String of text to slugify
429
+ * @param {boolean} [maintainCase=false]
430
+ * Keep the current case, otherwise make all lowercase
431
+ * @return {string}
432
+ * A unique slug string
433
+ */
434
+ slug(value: string, maintainCase?: boolean | undefined): string;
435
+ /**
436
+ * Reset - Forget all previous slugs
437
+ *
438
+ * @return void
439
+ */
440
+ reset(): void;
471
441
  }
472
-
442
+ //#endregion
443
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Heading.d.ts
473
444
  interface HeadingProps {
474
- disableAnchor?: boolean;
445
+ disableAnchor?: boolean;
475
446
  }
476
447
  declare const slugs: BananaSlug;
477
- declare const Heading: React__default.ComponentType<PropsWithChildren<HeadingProps>>;
478
-
479
- /**
480
- * markdown-to-jsx is a fork of
481
- * [simple-markdown v0.2.2](https://github.com/Khan/simple-markdown)
482
- * from Khan Academy. Thank you Khan devs for making such an awesome
483
- * and extensible parsing infra... without it, half of the
484
- * optimizations here wouldn't be feasible. 🙏🏼
485
- */
486
-
448
+ declare const Heading: React.ComponentType<PropsWithChildren<HeadingProps>>;
449
+ //#endregion
450
+ //#region node_modules/markdown-to-jsx/dist/index.d.ts
487
451
  /**
488
452
  * Analogous to `node.type`. Please note that the values here may change at any time,
489
453
  * so do not hard code against the value directly.
490
454
  */
491
455
  declare const RuleType: {
492
- readonly blockQuote: "0";
493
- readonly breakLine: "1";
494
- readonly breakThematic: "2";
495
- readonly codeBlock: "3";
496
- readonly codeFenced: "4";
497
- readonly codeInline: "5";
498
- readonly footnote: "6";
499
- readonly footnoteReference: "7";
500
- readonly gfmTask: "8";
501
- readonly heading: "9";
502
- readonly headingSetext: "10";
503
- /** only available if not `disableHTMLParsing` */
504
- readonly htmlBlock: "11";
505
- readonly htmlComment: "12";
506
- /** only available if not `disableHTMLParsing` */
507
- readonly htmlSelfClosing: "13";
508
- readonly image: "14";
509
- readonly link: "15";
510
- /** emits a `link` 'node', does not render directly */
511
- readonly linkAngleBraceStyleDetector: "16";
512
- /** emits a `link` 'node', does not render directly */
513
- readonly linkBareUrlDetector: "17";
514
- /** @deprecated merged into linkAngleBraceStyleDetector
515
- *
516
- * emits a `link` 'node', does not render directly */
517
- readonly linkMailtoDetector: "18";
518
- readonly newlineCoalescer: "19";
519
- readonly orderedList: "20";
520
- readonly paragraph: "21";
521
- readonly ref: "22";
522
- readonly refImage: "23";
523
- readonly refLink: "24";
524
- readonly table: "25";
525
- readonly tableSeparator: "26";
526
- readonly text: "27";
527
- readonly textBolded: "28";
528
- readonly textEmphasized: "29";
529
- readonly textEscaped: "30";
530
- readonly textMarked: "31";
531
- readonly textStrikethroughed: "32";
532
- readonly unorderedList: "33";
456
+ readonly blockQuote: "0";
457
+ readonly breakLine: "1";
458
+ readonly breakThematic: "2";
459
+ readonly codeBlock: "3";
460
+ readonly codeFenced: "4";
461
+ readonly codeInline: "5";
462
+ readonly footnote: "6";
463
+ readonly footnoteReference: "7";
464
+ readonly gfmTask: "8";
465
+ readonly heading: "9";
466
+ readonly headingSetext: "10"; /** only available if not `disableHTMLParsing` */
467
+ readonly htmlBlock: "11";
468
+ readonly htmlComment: "12"; /** only available if not `disableHTMLParsing` */
469
+ readonly htmlSelfClosing: "13";
470
+ readonly image: "14";
471
+ readonly link: "15"; /** emits a `link` 'node', does not render directly */
472
+ readonly linkAngleBraceStyleDetector: "16"; /** emits a `link` 'node', does not render directly */
473
+ readonly linkBareUrlDetector: "17";
474
+ /** @deprecated merged into linkAngleBraceStyleDetector
475
+ *
476
+ * emits a `link` 'node', does not render directly */
477
+ readonly linkMailtoDetector: "18";
478
+ readonly newlineCoalescer: "19";
479
+ readonly orderedList: "20";
480
+ readonly paragraph: "21";
481
+ readonly ref: "22";
482
+ readonly refImage: "23";
483
+ readonly refLink: "24";
484
+ readonly table: "25";
485
+ readonly tableSeparator: "26";
486
+ readonly text: "27";
487
+ readonly textBolded: "28";
488
+ readonly textEmphasized: "29";
489
+ readonly textEscaped: "30";
490
+ readonly textMarked: "31";
491
+ readonly textStrikethroughed: "32";
492
+ readonly unorderedList: "33";
533
493
  };
534
494
  type RuleType = (typeof RuleType)[keyof typeof RuleType];
535
495
  declare const Priority: {
496
+ /**
497
+ * anything that must scan the tree before everything else
498
+ */
499
+ MAX: number;
500
+ /**
501
+ * scans for block-level constructs
502
+ */
503
+ HIGH: number;
504
+ /**
505
+ * inline w/ more priority than other inline
506
+ */
507
+ MED: number;
508
+ /**
509
+ * inline elements
510
+ */
511
+ LOW: number;
512
+ /**
513
+ * bare text and stuff that is considered leftovers
514
+ */
515
+ MIN: number;
516
+ };
517
+ declare namespace MarkdownToJSX {
518
+ /**
519
+ * RequireAtLeastOne<{ ... }> <- only requires at least one key
520
+ */
521
+ type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & { [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>> }[Keys];
522
+ export type CreateElement = typeof React$1.createElement;
523
+ export type HTMLTags = keyof React$1.JSX.IntrinsicElements;
524
+ export type State = {
525
+ /** true if the current content is inside anchor link grammar */inAnchor?: boolean; /** true if parsing in an HTML context */
526
+ inHTML?: boolean; /** true if parsing in an inline context (subset of rules around formatting and links) */
527
+ inline?: boolean; /** true if in a table */
528
+ inTable?: boolean; /** use this for the `key` prop */
529
+ key?: React$1.Key; /** true if in a list */
530
+ list?: boolean; /** used for lookbacks */
531
+ prevCapture?: string; /** true if parsing in inline context w/o links */
532
+ simple?: boolean;
533
+ };
534
+ export interface BlockQuoteNode {
535
+ alert?: string;
536
+ children: MarkdownToJSX.ParserResult[];
537
+ type: typeof RuleType.blockQuote;
538
+ }
539
+ export interface BreakLineNode {
540
+ type: typeof RuleType.breakLine;
541
+ }
542
+ export interface BreakThematicNode {
543
+ type: typeof RuleType.breakThematic;
544
+ }
545
+ export interface CodeBlockNode {
546
+ type: typeof RuleType.codeBlock;
547
+ attrs?: React$1.JSX.IntrinsicAttributes;
548
+ lang?: string;
549
+ text: string;
550
+ }
551
+ export interface CodeFencedNode {
552
+ type: typeof RuleType.codeFenced;
553
+ }
554
+ export interface CodeInlineNode {
555
+ type: typeof RuleType.codeInline;
556
+ text: string;
557
+ }
558
+ export interface FootnoteNode {
559
+ type: typeof RuleType.footnote;
560
+ }
561
+ export interface FootnoteReferenceNode {
562
+ type: typeof RuleType.footnoteReference;
563
+ target: string;
564
+ text: string;
565
+ }
566
+ export interface GFMTaskNode {
567
+ type: typeof RuleType.gfmTask;
568
+ completed: boolean;
569
+ }
570
+ export interface HeadingNode {
571
+ type: typeof RuleType.heading;
572
+ children: MarkdownToJSX.ParserResult[];
573
+ id: string;
574
+ level: 1 | 2 | 3 | 4 | 5 | 6;
575
+ }
576
+ export interface HeadingSetextNode {
577
+ type: typeof RuleType.headingSetext;
578
+ }
579
+ export interface HTMLCommentNode {
580
+ type: typeof RuleType.htmlComment;
581
+ }
582
+ export interface ImageNode {
583
+ type: typeof RuleType.image;
584
+ alt?: string;
585
+ target: string;
586
+ title?: string;
587
+ }
588
+ export interface LinkNode {
589
+ type: typeof RuleType.link;
590
+ children: MarkdownToJSX.ParserResult[];
591
+ target: string;
592
+ title?: string;
593
+ }
594
+ export interface LinkAngleBraceNode {
595
+ type: typeof RuleType.linkAngleBraceStyleDetector;
596
+ }
597
+ export interface LinkBareURLNode {
598
+ type: typeof RuleType.linkBareUrlDetector;
599
+ }
600
+ export interface LinkMailtoNode {
601
+ type: typeof RuleType.linkMailtoDetector;
602
+ }
603
+ export interface OrderedListNode {
604
+ type: typeof RuleType.orderedList;
605
+ items: MarkdownToJSX.ParserResult[][];
606
+ ordered: true;
607
+ start?: number;
608
+ }
609
+ export interface UnorderedListNode {
610
+ type: typeof RuleType.unorderedList;
611
+ items: MarkdownToJSX.ParserResult[][];
612
+ ordered: false;
613
+ }
614
+ export interface NewlineNode {
615
+ type: typeof RuleType.newlineCoalescer;
616
+ }
617
+ export interface ParagraphNode {
618
+ type: typeof RuleType.paragraph;
619
+ children: MarkdownToJSX.ParserResult[];
620
+ }
621
+ export interface ReferenceNode {
622
+ type: typeof RuleType.ref;
623
+ }
624
+ export interface ReferenceImageNode {
625
+ type: typeof RuleType.refImage;
626
+ alt?: string;
627
+ ref: string;
628
+ }
629
+ export interface ReferenceLinkNode {
630
+ type: typeof RuleType.refLink;
631
+ children: MarkdownToJSX.ParserResult[];
632
+ fallbackChildren: string;
633
+ ref: string;
634
+ }
635
+ export interface TableNode {
636
+ type: typeof RuleType.table;
536
637
  /**
537
- * anything that must scan the tree before everything else
638
+ * alignment for each table column
538
639
  */
539
- MAX: number;
640
+ align: ('left' | 'right' | 'center')[];
641
+ cells: MarkdownToJSX.ParserResult[][][];
642
+ header: MarkdownToJSX.ParserResult[][];
643
+ }
644
+ export interface TableSeparatorNode {
645
+ type: typeof RuleType.tableSeparator;
646
+ }
647
+ export interface TextNode {
648
+ type: typeof RuleType.text;
649
+ text: string;
650
+ }
651
+ export interface BoldTextNode {
652
+ type: typeof RuleType.textBolded;
653
+ children: MarkdownToJSX.ParserResult[];
654
+ }
655
+ export interface ItalicTextNode {
656
+ type: typeof RuleType.textEmphasized;
657
+ children: MarkdownToJSX.ParserResult[];
658
+ }
659
+ export interface EscapedTextNode {
660
+ type: typeof RuleType.textEscaped;
661
+ }
662
+ export interface MarkedTextNode {
663
+ type: typeof RuleType.textMarked;
664
+ children: MarkdownToJSX.ParserResult[];
665
+ }
666
+ export interface StrikethroughTextNode {
667
+ type: typeof RuleType.textStrikethroughed;
668
+ children: MarkdownToJSX.ParserResult[];
669
+ }
670
+ export interface HTMLNode {
671
+ type: typeof RuleType.htmlBlock;
672
+ attrs: React$1.JSX.IntrinsicAttributes;
673
+ children?: ReturnType<MarkdownToJSX.NestedParser> | undefined;
674
+ noInnerParse: Boolean;
675
+ tag: MarkdownToJSX.HTMLTags;
676
+ text?: string | undefined;
677
+ }
678
+ export interface HTMLSelfClosingNode {
679
+ type: typeof RuleType.htmlSelfClosing;
680
+ attrs: React$1.JSX.IntrinsicAttributes;
681
+ tag: string;
682
+ }
683
+ export type ParserResult = BlockQuoteNode | BreakLineNode | BreakThematicNode | CodeBlockNode | CodeFencedNode | CodeInlineNode | FootnoteNode | FootnoteReferenceNode | GFMTaskNode | HeadingNode | HeadingSetextNode | HTMLCommentNode | ImageNode | LinkNode | LinkAngleBraceNode | LinkBareURLNode | LinkMailtoNode | OrderedListNode | UnorderedListNode | NewlineNode | ParagraphNode | ReferenceNode | ReferenceImageNode | ReferenceLinkNode | TableNode | TableSeparatorNode | TextNode | BoldTextNode | ItalicTextNode | EscapedTextNode | MarkedTextNode | StrikethroughTextNode | HTMLNode | HTMLSelfClosingNode;
684
+ export type NestedParser = (input: string, state?: MarkdownToJSX.State) => MarkdownToJSX.ParserResult[];
685
+ export type Parser<ParserOutput> = (capture: RegExpMatchArray, nestedParse: NestedParser, state?: MarkdownToJSX.State) => ParserOutput;
686
+ export type RuleOutput = (ast: MarkdownToJSX.ParserResult | MarkdownToJSX.ParserResult[], state: MarkdownToJSX.State) => React$1.ReactNode;
687
+ export type Rule<ParserOutput = MarkdownToJSX.ParserResult> = {
688
+ _match: (source: string, state: MarkdownToJSX.State, prevCapturedString?: string) => RegExpMatchArray;
689
+ _order: (typeof Priority)[keyof typeof Priority];
690
+ _parse: MarkdownToJSX.Parser<Omit<ParserOutput, 'type'>>;
540
691
  /**
541
- * scans for block-level constructs
692
+ * Optional fast check that can quickly determine if this rule
693
+ * should even be attempted. Should check the start of the source string
694
+ * for quick patterns without expensive regex operations.
695
+ *
696
+ * @param source The input source string (already trimmed of leading whitespace)
697
+ * @param state Current parser state
698
+ * @returns true if the rule should be attempted, false to skip
542
699
  */
543
- HIGH: number;
700
+ _qualify?: string[] | ((source: string, state: MarkdownToJSX.State) => boolean);
701
+ _render?: (node: ParserOutput,
544
702
  /**
545
- * inline w/ more priority than other inline
703
+ * Continue rendering AST nodes if applicable.
546
704
  */
547
- MED: number;
705
+
706
+ render: RuleOutput, state?: MarkdownToJSX.State) => React$1.ReactNode;
707
+ };
708
+ export type Rules = { [K in ParserResult['type']]: K extends typeof RuleType.table ? Rule<Extract<ParserResult, {
709
+ type: K | typeof RuleType.paragraph;
710
+ }>> : Rule<Extract<ParserResult, {
711
+ type: K;
712
+ }>> };
713
+ export type Override = RequireAtLeastOne<{
714
+ component: React$1.ElementType;
715
+ props: Object;
716
+ }> | React$1.ElementType;
717
+ export type Overrides = { [tag in HTMLTags]?: Override } & {
718
+ [customComponent: string]: Override;
719
+ };
720
+ export type Options = Partial<{
548
721
  /**
549
- * inline elements
722
+ * Ultimate control over the output of all rendered JSX.
550
723
  */
551
- LOW: number;
724
+ createElement: (tag: Parameters<CreateElement>[0], props: React$1.JSX.IntrinsicAttributes, ...children: React$1.ReactNode[]) => React$1.ReactNode;
552
725
  /**
553
- * bare text and stuff that is considered leftovers
726
+ * The library automatically generates an anchor tag for bare URLs included in the markdown
727
+ * document, but this behavior can be disabled if desired.
554
728
  */
555
- MIN: number;
556
- };
557
- declare namespace MarkdownToJSX {
729
+ disableAutoLink: boolean;
558
730
  /**
559
- * RequireAtLeastOne<{ ... }> <- only requires at least one key
731
+ * Disable the compiler's best-effort transcription of provided raw HTML
732
+ * into JSX-equivalent. This is the functionality that prevents the need to
733
+ * use `dangerouslySetInnerHTML` in React.
560
734
  */
561
- type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
562
- [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
563
- }[Keys];
564
- export type CreateElement = typeof React.createElement;
565
- export type HTMLTags = keyof React.JSX.IntrinsicElements;
566
- export type State = {
567
- /** true if the current content is inside anchor link grammar */
568
- inAnchor?: boolean;
569
- /** true if parsing in an HTML context */
570
- inHTML?: boolean;
571
- /** true if parsing in an inline context (subset of rules around formatting and links) */
572
- inline?: boolean;
573
- /** true if in a table */
574
- inTable?: boolean;
575
- /** use this for the `key` prop */
576
- key?: React.Key;
577
- /** true if in a list */
578
- list?: boolean;
579
- /** used for lookbacks */
580
- prevCapture?: string;
581
- /** true if parsing in inline context w/o links */
582
- simple?: boolean;
583
- };
584
- export interface BlockQuoteNode {
585
- alert?: string;
586
- children: MarkdownToJSX.ParserResult[];
587
- type: typeof RuleType.blockQuote;
588
- }
589
- export interface BreakLineNode {
590
- type: typeof RuleType.breakLine;
591
- }
592
- export interface BreakThematicNode {
593
- type: typeof RuleType.breakThematic;
594
- }
595
- export interface CodeBlockNode {
596
- type: typeof RuleType.codeBlock;
597
- attrs?: React.JSX.IntrinsicAttributes;
598
- lang?: string;
599
- text: string;
600
- }
601
- export interface CodeFencedNode {
602
- type: typeof RuleType.codeFenced;
603
- }
604
- export interface CodeInlineNode {
605
- type: typeof RuleType.codeInline;
606
- text: string;
607
- }
608
- export interface FootnoteNode {
609
- type: typeof RuleType.footnote;
610
- }
611
- export interface FootnoteReferenceNode {
612
- type: typeof RuleType.footnoteReference;
613
- target: string;
614
- text: string;
615
- }
616
- export interface GFMTaskNode {
617
- type: typeof RuleType.gfmTask;
618
- completed: boolean;
619
- }
620
- export interface HeadingNode {
621
- type: typeof RuleType.heading;
622
- children: MarkdownToJSX.ParserResult[];
623
- id: string;
624
- level: 1 | 2 | 3 | 4 | 5 | 6;
625
- }
626
- export interface HeadingSetextNode {
627
- type: typeof RuleType.headingSetext;
628
- }
629
- export interface HTMLCommentNode {
630
- type: typeof RuleType.htmlComment;
631
- }
632
- export interface ImageNode {
633
- type: typeof RuleType.image;
634
- alt?: string;
635
- target: string;
636
- title?: string;
637
- }
638
- export interface LinkNode {
639
- type: typeof RuleType.link;
640
- children: MarkdownToJSX.ParserResult[];
641
- target: string;
642
- title?: string;
643
- }
644
- export interface LinkAngleBraceNode {
645
- type: typeof RuleType.linkAngleBraceStyleDetector;
646
- }
647
- export interface LinkBareURLNode {
648
- type: typeof RuleType.linkBareUrlDetector;
649
- }
650
- export interface LinkMailtoNode {
651
- type: typeof RuleType.linkMailtoDetector;
652
- }
653
- export interface OrderedListNode {
654
- type: typeof RuleType.orderedList;
655
- items: MarkdownToJSX.ParserResult[][];
656
- ordered: true;
657
- start?: number;
658
- }
659
- export interface UnorderedListNode {
660
- type: typeof RuleType.unorderedList;
661
- items: MarkdownToJSX.ParserResult[][];
662
- ordered: false;
663
- }
664
- export interface NewlineNode {
665
- type: typeof RuleType.newlineCoalescer;
666
- }
667
- export interface ParagraphNode {
668
- type: typeof RuleType.paragraph;
669
- children: MarkdownToJSX.ParserResult[];
670
- }
671
- export interface ReferenceNode {
672
- type: typeof RuleType.ref;
673
- }
674
- export interface ReferenceImageNode {
675
- type: typeof RuleType.refImage;
676
- alt?: string;
677
- ref: string;
678
- }
679
- export interface ReferenceLinkNode {
680
- type: typeof RuleType.refLink;
681
- children: MarkdownToJSX.ParserResult[];
682
- fallbackChildren: string;
683
- ref: string;
684
- }
685
- export interface TableNode {
686
- type: typeof RuleType.table;
687
- /**
688
- * alignment for each table column
689
- */
690
- align: ('left' | 'right' | 'center')[];
691
- cells: MarkdownToJSX.ParserResult[][][];
692
- header: MarkdownToJSX.ParserResult[][];
693
- }
694
- export interface TableSeparatorNode {
695
- type: typeof RuleType.tableSeparator;
696
- }
697
- export interface TextNode {
698
- type: typeof RuleType.text;
699
- text: string;
700
- }
701
- export interface BoldTextNode {
702
- type: typeof RuleType.textBolded;
703
- children: MarkdownToJSX.ParserResult[];
704
- }
705
- export interface ItalicTextNode {
706
- type: typeof RuleType.textEmphasized;
707
- children: MarkdownToJSX.ParserResult[];
708
- }
709
- export interface EscapedTextNode {
710
- type: typeof RuleType.textEscaped;
711
- }
712
- export interface MarkedTextNode {
713
- type: typeof RuleType.textMarked;
714
- children: MarkdownToJSX.ParserResult[];
715
- }
716
- export interface StrikethroughTextNode {
717
- type: typeof RuleType.textStrikethroughed;
718
- children: MarkdownToJSX.ParserResult[];
719
- }
720
- export interface HTMLNode {
721
- type: typeof RuleType.htmlBlock;
722
- attrs: React.JSX.IntrinsicAttributes;
723
- children?: ReturnType<MarkdownToJSX.NestedParser> | undefined;
724
- noInnerParse: Boolean;
725
- tag: MarkdownToJSX.HTMLTags;
726
- text?: string | undefined;
727
- }
728
- export interface HTMLSelfClosingNode {
729
- type: typeof RuleType.htmlSelfClosing;
730
- attrs: React.JSX.IntrinsicAttributes;
731
- tag: string;
732
- }
733
- export type ParserResult = BlockQuoteNode | BreakLineNode | BreakThematicNode | CodeBlockNode | CodeFencedNode | CodeInlineNode | FootnoteNode | FootnoteReferenceNode | GFMTaskNode | HeadingNode | HeadingSetextNode | HTMLCommentNode | ImageNode | LinkNode | LinkAngleBraceNode | LinkBareURLNode | LinkMailtoNode | OrderedListNode | UnorderedListNode | NewlineNode | ParagraphNode | ReferenceNode | ReferenceImageNode | ReferenceLinkNode | TableNode | TableSeparatorNode | TextNode | BoldTextNode | ItalicTextNode | EscapedTextNode | MarkedTextNode | StrikethroughTextNode | HTMLNode | HTMLSelfClosingNode;
734
- export type NestedParser = (input: string, state?: MarkdownToJSX.State) => MarkdownToJSX.ParserResult[];
735
- export type Parser<ParserOutput> = (capture: RegExpMatchArray, nestedParse: NestedParser, state?: MarkdownToJSX.State) => ParserOutput;
736
- export type RuleOutput = (ast: MarkdownToJSX.ParserResult | MarkdownToJSX.ParserResult[], state: MarkdownToJSX.State) => React.ReactNode;
737
- export type Rule<ParserOutput = MarkdownToJSX.ParserResult> = {
738
- _match: (source: string, state: MarkdownToJSX.State, prevCapturedString?: string) => RegExpMatchArray;
739
- _order: (typeof Priority)[keyof typeof Priority];
740
- _parse: MarkdownToJSX.Parser<Omit<ParserOutput, 'type'>>;
741
- /**
742
- * Optional fast check that can quickly determine if this rule
743
- * should even be attempted. Should check the start of the source string
744
- * for quick patterns without expensive regex operations.
745
- *
746
- * @param source The input source string (already trimmed of leading whitespace)
747
- * @param state Current parser state
748
- * @returns true if the rule should be attempted, false to skip
749
- */
750
- _qualify?: string[] | ((source: string, state: MarkdownToJSX.State) => boolean);
751
- _render?: (node: ParserOutput,
752
- /**
753
- * Continue rendering AST nodes if applicable.
754
- */
755
- render: RuleOutput, state?: MarkdownToJSX.State) => React.ReactNode;
756
- };
757
- export type Rules = {
758
- [K in ParserResult['type']]: K extends typeof RuleType.table ? Rule<Extract<ParserResult, {
759
- type: K | typeof RuleType.paragraph;
760
- }>> : Rule<Extract<ParserResult, {
761
- type: K;
762
- }>>;
763
- };
764
- export type Override = RequireAtLeastOne<{
765
- component: React.ElementType;
766
- props: Object;
767
- }> | React.ElementType;
768
- export type Overrides = {
769
- [tag in HTMLTags]?: Override;
770
- } & {
771
- [customComponent: string]: Override;
735
+ disableParsingRawHTML: boolean;
736
+ /**
737
+ * Forces the compiler to have space between hash sign and the header text which
738
+ * is explicitly stated in the most of the markdown specs.
739
+ * https://github.github.com/gfm/#atx-heading
740
+ * `The opening sequence of # characters must be followed by a space or by the end of line.`
741
+ */
742
+ enforceAtxHeadings: boolean;
743
+ /**
744
+ * Forces the compiler to always output content with a block-level wrapper
745
+ * (`<p>` or any block-level syntax your markdown already contains.)
746
+ */
747
+ forceBlock: boolean;
748
+ /**
749
+ * Forces the compiler to always output content with an inline wrapper (`<span>`)
750
+ */
751
+ forceInline: boolean;
752
+ /**
753
+ * Forces the compiler to wrap results, even if there is only a single
754
+ * child or no children.
755
+ */
756
+ forceWrapper: boolean;
757
+ /**
758
+ * Supply additional HTML entity: unicode replacement mappings.
759
+ *
760
+ * Pass only the inner part of the entity as the key,
761
+ * e.g. `&le;` -> `{ "le": "\u2264" }`
762
+ *
763
+ * By default
764
+ * the following entities are replaced with their unicode equivalents:
765
+ *
766
+ * ```
767
+ * &amp;
768
+ * &apos;
769
+ * &gt;
770
+ * &lt;
771
+ * &nbsp;
772
+ * &quot;
773
+ * ```
774
+ */
775
+ namedCodesToUnicode: {
776
+ [key: string]: string;
772
777
  };
773
- export type Options = Partial<{
774
- /**
775
- * Ultimate control over the output of all rendered JSX.
776
- */
777
- createElement: (tag: Parameters<CreateElement>[0], props: React.JSX.IntrinsicAttributes, ...children: React.ReactNode[]) => React.ReactNode;
778
- /**
779
- * The library automatically generates an anchor tag for bare URLs included in the markdown
780
- * document, but this behavior can be disabled if desired.
781
- */
782
- disableAutoLink: boolean;
783
- /**
784
- * Disable the compiler's best-effort transcription of provided raw HTML
785
- * into JSX-equivalent. This is the functionality that prevents the need to
786
- * use `dangerouslySetInnerHTML` in React.
787
- */
788
- disableParsingRawHTML: boolean;
789
- /**
790
- * Forces the compiler to have space between hash sign and the header text which
791
- * is explicitly stated in the most of the markdown specs.
792
- * https://github.github.com/gfm/#atx-heading
793
- * `The opening sequence of # characters must be followed by a space or by the end of line.`
794
- */
795
- enforceAtxHeadings: boolean;
796
- /**
797
- * Forces the compiler to always output content with a block-level wrapper
798
- * (`<p>` or any block-level syntax your markdown already contains.)
799
- */
800
- forceBlock: boolean;
801
- /**
802
- * Forces the compiler to always output content with an inline wrapper (`<span>`)
803
- */
804
- forceInline: boolean;
805
- /**
806
- * Forces the compiler to wrap results, even if there is only a single
807
- * child or no children.
808
- */
809
- forceWrapper: boolean;
810
- /**
811
- * Supply additional HTML entity: unicode replacement mappings.
812
- *
813
- * Pass only the inner part of the entity as the key,
814
- * e.g. `&le;` -> `{ "le": "\u2264" }`
815
- *
816
- * By default
817
- * the following entities are replaced with their unicode equivalents:
818
- *
819
- * ```
820
- * &amp;
821
- * &apos;
822
- * &gt;
823
- * &lt;
824
- * &nbsp;
825
- * &quot;
826
- * ```
827
- */
828
- namedCodesToUnicode: {
829
- [key: string]: string;
830
- };
831
- /**
832
- * Selectively control the output of particular HTML tags as they would be
833
- * emitted by the compiler.
834
- */
835
- overrides: Overrides;
836
- /**
837
- * Allows for full control over rendering of particular rules.
838
- * For example, to implement a LaTeX renderer such as `react-katex`:
839
- *
840
- * ```
841
- * renderRule(next, node, renderChildren, state) {
842
- * if (node.type === RuleType.codeBlock && node.lang === 'latex') {
843
- * return (
844
- * <TeX as="div" key={state.key}>
845
- * {String.raw`${node.text}`}
846
- * </TeX>
847
- * )
848
- * }
849
- *
850
- * return next();
851
- * }
852
- * ```
853
- *
854
- * Thar be dragons obviously, but you can do a lot with this
855
- * (have fun!) To see how things work internally, check the `render`
856
- * method in source for a particular rule.
857
- */
858
- renderRule: (
859
- /** Resume normal processing, call this function as a fallback if you are not returning custom JSX. */
860
- next: () => React.ReactNode,
861
- /** the current AST node, use `RuleType` against `node.type` for identification */
862
- node: ParserResult,
863
- /** use as `renderChildren(node.children)` for block nodes */
864
- renderChildren: RuleOutput,
865
- /** contains `key` which should be supplied to the topmost JSX element */
866
- state: State) => React.ReactNode;
867
- /**
868
- * Override the built-in sanitizer function for URLs, etc if desired. The built-in version is available as a library export called `sanitizer`.
869
- */
870
- sanitizer: (value: string, tag: HTMLTags, attribute: string) => string | null;
871
- /**
872
- * Override normalization of non-URI-safe characters for use in generating
873
- * HTML IDs for anchor linking purposes.
874
- */
875
- slugify: (input: string, defaultFn: (input: string) => string) => string;
876
- /**
877
- * Declare the type of the wrapper to be used when there are multiple
878
- * children to render. Set to `null` to get an array of children back
879
- * without any wrapper, or use `React.Fragment` to get a React element
880
- * that won't show up in the DOM.
881
- */
882
- wrapper: React.ElementType | null;
883
- }>;
884
- export { };
885
- }
778
+ /**
779
+ * Selectively control the output of particular HTML tags as they would be
780
+ * emitted by the compiler.
781
+ */
782
+ overrides: Overrides;
783
+ /**
784
+ * Allows for full control over rendering of particular rules.
785
+ * For example, to implement a LaTeX renderer such as `react-katex`:
786
+ *
787
+ * ```
788
+ * renderRule(next, node, renderChildren, state) {
789
+ * if (node.type === RuleType.codeBlock && node.lang === 'latex') {
790
+ * return (
791
+ * <TeX as="div" key={state.key}>
792
+ * {String.raw`${node.text}`}
793
+ * </TeX>
794
+ * )
795
+ * }
796
+ *
797
+ * return next();
798
+ * }
799
+ * ```
800
+ *
801
+ * Thar be dragons obviously, but you can do a lot with this
802
+ * (have fun!) To see how things work internally, check the `render`
803
+ * method in source for a particular rule.
804
+ */
805
+ renderRule: (/** Resume normal processing, call this function as a fallback if you are not returning custom JSX. */
886
806
 
887
- declare const Markdown: React__default.ComponentType<Omit<React__default.HTMLAttributes<Element>, "children"> & {
888
- children: string;
889
- options?: MarkdownToJSX.Options;
890
- }>;
807
+ next: () => React$1.ReactNode, /** the current AST node, use `RuleType` against `node.type` for identification */
891
808
 
809
+ node: ParserResult, /** use as `renderChildren(node.children)` for block nodes */
810
+
811
+ renderChildren: RuleOutput, /** contains `key` which should be supplied to the topmost JSX element */
812
+
813
+ state: State) => React$1.ReactNode;
814
+ /**
815
+ * Override the built-in sanitizer function for URLs, etc if desired. The built-in version is available as a library export called `sanitizer`.
816
+ */
817
+ sanitizer: (value: string, tag: HTMLTags, attribute: string) => string | null;
818
+ /**
819
+ * Override normalization of non-URI-safe characters for use in generating
820
+ * HTML IDs for anchor linking purposes.
821
+ */
822
+ slugify: (input: string, defaultFn: (input: string) => string) => string;
823
+ /**
824
+ * Declare the type of the wrapper to be used when there are multiple
825
+ * children to render. Set to `null` to get an array of children back
826
+ * without any wrapper, or use `React.Fragment` to get a React element
827
+ * that won't show up in the DOM.
828
+ */
829
+ wrapper: React$1.ElementType | null;
830
+ }>;
831
+ export {};
832
+ }
833
+ //#endregion
834
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Markdown.d.ts
835
+ declare const Markdown: React.ComponentType<Omit<React.HTMLAttributes<Element>, "children"> & {
836
+ children: string;
837
+ options?: MarkdownToJSX.Options;
838
+ }>;
839
+ //#endregion
840
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Meta.d.ts
892
841
  type MetaProps = BaseAnnotations & {
893
- of?: ModuleExports;
894
- title?: string;
842
+ of?: ModuleExports;
843
+ title?: string;
895
844
  };
896
845
  /**
897
846
  * This component is used to declare component metadata in docs and gets transformed into a default
898
847
  * export underneath the hood.
899
848
  */
900
849
  declare const Meta: FC<MetaProps>;
901
-
902
- declare const Primary: React__default.ComponentType<{}>;
903
-
850
+ //#endregion
851
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Primary.d.ts
852
+ declare const Primary: React.ComponentType<{}>;
853
+ //#endregion
854
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Stories.d.ts
904
855
  interface StoriesProps {
905
- title?: ReactElement | string;
906
- includePrimary?: boolean;
856
+ title?: ReactElement | string;
857
+ includePrimary?: boolean;
907
858
  }
908
- declare const Stories: React__default.ComponentType<StoriesProps>;
909
-
910
- declare const Subheading: React__default.ComponentType<PropsWithChildren<HeadingProps>>;
911
-
859
+ declare const Stories: React.ComponentType<StoriesProps>;
860
+ //#endregion
861
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Subheading.d.ts
862
+ declare const Subheading: React.ComponentType<PropsWithChildren<HeadingProps>>;
863
+ //#endregion
864
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Subtitle.d.ts
912
865
  interface SubtitleProps {
913
- children?: ReactNode;
914
- /**
915
- * Specify where to get the subtitle from. If not specified, the subtitle will be extracted from
916
- * the meta of the attached CSF file.
917
- */
918
- of?: Of;
866
+ children?: ReactNode;
867
+ /**
868
+ * Specify where to get the subtitle from. If not specified, the subtitle will be extracted from
869
+ * the meta of the attached CSF file.
870
+ */
871
+ of?: Of;
919
872
  }
920
- declare const Subtitle: React__default.ComponentType<SubtitleProps>;
921
-
873
+ declare const Subtitle: React.ComponentType<SubtitleProps>;
874
+ //#endregion
875
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Title.d.ts
922
876
  interface TitleProps {
923
- /**
924
- * Specify where to get the title from. Must be a CSF file's default export. If not specified, the
925
- * title will be read from children, or extracted from the meta of the attached CSF file.
926
- */
927
- of?: Of;
928
- /** Specify content to display as the title. */
929
- children?: ReactNode;
877
+ /**
878
+ * Specify where to get the title from. Must be a CSF file's default export. If not specified, the
879
+ * title will be read from children, or extracted from the meta of the attached CSF file.
880
+ */
881
+ of?: Of;
882
+ /** Specify content to display as the title. */
883
+ children?: ReactNode;
930
884
  }
931
885
  declare const extractTitle: (title: ComponentTitle) => string;
932
- declare const Title: React__default.ComponentType<TitleProps>;
933
-
934
- declare const Unstyled: React__default.ComponentType<React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
935
-
936
- declare const Wrapper: React__default.ComponentType<React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
937
-
886
+ declare const Title: React.ComponentType<TitleProps>;
887
+ //#endregion
888
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Unstyled.d.ts
889
+ declare const Unstyled: React.ComponentType<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
890
+ //#endregion
891
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/Wrapper.d.ts
892
+ declare const Wrapper: React.ComponentType<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
893
+ //#endregion
894
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/blocks/mdx.d.ts
938
895
  declare const assertIsFn: (val: any) => any;
939
896
  declare const AddContext: FC<PropsWithChildren<DocsContextProps>>;
940
897
  interface CodeOrSourceMdxProps {
941
- className?: string;
898
+ className?: string;
942
899
  }
943
900
  declare const CodeOrSourceMdx: FC<PropsWithChildren<CodeOrSourceMdxProps>>;
944
901
  interface AnchorMdxProps {
945
- href: string;
946
- target: string;
902
+ href: string;
903
+ target: string;
947
904
  }
948
905
  declare const AnchorMdx: FC<PropsWithChildren<AnchorMdxProps>>;
949
906
  interface HeaderMdxProps {
950
- as: string;
951
- id: string;
907
+ as: string;
908
+ id: string;
952
909
  }
953
910
  declare const HeaderMdx: FC<PropsWithChildren<HeaderMdxProps>>;
954
911
  declare const HeadersMdx: {};
955
-
912
+ //#endregion
913
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/types.d.ts
956
914
  interface ControlProps<T> {
957
- name: string;
958
- storyId?: string;
959
- controlsId?: string;
960
- value?: T;
961
- defaultValue?: T;
962
- argType?: ArgType;
963
- /** Whether the underlying arg is required; surfaced as `aria-required` on the control's input. */
964
- required?: boolean;
965
- onChange: (value?: T) => T | void;
966
- onFocus?: (evt: any) => void;
967
- onBlur?: (evt: any) => void;
915
+ name: string;
916
+ storyId?: string;
917
+ controlsId?: string;
918
+ value?: T;
919
+ defaultValue?: T;
920
+ argType?: ArgType;
921
+ /** Whether the underlying arg is required; surfaced as `aria-required` on the control's input. */
922
+ required?: boolean;
923
+ onChange: (value?: T) => T | void;
924
+ onFocus?: (evt: any) => void;
925
+ onBlur?: (evt: any) => void;
968
926
  }
969
927
  type BooleanValue = boolean;
970
- interface BooleanConfig {
971
- }
928
+ interface BooleanConfig {}
972
929
  type ColorValue = string;
973
930
  type PresetColor = ColorValue | {
974
- color: ColorValue;
975
- title?: string;
931
+ color: ColorValue;
932
+ title?: string;
976
933
  };
977
934
  interface ColorConfig {
978
- presetColors?: PresetColor[];
979
- /**
980
- * Maximum number of preset colors shown in the color picker. When the number of presets exceeds
981
- * this value, the oldest presets are removed first (most-recently-used order). Set to `Infinity`
982
- * or `0` to disable the limit and show all presets.
983
- *
984
- * @default 27
985
- */
986
- maxPresetColors?: number;
987
- /**
988
- * Whether the color picker should be open by default when rendered.
989
- *
990
- * @default false
991
- */
992
- startOpen?: boolean;
935
+ presetColors?: PresetColor[];
936
+ /**
937
+ * Maximum number of preset colors shown in the color picker. When the number of presets exceeds
938
+ * this value, the oldest presets are removed first (most-recently-used order). Set to `Infinity`
939
+ * or `0` to disable the limit and show all presets.
940
+ *
941
+ * @default 27
942
+ */
943
+ maxPresetColors?: number;
944
+ /**
945
+ * Whether the color picker should be open by default when rendered.
946
+ *
947
+ * @default false
948
+ */
949
+ startOpen?: boolean;
993
950
  }
994
951
  type DateValue = Date | number;
995
- interface DateConfig {
996
- }
952
+ interface DateConfig {}
997
953
  type NumberValue = number;
998
954
  interface NumberConfig {
999
- min?: number;
1000
- max?: number;
1001
- step?: number;
955
+ min?: number;
956
+ max?: number;
957
+ step?: number;
1002
958
  }
1003
959
  type RangeConfig = NumberConfig;
1004
960
  type ObjectValue = any;
1005
- interface ObjectConfig {
1006
- }
961
+ interface ObjectConfig {}
1007
962
  type OptionsSingleSelection = any;
1008
963
  type OptionsMultiSelection = any[];
1009
964
  type OptionsSelection = OptionsSingleSelection | OptionsMultiSelection;
@@ -1012,21 +967,23 @@ type OptionsObject = Record<string, any>;
1012
967
  type Options = OptionsArray | OptionsObject;
1013
968
  type OptionsControlType = 'radio' | 'inline-radio' | 'check' | 'inline-check' | 'select' | 'multi-select';
1014
969
  interface OptionsConfig {
1015
- labels?: Record<any, string>;
1016
- type: OptionsControlType;
970
+ labels?: Record<any, string>;
971
+ type: OptionsControlType;
1017
972
  }
1018
973
  interface NormalizedOptionsConfig {
1019
- options: OptionsObject;
974
+ options: OptionsObject;
1020
975
  }
1021
976
  type TextValue = string;
1022
977
  interface TextConfig {
1023
- maxLength?: number;
978
+ maxLength?: number;
1024
979
  }
1025
980
  type ControlType = 'array' | 'boolean' | 'color' | 'date' | 'number' | 'range' | 'object' | OptionsControlType | 'text';
1026
981
  type Control = BooleanConfig | ColorConfig | DateConfig | NumberConfig | ObjectConfig | OptionsConfig | RangeConfig | TextConfig;
1027
-
982
+ //#endregion
983
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/Color.d.ts
1028
984
  type ColorControlProps = ControlProps<ColorValue> & ColorConfig;
1029
-
985
+ //#endregion
986
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/Boolean.d.ts
1030
987
  type BooleanProps = ControlProps<BooleanValue> & BooleanConfig;
1031
988
  /**
1032
989
  * # Boolean Control
@@ -1041,19 +998,22 @@ type BooleanProps = ControlProps<BooleanValue> & BooleanConfig;
1041
998
  * ```
1042
999
  */
1043
1000
  declare const BooleanControl: FC<BooleanProps>;
1044
-
1001
+ //#endregion
1002
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/Date.d.ts
1045
1003
  declare const parseDate: (value: string) => Date;
1046
1004
  declare const parseTime: (value: string) => Date;
1047
1005
  declare const formatDate: (value: Date | number) => string;
1048
1006
  declare const formatTime: (value: Date | number) => string;
1049
1007
  type DateProps = ControlProps<DateValue> & DateConfig;
1050
1008
  declare const DateControl: FC<DateProps>;
1051
-
1009
+ //#endregion
1010
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/Number.d.ts
1052
1011
  type NumberProps = ControlProps<NumberValue | null> & NumberConfig;
1053
1012
  declare const parse: (value: string) => number | undefined;
1054
1013
  declare const format: (value: NumberValue) => string;
1055
1014
  declare const NumberControl: FC<NumberProps>;
1056
-
1015
+ //#endregion
1016
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/options/Options.d.ts
1057
1017
  /**
1058
1018
  * Options can accept `options` in two formats:
1059
1019
  *
@@ -1069,36 +1029,41 @@ declare const NumberControl: FC<NumberProps>;
1069
1029
  declare const normalizeOptions: (options: Options, labels?: Record<any, string>) => any;
1070
1030
  type OptionsProps = ControlProps<OptionsSelection> & OptionsConfig;
1071
1031
  declare const OptionsControl: FC<OptionsProps>;
1072
-
1032
+ //#endregion
1033
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/Object.d.ts
1073
1034
  type ObjectProps = ControlProps<ObjectValue> & ObjectConfig;
1074
1035
  declare const ObjectControl: FC<ObjectProps>;
1075
-
1036
+ //#endregion
1037
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/Range.d.ts
1076
1038
  type RangeProps = ControlProps<NumberValue | null> & RangeConfig;
1077
1039
  declare const RangeControl: FC<RangeProps>;
1078
-
1040
+ //#endregion
1041
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/Text.d.ts
1079
1042
  type TextProps = ControlProps<TextValue | undefined> & TextConfig;
1080
1043
  declare const TextControl: FC<TextProps>;
1081
-
1044
+ //#endregion
1045
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/Files.d.ts
1082
1046
  interface FilesControlProps extends ControlProps<string[]> {
1083
- /**
1084
- * The accept attribute value is a string that defines the file types the file input should
1085
- * accept. This string is a comma-separated list of unique file type specifiers.
1086
- *
1087
- * @example _/_
1088
- *
1089
- * @example .webm,video/webm
1090
- *
1091
- * @example .doc,.docx,application/msword
1092
- *
1093
- * @defaultValue `image/*`
1094
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept
1095
- */
1096
- accept?: string;
1047
+ /**
1048
+ * The accept attribute value is a string that defines the file types the file input should
1049
+ * accept. This string is a comma-separated list of unique file type specifiers.
1050
+ *
1051
+ * @example _/_
1052
+ *
1053
+ * @example .webm,video/webm
1054
+ *
1055
+ * @example .doc,.docx,application/msword
1056
+ *
1057
+ * @defaultValue `image/*`
1058
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept
1059
+ */
1060
+ accept?: string;
1097
1061
  }
1098
1062
  declare const FilesControl: FC<FilesControlProps>;
1099
-
1063
+ //#endregion
1064
+ //#region code/addons/docs/.dts-emit/code/addons/docs/src/blocks/controls/index.d.ts
1100
1065
  type ColorProps = ColorControlProps;
1101
- declare const LazyColorControl: React__default.LazyExoticComponent<React__default.FC<ColorControlProps>>;
1102
- declare const ColorControl: (props: ComponentProps<typeof LazyColorControl>) => React__default.JSX.Element;
1103
-
1104
- export { AddContext, Anchor, AnchorMdx, type AnchorProps, ArgTypes, type BooleanConfig, BooleanControl, type BooleanProps, type BooleanValue, Canvas, CodeOrSourceMdx, type ColorConfig, ColorControl, ColorItem, ColorPalette, type ColorProps, type ColorValue, type Component, type Control, type ControlProps, type ControlType, Controls, type DateConfig, DateControl, type DateProps, type DateValue, Description, DescriptionType, Docs, DocsContainer, type DocsContainerProps, DocsContext, DocsPage, type DocsProps, DocsStory, type DocsStoryProps, ExternalDocs, ExternalDocsContainer, type ExternalDocsProps, FilesControl, type FilesControlProps, HeaderMdx, HeadersMdx, Heading, type HeadingProps, IconGallery, IconItem, Markdown, Meta, type NormalizedOptionsConfig, type NumberConfig, NumberControl, type NumberValue, type ObjectConfig, ObjectControl, type ObjectProps, type ObjectValue, type Of, type Options, type OptionsArray, type OptionsConfig, OptionsControl, type OptionsControlType, type OptionsMultiSelection, type OptionsObject, type OptionsProps, type OptionsSelection, type OptionsSingleSelection, PRIMARY_STORY, type PresetColor, Primary, ArgsTable as PureArgsTable, type RangeConfig, RangeControl, type SortType, Source, SourceContainer, SourceContext, type SourceContextProps, type SourceItem, type SourceParameters, type SourceProps, Stories, Story, type StoryProps, type StorySources, Subheading, Subtitle, TableOfContents, type TextConfig, TextControl, type TextProps, type TextValue, Title, Typeset, UNKNOWN_ARGS_HASH, Unstyled, Wrapper, anchorBlockIdFromId, argsHash, assertIsFn, extractTitle, format, formatDate, formatTime, getStoryId, getStoryProps, normalizeOptions, parse, parseDate, parseTime, slugs, useOf, useSourceProps };
1066
+ declare const LazyColorControl: React.LazyExoticComponent<React.FC<ColorControlProps>>;
1067
+ declare const ColorControl: (props: ComponentProps<typeof LazyColorControl>) => React.JSX.Element;
1068
+ //#endregion
1069
+ export { AddContext, Anchor, AnchorMdx, AnchorProps, ArgTypes, BooleanConfig, BooleanControl, BooleanProps, BooleanValue, Canvas, CodeOrSourceMdx, ColorConfig, ColorControl, ColorItem, ColorPalette, ColorProps, ColorValue, Component, Control, ControlProps, ControlType, Controls, DateConfig, DateControl, DateProps, DateValue, Description, DescriptionType, Docs, DocsContainer, DocsContainerProps, DocsContext, type DocsContextProps, DocsPage, DocsProps, DocsStory, DocsStoryProps, ExternalDocs, ExternalDocsContainer, ExternalDocsProps, FilesControl, FilesControlProps, HeaderMdx, HeadersMdx, Heading, HeadingProps, IconGallery, IconItem, Markdown, Meta, NormalizedOptionsConfig, NumberConfig, NumberControl, NumberValue, ObjectConfig, ObjectControl, ObjectProps, ObjectValue, Of, Options, OptionsArray, OptionsConfig, OptionsControl, OptionsControlType, OptionsMultiSelection, OptionsObject, OptionsProps, OptionsSelection, OptionsSingleSelection, PRIMARY_STORY, PresetColor, Primary, ArgsTable as PureArgsTable, RangeConfig, RangeControl, type SortType, Source, SourceContainer, SourceContext, SourceContextProps, SourceItem, SourceParameters, SourceProps, Stories, Story, StoryProps, StorySources, Subheading, Subtitle, TableOfContents, TextConfig, TextControl, TextProps, TextValue, Title, Typeset, UNKNOWN_ARGS_HASH, Unstyled, Wrapper, anchorBlockIdFromId, argsHash, assertIsFn, extractTitle, format, formatDate, formatTime, getStoryId, getStoryProps, normalizeOptions, parse, parseDate, parseTime, slugs, useOf, useSourceProps };