Skip to content

Commit 453023b

Browse files
committed
fix(card): fix spelling of raisable and deprecate raiseable prop
raiseable will be removed in the next major release
1 parent ce2bb5b commit 453023b

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

packages/card/src/Card.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
88
* Boolean if the card should gain additional box-shadow elevation once
99
* hovered.
1010
*/
11-
raiseable?: boolean;
11+
raisable?: boolean;
1212

1313
/**
1414
* Boolean if the card should no longer be `display: inline-block`, but
@@ -18,9 +18,12 @@ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
1818

1919
/**
2020
* Boolean if the card should use a border instead of box-shadow. Enabling
21-
* this prop will always disable the `raiseable` prop.
21+
* this prop will always disable the `raisable` prop.
2222
*/
2323
bordered?: boolean;
24+
25+
/** @deprecated \@since 5.1.3 Use {@link raisable} instead. */
26+
raiseable?: boolean;
2427
}
2528

2629
const block = bem("rmd-card");
@@ -35,6 +38,7 @@ export const Card = forwardRef<HTMLDivElement, CardProps>(function Card(
3538
className,
3639
children,
3740
raiseable = false,
41+
raisable = raiseable,
3842
fullWidth = false,
3943
bordered = false,
4044
...props
@@ -49,7 +53,7 @@ export const Card = forwardRef<HTMLDivElement, CardProps>(function Card(
4953
block({
5054
bordered,
5155
shadowed: !bordered,
52-
raiseable: !bordered && raiseable,
56+
raisable: !bordered && raisable,
5357
"full-width": fullWidth,
5458
}),
5559
className

packages/card/src/__tests__/Card.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ describe("Card", () => {
1111
rerender(<Card bordered />);
1212
expect(container).toMatchSnapshot();
1313

14-
rerender(<Card bordered raiseable />);
14+
rerender(<Card bordered raisable />);
1515
expect(container).toMatchSnapshot();
1616

17-
rerender(<Card bordered fullWidth raiseable />);
17+
rerender(<Card bordered fullWidth raisable />);
1818
expect(container).toMatchSnapshot();
1919

2020
rerender(
21-
<Card bordered fullWidth raiseable>
21+
<Card bordered fullWidth raisable>
2222
<div>Content</div>
2323
</Card>
2424
);

packages/card/src/_mixins.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@
6666
@include rmd-card-theme(background-color);
6767
@include rmd-card-theme(color);
6868
@include rmd-utils-mouse-only {
69-
&--raiseable {
69+
// TODO: Remove misspelled version in next major release
70+
&--raiseable,
71+
&--raisable {
7072
// Note: Only worthwhile with the `--shadowed` class
7173
@include rmd-elevation-transition(
7274
$rmd-card-base-elevation,

packages/documentation/src/components/Demos/Card/WithActions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ actions using the `CardActions` component. This is normally used alongside the
33
`Button` component from #button as the `CardActions` just applies some simple
44
padding and `flex` behavior.
55

6-
This example will also show how cards can be "raiseable" so that when a desktop
6+
This example will also show how cards can be "raisable" so that when a desktop
77
user can hover the card to raise the elevation.

packages/documentation/src/components/Demos/Card/WithActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Container from "./Container";
1313
export default function WithActions(): ReactElement {
1414
return (
1515
<Container>
16-
<Card raiseable>
16+
<Card raisable>
1717
<CardHeader>
1818
<CardTitle>This is a title</CardTitle>
1919
</CardHeader>

0 commit comments

Comments
 (0)