@react-md/states
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -1,2 +0,2 @@ | ||
export var RIPPLE_CLASS_NAMES = { | ||
export var DEFAULT_RIPPLE_CLASSNAMES = { | ||
enter: "rmd-ripple--animating", | ||
@@ -8,3 +8,3 @@ enterActive: "rmd-ripple--scaling", | ||
}; | ||
export var RIPPLE_TIMEOUT = { | ||
export var DEFAULT_RIPPLE_TIMEOUT = { | ||
enter: 150, | ||
@@ -11,0 +11,0 @@ exit: 300, |
@@ -33,12 +33,13 @@ var __assign = (this && this.__assign) || function () { | ||
export default function useRipples(_a) { | ||
var rippleTimeout = _a.rippleTimeout, rippleClassNames = _a.rippleClassNames, rippleContainerClassName = _a.rippleContainerClassName, rippleClassName = _a.rippleClassName, disableSpacebarClick = _a.disableSpacebarClick, options = __rest(_a, ["rippleTimeout", "rippleClassNames", "rippleContainerClassName", "rippleClassName", "disableSpacebarClick"]); | ||
var rippleTimeout = _a.rippleTimeout, rippleClassNames = _a.rippleClassNames, rippleContainerClassName = _a.rippleContainerClassName, rippleClassName = _a.rippleClassName, disableRipple = _a.disableRipple, disableSpacebarClick = _a.disableSpacebarClick, options = __rest(_a, ["rippleTimeout", "rippleClassNames", "rippleContainerClassName", "rippleClassName", "disableRipple", "disableSpacebarClick"]); | ||
var _b = useRippleTransition(disableSpacebarClick), create = _b.create, state = _b.state, release = _b.release, entered = _b.entered, remove = _b.remove, cancel = _b.cancel; | ||
var handlers = useRippleHandlers(__assign({ create: create, | ||
release: release, | ||
cancel: cancel }, options)); | ||
cancel: cancel, | ||
disableRipple: disableRipple }, options)); | ||
return { | ||
handlers: handlers, | ||
ripples: (React.createElement(RippleContainer, { key: "ripples", ripples: state, className: rippleContainerClassName, rippleClassName: rippleClassName, timeout: rippleTimeout, classNames: rippleClassNames, entered: entered, exited: remove })), | ||
ripples: disableRipple ? null : (React.createElement(RippleContainer, { key: "ripples", ripples: state, className: rippleContainerClassName, rippleClassName: rippleClassName, timeout: rippleTimeout, classNames: rippleClassNames, entered: entered, exited: remove })), | ||
}; | ||
} | ||
//# sourceMappingURL=useRipples.js.map |
import React, { createContext, useContext, useMemo, } from "react"; | ||
import { RIPPLE_CLASS_NAMES, RIPPLE_TIMEOUT } from "./ripples/constants"; | ||
import { DEFAULT_RIPPLE_CLASSNAMES, DEFAULT_RIPPLE_TIMEOUT, } from "./ripples/constants"; | ||
export var StatesConfigContext = createContext({ | ||
rippleTimeout: RIPPLE_TIMEOUT, | ||
rippleClassNames: RIPPLE_CLASS_NAMES, | ||
rippleTimeout: DEFAULT_RIPPLE_TIMEOUT, | ||
rippleClassNames: DEFAULT_RIPPLE_CLASSNAMES, | ||
disableRipple: false, | ||
@@ -28,3 +28,3 @@ disableProgrammaticRipple: false, | ||
function StatesConfig(_a) { | ||
var _b = _a.rippleTimeout, rippleTimeout = _b === void 0 ? RIPPLE_TIMEOUT : _b, _c = _a.rippleClassNames, rippleClassNames = _c === void 0 ? RIPPLE_CLASS_NAMES : _c, _d = _a.disableRipple, disableRipple = _d === void 0 ? false : _d, _e = _a.disableProgrammaticRipple, disableProgrammaticRipple = _e === void 0 ? false : _e, children = _a.children; | ||
var _b = _a.rippleTimeout, rippleTimeout = _b === void 0 ? DEFAULT_RIPPLE_TIMEOUT : _b, _c = _a.rippleClassNames, rippleClassNames = _c === void 0 ? DEFAULT_RIPPLE_CLASSNAMES : _c, _d = _a.disableRipple, disableRipple = _d === void 0 ? false : _d, _e = _a.disableProgrammaticRipple, disableProgrammaticRipple = _e === void 0 ? false : _e, children = _a.children; | ||
var value = useMemo(function () { return ({ | ||
@@ -31,0 +31,0 @@ rippleTimeout: rippleTimeout, |
@@ -11,3 +11,3 @@ "use strict"; | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -14,0 +14,0 @@ var useInteractionStates_1 = require("./useInteractionStates"); |
import { CSSTransitionClassNames } from "react-transition-group/CSSTransition"; | ||
import { TransitionTimeout } from "@react-md/transition"; | ||
export declare const RIPPLE_CLASS_NAMES: CSSTransitionClassNames; | ||
export declare const RIPPLE_TIMEOUT: TransitionTimeout; | ||
export declare const DEFAULT_RIPPLE_CLASSNAMES: CSSTransitionClassNames; | ||
export declare const DEFAULT_RIPPLE_TIMEOUT: TransitionTimeout; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RIPPLE_TIMEOUT = exports.RIPPLE_CLASS_NAMES = void 0; | ||
exports.RIPPLE_CLASS_NAMES = { | ||
exports.DEFAULT_RIPPLE_TIMEOUT = exports.DEFAULT_RIPPLE_CLASSNAMES = void 0; | ||
exports.DEFAULT_RIPPLE_CLASSNAMES = { | ||
enter: "rmd-ripple--animating", | ||
@@ -11,3 +11,3 @@ enterActive: "rmd-ripple--scaling", | ||
}; | ||
exports.RIPPLE_TIMEOUT = { | ||
exports.DEFAULT_RIPPLE_TIMEOUT = { | ||
enter: 150, | ||
@@ -14,0 +14,0 @@ exit: 300, |
@@ -12,3 +12,3 @@ import { ReactNode } from "react"; | ||
*/ | ||
export default function useRipples<E extends HTMLElement = HTMLElement>({ rippleTimeout, rippleClassNames, rippleContainerClassName, rippleClassName, disableSpacebarClick, ...options }: RipplesOptions<E>): ReturnValue<E>; | ||
export default function useRipples<E extends HTMLElement = HTMLElement>({ rippleTimeout, rippleClassNames, rippleContainerClassName, rippleClassName, disableRipple, disableSpacebarClick, ...options }: RipplesOptions<E>): ReturnValue<E>; | ||
export {}; |
@@ -38,10 +38,11 @@ "use strict"; | ||
function useRipples(_a) { | ||
var rippleTimeout = _a.rippleTimeout, rippleClassNames = _a.rippleClassNames, rippleContainerClassName = _a.rippleContainerClassName, rippleClassName = _a.rippleClassName, disableSpacebarClick = _a.disableSpacebarClick, options = __rest(_a, ["rippleTimeout", "rippleClassNames", "rippleContainerClassName", "rippleClassName", "disableSpacebarClick"]); | ||
var rippleTimeout = _a.rippleTimeout, rippleClassNames = _a.rippleClassNames, rippleContainerClassName = _a.rippleContainerClassName, rippleClassName = _a.rippleClassName, disableRipple = _a.disableRipple, disableSpacebarClick = _a.disableSpacebarClick, options = __rest(_a, ["rippleTimeout", "rippleClassNames", "rippleContainerClassName", "rippleClassName", "disableRipple", "disableSpacebarClick"]); | ||
var _b = reducer_1.useRippleTransition(disableSpacebarClick), create = _b.create, state = _b.state, release = _b.release, entered = _b.entered, remove = _b.remove, cancel = _b.cancel; | ||
var handlers = useRippleHandlers_1.default(__assign({ create: create, | ||
release: release, | ||
cancel: cancel }, options)); | ||
cancel: cancel, | ||
disableRipple: disableRipple }, options)); | ||
return { | ||
handlers: handlers, | ||
ripples: (react_1.default.createElement(RippleContainer_1.default, { key: "ripples", ripples: state, className: rippleContainerClassName, rippleClassName: rippleClassName, timeout: rippleTimeout, classNames: rippleClassNames, entered: entered, exited: remove })), | ||
ripples: disableRipple ? null : (react_1.default.createElement(RippleContainer_1.default, { key: "ripples", ripples: state, className: rippleContainerClassName, rippleClassName: rippleClassName, timeout: rippleTimeout, classNames: rippleClassNames, entered: entered, exited: remove })), | ||
}; | ||
@@ -48,0 +49,0 @@ } |
@@ -26,4 +26,4 @@ "use strict"; | ||
exports.StatesConfigContext = react_1.createContext({ | ||
rippleTimeout: constants_1.RIPPLE_TIMEOUT, | ||
rippleClassNames: constants_1.RIPPLE_CLASS_NAMES, | ||
rippleTimeout: constants_1.DEFAULT_RIPPLE_TIMEOUT, | ||
rippleClassNames: constants_1.DEFAULT_RIPPLE_CLASSNAMES, | ||
disableRipple: false, | ||
@@ -52,3 +52,3 @@ disableProgrammaticRipple: false, | ||
function StatesConfig(_a) { | ||
var _b = _a.rippleTimeout, rippleTimeout = _b === void 0 ? constants_1.RIPPLE_TIMEOUT : _b, _c = _a.rippleClassNames, rippleClassNames = _c === void 0 ? constants_1.RIPPLE_CLASS_NAMES : _c, _d = _a.disableRipple, disableRipple = _d === void 0 ? false : _d, _e = _a.disableProgrammaticRipple, disableProgrammaticRipple = _e === void 0 ? false : _e, children = _a.children; | ||
var _b = _a.rippleTimeout, rippleTimeout = _b === void 0 ? constants_1.DEFAULT_RIPPLE_TIMEOUT : _b, _c = _a.rippleClassNames, rippleClassNames = _c === void 0 ? constants_1.DEFAULT_RIPPLE_CLASSNAMES : _c, _d = _a.disableRipple, disableRipple = _d === void 0 ? false : _d, _e = _a.disableProgrammaticRipple, disableProgrammaticRipple = _e === void 0 ? false : _e, children = _a.children; | ||
var value = react_1.useMemo(function () { return ({ | ||
@@ -55,0 +55,0 @@ rippleTimeout: rippleTimeout, |
{ | ||
"name": "@react-md/states", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"description": "A package for adding the different focus, hover, selected, active, etc states to elements", | ||
@@ -38,5 +38,5 @@ "scripts": { | ||
"dependencies": { | ||
"@react-md/theme": "^2.0.0-beta.1", | ||
"@react-md/transition": "^2.0.0-beta.1", | ||
"@react-md/utils": "^2.0.0-beta.1", | ||
"@react-md/theme": "^2.0.0-beta.2", | ||
"@react-md/transition": "^2.0.0-beta.2", | ||
"@react-md/utils": "^2.0.0-beta.2", | ||
"react-transition-group": "^4.3.0" | ||
@@ -53,3 +53,7 @@ }, | ||
}, | ||
"gitHead": "76642fca0cf36307a5431d67a8eb4abe0a7b18a6" | ||
"devDependencies": { | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1" | ||
}, | ||
"gitHead": "cf3a082e89a038dd4cc60974874938af6480b289" | ||
} |
import { CSSTransitionClassNames } from "react-transition-group/CSSTransition"; | ||
import { TransitionTimeout } from "@react-md/transition"; | ||
export const RIPPLE_CLASS_NAMES: CSSTransitionClassNames = { | ||
export const DEFAULT_RIPPLE_CLASSNAMES: CSSTransitionClassNames = { | ||
enter: "rmd-ripple--animating", | ||
@@ -12,5 +12,5 @@ enterActive: "rmd-ripple--scaling", | ||
export const RIPPLE_TIMEOUT: TransitionTimeout = { | ||
export const DEFAULT_RIPPLE_TIMEOUT: TransitionTimeout = { | ||
enter: 150, | ||
exit: 300, | ||
}; |
import { CSSTransitionClassNames } from "react-transition-group/CSSTransition"; | ||
import { TransitionTimeout } from "@react-md/transition"; | ||
export declare const RIPPLE_CLASS_NAMES: CSSTransitionClassNames; | ||
export declare const RIPPLE_TIMEOUT: TransitionTimeout; | ||
export declare const DEFAULT_RIPPLE_CLASSNAMES: CSSTransitionClassNames; | ||
export declare const DEFAULT_RIPPLE_TIMEOUT: TransitionTimeout; |
@@ -12,3 +12,3 @@ import { ReactNode } from "react"; | ||
*/ | ||
export default function useRipples<E extends HTMLElement = HTMLElement>({ rippleTimeout, rippleClassNames, rippleContainerClassName, rippleClassName, disableSpacebarClick, ...options }: RipplesOptions<E>): ReturnValue<E>; | ||
export default function useRipples<E extends HTMLElement = HTMLElement>({ rippleTimeout, rippleClassNames, rippleContainerClassName, rippleClassName, disableRipple, disableSpacebarClick, ...options }: RipplesOptions<E>): ReturnValue<E>; | ||
export {}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
319889
5120
2