4.0.3 • Published 2 years ago

@component-controls/addon-catalog v4.0.3

Weekly downloads
452
License
MIT
Repository
github
Last release
2 years ago

Table of contents

In action

Example site

Overview

Addon to collect and display a grid-like list of component cards. Each card displays some component statistics - like the dates the component file was created and last committed, the number of commits as well as the component contributors, the number of lines and comments as well as a preview of the first story in the components' document ESM or MDX file.

Getting Started

Install

yarn add @component-controls/addon-catalog --dev

Usage

---
title: Components/index
---
import { Catalog } from '@component-controls/addon-catalog';


# Components

<Catalog
  filter={({ doc }) => doc.title.startsWith('Components')} <-- filter which components to display
  group={({ story }) => story.category} <- grouping of the filtered components by the category field of the document
/>

API

Catalog

react component

defined in @component-controls/addon-catalog/plugins/addon-catalog/src/Catalog/Catalog.tsx

properties

NameTypeParentDescription
filterfunction (props*story*name*: stringstoryName: stringid: stringrawId: stringdoc: stringstoryFn: function (controlValues*: context*: ) => Promise | anydescription: stringarguments: StoryArgument[]locstart*: end*: source: stringsubtitle: stringdynamic: booleandynamicId: stringcomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>controls[string]: ComponentControl<P>smartControlssmart*: include*: exclude*: decorators: StoryRenderFn[]plugins: anycategory: stringdoc*[string]: anytitle*: stringtype: "story" | "blog" | "page" | "tags" | "author" | stringroute: stringdate: stringdateModified: stringstatus: "draft" | "published"tags: string[]keywords: string[]description: string | JSX.Elementimage: stringauthor: stringorder: numbermenu: stringtemplatebind*: function (props*: ) => Example<>bind*: source*: id*: storyName*: rawId*: doc*: storyFn*: description*: loc*: subtitle*: dynamic*: dynamicId*: component*: subcomponents*: smartControls*: decorators*: plugins*: category*: controls*: source: stringid: stringstoryName: stringrawId: stringdoc: stringstoryFn: StoryRenderFndescription: stringloc: CodeLocationsubtitle: stringdynamic: booleandynamicId: stringcomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>smartControls: SmartControlsdecorators: StoryRenderFn[]plugins: anycategory: stringcontrols: ExampleControlsstories: string[]source: stringfileName: stringpackage: stringtestFiles: string[]testCoverage: string[]testData: stringrenderFn: function (props*: ) => anydata[string]: componentsLookup[string]: stringMDXPage: anyisMDXComponent: booleanparameters: anycomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>controls[string]: ComponentControl<P>smartControlssmart*: include*: exclude*: decorators: StoryRenderFn[]plugins: anycategory: stringnavSidebar: booleancontextSidebar: booleanfullPage: boolean) => booleanComponentsCatalogPropsfilter stories/documents
groupfunction (props*story*name*: stringstoryName: stringid: stringrawId: stringdoc: stringstoryFn: function (controlValues*: context*: ) => Promise | anydescription: stringarguments: StoryArgument[]locstart*: end*: source: stringsubtitle: stringdynamic: booleandynamicId: stringcomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>controls[string]: ComponentControl<P>smartControlssmart*: include*: exclude*: decorators: StoryRenderFn[]plugins: anycategory: stringdoc*[string]: anytitle*: stringtype: "story" | "blog" | "page" | "tags" | "author" | stringroute: stringdate: stringdateModified: stringstatus: "draft" | "published"tags: string[]keywords: string[]description: string | JSX.Elementimage: stringauthor: stringorder: numbermenu: stringtemplatebind*: source*: id*: storyName*: rawId*: doc*: storyFn*: description*: loc*: subtitle*: dynamic*: dynamicId*: component*: subcomponents*: smartControls*: decorators*: plugins*: category*: controls*: stories: string[]source: stringfileName: stringpackage: stringtestFiles: string[]testCoverage: string[]testData: stringrenderFn: function (props*: ) => anydata[string]: componentsLookup[string]: stringMDXPage: anyisMDXComponent: booleanparameters: anycomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>controls[string]: ComponentControl<P>smartControlssmart*: include*: exclude*: decorators: StoryRenderFn[]plugins: anycategory: stringnavSidebar: booleancontextSidebar: booleanfullPage: boolean) => stringComponentsCatalogPropsgrouping function
groupSortfunction (groups*: string[]) => string[]ComponentsCatalogPropsgroup/category sorting
slotstring | undefinedHTMLAttributes
styleCSSProperties | undefinedHTMLAttributes
titlestring | undefinedHTMLAttributes
keyKey | null | undefinedAttributes
sxThemeUICSSObject | ThemeDerivedStylesAttributesThe ThemeUIStyleObject extends [style props](https://emotion.sh/docs/object-styles) such that properties that are part of the Theme will be transformed to their corresponding values. Other valid CSS properties are also allowed.
defaultCheckedboolean | undefinedHTMLAttributes
defaultValuestring | number | ReadonlyArray<string> | undefinedHTMLAttributes
suppressContentEditableWarningboolean | undefinedHTMLAttributes
suppressHydrationWarningboolean | undefinedHTMLAttributes
accessKeystring | undefined
4.0.3

2 years ago

3.15.0

3 years ago

3.11.4

3 years ago

3.13.1

3 years ago

3.11.3

3 years ago

3.9.1

3 years ago

3.9.0

3 years ago

3.10.1

3 years ago

3.8.0

3 years ago

3.10.0

3 years ago

3.10.3

3 years ago

3.12.0

3 years ago

3.10.2

3 years ago

3.14.1

3 years ago

3.14.0

3 years ago

3.10.4

3 years ago

3.8.3

3 years ago

3.14.3

3 years ago

3.8.2

3 years ago

3.14.2

3 years ago

3.8.1

3 years ago

3.14.5

3 years ago

3.14.4

3 years ago

3.14.6

3 years ago

3.11.0

3 years ago

3.7.0

3 years ago

3.13.0

3 years ago

3.11.2

3 years ago

3.11.1

3 years ago

3.6.3

3 years ago

3.6.2

3 years ago

3.6.1

3 years ago

3.6.0

3 years ago

3.5.5

3 years ago

3.5.4

3 years ago

3.5.3

3 years ago

3.5.2

3 years ago

3.5.1

3 years ago

3.5.0

3 years ago

3.4.5

3 years ago

3.4.4

3 years ago

3.4.3

3 years ago

3.4.2

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

3.1.3

3 years ago

3.3.0

3 years ago

3.2.0

3 years ago

3.1.6

3 years ago

3.1.5

3 years ago

3.1.4

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

2.13.0

3 years ago

2.12.0

3 years ago

2.11.3

3 years ago

2.11.2

3 years ago

2.10.5

3 years ago

2.10.3

3 years ago

2.10.4

3 years ago

2.11.0

3 years ago

2.11.1

3 years ago

2.10.2

3 years ago

2.10.1

3 years ago

2.10.0

3 years ago

2.9.1

3 years ago

2.9.0

3 years ago

2.8.1

3 years ago

2.8.0

3 years ago

2.7.0

3 years ago