@getpara/react-common 2.0.0-alpha.57 → 2.0.0-alpha.59
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,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-GOCCUU3Z.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { CpslIcon } from "@getpara/react-components";
|
|
6
|
+
import { safeStyled } from "../utils/index.js";
|
|
7
|
+
const BannerContainer = safeStyled.div`
|
|
8
|
+
background: #fffcec;
|
|
9
|
+
border: 2px solid var(--cpsl-color-utility-yellow);
|
|
10
|
+
border-radius: 4px;
|
|
11
|
+
padding: 8px 8px;
|
|
12
|
+
`;
|
|
13
|
+
const Content = safeStyled.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
position: relative;
|
|
18
|
+
`;
|
|
19
|
+
const Text = safeStyled.div`
|
|
20
|
+
flex: 1;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
line-height: 1.4;
|
|
23
|
+
color: var(--cpsl-color-black);
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
`;
|
|
26
|
+
const CloseButton = safeStyled.button`
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
border: none;
|
|
29
|
+
padding: 0;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
width: 20px;
|
|
36
|
+
height: 20px;
|
|
37
|
+
margin-top: 1px;
|
|
38
|
+
`;
|
|
39
|
+
const CloseIcon = safeStyled(CpslIcon)`
|
|
40
|
+
--icon-color: var(--cpsl-color-utility-yellow);
|
|
41
|
+
--height: 20px;
|
|
42
|
+
--width: 20px;
|
|
43
|
+
`;
|
|
44
|
+
const WarningBanner = ({ children, onClose }) => {
|
|
45
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
46
|
+
const handleClose = () => {
|
|
47
|
+
setIsVisible(false);
|
|
48
|
+
onClose == null ? void 0 : onClose();
|
|
49
|
+
};
|
|
50
|
+
if (!isVisible) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return /* @__PURE__ */ jsx(BannerContainer, { children: /* @__PURE__ */ jsxs(Content, { children: [
|
|
54
|
+
/* @__PURE__ */ jsx(CloseButton, { onClick: handleClose, "aria-label": "Close warning", children: /* @__PURE__ */ jsx(CloseIcon, { icon: "x" }) }),
|
|
55
|
+
/* @__PURE__ */ jsx(Text, { children })
|
|
56
|
+
] }) });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
WarningBanner
|
|
60
|
+
};
|
package/dist/components/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-common",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.59",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/react-components": "2.0.0-alpha.
|
|
6
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
5
|
+
"@getpara/react-components": "2.0.0-alpha.59",
|
|
6
|
+
"@getpara/web-sdk": "2.0.0-alpha.59",
|
|
7
7
|
"@moonpay/moonpay-react": "^1.8.3",
|
|
8
8
|
"@ramp-network/ramp-instant-sdk": "^4.0.5",
|
|
9
9
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
],
|
|
41
41
|
"type": "module",
|
|
42
42
|
"types": "dist/index.d.ts",
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "e15908ac8eafff6f3b264fffa43742870b14b275"
|
|
44
44
|
}
|