@component-controls/blocks
v4.0.3
Published
Component controls core documentation blocks.
Downloads
913
Readme
Table of contents
- Overview
- List of components
- getURL
- InvalidType
- getStoryTitle
- repositoryActions
- ComponentStats
- MockContext
- ThemeProvider
- Playground
- Pagination
- PackageVersion
- BlockContextProvider
- Subtitle
- LocalImport
- Search
- StoryPlayground
- LocalDependencies
- ExternalDependencies
- getUpdatedUrlParams
- ComponentContributors
- PageTypeTag
- Title
- EditPage
- getStoryBlockTitle
- ComponentJSX
- CommitsPopover
- Description
- ComponentsContainer
- StoryBlockContainer
- DocumentItem
- makeDecorators
- StoryData
- ComponentSource
- ComponentCommits
- BaseTestsCoverage
- TestsCoverage
- TestsResults
- PackageLink
- Stories
- StoryConfig
- Container
- BaseComponentCommits
- TagsList
- BaseStoryData
- BaseTestsResults
- StorySource
- PropsTable
- getUrlParams
- ComponentsBlockContainer
- BasePlayground
- useURLParams
Overview
Some of the guiding design goals for this library:
- Most components should have a 'plain' and a 'block' version, where the block version adds a collapsible Box with a title.
- There are two main categories of components:
- that display story data (i.e. story source, story render)
- that display component(s) data (i.e. prop tables, component sources)
- Components accept a list of custom ActionItems to be extended.
- Components that deal with source code (story or component source) display actions to browse their respective repositories.
List of components
getURL
react component
defined in @component-controls/blocks/ui/blocks/src/utils/url.ts
InvalidType
react component
error message when the control type is not found.
defined in @component-controls/blocks/ui/blocks/src/notifications/InvalidType.tsx
getStoryTitle
react type
defined in @component-controls/blocks/ui/blocks/src/utils/constants.ts
properties
| Name | Type | Parent | Description |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title*
| string
| Document
| title of the document. If no 'route' parameter is specifified, the title is used to generate the document url. This is the only required field, to show the document in the menu structures. |
| type
| "story"
| "blog"
| "page"
| "tags"
| "author"
| string
| Document
| document type - blogs, pages, stories and even custom ones. By default - story |
| route
| string
| Document
| if provided, will be used as the route for the page. if not provided, the title in lowercase will be used as the route |
| date
| string
| Document
| optional date the document was created. If not assigned, the instrumentation process will use birthtime |
| dateModified
| string
| Document
| optional date the document was last modified. If not assigned, the instrumentation process will use mtime |
| status
| "draft"
| "published"
| Document
| if set to draft, the document will be hidden in production builds. |
| tags
| string
[] | Document
| comma-separated list of document tags, used for search and for SOE keywords unless keyswords are specified. |
| keywords
| string
[] | Document
| comma-separated list of SEO keywords |
| description
| string
| JSX.Element
| Document
| documentation file description |
| image
| string
| Document
| link to an image for the document, will be used for SEO |
| author
| string
| Document
| document author |
| order
| number
| Document
| document order, used to sort documents within the same parent |
| menu
| string
| Document
| to which static menu to attach the document compatibility with docz |
| template
| type
bind
*: function (props
name
*: string
storyName
: string
id
: string
rawId
: string
doc
: string
storyFn
: StoryRenderFndescription
: string
arguments
: StoryArgumentsloc
: CodeLocationsource
: string
subtitle
: string
dynamic
: boolean
dynamicId
: string
component
at
*: subcomponents
: Record
<string
, (string
, Record
<string
, unknown
>, ElementType
<Props
>)>controls
: ComponentControlssmartControls
: SmartControlsdecorators
: StoryRenderFn
[]plugins
: any
category
: string
) => Example
<>bind
*: function (props
*: ) => Example
<Props
>source
: string
id
: string
description
: string
storyName
: string
rawId
: string
doc
: string
storyFn
: StoryRenderFnloc
: CodeLocationsubtitle
: string
dynamic
: boolean
dynamicId
: string
component
at
*: subcomponents
: Record
<string
, (string
, Record
<string
, unknown
>, ElementType
<Props
>)>smartControls
: SmartControlsdecorators
: StoryRenderFn
[]plugins
: any
category
: string
controls
*: source
: string
id
: string
description
: string
storyName
: string
rawId
: string
doc
: string
storyFn
: function (controlValues
[string
]: any
context
: any
) => Promise
| any
loc
start
*line
*: number
column
*: number
end
*line
*: number
column
*: number
subtitle
: string
dynamic
: boolean
dynamicId
: string
component
: string
| Record
<string
, unknown
> | ElementType
<Props
>subcomponents
: Record
<string
, (string
, Record
<string
, unknown
>, ElementType
<Props
>)>smartControls
smart
: boolean
include
: string
[] | IncludeFn
exclude
: string
[] | IncludeFn
decorators
: StoryRenderFn
[]plugins
: any
category
: string
controls
[string
]: ComponentControl
<ExampleControls
> | any
| Document
| template component to be linked to document stories |
| stories
| string
[] | Document
| list of story ids contained in the document. |
| source
| string
| Document
| source code of the entire file of stories |
| fileName
| string
| Document
| file name of the file of stories |
| package
| string