@storybook/blocks
Advanced tools
Comparing version 0.0.0-pr-28585-sha-af48f0d6 to 0.0.0-pr-28607-sha-54ec63fe
import { Conditional, DocsContextProps, PreparedStory, ModuleExports, Renderer as Renderer$1, Args as Args$1, StoryId, ModuleExport, ResolvedModuleExportType, ResolvedModuleExportFromType, Parameters as Parameters$1, ProjectAnnotations, BaseAnnotations, ComponentTitle } from 'storybook/internal/types'; | ||
export { DocsContextProps } from 'storybook/internal/types'; | ||
import React, { ComponentProps, FunctionComponent, ReactNode, FC, PropsWithChildren, Context, ReactElement } from 'react'; | ||
import * as React from 'react'; | ||
import React__default, { ComponentProps, FunctionComponent, ReactNode, FC, PropsWithChildren, Context, ReactElement } from 'react'; | ||
import { PropDescriptor } from 'storybook/internal/preview-api'; | ||
import { Renderer } from '@storybook/csf'; | ||
import { PropDescriptor } from 'storybook/internal/preview-api'; | ||
import { SupportedLanguage, SyntaxHighlighter, ActionItem, SyntaxHighlighterFormatTypes } from 'storybook/internal/components'; | ||
import { SourceType } from 'storybook/internal/docs-tools'; | ||
import { ThemeVars } from 'storybook/internal/theming'; | ||
import PureMarkdown from 'markdown-to-jsx'; | ||
@@ -16,17 +16,9 @@ declare enum SourceError { | ||
interface SourceCodeProps { | ||
/** | ||
* The language the syntax highlighter uses for your story’s code | ||
*/ | ||
/** The language the syntax highlighter uses for your story’s code */ | ||
language?: SupportedLanguage; | ||
/** | ||
* Use this to override the content of the source block. | ||
*/ | ||
/** Use this to override the content of the source block. */ | ||
code?: string; | ||
/** | ||
* The (prettier) formatter the syntax highlighter uses for your story’s code. | ||
*/ | ||
/** The (prettier) formatter the syntax highlighter uses for your story’s code. */ | ||
format?: ComponentProps<typeof SyntaxHighlighter>['format']; | ||
/** | ||
* Display the source snippet in a dark mode. | ||
*/ | ||
/** Display the source snippet in a dark mode. */ | ||
dark?: boolean; | ||
@@ -38,5 +30,3 @@ } | ||
} | ||
/** | ||
* Syntax-highlighted source code for a component (or anything!) | ||
*/ | ||
/** Syntax-highlighted source code for a component (or anything!) */ | ||
declare const Source$1: FunctionComponent<SourceProps$1>; | ||
@@ -96,3 +86,3 @@ | ||
interface ArgsTableOptionProps { | ||
children?: React.ReactNode; | ||
children?: React__default.ReactNode; | ||
updateArgs?: (args: Args) => void; | ||
@@ -119,4 +109,4 @@ resetArgs?: (argNames?: string[]) => void; | ||
/** | ||
* Display the props for a component as a props table. Each row is a collection of | ||
* ArgDefs, usually derived from docgen info for the component. | ||
* Display the props for a component as a props table. Each row is a collection of ArgDefs, usually | ||
* derived from docgen info for the component. | ||
*/ | ||
@@ -151,4 +141,4 @@ declare const ArgsTable: FC<ArgsTableProps>; | ||
/** | ||
* Convenient styleguide documentation showing examples of type | ||
* with different sizes and weights and configurable sample text. | ||
* Convenient styleguide documentation showing examples of type with different sizes and weights and | ||
* configurable sample text. | ||
*/ | ||
@@ -166,12 +156,12 @@ declare const Typeset: FC<TypesetProps>; | ||
/** | ||
* A single color row your styleguide showing title, subtitle and one or more colors, used | ||
* as a child of `ColorPalette`. | ||
* A single color row your styleguide showing title, subtitle and one or more colors, used as a | ||
* child of `ColorPalette`. | ||
*/ | ||
declare const ColorItem: FunctionComponent<ColorItemProps>; | ||
interface ColorPaletteProps { | ||
children?: React.ReactNode; | ||
children?: React__default.ReactNode; | ||
} | ||
/** | ||
* Styleguide documentation for colors, including names, captions, and color swatches, | ||
* all specified as `ColorItem` children of this wrapper component. | ||
* Styleguide documentation for colors, including names, captions, and color swatches, all specified | ||
* as `ColorItem` children of this wrapper component. | ||
*/ | ||
@@ -182,14 +172,10 @@ declare const ColorPalette: FunctionComponent<ColorPaletteProps>; | ||
name: string; | ||
children?: React.ReactNode; | ||
children?: React__default.ReactNode; | ||
} | ||
/** | ||
* An individual icon with a caption and an example (passed as `children`). | ||
*/ | ||
/** An individual icon with a caption and an example (passed as `children`). */ | ||
declare const IconItem: FunctionComponent<IconItemProps>; | ||
interface IconGalleryProps { | ||
children?: React.ReactNode; | ||
children?: React__default.ReactNode; | ||
} | ||
/** | ||
* Show a grid of icons, as specified by `IconItem`. | ||
*/ | ||
/** Show a grid of icons, as specified by `IconItem`. */ | ||
declare const IconGallery: FunctionComponent<IconGalleryProps>; | ||
@@ -233,13 +219,7 @@ | ||
type SourceParameters = SourceCodeProps & { | ||
/** | ||
* Where to read the source code from, see `SourceType` | ||
*/ | ||
/** Where to read the source code from, see `SourceType` */ | ||
type?: SourceType; | ||
/** | ||
* Transform the detected source for display | ||
*/ | ||
/** Transform the detected source for display */ | ||
transform?: (code: string, storyContext: ReturnType<DocsContextProps['getStoryContext']>) => string; | ||
/** | ||
* Internal: set by our CSF loader (`enrichCsf` in `@storybook/csf-tools`). | ||
*/ | ||
/** Internal: set by our CSF loader (`enrichCsf` in `@storybook/csf-tools`). */ | ||
originalSource?: string; | ||
@@ -255,9 +235,7 @@ }; | ||
* | ||
* <Source of={ButtonStories.Primary} /> | ||
* <Source of={ButtonStories.Primary} />; | ||
* ``` | ||
*/ | ||
of?: ModuleExport; | ||
/** | ||
* Internal prop to control if a story re-renders on args updates | ||
*/ | ||
/** Internal prop to control if a story re-renders on args updates */ | ||
__forceInitialArgs?: boolean; | ||
@@ -268,5 +246,4 @@ }; | ||
/** | ||
* Story source doc block renders source code if provided, | ||
* or the source for a story if `storyId` is provided, or | ||
* the source for the current story if nothing is provided. | ||
* Story source doc block renders source code if provided, or the source for a story if `storyId` is | ||
* provided, or the source for the current story if nothing is provided. | ||
*/ | ||
@@ -276,5 +253,3 @@ declare const Source: FC<SourceProps>; | ||
type PureStoryProps = ComponentProps<typeof Story$1>; | ||
/** | ||
* Props to reference another story | ||
*/ | ||
/** Props to reference another story */ | ||
type StoryRefProps = { | ||
@@ -300,3 +275,3 @@ /** | ||
* | ||
* <Story of={ButtonStories.Primary} meta={ButtonStories} /> | ||
* <Story of={ButtonStories.Primary} meta={ButtonStories} />; | ||
* ``` | ||
@@ -307,21 +282,11 @@ */ | ||
type StoryParameters = { | ||
/** | ||
* Render the story inline or in an iframe | ||
*/ | ||
/** Render the story inline or in an iframe */ | ||
inline?: boolean; | ||
/** | ||
* When rendering in an iframe (`inline={false}`), set the story height | ||
*/ | ||
/** When rendering in an iframe (`inline={false}`), set the story height */ | ||
height?: string; | ||
/** | ||
* Whether to run the story's play function | ||
*/ | ||
/** Whether to run the story's play function */ | ||
autoplay?: boolean; | ||
/** | ||
* Internal prop to control if a story re-renders on args updates | ||
*/ | ||
/** Internal prop to control if a story re-renders on args updates */ | ||
__forceInitialArgs?: boolean; | ||
/** | ||
* Internal prop if this story is the primary story | ||
*/ | ||
/** Internal prop if this story is the primary story */ | ||
__primary?: boolean; | ||
@@ -354,3 +319,3 @@ }; | ||
* | ||
* <Canvas of={ButtonStories.Primary} meta={ButtonStories} /> | ||
* <Canvas of={ButtonStories.Primary} meta={ButtonStories} />; | ||
* ``` | ||
@@ -360,6 +325,6 @@ */ | ||
/** | ||
* Specify the initial state of the source panel | ||
* hidden: the source panel is hidden by default | ||
* shown: the source panel is shown by default | ||
* none: the source panel is not available and the button to show it is hidden | ||
* Specify the initial state of the source panel hidden: the source panel is hidden by default | ||
* shown: the source panel is shown by default none: the source panel is not available and the | ||
* button to show it is hidden | ||
* | ||
* @default 'hidden' | ||
@@ -369,16 +334,12 @@ */ | ||
/** | ||
* how to layout the story within the canvas | ||
* padded: the story has padding within the canvas | ||
* fullscreen: the story is rendered edge to edge within the canvas | ||
* centered: the story is centered within the canvas | ||
* How to layout the story within the canvas padded: the story has padding within the canvas | ||
* fullscreen: the story is rendered edge to edge within the canvas centered: the story is | ||
* centered within the canvas | ||
* | ||
* @default 'padded' | ||
*/ | ||
layout?: Layout; | ||
/** | ||
* @see {SourceProps} | ||
*/ | ||
/** @see {SourceProps} */ | ||
source?: Omit<SourceProps, 'dark'>; | ||
/** | ||
* @see {StoryProps} | ||
*/ | ||
/** @see {StoryProps} */ | ||
story?: Pick<StoryProps, 'inline' | 'height' | 'autoplay' | '__forceInitialArgs' | '__primary'>; | ||
@@ -400,6 +361,5 @@ }; | ||
/** | ||
* A hook to resolve the `of` prop passed to a block. | ||
* will return the resolved module | ||
* if the resolved module is a meta it will include a preparedMeta property similar to a preparedStory | ||
* if the resolved module is a component it will include the project annotations | ||
* A hook to resolve the `of` prop passed to a block. will return the resolved module if the | ||
* resolved module is a meta it will include a preparedMeta property similar to a preparedStory if | ||
* the resolved module is a component it will include the project annotations | ||
*/ | ||
@@ -416,4 +376,4 @@ declare const useOf: <TType extends ResolvedModuleExportType>(moduleExportOrType: Of, validTypes?: TType[]) => ResolvedModuleExportFromType<TType>; | ||
/** | ||
* Specify where to get the description from. Can be a component, a CSF file or a story. | ||
* If not specified, the description will be extracted from the meta of the attached CSF file. | ||
* Specify where to get the description from. Can be a component, a CSF file or a story. If not | ||
* specified, the description will be extracted from the meta of the attached CSF file. | ||
*/ | ||
@@ -428,3 +388,3 @@ of?: Of; | ||
}; | ||
declare function Docs<TRenderer extends Renderer$1 = Renderer$1>({ context, docsParameter, }: DocsProps<TRenderer>): React.JSX.Element; | ||
declare function Docs<TRenderer extends Renderer$1 = Renderer$1>({ context, docsParameter, }: DocsProps<TRenderer>): React__default.JSX.Element; | ||
@@ -454,5 +414,5 @@ declare const DocsPage: FC; | ||
}; | ||
declare function ExternalDocs<TRenderer extends Renderer$1 = Renderer$1>({ projectAnnotationsList, children, }: PropsWithChildren<ExternalDocsProps<TRenderer>>): React.JSX.Element; | ||
declare function ExternalDocs<TRenderer extends Renderer$1 = Renderer$1>({ projectAnnotationsList, children, }: PropsWithChildren<ExternalDocsProps<TRenderer>>): React__default.JSX.Element; | ||
declare const ExternalDocsContainer: React.FC<React.PropsWithChildren<{ | ||
declare const ExternalDocsContainer: React__default.FC<React__default.PropsWithChildren<{ | ||
projectAnnotations: any; | ||
@@ -466,5 +426,393 @@ }>>; | ||
type MarkdownProps = typeof PureMarkdown extends React.ComponentType<infer Props> ? Props : never; | ||
declare const Markdown: (props: MarkdownProps) => React.JSX.Element; | ||
/** | ||
* markdown-to-jsx is a fork of | ||
* [simple-markdown v0.2.2](https://github.com/Khan/simple-markdown) | ||
* from Khan Academy. Thank you Khan devs for making such an awesome | ||
* and extensible parsing infra... without it, half of the | ||
* optimizations here wouldn't be feasible. 🙏🏼 | ||
*/ | ||
/** | ||
* Analogous to `node.type`. Please note that the values here may change at any time, | ||
* so do not hard code against the value directly. | ||
*/ | ||
declare const enum RuleType { | ||
blockQuote = "0", | ||
breakLine = "1", | ||
breakThematic = "2", | ||
codeBlock = "3", | ||
codeFenced = "4", | ||
codeInline = "5", | ||
footnote = "6", | ||
footnoteReference = "7", | ||
gfmTask = "8", | ||
heading = "9", | ||
headingSetext = "10", | ||
/** only available if not `disableHTMLParsing` */ | ||
htmlBlock = "11", | ||
htmlComment = "12", | ||
/** only available if not `disableHTMLParsing` */ | ||
htmlSelfClosing = "13", | ||
image = "14", | ||
link = "15", | ||
/** emits a `link` 'node', does not render directly */ | ||
linkAngleBraceStyleDetector = "16", | ||
/** emits a `link` 'node', does not render directly */ | ||
linkBareUrlDetector = "17", | ||
/** emits a `link` 'node', does not render directly */ | ||
linkMailtoDetector = "18", | ||
newlineCoalescer = "19", | ||
orderedList = "20", | ||
paragraph = "21", | ||
ref = "22", | ||
refImage = "23", | ||
refLink = "24", | ||
table = "25", | ||
tableSeparator = "26", | ||
text = "27", | ||
textBolded = "28", | ||
textEmphasized = "29", | ||
textEscaped = "30", | ||
textMarked = "31", | ||
textStrikethroughed = "32", | ||
unorderedList = "33" | ||
} | ||
declare const enum Priority { | ||
/** | ||
* anything that must scan the tree before everything else | ||
*/ | ||
MAX = 0, | ||
/** | ||
* scans for block-level constructs | ||
*/ | ||
HIGH = 1, | ||
/** | ||
* inline w/ more priority than other inline | ||
*/ | ||
MED = 2, | ||
/** | ||
* inline elements | ||
*/ | ||
LOW = 3, | ||
/** | ||
* bare text and stuff that is considered leftovers | ||
*/ | ||
MIN = 4 | ||
} | ||
/** | ||
* A simple HOC for easy React use. Feed the markdown content as a direct child | ||
* and the rest is taken care of automatically. | ||
*/ | ||
declare const Markdown$1: React.FC<{ | ||
[key: string]: any; | ||
children: string; | ||
options?: MarkdownToJSX.Options; | ||
}>; | ||
declare namespace MarkdownToJSX { | ||
/** | ||
* RequireAtLeastOne<{ ... }> <- only requires at least one key | ||
*/ | ||
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]; | ||
export type CreateElement = typeof React.createElement; | ||
export type HTMLTags = keyof JSX.IntrinsicElements; | ||
export type State = { | ||
/** true if the current content is inside anchor link grammar */ | ||
inAnchor?: boolean; | ||
/** true if parsing in an inline context (subset of rules around formatting and links) */ | ||
inline?: boolean; | ||
/** true if in a table */ | ||
inTable?: boolean; | ||
/** use this for the `key` prop */ | ||
key?: React.Key; | ||
/** true if in a list */ | ||
list?: boolean; | ||
/** true if parsing in inline context w/o links */ | ||
simple?: boolean; | ||
}; | ||
export interface BlockQuoteNode { | ||
children: MarkdownToJSX.ParserResult[]; | ||
type: RuleType.blockQuote; | ||
} | ||
export interface BreakLineNode { | ||
type: RuleType.breakLine; | ||
} | ||
export interface BreakThematicNode { | ||
type: RuleType.breakThematic; | ||
} | ||
export interface CodeBlockNode { | ||
type: RuleType.codeBlock; | ||
attrs?: JSX.IntrinsicAttributes; | ||
lang?: string; | ||
text: string; | ||
} | ||
export interface CodeFencedNode { | ||
type: RuleType.codeFenced; | ||
} | ||
export interface CodeInlineNode { | ||
type: RuleType.codeInline; | ||
text: string; | ||
} | ||
export interface FootnoteNode { | ||
type: RuleType.footnote; | ||
} | ||
export interface FootnoteReferenceNode { | ||
type: RuleType.footnoteReference; | ||
target: string; | ||
text: string; | ||
} | ||
export interface GFMTaskNode { | ||
type: RuleType.gfmTask; | ||
completed: boolean; | ||
} | ||
export interface HeadingNode { | ||
type: RuleType.heading; | ||
children: MarkdownToJSX.ParserResult[]; | ||
id: string; | ||
level: 1 | 2 | 3 | 4 | 5 | 6; | ||
} | ||
export interface HeadingSetextNode { | ||
type: RuleType.headingSetext; | ||
} | ||
export interface HTMLCommentNode { | ||
type: RuleType.htmlComment; | ||
} | ||
export interface ImageNode { | ||
type: RuleType.image; | ||
alt?: string; | ||
target: string; | ||
title?: string; | ||
} | ||
export interface LinkNode { | ||
type: RuleType.link; | ||
children: MarkdownToJSX.ParserResult[]; | ||
target: string; | ||
title?: string; | ||
} | ||
export interface LinkAngleBraceNode { | ||
type: RuleType.linkAngleBraceStyleDetector; | ||
} | ||
export interface LinkBareURLNode { | ||
type: RuleType.linkBareUrlDetector; | ||
} | ||
export interface LinkMailtoNode { | ||
type: RuleType.linkMailtoDetector; | ||
} | ||
export interface OrderedListNode { | ||
type: RuleType.orderedList; | ||
items: MarkdownToJSX.ParserResult[][]; | ||
ordered: true; | ||
start?: number; | ||
} | ||
export interface UnorderedListNode { | ||
type: RuleType.unorderedList; | ||
items: MarkdownToJSX.ParserResult[][]; | ||
ordered: false; | ||
} | ||
export interface NewlineNode { | ||
type: RuleType.newlineCoalescer; | ||
} | ||
export interface ParagraphNode { | ||
type: RuleType.paragraph; | ||
children: MarkdownToJSX.ParserResult[]; | ||
} | ||
export interface ReferenceNode { | ||
type: RuleType.ref; | ||
} | ||
export interface ReferenceImageNode { | ||
type: RuleType.refImage; | ||
alt?: string; | ||
ref: string; | ||
} | ||
export interface ReferenceLinkNode { | ||
type: RuleType.refLink; | ||
children: MarkdownToJSX.ParserResult[]; | ||
fallbackChildren: MarkdownToJSX.ParserResult[]; | ||
ref: string; | ||
} | ||
export interface TableNode { | ||
type: RuleType.table; | ||
/** | ||
* alignment for each table column | ||
*/ | ||
align: ('left' | 'right' | 'center')[]; | ||
cells: MarkdownToJSX.ParserResult[][][]; | ||
header: MarkdownToJSX.ParserResult[][]; | ||
} | ||
export interface TableSeparatorNode { | ||
type: RuleType.tableSeparator; | ||
} | ||
export interface TextNode { | ||
type: RuleType.text; | ||
text: string; | ||
} | ||
export interface BoldTextNode { | ||
type: RuleType.textBolded; | ||
children: MarkdownToJSX.ParserResult[]; | ||
} | ||
export interface ItalicTextNode { | ||
type: RuleType.textEmphasized; | ||
children: MarkdownToJSX.ParserResult[]; | ||
} | ||
export interface EscapedTextNode { | ||
type: RuleType.textEscaped; | ||
} | ||
export interface MarkedTextNode { | ||
type: RuleType.textMarked; | ||
children: MarkdownToJSX.ParserResult[]; | ||
} | ||
export interface StrikethroughTextNode { | ||
type: RuleType.textStrikethroughed; | ||
children: MarkdownToJSX.ParserResult[]; | ||
} | ||
export interface HTMLNode { | ||
type: RuleType.htmlBlock; | ||
attrs: JSX.IntrinsicAttributes; | ||
children?: ReturnType<MarkdownToJSX.NestedParser> | undefined; | ||
noInnerParse: Boolean; | ||
tag: MarkdownToJSX.HTMLTags; | ||
text?: string | undefined; | ||
} | ||
export interface HTMLSelfClosingNode { | ||
type: RuleType.htmlSelfClosing; | ||
attrs: JSX.IntrinsicAttributes; | ||
tag: string; | ||
} | ||
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; | ||
export type NestedParser = (input: string, state?: MarkdownToJSX.State) => MarkdownToJSX.ParserResult[]; | ||
export type Parser<ParserOutput> = (capture: RegExpMatchArray, nestedParse: NestedParser, state?: MarkdownToJSX.State) => ParserOutput; | ||
export type RuleOutput = (ast: MarkdownToJSX.ParserResult | MarkdownToJSX.ParserResult[], state: MarkdownToJSX.State) => JSX.Element; | ||
export type Rule<ParserOutput = MarkdownToJSX.ParserResult> = { | ||
match: (source: string, state: MarkdownToJSX.State, prevCapturedString?: string) => RegExpMatchArray; | ||
order: Priority; | ||
parse: MarkdownToJSX.Parser<Omit<ParserOutput, 'type'>>; | ||
render?: (node: ParserOutput, | ||
/** | ||
* Continue rendering AST nodes if applicable. | ||
*/ | ||
render: RuleOutput, state?: MarkdownToJSX.State) => React.ReactChild; | ||
}; | ||
export type Rules = { | ||
[K in ParserResult['type']]: Rule<Extract<ParserResult, { | ||
type: K; | ||
}>>; | ||
}; | ||
export type Override = RequireAtLeastOne<{ | ||
component: React.ElementType; | ||
props: Object; | ||
}> | React.ElementType; | ||
export type Overrides = { | ||
[tag in HTMLTags]?: Override; | ||
} & { | ||
[customComponent: string]: Override; | ||
}; | ||
export type Options = Partial<{ | ||
/** | ||
* Ultimate control over the output of all rendered JSX. | ||
*/ | ||
createElement: (tag: Parameters<CreateElement>[0], props: JSX.IntrinsicAttributes, ...children: React.ReactChild[]) => React.ReactChild; | ||
/** | ||
* Disable the compiler's best-effort transcription of provided raw HTML | ||
* into JSX-equivalent. This is the functionality that prevents the need to | ||
* use `dangerouslySetInnerHTML` in React. | ||
*/ | ||
disableParsingRawHTML: boolean; | ||
/** | ||
* Forces the compiler to have space between hash sign and the header text which | ||
* is explicitly stated in the most of the markdown specs. | ||
* https://github.github.com/gfm/#atx-heading | ||
* `The opening sequence of # characters must be followed by a space or by the end of line.` | ||
*/ | ||
enforceAtxHeadings: boolean; | ||
/** | ||
* Forces the compiler to always output content with a block-level wrapper | ||
* (`<p>` or any block-level syntax your markdown already contains.) | ||
*/ | ||
forceBlock: boolean; | ||
/** | ||
* Forces the compiler to always output content with an inline wrapper (`<span>`) | ||
*/ | ||
forceInline: boolean; | ||
/** | ||
* Forces the compiler to wrap results, even if there is only a single | ||
* child or no children. | ||
*/ | ||
forceWrapper: boolean; | ||
/** | ||
* Supply additional HTML entity: unicode replacement mappings. | ||
* | ||
* Pass only the inner part of the entity as the key, | ||
* e.g. `≤` -> `{ "le": "\u2264" }` | ||
* | ||
* By default | ||
* the following entities are replaced with their unicode equivalents: | ||
* | ||
* ``` | ||
* & | ||
* ' | ||
* > | ||
* < | ||
* | ||
* " | ||
* ``` | ||
*/ | ||
namedCodesToUnicode: { | ||
[key: string]: string; | ||
}; | ||
/** | ||
* Selectively control the output of particular HTML tags as they would be | ||
* emitted by the compiler. | ||
*/ | ||
overrides: Overrides; | ||
/** | ||
* Allows for full control over rendering of particular rules. | ||
* For example, to implement a LaTeX renderer such as `react-katex`: | ||
* | ||
* ``` | ||
* renderRule(next, node, renderChildren, state) { | ||
* if (node.type === RuleType.codeBlock && node.lang === 'latex') { | ||
* return ( | ||
* <TeX as="div" key={state.key}> | ||
* {String.raw`${node.text}`} | ||
* </TeX> | ||
* ) | ||
* } | ||
* | ||
* return next(); | ||
* } | ||
* ``` | ||
* | ||
* Thar be dragons obviously, but you can do a lot with this | ||
* (have fun!) To see how things work internally, check the `render` | ||
* method in source for a particular rule. | ||
*/ | ||
renderRule: ( | ||
/** Resume normal processing, call this function as a fallback if you are not returning custom JSX. */ | ||
next: () => React.ReactChild, | ||
/** the current AST node, use `RuleType` against `node.type` for identification */ | ||
node: ParserResult, | ||
/** use as `renderChildren(node.children)` for block nodes */ | ||
renderChildren: RuleOutput, | ||
/** contains `key` which should be supplied to the topmost JSX element */ | ||
state: State) => React.ReactChild; | ||
/** | ||
* Override normalization of non-URI-safe characters for use in generating | ||
* HTML IDs for anchor linking purposes. | ||
*/ | ||
slugify: (source: string) => string; | ||
/** | ||
* Declare the type of the wrapper to be used when there are multiple | ||
* children to render. Set to `null` to get an array of children back | ||
* without any wrapper, or use `React.Fragment` to get a React element | ||
* that won't show up in the DOM. | ||
*/ | ||
wrapper: React.ElementType | null; | ||
}>; | ||
export {}; | ||
} | ||
type MarkdownProps = typeof Markdown$1 extends React__default.ComponentType<infer Props> ? Props : never; | ||
declare const Markdown: (props: MarkdownProps) => React__default.JSX.Element; | ||
type MetaProps = BaseAnnotations & { | ||
@@ -475,4 +823,4 @@ of?: ModuleExports; | ||
/** | ||
* This component is used to declare component metadata in docs | ||
* and gets transformed into a default export underneath the hood. | ||
* This component is used to declare component metadata in docs and gets transformed into a default | ||
* export underneath the hood. | ||
*/ | ||
@@ -482,5 +830,3 @@ declare const Meta: FC<MetaProps>; | ||
interface PrimaryProps { | ||
/** | ||
* Specify where to get the primary story from. | ||
*/ | ||
/** Specify where to get the primary story from. */ | ||
of?: Of; | ||
@@ -501,4 +847,4 @@ } | ||
/** | ||
* Specify where to get the subtitle from. | ||
* If not specified, the subtitle will be extracted from the meta of the attached CSF file. | ||
* Specify where to get the subtitle from. If not specified, the subtitle will be extracted from | ||
* the meta of the attached CSF file. | ||
*/ | ||
@@ -511,9 +857,7 @@ of?: Of; | ||
/** | ||
* Specify where to get the title from. Must be a CSF file's default export. | ||
* If not specified, the title will be read from children, or extracted from the meta of the attached CSF file. | ||
* Specify where to get the title from. Must be a CSF file's default export. If not specified, the | ||
* title will be read from children, or extracted from the meta of the attached CSF file. | ||
*/ | ||
of?: Of; | ||
/** | ||
* Specify content to display as the title. | ||
*/ | ||
/** Specify content to display as the title. */ | ||
children?: ReactNode; | ||
@@ -524,5 +868,5 @@ } | ||
declare const Unstyled: React.FC<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>; | ||
declare const Unstyled: React__default.FC<React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>; | ||
declare const Wrapper: FC<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>; | ||
declare const Wrapper: FC<React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>; | ||
@@ -568,2 +912,3 @@ declare const assertIsFn: (val: any) => any; | ||
* Whether the color picker should be open by default when rendered. | ||
* | ||
* @default false | ||
@@ -612,10 +957,10 @@ */ | ||
* # Boolean Control | ||
* Renders a switch toggle with "True" or "False". | ||
* or if the value is `undefined`, renders a button to set the boolean. | ||
* | ||
* Renders a switch toggle with "True" or "False". or if the value is `undefined`, renders a button | ||
* to set the boolean. | ||
* | ||
* ## Example usage | ||
* | ||
* ``` | ||
* | ||
* <BooleanControl name="isTrue" value={value} onChange={handleValueChange}/> | ||
* <BooleanControl name="isTrue" value={value} onChange={handleValueChange} />; | ||
* ``` | ||
@@ -651,9 +996,11 @@ */ | ||
/** | ||
* The accept attribute value is a string that defines the file types the file input should accept. This string is a comma-separated list of unique file type specifiers. | ||
* @example | ||
* *\/* | ||
* @example | ||
* .webm,video/webm | ||
* @example | ||
* .doc,.docx,application/msword | ||
* The accept attribute value is a string that defines the file types the file input should | ||
* accept. This string is a comma-separated list of unique file type specifiers. | ||
* | ||
* @example _/_ | ||
* | ||
* @example .webm,video/webm | ||
* | ||
* @example .doc,.docx,application/msword | ||
* | ||
* @defaultValue `image/*` | ||
@@ -667,5 +1014,5 @@ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept | ||
type ColorProps = ColorControlProps; | ||
declare const LazyColorControl: React.LazyExoticComponent<React.FC<ColorControlProps>>; | ||
declare const ColorControl: (props: ComponentProps<typeof LazyColorControl>) => React.JSX.Element; | ||
declare const LazyColorControl: React__default.LazyExoticComponent<React__default.FC<ColorControlProps>>; | ||
declare const ColorControl: (props: ComponentProps<typeof LazyColorControl>) => React__default.JSX.Element; | ||
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, DescriptionContainer as Description, DescriptionType, Docs, DocsContainer, DocsContainerProps, DocsContext, 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, SortType, Source, SourceContainer, SourceContext, SourceContextProps, SourceItem, SourceProps, Stories, Story, StoryProps, StorySources, Subheading, Subtitle, TextConfig, TextControl, TextProps, TextValue, Title, Typeset, UNKNOWN_ARGS_HASH, Unstyled, Wrapper, anchorBlockIdFromId, argsHash, assertIsFn, extractTitle, format, formatDate, formatTime, getStoryId, getStoryProps, parse, parseDate, parseTime, useOf, useSourceProps }; |
{ | ||
"name": "@storybook/blocks", | ||
"version": "0.0.0-pr-28585-sha-af48f0d6", | ||
"version": "0.0.0-pr-28607-sha-54ec63fe", | ||
"description": "Storybook Doc Blocks", | ||
@@ -26,3 +26,2 @@ "keywords": [ | ||
"types": "./dist/index.d.ts", | ||
"node": "./dist/index.js", | ||
"import": "./dist/index.mjs", | ||
@@ -44,13 +43,17 @@ "require": "./dist/index.js" | ||
"scripts": { | ||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts", | ||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts" | ||
"check": "jiti ../../../scripts/prepare/check.ts", | ||
"prep": "jiti ../../../scripts/prepare/bundle.ts" | ||
}, | ||
"dependencies": { | ||
"@storybook/csf": "0.1.11", | ||
"@storybook/global": "^5.0.0", | ||
"@storybook/icons": "^1.2.5", | ||
"@types/lodash": "^4.14.167", | ||
"@storybook/csf": "0.1.12", | ||
"@storybook/icons": "^1.2.12", | ||
"ts-dedent": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@storybook/addon-actions": "0.0.0-pr-28607-sha-54ec63fe", | ||
"@storybook/react": "0.0.0-pr-28607-sha-54ec63fe", | ||
"@storybook/test": "0.0.0-pr-28607-sha-54ec63fe", | ||
"@types/color-convert": "^2.0.0", | ||
"color-convert": "^2.0.1", | ||
"dequal": "^2.0.2", | ||
"lodash": "^4.17.21", | ||
"es-toolkit": "^1.22.0", | ||
"markdown-to-jsx": "^7.4.5", | ||
@@ -61,10 +64,2 @@ "memoizerific": "^1.11.3", | ||
"telejson": "^7.2.0", | ||
"ts-dedent": "^2.0.0", | ||
"util-deprecate": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@storybook/addon-actions": "0.0.0-pr-28585-sha-af48f0d6", | ||
"@storybook/react": "0.0.0-pr-28585-sha-af48f0d6", | ||
"@storybook/test": "0.0.0-pr-28585-sha-af48f0d6", | ||
"@types/color-convert": "^2.0.0", | ||
"tocbot": "^4.20.1" | ||
@@ -75,3 +70,3 @@ }, | ||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta", | ||
"storybook": "^0.0.0-pr-28585-sha-af48f0d6" | ||
"storybook": "^0.0.0-pr-28607-sha-54ec63fe" | ||
}, | ||
@@ -78,0 +73,0 @@ "peerDependenciesMeta": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
603660
6
3304
12
6
11
+ Added@storybook/csf@0.1.12(transitive)
- Removed@storybook/global@^5.0.0
- Removed@types/lodash@^4.14.167
- Removedcolor-convert@^2.0.1
- Removeddequal@^2.0.2
- Removedlodash@^4.17.21
- Removedmarkdown-to-jsx@^7.4.5
- Removedmemoizerific@^1.11.3
- Removedpolished@^4.2.2
- Removedreact-colorful@^5.1.2
- Removedtelejson@^7.2.0
- Removedutil-deprecate@^1.0.2
- Removed@babel/runtime@7.26.0(transitive)
- Removed@storybook/csf@0.1.11(transitive)
- Removed@storybook/global@5.0.0(transitive)
- Removed@types/lodash@4.17.13(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removeddequal@2.0.3(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmap-or-similar@1.5.0(transitive)
- Removedmarkdown-to-jsx@7.7.2(transitive)
- Removedmemoizerific@1.11.3(transitive)
- Removedpolished@4.3.1(transitive)
- Removedreact-colorful@5.6.1(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedtelejson@7.2.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updated@storybook/csf@0.1.12
Updated@storybook/icons@^1.2.12