@obolnetwork/obol-ui 1.0.24 → 1.0.25
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/index.es.js +9 -8
- package/dist/index.js +8 -7
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createStitches } from '@stitches/react';
|
|
|
2
2
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
5
|
-
import React, { forwardRef, useState, useRef, useEffect, useLayoutEffect } from 'react';
|
|
5
|
+
import React, { forwardRef, useState, useRef, useImperativeHandle, useEffect, useLayoutEffect } from 'react';
|
|
6
6
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
7
7
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
8
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
@@ -1386,10 +1386,11 @@ var Content$2 = styled(TooltipContent, {
|
|
|
1386
1386
|
fill: "$bg05",
|
|
1387
1387
|
},
|
|
1388
1388
|
});
|
|
1389
|
-
var TextFieldWithCopy = forwardRef(function (props) {
|
|
1390
|
-
var _a = useState(), inputValue = _a[0], setInputValue = _a[1];
|
|
1389
|
+
var TextFieldWithCopy = forwardRef(function (props, ref) {
|
|
1390
|
+
var _a = useState(""), inputValue = _a[0], setInputValue = _a[1];
|
|
1391
1391
|
var _b = useState(false), isCopied = _b[0], setIsCopied = _b[1];
|
|
1392
|
-
var
|
|
1392
|
+
var innerRef = useRef(null);
|
|
1393
|
+
useImperativeHandle(ref, function () { return innerRef.current; });
|
|
1393
1394
|
var copyToClipBoard = function (content) {
|
|
1394
1395
|
if (content) {
|
|
1395
1396
|
navigator.clipboard.writeText(content);
|
|
@@ -1399,8 +1400,8 @@ var TextFieldWithCopy = forwardRef(function (props) {
|
|
|
1399
1400
|
useTimeout(function () {
|
|
1400
1401
|
setIsCopied(false);
|
|
1401
1402
|
}, isCopied ? 3000 : null);
|
|
1402
|
-
return (jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsx(TextField, __assign({ withCopy: true, ref:
|
|
1403
|
-
return copyToClipBoard(
|
|
1403
|
+
return (jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsx(TextField, __assign({ withCopy: true, ref: innerRef, value: inputValue, onChange: function (e) { return setInputValue(e.target.value); } }, props, { css: { width: "$full" } })), jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsx(IconButton, __assign({ onClick: function () {
|
|
1404
|
+
return copyToClipBoard(inputValue);
|
|
1404
1405
|
} }, { children: !isCopied ? jsx(CopyIcon, {}) : jsx(CheckIcon, {}) })) })), jsxs(Content$2, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsx(TooltipArrow, {})] }))] }))] })));
|
|
1405
1406
|
});
|
|
1406
1407
|
TextFieldWithCopy.displayName = "TextFieldWithCopy";
|
|
@@ -2066,11 +2067,11 @@ var Advisory = function (_a) {
|
|
|
2066
2067
|
var handleOnAccept = function (value) {
|
|
2067
2068
|
onUpdateState(value);
|
|
2068
2069
|
};
|
|
2069
|
-
return (jsxs(Box, __assign({ css: {
|
|
2070
|
+
return (jsxs(Box, __assign({ className: "advisory-container", css: {
|
|
2070
2071
|
display: "flex",
|
|
2071
2072
|
border: "2px solid $bg04",
|
|
2072
2073
|
borderRadius: "$3",
|
|
2073
|
-
|
|
2074
|
+
minHeight: "752px",
|
|
2074
2075
|
} }, { children: [jsx(Box, __assign({ css: {
|
|
2075
2076
|
display: "flex",
|
|
2076
2077
|
fd: "column",
|
package/dist/index.js
CHANGED
|
@@ -1418,10 +1418,11 @@ var Content$2 = styled(TooltipContent, {
|
|
|
1418
1418
|
fill: "$bg05",
|
|
1419
1419
|
},
|
|
1420
1420
|
});
|
|
1421
|
-
var TextFieldWithCopy = React.forwardRef(function (props) {
|
|
1422
|
-
var _a = React.useState(), inputValue = _a[0], setInputValue = _a[1];
|
|
1421
|
+
var TextFieldWithCopy = React.forwardRef(function (props, ref) {
|
|
1422
|
+
var _a = React.useState(""), inputValue = _a[0], setInputValue = _a[1];
|
|
1423
1423
|
var _b = React.useState(false), isCopied = _b[0], setIsCopied = _b[1];
|
|
1424
|
-
var
|
|
1424
|
+
var innerRef = React.useRef(null);
|
|
1425
|
+
React.useImperativeHandle(ref, function () { return innerRef.current; });
|
|
1425
1426
|
var copyToClipBoard = function (content) {
|
|
1426
1427
|
if (content) {
|
|
1427
1428
|
navigator.clipboard.writeText(content);
|
|
@@ -1431,8 +1432,8 @@ var TextFieldWithCopy = React.forwardRef(function (props) {
|
|
|
1431
1432
|
useTimeout(function () {
|
|
1432
1433
|
setIsCopied(false);
|
|
1433
1434
|
}, isCopied ? 3000 : null);
|
|
1434
|
-
return (jsxRuntime.jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsxRuntime.jsx(TextField, __assign({ withCopy: true, ref:
|
|
1435
|
-
return copyToClipBoard(
|
|
1435
|
+
return (jsxRuntime.jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsxRuntime.jsx(TextField, __assign({ withCopy: true, ref: innerRef, value: inputValue, onChange: function (e) { return setInputValue(e.target.value); } }, props, { css: { width: "$full" } })), jsxRuntime.jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsxRuntime.jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsxRuntime.jsx(IconButton, __assign({ onClick: function () {
|
|
1436
|
+
return copyToClipBoard(inputValue);
|
|
1436
1437
|
} }, { children: !isCopied ? jsxRuntime.jsx(CopyIcon, {}) : jsxRuntime.jsx(CheckIcon, {}) })) })), jsxRuntime.jsxs(Content$2, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsxRuntime.jsx(TooltipArrow, {})] }))] }))] })));
|
|
1437
1438
|
});
|
|
1438
1439
|
TextFieldWithCopy.displayName = "TextFieldWithCopy";
|
|
@@ -2098,11 +2099,11 @@ var Advisory = function (_a) {
|
|
|
2098
2099
|
var handleOnAccept = function (value) {
|
|
2099
2100
|
onUpdateState(value);
|
|
2100
2101
|
};
|
|
2101
|
-
return (jsxRuntime.jsxs(Box, __assign({ css: {
|
|
2102
|
+
return (jsxRuntime.jsxs(Box, __assign({ className: "advisory-container", css: {
|
|
2102
2103
|
display: "flex",
|
|
2103
2104
|
border: "2px solid $bg04",
|
|
2104
2105
|
borderRadius: "$3",
|
|
2105
|
-
|
|
2106
|
+
minHeight: "752px",
|
|
2106
2107
|
} }, { children: [jsxRuntime.jsx(Box, __assign({ css: {
|
|
2107
2108
|
display: "flex",
|
|
2108
2109
|
fd: "column",
|