Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-md/states

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-md/states - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

## [4.0.1](https://github.com/mlaursen/react-md/compare/v4.0.0...v4.0.1) (2021-11-27)
### Other Internal Changes
* Updated imports to use `import type` when possible ([ba96bb6](https://github.com/mlaursen/react-md/commit/ba96bb62eeddcc0879f6d584aa670850203561e6))
# [4.0.0](https://github.com/mlaursen/react-md/compare/v3.1.1...v4.0.0) (2021-11-24)

@@ -8,0 +20,0 @@

20

es/ripples/reducer.js

@@ -12,2 +12,18 @@ var __assign = (this && this.__assign) || function () {

};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {

@@ -68,3 +84,3 @@ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {

var ripple = createRippleState(event);
return __spreadArray(__spreadArray([], state, true), [ripple], false);
return __spreadArray(__spreadArray([], __read(state), false), [ripple], false);
}

@@ -130,3 +146,3 @@ function enteredRipple(state, ripple) {

if (disableSpacebarClick === void 0) { disableSpacebarClick = false; }
var _a = useReducer(reducer, []), state = _a[0], dispatch = _a[1];
var _a = __read(useReducer(reducer, []), 2), state = _a[0], dispatch = _a[1];
var spacebarRef = useRefCache(disableSpacebarClick);

@@ -133,0 +149,0 @@ var create = useCallback(function (event) {

@@ -12,2 +12,18 @@ var __assign = (this && this.__assign) || function () {

};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
import { useCallback, useState } from "react";

@@ -30,3 +46,3 @@ import { useRefCache } from "@react-md/utils";

var _b = _a === void 0 ? {} : _a, _c = _b.handlers, handlers = _c === void 0 ? {} : _c, _d = _b.disableSpacebarClick, disableSpacebarClick = _d === void 0 ? false : _d;
var _e = useState(false), pressed = _e[0], setPressed = _e[1];
var _e = __read(useState(false), 2), pressed = _e[0], setPressed = _e[1];
var ref = useRefCache(__assign(__assign({}, handlers), { pressed: pressed }));

@@ -33,0 +49,0 @@ var handleKeyDown = useCallback(function (event) {

2

lib/ripples/reducer.d.ts

@@ -1,2 +0,2 @@

import { RippleEvent, RipplesState, RippleState } from "./types";
import type { RippleEvent, RipplesState, RippleState } from "./types";
export declare const CREATE = "CREATE";

@@ -3,0 +3,0 @@ export declare const CANCEL = "CANCEL";

@@ -13,2 +13,18 @@ "use strict";

};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {

@@ -72,3 +88,3 @@ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {

var ripple = (0, utils_2.createRippleState)(event);
return __spreadArray(__spreadArray([], state, true), [ripple], false);
return __spreadArray(__spreadArray([], __read(state), false), [ripple], false);
}

@@ -135,3 +151,3 @@ function enteredRipple(state, ripple) {

if (disableSpacebarClick === void 0) { disableSpacebarClick = false; }
var _a = (0, react_1.useReducer)(reducer, []), state = _a[0], dispatch = _a[1];
var _a = __read((0, react_1.useReducer)(reducer, []), 2), state = _a[0], dispatch = _a[1];
var spacebarRef = (0, utils_1.useRefCache)(disableSpacebarClick);

@@ -138,0 +154,0 @@ var create = (0, react_1.useCallback)(function (event) {

import type { ReactElement } from "react";
import { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition";
import { RippleState } from "./types";
import type { RippleState } from "./types";
export interface RippleProps {

@@ -5,0 +5,0 @@ className?: string;

@@ -1,4 +0,4 @@

import { ReactElement } from "react";
import type { ReactElement } from "react";
import type { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition";
import { RipplesState, RippleState } from "./types";
import type { RipplesState, RippleState } from "./types";
export interface RippleContainerProps {

@@ -5,0 +5,0 @@ ripples: RipplesState;

@@ -1,2 +0,2 @@

import { MergableRippleHandlers, RippleEvent } from "./types";
import type { MergableRippleHandlers, RippleEvent } from "./types";
interface Options<E extends HTMLElement> {

@@ -3,0 +3,0 @@ create: (event: RippleEvent<E>) => void;

@@ -1,3 +0,3 @@

import { ReactNode } from "react";
import { MergableRippleHandlers, RipplesOptions } from "./types";
import type { ReactNode } from "react";
import type { MergableRippleHandlers, RipplesOptions } from "./types";
interface ReturnValue<E extends HTMLElement> {

@@ -4,0 +4,0 @@ handlers: MergableRippleHandlers<E>;

@@ -1,2 +0,2 @@

import { RippleEvent, RippleState, RippleType } from "./types";
import type { RippleEvent, RippleState, RippleType } from "./types";
/**

@@ -3,0 +3,0 @@ * Checks if the ripple event should be ignored since it was bubbled

import { ReactElement, ReactNode } from "react";
import { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition";
import type { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition";
/**

@@ -4,0 +4,0 @@ * Contains all the values in the `StatesConfig` component.

@@ -1,3 +0,3 @@

import { ReactNode } from "react";
import { MergableRippleHandlers, RipplesOptions } from "./ripples/types";
import type { ReactNode } from "react";
import type { MergableRippleHandlers, RipplesOptions } from "./ripples/types";
import { StatesConfigContextType } from "./StatesConfig";

@@ -4,0 +4,0 @@ export interface InteractionStatesOptions<E extends HTMLElement = HTMLElement> extends Partial<StatesConfigContextType>, RipplesOptions<E> {

@@ -1,2 +0,2 @@

import { MergableRippleHandlers } from "./ripples/types";
import type { MergableRippleHandlers } from "./ripples/types";
interface PressedStatesOptions<E extends HTMLElement = HTMLElement> {

@@ -3,0 +3,0 @@ handlers?: MergableRippleHandlers<E>;

@@ -13,2 +13,18 @@ "use strict";

};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -33,3 +49,3 @@ exports.usePressedStates = void 0;

var _b = _a === void 0 ? {} : _a, _c = _b.handlers, handlers = _c === void 0 ? {} : _c, _d = _b.disableSpacebarClick, disableSpacebarClick = _d === void 0 ? false : _d;
var _e = (0, react_1.useState)(false), pressed = _e[0], setPressed = _e[1];
var _e = __read((0, react_1.useState)(false), 2), pressed = _e[0], setPressed = _e[1];
var ref = (0, utils_1.useRefCache)(__assign(__assign({}, handlers), { pressed: pressed }));

@@ -36,0 +52,0 @@ var handleKeyDown = (0, react_1.useCallback)(function (event) {

{
"name": "@react-md/states",
"version": "4.0.0",
"version": "4.0.1",
"description": "A package for adding the different focus, hover, selected, active, etc states to elements",

@@ -31,5 +31,5 @@ "main": "./lib/index.js",

"dependencies": {
"@react-md/theme": "^4.0.0",
"@react-md/transition": "^4.0.0",
"@react-md/utils": "^4.0.0",
"@react-md/theme": "^4.0.1",
"@react-md/transition": "^4.0.1",
"@react-md/utils": "^4.0.1",
"classnames": "^2.3.1"

@@ -48,3 +48,3 @@ },

},
"gitHead": "a9f2d64a777698fa65bb3196f6063cdd8321f5cb"
"gitHead": "0df0f24d688ea7c867b7ef656ee9887f00215705"
}
import { Reducer, useCallback, useReducer } from "react";
import { useRefCache } from "@react-md/utils";
import { RippleEvent, RipplesState, RippleState } from "./types";
import type { RippleEvent, RipplesState, RippleState } from "./types";
import { createRippleState, getType, isBubbled, isRippleable } from "./utils";

@@ -6,0 +6,0 @@

import { useCallback, useRef } from "react";
import { useRefCache } from "@react-md/utils";
import { MergableRippleHandlers, RippleEvent } from "./types";
import type { MergableRippleHandlers, RippleEvent } from "./types";

@@ -6,0 +6,0 @@ interface Options<E extends HTMLElement> {

import { findSizingContainer } from "@react-md/utils";
import { RippleEvent, RippleState, RippleType } from "./types";
import type { RippleEvent, RippleState, RippleType } from "./types";

@@ -5,0 +5,0 @@ /**

@@ -1,6 +0,6 @@

import { ReactNode } from "react";
import type { ReactNode } from "react";
import cn from "classnames";
import { Maybe } from "@react-md/utils";
import type { Maybe } from "@react-md/utils";
import { MergableRippleHandlers, RipplesOptions } from "./ripples/types";
import type { MergableRippleHandlers, RipplesOptions } from "./ripples/types";
import { useRipples } from "./ripples/useRipples";

@@ -7,0 +7,0 @@ import {

import { useCallback, useState } from "react";
import { useRefCache } from "@react-md/utils";
import { MergableRippleHandlers } from "./ripples/types";
import type { MergableRippleHandlers } from "./ripples/types";
import { isBubbled } from "./ripples/utils";

@@ -6,0 +6,0 @@

@@ -1,2 +0,2 @@

import { RippleEvent, RipplesState, RippleState } from "./types";
import type { RippleEvent, RipplesState, RippleState } from "./types";
export declare const CREATE = "CREATE";

@@ -3,0 +3,0 @@ export declare const CANCEL = "CANCEL";

import type { ReactElement } from "react";
import { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition";
import { RippleState } from "./types";
import type { RippleState } from "./types";
export interface RippleProps {

@@ -5,0 +5,0 @@ className?: string;

@@ -1,4 +0,4 @@

import { ReactElement } from "react";
import type { ReactElement } from "react";
import type { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition";
import { RipplesState, RippleState } from "./types";
import type { RipplesState, RippleState } from "./types";
export interface RippleContainerProps {

@@ -5,0 +5,0 @@ ripples: RipplesState;

@@ -1,2 +0,2 @@

import { MergableRippleHandlers, RippleEvent } from "./types";
import type { MergableRippleHandlers, RippleEvent } from "./types";
interface Options<E extends HTMLElement> {

@@ -3,0 +3,0 @@ create: (event: RippleEvent<E>) => void;

@@ -1,3 +0,3 @@

import { ReactNode } from "react";
import { MergableRippleHandlers, RipplesOptions } from "./types";
import type { ReactNode } from "react";
import type { MergableRippleHandlers, RipplesOptions } from "./types";
interface ReturnValue<E extends HTMLElement> {

@@ -4,0 +4,0 @@ handlers: MergableRippleHandlers<E>;

@@ -1,2 +0,2 @@

import { RippleEvent, RippleState, RippleType } from "./types";
import type { RippleEvent, RippleState, RippleType } from "./types";
/**

@@ -3,0 +3,0 @@ * Checks if the ripple event should be ignored since it was bubbled

import { ReactElement, ReactNode } from "react";
import { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition";
import type { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition";
/**

@@ -4,0 +4,0 @@ * Contains all the values in the `StatesConfig` component.

@@ -1,3 +0,3 @@

import { ReactNode } from "react";
import { MergableRippleHandlers, RipplesOptions } from "./ripples/types";
import type { ReactNode } from "react";
import type { MergableRippleHandlers, RipplesOptions } from "./ripples/types";
import { StatesConfigContextType } from "./StatesConfig";

@@ -4,0 +4,0 @@ export interface InteractionStatesOptions<E extends HTMLElement = HTMLElement> extends Partial<StatesConfigContextType>, RipplesOptions<E> {

@@ -1,2 +0,2 @@

import { MergableRippleHandlers } from "./ripples/types";
import type { MergableRippleHandlers } from "./ripples/types";
interface PressedStatesOptions<E extends HTMLElement = HTMLElement> {

@@ -3,0 +3,0 @@ handlers?: MergableRippleHandlers<E>;

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc