@rmwc/icon-button
Advanced tools
Comparing version 8.0.8 to 14.0.0-alpha.0
@@ -16,3 +16,3 @@ "use strict"; | ||
} | ||
return react_1.default.createElement(IconButtonRoot, tslib_1.__assign({ tag: "button" }, rest, { ref: ref })); | ||
return react_1.default.createElement(IconButtonRoot, tslib_1.__assign({}, rest, { ref: ref })); | ||
}); | ||
@@ -23,2 +23,3 @@ var IconButtonToggle = base_1.createComponent(function IconButtonToggle(props, ref) { | ||
return (react_1.default.createElement(IconButtonToggleRoot, tslib_1.__assign({ "aria-pressed": isOn }, rootEl.props(rest), { tag: "button", ref: ref }), | ||
react_1.default.createElement("div", { className: "mdc-icon-button__ripple" }), | ||
react_1.default.createElement(IconButtonIcon, { icon: icon }), | ||
@@ -34,3 +35,3 @@ react_1.default.createElement(IconButtonIcon, { icon: onIcon, on: true }))); | ||
})(base_1.createComponent(function IconButtonRoot(props, ref) { | ||
var checked = props.checked, label = props.label, foundationRef = props.foundationRef, rest = tslib_1.__rest(props, ["checked", "label", "foundationRef"]); | ||
var checked = props.checked, label = props.label, foundationRef = props.foundationRef, children = props.children, icon = props.icon, rest = tslib_1.__rest(props, ["checked", "label", "foundationRef", "children", "icon"]); | ||
var className = base_1.useClassNames(props, [ | ||
@@ -42,3 +43,5 @@ 'mdc-icon-button', | ||
]); | ||
return (react_1.default.createElement(icon_1.Icon, tslib_1.__assign({ role: "button", tabIndex: 0, "aria-label": label }, rest, { className: className, ref: ref }))); | ||
return (react_1.default.createElement(base_1.Tag, tslib_1.__assign({ tag: "button", role: "button", tabIndex: 0, "aria-label": label }, rest, { className: className, ref: ref }), | ||
react_1.default.createElement("div", { className: "mdc-icon-button__ripple" }), | ||
react_1.default.createElement(icon_1.Icon, tslib_1.__assign({ icon: icon }, rest, { tag: "i" })))); | ||
})); | ||
@@ -45,0 +48,0 @@ var IconButtonToggleRoot = ripple_1.withRipple({ |
@@ -1,3 +0,3 @@ | ||
/// <reference types="react" /> | ||
export default function Readme(): JSX.Element; | ||
export declare const galleryExample: JSX.Element; | ||
import React from 'react'; | ||
export default function Readme(): React.JSX.Element; | ||
export declare const galleryExample: React.JSX.Element; |
@@ -13,3 +13,3 @@ import { __assign, __rest } from "tslib"; | ||
} | ||
return React.createElement(IconButtonRoot, __assign({ tag: "button" }, rest, { ref: ref })); | ||
return React.createElement(IconButtonRoot, __assign({}, rest, { ref: ref })); | ||
}); | ||
@@ -20,2 +20,3 @@ var IconButtonToggle = createComponent(function IconButtonToggle(props, ref) { | ||
return (React.createElement(IconButtonToggleRoot, __assign({ "aria-pressed": isOn }, rootEl.props(rest), { tag: "button", ref: ref }), | ||
React.createElement("div", { className: "mdc-icon-button__ripple" }), | ||
React.createElement(IconButtonIcon, { icon: icon }), | ||
@@ -31,3 +32,3 @@ React.createElement(IconButtonIcon, { icon: onIcon, on: true }))); | ||
})(createComponent(function IconButtonRoot(props, ref) { | ||
var checked = props.checked, label = props.label, foundationRef = props.foundationRef, rest = __rest(props, ["checked", "label", "foundationRef"]); | ||
var checked = props.checked, label = props.label, foundationRef = props.foundationRef, children = props.children, icon = props.icon, rest = __rest(props, ["checked", "label", "foundationRef", "children", "icon"]); | ||
var className = useClassNames(props, [ | ||
@@ -39,3 +40,5 @@ 'mdc-icon-button', | ||
]); | ||
return (React.createElement(Icon, __assign({ role: "button", tabIndex: 0, "aria-label": label }, rest, { className: className, ref: ref }))); | ||
return (React.createElement(Tag, __assign({ tag: "button", role: "button", tabIndex: 0, "aria-label": label }, rest, { className: className, ref: ref }), | ||
React.createElement("div", { className: "mdc-icon-button__ripple" }), | ||
React.createElement(Icon, __assign({ icon: icon }, rest, { tag: "i" })))); | ||
})); | ||
@@ -42,0 +45,0 @@ var IconButtonToggleRoot = withRipple({ |
@@ -1,3 +0,3 @@ | ||
/// <reference types="react" /> | ||
export default function Readme(): JSX.Element; | ||
export declare const galleryExample: JSX.Element; | ||
import React from 'react'; | ||
export default function Readme(): React.JSX.Element; | ||
export declare const galleryExample: React.JSX.Element; |
{ | ||
"name": "@rmwc/icon-button", | ||
"version": "8.0.8", | ||
"version": "14.0.0-alpha.0", | ||
"description": "RMWC IconButton component", | ||
@@ -39,9 +39,9 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@material/icon-button": "^8.0.0", | ||
"@rmwc/base": "^8.0.8", | ||
"@rmwc/icon": "^8.0.8", | ||
"@rmwc/ripple": "^8.0.8", | ||
"@rmwc/types": "^8.0.8" | ||
"@material/icon-button": "^14.0.0", | ||
"@rmwc/base": "^14.0.0-alpha.0", | ||
"@rmwc/icon": "^14.0.0-alpha.0", | ||
"@rmwc/ripple": "^14.0.0-alpha.0", | ||
"@rmwc/types": "^14.0.0-alpha.0" | ||
}, | ||
"gitHead": "d9befec0e3b258864b71686eecd16c16feb43cf1" | ||
} |
@@ -49,22 +49,24 @@ # Icon Buttons | ||
```jsx | ||
function Controlled() { | ||
const [isChecked, setIsChecked] = React.useState(false); | ||
return ( | ||
<> | ||
<IconButton | ||
checked={isChecked} | ||
onClick={() => setIsChecked(!isChecked)} | ||
onIcon="star" | ||
icon="star_border" | ||
/> | ||
<> | ||
{function Controlled() { | ||
const [isChecked, setIsChecked] = React.useState(false); | ||
return ( | ||
<> | ||
<IconButton | ||
checked={isChecked} | ||
onClick={() => setIsChecked(!isChecked)} | ||
onIcon="star" | ||
icon="star_border" | ||
/> | ||
<IconButton | ||
checked={isChecked} | ||
onClick={() => setIsChecked(!isChecked)} | ||
onIcon="images/icons/twitter.png" | ||
icon="images/icons/facebook.png" | ||
/> | ||
</> | ||
); | ||
} | ||
<IconButton | ||
checked={isChecked} | ||
onClick={() => setIsChecked(!isChecked)} | ||
onIcon="images/icons/twitter.png" | ||
icon="images/icons/facebook.png" | ||
/> | ||
</> | ||
); | ||
}} | ||
</> | ||
``` | ||
@@ -71,0 +73,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30294
511
113
3
+ Added@material/animation@14.0.0(transitive)
+ Added@material/base@14.0.0(transitive)
+ Added@material/density@14.0.0(transitive)
+ Added@material/dom@14.0.0(transitive)
+ Added@material/elevation@14.0.0(transitive)
+ Added@material/feature-targeting@14.0.0(transitive)
+ Added@material/focus-ring@14.0.0(transitive)
+ Added@material/icon-button@14.0.0(transitive)
+ Added@material/ripple@14.0.0(transitive)
+ Added@material/rtl@14.0.0(transitive)
+ Added@material/theme@14.0.0(transitive)
+ Added@material/touch-target@14.0.0(transitive)
+ Added@rmwc/base@14.3.5(transitive)
+ Added@rmwc/icon@14.3.5(transitive)
+ Added@rmwc/provider@14.3.5(transitive)
+ Added@rmwc/ripple@14.3.5(transitive)
+ Added@rmwc/types@14.3.5(transitive)
- Removed@material/animation@8.0.0(transitive)
- Removed@material/base@8.0.0(transitive)
- Removed@material/density@8.0.0(transitive)
- Removed@material/dom@8.0.0(transitive)
- Removed@material/feature-targeting@8.0.0(transitive)
- Removed@material/icon-button@8.0.0(transitive)
- Removed@material/ripple@8.0.0(transitive)
- Removed@material/rtl@8.0.0(transitive)
- Removed@material/theme@8.0.0(transitive)
- Removed@rmwc/base@8.0.8(transitive)
- Removed@rmwc/icon@8.0.8(transitive)
- Removed@rmwc/provider@8.0.8(transitive)
- Removed@rmwc/ripple@8.0.8(transitive)
- Removed@rmwc/types@8.0.8(transitive)
- Removed@types/classnames@2.3.4(transitive)
- Removedtslib@1.14.1(transitive)
Updated@rmwc/base@^14.0.0-alpha.0
Updated@rmwc/icon@^14.0.0-alpha.0
Updated@rmwc/ripple@^14.0.0-alpha.0
Updated@rmwc/types@^14.0.0-alpha.0