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

fix(component-overview): endrer fra null til undefined på inputgroup #2098

Merged
merged 2 commits into from
Jun 21, 2024
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
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
Loading