NCIOCPL / ncids

NCI Design System
8 stars 5 forks source link

Enabler: Enable a way to preview complex components in documentation site. #439

Open bryanpizzillo opened 2 years ago

bryanpizzillo commented 2 years ago

Enable a way to preview complex components in documentation site.

ESTIMATE TBD

There are components, specifically the NCI Header, that cannot be just added to a preview. There are a number of assumptions as to positioning (e.g., the header is at the top of the page) that should be made, but previews do not always appear in the perfect places as the previews show in the middle of the page. Also reflows based on breakpoints are also hard to handle within the previews.

We should take an approach like USWDS does for their header where the preview is actually a screenshot that links to a full HTML page with working JS.

NOTE: ❗❗ There should be no janky must build ncids-css/ncids-js and copy files first. This should ALL be done as part of the doc site build.

Notes

Note: This ticket is related to #938 and #945, as they both involve previewing both the component and the code for the component.

bryanpizzillo commented 2 years ago

I think the easiest solution for this is to publish the ncids-js-testing example site to a folder under the documentation site. (Like we did for Storybook) This way we can just use the pages we are actually using for tests. We probably should also add something to the component to handle correctly linking to the demo site, as well as providing a screenshot for the thing we are previewing.

sarinapadilla commented 10 months ago

We will continue to develop a solution for this ticket based on the findings from #1164 .

sarinapadilla commented 5 months ago

This story is blocked by #1224.