Skip to content

Commit 42d0baa

Browse files
committed
fix(tray): storybook heading text control and unused import
The Storybook "heading" control was previously not usable, due to how the arg was being passed through to the Dialog. This text string control will now change the heading. Replaces an "unused" import for Modal whose CSS is still necessary for the Tray to render correctly. The unused import would be deleted on save/fix, resulting in the wrong styles. Replaced the template import with an import of just the CSS for Modal.
1 parent 5252c7f commit 42d0baa

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

components/tray/stories/template.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { classMap } from "lit/directives/class-map.js";
33
import { ifDefined } from "lit/directives/if-defined.js";
44
import { styleMap } from "lit/directives/style-map.js";
55

6-
import { Template as Modal } from "@spectrum-css/modal/stories/template.js";
7-
6+
import "@spectrum-css/modal/index.css";
87
import "../index.css";
98

109
export const Template = ({

components/tray/stories/tray.stories.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default {
2929
rootClass: "spectrum-Tray",
3030
customClasses: ["spectrum-Modal"],
3131
isOpen: true,
32+
heading: "New Messages",
3233
},
3334
parameters: {
3435
actions: {
@@ -43,15 +44,16 @@ export default {
4344
};
4445

4546
export const Default = ({
47+
heading,
4648
...args
4749
}) => {
4850
return html`
4951
<div>
5052
${Template({
51-
heading: "Tray Dialog",
53+
...args,
5254
content: [
5355
() => Dialog({
54-
heading: "New Messages",
56+
heading,
5557
content: ["You have 5 new messages!"],
5658
isDismissable: false,
5759
})
@@ -62,7 +64,6 @@ export const Default = ({
6264
window.isChromatic() ?
6365
Template({
6466
...args,
65-
heading: "Tray Dialog",
6667
content: [
6768
() => Dialog({
6869
heading: "You have new messages waiting in your inbox",
@@ -79,4 +80,3 @@ export const Default = ({
7980
</div>
8081
`;
8182
};
82-
Default.args = {};

0 commit comments

Comments
 (0)