Skip to content

Commit

Permalink
feat(Typography): remove small prop from paragraph (p) (#2234)
Browse files Browse the repository at this point in the history
* remove small prop from Paragraph

* add migration steps
  • Loading branch information
joakbjerk authored and tujoworker committed May 31, 2023
1 parent 76cc7ba commit 06c5ba5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { Accordion } from '@dnb/eufemia/src'
- [Lists](#lists)
- [InputMasked](#inputmasked)
- [FormRow](#formrow)
- [Element changes](#element-changes)
- [Paragraph](#paragraph)

</Accordion>

Expand Down Expand Up @@ -288,4 +290,12 @@ When you convert from `<Modal />` or `<Modal mode="dialog" />` to `<Dialog />`

1. The FormRow properties `indent` and `indent_offset` were removed.

## Element changes

### [Paragraph](/uilib/elements/paragraph/)

Removed `small` as prop. Use `size="small"` instead.

1. Find the `small ` property and replace it with `size="small"`.

_April, 20. 2023_
8 changes: 1 addition & 7 deletions packages/dnb-eufemia/src/elements/typography/P.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export type PProps = SpacingProps &
* Default: p
*/
element?: DynamicElement & 'p'
/**
* Tells the component to use the small font-size dnb-p__size--small defined in paragraphStyle - typography-mixins.scss. Find more details here https://eufemia.dnb.no/uilib/typography/font-size/
*/
small?: boolean
/**
* Tells the component to use the medium font-weight styling dnb-p--medium defined in paragraphStyle - typography-mixins.scss. Find more details here https://eufemia.dnb.no/uilib/typography/font-weight/
*/
Expand All @@ -53,7 +49,6 @@ const P = ({
modifier,
element = 'p',
className,
small,
medium,
bold,
size,
Expand Down Expand Up @@ -85,8 +80,7 @@ const P = ({
'dnb-p',
modifierString,
className,
size && `dnb-p__size--${size}`,
small && 'dnb-p__size--small'
size && `dnb-p__size--${size}`
)}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ exports[`P element have to match default P element snapshot 1`] = `
medium={true}
modifier="modifier"
size="x-small"
small={true}
>
<ForwardRef
as="p"
className="dnb-p dnb-p--medium dnb-p--bold dnb-p--modifier dnb-p__size--x-small dnb-p__size--small"
className="dnb-p dnb-p--medium dnb-p--bold dnb-p--modifier dnb-p__size--x-small"
>
<ElementInstance
as="p"
className="dnb-p dnb-p--medium dnb-p--bold dnb-p--modifier dnb-p__size--x-small dnb-p__size--small"
className="dnb-p dnb-p--medium dnb-p--bold dnb-p--modifier dnb-p__size--x-small"
innerRef={null}
>
<p
className="dnb-p dnb-p--medium dnb-p--bold dnb-p--modifier dnb-p__size--x-small dnb-p__size--small"
className="dnb-p dnb-p--medium dnb-p--bold dnb-p--modifier dnb-p__size--x-small"
/>
</ElementInstance>
</ForwardRef>
Expand Down

0 comments on commit 06c5ba5

Please sign in to comment.