Add Storybook links to the docs site for Web Components and RDS Storybook - #2801
Add Storybook links to the docs site for Web Components and RDS Storybook#2801itsmedavep wants to merge 2 commits into
Conversation
1f6abce to
d93c283
Compare
niqjohnson
left a comment
There was a problem hiding this comment.
High level, I wonder if we can refactor this a little to centralize all the markup for the links in one spot so we don't have to repeat it on every page. Take this with a grain of salt since I'm out of practice with the Design System, though. Can we move the markup to variation-content.html, something like:
{% if page.storybook_links and page.storybook_links.size > 0 %}
<ul class="m-list m-list--links">
{% for storybook_link in page.storybook_links %}
<li class="m-list__item">
<a class="a-link a-link--jump" href="{{ storybook_link.href }}">
[storybook icon goes here]
<span class="a-link__text">{{ storybook_link.text }}</span>
</a>
</li>
{% endfor %}
</ul>
{% endif %}Then we'd have a storybook_links field in the markdown files that can contain any number of links in it (the content of which would be the link text and the link URL). That would probably have to be hooked up to appear in Decap, too, right?
So it would be more upfront setup this way, but it would probably make it easier to add more links in the future (and would keep the markup in one spot if we ever need to change it).
What do you think?
|
|
||
| <div> | ||
| <span class="storybook-brand-color"><cfpb-icon name="storybook" /></span> | ||
| <cfpb-link link-variant="external"><a href="https://cfpb.github.io/design-system/web-components/?path=/docs/web-components-cfpb-alert--overview">Web component</a></cfpb-link> |
There was a problem hiding this comment.
Can this be marked up as our standard link with icon component? If we want to go that route, I think we can get rid of the external link icon at the end and use just the Storybook icon as the icon (since these links all still point to cfpb.github.io). I think we can get around having to wrap the icon in a span if we move the markup to a template instead of in the markdown.
There was a problem hiding this comment.
A couple of things
- I tired to match the concept that Jenn had closely, if we want to move away from that I think what you suggest here makes sense.
- I was trying to use web components for this since we really should be moving off the legacy components IMO.
- Given that, if we loose both icons in favor of only the Storybook one it probably would become
<cfpb-link href="#" icon-left="Storybook">This is a link</cfpb-link>
| highlight successful submissions, errors that need to be corrected, or details | ||
| to know before submitting a form. | ||
|
|
||
| <div> |
There was a problem hiding this comment.
Can this be marked up as our standard link list component? Semantically I think that makes sense, but I'm not sure if it'll throw anything off in the layout.
There was a problem hiding this comment.
It can and probably should but I believe it introduced layout issues when I tried to use the WC cfpb-list component. I can revisit.
https://cfpb.github.io/design-system/components/reference-for-custom-elements#list
EG:
<cfpb-list>
<cfpb-link><a href="#">Item 1</a></cfpb-link>
<cfpb-link><a href="#">Item 2</a></cfpb-link>
<cfpb-link><a href="#">Item 3</a></cfpb-link>
</cfpb-list> <cfpb-list gap="compact">
Yeah, that is an interesting question. We probably could do that. I think if we did we would probably want to use the Web Component version (so It would need to be hooked up in DeCap. One thing to point out is that I consciously was avoiding making changes to DeCap with this PR. That was/is because of our DeCap woes. I didn't want DeCap's issues to sidetrack this from getting done. Since right now DeCap's future is questionable, and there are bugs, I am not exactly sure what the right move would be for this. Thoughts? |






This addresses the desire to have the docs site link to the WC and Reac Storybooks.
This only covers the docs pages where we have Storybook stories for both the WC and React versions as a first step in the process.
Additionally, this adds the Storybook svg icon and colors it with a class by wrapping it in a
<span>.That was necessary because DeCap descriptions use >- style markdown and if we used the cfpb-icon colorization natively it would hit a YAML parsing error. (it works fine in the WC reference docs page because it lives outside of a description)
That means it covers:
alerts
buttons
expandables
filter tags
taglines
yarn startand verify there are now links to WC and React Storybooks.Additions
Removals
Changes
Testing
Screenshots
Notes and todos
Checklist
Testing checklist
Browsers
Check the current browser support cutoff list for browsers that are advisable
to prioritize for testing.
Accessibility
Other