@raspberrypifoundation/design-system-react 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bundle.js +8 -2
- package/dist/esm/bundle.js +8 -2
- package/package.json +1 -1
package/dist/cjs/bundle.js
CHANGED
|
@@ -3955,7 +3955,13 @@ const Button = ({
|
|
|
3955
3955
|
"rpf-button--full-width": fullWidth,
|
|
3956
3956
|
disabled
|
|
3957
3957
|
}, className);
|
|
3958
|
-
|
|
3958
|
+
let iconClasses = "rpf-button__icon";
|
|
3959
|
+
if ( /*#__PURE__*/React.isValidElement(icon)) {
|
|
3960
|
+
iconClasses += " icon";
|
|
3961
|
+
console.warn("DEPRECATED: icons as React elements will not be supported in future releases");
|
|
3962
|
+
} else {
|
|
3963
|
+
iconClasses += " material-symbols-sharp";
|
|
3964
|
+
}
|
|
3959
3965
|
const renderIcon = position => icon && iconPosition === position && /*#__PURE__*/React.createElement("span", {
|
|
3960
3966
|
className: iconClasses
|
|
3961
3967
|
}, icon);
|
|
@@ -3983,7 +3989,7 @@ Button.propTypes = {
|
|
|
3983
3989
|
type: PropTypes.string,
|
|
3984
3990
|
className: PropTypes.string,
|
|
3985
3991
|
disabled: PropTypes.bool,
|
|
3986
|
-
icon: PropTypes.string,
|
|
3992
|
+
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
3987
3993
|
href: PropTypes.string,
|
|
3988
3994
|
onClick: PropTypes.func,
|
|
3989
3995
|
text: PropTypes.string,
|
package/dist/esm/bundle.js
CHANGED
|
@@ -3953,7 +3953,13 @@ const Button = ({
|
|
|
3953
3953
|
"rpf-button--full-width": fullWidth,
|
|
3954
3954
|
disabled
|
|
3955
3955
|
}, className);
|
|
3956
|
-
|
|
3956
|
+
let iconClasses = "rpf-button__icon";
|
|
3957
|
+
if ( /*#__PURE__*/React.isValidElement(icon)) {
|
|
3958
|
+
iconClasses += " icon";
|
|
3959
|
+
console.warn("DEPRECATED: icons as React elements will not be supported in future releases");
|
|
3960
|
+
} else {
|
|
3961
|
+
iconClasses += " material-symbols-sharp";
|
|
3962
|
+
}
|
|
3957
3963
|
const renderIcon = position => icon && iconPosition === position && /*#__PURE__*/React.createElement("span", {
|
|
3958
3964
|
className: iconClasses
|
|
3959
3965
|
}, icon);
|
|
@@ -3981,7 +3987,7 @@ Button.propTypes = {
|
|
|
3981
3987
|
type: PropTypes.string,
|
|
3982
3988
|
className: PropTypes.string,
|
|
3983
3989
|
disabled: PropTypes.bool,
|
|
3984
|
-
icon: PropTypes.string,
|
|
3990
|
+
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
3985
3991
|
href: PropTypes.string,
|
|
3986
3992
|
onClick: PropTypes.func,
|
|
3987
3993
|
text: PropTypes.string,
|