@crossmint/client-sdk-react-ui 0.0.4
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/LICENSE +201 -0
- package/README.md +30 -0
- package/lib/cjs/CrossMintButton.d.ts +14 -0
- package/lib/cjs/CrossMintButton.js +55 -0
- package/lib/cjs/CrossMintButton.js.map +1 -0
- package/lib/cjs/CrossMintModal.d.ts +6 -0
- package/lib/cjs/CrossMintModal.js +55 -0
- package/lib/cjs/CrossMintModal.js.map +1 -0
- package/lib/cjs/CrossMintModalProvider.d.ts +6 -0
- package/lib/cjs/CrossMintModalProvider.js +48 -0
- package/lib/cjs/CrossMintModalProvider.js.map +1 -0
- package/lib/cjs/CrossMintPopupProvider.d.ts +6 -0
- package/lib/cjs/CrossMintPopupProvider.js +69 -0
- package/lib/cjs/CrossMintPopupProvider.js.map +1 -0
- package/lib/cjs/CrossMintProvider.d.ts +7 -0
- package/lib/cjs/CrossMintProvider.js +50 -0
- package/lib/cjs/CrossMintProvider.js.map +1 -0
- package/lib/cjs/index.d.ts +5 -0
- package/lib/cjs/index.js +18 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/useCrossMintModal.d.ts +7 -0
- package/lib/cjs/useCrossMintModal.js +10 -0
- package/lib/cjs/useCrossMintModal.js.map +1 -0
- package/lib/cjs/useCrossMintPopup.d.ts +8 -0
- package/lib/cjs/useCrossMintPopup.js +10 -0
- package/lib/cjs/useCrossMintPopup.js.map +1 -0
- package/lib/esm/CrossMintButton.d.ts +14 -0
- package/lib/esm/CrossMintButton.js +20 -0
- package/lib/esm/CrossMintButton.js.map +1 -0
- package/lib/esm/CrossMintModal.d.ts +6 -0
- package/lib/esm/CrossMintModal.js +32 -0
- package/lib/esm/CrossMintModal.js.map +1 -0
- package/lib/esm/CrossMintModalProvider.d.ts +6 -0
- package/lib/esm/CrossMintModalProvider.js +13 -0
- package/lib/esm/CrossMintModalProvider.js.map +1 -0
- package/lib/esm/CrossMintPopupProvider.d.ts +6 -0
- package/lib/esm/CrossMintPopupProvider.js +46 -0
- package/lib/esm/CrossMintPopupProvider.js.map +1 -0
- package/lib/esm/CrossMintProvider.d.ts +7 -0
- package/lib/esm/CrossMintProvider.js +15 -0
- package/lib/esm/CrossMintProvider.js.map +1 -0
- package/lib/esm/index.d.ts +5 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/useCrossMintModal.d.ts +7 -0
- package/lib/esm/useCrossMintModal.js +6 -0
- package/lib/esm/useCrossMintModal.js.map +1 -0
- package/lib/esm/useCrossMintPopup.d.ts +8 -0
- package/lib/esm/useCrossMintPopup.js +6 -0
- package/lib/esm/useCrossMintPopup.js.map +1 -0
- package/package.json +44 -0
- package/src/CrossMintButton.tsx +64 -0
- package/src/CrossMintModal.tsx +54 -0
- package/src/CrossMintModalProvider.tsx +24 -0
- package/src/CrossMintPopupProvider.tsx +88 -0
- package/src/CrossMintProvider.tsx +28 -0
- package/src/index.ts +5 -0
- package/src/useCrossMintModal.tsx +12 -0
- package/src/useCrossMintPopup.tsx +19 -0
- package/styles.css +118 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
|
|
3
|
+
export interface PopupContextState {
|
|
4
|
+
connecting: boolean;
|
|
5
|
+
connect: (
|
|
6
|
+
candyMachineId: string,
|
|
7
|
+
collectionTitle?: string,
|
|
8
|
+
collectionDescription?: string,
|
|
9
|
+
collectionPhoto?: string
|
|
10
|
+
) => void;
|
|
11
|
+
|
|
12
|
+
popup: Window | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const PopupContext = createContext<PopupContextState>({} as PopupContextState);
|
|
16
|
+
|
|
17
|
+
export function useCrossMintPopup(): PopupContextState {
|
|
18
|
+
return useContext(PopupContext);
|
|
19
|
+
}
|
package/styles.css
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@import url("https://cdn.rawgit.com/mfd/09b70eb47474836f25a21660282ce0fd/raw/e06a670afcb2b861ed2ac4a1ef752d062ef6b46b/Gilroy.css");
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--crossmint-main-green: #00ff85;
|
|
5
|
+
--crossmint-main-blue: #00e0ff;
|
|
6
|
+
--crossmint-main-dark-bg: #1e1e1e;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* Mint Button */
|
|
10
|
+
|
|
11
|
+
.client-sdk-button-trigger {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
align-items: center;
|
|
15
|
+
padding: 0.875rem 0.875rem;
|
|
16
|
+
font-weight: 900;
|
|
17
|
+
transition: opacity ease-in-out 0.25s;
|
|
18
|
+
border-radius: 0.5rem;
|
|
19
|
+
font-family: "Gilroy", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
|
|
20
|
+
"Helvetica Neue", sans-serif;
|
|
21
|
+
outline: none;
|
|
22
|
+
border: none;
|
|
23
|
+
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.client-sdk-button-trigger p {
|
|
27
|
+
margin: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.client-sdk-button-trigger:hover:enabled {
|
|
31
|
+
opacity: 0.6;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.client-sdk-button-trigger-dark {
|
|
36
|
+
background: var(--crossmint-main-dark-bg);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.client-sdk-button-trigger-light {
|
|
40
|
+
background: white;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.client-sdk-button-trigger-light p {
|
|
44
|
+
color: black;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.client-sdk-button-trigger-dark p {
|
|
48
|
+
color: white;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.client-sdk-button-trigger-colored {
|
|
52
|
+
background-image: linear-gradient(to bottom right, var(--crossmint-main-green), var(--crossmint-main-blue));
|
|
53
|
+
color: white;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.client-sdk-button-icon {
|
|
57
|
+
width: 21px;
|
|
58
|
+
height: 21px;
|
|
59
|
+
margin-right: 0.875rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Modal */
|
|
63
|
+
.client-sdk-modal {
|
|
64
|
+
position: fixed;
|
|
65
|
+
top: 0;
|
|
66
|
+
left: 0;
|
|
67
|
+
right: 0;
|
|
68
|
+
bottom: 0;
|
|
69
|
+
opacity: 0;
|
|
70
|
+
transition: opacity linear 150ms;
|
|
71
|
+
background: rgba(0, 0, 0, 0.5);
|
|
72
|
+
z-index: 1040;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.client-sdk-modal.client-sdk-modal-fade-in {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.client-sdk-modal-overlay {
|
|
80
|
+
background: rgba(0, 0, 0, 0.5);
|
|
81
|
+
position: fixed;
|
|
82
|
+
top: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
bottom: 0;
|
|
85
|
+
right: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.client-sdk-modal-container {
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
right: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
display: flex;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
align-items: center;
|
|
99
|
+
z-index: 1041;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.client-sdk-modal-loader {
|
|
103
|
+
border: 3px solid transparent; /* Light grey */
|
|
104
|
+
border-top: 3px solid white; /* Blue */
|
|
105
|
+
border-radius: 50%;
|
|
106
|
+
width: 35px;
|
|
107
|
+
height: 35px;
|
|
108
|
+
animation: crossmintSpin 1s linear infinite;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@keyframes crossmintSpin {
|
|
112
|
+
0% {
|
|
113
|
+
transform: rotate(0deg);
|
|
114
|
+
}
|
|
115
|
+
100% {
|
|
116
|
+
transform: rotate(360deg);
|
|
117
|
+
}
|
|
118
|
+
}
|