Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(P): deprecate style_type property #1855

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,6 @@ exports[`GlobalError snapshot have to match component snapshot 1`] = `
modifier={null}
size={null}
small={null}
style_type={null}
>
<ForwardRef
as="p"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ exports[`Skeleton component have to match snapshot 1`] = `
modifier={null}
size={null}
small={null}
style_type={null}
>
<ForwardRef
as="p"
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/elements/Ingress.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
import React from 'react'
import P from './P'

const Ingress = (p) => <P style_type="ingress" {...p} />
langz marked this conversation as resolved.
Show resolved Hide resolved
const Ingress = (p) => <P className="dnb-p--ingress" {...p} />
Ingress.tagName = 'dnb-p--ingress'
export default Ingress
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/elements/Lead.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
import React from 'react'
import P from './P'

const Lead = (p) => <P style_type="lead" {...p} />
langz marked this conversation as resolved.
Show resolved Hide resolved
const Lead = (p) => <P className="dnb-p--lead" {...p} />
Lead.tagName = 'dnb-p--lead'
export default Lead
1 change: 0 additions & 1 deletion packages/dnb-eufemia/src/elements/P.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export interface PProps
medium?: boolean;
bold?: boolean;
size?: PSize;
style_type?: string;
modifier?: string;
children?: React.ReactNode;
}
Expand Down
7 changes: 0 additions & 7 deletions packages/dnb-eufemia/src/elements/P.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { spacingPropTypes } from '../components/space/SpacingHelper'
import E from './Element'

const P = ({
style_type,
modifier,
element,
className,
Expand All @@ -27,10 +26,6 @@ const P = ({
modifier = [modifier]
}

if (style_type) {
modifier.push(style_type) // deprecated
}

if (medium === true) {
modifier.push('medium')
} else if (bold === true) {
Expand Down Expand Up @@ -76,7 +71,6 @@ P.propTypes = {
'x-large',
'xx-large',
]),
style_type: PropTypes.string, // deprecated
modifier: PropTypes.string,
children: PropTypes.node,
}
Expand All @@ -87,7 +81,6 @@ P.defaultProps = {
medium: null,
bold: null,
size: null,
style_type: null, // deprecated
modifier: null,
children: null,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ exports[`P element have to match default P element snapshot 1`] = `
modifier="modifier"
size="x-small"
small={true}
style_type="style_type"
>
<ForwardRef
as="p"
className="dnb-p dnb-p--modifier dnb-p--style_type dnb-p--medium className dnb-p__size--x-small"
className="dnb-p dnb-p--modifier dnb-p--medium className dnb-p__size--x-small"
>
<ElementInstance
as="p"
className="dnb-p dnb-p--modifier dnb-p--style_type dnb-p--medium className dnb-p__size--x-small"
className="dnb-p dnb-p--modifier dnb-p--medium className dnb-p__size--x-small"
innerRef={null}
>
<p
className="dnb-p dnb-p--modifier dnb-p--style_type dnb-p--medium className dnb-p__size--x-small"
className="dnb-p dnb-p--modifier dnb-p--medium className dnb-p__size--x-small"
>
children
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ exports[`PaymentCard have to match snapshot 1`] = `
modifier="x-small bold"
size={null}
small={null}
style_type={null}
>
<ForwardRef
as="p"
Expand All @@ -256,7 +255,6 @@ exports[`PaymentCard have to match snapshot 1`] = `
modifier={null}
size={null}
small={null}
style_type={null}
>
<ForwardRef
as="p"
Expand Down