Skip to content

Commit

Permalink
Merge pull request #2098 from SpareBank1/input-group-feil
Browse files Browse the repository at this point in the history
fix(component-overview): endrer fra null til undefined på inputgroup
  • Loading branch information
tuva-odegard authored Jun 21, 2024
2 parents 37fe2d2 + 22a4944 commit 5dd2d47
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 24 deletions.
6 changes: 1 addition & 5 deletions packages/ffe-cards-react/src/CardBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ function CardBaseWithForwardRef<As extends ElementType>(
...rest
} = props;

const withCardActionProps: React.ComponentProps<typeof WithCardAction> = {
...rest,
};

return (
<WithCardAction
className={classNames('ffe-card-base', className, {
Expand All @@ -50,7 +46,7 @@ function CardBaseWithForwardRef<As extends ElementType>(
'ffe-card-base--text-center': textCenter,
'ffe-card-base--no-padding': noPadding,
})}
{...withCardActionProps}
{...(rest as Record<string, unknown>)}
ref={ref}
>
{({ CardAction }) =>
Expand Down
5 changes: 1 addition & 4 deletions packages/ffe-cards-react/src/IconCard/IconCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ function IconCardWithForwardRef<As extends ElementType>(
ref: ForwardedRef<any>,
) {
const { className, condensed, icon, children, ...rest } = props;
const withCardActionProps: React.ComponentProps<typeof WithCardAction> = {
...rest,
};
return (
<WithCardAction
className={classNames(
'ffe-icon-card',
{ 'ffe-icon-card--condensed': condensed },
className,
)}
{...withCardActionProps}
{...(rest as Record<string, unknown>)}
ref={ref}
>
{({ CardAction }) => (
Expand Down
6 changes: 2 additions & 4 deletions packages/ffe-cards-react/src/ImageCard/ImageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ function ImageCardWithForwardRef<As extends ElementType>(
ref: ForwardedRef<any>,
) {
const { className, imageSrc, imageAltText, children, ...rest } = props;
const withCardActionProps: React.ComponentProps<typeof WithCardAction> = {
...rest,
};

return (
<WithCardAction
className={classNames('ffe-image-card', className)}
{...withCardActionProps}
{...(rest as Record<string, unknown>)}
ref={ref}
>
{({ CardAction }) => (
Expand Down
6 changes: 2 additions & 4 deletions packages/ffe-cards-react/src/StippledCard/StippledCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@ function StippledCardWithForwardRef<As extends ElementType>(
ref: ForwardedRef<any>,
) {
const { className, condensed, img, children, ...rest } = props;
const withCardActionProps: React.ComponentProps<typeof WithCardAction> = {
...rest,
};

return (
<WithCardAction
className={classNames(
'ffe-stippled-card',
{ 'ffe-stippled-card--condensed': condensed },
className,
)}
{...withCardActionProps}
{...(rest as Record<string, unknown>)}
ref={ref}
>
{({ CardAction }) => (
Expand Down
8 changes: 2 additions & 6 deletions packages/ffe-cards-react/src/TextCard/TextCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type TextCardProps<As extends ElementType = 'div'> = Omit<
> & {
/** Left-aligned text on the card */
leftAlign?: boolean;
/** Function that's passed available sub-components as arguments, or regular children */
/** Function that's passed available subcomponents as arguments, or regular children */
children:
| React.ReactNode
| ((cardRenderProps: CardRenderProps) => React.ReactNode);
Expand All @@ -22,18 +22,14 @@ function TextCardWithForwardRef<As extends ElementType>(
) {
const { className, leftAlign, children, ...rest } = props;

const withCardActionProps: React.ComponentProps<typeof WithCardAction> = {
...rest,
};

return (
<WithCardAction
className={classNames(
'ffe-text-card',
{ 'ffe-text-card--left-align': leftAlign },
className,
)}
{...withCardActionProps}
{...(rest as Record<string, unknown>)}
ref={ref}
>
{({ CardAction }) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-form-react/src/InputGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface InputGroupProps
*/
extraMargin?: boolean;
/** Use the ErrorFieldMessage component if you need more flexibility in how the content is rendered. */
fieldMessage?: string | React.ReactElement<{ id: string }>;
fieldMessage?: string | React.ReactElement<{ id: string }> | null;
/** To just render a static, always visible tooltip, use this. */
description?: string;
/** Use the Label component if you need more flexibility in how the content is rendered. */
Expand Down

0 comments on commit 5dd2d47

Please sign in to comment.