Skip to content

Commit

Permalink
fix: use new tag to hide storybook foundations stories (#3474)
Browse files Browse the repository at this point in the history
Storybook foundations pages now display as a single page instead of in
folders with their example stories appearing.
These now use the newer !dev tag to hide them. The old custom
"foundation" tag was previously used to hide them, but this tag is no
longer used.

Also fixes some linter errors encountered during commit; a couple
unused variables and incorrect typeof comparisons.
  • Loading branch information
jawinn authored Jan 3, 2025
1 parent 9d7f088 commit 616f2a7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-trees-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/preview": patch
---

Updates the tags used by the stories in the "Foundations" documentation, so hidden stories remain hidden on the sidebar.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
handles: ["click .spectrum-ActionButton:not([disabled])"],
},
},
tags: ['foundation'],
tags: ['!dev'],
};

const ActionButton = (args, context) => html`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ export default {
handles: ['click input[type="checkbox"]'],
},
},
tags: ['foundation'],
tags: ['!dev'],
};

const Checkbox = ({
customStyles = {},
isChecked = false,
...args
} = {}, context = {}) => html`
const Checkbox = (args = {}, context = {}) => html`
<div style="padding: 1rem 0;">
${Template({ ...args, iconName: undefined }, context)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export default {
args: {
rootClass: "spectrum-Foundations-Example-CornerRounding",
},
tags: ["foundation"],
tags: ["!dev"],
};

const CornerRadiusGroup = ({ customStyles = {}, ...args }, context) => html`
const CornerRadiusGroup = (args = {}, context = {}) => html`
<div>
<table class="spectrum-Foundations-Example-CornerRounding-table">
<thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
handles: ["click .spectrum-Button"],
},
},
tags: ["foundation"],
tags: ["!dev"],
};

export const ButtonDownState = Template.bind({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
handles: ["click input[type=\"checkbox\"]"],
},
},
tags: ["foundation"],
tags: ["!dev"],
};

export const CheckboxDownState = Template.bind({});
Expand Down
6 changes: 3 additions & 3 deletions .storybook/foundations/drop-shadow/drop-shadow.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
description:
"Drop shadows draw attention and give the appearance of depth. By default, this style is used to show elevation, when content appears on top of other content.",
component: "Drop shadow",
tags: ["foundation"],
tags: ["!dev"],
};

const DropShadowSwatch = ({
Expand All @@ -19,9 +19,9 @@ const DropShadowSwatch = ({
class=${classMap({
[rootClass]: true,
[`${rootClass}--${variant}-drop-shadow`]:
typeof variant !== undefined && !!isDropShadow,
typeof variant !== "undefined" && !!isDropShadow,
[`${rootClass}--${variant}-box-shadow`]:
typeof variant !== undefined && !isDropShadow,
typeof variant !== "undefined" && !isDropShadow,
})}
></div>
`;
Expand Down

0 comments on commit 616f2a7

Please sign in to comment.