@storybook/blocks 7.0.0-alpha.49 → 7.0.0-alpha.50
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/index.d.ts +14 -11
- package/dist/index.js +19 -19
- package/dist/index.mjs +8 -8
- package/jest.config.js +7 -0
- package/package.json +15 -15
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FunctionComponent, ComponentProps, ReactNode, FC, ElementType, Context } from 'react';
|
|
2
|
-
import { Conditional, Parameters,
|
|
2
|
+
import { Conditional, Parameters, Renderer, Store_PropDescriptor, StrictArgTypes, StoryId, ProjectAnnotations, BaseAnnotations, Store_ModuleExports, Store_Story, StoryAnnotations, Store_ModuleExport, ComponentTitle } from '@storybook/types';
|
|
3
3
|
import { DocsContextProps } from '@storybook/preview-web';
|
|
4
4
|
export { DocsContextProps } from '@storybook/preview-web';
|
|
5
5
|
import { SyntaxHighlighter, ActionItem, SyntaxHighlighterFormatTypes } from '@storybook/components';
|
|
@@ -174,7 +174,7 @@ interface AnchorProps {
|
|
|
174
174
|
}
|
|
175
175
|
declare const Anchor: FC<AnchorProps>;
|
|
176
176
|
|
|
177
|
-
declare const DocsContext: Context<DocsContextProps<
|
|
177
|
+
declare const DocsContext: Context<DocsContextProps<Renderer>>;
|
|
178
178
|
|
|
179
179
|
declare const PRIMARY_STORY = "^";
|
|
180
180
|
declare type Component = any;
|
|
@@ -256,7 +256,7 @@ declare type SourceStateProps = {
|
|
|
256
256
|
state: SourceState;
|
|
257
257
|
};
|
|
258
258
|
declare type PureSourceProps = ComponentProps<typeof Source$1>;
|
|
259
|
-
declare const
|
|
259
|
+
declare const useSourceProps: (props: SourceProps, docsContext: DocsContextProps<any>, sourceContext: SourceContextProps) => PureSourceProps & SourceStateProps;
|
|
260
260
|
/**
|
|
261
261
|
* Story source doc block renders source code if provided,
|
|
262
262
|
* or the source for a story if `storyId` is provided, or
|
|
@@ -264,7 +264,7 @@ declare const getSourceProps: (props: SourceProps, docsContext: DocsContextProps
|
|
|
264
264
|
*/
|
|
265
265
|
declare const Source: FC<PureSourceProps>;
|
|
266
266
|
|
|
267
|
-
declare type CanvasProps = PreviewProps & {
|
|
267
|
+
declare type CanvasProps = Omit<PreviewProps, 'isExpanded'> & {
|
|
268
268
|
withSource?: SourceState;
|
|
269
269
|
mdxSource?: string;
|
|
270
270
|
};
|
|
@@ -286,7 +286,7 @@ interface DescriptionProps {
|
|
|
286
286
|
declare const getDescriptionProps: ({ of, type, markdown, children }: DescriptionProps, { storyById }: DocsContextProps<any>) => DescriptionProps$1;
|
|
287
287
|
declare const DescriptionContainer: FC<DescriptionProps>;
|
|
288
288
|
|
|
289
|
-
declare type DocsProps<TFramework extends
|
|
289
|
+
declare type DocsProps<TFramework extends Renderer = Renderer> = {
|
|
290
290
|
docsParameter: Parameters;
|
|
291
291
|
context: DocsContextProps<TFramework>;
|
|
292
292
|
};
|
|
@@ -294,7 +294,7 @@ declare const Docs: FunctionComponent<DocsProps>;
|
|
|
294
294
|
|
|
295
295
|
declare const DocsPage: FC;
|
|
296
296
|
|
|
297
|
-
interface DocsContainerProps<TFramework extends
|
|
297
|
+
interface DocsContainerProps<TFramework extends Renderer = Renderer> {
|
|
298
298
|
context: DocsContextProps<TFramework>;
|
|
299
299
|
theme?: ThemeVars;
|
|
300
300
|
children?: ReactNode;
|
|
@@ -303,7 +303,7 @@ declare const DocsContainer: FunctionComponent<DocsContainerProps>;
|
|
|
303
303
|
|
|
304
304
|
declare const DocsStory: FC<DocsStoryProps>;
|
|
305
305
|
|
|
306
|
-
declare type ExternalDocsProps<TFramework extends
|
|
306
|
+
declare type ExternalDocsProps<TFramework extends Renderer = Renderer> = {
|
|
307
307
|
projectAnnotationsList: ProjectAnnotations<TFramework>[];
|
|
308
308
|
};
|
|
309
309
|
declare const ExternalDocs: FunctionComponent<ExternalDocsProps>;
|
|
@@ -346,7 +346,6 @@ declare type CommonProps = StoryAnnotations & {
|
|
|
346
346
|
};
|
|
347
347
|
declare type StoryDefProps = {
|
|
348
348
|
name: string;
|
|
349
|
-
children: ReactNode;
|
|
350
349
|
};
|
|
351
350
|
declare type StoryRefProps = {
|
|
352
351
|
id?: string;
|
|
@@ -355,11 +354,10 @@ declare type StoryRefProps = {
|
|
|
355
354
|
};
|
|
356
355
|
declare type StoryImportProps = {
|
|
357
356
|
name: string;
|
|
358
|
-
story: ElementType;
|
|
359
357
|
};
|
|
360
358
|
declare type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
|
|
361
359
|
declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
|
|
362
|
-
declare const getStoryProps: <TFramework extends
|
|
360
|
+
declare const getStoryProps: <TFramework extends Renderer>({ height, inline }: StoryProps, story: Store_Story<TFramework>) => PureStoryProps;
|
|
363
361
|
declare const Story: FC<StoryProps>;
|
|
364
362
|
|
|
365
363
|
declare const Subheading: FC<HeadingProps>;
|
|
@@ -458,6 +456,11 @@ declare type Controls = Record<string, Control>;
|
|
|
458
456
|
declare type ColorControlProps = ControlProps<ColorValue> & ColorConfig;
|
|
459
457
|
|
|
460
458
|
declare type BooleanProps = ControlProps<BooleanValue> & BooleanConfig;
|
|
459
|
+
/**
|
|
460
|
+
* # Boolean control
|
|
461
|
+
* Renders a switch toggle with "True" or "False".
|
|
462
|
+
* or if the value is `undefined`, renders a button to set the boolean.
|
|
463
|
+
*/
|
|
461
464
|
declare const BooleanControl: FC<BooleanProps>;
|
|
462
465
|
|
|
463
466
|
declare const parseDate: (value: string) => Date;
|
|
@@ -506,4 +509,4 @@ declare type ColorProps = ColorControlProps;
|
|
|
506
509
|
declare const LazyColorControl: React.LazyExoticComponent<React.FC<ColorControlProps>>;
|
|
507
510
|
declare const ColorControl: (props: ComponentProps<typeof LazyColorControl>) => JSX.Element;
|
|
508
511
|
|
|
509
|
-
export { AddContext, Anchor, AnchorMdx, AnchorProps, ArgsTable, BooleanConfig, BooleanControl, BooleanProps, BooleanValue, Canvas, CodeOrSourceMdx, ColorConfig, ColorControl, ColorItem, ColorPalette, ColorProps, ColorValue, Component, ComponentsTable, Control, ControlProps, ControlType, Controls, DateConfig, DateControl, DateProps, DateValue, DescriptionContainer as Description, DescriptionType, Docs, DocsContainer, DocsContainerProps, DocsContext, DocsPage, DocsProps, DocsStory, DocsStoryProps, ExternalDocs, ExternalDocsContainer, ExternalDocsProps, FilesControl, FilesControlProps, HeaderMdx, HeadersMdx, Heading, HeadingProps, IconGallery, IconItem, Meta, NoControlsWarning, NormalizedOptionsConfig, NumberConfig, NumberControl, NumberValue, ObjectConfig, ObjectControl, ObjectProps, ObjectValue, Options, OptionsArray, OptionsConfig, OptionsControl, OptionsControlType, OptionsMultiSelection, OptionsObject, OptionsProps, OptionsSelection, OptionsSingleSelection, PRIMARY_STORY, PresetColor, Primary, ArgsTable$1 as PureArgsTable, RangeConfig, RangeControl, SortType, Source, SourceContainer, SourceContext, SourceContextProps, SourceItem, SourceState, Stories, Story, StoryData, StoryProps, StorySources, StoryTable, Subheading, Subtitle, TextConfig, TextControl, TextProps, TextValue, Title, Typeset, Wrapper, anchorBlockIdFromId, assertIsFn, extractComponentArgTypes, extractTitle, format, formatDate, formatTime, getComponent, getDescriptionProps,
|
|
512
|
+
export { AddContext, Anchor, AnchorMdx, AnchorProps, ArgsTable, BooleanConfig, BooleanControl, BooleanProps, BooleanValue, Canvas, CodeOrSourceMdx, ColorConfig, ColorControl, ColorItem, ColorPalette, ColorProps, ColorValue, Component, ComponentsTable, Control, ControlProps, ControlType, Controls, DateConfig, DateControl, DateProps, DateValue, DescriptionContainer as Description, DescriptionType, Docs, DocsContainer, DocsContainerProps, DocsContext, DocsPage, DocsProps, DocsStory, DocsStoryProps, ExternalDocs, ExternalDocsContainer, ExternalDocsProps, FilesControl, FilesControlProps, HeaderMdx, HeadersMdx, Heading, HeadingProps, IconGallery, IconItem, Meta, NoControlsWarning, NormalizedOptionsConfig, NumberConfig, NumberControl, NumberValue, ObjectConfig, ObjectControl, ObjectProps, ObjectValue, Options, OptionsArray, OptionsConfig, OptionsControl, OptionsControlType, OptionsMultiSelection, OptionsObject, OptionsProps, OptionsSelection, OptionsSingleSelection, PRIMARY_STORY, PresetColor, Primary, ArgsTable$1 as PureArgsTable, RangeConfig, RangeControl, SortType, Source, SourceContainer, SourceContext, SourceContextProps, SourceItem, SourceState, Stories, Story, StoryData, StoryProps, StorySources, StoryTable, Subheading, Subtitle, TextConfig, TextControl, TextProps, TextValue, Title, Typeset, Wrapper, anchorBlockIdFromId, assertIsFn, extractComponentArgTypes, extractTitle, format, formatDate, formatTime, getComponent, getDescriptionProps, getStoryId, getStoryProps, parse, parseDate, parseTime, storyBlockIdFromId, useSourceProps };
|