Skip to content

Commit 73585e3

Browse files
authored
break(Section)!: remove spacing property (#6594)
1 parent 6e250e6 commit 73585e3

46 files changed

Lines changed: 209 additions & 320 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/dnb-design-system-portal/src/docs/contribute.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ Colors, fonts and logo guidelines are set in the DNB Brandbook and the digital v
4242

4343
<div
4444
align="center"
45-
className="dnb-section dnb-section--spacing dnb-section--mint-green"
45+
className="dnb-section dnb-section--info"
46+
style={{ padding: 'var(--spacing-large) 0' }}
4647
>
4748
<div style={{ display: 'flex', flexWrap: 'wrap', marginBottom: '1rem' }}>
4849
<Card

packages/dnb-design-system-portal/src/docs/contribute/first-contribution.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Button, Blockquote, Section } from '@dnb/eufemia/src'
1212

1313
If you are new to the Eufemia Library, we would recommend following an intro to the elementary parts of Eufemia.
1414

15-
<Section backgroundColor="mint-green" spacing>
15+
<Section backgroundColor="mint-green" innerSpace={{ block: 'large' }}>
1616
<Button
1717
href="/uilib/intro"
1818
size="large"
@@ -49,7 +49,7 @@ More information in [Style guides - Git convention](/contribute/style-guides/git
4949

5050
Have a look at the "before getting started" section for a description of technical details. In this section, you will find what packages are included, design decisions explained, the format of the component structure, what purpose different files have, what happens during a build, and the different development environments.
5151

52-
<Section backgroundColor="mint-green" spacing>
52+
<Section backgroundColor="mint-green" innerSpace={{ block: 'large' }}>
5353
<Button
5454
href="/contribute/first-contribution/before-started"
5555
size="large"

packages/dnb-design-system-portal/src/docs/contribute/rules.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ After filing a report, a representative will contact you personally. If the pers
6969

7070
Anyone asked to stop unacceptable behavior is expected to comply immediately. If an individual engages in unacceptable behavior, the representative may take any action they deem appropriate, up to and including a permanent ban from our community without warning.
7171

72-
<Section backgroundColor="mint-green" spacing>
72+
<Section backgroundColor="mint-green" innerSpace={{ block: 'large' }}>
7373
<Button
7474
href="/issue"
7575
size="large"

packages/dnb-design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v11-info.mdx

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ v11 of @dnb/eufemia contains _breaking changes_. As a migration process, you can
2626
10. Replace the `as` prop with `element` on the `H` heading element.
2727
11. Replace `prerender` with `keepInDOM` on Tabs and Accordion components.
2828
12. Replace `styleType` (or `style_type`) with `backgroundColor` on Breadcrumb, Dialog.Body, and Drawer.Body components.
29+
13. Remove `spacing` on Section. Use `innerSpace={{ block: 'large' }}` instead (see [Section](#section)).
30+
14. Replace `contentSpacing` with `contentInnerSpace` and `tabsSpacing` with `tabsInnerSpace` on the Tabs component.
2931

3032
### innerRef → ref
3133

@@ -123,9 +125,28 @@ $ pnpm add @dnb/eufemia@11
123125
- `pistachio`
124126
- `fire-red`
125127
- `fire-red-8`
126-
2. Remove `spacing`. Use `innerSpace` instead.
128+
2. Remove `spacing`. Use `innerSpace` instead. The `spacing` prop only applied vertical (top/bottom) padding, so use the `block` shorthand to match the old behavior:
129+
130+
- `spacing` -> `innerSpace={{ block: 'large' }}`
131+
- `spacing="x-small"` -> `innerSpace={{ block: 'x-small' }}`
132+
- `spacing="small"` -> `innerSpace={{ block: 'small' }}`
133+
- `spacing="medium"` -> `innerSpace={{ block: 'medium' }}`
134+
- `spacing="large"` -> `innerSpace={{ block: 'large' }}`
135+
- `spacing="x-large"` -> `innerSpace={{ block: 'x-large' }}`
136+
- `spacing="xx-large"` -> `innerSpace={{ block: 'xx-large' }}`
137+
138+
You can also use `top` and `bottom` individually if you need different values, e.g. `innerSpace={{ top: 'small', bottom: 'large' }}`. Note that `innerSpace="large"` (a plain string) applies padding on **all four sides**, not just top/bottom.
139+
127140
3. Replace `inner_ref` with `ref`.
128141

142+
#### Types
143+
144+
- The exported `SectionSpacing` type has been removed. If you imported it (e.g. for Breadcrumb or custom components), use the `InnerSpaceType` from `@dnb/eufemia/components/space/types` instead.
145+
146+
#### Styling
147+
148+
- Remove CSS classes `dnb-section--spacing`, `dnb-section--spacing-small`, etc, as they are not supported anymore.
149+
129150
### [HelpButton](/uilib/components/help-button/)
130151

131152
#### Translations
@@ -649,6 +670,7 @@ New props added:
649670
#### Properties
650671

651672
- Replace `styleType` (or `style_type`) with `backgroundColor`.
673+
- The `spacing` prop type has changed from `SectionSpacing` to `SpaceTypeAll | SpaceTypeMedia`. All previously valid string values still work, but if you imported `SectionSpacing` to type your Breadcrumb spacing, update to use the new types.
652674

653675
### [BreadcrumbItem](/uilib/components/breadcrumb/)
654676

@@ -899,6 +921,14 @@ render(<Logo svg={SbankenCompact} />)
899921
#### Properties
900922

901923
- Replace `styleType` (or `style_type`) with `backgroundColor`.
924+
- Replace `spacing` with `innerSpace`. Use `block` to match the old vertical-only padding:
925+
- `spacing` -> `innerSpace={{ block: 'large' }}`
926+
- `spacing="x-small"` -> `innerSpace={{ block: 'x-small' }}`
927+
- `spacing="small"` -> `innerSpace={{ block: 'small' }}`
928+
- `spacing="medium"` -> `innerSpace={{ block: 'medium' }}`
929+
- `spacing="large"` -> `innerSpace={{ block: 'large' }}`
930+
- `spacing="x-large"` -> `innerSpace={{ block: 'x-large' }}`
931+
- `spacing="xx-large"` -> `innerSpace={{ block: 'xx-large' }}`
902932

903933
### [Heading](/uilib/components/heading/)
904934

@@ -979,10 +1009,10 @@ render(<Logo svg={SbankenCompact} />)
9791009

9801010
- Replace `selected_key` with `selectedKey`.
9811011
- Replace `content_style` with `contentStyle`.
982-
- Replace `content_spacing` with `contentSpacing`.
1012+
- Replace `content_spacing` or `contentSpacing` with `contentInnerSpace`. The `contentSpacing` prop has been removed – use `contentInnerSpace` instead, which passes `innerSpace` to the content Section.
9831013
- Replace `tab_element` with `tabElement`.
9841014
- Replace `tabs_style` with `tabsStyle`.
985-
- Replace `tabs_spacing` with `tabsSpacing`.
1015+
- Replace `tabs_spacing` or `tabsSpacing` with `tabsInnerSpace`. The `tabsSpacing` prop has been removed – use `tabsInnerSpace` instead.
9861016
- Replace `nav_button_edge` with `navButtonEdge`.
9871017
- Replace `preventRerender` with `preventRerender`.
9881018
- Replace `on_change` with `onChange`.
@@ -993,6 +1023,10 @@ render(<Logo svg={SbankenCompact} />)
9931023
- Replace `no_border` with `noBorder`.
9941024
- Replace `prerender` with `keepInDOM`.
9951025

1026+
#### Styling
1027+
1028+
- The CSS classes `dnb-section--spacing-*` are no longer applied to the Tabs content wrapper or tab list. If you have custom CSS targeting these classes within Tabs, update to target the inline styles or use `contentInnerSpace`/`tabsInnerSpace` props instead.
1029+
9961030
### [Pagination](/uilib/components/pagination/)
9971031

9981032
#### Properties

packages/dnb-design-system-portal/src/docs/uilib/components/anchor/Examples.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const AnchorBasicUse = () => (
5050
export const AnchorExampleInSection = () => (
5151
<Wrapper>
5252
<ComponentBox data-visual-test="anchor-in-section">
53-
<Section spacing>
53+
<Section innerSpace={{ block: 'large' }}>
5454
<Anchor
5555
className="dnb-anchor--no-underline"
5656
href="https://dnb.no/"

packages/dnb-design-system-portal/src/docs/uilib/components/drawer/Examples.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export const DrawerCustomTriggerExample = () => (
240240
iconPosition: 'left',
241241
}}
242242
>
243-
<Drawer.Body spacing>
243+
<Drawer.Body innerSpace={{ block: 'large' }}>
244244
<P>Opened a Drawer with a custom trigger button!</P>
245245
</Drawer.Body>
246246
</Drawer>

packages/dnb-design-system-portal/src/docs/uilib/components/global-status/Examples.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ export const GlobalStatusUpdate = () => (
316316
React.useEffect(() => () => inst.current.remove(), [])
317317

318318
return (
319-
<Section top spacing variant="divider">
319+
<Section top innerSpace={{ block: 'large' }} variant="divider">
320320
<ToggleButton
321321
text="Toggle"
322322
variant="checkbox"

packages/dnb-design-system-portal/src/docs/uilib/components/height-animation/Examples.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ export function HeightAnimationDefault() {
4949

5050
<Section backgroundColor="lavender" top>
5151
<HeightAnimation open={openState}>
52-
<Section spacing backgroundColor="lavender">
52+
<Section
53+
innerSpace={{ block: 'large' }}
54+
backgroundColor="lavender"
55+
>
5356
<P space={0}>Your content</P>
5457
</Section>
5558
{contentState && <P space={0}>More content</P>}
@@ -145,7 +148,10 @@ export function HeightAnimationKeepInDOM() {
145148
keepInDOM={true}
146149
duration={1000}
147150
>
148-
<Section spacing backgroundColor="lavender">
151+
<Section
152+
innerSpace={{ block: 'large' }}
153+
backgroundColor="lavender"
154+
>
149155
<P space={0}>Your content</P>
150156
</Section>
151157
{contentState && <P space={0}>More content</P>}

packages/dnb-design-system-portal/src/docs/uilib/components/pagination/infinity-scroller/Examples.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const PaginationExampleInfinityTable = () => (
151151

152152
export function PaginationTableExample() {
153153
return (
154-
<Wrapper className="dnb-core-style" spacing>
154+
<Wrapper className="dnb-core-style" innerSpace={{ block: 'large' }}>
155155
<Space left>
156156
<H1 size="small">Infinity Table</H1>
157157
<P bottom>

packages/dnb-design-system-portal/src/docs/uilib/components/skip-content/Examples.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ export const SkipContentTable = () => (
3333
<LargeTableWithInteractiveElements id="table-with-caption" />
3434
</section>
3535

36-
<Section id="submit-area" spacing="small" variant="divider" top>
36+
<Section
37+
id="submit-area"
38+
innerSpace={{ block: 'small' }}
39+
variant="divider"
40+
top
41+
>
3742
<SkipContent.Return selector="#submit-area" bottom>
3843
Back to beginning of table
3944
</SkipContent.Return>
@@ -64,7 +69,7 @@ const LargeTableWithInteractiveElements = (props) => {
6469
<Td align="right">Row {nr}</Td>
6570

6671
<Td.AccordionContent>
67-
<Section top spacing>
72+
<Section top innerSpace={{ block: 'large' }}>
6873
<Dl>
6974
<Dt>Favorittfarge</Dt>
7075
<Dd>Grønn</Dd>

0 commit comments

Comments
 (0)