@geneui/components 3.0.0-next-b9c382c-15042025 → 3.0.0-next-4ef2cbc-18042025
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/CheckMark-34798545.js +23 -0
- package/Checkbox.js +1 -19
- package/Copy.js +62 -0
- package/components/atoms/Copy/Copy.d.ts +39 -0
- package/components/atoms/Copy/index.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { _ as _objectWithoutProperties, a as _extends } from './ActivityRecent-b88e2ba8.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
var _excluded = ["size", "color"];
|
|
5
|
+
var SvgCheckMark = function SvgCheckMark(_ref) {
|
|
6
|
+
var _ref$size = _ref.size,
|
|
7
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
8
|
+
_ref$color = _ref.color,
|
|
9
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
10
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
12
|
+
width: size,
|
|
13
|
+
height: size,
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: color,
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
17
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
18
|
+
d: "M9.19 19.25a.75.75 0 0 1-.564-.255l-5.44-6.188a.756.756 0 0 1 .612-1.248.75.75 0 0 1 .516.253l4.867 5.535 10.491-12.33a.75.75 0 0 1 1.322.426.756.756 0 0 1-.176.55l-11.055 12.992a.756.756 0 0 1-.567.265h-.006Z",
|
|
19
|
+
fill: color
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { SvgCheckMark as S };
|
package/Checkbox.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { c as classNames } from './index-ce02421b.js';
|
|
3
|
+
import { S as SvgCheckMark } from './CheckMark-34798545.js';
|
|
3
4
|
import { _ as _objectWithoutProperties, a as _extends } from './ActivityRecent-b88e2ba8.js';
|
|
4
5
|
import HelperText from './HelperText.js';
|
|
5
6
|
import Label from './Label.js';
|
|
@@ -15,25 +16,6 @@ import './useEllipsisDetection-e2685fb7.js';
|
|
|
15
16
|
import './Info.js';
|
|
16
17
|
import './InfoOutlined-fc7d9afa.js';
|
|
17
18
|
|
|
18
|
-
var _excluded$1 = ["size", "color"];
|
|
19
|
-
var SvgCheckMark = function SvgCheckMark(_ref) {
|
|
20
|
-
var _ref$size = _ref.size,
|
|
21
|
-
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
22
|
-
_ref$color = _ref.color,
|
|
23
|
-
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
24
|
-
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
25
|
-
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
26
|
-
width: size,
|
|
27
|
-
height: size,
|
|
28
|
-
viewBox: "0 0 24 24",
|
|
29
|
-
fill: color,
|
|
30
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
31
|
-
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
32
|
-
d: "M9.19 19.25a.75.75 0 0 1-.564-.255l-5.44-6.188a.756.756 0 0 1 .612-1.248.75.75 0 0 1 .516.253l4.867 5.535 10.491-12.33a.75.75 0 0 1 1.322.426.756.756 0 0 1-.176.55l-11.055 12.992a.756.756 0 0 1-.567.265h-.006Z",
|
|
33
|
-
fill: color
|
|
34
|
-
}));
|
|
35
|
-
};
|
|
36
|
-
|
|
37
19
|
var _excluded = ["size", "color"];
|
|
38
20
|
var SvgMinus = function SvgMinus(_ref) {
|
|
39
21
|
var _ref$size = _ref.size,
|
package/Copy.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React__default, { useState } from 'react';
|
|
2
|
+
import { S as SvgCheckMark } from './CheckMark-34798545.js';
|
|
3
|
+
import { _ as _objectWithoutProperties, a as _extends } from './ActivityRecent-b88e2ba8.js';
|
|
4
|
+
import Button from './Button.js';
|
|
5
|
+
import Tooltip from './Tooltip.js';
|
|
6
|
+
import './index-ce02421b.js';
|
|
7
|
+
import './Loader.js';
|
|
8
|
+
import './style-inject.es-746bb8ed.js';
|
|
9
|
+
import './floating-ui.react-0485e4db.js';
|
|
10
|
+
import 'react-dom';
|
|
11
|
+
import './index-7fa24b9c.js';
|
|
12
|
+
import './useDebounceCallback-999deae7.js';
|
|
13
|
+
|
|
14
|
+
var _excluded = ["size", "color"];
|
|
15
|
+
var SvgCopy = function SvgCopy(_ref) {
|
|
16
|
+
var _ref$size = _ref.size,
|
|
17
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
18
|
+
_ref$color = _ref.color,
|
|
19
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
22
|
+
width: size,
|
|
23
|
+
height: size,
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
fill: color,
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
27
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
28
|
+
d: "M18.222 1.959h-9.93a1.753 1.753 0 0 0-1.744 1.744v13.87a1.747 1.747 0 0 0 1.745 1.744h9.929a1.74 1.74 0 0 0 1.744-1.745v-13.869a1.747 1.747 0 0 0-1.744-1.744Zm.249 15.613a.248.248 0 0 1-.25.25h-9.928a.247.247 0 0 1-.25-.25v-13.869a.253.253 0 0 1 .25-.249h9.929a.253.253 0 0 1 .249.25v13.868Z",
|
|
29
|
+
fill: color
|
|
30
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
31
|
+
d: "M16.148 20.463h-7.985a2.704 2.704 0 0 1-2.701-2.702v-13.759a1.724 1.724 0 0 0-1.496 1.715v12.044a4.203 4.203 0 0 0 4.197 4.198h7.985a1.733 1.733 0 0 0 1.715-1.506h-1.665a.092.092 0 0 1-.05.01Z",
|
|
32
|
+
fill: color
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Copy component used to copy content to the clipboard, providing visual feedback upon success.
|
|
37
|
+
const CopyComponent = ({ size = "medium", value, className, contentRef, copyTooltipText = "Copy", copiedTooltipText = "Copied", appearance = "primary", disabled }) => {
|
|
38
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
39
|
+
const copyContent = (e) => {
|
|
40
|
+
var _a;
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
if (isCopied)
|
|
43
|
+
return;
|
|
44
|
+
const content = value || ((_a = contentRef === null || contentRef === void 0 ? void 0 : contentRef.current) === null || _a === void 0 ? void 0 : _a.innerText);
|
|
45
|
+
if (!content)
|
|
46
|
+
return;
|
|
47
|
+
navigator.clipboard
|
|
48
|
+
.writeText(content)
|
|
49
|
+
.then(() => {
|
|
50
|
+
setIsCopied(true);
|
|
51
|
+
const id = setTimeout(() => {
|
|
52
|
+
setIsCopied(false);
|
|
53
|
+
clearTimeout(id);
|
|
54
|
+
}, 2000);
|
|
55
|
+
})
|
|
56
|
+
.catch((error) => console.error("Failed to copy:", error));
|
|
57
|
+
};
|
|
58
|
+
return (React__default.createElement(Tooltip, { text: isCopied ? copiedTooltipText : copyTooltipText, isVisible: true },
|
|
59
|
+
React__default.createElement(Button, { className: className, Icon: isCopied ? SvgCheckMark : SvgCopy, onClick: copyContent, size: size, disabled: disabled, appearance: appearance, displayType: "text" })));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export { CopyComponent as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FC, RefObject } from "react";
|
|
2
|
+
interface ICopyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Size of the copy and copied icons: `small | medium | large | XSmall`,
|
|
5
|
+
*/
|
|
6
|
+
size?: "small" | "medium" | "large" | "XSmall";
|
|
7
|
+
/**
|
|
8
|
+
* Additional class for the parent element.
|
|
9
|
+
* This prop should be used to set placement properties for the element relative to its parent using BEM conventions.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Reference to the content you want to copy
|
|
14
|
+
*/
|
|
15
|
+
contentRef?: RefObject<HTMLElement>;
|
|
16
|
+
/**
|
|
17
|
+
* Tooltip text to display when the copy action is available. It will be shown when the user hovers over the copy icon.
|
|
18
|
+
*/
|
|
19
|
+
copyTooltipText?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Tooltip text to display when the copy action has been performed. It will be shown when the user clicks on the copy icon.
|
|
22
|
+
*/
|
|
23
|
+
copiedTooltipText?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The value to copy. If specified, this will be copied instead of the content referenced by contentRef.
|
|
26
|
+
*/
|
|
27
|
+
value?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Indicates the action meaning. <br>
|
|
30
|
+
* Possible values: `secondary | primary | inverse`
|
|
31
|
+
*/
|
|
32
|
+
appearance?: "secondary" | "primary" | "inverse";
|
|
33
|
+
/**
|
|
34
|
+
* Disables the copy, preventing it from being interacted with.
|
|
35
|
+
*/
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
}
|
|
38
|
+
declare const CopyComponent: FC<ICopyProps>;
|
|
39
|
+
export { ICopyProps, CopyComponent as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ICopyProps, default } from "./Copy";
|
package/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { Popover, PopoverBody, PopoverFooter, PopoverFooterActions, IPopoverProp
|
|
|
14
14
|
export { default as Badge, IBadgeProps } from "./components/atoms/Badge";
|
|
15
15
|
export { default as Scrollbar, IScrollbarProps } from "./components/atoms/Scrollbar";
|
|
16
16
|
export { Grid, Col, Row, IColProps, IRowProps } from "./components/atoms/Grid";
|
|
17
|
+
export { default as Copy, ICopyProps } from "./components/atoms/Copy";
|
|
17
18
|
export { default as Tooltip, ITooltipProps } from "./components/molecules/Tooltip";
|
|
18
19
|
export { default as ProgressBar, IProgressBarProps } from "./components/molecules/ProgressBar";
|
|
19
20
|
export { Steps, Step, IStepProps, IStepsProps } from "./components/molecules/Steps";
|
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { Popover, PopoverBody, PopoverFooter, PopoverFooterActions } from './Pop
|
|
|
14
14
|
export { default as Badge } from './Badge.js';
|
|
15
15
|
export { default as Scrollbar } from './Scrollbar.js';
|
|
16
16
|
export { Col, Grid, Row } from './Grid.js';
|
|
17
|
+
export { default as Copy } from './Copy.js';
|
|
17
18
|
export { default as Tooltip } from './Tooltip.js';
|
|
18
19
|
export { default as ProgressBar } from './ProgressBar.js';
|
|
19
20
|
export { Step, Steps } from './Steps.js';
|
|
@@ -36,6 +37,7 @@ import './floating-ui.react-0485e4db.js';
|
|
|
36
37
|
import 'react-dom';
|
|
37
38
|
import './X-20da3b4a.js';
|
|
38
39
|
import 'prop-types';
|
|
40
|
+
import './CheckMark-34798545.js';
|
|
39
41
|
|
|
40
42
|
const SCROLL_LOCK_CLASS = "scroll-lock";
|
|
41
43
|
const useScrollLock = (target) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geneui/components",
|
|
3
3
|
"description": "The Gene UI components library designed for BI tools",
|
|
4
|
-
"version": "3.0.0-next-
|
|
4
|
+
"version": "3.0.0-next-4ef2cbc-18042025",
|
|
5
5
|
"author": "SoftConstruct",
|
|
6
6
|
"homepage": "https://github.com/softconstruct/gene-ui-components#readme",
|
|
7
7
|
"repository": {
|