Skip to content

Commit

Permalink
Merge pull request #1122 from nsbno/fix-card-props
Browse files Browse the repository at this point in the history
Stop Card from overriding style props
  • Loading branch information
alicemacl authored Apr 25, 2024
2 parents 351ca1a + 457fd2a commit b19f0fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-gorillas-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vygruppen/spor-react": patch
---

Stop Card from disregarding allowed styling related props
13 changes: 9 additions & 4 deletions packages/spor-react/src/card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { As, chakra, forwardRef, useStyleConfig } from "@chakra-ui/react";
import {
As,
Box,
BoxProps,
forwardRef,
useStyleConfig,
} from "@chakra-ui/react";
import React from "react";
import { BoxProps } from "../layout";

export type CardProps = Exclude<BoxProps, "size"> & {
size?: "sm" | "lg";
Expand Down Expand Up @@ -53,9 +58,9 @@ export const Card = forwardRef<CardProps, As>(
});

return (
<chakra.div sx={styles} {...props} ref={ref}>
<Box __css={styles} {...props} ref={ref}>
{children}
</chakra.div>
</Box>
);
},
);

0 comments on commit b19f0fc

Please sign in to comment.