@uxf/core-react 11.90.0 → 11.91.0
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addIsHoverableClassname = addIsHoverableClassname;
|
|
4
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
5
|
+
function addIsHoverableClassname(options) {
|
|
6
|
+
return options.classNamePrefix
|
|
7
|
+
? `${options.classNamePrefix}--${classes_1.CLASSES.IS_HOVERABLE} ${classes_1.CLASSES.IS_HOVERABLE}`
|
|
8
|
+
: classes_1.CLASSES.IS_HOVERABLE;
|
|
9
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useAnchorProps = useAnchorProps;
|
|
4
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
5
4
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
6
5
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
7
6
|
const _use_simulated_button_1 = require("./_use-simulated-button");
|
|
8
7
|
const add_busy_and_disabled_classnames_1 = require("./add-busy-and-disabled-classnames");
|
|
8
|
+
const add_is_hoverable_classname_1 = require("./add-is-hoverable-classname");
|
|
9
9
|
function useAnchorProps(props, options = {}) {
|
|
10
10
|
const { ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, analyticsCallback, className, isDisabled, download, href, hrefLang, isLoading, media, onClick, onKeyDown, onKeyUp, ping, referrerPolicy, rel, role, tabIndex, target, type, ...restProps } = props;
|
|
11
11
|
const isBusy = Boolean(isLoading || ariaBusy);
|
|
@@ -28,7 +28,7 @@ function useAnchorProps(props, options = {}) {
|
|
|
28
28
|
return {
|
|
29
29
|
"aria-busy": isBusy,
|
|
30
30
|
"aria-disabled": isDisabledOrAriaDisabled,
|
|
31
|
-
className: (0, cx_1.cx)(
|
|
31
|
+
className: (0, cx_1.cx)((0, add_is_hoverable_classname_1.addIsHoverableClassname)(options), ..._className),
|
|
32
32
|
download,
|
|
33
33
|
href,
|
|
34
34
|
hrefLang,
|
|
@@ -49,7 +49,7 @@ function useAnchorProps(props, options = {}) {
|
|
|
49
49
|
return {
|
|
50
50
|
"aria-busy": isBusy,
|
|
51
51
|
"aria-disabled": isDisabledOrAriaDisabled,
|
|
52
|
-
className: (0, cx_1.cx)(
|
|
52
|
+
className: (0, cx_1.cx)((0, add_is_hoverable_classname_1.addIsHoverableClassname)(options), ..._className),
|
|
53
53
|
onClick: simulatedButton.onClick,
|
|
54
54
|
onKeyDown: simulatedButton.onKeyDown,
|
|
55
55
|
onKeyUp: simulatedButton.onKeyUp,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useButtonProps = useButtonProps;
|
|
4
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
5
4
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
6
5
|
const react_1 = require("react");
|
|
7
6
|
const add_busy_and_disabled_classnames_1 = require("./add-busy-and-disabled-classnames");
|
|
7
|
+
const add_is_hoverable_classname_1 = require("./add-is-hoverable-classname");
|
|
8
8
|
function useButtonProps(props, options = {}) {
|
|
9
9
|
const { ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, autoFocus, analyticsCallback, className, disabled, formAction, formEncType, formMethod, formNoValidate, formTarget, loading, name, onClick, role, tabIndex, type, value, ...restProps } = props;
|
|
10
10
|
const isBusy = loading ? loading : Boolean(ariaBusy);
|
|
@@ -41,7 +41,7 @@ function useButtonProps(props, options = {}) {
|
|
|
41
41
|
"aria-busy": isBusy,
|
|
42
42
|
"aria-disabled": ariaDisabled,
|
|
43
43
|
autoFocus,
|
|
44
|
-
className: (0, cx_1.cx)(
|
|
44
|
+
className: (0, cx_1.cx)((0, add_is_hoverable_classname_1.addIsHoverableClassname)(options), ..._className),
|
|
45
45
|
disabled,
|
|
46
46
|
onClick: _onClick,
|
|
47
47
|
role,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useClickableProps = useClickableProps;
|
|
4
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
5
4
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
6
5
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
7
6
|
const _use_simulated_button_1 = require("./_use-simulated-button");
|
|
8
7
|
const add_busy_and_disabled_classnames_1 = require("./add-busy-and-disabled-classnames");
|
|
8
|
+
const add_is_hoverable_classname_1 = require("./add-is-hoverable-classname");
|
|
9
9
|
function useClickableProps(props, options = {}) {
|
|
10
10
|
const { ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, analyticsCallback, className, isDisabled, isLoading, onClick, onKeyDown, onKeyUp, role, tabIndex, type, ...restProps } = props;
|
|
11
11
|
const isBusy = Boolean(isLoading || ariaBusy);
|
|
@@ -27,7 +27,7 @@ function useClickableProps(props, options = {}) {
|
|
|
27
27
|
return {
|
|
28
28
|
"aria-busy": isBusy,
|
|
29
29
|
"aria-disabled": isDisabledOrAriaDisabled,
|
|
30
|
-
className: (0, cx_1.cx)(
|
|
30
|
+
className: (0, cx_1.cx)((0, add_is_hoverable_classname_1.addIsHoverableClassname)(options), ..._className),
|
|
31
31
|
onClick: simulatedButton.onClick,
|
|
32
32
|
onKeyDown: simulatedButton.onKeyDown,
|
|
33
33
|
onKeyUp: simulatedButton.onKeyUp,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/core-react",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.91.0",
|
|
4
4
|
"description": "UXF Core",
|
|
5
5
|
"author": "UX Fans s.r.o",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@uxf/core": "11.
|
|
15
|
+
"@uxf/core": "11.91.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": ">=18.2.0"
|