diff --git a/src/app-components/Text/DisplayText.tsx b/src/app-components/Text/DisplayText.tsx index 3cf5b63167..6502444ae4 100644 --- a/src/app-components/Text/DisplayText.tsx +++ b/src/app-components/Text/DisplayText.tsx @@ -1,23 +1,12 @@ import React from 'react'; -import classes from 'src/app-components/Text/Text.module.css'; - interface TextProps { value: string; - iconUrl?: string; - iconAltText?: string; labelId?: string; } -export const DisplayText = ({ value, iconUrl, iconAltText, labelId }: TextProps) => ( +export const DisplayText = ({ value, labelId }: TextProps) => ( <> - {iconUrl && ( - {iconAltText} - )} {labelId && {value}} {!labelId && {value}} diff --git a/src/components/label/Label.module.css b/src/components/label/Label.module.css index 8004622a5a..97ef408106 100644 --- a/src/components/label/Label.module.css +++ b/src/components/label/Label.module.css @@ -3,6 +3,11 @@ gap: var(--ds-size-2); } +.iconWithTitle { + display: flex; + align-items: center; +} + .fullWidth { width: 100%; } diff --git a/src/components/label/Label.tsx b/src/components/label/Label.tsx index e4a2f862ad..3a926bb525 100644 --- a/src/components/label/Label.tsx +++ b/src/components/label/Label.tsx @@ -24,6 +24,7 @@ export type LabelProps = PropsWithChildren<{ className?: string; overrideId?: string; textResourceBindings?: ExprResolved; + icon?: React.ReactNode; }> & DesignsystemetLabelProps; @@ -46,6 +47,7 @@ export function LabelInner(props: LabelInnerProps) { overrideId, renderLabelAs, className, + icon, textResourceBindings: overriddenTrb, ...designsystemetLabelProps } = props; @@ -101,15 +103,30 @@ export function LabelInner(props: LabelInnerProps) { {/* we want this "label" not to be rendered as a