Skip to content

Commit 8ee4329

Browse files
Jeffrey Lauwersclaude
andcommitted
fix(Alert, Note): padding-block xl, icon size xl, heading margin reset, Paragraph component
- padding-block token: space.block.lg → space.block.xl (meer lucht) - Icon: size="xl" toegevoegd — was default md, waardoor icoon te klein was t.o.v. span - .dsn-alert__heading / .dsn-note__heading: margin-block-end: 0 — heading-3 had 12px bottom margin waardoor de grid-row opgerekt werd en het icoon niet meer uitlijnde met de heading tekst - htmlTemplate + docs.mdx: <p> → <p class="dsn-paragraph"> - AllStates stories: {TEKST} gewrapt in <Paragraph> component - WithList story in Alert: <ul> → <UnorderedList> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8120299 commit 8ee4329

10 files changed

Lines changed: 29 additions & 19 deletions

File tree

packages/components-html/src/alert/alert.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
grid-column: 2;
116116
grid-row: 1;
117117
align-self: center;
118+
margin-block-end: 0;
118119
}
119120

120121
/* ===========================

packages/components-html/src/note/note.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
grid-column: 2;
133133
grid-row: 1;
134134
align-self: center;
135+
margin-block-end: 0;
135136
}
136137

137138
/* ===========================

packages/components-react/src/Alert/Alert.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export const Alert = React.forwardRef<HTMLDivElement, AlertProps>(
101101
iconStart === undefined ? (
102102
<Icon
103103
name={PREFERRED_ICONS[variant] as Parameters<typeof Icon>[0]['name']}
104+
size="xl"
104105
aria-hidden
105106
/>
106107
) : (

packages/components-react/src/Note/Note.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export const Note = React.forwardRef<HTMLElement, NoteProps>(
120120
iconStart === undefined ? (
121121
<Icon
122122
name={PREFERRED_ICONS[variant] as Parameters<typeof Icon>[0]['name']}
123+
size="xl"
123124
aria-hidden
124125
/>
125126
) : (

packages/design-tokens/src/tokens/components/alert.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"comment": "Gap between heading and body"
2323
},
2424
"padding-block": {
25-
"value": "{dsn.space.block.lg}",
25+
"value": "{dsn.space.block.xl}",
2626
"type": "dimension",
2727
"comment": "Vertical padding"
2828
},

packages/design-tokens/src/tokens/components/note.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"comment": "Gap between heading and body"
1818
},
1919
"padding-block": {
20-
"value": "{dsn.space.block.lg}",
20+
"value": "{dsn.space.block.xl}",
2121
"type": "dimension",
2222
"comment": "Vertical padding"
2323
},

packages/storybook/src/Alert.docs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const [intro, rest] = docs.split('<!-- VOORBEELD -->');
2323
</span>
2424
<strong class="dsn-alert__heading dsn-heading dsn-heading--3">Heading</strong>
2525
<div class="dsn-alert__content">
26-
<p>Tekst</p>
26+
<p class="dsn-paragraph">Tekst</p>
2727
</div>
2828
</div>`}
2929
/>

packages/storybook/src/Alert.stories.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Meta, StoryObj } from '@storybook/react';
2-
import { Icon, Alert } from '@dsn/components-react';
2+
import { Icon, Alert, Paragraph, UnorderedList } from '@dsn/components-react';
33
import type { IconName } from '@dsn/components-react/icon-registry.generated';
44
import DocsPage from './Alert.docs.mdx';
55
import {
@@ -97,7 +97,7 @@ const meta: Meta<typeof Alert> = {
9797

9898
const heading = args.heading ?? 'Heading';
9999
const children = args.children
100-
? `\n <div class="dsn-alert__content">\n <p>${args.children}</p>\n </div>`
100+
? `\n <div class="dsn-alert__content">\n <p class="dsn-paragraph">${args.children}</p>\n </div>`
101101
: '';
102102

103103
return `<div class="${cls}" role="alert">${icon}\n <strong class="dsn-alert__heading dsn-heading dsn-heading--3">${heading}</strong>${children}\n</div>`;
@@ -172,16 +172,16 @@ export const AllStates: Story = {
172172
render: () => (
173173
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
174174
<Alert variant="info" heading="Informatief bericht">
175-
{TEKST}
175+
<Paragraph>{TEKST}</Paragraph>
176176
</Alert>
177177
<Alert variant="positive" heading="Gelukt">
178-
{TEKST}
178+
<Paragraph>{TEKST}</Paragraph>
179179
</Alert>
180180
<Alert variant="negative" heading="Er is een fout opgetreden">
181-
{TEKST}
181+
<Paragraph>{TEKST}</Paragraph>
182182
</Alert>
183183
<Alert variant="warning" heading="Let op">
184-
{TEKST}
184+
<Paragraph>{TEKST}</Paragraph>
185185
</Alert>
186186
</div>
187187
),
@@ -194,11 +194,11 @@ export const WithList: Story = {
194194
variant="negative"
195195
heading="Er zijn fouten opgetreden. Controleer de volgende velden:"
196196
>
197-
<ul>
197+
<UnorderedList>
198198
<li>Voornaam is verplicht</li>
199199
<li>E-mailadres is ongeldig</li>
200200
<li>Telefoonnummer ontbreekt</li>
201-
</ul>
201+
</UnorderedList>
202202
</Alert>
203203
),
204204
};

packages/storybook/src/Note.docs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const [intro, rest] = docs.split('<!-- VOORBEELD -->');
2323
</span>
2424
<strong class="dsn-heading dsn-heading--3 dsn-note__heading">Heading</strong>
2525
<div class="dsn-note__content">
26-
<p>Tekst</p>
26+
<p class="dsn-paragraph">Tekst</p>
2727
</div>
2828
</div>`}
2929
/>

packages/storybook/src/Note.stories.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import type { Meta, StoryObj } from '@storybook/react';
2-
import { Icon, Note, Link, UnorderedList } from '@dsn/components-react';
2+
import {
3+
Icon,
4+
Note,
5+
Paragraph,
6+
Link,
7+
UnorderedList,
8+
} from '@dsn/components-react';
39
import type { IconName } from '@dsn/components-react/icon-registry.generated';
410
import DocsPage from './Note.docs.mdx';
511
import {
@@ -101,7 +107,7 @@ const meta: Meta<typeof Note> = {
101107
? `\n <strong class="dsn-heading dsn-heading--3 dsn-note__heading">${args.heading}</strong>`
102108
: '';
103109
const children = args.children
104-
? `\n <div class="dsn-note__content">\n <p>${args.children}</p>\n </div>`
110+
? `\n <div class="dsn-note__content">\n <p class="dsn-paragraph">${args.children}</p>\n </div>`
105111
: '';
106112

107113
const as = args.as ?? 'div';
@@ -189,19 +195,19 @@ export const AllStates: Story = {
189195
render: () => (
190196
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
191197
<Note variant="neutral" heading="Neutral">
192-
{TEKST}
198+
<Paragraph>{TEKST}</Paragraph>
193199
</Note>
194200
<Note variant="info" heading="Info">
195-
{TEKST}
201+
<Paragraph>{TEKST}</Paragraph>
196202
</Note>
197203
<Note variant="positive" heading="Positive">
198-
{TEKST}
204+
<Paragraph>{TEKST}</Paragraph>
199205
</Note>
200206
<Note variant="negative" heading="Negative">
201-
{TEKST}
207+
<Paragraph>{TEKST}</Paragraph>
202208
</Note>
203209
<Note variant="warning" heading="Warning">
204-
{TEKST}
210+
<Paragraph>{TEKST}</Paragraph>
205211
</Note>
206212
</div>
207213
),

0 commit comments

Comments
 (0)