@storybook/blocks 7.0.0-alpha.50 → 7.0.0-alpha.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +58 -58
  2. package/package.json +15 -15
package/dist/index.d.ts CHANGED
@@ -20,7 +20,7 @@ interface SourceCodeProps {
20
20
  format?: ComponentProps<typeof SyntaxHighlighter>['format'];
21
21
  dark?: boolean;
22
22
  }
23
- declare type SourceProps$1 = SourceErrorProps & SourceCodeProps;
23
+ type SourceProps$1 = SourceErrorProps & SourceCodeProps;
24
24
  /**
25
25
  * Syntax-highlighted source code for a component (or anything!)
26
26
  */
@@ -55,7 +55,7 @@ interface ArgTypes {
55
55
  interface Args {
56
56
  [key: string]: any;
57
57
  }
58
- declare type Globals = {
58
+ type Globals = {
59
59
  [name: string]: any;
60
60
  };
61
61
 
@@ -63,7 +63,7 @@ declare enum ArgsTableError {
63
63
  NO_COMPONENT = "No component found.",
64
64
  ARGS_UNSUPPORTED = "Args unsupported. See Args documentation for your framework."
65
65
  }
66
- declare type SortType = 'alpha' | 'requiredFirst' | 'none';
66
+ type SortType = 'alpha' | 'requiredFirst' | 'none';
67
67
  interface ArgsTableOptionProps {
68
68
  children?: React.ReactNode;
69
69
  updateArgs?: (args: Args) => void;
@@ -85,7 +85,7 @@ interface ArgsTableErrorProps {
85
85
  interface ArgsTableLoadingProps {
86
86
  isLoading: true;
87
87
  }
88
- declare type ArgsTableProps$1 = ArgsTableOptionProps & (ArgsTableDataProps | ArgsTableErrorProps | ArgsTableLoadingProps);
88
+ type ArgsTableProps$1 = ArgsTableOptionProps & (ArgsTableDataProps | ArgsTableErrorProps | ArgsTableLoadingProps);
89
89
  /**
90
90
  * Display the props for a component as a props table. Each row is a collection of
91
91
  * ArgDefs, usually derived from docgen info for the component.
@@ -106,8 +106,8 @@ interface InlineStoryProps extends CommonProps$2 {
106
106
  parameters: Parameters;
107
107
  storyFn: ElementType;
108
108
  }
109
- declare type IFrameStoryProps = CommonProps$2;
110
- declare type StoryProps$2 = InlineStoryProps | IFrameStoryProps;
109
+ type IFrameStoryProps = CommonProps$2;
110
+ type StoryProps$2 = InlineStoryProps | IFrameStoryProps;
111
111
  /**
112
112
  * A story element, either rendered inline or in an iframe,
113
113
  * with configurable height.
@@ -130,7 +130,7 @@ interface TypesetProps {
130
130
  */
131
131
  declare const Typeset: FC<TypesetProps>;
132
132
 
133
- declare type Colors = string[] | {
133
+ type Colors = string[] | {
134
134
  [key: string]: string;
135
135
  };
136
136
  interface ColorItemProps {
@@ -177,14 +177,14 @@ declare const Anchor: FC<AnchorProps>;
177
177
  declare const DocsContext: Context<DocsContextProps<Renderer>>;
178
178
 
179
179
  declare const PRIMARY_STORY = "^";
180
- declare type Component = any;
180
+ type Component = any;
181
181
  interface StoryData {
182
182
  id?: string;
183
183
  kind?: string;
184
184
  name?: string;
185
185
  parameters?: any;
186
186
  }
187
- declare type DocsStoryProps = StoryData & {
187
+ type DocsStoryProps = StoryData & {
188
188
  expanded?: boolean;
189
189
  withToolbar?: boolean;
190
190
  };
@@ -194,19 +194,19 @@ interface BaseProps {
194
194
  exclude?: Store_PropDescriptor;
195
195
  sort?: SortType;
196
196
  }
197
- declare type OfProps = BaseProps & {
197
+ type OfProps = BaseProps & {
198
198
  of: '^' | Component;
199
199
  };
200
- declare type ComponentsProps = BaseProps & {
200
+ type ComponentsProps = BaseProps & {
201
201
  components: {
202
202
  [label: string]: Component;
203
203
  };
204
204
  };
205
- declare type StoryProps$1 = BaseProps & {
205
+ type StoryProps$1 = BaseProps & {
206
206
  story: '.' | '^' | string;
207
207
  showComponent?: boolean;
208
208
  };
209
- declare type ArgsTableProps = BaseProps | OfProps | ComponentsProps | StoryProps$1;
209
+ type ArgsTableProps = BaseProps | OfProps | ComponentsProps | StoryProps$1;
210
210
  declare const extractComponentArgTypes: (component: Component, context: DocsContextProps, include?: Store_PropDescriptor, exclude?: Store_PropDescriptor) => StrictArgTypes;
211
211
  declare const getComponent: (props: ArgsTableProps, context: DocsContextProps) => Component;
212
212
  declare const StoryTable: FC<StoryProps$1 & {
@@ -220,7 +220,7 @@ interface SourceItem {
220
220
  code: string;
221
221
  format: SyntaxHighlighterFormatTypes;
222
222
  }
223
- declare type StorySources = Record<StoryId, SourceItem>;
223
+ type StorySources = Record<StoryId, SourceItem>;
224
224
  interface SourceContextProps {
225
225
  sources: StorySources;
226
226
  setSource?: (id: StoryId, item: SourceItem) => void;
@@ -241,21 +241,21 @@ interface CommonProps$1 {
241
241
  format?: PureSourceProps['format'];
242
242
  code?: string;
243
243
  }
244
- declare type SingleSourceProps = {
244
+ type SingleSourceProps = {
245
245
  id: string;
246
246
  } & CommonProps$1;
247
- declare type MultiSourceProps = {
247
+ type MultiSourceProps = {
248
248
  ids: string[];
249
249
  } & CommonProps$1;
250
- declare type CodeProps = {
250
+ type CodeProps = {
251
251
  code: string;
252
252
  } & CommonProps$1;
253
- declare type NoneProps = CommonProps$1;
254
- declare type SourceProps = SingleSourceProps | MultiSourceProps | CodeProps | NoneProps;
255
- declare type SourceStateProps = {
253
+ type NoneProps = CommonProps$1;
254
+ type SourceProps = SingleSourceProps | MultiSourceProps | CodeProps | NoneProps;
255
+ type SourceStateProps = {
256
256
  state: SourceState;
257
257
  };
258
- declare type PureSourceProps = ComponentProps<typeof Source$1>;
258
+ type PureSourceProps = ComponentProps<typeof Source$1>;
259
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,
@@ -264,7 +264,7 @@ declare const useSourceProps: (props: SourceProps, docsContext: DocsContextProps
264
264
  */
265
265
  declare const Source: FC<PureSourceProps>;
266
266
 
267
- declare type CanvasProps = Omit<PreviewProps, 'isExpanded'> & {
267
+ 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 Renderer = Renderer> = {
289
+ type DocsProps<TFramework extends Renderer = Renderer> = {
290
290
  docsParameter: Parameters;
291
291
  context: DocsContextProps<TFramework>;
292
292
  };
@@ -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 Renderer = Renderer> = {
306
+ type ExternalDocsProps<TFramework extends Renderer = Renderer> = {
307
307
  projectAnnotationsList: ProjectAnnotations<TFramework>[];
308
308
  };
309
309
  declare const ExternalDocs: FunctionComponent<ExternalDocsProps>;
@@ -318,7 +318,7 @@ interface HeadingProps {
318
318
  }
319
319
  declare const Heading: FC<HeadingProps>;
320
320
 
321
- declare type MetaProps = BaseAnnotations & {
321
+ type MetaProps = BaseAnnotations & {
322
322
  of?: Store_ModuleExports;
323
323
  };
324
324
  /**
@@ -339,23 +339,23 @@ interface StoriesProps {
339
339
  declare const Stories: FC<StoriesProps>;
340
340
 
341
341
  declare const storyBlockIdFromId: (storyId: string) => string;
342
- declare type PureStoryProps = ComponentProps<typeof Story$1>;
343
- declare type CommonProps = StoryAnnotations & {
342
+ type PureStoryProps = ComponentProps<typeof Story$1>;
343
+ type CommonProps = StoryAnnotations & {
344
344
  height?: string;
345
345
  inline?: boolean;
346
346
  };
347
- declare type StoryDefProps = {
347
+ type StoryDefProps = {
348
348
  name: string;
349
349
  };
350
- declare type StoryRefProps = {
350
+ type StoryRefProps = {
351
351
  id?: string;
352
352
  of?: Store_ModuleExport;
353
353
  meta?: Store_ModuleExports;
354
354
  };
355
- declare type StoryImportProps = {
355
+ type StoryImportProps = {
356
356
  name: string;
357
357
  };
358
- declare type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
358
+ type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
359
359
  declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
360
360
  declare const getStoryProps: <TFramework extends Renderer>({ height, inline }: StoryProps, story: Store_Story<TFramework>) => PureStoryProps;
361
361
  declare const Story: FC<StoryProps>;
@@ -402,11 +402,11 @@ interface ControlProps<T> {
402
402
  onFocus?: (evt: any) => void;
403
403
  onBlur?: (evt: any) => void;
404
404
  }
405
- declare type BooleanValue = boolean;
405
+ type BooleanValue = boolean;
406
406
  interface BooleanConfig {
407
407
  }
408
- declare type ColorValue = string;
409
- declare type PresetColor = ColorValue | {
408
+ type ColorValue = string;
409
+ type PresetColor = ColorValue | {
410
410
  color: ColorValue;
411
411
  title?: string;
412
412
  };
@@ -418,26 +418,26 @@ interface ColorConfig {
418
418
  */
419
419
  startOpen?: boolean;
420
420
  }
421
- declare type DateValue = Date | number;
421
+ type DateValue = Date | number;
422
422
  interface DateConfig {
423
423
  }
424
- declare type NumberValue = number;
424
+ type NumberValue = number;
425
425
  interface NumberConfig {
426
426
  min?: number;
427
427
  max?: number;
428
428
  step?: number;
429
429
  }
430
- declare type RangeConfig = NumberConfig;
431
- declare type ObjectValue = any;
430
+ type RangeConfig = NumberConfig;
431
+ type ObjectValue = any;
432
432
  interface ObjectConfig {
433
433
  }
434
- declare type OptionsSingleSelection = any;
435
- declare type OptionsMultiSelection = any[];
436
- declare type OptionsSelection = OptionsSingleSelection | OptionsMultiSelection;
437
- declare type OptionsArray = any[];
438
- declare type OptionsObject = Record<string, any>;
439
- declare type Options = OptionsArray | OptionsObject;
440
- declare type OptionsControlType = 'radio' | 'inline-radio' | 'check' | 'inline-check' | 'select' | 'multi-select';
434
+ type OptionsSingleSelection = any;
435
+ type OptionsMultiSelection = any[];
436
+ type OptionsSelection = OptionsSingleSelection | OptionsMultiSelection;
437
+ type OptionsArray = any[];
438
+ type OptionsObject = Record<string, any>;
439
+ type Options = OptionsArray | OptionsObject;
440
+ type OptionsControlType = 'radio' | 'inline-radio' | 'check' | 'inline-check' | 'select' | 'multi-select';
441
441
  interface OptionsConfig {
442
442
  labels: Record<any, string>;
443
443
  type: OptionsControlType;
@@ -445,17 +445,17 @@ interface OptionsConfig {
445
445
  interface NormalizedOptionsConfig {
446
446
  options: OptionsObject;
447
447
  }
448
- declare type TextValue = string;
448
+ type TextValue = string;
449
449
  interface TextConfig {
450
450
  maxLength?: number;
451
451
  }
452
- declare type ControlType = 'array' | 'boolean' | 'color' | 'date' | 'number' | 'range' | 'object' | OptionsControlType | 'text';
453
- declare type Control = BooleanConfig | ColorConfig | DateConfig | NumberConfig | ObjectConfig | OptionsConfig | RangeConfig | TextConfig;
454
- declare type Controls = Record<string, Control>;
452
+ type ControlType = 'array' | 'boolean' | 'color' | 'date' | 'number' | 'range' | 'object' | OptionsControlType | 'text';
453
+ type Control = BooleanConfig | ColorConfig | DateConfig | NumberConfig | ObjectConfig | OptionsConfig | RangeConfig | TextConfig;
454
+ type Controls = Record<string, Control>;
455
455
 
456
- declare type ColorControlProps = ControlProps<ColorValue> & ColorConfig;
456
+ type ColorControlProps = ControlProps<ColorValue> & ColorConfig;
457
457
 
458
- declare type BooleanProps = ControlProps<BooleanValue> & BooleanConfig;
458
+ type BooleanProps = ControlProps<BooleanValue> & BooleanConfig;
459
459
  /**
460
460
  * # Boolean control
461
461
  * Renders a switch toggle with "True" or "False".
@@ -467,26 +467,26 @@ declare const parseDate: (value: string) => Date;
467
467
  declare const parseTime: (value: string) => Date;
468
468
  declare const formatDate: (value: Date | number) => string;
469
469
  declare const formatTime: (value: Date | number) => string;
470
- declare type DateProps = ControlProps<DateValue> & DateConfig;
470
+ type DateProps = ControlProps<DateValue> & DateConfig;
471
471
  declare const DateControl: FC<DateProps>;
472
472
 
473
- declare type NumberProps = ControlProps<NumberValue | null> & NumberConfig;
473
+ type NumberProps = ControlProps<NumberValue | null> & NumberConfig;
474
474
  declare const parse: (value: string) => number;
475
475
  declare const format: (value: NumberValue) => string;
476
476
  declare const NumberControl: FC<NumberProps>;
477
477
 
478
- declare type OptionsProps = ControlProps<OptionsSelection> & OptionsConfig;
478
+ type OptionsProps = ControlProps<OptionsSelection> & OptionsConfig;
479
479
  declare const OptionsControl: FC<OptionsProps>;
480
480
 
481
- declare type ObjectProps = ControlProps<ObjectValue> & ObjectConfig & {
481
+ type ObjectProps = ControlProps<ObjectValue> & ObjectConfig & {
482
482
  theme: any;
483
483
  };
484
484
  declare const ObjectControl: FC<ObjectProps>;
485
485
 
486
- declare type RangeProps = ControlProps<NumberValue | null> & RangeConfig;
486
+ type RangeProps = ControlProps<NumberValue | null> & RangeConfig;
487
487
  declare const RangeControl: FC<RangeProps>;
488
488
 
489
- declare type TextProps = ControlProps<TextValue | undefined> & TextConfig;
489
+ type TextProps = ControlProps<TextValue | undefined> & TextConfig;
490
490
  declare const TextControl: FC<TextProps>;
491
491
 
492
492
  interface FilesControlProps extends ControlProps<string[]> {
@@ -505,7 +505,7 @@ interface FilesControlProps extends ControlProps<string[]> {
505
505
  }
506
506
  declare const FilesControl: FC<FilesControlProps>;
507
507
 
508
- declare type ColorProps = ColorControlProps;
508
+ type ColorProps = ColorControlProps;
509
509
  declare const LazyColorControl: React.LazyExoticComponent<React.FC<ColorControlProps>>;
510
510
  declare const ColorControl: (props: ComponentProps<typeof LazyColorControl>) => JSX.Element;
511
511
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/blocks",
3
- "version": "7.0.0-alpha.50",
3
+ "version": "7.0.0-alpha.51",
4
4
  "description": "Storybook Doc Blocks",
5
5
  "keywords": [
6
6
  "storybook"
@@ -42,17 +42,17 @@
42
42
  "prep": "../../../scripts/prepare/bundle.ts"
43
43
  },
44
44
  "dependencies": {
45
- "@storybook/api": "7.0.0-alpha.50",
46
- "@storybook/channels": "7.0.0-alpha.50",
47
- "@storybook/client-logger": "7.0.0-alpha.50",
48
- "@storybook/components": "7.0.0-alpha.50",
49
- "@storybook/core-events": "7.0.0-alpha.50",
50
- "@storybook/csf": "0.0.2-next.7",
51
- "@storybook/docs-tools": "7.0.0-alpha.50",
52
- "@storybook/preview-web": "7.0.0-alpha.50",
53
- "@storybook/store": "7.0.0-alpha.50",
54
- "@storybook/theming": "7.0.0-alpha.50",
55
- "@storybook/types": "7.0.0-alpha.50",
45
+ "@storybook/api": "7.0.0-alpha.51",
46
+ "@storybook/channels": "7.0.0-alpha.51",
47
+ "@storybook/client-logger": "7.0.0-alpha.51",
48
+ "@storybook/components": "7.0.0-alpha.51",
49
+ "@storybook/core-events": "7.0.0-alpha.51",
50
+ "@storybook/csf": "next",
51
+ "@storybook/docs-tools": "7.0.0-alpha.51",
52
+ "@storybook/preview-web": "7.0.0-alpha.51",
53
+ "@storybook/store": "7.0.0-alpha.51",
54
+ "@storybook/theming": "7.0.0-alpha.51",
55
+ "@storybook/types": "7.0.0-alpha.51",
56
56
  "@types/lodash": "^4.14.167",
57
57
  "color-convert": "^2.0.1",
58
58
  "dequal": "^2.0.2",
@@ -66,8 +66,8 @@
66
66
  "util-deprecate": "^1.0.2"
67
67
  },
68
68
  "devDependencies": {
69
- "@storybook/addon-actions": "7.0.0-alpha.50",
70
- "@storybook/addons": "7.0.0-alpha.50",
69
+ "@storybook/addon-actions": "7.0.0-alpha.51",
70
+ "@storybook/addons": "7.0.0-alpha.51",
71
71
  "@types/color-convert": "^2.0.0"
72
72
  },
73
73
  "peerDependencies": {
@@ -82,5 +82,5 @@
82
82
  "./src/index.ts"
83
83
  ]
84
84
  },
85
- "gitHead": "77184d039091f4782dc4540df6d271a24fb3e242"
85
+ "gitHead": "4fec76c3f5135854d9834ebc1cf2f1f325696ded"
86
86
  }