@navikt/ds-react 5.3.3 → 5.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/alert/alert.stories.tsx +24 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.4",
|
|
4
4
|
"description": "Aksel react-components for NAV designsystem",
|
|
5
5
|
"author": "Aksel | NAV designsystem team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@floating-ui/react": "0.24.1",
|
|
41
|
-
"@navikt/aksel-icons": "^5.3.
|
|
41
|
+
"@navikt/aksel-icons": "^5.3.4",
|
|
42
42
|
"@radix-ui/react-tabs": "1.0.0",
|
|
43
43
|
"@radix-ui/react-toggle-group": "1.0.0",
|
|
44
44
|
"clsx": "^1.2.1",
|
|
@@ -149,11 +149,22 @@ export const Links = () => {
|
|
|
149
149
|
);
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
const AlertWithCloseButton = ({
|
|
152
|
+
const AlertWithCloseButton = ({
|
|
153
|
+
children,
|
|
154
|
+
size,
|
|
155
|
+
}: {
|
|
156
|
+
size?: "medium" | "small";
|
|
157
|
+
children?: React.ReactNode;
|
|
158
|
+
}) => {
|
|
153
159
|
let [show, setShow] = React.useState(true);
|
|
154
160
|
|
|
155
161
|
return show ? (
|
|
156
|
-
<Alert
|
|
162
|
+
<Alert
|
|
163
|
+
variant="warning"
|
|
164
|
+
size={size}
|
|
165
|
+
closeButton
|
|
166
|
+
onClose={() => setShow(false)}
|
|
167
|
+
>
|
|
157
168
|
{children || "Content"}
|
|
158
169
|
</Alert>
|
|
159
170
|
) : null;
|
|
@@ -165,14 +176,22 @@ export const WithCloseButton: Story = {
|
|
|
165
176
|
<div className="colgap">
|
|
166
177
|
<AlertWithCloseButton />
|
|
167
178
|
<AlertWithCloseButton>
|
|
179
|
+
<BodyLong>Ullamco ullamco laborum et commodo sint culpa</BodyLong>
|
|
180
|
+
</AlertWithCloseButton>
|
|
181
|
+
<AlertWithCloseButton>
|
|
182
|
+
<DsHeading spacing size="small" level="3">
|
|
183
|
+
Aliquip duis est in commodo pariatur
|
|
184
|
+
</DsHeading>
|
|
168
185
|
<BodyLong>
|
|
169
186
|
Ullamco ullamco laborum et commodo sint culpa cupidatat culpa qui
|
|
170
187
|
laboris ex. Labore ex occaecat proident qui qui fugiat magna. Fugiat
|
|
171
188
|
sint commodo consequat eu aute.
|
|
172
189
|
</BodyLong>
|
|
173
|
-
<Link href="#">Id elit esse enim reprehenderit</Link>
|
|
174
190
|
</AlertWithCloseButton>
|
|
175
|
-
<AlertWithCloseButton>
|
|
191
|
+
<AlertWithCloseButton size="small">
|
|
192
|
+
<BodyLong>Ullamco ullamco laborum et commodo</BodyLong>
|
|
193
|
+
</AlertWithCloseButton>
|
|
194
|
+
<AlertWithCloseButton size="small">
|
|
176
195
|
<DsHeading spacing size="small" level="3">
|
|
177
196
|
Aliquip duis est in commodo pariatur
|
|
178
197
|
</DsHeading>
|
|
@@ -194,6 +213,6 @@ export const WithCloseButton: Story = {
|
|
|
194
213
|
});
|
|
195
214
|
|
|
196
215
|
const buttonsAfter = canvas.getAllByTitle("Lukk Alert");
|
|
197
|
-
expect(buttonsAfter.length).toBe(
|
|
216
|
+
expect(buttonsAfter.length).toBe(4);
|
|
198
217
|
},
|
|
199
218
|
};
|