@conduction/components 2.2.9 → 2.2.10
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/README.md +1 -0
- package/lib/components/tableWrapper/TableWrapper.d.ts +1 -5
- package/lib/components/tableWrapper/TableWrapper.js +2 -3
- package/lib/components/toolTip/ToolTip.d.ts +1 -0
- package/lib/components/toolTip/ToolTip.js +3 -2
- package/lib/components/toolTip/ToolTip.module.css +2 -0
- package/package.json +1 -1
- package/src/components/tableWrapper/TableWrapper.tsx +4 -16
- package/src/components/toolTip/ToolTip.module.css +2 -0
- package/src/components/toolTip/ToolTip.tsx +4 -2
package/README.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState, useEffect } from "react";
|
|
3
3
|
import * as styles from "./TableWrapper.module.css";
|
|
4
|
-
import clsx from "clsx";
|
|
5
4
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
6
5
|
import { faChevronLeft, faChevronRight } from "@fortawesome/free-solid-svg-icons";
|
|
7
|
-
export const TableWrapper = ({ children
|
|
6
|
+
export const TableWrapper = ({ children }) => {
|
|
8
7
|
const [canScrollRight, setCanScrollRight] = useState(false);
|
|
9
8
|
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
10
9
|
const wrapperRef = React.useRef(null);
|
|
@@ -27,5 +26,5 @@ export const TableWrapper = ({ children, touchScreen, }) => {
|
|
|
27
26
|
setCanScrollRight(wrapperRef.current.scrollWidth > wrapperRef.current.clientWidth); // initiate scroll
|
|
28
27
|
}
|
|
29
28
|
}, []);
|
|
30
|
-
return (_jsx("div", { className: styles.container, children: _jsxs("div", { onScroll: handleScroll, ref: wrapperRef, className:
|
|
29
|
+
return (_jsx("div", { className: styles.container, children: _jsxs("div", { onScroll: handleScroll, ref: wrapperRef, className: styles.wrapper, children: [canScrollLeft && (_jsx("div", { onClick: handleScrollLeft, className: styles.scrollLeftButton, children: _jsx("div", { className: styles.scrollButton, children: _jsx(FontAwesomeIcon, { icon: faChevronLeft }) }) })), children, canScrollRight && (_jsx("div", { onClick: handleScrollRight, className: styles.scrollRightButton, children: _jsx("div", { className: styles.scrollButton, children: _jsx(FontAwesomeIcon, { icon: faChevronRight }) }) }))] }) }));
|
|
31
30
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as styles from "./ToolTip.module.css";
|
|
3
3
|
import { Tooltip } from "react-tooltip";
|
|
4
|
+
import clsx from "clsx";
|
|
4
5
|
/**
|
|
5
6
|
* Implement this ToolTip only once, in a high-level wrapper.
|
|
6
7
|
* Use the ToolTip anywhere, in any element, by setting the following data props:
|
|
@@ -8,6 +9,6 @@ import { Tooltip } from "react-tooltip";
|
|
|
8
9
|
* data-tooltip-id="this-is-the-id-set-in-ToolTipProps"
|
|
9
10
|
* data-tooltip-content="Hello world!"
|
|
10
11
|
*/
|
|
11
|
-
export const ToolTip = ({ id }) => {
|
|
12
|
-
return _jsx(Tooltip, { className: styles.tooltip, ...{ id } });
|
|
12
|
+
export const ToolTip = ({ id, layoutClassName }) => {
|
|
13
|
+
return _jsx(Tooltip, { className: clsx(styles.tooltip, layoutClassName, layoutClassName), ...{ id } });
|
|
13
14
|
};
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
--conduction-tooltip-border-radius: 0px;
|
|
14
14
|
|
|
15
15
|
--conduction-tooltip-opacity: 1;
|
|
16
|
+
--conduction-tooltip-z-index: 9999;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.tooltip {
|
|
@@ -30,4 +31,5 @@
|
|
|
30
31
|
border-radius: var(--conduction-tooltip-border-radius) !important;
|
|
31
32
|
|
|
32
33
|
opacity: var(--conduction-tooltip-opacity);
|
|
34
|
+
z-index: var(--conduction-tooltip-z-index);
|
|
33
35
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
2
|
import * as styles from "./TableWrapper.module.css";
|
|
3
|
-
import clsx from "clsx";
|
|
4
3
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
5
4
|
import { faChevronLeft, faChevronRight } from "@fortawesome/free-solid-svg-icons";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
touchScreen?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const TableWrapper: React.FC<{ children: React.ReactNode } & TableWrapperProps> = ({
|
|
12
|
-
children,
|
|
13
|
-
touchScreen,
|
|
14
|
-
}) => {
|
|
6
|
+
export const TableWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
15
7
|
const [canScrollRight, setCanScrollRight] = useState(false);
|
|
16
8
|
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
17
9
|
|
|
@@ -42,12 +34,8 @@ export const TableWrapper: React.FC<{ children: React.ReactNode } & TableWrapper
|
|
|
42
34
|
|
|
43
35
|
return (
|
|
44
36
|
<div className={styles.container}>
|
|
45
|
-
<div
|
|
46
|
-
|
|
47
|
-
ref={wrapperRef}
|
|
48
|
-
className={clsx(touchScreen ? styles.wrapperTouchscreen : styles.wrapper)}
|
|
49
|
-
>
|
|
50
|
-
{canScrollLeft && !touchScreen && (
|
|
37
|
+
<div onScroll={handleScroll} ref={wrapperRef} className={styles.wrapper}>
|
|
38
|
+
{canScrollLeft && (
|
|
51
39
|
<div onClick={handleScrollLeft} className={styles.scrollLeftButton}>
|
|
52
40
|
<div className={styles.scrollButton}>
|
|
53
41
|
<FontAwesomeIcon icon={faChevronLeft} />
|
|
@@ -55,7 +43,7 @@ export const TableWrapper: React.FC<{ children: React.ReactNode } & TableWrapper
|
|
|
55
43
|
</div>
|
|
56
44
|
)}
|
|
57
45
|
{children}
|
|
58
|
-
{canScrollRight &&
|
|
46
|
+
{canScrollRight && (
|
|
59
47
|
<div onClick={handleScrollRight} className={styles.scrollRightButton}>
|
|
60
48
|
<div className={styles.scrollButton}>
|
|
61
49
|
<FontAwesomeIcon icon={faChevronRight} />
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
--conduction-tooltip-border-radius: 0px;
|
|
14
14
|
|
|
15
15
|
--conduction-tooltip-opacity: 1;
|
|
16
|
+
--conduction-tooltip-z-index: 9999;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.tooltip {
|
|
@@ -30,4 +31,5 @@
|
|
|
30
31
|
border-radius: var(--conduction-tooltip-border-radius) !important;
|
|
31
32
|
|
|
32
33
|
opacity: var(--conduction-tooltip-opacity);
|
|
34
|
+
z-index: var(--conduction-tooltip-z-index);
|
|
33
35
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as styles from "./ToolTip.module.css";
|
|
3
3
|
import { Tooltip } from "react-tooltip";
|
|
4
|
+
import clsx from "clsx";
|
|
4
5
|
|
|
5
6
|
interface ToolTipProps {
|
|
6
7
|
id: string;
|
|
8
|
+
layoutClassName?: string;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -14,6 +16,6 @@ interface ToolTipProps {
|
|
|
14
16
|
* data-tooltip-content="Hello world!"
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
|
-
export const ToolTip: React.FC<ToolTipProps> = ({ id }) => {
|
|
18
|
-
return <Tooltip className={styles.tooltip} {...{ id }} />;
|
|
19
|
+
export const ToolTip: React.FC<ToolTipProps> = ({ id, layoutClassName }) => {
|
|
20
|
+
return <Tooltip className={clsx(styles.tooltip, layoutClassName, layoutClassName)} {...{ id }} />;
|
|
19
21
|
};
|