@rmwc/button
Advanced tools
Comparing version 5.0.2-alpha.0 to 5.0.3-alpha.0
@@ -25,6 +25,6 @@ import * as RMWC from '@rmwc/types'; | ||
*/ | ||
export declare const Button: React.ComponentType<ButtonProps & RMWC.ComponentProps<any> & RMWC.WithRippleProps>; | ||
export declare const Button: React.ComponentType<ButtonProps & RMWC.ComponentProps & RMWC.WithRippleProps>; | ||
export interface ButtonIconProps extends IconProps { | ||
} | ||
/** An icon that goes inside of buttons. This is an instance of the Icon component. */ | ||
export declare const ButtonIcon: React.ComponentType<ButtonIconProps & RMWC.ComponentProps<any>>; | ||
export declare const ButtonIcon: React.ComponentType<ButtonIconProps & RMWC.ComponentProps>; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
@@ -28,53 +29,53 @@ __assign = Object.assign || function(t) { | ||
}; | ||
define(["require", "exports", "react", "@rmwc/base", "@rmwc/ripple", "@rmwc/icon"], function (require, exports, React, base_1, ripple_1, icon_1) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
React = __importStar(React); | ||
/** | ||
* The Button component. Buttons also accepts all of the props from the Ripple component. | ||
*/ | ||
exports.Button = ripple_1.withRipple({ | ||
surface: false | ||
})(base_1.componentFactory({ | ||
displayName: 'Button', | ||
tag: 'button', | ||
classNames: function (props) { return [ | ||
'mdc-button', | ||
{ | ||
'mdc-button--dense': props.dense, | ||
'mdc-button--raised': props.raised, | ||
'mdc-button--unelevated': props.unelevated, | ||
'mdc-button--outlined': props.outlined | ||
} | ||
]; }, | ||
consumeProps: [ | ||
'dense', | ||
'raised', | ||
'unelevated', | ||
'outlined', | ||
'primary', | ||
'accent', | ||
'unbounded' | ||
], | ||
defaultProps: { | ||
dense: false, | ||
raised: false, | ||
unelevated: false, | ||
outlined: false | ||
}, | ||
render: function (_a, ref, Tag) { | ||
var icon = _a.icon, label = _a.label, children = _a.children, rest = __rest(_a, ["icon", "label", "children"]); | ||
return (React.createElement(Tag, __assign({}, rest, { ref: ref }), | ||
!!icon && React.createElement(exports.ButtonIcon, { icon: icon }), | ||
React.createElement("span", { className: "mdc-button__label" }, | ||
label, | ||
children))); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var React = __importStar(require("react")); | ||
var base_1 = require("@rmwc/base"); | ||
var ripple_1 = require("@rmwc/ripple"); | ||
var icon_1 = require("@rmwc/icon"); | ||
/** | ||
* The Button component. Buttons also accepts all of the props from the Ripple component. | ||
*/ | ||
exports.Button = ripple_1.withRipple({ | ||
surface: false | ||
})(base_1.componentFactory({ | ||
displayName: 'Button', | ||
tag: 'button', | ||
classNames: function (props) { return [ | ||
'mdc-button', | ||
{ | ||
'mdc-button--dense': props.dense, | ||
'mdc-button--raised': props.raised, | ||
'mdc-button--unelevated': props.unelevated, | ||
'mdc-button--outlined': props.outlined | ||
} | ||
})); | ||
/** An icon that goes inside of buttons. This is an instance of the Icon component. */ | ||
exports.ButtonIcon = base_1.componentFactory({ | ||
displayName: 'ButtonIcon', | ||
tag: icon_1.Icon, | ||
classNames: ['mdc-button__icon'] | ||
}); | ||
]; }, | ||
consumeProps: [ | ||
'dense', | ||
'raised', | ||
'unelevated', | ||
'outlined', | ||
'primary', | ||
'accent', | ||
'unbounded' | ||
], | ||
defaultProps: { | ||
dense: false, | ||
raised: false, | ||
unelevated: false, | ||
outlined: false | ||
}, | ||
render: function (_a, ref, Tag) { | ||
var icon = _a.icon, label = _a.label, children = _a.children, rest = __rest(_a, ["icon", "label", "children"]); | ||
return (React.createElement(Tag, __assign({}, rest, { ref: ref }), | ||
!!icon && React.createElement(exports.ButtonIcon, { icon: icon }), | ||
React.createElement("span", { className: "mdc-button__label" }, | ||
label, | ||
children))); | ||
} | ||
})); | ||
/** An icon that goes inside of buttons. This is an instance of the Icon component. */ | ||
exports.ButtonIcon = base_1.componentFactory({ | ||
displayName: 'ButtonIcon', | ||
tag: icon_1.Icon, | ||
classNames: ['mdc-button__icon'] | ||
}); |
@@ -25,6 +25,6 @@ import * as RMWC from '@rmwc/types'; | ||
*/ | ||
export declare const Button: React.ComponentType<ButtonProps & RMWC.ComponentProps<any> & RMWC.WithRippleProps>; | ||
export declare const Button: React.ComponentType<ButtonProps & RMWC.ComponentProps & RMWC.WithRippleProps>; | ||
export interface ButtonIconProps extends IconProps { | ||
} | ||
/** An icon that goes inside of buttons. This is an instance of the Icon component. */ | ||
export declare const ButtonIcon: React.ComponentType<ButtonIconProps & RMWC.ComponentProps<any>>; | ||
export declare const ButtonIcon: React.ComponentType<ButtonIconProps & RMWC.ComponentProps>; |
{ | ||
"name": "@rmwc/button", | ||
"version": "5.0.2-alpha.0", | ||
"version": "5.0.3-alpha.0", | ||
"description": "RMWC Button component", | ||
@@ -35,8 +35,8 @@ "main": "dist/index.js", | ||
"@material/button": "^0.43.0", | ||
"@rmwc/base": "^5.0.2-alpha.0", | ||
"@rmwc/icon": "^5.0.2-alpha.0", | ||
"@rmwc/provider": "^5.0.2-alpha.0", | ||
"@rmwc/ripple": "^5.0.2-alpha.0" | ||
"@rmwc/base": "^5.0.3-alpha.0", | ||
"@rmwc/icon": "^5.0.3-alpha.0", | ||
"@rmwc/provider": "^5.0.3-alpha.0", | ||
"@rmwc/ripple": "^5.0.3-alpha.0" | ||
}, | ||
"gitHead": "69fbf9ddbdad8cf2b014443c386e1c125a9cee79" | ||
"gitHead": "32b316530fb6c1c78e2335bc56d9be85e3cb3752" | ||
} |
@@ -72,3 +72,3 @@ # Buttons | ||
<Docs src={docs} components={['Button', 'ButtonIcon']} />; | ||
<Docs src={docs} components={['Button', 'ButtonIcon']} /> | ||
``` |
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
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
35732
15
1238
Updated@rmwc/base@^5.0.3-alpha.0
Updated@rmwc/icon@^5.0.3-alpha.0
Updated@rmwc/ripple@^5.0.3-alpha.0