3.2.0 • Published 8 months ago

@pine-ds/doc-components v3.2.0

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

Pine Doc Components

Background

We started off using Storybook to document our Stencil Web Components. With Stencil you have framework integrations or Output Targets, we were using React. Instead of having multiple versions of Storybook (WebComponents, React, etc), we elected to recreate the common components we used within Storybook (ArgsTable and Canvas).

Components

docArgsTable

The docArgsTable component can be used to show a static table of arg types for a given component as a way to document its interface.

Properties

namedescription
docSourceThe docs-json output type from Stencil. During compiliation Stencil will generate a JSON file with all of the components metadata. You can read more about docs-json here. It expects the components key.
componentNameThe name of the component to lookup.

docCanvas

The Canvas component is a wrapper, featuring a series of buttons to view the various Source snippets.

Properties

namedescription
mdxSourceAn object of key/value pairs. Each key will render a button that will show the source code.

How to use

docArgsTable

import { DocArgsTable } from '@pine-ds/doc-components';
import { components } from '../../../../dist/docs.json';

<DocArgsTable componentName='pds-radio' docSource={components} />

output Alt text

docCanvas

import { DocCanvas } from '@pine-ds/doc-components';

<DocCanvas mdxSource={{
  react: `<PdsRadio componentId="message1" label="Label" helperMessage="This is short message text." />`,
  webComponent: `<pds-radio component-id="message1" label="Label" helper-message="This is short message text." />`
}}>
  <pds-radio component-id="message1" label="Label" helper-message="This is short message text." />
</DocCanvas>

output

Default state Alt text

Active Tab Alt text

3.0.3

9 months ago

3.2.0

8 months ago

3.0.2

9 months ago

3.1.0

9 months ago

3.0.1

9 months ago

2.16.3

11 months ago

2.16.4

11 months ago

2.17.0

10 months ago

2.16.1

11 months ago

2.16.2

11 months ago

3.0.0

10 months ago

2.15.0

11 months ago

2.16.0

11 months ago

2.14.0

12 months ago

1.1.1

2 years ago

1.0.0

2 years ago

0.2.4

2 years ago

0.1.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago