@simplybusiness/mobius 3.6.1 → 3.7.1
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/CHANGELOG.md +16 -0
- package/dist/cjs/components/Button/Button.d.ts +3 -2
- package/dist/cjs/components/Button/Button.js +9 -14
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.js +1 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useButton/index.d.ts +1 -0
- package/dist/cjs/hooks/useButton/index.js +18 -0
- package/dist/cjs/hooks/useButton/index.js.map +1 -0
- package/dist/cjs/hooks/useButton/useButton.d.ts +35 -0
- package/dist/cjs/hooks/useButton/useButton.js +32 -0
- package/dist/cjs/hooks/useButton/useButton.js.map +1 -0
- package/dist/cjs/hooks/useButton/useButton.test.d.ts +1 -0
- package/dist/cjs/hooks/useButton/useButton.test.js +143 -0
- package/dist/cjs/hooks/useButton/useButton.test.js.map +1 -0
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/components/Button/Button.js +10 -15
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useButton/index.js +2 -0
- package/dist/esm/hooks/useButton/index.js.map +1 -0
- package/dist/esm/hooks/useButton/useButton.js +28 -0
- package/dist/esm/hooks/useButton/useButton.js.map +1 -0
- package/dist/esm/hooks/useButton/useButton.test.js +141 -0
- package/dist/esm/hooks/useButton/useButton.test.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/mobius.d.ts +39 -2
- package/package.json +1 -1
- package/src/components/Button/Button.tsx +10 -34
- package/src/components/DatePicker/DatePicker.tsx +1 -0
- package/src/hooks/index.tsx +1 -0
- package/src/hooks/useButton/index.tsx +1 -0
- package/src/hooks/useButton/useButton.test.tsx +183 -0
- package/src/hooks/useButton/useButton.tsx +75 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file, or link in
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.7.0] - 2023-07-31
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- New simpler `useButton` hook implemenation, to work correctly with
|
|
13
|
+
shadow DOM
|
|
14
|
+
|
|
15
|
+
## [3.6.2] - 2023-07-26
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Fix missing `:focus-visible` state for `<Button variant="basic">`
|
|
20
|
+
|
|
8
21
|
## [3.6.1] - 2023-07-26
|
|
9
22
|
|
|
10
23
|
### Fixed
|
|
@@ -265,6 +278,9 @@ Additionally, mobius and themes are available on the public NPM registry and can
|
|
|
265
278
|
|
|
266
279
|
## Github Links
|
|
267
280
|
|
|
281
|
+
[3.7.1]: https://github.com/simplybusiness/mobius/releases/tag/v3.7.1
|
|
282
|
+
[3.7.0]: https://github.com/simplybusiness/mobius/releases/tag/v3.7.0
|
|
283
|
+
[3.6.2]: https://github.com/simplybusiness/mobius/releases/tag/v3.6.2
|
|
268
284
|
[3.6.1]: https://github.com/simplybusiness/mobius/releases/tag/v3.6.1
|
|
269
285
|
[3.6.0]: https://github.com/simplybusiness/mobius/releases/tag/v3.6.0
|
|
270
286
|
[3.5.1]: https://github.com/simplybusiness/mobius/releases/tag/v3.5.1
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Ref, RefAttributes, ReactNode } from "react";
|
|
2
|
-
import type { AriaButtonProps } from "@react-types/button";
|
|
3
2
|
import { DOMProps } from "@react-types/shared";
|
|
3
|
+
import { AriaFocusRingProps } from "@react-aria/focus";
|
|
4
4
|
import type { IconName } from "@simplybusiness/icons";
|
|
5
5
|
import { ForwardedRefComponent } from "../../types/components";
|
|
6
|
+
import { UseButtonProps } from "../../hooks/useButton";
|
|
6
7
|
export type ButtonElementType = HTMLButtonElement;
|
|
7
8
|
export type Variant = "primary" | "secondary" | "ghost" | "inverse" | "inverse-ghost" | "basic";
|
|
8
9
|
export type Size = "small" | "medium" | "large";
|
|
9
|
-
export interface ButtonProps extends
|
|
10
|
+
export interface ButtonProps extends UseButtonProps, AriaFocusRingProps, DOMProps, RefAttributes<ButtonElementType> {
|
|
10
11
|
/** Custom class name for setting specific CSS */
|
|
11
12
|
className?: string;
|
|
12
13
|
/** Shortlist of styles */
|
|
@@ -18,25 +18,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.Button = void 0;
|
|
19
19
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
20
20
|
const react_1 = require("react");
|
|
21
|
-
const button_1 = require("@react-aria/button");
|
|
22
21
|
const interactions_1 = require("@react-aria/interactions");
|
|
23
22
|
const clsx_1 = __importDefault(require("clsx"));
|
|
24
23
|
const focus_1 = require("@react-aria/focus");
|
|
25
24
|
const Loading_1 = require("./Loading");
|
|
26
25
|
const Icon_1 = require("../Icon");
|
|
26
|
+
const useButton_1 = require("../../hooks/useButton");
|
|
27
27
|
const Button = (0, react_1.forwardRef)((props, ref) => {
|
|
28
|
-
const { children, elementType: Component = "button", isDisabled, isLoading, isSuccess, variant = "primary", size = "medium", icon, iconPosition = "left",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
onPressStart,
|
|
36
|
-
onPressUp,
|
|
37
|
-
isDisabled,
|
|
38
|
-
}, refObj);
|
|
39
|
-
const mergedButtonProps = Object.assign(Object.assign({}, buttonProps), { onClick: (event) => { var _a; return (onClick === null || onClick === void 0 ? void 0 : onClick(event)) || ((_a = buttonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonProps, event)); } });
|
|
28
|
+
const { children, elementType: Component = "button", isDisabled, isLoading, isSuccess, variant = "primary", size = "medium", icon, iconPosition = "left",
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
onPress,
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
+
onClick } = props, otherProps = __rest(props, ["children", "elementType", "isDisabled", "isLoading", "isSuccess", "variant", "size", "icon", "iconPosition", "onPress", "onClick"]);
|
|
33
|
+
const { hoverProps, isHovered } = (0, interactions_1.useHover)(props);
|
|
34
|
+
const { buttonProps } = (0, useButton_1.useButton)(props);
|
|
40
35
|
const { focusProps, isFocusVisible } = (0, focus_1.useFocusRing)(props);
|
|
41
36
|
// Reshape class name and apply to outer element
|
|
42
37
|
const classes = (0, clsx_1.default)("mobius", "mobius/Button", `--variant-${variant}`, `--size-${size}`, {
|
|
@@ -52,7 +47,7 @@ const Button = (0, react_1.forwardRef)((props, ref) => {
|
|
|
52
47
|
"hide-children": isLoading || isSuccess,
|
|
53
48
|
});
|
|
54
49
|
const hasIcon = icon && !isLoading && !isSuccess;
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ ref: ref },
|
|
50
|
+
return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ ref: ref }, buttonProps, hoverProps, focusProps, otherProps, { children: [isLoading && (0, jsx_runtime_1.jsx)(Loading_1.Loading, {}), hasIcon && iconPosition === "left" && (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon }), children && (0, jsx_runtime_1.jsx)("span", Object.assign({ className: spanClasses }, { children: children })), hasIcon && iconPosition === "right" && (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon })] })));
|
|
56
51
|
});
|
|
57
52
|
exports.Button = Button;
|
|
58
53
|
Button.displayName = "Button";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,iCAAkE;AAClE,2DAAoD;AAEpD,gDAAwB;AACxB,6CAAqE;AAGrE,uCAAoC;AACpC,kCAA+B;AAC/B,qDAAkE;AAoClE,MAAM,MAAM,GACV,IAAA,kBAAU,EAAC,CAAC,KAAkB,EAAE,GAAc,EAAE,EAAE;IAChD,MAAM,EACJ,QAAQ,EACR,WAAW,EAAE,SAAS,GAAG,QAAQ,EACjC,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,QAAQ,EACf,IAAI,EACJ,YAAY,GAAG,MAAM;IACrB,6DAA6D;IAC7D,OAAO;IACP,6DAA6D;IAC7D,OAAO,KAEL,KAAK,EADJ,UAAU,UACX,KAAK,EAfH,oIAeL,CAAQ,CAAC;IACV,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAA,uBAAQ,EAAC,KAAK,CAAC,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAC;IAEzC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC;IAE3D,gDAAgD;IAChD,MAAM,OAAO,GAAG,IAAA,cAAI,EAClB,QAAQ,EACR,eAAe,EACf,aAAa,OAAO,EAAE,EACtB,UAAU,IAAI,EAAE,EAChB;QACE,eAAe,EAAE,UAAU;QAC3B,cAAc,EAAE,SAAS;QACzB,cAAc,EAAE,SAAS;QACzB,cAAc,EAAE,SAAS,IAAI,CAAC,SAAS;QACvC,oBAAoB,EAAE,c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iDACM,UAAU,EACV,UAAU,EACV,UAAU,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,qBAAqB,iBAEhC,uBAAC,qBAAS,oBAAK,UAAU,IAAE,SAAS,EAAE,gBAAgB,IAAI,
|
|
1
|
+
{"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;AAEb,0DAGmC;AACnC,uDAA4E;AAC5E,iCAA+B;AAC/B,mDAAqD;AAErD,2DAAoD;AACpD,6CAAiD;AACjD,gDAAwB;AACxB,iEAA6D;AAC7D,2CAAwC;AACxC,sCAAmC;AACnC,uCAAoC;AACpC,yCAAsC;AACtC,oCAAiC;AAQjC,SAAgB,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,KAAK,GAAG,IAAA,+BAAkB,EAAC,KAAK,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,IAAA,cAAM,EAAwB,IAAI,CAAC,CAAC;IAChD,MAAM,EACJ,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,GACd,GAAG,IAAA,0BAAa,EAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAErC,MAAM,OAAO,GAAG,IAAA,cAAI,EAAC,mBAAmB,EAAE;QACxC,YAAY,EAAE,KAAK,CAAC,eAAe,KAAK,OAAO;QAC/C,cAAc,EAAE,KAAK,CAAC,eAAe,KAAK,SAAS;QACnD,eAAe,EAAE,OAAO,UAAU,KAAK,SAAS,IAAI,UAAU;QAC9D,eAAe,EAAE,OAAO,UAAU,KAAK,SAAS,IAAI,CAAC,UAAU;KAChE,CAAC,CAAC;IAEH,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAA,uBAAQ,oBACrC,KAAK,EACR,CAAC;IAEH,MAAM,EAAE,UAAU,EAA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.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./useBreakpoint"), exports);
|
|
18
18
|
__exportStar(require("./useHideColumns"), exports);
|
|
19
|
+
__exportStar(require("./useButton"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,mDAAiC;AACjC,8CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./useButton";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useButton"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/useButton/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSXElementConstructor } from "react";
|
|
2
|
+
export interface UseButtonProps {
|
|
3
|
+
elementType?: "button" | "a" | "span" | "input" | JSXElementConstructor<any> | undefined;
|
|
4
|
+
type?: "button" | "submit" | "reset";
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
|
+
onPress?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
8
|
+
href?: string;
|
|
9
|
+
target?: string;
|
|
10
|
+
rel?: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function useButton({ elementType, type, isDisabled, href, target, rel, role, onClick, onPress, }: UseButtonProps): {
|
|
14
|
+
buttonProps: {
|
|
15
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
16
|
+
type: "button" | "reset" | "submit";
|
|
17
|
+
role?: undefined;
|
|
18
|
+
href: string | undefined;
|
|
19
|
+
target: string | undefined;
|
|
20
|
+
rel: string | undefined;
|
|
21
|
+
tabIndex: number;
|
|
22
|
+
disabled: true | undefined;
|
|
23
|
+
"aria-disabled": true | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
26
|
+
role: string | undefined;
|
|
27
|
+
type?: undefined;
|
|
28
|
+
href: string | undefined;
|
|
29
|
+
target: string | undefined;
|
|
30
|
+
rel: string | undefined;
|
|
31
|
+
tabIndex: number;
|
|
32
|
+
disabled: true | undefined;
|
|
33
|
+
"aria-disabled": true | undefined;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useButton = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useButton({ elementType = "button", type = "button", isDisabled = false, href, target, rel, role, onClick, onPress, }) {
|
|
6
|
+
const realOnClick = (0, react_1.useCallback)((event) => {
|
|
7
|
+
if (isDisabled) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
11
|
+
onPress === null || onPress === void 0 ? void 0 : onPress(event);
|
|
12
|
+
}, [isDisabled, onClick, onPress]);
|
|
13
|
+
function getRole() {
|
|
14
|
+
if (role) {
|
|
15
|
+
return role;
|
|
16
|
+
}
|
|
17
|
+
if (elementType === "a") {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return "button";
|
|
21
|
+
}
|
|
22
|
+
const extraProps = elementType === "button"
|
|
23
|
+
? { type }
|
|
24
|
+
: {
|
|
25
|
+
role: getRole(),
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
buttonProps: Object.assign(Object.assign({ href: elementType === "a" ? href : undefined, target: elementType === "a" ? target : undefined, rel: elementType === "a" ? rel : undefined, tabIndex: isDisabled ? -1 : 0, disabled: isDisabled || undefined, "aria-disabled": isDisabled || undefined }, extraProps), { onClick: realOnClick }),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
exports.useButton = useButton;
|
|
32
|
+
//# sourceMappingURL=useButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useButton.js","sourceRoot":"","sources":["../../../../src/hooks/useButton/useButton.tsx"],"names":[],"mappings":";;;AAAA,iCAA2D;AAoB3D,SAAgB,SAAS,CAAC,EACxB,WAAW,GAAG,QAAQ,EACtB,IAAI,GAAG,QAAQ,EACf,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,MAAM,EACN,GAAG,EACH,IAAI,EACJ,OAAO,EACP,OAAO,GACQ;IACf,MAAM,WAAW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|
|
3
|
+
const react_1 = require("@testing-library/react");
|
|
4
|
+
const useButton_1 = require("./useButton");
|
|
5
|
+
describe("useButton", () => {
|
|
6
|
+
it("should return an object", () => {
|
|
7
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
8
|
+
expect(result.current).toBeInstanceOf(Object);
|
|
9
|
+
});
|
|
10
|
+
it("should return an object with buttonProps", () => {
|
|
11
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
12
|
+
expect(result.current).toHaveProperty("buttonProps");
|
|
13
|
+
});
|
|
14
|
+
describe("type", () => {
|
|
15
|
+
it("should return an object with buttonProps with type property", () => {
|
|
16
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
17
|
+
expect(result.current.buttonProps).toHaveProperty("type");
|
|
18
|
+
});
|
|
19
|
+
it("should return an object with buttonProps with type set to button when elementType is button", () => {
|
|
20
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ elementType: "button" }));
|
|
21
|
+
expect(result.current.buttonProps).toHaveProperty("type", "button");
|
|
22
|
+
});
|
|
23
|
+
it("should return an object with buttonProps with type set to passed in type when elementType is button", () => {
|
|
24
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ type: "submit" }));
|
|
25
|
+
expect(result.current.buttonProps).toHaveProperty("type", "submit");
|
|
26
|
+
});
|
|
27
|
+
it("should return an object without buttonProps with type property when elementType is not button", () => {
|
|
28
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ elementType: "a" }));
|
|
29
|
+
expect(result.current.buttonProps).not.toHaveProperty("type");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe("isDisabled", () => {
|
|
33
|
+
it("should return an object with buttonProps with disabled property set to undefined", () => {
|
|
34
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
35
|
+
expect(result.current.buttonProps).toHaveProperty("disabled", undefined);
|
|
36
|
+
});
|
|
37
|
+
it("should return an object with buttonProps with disabled set to true when isDisabled is set to true", () => {
|
|
38
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ isDisabled: true }));
|
|
39
|
+
expect(result.current.buttonProps).toHaveProperty("disabled", true);
|
|
40
|
+
});
|
|
41
|
+
it("should return an object with buttonProps with aria-disabled property set to undefined", () => {
|
|
42
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
43
|
+
expect(result.current.buttonProps).toHaveProperty("aria-disabled", undefined);
|
|
44
|
+
});
|
|
45
|
+
it("should return an object with buttonProps with aria-disabled property set to true when isDisabled is set to true", () => {
|
|
46
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ isDisabled: true }));
|
|
47
|
+
expect(result.current.buttonProps).toHaveProperty("aria-disabled", true);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe("href", () => {
|
|
51
|
+
describe("when elementType is a", () => {
|
|
52
|
+
it("should return an object with buttonProps with href property set to undefined", () => {
|
|
53
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
54
|
+
expect(result.current.buttonProps).toHaveProperty("href", undefined);
|
|
55
|
+
});
|
|
56
|
+
it("should return an object with buttonProps with href property set to passed in href", () => {
|
|
57
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ elementType: "a", href: "test" }));
|
|
58
|
+
expect(result.current.buttonProps).toHaveProperty("href", "test");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
describe("when elementType is not a", () => {
|
|
62
|
+
it("should return an object with buttonProps with href property set to undefined", () => {
|
|
63
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ elementType: "button" }));
|
|
64
|
+
expect(result.current.buttonProps).toHaveProperty("href", undefined);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe("target", () => {
|
|
69
|
+
describe("when elementType is a", () => {
|
|
70
|
+
it("should return an object with buttonProps with target property set to undefined", () => {
|
|
71
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
72
|
+
expect(result.current.buttonProps).toHaveProperty("target", undefined);
|
|
73
|
+
});
|
|
74
|
+
it("should return an object with buttonProps with target property set to passed in target", () => {
|
|
75
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ elementType: "a", target: "test" }));
|
|
76
|
+
expect(result.current.buttonProps).toHaveProperty("target", "test");
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe("when elementType is not a", () => {
|
|
80
|
+
it("should return an object with buttonProps with target property set to undefined", () => {
|
|
81
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ elementType: "button" }));
|
|
82
|
+
expect(result.current.buttonProps).toHaveProperty("target", undefined);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
describe("rel", () => {
|
|
87
|
+
describe("when elementType is a", () => {
|
|
88
|
+
it("should return an object with buttonProps with rel property set to undefined", () => {
|
|
89
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
90
|
+
expect(result.current.buttonProps).toHaveProperty("rel", undefined);
|
|
91
|
+
});
|
|
92
|
+
it("should return an object with buttonProps with rel property set to passed in rel", () => {
|
|
93
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ elementType: "a", rel: "test" }));
|
|
94
|
+
expect(result.current.buttonProps).toHaveProperty("rel", "test");
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
describe("when elementType is not a", () => {
|
|
98
|
+
it("should return an object with buttonProps with rel property set to undefined", () => {
|
|
99
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ elementType: "button" }));
|
|
100
|
+
expect(result.current.buttonProps).toHaveProperty("rel", undefined);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
describe("events", () => {
|
|
105
|
+
it("should return an object with buttonProps with onClick property", () => {
|
|
106
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({}));
|
|
107
|
+
expect(result.current.buttonProps).toHaveProperty("onClick");
|
|
108
|
+
});
|
|
109
|
+
describe("onClick", () => {
|
|
110
|
+
it("should call onClick when buttonProps onClick is called", () => {
|
|
111
|
+
const onClick = jest.fn();
|
|
112
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ onClick }));
|
|
113
|
+
// @ts-expect-error - We don't care about the event argument
|
|
114
|
+
result.current.buttonProps.onClick();
|
|
115
|
+
expect(onClick).toHaveBeenCalled();
|
|
116
|
+
});
|
|
117
|
+
it("should not call onClick when buttonProps onClick is called and isDisabled is true", () => {
|
|
118
|
+
const onClick = jest.fn();
|
|
119
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ onClick, isDisabled: true }));
|
|
120
|
+
// @ts-expect-error - We don't care about the event argument
|
|
121
|
+
result.current.buttonProps.onClick();
|
|
122
|
+
expect(onClick).not.toHaveBeenCalled();
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
describe("onPress", () => {
|
|
126
|
+
it("should call onPress when buttonProps onClick is called", () => {
|
|
127
|
+
const onPress = jest.fn();
|
|
128
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ onPress }));
|
|
129
|
+
// @ts-expect-error - We don't care about the event argument
|
|
130
|
+
result.current.buttonProps.onClick();
|
|
131
|
+
expect(onPress).toHaveBeenCalled();
|
|
132
|
+
});
|
|
133
|
+
it("should not call onPress when buttonProps onClick is called and isDisabled is true", () => {
|
|
134
|
+
const onPress = jest.fn();
|
|
135
|
+
const { result } = (0, react_1.renderHook)(() => (0, useButton_1.useButton)({ onPress, isDisabled: true }));
|
|
136
|
+
// @ts-expect-error - We don't care about the event argument
|
|
137
|
+
result.current.buttonProps.onClick();
|
|
138
|
+
expect(onPress).not.toHaveBeenCalled();
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=useButton.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useButton.test.js","sourceRoot":"","sources":["../../../../src/hooks/useButton/useButton.test.tsx"],"names":[],"mappings":";;AAAA,kDAAoD;AACpD,2CAAwC;AAExC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,EAAC,GAAG,EAAE,CAAC,IAAA,qBAAS,EAAC,EAAE,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,EAAC,GAAG,EAAE,CAAC,IAAA,qBAAS,EAAC,EAAE,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;YACrE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,EAAC,GAAG,EAAE,CAAC,IAAA,qBAAS,EAAC,EAAE,CAAC,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6FAA6F,EAAE,GAAG,EAAE;YACrG,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA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