From 6b54af210756316808acbf26f7e5258581b2b773 Mon Sep 17 00:00:00 2001 From: Max Morgan Date: Mon, 29 Jul 2024 10:44:33 -0400 Subject: [PATCH] Add a storybook arg for show --- src/stories/articlecard.stories.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/stories/articlecard.stories.js b/src/stories/articlecard.stories.js index 8545c0b0..98760b09 100644 --- a/src/stories/articlecard.stories.js +++ b/src/stories/articlecard.stories.js @@ -26,6 +26,10 @@ export default { description: 'The subtitle of the article. Custom markdown is supported.', }, color: COMMON_STORY_ARGS.bootstrapColor, + show: { + control: { type: 'boolean' }, + description: 'Toggle to show or hide the article card title text.', + }, }, args: { src: 'https://placehold.co/300x400', @@ -36,6 +40,7 @@ export default { color: 'primary', href: 'https://www.example.com', target: '_blank', + show: false, }, }; @@ -57,6 +62,9 @@ function _createArticleCard(args) { articleCardElt1.setAttribute('color', args.color); articleCardElt1.setAttribute('href', args.href); articleCardElt1.setAttribute('target', args.target); + if (args.show) { + articleCardElt1.setAttribute('show', 'show'); + } if (_containsHTMLTags(args.title)) { const title = _createElementFromHTML(args.title); title.slot = 'title';