Skip to content

Commit ba4a9af

Browse files
author
unknown
committed
1.0.0-beta7
1 parent 4275b83 commit ba4a9af

File tree

142 files changed

+1982
-1553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1982
-1553
lines changed

README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MDB 5 React
22

3-
Version: FREE 1.0.0-beta5
3+
Version: FREE 1.0.0-beta7
44

55
Documentation:
66
https://mdbootstrap.com/docs/b5/react/

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mdb-react-ui-kit-demo",
3-
"version": "1.0.0-beta5",
3+
"version": "1.0.0-beta7",
44
"main": "index.js",
55
"repository": {
66
"type": "git",

app/src/components/Button/Button.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useState } from 'react';
22
import clsx from 'clsx';
33
import type { ButtonProps } from './types';
4+
import MDBRipple from '../../methods/Ripple/Ripple';
45

56
const MDBBtn: React.FC<ButtonProps> = React.forwardRef<HTMLAllCollection, ButtonProps>(
67
(
@@ -17,6 +18,7 @@ const MDBBtn: React.FC<ButtonProps> = React.forwardRef<HTMLAllCollection, Button
1718
block,
1819
active,
1920
toggle,
21+
noRipple,
2022
tag: Tag,
2123
...props
2224
},
@@ -25,6 +27,7 @@ const MDBBtn: React.FC<ButtonProps> = React.forwardRef<HTMLAllCollection, Button
2527
const [isActive, setActive] = useState(active ? active : false);
2628

2729
let btnColor;
30+
const waveColor = (color && ['light', 'link'].includes(color as string)) || outline ? 'dark' : 'light';
2831

2932
if (color !== 'none') {
3033
if (outline) {
@@ -58,7 +61,7 @@ const MDBBtn: React.FC<ButtonProps> = React.forwardRef<HTMLAllCollection, Button
5861
Tag = 'a';
5962
}
6063

61-
return (
64+
return ['hr', 'img', 'input'].includes(Tag) || noRipple ? (
6265
<Tag
6366
className={classes}
6467
onClick={
@@ -75,10 +78,29 @@ const MDBBtn: React.FC<ButtonProps> = React.forwardRef<HTMLAllCollection, Button
7578
>
7679
{children}
7780
</Tag>
81+
) : (
82+
<MDBRipple
83+
rippleTag={Tag}
84+
rippleColor={waveColor}
85+
className={classes}
86+
onClick={
87+
toggle
88+
? () => {
89+
setActive(!isActive);
90+
}
91+
: undefined
92+
}
93+
disabled={disabled && Tag === 'button' ? true : undefined}
94+
href={href}
95+
ref={ref}
96+
{...props}
97+
>
98+
{children}
99+
</MDBRipple>
78100
);
79101
}
80102
);
81103

82-
MDBBtn.defaultProps = { tag: 'button', type: 'button', role: 'button' };
104+
MDBBtn.defaultProps = { tag: 'button', type: 'button', role: 'button', color: 'primary' };
83105

84106
export default MDBBtn;

app/src/components/Button/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ declare const MDBBtn: React.FunctionComponent<{
1616
toggle?: boolean;
1717
target?: string;
1818
value?: string | number;
19+
noRipple?: boolean;
1920
tag?: React.ComponentProps<any>;
2021
[rest: string]: any;
2122
}>;

app/src/components/Button/types.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type ButtonProps = {
1414
toggle?: boolean;
1515
target?: string;
1616
value?: string | number;
17+
noRipple?: boolean;
1718
tag?: React.ComponentProps<any>;
1819
[rest: string]: any;
1920
};

app/src/components/Popover/Popover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const MDBPopover: React.FC<PopoverProps> = ({
120120
MDBPopover.defaultProps = {
121121
tag: MDBBtn,
122122
popperTag: 'div',
123-
placement: 'top',
123+
placement: 'bottom',
124124
};
125125

126126
export default MDBPopover;

app/src/methods/Ripple/Ripple.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,6 @@ const MDBRipple: React.FC<RippleProps> = React.forwardRef<HTMLAllCollection, Rip
229229
}
230230
);
231231

232-
MDBRipple.defaultProps = { rippleTag: MDBBtn, rippleDuration: 500, rippleRadius: 0, rippleColor: 'dark' };
232+
MDBRipple.defaultProps = { rippleTag: 'div', rippleDuration: 500, rippleRadius: 0, rippleColor: 'dark' };
233233

234234
export default MDBRipple;

dist/css/mdb.min.css

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ declare const MDBBtn: React$1.FunctionComponent<{
5353
toggle?: boolean;
5454
target?: string;
5555
value?: string | number;
56+
noRipple?: boolean;
5657
tag?: React$1.ComponentProps<any>;
5758
[rest: string]: any;
5859
}>;

dist/mdb-react-ui-kit.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)