Skip to content

Commit e5b9eea

Browse files
feat(inlinealert): enhance chromatic coverage
1 parent 5bf2af2 commit e5b9eea

File tree

1 file changed

+61
-18
lines changed

1 file changed

+61
-18
lines changed

components/inlinealert/stories/inlinealert.stories.js

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { html } from "lit";
2-
2+
import { styleMap } from "lit/directives/style-map.js";
33
import { Template } from "./template";
44

55
/**
@@ -58,29 +58,72 @@ export default {
5858
},
5959
};
6060

61-
export const Default = (args) => html`
62-
<div>
61+
export const Default = (args, context) => html`
62+
<div style=${styleMap({
63+
display: "flex",
64+
flexDirection: "column",
65+
alignItems: "flex-start",
66+
gap: "1rem",
67+
"--mod-detail-margin-end": ".3rem",
68+
})}>
6369
${Template({
6470
...args
6571
})}
6672
6773
${
6874
window.isChromatic() ?
69-
Template({
70-
...args,
71-
headerText: "in-line alert header announcing something very long and in-line",
72-
text: "this is a very urgent alert with a lot of context, so the text has to wrap",
73-
customStyles: {"max-width": "400px"}
74-
})
75-
&&
76-
Template({
77-
...args,
78-
headerText: "in-line alert header announcing something very long and in-line",
79-
text: "this is a very urgent alert with a lot of context, so the text has to wrap",
80-
customStyles: {"max-width": "400px"},
81-
variant: "notice",
82-
isClosable: true,
83-
})
75+
html`
76+
<div style=${styleMap({
77+
display: "flex",
78+
alignItems: "flex-start",
79+
flexDirection: "column",
80+
gap: "1rem",
81+
"--mod-detail-margin-end": ".3rem",
82+
})}>
83+
${Template({
84+
...args,
85+
headerText: "in-line alert header announcing something very long and in-line",
86+
text: "this is a very urgent alert with a lot of context, so the text has to wrap",
87+
customStyles: {"max-width": "400px"}
88+
}, context)}
89+
${Template({
90+
...args,
91+
headerText: "in-line alert header announcing something very long and in-line",
92+
text: "this is a very urgent alert with a lot of context, so the text has to wrap",
93+
variant: "info",
94+
customStyles: {"max-width": "400px"},
95+
}, context)}
96+
${Template({
97+
...args,
98+
headerText: "in-line alert header announcing something very long and in-line",
99+
text: "this is a very urgent alert with a lot of context, so the text has to wrap",
100+
variant: "negative",
101+
customStyles: {"max-width": "400px"},
102+
}, context)}
103+
${Template({
104+
...args,
105+
headerText: "in-line alert header announcing something very long and in-line",
106+
text: "this is a very urgent alert with a lot of context, so the text has to wrap",
107+
variant: "positive",
108+
customStyles: {"max-width": "400px"},
109+
}, context)}
110+
${Template({
111+
...args,
112+
headerText: "in-line alert header announcing something very long and in-line",
113+
text: "this is a very urgent alert with a lot of context, so the text has to wrap",
114+
variant: "notice",
115+
customStyles: {"max-width": "400px"},
116+
}, context)}
117+
${Template({
118+
...args,
119+
headerText: "closable alert header announcing something very long and in-line",
120+
text: "this is a very urgent alert with a lot of context, so the text has to wrap",
121+
customStyles: {"max-width": "400px"},
122+
variant: "positive",
123+
isClosable: true,
124+
}, context)}
125+
</div>
126+
`
84127
: null
85128
}
86129
</div>

0 commit comments

Comments
 (0)