@bigbinary/neeto-molecules 4.1.53 → 4.1.54
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/dist/cjs/v2/CopyToClipboardButton.js +122 -0
- package/dist/cjs/v2/CopyToClipboardButton.js.map +1 -0
- package/dist/cjs/v2/PageLoader.js +42 -0
- package/dist/cjs/v2/PageLoader.js.map +1 -0
- package/dist/v2/CopyToClipboardButton.js +120 -0
- package/dist/v2/CopyToClipboardButton.js.map +1 -0
- package/dist/v2/PageLoader.js +40 -0
- package/dist/v2/PageLoader.js.map +1 -0
- package/package.json +13 -13
- package/types/v2/CopyToClipboardButton.d.ts +33 -0
- package/types/v2/PageLoader.d.ts +7 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var neetoAtoms = require('@bigbinary/neeto-atoms');
|
|
8
|
+
var classnames = require('classnames');
|
|
9
|
+
var general = require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
10
|
+
var reactI18next = require('react-i18next');
|
|
11
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
|
+
var createLucideIcon = require('../createLucideIcon-DBDhE7kE.js');
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @license lucide-react v1.7.0 - ISC
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the ISC license.
|
|
18
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const __iconNode$1 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
23
|
+
const Check = createLucideIcon.createLucideIcon("check", __iconNode$1);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @license lucide-react v1.7.0 - ISC
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the ISC license.
|
|
29
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
const __iconNode = [
|
|
34
|
+
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
35
|
+
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
36
|
+
];
|
|
37
|
+
const Copy = createLucideIcon.createLucideIcon("copy", __iconNode);
|
|
38
|
+
|
|
39
|
+
var TIME_OUT = 2000;
|
|
40
|
+
|
|
41
|
+
var _excluded = ["className", "icon", "label", "successLabel", "tooltipContent", "successTooltipContent", "value", "variant", "size", "tooltipProps", "onClick"];
|
|
42
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
43
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
44
|
+
var CopyToClipboardButton = function CopyToClipboardButton(_ref) {
|
|
45
|
+
var className = _ref.className,
|
|
46
|
+
_ref$icon = _ref.icon,
|
|
47
|
+
Icon = _ref$icon === void 0 ? Copy : _ref$icon,
|
|
48
|
+
_ref$label = _ref.label,
|
|
49
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
50
|
+
successLabel = _ref.successLabel,
|
|
51
|
+
tooltipContent = _ref.tooltipContent,
|
|
52
|
+
successTooltipContent = _ref.successTooltipContent,
|
|
53
|
+
value = _ref.value,
|
|
54
|
+
_ref$variant = _ref.variant,
|
|
55
|
+
variant = _ref$variant === void 0 ? "outline" : _ref$variant,
|
|
56
|
+
size = _ref.size,
|
|
57
|
+
tooltipProps = _ref.tooltipProps,
|
|
58
|
+
onClick = _ref.onClick,
|
|
59
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
60
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
61
|
+
t = _useTranslation.t;
|
|
62
|
+
var _useState = React.useState(false),
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
isChecked = _useState2[0],
|
|
65
|
+
setIsChecked = _useState2[1];
|
|
66
|
+
var ref = React.useRef();
|
|
67
|
+
var timerRef = React.useRef();
|
|
68
|
+
var resolvedSize = size || (label ? "default" : "icon");
|
|
69
|
+
var onHandleClick = function onHandleClick(event) {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
if (onClick) onClick(event);else general.copyToClipboard(value, {
|
|
73
|
+
showToastr: false
|
|
74
|
+
});
|
|
75
|
+
clearTimeout(timerRef.current);
|
|
76
|
+
setIsChecked(true);
|
|
77
|
+
timerRef.current = setTimeout(function () {
|
|
78
|
+
setIsChecked(false);
|
|
79
|
+
}, TIME_OUT);
|
|
80
|
+
};
|
|
81
|
+
React.useEffect(function () {
|
|
82
|
+
return function () {
|
|
83
|
+
return clearTimeout(timerRef.current);
|
|
84
|
+
};
|
|
85
|
+
}, []);
|
|
86
|
+
React.useLayoutEffect(function () {
|
|
87
|
+
if (!ref.current) return;
|
|
88
|
+
ref.current.style.minWidth = "";
|
|
89
|
+
var buttonWidth = ref.current.clientWidth;
|
|
90
|
+
ref.current.style.minWidth = "".concat(buttonWidth, "px");
|
|
91
|
+
}, [resolvedSize, label]);
|
|
92
|
+
var currentTooltipContent = isChecked ? successTooltipContent || t("neetoMolecules.common.copied") : tooltipContent || t("neetoMolecules.common.copy");
|
|
93
|
+
var buttonLabel = isChecked && label ? successLabel || t("neetoMolecules.common.copied") : label;
|
|
94
|
+
var ButtonIcon = isChecked ? Check : Icon;
|
|
95
|
+
var button = /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Button, _objectSpread(_objectSpread({
|
|
96
|
+
ref: ref,
|
|
97
|
+
"data-testid": "copy-to-clipboard-button",
|
|
98
|
+
size: resolvedSize,
|
|
99
|
+
variant: isChecked ? "default" : variant,
|
|
100
|
+
className: classnames("neeto-molecules-copy-button", isChecked && "neeto-molecules-copy-button--active", className),
|
|
101
|
+
onClick: onHandleClick
|
|
102
|
+
}, otherProps), {}, {
|
|
103
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
104
|
+
size: 16
|
|
105
|
+
}), buttonLabel]
|
|
106
|
+
}));
|
|
107
|
+
if (label) return button;
|
|
108
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.TooltipProvider, {
|
|
109
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
110
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.TooltipTrigger, {
|
|
111
|
+
asChild: true,
|
|
112
|
+
children: button
|
|
113
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.TooltipContent, {
|
|
114
|
+
side: "top",
|
|
115
|
+
children: currentTooltipContent
|
|
116
|
+
})]
|
|
117
|
+
}))
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
module.exports = CopyToClipboardButton;
|
|
122
|
+
//# sourceMappingURL=CopyToClipboardButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyToClipboardButton.js","sources":["../../../node_modules/lucide-react/dist/esm/icons/check.js","../../../node_modules/lucide-react/dist/esm/icons/copy.js","../../../src/v2/components/CopyToClipboardButton/constants.js","../../../src/v2/components/CopyToClipboardButton/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\", key: \"17jyea\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\", key: \"zix9uf\" }]\n];\nconst Copy = createLucideIcon(\"copy\", __iconNode);\n\nexport { __iconNode, Copy as default };\n//# sourceMappingURL=copy.js.map\n","const TIME_OUT = 2000;\n\nexport { TIME_OUT };\n","import { useState, useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport {\n Button,\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { Copy, Check } from \"lucide-react\";\nimport { copyToClipboard } from \"neetocommons/utils/general\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { TIME_OUT } from \"./constants\";\n\nconst CopyToClipboardButton = ({\n className,\n icon: Icon = Copy,\n label = \"\",\n successLabel,\n tooltipContent,\n successTooltipContent,\n value,\n variant = \"outline\",\n size,\n tooltipProps,\n onClick,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n const [isChecked, setIsChecked] = useState(false);\n\n const ref = useRef();\n const timerRef = useRef();\n\n const resolvedSize = size || (label ? \"default\" : \"icon\");\n\n const onHandleClick = event => {\n event.preventDefault();\n event.stopPropagation();\n\n if (onClick) onClick(event);\n else copyToClipboard(value, { showToastr: false });\n\n clearTimeout(timerRef.current);\n setIsChecked(true);\n timerRef.current = setTimeout(() => {\n setIsChecked(false);\n }, TIME_OUT);\n };\n\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n useLayoutEffect(() => {\n if (!ref.current) return;\n ref.current.style.minWidth = \"\";\n const buttonWidth = ref.current.clientWidth;\n ref.current.style.minWidth = `${buttonWidth}px`;\n }, [resolvedSize, label]);\n\n const currentTooltipContent = isChecked\n ? successTooltipContent || t(\"neetoMolecules.common.copied\")\n : tooltipContent || t(\"neetoMolecules.common.copy\");\n\n const buttonLabel =\n isChecked && label\n ? successLabel || t(\"neetoMolecules.common.copied\")\n : label;\n const ButtonIcon = isChecked ? Check : Icon;\n\n const button = (\n <Button\n {...{ ref }}\n data-testid=\"copy-to-clipboard-button\"\n size={resolvedSize}\n variant={isChecked ? \"default\" : variant}\n className={classnames(\n \"neeto-molecules-copy-button\",\n isChecked && \"neeto-molecules-copy-button--active\",\n className\n )}\n onClick={onHandleClick}\n {...otherProps}\n >\n <ButtonIcon size={16} />\n {buttonLabel}\n </Button>\n );\n\n if (label) return button;\n\n return (\n <TooltipProvider>\n <Tooltip {...tooltipProps}>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent side=\"top\">{currentTooltipContent}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n};\n\nCopyToClipboardButton.propTypes = {\n className: PropTypes.string,\n icon: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.func,\n PropTypes.object,\n ]),\n label: PropTypes.string,\n successLabel: PropTypes.string,\n value: PropTypes.string,\n variant: PropTypes.string,\n size: PropTypes.string,\n tooltipContent: PropTypes.string,\n successTooltipContent: PropTypes.string,\n};\n\nexport default CopyToClipboardButton;\n"],"names":["__iconNode","createLucideIcon","TIME_OUT","CopyToClipboardButton","_ref","className","_ref$icon","icon","Icon","Copy","_ref$label","label","successLabel","tooltipContent","successTooltipContent","value","_ref$variant","variant","size","tooltipProps","onClick","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","isChecked","setIsChecked","ref","useRef","timerRef","resolvedSize","onHandleClick","event","preventDefault","stopPropagation","copyToClipboard","showToastr","clearTimeout","current","setTimeout","useEffect","useLayoutEffect","style","minWidth","buttonWidth","clientWidth","concat","currentTooltipContent","buttonLabel","ButtonIcon","Check","button","_jsxs","Button","_objectSpread","classnames","children","_jsx","TooltipProvider","Tooltip","TooltipTrigger","asChild","TooltipContent","side"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AACtE,MAAM,KAAK,GAAGC,iCAAgB,CAAC,OAAO,EAAED,YAAU,CAAC;;ACVnD;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC1F,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,yDAAyD,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC1F,CAAC;AACD,MAAM,IAAI,GAAGC,iCAAgB,CAAC,MAAM,EAAE,UAAU,CAAC;;ACbjD,IAAMC,QAAQ,GAAG,IAAI;;;;;ACiBrB,IAAMC,qBAAqB,GAAG,SAA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
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var neetoAtoms = require('@bigbinary/neeto-atoms');
|
|
7
|
+
var injectCss = require('../inject-css-B6qYtOJe.js');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
|
|
10
|
+
var css = ".neeto-molecules-pageloader__loader{animation:neeto-molecules-pageloader-anim1 .8s linear infinite alternate,neeto-molecules-pageloader-anim2 1.6s linear infinite;aspect-ratio:1;border:5px solid var(--primary);border-radius:50%;width:36px}@keyframes neeto-molecules-pageloader-anim1{0%{clip-path:polygon(50% 50%,0 0,50% 0,50% 0,50% 0,50% 0,50% 0)}12.5%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 0,100% 0,100% 0)}25%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 100%,100% 100%,100% 100%)}50%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 100%,50% 100%,0 100%)}62.5%{clip-path:polygon(50% 50%,100% 0,100% 0,100% 0,100% 100%,50% 100%,0 100%)}75%{clip-path:polygon(50% 50%,100% 100%,100% 100%,100% 100%,100% 100%,50% 100%,0 100%)}to{clip-path:polygon(50% 50%,50% 100%,50% 100%,50% 100%,50% 100%,50% 100%,0 100%)}}@keyframes neeto-molecules-pageloader-anim2{0%{transform:scaleY(1) rotate(0deg)}49.99%{transform:scaleY(1) rotate(135deg)}50%{transform:scaleY(-1) rotate(0deg)}to{transform:scaleY(-1) rotate(-135deg)}}";
|
|
11
|
+
injectCss.n(css,{});
|
|
12
|
+
|
|
13
|
+
var _excluded = ["text"];
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
var PageLoader = function PageLoader(_ref) {
|
|
17
|
+
var _ref$text = _ref.text,
|
|
18
|
+
text = _ref$text === void 0 ? "" : _ref$text,
|
|
19
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({
|
|
21
|
+
className: "relative box-border h-full w-full [&_*]:box-border"
|
|
22
|
+
}, otherProps), {}, {
|
|
23
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
24
|
+
className: "inset-inline-start-0 absolute top-0 flex h-full w-full flex-col items-center justify-center",
|
|
25
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26
|
+
className: "relative mb-4 flex shrink-0 items-center justify-center p-2",
|
|
27
|
+
"data-testid": "neeto-molecules-pageloader",
|
|
28
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29
|
+
className: "neeto-molecules-pageloader__loader"
|
|
30
|
+
})
|
|
31
|
+
}), text && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
32
|
+
variant: "h5",
|
|
33
|
+
weight: "semibold",
|
|
34
|
+
children: text
|
|
35
|
+
})]
|
|
36
|
+
})
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
var index = /*#__PURE__*/React.memo(PageLoader);
|
|
40
|
+
|
|
41
|
+
module.exports = index;
|
|
42
|
+
//# sourceMappingURL=PageLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageLoader.js","sources":["../../../src/v2/components/PageLoader/index.jsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Typography } from \"@bigbinary/neeto-atoms\";\nimport PropTypes from \"prop-types\";\n\nimport \"./page-loader.css\";\n\nconst PageLoader = ({ text = \"\", ...otherProps }) => (\n <div\n className=\"relative box-border h-full w-full [&_*]:box-border\"\n {...otherProps}\n >\n <div className=\"inset-inline-start-0 absolute top-0 flex h-full w-full flex-col items-center justify-center\">\n <div\n className=\"relative mb-4 flex shrink-0 items-center justify-center p-2\"\n data-testid=\"neeto-molecules-pageloader\"\n >\n <div className=\"neeto-molecules-pageloader__loader\" />\n </div>\n {text && (\n <Typography variant=\"h5\" weight=\"semibold\">\n {text}\n </Typography>\n )}\n </div>\n </div>\n);\n\nPageLoader.propTypes = { text: PropTypes.string };\n\nexport default memo(PageLoader);\n"],"names":["PageLoader","_ref","_ref$text","text","otherProps","_objectWithoutProperties","_excluded","_jsx","_objectSpread","className","children","_jsxs","Typography","variant","weight","memo"],"mappings":";;;;;;;;;;;;;;;AAOA,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAAME,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,SAAA;AAAKE,IAAAA,UAAU,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;AAAA,EAAA,oBAC5CC,cAAA,CAAA,KAAA,EAAAC,aAAA,CAAAA,aAAA,CAAA;AACEC,IAAAA,SAAS,EAAC;AAAoD,GAAA,EAC1DL,UAAU,CAAA,EAAA,EAAA,EAAA;AAAAM,IAAAA,QAAA,eAEdC,eAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,6FAA6F;AAAAC,MAAAA,QAAA,gBAC1GH,cAAA,CAAA,KAAA,EAAA;AACEE,QAAAA,SAAS,EAAC,6DAA6D;AACvE,QAAA,aAAA,EAAY,4BAA4B;AAAAC,QAAAA,QAAA,eAExCH,cAAA,CAAA,KAAA,EAAA;AAAKE,UAAAA,SAAS,EAAC;SAAsC;AAAC,OACnD,CAAC,EACLN,IAAI,iBACHI,cAAA,CAACK,qBAAU,EAAA;AAACC,QAAAA,OAAO,EAAC,IAAI;AAACC,QAAAA,MAAM,EAAC,UAAU;AAAAJ,QAAAA,QAAA,EACvCP;AAAI,OACK,CACb;KACE;AAAC,GAAA,CACH,CAAC;AAAA,CACP;AAID,YAAA,aAAeY,UAAI,CAACf,UAAU,CAAC;;;;"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
+
import { useState, useRef, useEffect, useLayoutEffect } from 'react';
|
|
5
|
+
import { Button, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '@bigbinary/neeto-atoms';
|
|
6
|
+
import classnames from 'classnames';
|
|
7
|
+
import { copyToClipboard } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
+
import { c as createLucideIcon } from '../createLucideIcon-mNMhCCpf.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @license lucide-react v1.7.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const __iconNode$1 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
21
|
+
const Check = createLucideIcon("check", __iconNode$1);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @license lucide-react v1.7.0 - ISC
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the ISC license.
|
|
27
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const __iconNode = [
|
|
32
|
+
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
33
|
+
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
34
|
+
];
|
|
35
|
+
const Copy = createLucideIcon("copy", __iconNode);
|
|
36
|
+
|
|
37
|
+
var TIME_OUT = 2000;
|
|
38
|
+
|
|
39
|
+
var _excluded = ["className", "icon", "label", "successLabel", "tooltipContent", "successTooltipContent", "value", "variant", "size", "tooltipProps", "onClick"];
|
|
40
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
41
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
42
|
+
var CopyToClipboardButton = function CopyToClipboardButton(_ref) {
|
|
43
|
+
var className = _ref.className,
|
|
44
|
+
_ref$icon = _ref.icon,
|
|
45
|
+
Icon = _ref$icon === void 0 ? Copy : _ref$icon,
|
|
46
|
+
_ref$label = _ref.label,
|
|
47
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
48
|
+
successLabel = _ref.successLabel,
|
|
49
|
+
tooltipContent = _ref.tooltipContent,
|
|
50
|
+
successTooltipContent = _ref.successTooltipContent,
|
|
51
|
+
value = _ref.value,
|
|
52
|
+
_ref$variant = _ref.variant,
|
|
53
|
+
variant = _ref$variant === void 0 ? "outline" : _ref$variant,
|
|
54
|
+
size = _ref.size,
|
|
55
|
+
tooltipProps = _ref.tooltipProps,
|
|
56
|
+
onClick = _ref.onClick,
|
|
57
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
58
|
+
var _useTranslation = useTranslation(),
|
|
59
|
+
t = _useTranslation.t;
|
|
60
|
+
var _useState = useState(false),
|
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62
|
+
isChecked = _useState2[0],
|
|
63
|
+
setIsChecked = _useState2[1];
|
|
64
|
+
var ref = useRef();
|
|
65
|
+
var timerRef = useRef();
|
|
66
|
+
var resolvedSize = size || (label ? "default" : "icon");
|
|
67
|
+
var onHandleClick = function onHandleClick(event) {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
event.stopPropagation();
|
|
70
|
+
if (onClick) onClick(event);else copyToClipboard(value, {
|
|
71
|
+
showToastr: false
|
|
72
|
+
});
|
|
73
|
+
clearTimeout(timerRef.current);
|
|
74
|
+
setIsChecked(true);
|
|
75
|
+
timerRef.current = setTimeout(function () {
|
|
76
|
+
setIsChecked(false);
|
|
77
|
+
}, TIME_OUT);
|
|
78
|
+
};
|
|
79
|
+
useEffect(function () {
|
|
80
|
+
return function () {
|
|
81
|
+
return clearTimeout(timerRef.current);
|
|
82
|
+
};
|
|
83
|
+
}, []);
|
|
84
|
+
useLayoutEffect(function () {
|
|
85
|
+
if (!ref.current) return;
|
|
86
|
+
ref.current.style.minWidth = "";
|
|
87
|
+
var buttonWidth = ref.current.clientWidth;
|
|
88
|
+
ref.current.style.minWidth = "".concat(buttonWidth, "px");
|
|
89
|
+
}, [resolvedSize, label]);
|
|
90
|
+
var currentTooltipContent = isChecked ? successTooltipContent || t("neetoMolecules.common.copied") : tooltipContent || t("neetoMolecules.common.copy");
|
|
91
|
+
var buttonLabel = isChecked && label ? successLabel || t("neetoMolecules.common.copied") : label;
|
|
92
|
+
var ButtonIcon = isChecked ? Check : Icon;
|
|
93
|
+
var button = /*#__PURE__*/jsxs(Button, _objectSpread(_objectSpread({
|
|
94
|
+
ref: ref,
|
|
95
|
+
"data-testid": "copy-to-clipboard-button",
|
|
96
|
+
size: resolvedSize,
|
|
97
|
+
variant: isChecked ? "default" : variant,
|
|
98
|
+
className: classnames("neeto-molecules-copy-button", isChecked && "neeto-molecules-copy-button--active", className),
|
|
99
|
+
onClick: onHandleClick
|
|
100
|
+
}, otherProps), {}, {
|
|
101
|
+
children: [/*#__PURE__*/jsx(ButtonIcon, {
|
|
102
|
+
size: 16
|
|
103
|
+
}), buttonLabel]
|
|
104
|
+
}));
|
|
105
|
+
if (label) return button;
|
|
106
|
+
return /*#__PURE__*/jsx(TooltipProvider, {
|
|
107
|
+
children: /*#__PURE__*/jsxs(Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
108
|
+
children: [/*#__PURE__*/jsx(TooltipTrigger, {
|
|
109
|
+
asChild: true,
|
|
110
|
+
children: button
|
|
111
|
+
}), /*#__PURE__*/jsx(TooltipContent, {
|
|
112
|
+
side: "top",
|
|
113
|
+
children: currentTooltipContent
|
|
114
|
+
})]
|
|
115
|
+
}))
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { CopyToClipboardButton as default };
|
|
120
|
+
//# sourceMappingURL=CopyToClipboardButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyToClipboardButton.js","sources":["../../node_modules/lucide-react/dist/esm/icons/check.js","../../node_modules/lucide-react/dist/esm/icons/copy.js","../../src/v2/components/CopyToClipboardButton/constants.js","../../src/v2/components/CopyToClipboardButton/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\", key: \"17jyea\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\", key: \"zix9uf\" }]\n];\nconst Copy = createLucideIcon(\"copy\", __iconNode);\n\nexport { __iconNode, Copy as default };\n//# sourceMappingURL=copy.js.map\n","const TIME_OUT = 2000;\n\nexport { TIME_OUT };\n","import { useState, useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport {\n Button,\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { Copy, Check } from \"lucide-react\";\nimport { copyToClipboard } from \"neetocommons/utils/general\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { TIME_OUT } from \"./constants\";\n\nconst CopyToClipboardButton = ({\n className,\n icon: Icon = Copy,\n label = \"\",\n successLabel,\n tooltipContent,\n successTooltipContent,\n value,\n variant = \"outline\",\n size,\n tooltipProps,\n onClick,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n const [isChecked, setIsChecked] = useState(false);\n\n const ref = useRef();\n const timerRef = useRef();\n\n const resolvedSize = size || (label ? \"default\" : \"icon\");\n\n const onHandleClick = event => {\n event.preventDefault();\n event.stopPropagation();\n\n if (onClick) onClick(event);\n else copyToClipboard(value, { showToastr: false });\n\n clearTimeout(timerRef.current);\n setIsChecked(true);\n timerRef.current = setTimeout(() => {\n setIsChecked(false);\n }, TIME_OUT);\n };\n\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n useLayoutEffect(() => {\n if (!ref.current) return;\n ref.current.style.minWidth = \"\";\n const buttonWidth = ref.current.clientWidth;\n ref.current.style.minWidth = `${buttonWidth}px`;\n }, [resolvedSize, label]);\n\n const currentTooltipContent = isChecked\n ? successTooltipContent || t(\"neetoMolecules.common.copied\")\n : tooltipContent || t(\"neetoMolecules.common.copy\");\n\n const buttonLabel =\n isChecked && label\n ? successLabel || t(\"neetoMolecules.common.copied\")\n : label;\n const ButtonIcon = isChecked ? Check : Icon;\n\n const button = (\n <Button\n {...{ ref }}\n data-testid=\"copy-to-clipboard-button\"\n size={resolvedSize}\n variant={isChecked ? \"default\" : variant}\n className={classnames(\n \"neeto-molecules-copy-button\",\n isChecked && \"neeto-molecules-copy-button--active\",\n className\n )}\n onClick={onHandleClick}\n {...otherProps}\n >\n <ButtonIcon size={16} />\n {buttonLabel}\n </Button>\n );\n\n if (label) return button;\n\n return (\n <TooltipProvider>\n <Tooltip {...tooltipProps}>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent side=\"top\">{currentTooltipContent}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n};\n\nCopyToClipboardButton.propTypes = {\n className: PropTypes.string,\n icon: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.func,\n PropTypes.object,\n ]),\n label: PropTypes.string,\n successLabel: PropTypes.string,\n value: PropTypes.string,\n variant: PropTypes.string,\n size: PropTypes.string,\n tooltipContent: PropTypes.string,\n successTooltipContent: PropTypes.string,\n};\n\nexport default CopyToClipboardButton;\n"],"names":["__iconNode","TIME_OUT","CopyToClipboardButton","_ref","className","_ref$icon","icon","Icon","Copy","_ref$label","label","successLabel","tooltipContent","successTooltipContent","value","_ref$variant","variant","size","tooltipProps","onClick","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","isChecked","setIsChecked","ref","useRef","timerRef","resolvedSize","onHandleClick","event","preventDefault","stopPropagation","copyToClipboard","showToastr","clearTimeout","current","setTimeout","useEffect","useLayoutEffect","style","minWidth","buttonWidth","clientWidth","concat","currentTooltipContent","buttonLabel","ButtonIcon","Check","button","_jsxs","Button","_objectSpread","classnames","children","_jsx","TooltipProvider","Tooltip","TooltipTrigger","asChild","TooltipContent","side"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AACtE,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,EAAEA,YAAU,CAAC;;ACVnD;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC1F,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,yDAAyD,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC1F,CAAC;AACD,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC;;ACbjD,IAAMC,QAAQ,GAAG,IAAI;;;;;ACiBrB,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAAC,IAAA,EAarB;AAAA,EAAA,IAZJC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAAC,SAAA,GAAAF,IAAA,CACTG,IAAI;AAAEC,IAAAA,IAAI,GAAAF,SAAA,KAAA,MAAA,GAAGG,IAAI,GAAAH,SAAA;IAAAI,UAAA,GAAAN,I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;AACC3B,IAAAA,GAAG,EAAHA,GAAG;AACT,IAAA,aAAA,EAAY,0BAA0B;AACtCf,IAAAA,IAAI,EAAEkB,YAAa;AACnBnB,IAAAA,OAAO,EAAEc,SAAS,GAAG,SAAS,GAAGd,OAAQ;IACzCZ,SAAS,EAAEwD,UAAU,CACnB,6BAA6B,EAC7B9B,SAAS,IAAI,qCAAqC,EAClD1B,SACF,CAAE;AACFe,IAAAA,OAAO,EAAEiB;AAAc,GAAA,EACnBhB,UAAU,CAAA,EAAA,EAAA,EAAA;IAAAyC,QAAA,EAAA,cAEdC,GAAA,CAACR,UAAU,EAAA;AAACrC,MAAAA,IAAI,EAAE;KAAK,CAAC,EACvBoC,WAAW;AAAA,GAAA,CACN,CACT;EAED,IAAI3C,KAAK,EAAE,OAAO8C,MAAM;EAExB,oBACEM,GAAA,CAACC,eAAe,EAAA;IAAAF,QAAA,eACdJ,IAAA,CAACO,OAAO,EAAAL,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAKzC,YAAY,CAAA,EAAA,EAAA,EAAA;MAAA2C,QAAA,EAAA,cACvBC,GAAA,CAACG,cAAc,EAAA;QAACC,OAAO,EAAA,IAAA;AAAAL,QAAAA,QAAA,EAAEL;AAAM,OAAiB,CAAC,eACjDM,GAAA,CAACK,cAAc,EAAA;AAACC,QAAAA,IAAI,EAAC,KAAK;AAAAP,QAAAA,QAAA,EAAET;AAAqB,OAAiB,CAAC;KAAA,CAC5D;AAAC,GACK,CAAC;AAEtB;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { Typography } from '@bigbinary/neeto-atoms';
|
|
5
|
+
import { n } from '../inject-css-C2dztUxs.js';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var css = ".neeto-molecules-pageloader__loader{animation:neeto-molecules-pageloader-anim1 .8s linear infinite alternate,neeto-molecules-pageloader-anim2 1.6s linear infinite;aspect-ratio:1;border:5px solid var(--primary);border-radius:50%;width:36px}@keyframes neeto-molecules-pageloader-anim1{0%{clip-path:polygon(50% 50%,0 0,50% 0,50% 0,50% 0,50% 0,50% 0)}12.5%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 0,100% 0,100% 0)}25%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 100%,100% 100%,100% 100%)}50%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 100%,50% 100%,0 100%)}62.5%{clip-path:polygon(50% 50%,100% 0,100% 0,100% 0,100% 100%,50% 100%,0 100%)}75%{clip-path:polygon(50% 50%,100% 100%,100% 100%,100% 100%,100% 100%,50% 100%,0 100%)}to{clip-path:polygon(50% 50%,50% 100%,50% 100%,50% 100%,50% 100%,50% 100%,0 100%)}}@keyframes neeto-molecules-pageloader-anim2{0%{transform:scaleY(1) rotate(0deg)}49.99%{transform:scaleY(1) rotate(135deg)}50%{transform:scaleY(-1) rotate(0deg)}to{transform:scaleY(-1) rotate(-135deg)}}";
|
|
9
|
+
n(css,{});
|
|
10
|
+
|
|
11
|
+
var _excluded = ["text"];
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
var PageLoader = function PageLoader(_ref) {
|
|
15
|
+
var _ref$text = _ref.text,
|
|
16
|
+
text = _ref$text === void 0 ? "" : _ref$text,
|
|
17
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
19
|
+
className: "relative box-border h-full w-full [&_*]:box-border"
|
|
20
|
+
}, otherProps), {}, {
|
|
21
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
22
|
+
className: "inset-inline-start-0 absolute top-0 flex h-full w-full flex-col items-center justify-center",
|
|
23
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
24
|
+
className: "relative mb-4 flex shrink-0 items-center justify-center p-2",
|
|
25
|
+
"data-testid": "neeto-molecules-pageloader",
|
|
26
|
+
children: /*#__PURE__*/jsx("div", {
|
|
27
|
+
className: "neeto-molecules-pageloader__loader"
|
|
28
|
+
})
|
|
29
|
+
}), text && /*#__PURE__*/jsx(Typography, {
|
|
30
|
+
variant: "h5",
|
|
31
|
+
weight: "semibold",
|
|
32
|
+
children: text
|
|
33
|
+
})]
|
|
34
|
+
})
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
var index = /*#__PURE__*/memo(PageLoader);
|
|
38
|
+
|
|
39
|
+
export { index as default };
|
|
40
|
+
//# sourceMappingURL=PageLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageLoader.js","sources":["../../src/v2/components/PageLoader/index.jsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Typography } from \"@bigbinary/neeto-atoms\";\nimport PropTypes from \"prop-types\";\n\nimport \"./page-loader.css\";\n\nconst PageLoader = ({ text = \"\", ...otherProps }) => (\n <div\n className=\"relative box-border h-full w-full [&_*]:box-border\"\n {...otherProps}\n >\n <div className=\"inset-inline-start-0 absolute top-0 flex h-full w-full flex-col items-center justify-center\">\n <div\n className=\"relative mb-4 flex shrink-0 items-center justify-center p-2\"\n data-testid=\"neeto-molecules-pageloader\"\n >\n <div className=\"neeto-molecules-pageloader__loader\" />\n </div>\n {text && (\n <Typography variant=\"h5\" weight=\"semibold\">\n {text}\n </Typography>\n )}\n </div>\n </div>\n);\n\nPageLoader.propTypes = { text: PropTypes.string };\n\nexport default memo(PageLoader);\n"],"names":["PageLoader","_ref","_ref$text","text","otherProps","_objectWithoutProperties","_excluded","_jsx","_objectSpread","className","children","_jsxs","Typography","variant","weight","memo"],"mappings":";;;;;;;;;;;;;AAOA,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAAME,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,SAAA;AAAKE,IAAAA,UAAU,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;AAAA,EAAA,oBAC5CC,GAAA,CAAA,KAAA,EAAAC,aAAA,CAAAA,aAAA,CAAA;AACEC,IAAAA,SAAS,EAAC;AAAoD,GAAA,EAC1DL,UAAU,CAAA,EAAA,EAAA,EAAA;AAAAM,IAAAA,QAAA,eAEdC,IAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,6FAA6F;AAAAC,MAAAA,QAAA,gBAC1GH,GAAA,CAAA,KAAA,EAAA;AACEE,QAAAA,SAAS,EAAC,6DAA6D;AACvE,QAAA,aAAA,EAAY,4BAA4B;AAAAC,QAAAA,QAAA,eAExCH,GAAA,CAAA,KAAA,EAAA;AAAKE,UAAAA,SAAS,EAAC;SAAsC;AAAC,OACnD,CAAC,EACLN,IAAI,iBACHI,GAAA,CAACK,UAAU,EAAA;AAACC,QAAAA,OAAO,EAAC,IAAI;AAACC,QAAAA,MAAM,EAAC,UAAU;AAAAJ,QAAAA,QAAA,EACvCP;AAAI,OACK,CACb;KACE;AAAC,GAAA,CACH,CAAC;AAAA,CACP;AAID,YAAA,aAAeY,IAAI,CAACf,UAAU,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.54",
|
|
4
4
|
"description": "A package of reusable molecular components for neeto products.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-molecules.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
|
@@ -58,18 +58,18 @@
|
|
|
58
58
|
"@babel/runtime": "7.26.10",
|
|
59
59
|
"@bigbinary/babel-preset-neeto": "^1.0.14",
|
|
60
60
|
"@bigbinary/eslint-plugin-neeto": "1.9.0",
|
|
61
|
-
"@bigbinary/neeto-atoms": "1.0.
|
|
61
|
+
"@bigbinary/neeto-atoms": "^1.0.6",
|
|
62
62
|
"@bigbinary/neeto-audit-frontend": "2.4.3",
|
|
63
63
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
64
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
64
|
+
"@bigbinary/neeto-commons-frontend": "4.13.120",
|
|
65
65
|
"@bigbinary/neeto-editor": "1.47.99",
|
|
66
66
|
"@bigbinary/neeto-filters-frontend": "4.3.32",
|
|
67
67
|
"@bigbinary/neeto-hotkeys": "1.0.9",
|
|
68
68
|
"@bigbinary/neeto-icons": "1.20.86",
|
|
69
|
-
"@bigbinary/neeto-image-uploader-frontend": "
|
|
70
|
-
"@bigbinary/neeto-team-members-frontend": "5.0.
|
|
71
|
-
"@bigbinary/neeto-time-zones": "0.8.
|
|
72
|
-
"@bigbinary/neetoui": "8.
|
|
69
|
+
"@bigbinary/neeto-image-uploader-frontend": "4.0.1",
|
|
70
|
+
"@bigbinary/neeto-team-members-frontend": "5.0.29",
|
|
71
|
+
"@bigbinary/neeto-time-zones": "0.8.21",
|
|
72
|
+
"@bigbinary/neetoui": "8.6.0",
|
|
73
73
|
"@dnd-kit/core": "^6.3.1",
|
|
74
74
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
75
75
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -233,17 +233,17 @@
|
|
|
233
233
|
"peerDependencies": {
|
|
234
234
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
235
235
|
"@babel/runtime": "7.26.0",
|
|
236
|
-
"@bigbinary/neeto-atoms": "1.0.
|
|
236
|
+
"@bigbinary/neeto-atoms": "^1.0.6",
|
|
237
237
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
238
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
238
|
+
"@bigbinary/neeto-commons-frontend": "4.13.120",
|
|
239
239
|
"@bigbinary/neeto-editor": "1.47.99",
|
|
240
240
|
"@bigbinary/neeto-filters-frontend": "4.3.32",
|
|
241
241
|
"@bigbinary/neeto-hotkeys": "1.0.9",
|
|
242
242
|
"@bigbinary/neeto-icons": "1.20.86",
|
|
243
|
-
"@bigbinary/neeto-image-uploader-frontend": "
|
|
244
|
-
"@bigbinary/neeto-team-members-frontend": "5.0.
|
|
245
|
-
"@bigbinary/neeto-time-zones": "0.8.
|
|
246
|
-
"@bigbinary/neetoui": "8.
|
|
243
|
+
"@bigbinary/neeto-image-uploader-frontend": "4.0.1",
|
|
244
|
+
"@bigbinary/neeto-team-members-frontend": "5.0.29",
|
|
245
|
+
"@bigbinary/neeto-time-zones": "0.8.21",
|
|
246
|
+
"@bigbinary/neetoui": "8.6.0",
|
|
247
247
|
"@dnd-kit/core": "^6.2.0",
|
|
248
248
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
249
249
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export interface CopyToClipboardButtonProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
icon?: React.ElementType;
|
|
6
|
+
label?: string;
|
|
7
|
+
successLabel?: string;
|
|
8
|
+
tooltipContent?: string;
|
|
9
|
+
successTooltipContent?: string;
|
|
10
|
+
value: string;
|
|
11
|
+
variant?:
|
|
12
|
+
| "default"
|
|
13
|
+
| "destructive"
|
|
14
|
+
| "outline"
|
|
15
|
+
| "secondary"
|
|
16
|
+
| "ghost"
|
|
17
|
+
| "link";
|
|
18
|
+
size?:
|
|
19
|
+
| "default"
|
|
20
|
+
| "xs"
|
|
21
|
+
| "sm"
|
|
22
|
+
| "lg"
|
|
23
|
+
| "icon"
|
|
24
|
+
| "icon-xs"
|
|
25
|
+
| "icon-sm"
|
|
26
|
+
| "icon-lg";
|
|
27
|
+
tooltipProps?: Record<string, unknown>;
|
|
28
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const CopyToClipboardButton: React.FC<CopyToClipboardButtonProps>;
|
|
32
|
+
|
|
33
|
+
export default CopyToClipboardButton;
|