@graphprotocol/go 10.5.2

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.
Files changed (65) hide show
  1. package/dist/AnnouncementBanner/AnnouncementBanner.d.ts +19 -0
  2. package/dist/AnnouncementBanner/AnnouncementBanner.d.ts.map +1 -0
  3. package/dist/AnnouncementBanner/AnnouncementBanner.js +116 -0
  4. package/dist/AnnouncementBanner/index.d.ts +2 -0
  5. package/dist/AnnouncementBanner/index.d.ts.map +1 -0
  6. package/dist/CookieBanner/CookieBanner.d.ts +17 -0
  7. package/dist/CookieBanner/CookieBanner.d.ts.map +1 -0
  8. package/dist/CookieBanner/CookieBanner.js +195 -0
  9. package/dist/CookieBanner/index.d.ts +2 -0
  10. package/dist/CookieBanner/index.d.ts.map +1 -0
  11. package/dist/FeaturedSubgraphs/FeaturedSubgraphsGrid.d.ts +4 -0
  12. package/dist/FeaturedSubgraphs/FeaturedSubgraphsGrid.d.ts.map +1 -0
  13. package/dist/FeaturedSubgraphs/FeaturedSubgraphsGrid.js +42 -0
  14. package/dist/FeaturedSubgraphs/generated/gql.d.ts +42 -0
  15. package/dist/FeaturedSubgraphs/generated/gql.d.ts.map +1 -0
  16. package/dist/FeaturedSubgraphs/generated/gql.js +11 -0
  17. package/dist/FeaturedSubgraphs/generated/graphql.d.ts +10835 -0
  18. package/dist/FeaturedSubgraphs/generated/graphql.d.ts.map +1 -0
  19. package/dist/FeaturedSubgraphs/generated/graphql.js +403 -0
  20. package/dist/FeaturedSubgraphs/generated/index.d.ts +2 -0
  21. package/dist/FeaturedSubgraphs/generated/index.d.ts.map +1 -0
  22. package/dist/FeaturedSubgraphs/index.d.ts +3 -0
  23. package/dist/FeaturedSubgraphs/index.d.ts.map +1 -0
  24. package/dist/FeaturedSubgraphs/useFeaturedSubgrahsQuery.d.ts +28 -0
  25. package/dist/FeaturedSubgraphs/useFeaturedSubgrahsQuery.d.ts.map +1 -0
  26. package/dist/FeaturedSubgraphs/useFeaturedSubgrahsQuery.js +109 -0
  27. package/dist/GlobalFooter/GlobalFooter.d.ts +28 -0
  28. package/dist/GlobalFooter/GlobalFooter.d.ts.map +1 -0
  29. package/dist/GlobalFooter/GlobalFooter.js +300 -0
  30. package/dist/GlobalFooter/index.d.ts +2 -0
  31. package/dist/GlobalFooter/index.d.ts.map +1 -0
  32. package/dist/GlobalHeader/GlobalHeader.d.ts +4477 -0
  33. package/dist/GlobalHeader/GlobalHeader.d.ts.map +1 -0
  34. package/dist/GlobalHeader/GlobalHeader.js +1045 -0
  35. package/dist/GlobalHeader/index.d.ts +2 -0
  36. package/dist/GlobalHeader/index.d.ts.map +1 -0
  37. package/dist/MarketingNavbar/MarketingNavbar.d.ts +9 -0
  38. package/dist/MarketingNavbar/MarketingNavbar.d.ts.map +1 -0
  39. package/dist/MarketingNavbar/MarketingNavbar.js +566 -0
  40. package/dist/MarketingNavbar/index.d.ts +2 -0
  41. package/dist/MarketingNavbar/index.d.ts.map +1 -0
  42. package/dist/NPSForm/NPSForm.d.ts +20 -0
  43. package/dist/NPSForm/NPSForm.d.ts.map +1 -0
  44. package/dist/NPSForm/NPSForm.js +205 -0
  45. package/dist/NPSForm/index.d.ts +2 -0
  46. package/dist/NPSForm/index.d.ts.map +1 -0
  47. package/dist/NetworkIcon/NetworkIcon.d.ts +11 -0
  48. package/dist/NetworkIcon/NetworkIcon.d.ts.map +1 -0
  49. package/dist/NetworkIcon/NetworkIcon.js +443 -0
  50. package/dist/NetworkIcon/index.d.ts +2 -0
  51. package/dist/NetworkIcon/index.d.ts.map +1 -0
  52. package/dist/SupportModal/SupportModal.d.ts +6 -0
  53. package/dist/SupportModal/SupportModal.d.ts.map +1 -0
  54. package/dist/SupportModal/SupportModal.js +310 -0
  55. package/dist/SupportModal/index.d.ts +2 -0
  56. package/dist/SupportModal/index.d.ts.map +1 -0
  57. package/dist/SupportModal/submitToZendesk.d.ts +12 -0
  58. package/dist/SupportModal/submitToZendesk.d.ts.map +1 -0
  59. package/dist/SupportModal/submitToZendesk.js +26 -0
  60. package/dist/index.d.ts +10 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +23 -0
  63. package/dist/jsx/src/jsx-runtime.js +10 -0
  64. package/dist/jsx/src/parseProps.js +48 -0
  65. package/package.json +95 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/NetworkIcon/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { ExperimentalModalProps } from '@graphprotocol/gds';
2
+ export interface SupportModalProps extends Omit<ExperimentalModalProps, 'trigger' | 'steps' | 'currentStep' | 'onCurrentStepChange' | 'children'> {
3
+ defaultEmail?: string;
4
+ }
5
+ export declare function SupportModal({ open, onClose, defaultEmail, className, ...props }: SupportModalProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=SupportModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SupportModal.d.ts","sourceRoot":"","sources":["../../src/SupportModal/SupportModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,sBAAsB,EAU5B,MAAM,oBAAoB,CAAA;AA0D3B,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,qBAAqB,GAAG,UAAU,CAAC;IAC9G,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CA4RnG"}
@@ -0,0 +1,310 @@
1
+ "use client";
2
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
+ import { useI18n, useDebounce, ExperimentalModal, classNames, LoadingSpinner, SuccessIllustration, ExperimentalButton, ExperimentalSelect, ExperimentalTransition, ExperimentalInput, ExperimentalTextArea, ExperimentalRadio, ExperimentalCard, Icon } from "@graphprotocol/gds";
4
+ import { BookOpenText } from "@graphprotocol/gds/dist/icons/BookOpenText.js";
5
+ import { ChalkboardTeacher } from "@graphprotocol/gds/dist/icons/ChalkboardTeacher.js";
6
+ import { useState, useId } from "react";
7
+ import { submitToZendesk } from "./submitToZendesk.js";
8
+ const TOPICS = [
9
+ {
10
+ label: "Delegating"
11
+ },
12
+ {
13
+ label: "Docs"
14
+ },
15
+ {
16
+ label: "GRC-20"
17
+ },
18
+ {
19
+ label: "Indexing"
20
+ },
21
+ {
22
+ label: "Querying a Subgraph",
23
+ extraFields: ["deploymentId"]
24
+ },
25
+ {
26
+ label: "Subgraph Development",
27
+ extraFields: ["deploymentId"]
28
+ },
29
+ {
30
+ label: "Substreams"
31
+ },
32
+ {
33
+ label: "Other",
34
+ extraFields: ["otherTopic"]
35
+ }
36
+ ];
37
+ const CONTACT_METHODS = [
38
+ {
39
+ label: "Email",
40
+ contactValueLabel: "Your Email address",
41
+ contactValuePattern: "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$"
42
+ },
43
+ {
44
+ label: "Discord",
45
+ contactValueLabel: "Your Discord username",
46
+ contactValuePattern: "^[\\w.#]+$"
47
+ // See https://support.discord.com/hc/en-us/articles/12620128861463-New-Usernames-Display-Names
48
+ },
49
+ {
50
+ label: "Telegram",
51
+ contactValueLabel: "Your Telegram username",
52
+ contactValuePattern: "^@[^\\s]{5,32}$"
53
+ }
54
+ ];
55
+ const STEPS = ["support-options", "contact-support", "message-sent"];
56
+ function SupportModal({ open, onClose, defaultEmail, className, ...props }) {
57
+ const { locale } = useI18n();
58
+ const [currentStep, setCurrentStep] = useState("support-options");
59
+ const formId = useId();
60
+ const [formStatus, setFormStatus] = useState("idle");
61
+ const [topic, setTopic] = useState(null);
62
+ const extraFields = (topic == null ? void 0 : topic.extraFields) || [];
63
+ const showOtherTopic = extraFields.includes("otherTopic");
64
+ const showOtherTopicUI = useDebounce(showOtherTopic, 100);
65
+ const [otherTopic, setOtherTopic] = useState("");
66
+ const showDeploymentId = extraFields.includes("deploymentId");
67
+ const showDeploymentIdUI = useDebounce(showDeploymentId, 100);
68
+ const [deploymentId, setDeploymentId] = useState("");
69
+ const [description, setDescription] = useState("");
70
+ const [contactMethod, privateSetContactMethod] = useState(null);
71
+ const [contactValue, setContactValue] = useState("");
72
+ const [initialized, setInitialized] = useState(false);
73
+ const setContactMethod = (method) => {
74
+ privateSetContactMethod(method);
75
+ if (defaultEmail) {
76
+ if ((method == null ? void 0 : method.label) === "Email") {
77
+ setContactValue(defaultEmail);
78
+ } else if (contactValue === defaultEmail) {
79
+ setContactValue("");
80
+ }
81
+ }
82
+ };
83
+ const validateForm = () => {
84
+ return Boolean(topic) && (!showOtherTopic || Boolean(otherTopic)) && Boolean(description) && Boolean(contactMethod) && Boolean(contactValue);
85
+ };
86
+ const submitForm = async () => {
87
+ if (!validateForm()) return;
88
+ setFormStatus("submitting");
89
+ setCurrentStep("message-sent");
90
+ const success = await submitToZendesk({
91
+ contact: {
92
+ method: contactMethod.label,
93
+ value: contactValue
94
+ },
95
+ subject: showOtherTopic ? otherTopic : topic.label,
96
+ body: description,
97
+ deploymentId: showDeploymentId ? deploymentId : void 0
98
+ });
99
+ if (success) {
100
+ setFormStatus("success");
101
+ } else {
102
+ setFormStatus("idle");
103
+ setCurrentStep("contact-support");
104
+ }
105
+ };
106
+ const reset = () => {
107
+ setCurrentStep("support-options");
108
+ setFormStatus("idle");
109
+ setTopic(null);
110
+ setOtherTopic("");
111
+ setDeploymentId("");
112
+ setDescription("");
113
+ setContactMethod(null);
114
+ setContactValue("");
115
+ };
116
+ const close = () => {
117
+ onClose == null ? void 0 : onClose(false);
118
+ };
119
+ if (open === true && !initialized) {
120
+ reset();
121
+ setInitialized(true);
122
+ }
123
+ if (open === false && initialized) {
124
+ setInitialized(false);
125
+ }
126
+ return /* @__PURE__ */ jsx(
127
+ ExperimentalModal,
128
+ {
129
+ size: "large",
130
+ open,
131
+ onClose: close,
132
+ steps: currentStep === "support-options" ? [currentStep] : STEPS,
133
+ currentStep,
134
+ onCurrentStepChange: setCurrentStep,
135
+ "data-success": formStatus === "success" ? true : void 0,
136
+ className: classNames(["group/support-modal", className]),
137
+ ...props,
138
+ children: () => {
139
+ switch (currentStep) {
140
+ case "support-options":
141
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
142
+ /* @__PURE__ */ jsx(ExperimentalModal.Header, { title: "Support" }),
143
+ /* @__PURE__ */ jsxs(ExperimentalModal.Body, { children: [
144
+ /* @__PURE__ */ jsx("p", { className: "mb-6", children: "Get support from The Graph community, learn from The Graph documentation, or reach out to a support teammate for assistance." }),
145
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 text-center text-white sm:grid-cols-2", children: [
146
+ /* @__PURE__ */ jsx(
147
+ ExperimentalCard,
148
+ {
149
+ variant: "primary",
150
+ href: "https://discord.gg/graphprotocol",
151
+ target: "_blank",
152
+ className: "col-span-full",
153
+ children: /* @__PURE__ */ jsxs("span", { className: "flex h-full flex-col items-center justify-center", children: [
154
+ /* @__PURE__ */ jsx(Icon.LogoDiscord, { title: "Discord", size: "32px", className: "mb-2" }),
155
+ /* @__PURE__ */ jsx("span", { className: "text-p16", children: "Ask The Graph community" }),
156
+ /* @__PURE__ */ jsx("span", { className: "text-p14 text-white/48", children: "Live chat with experts on Discord." })
157
+ ] })
158
+ }
159
+ ),
160
+ /* @__PURE__ */ jsx(ExperimentalCard, { href: `https://thegraph.com/docs/${locale}/`, target: "_blank", children: /* @__PURE__ */ jsxs("span", { className: "flex h-full flex-col items-center justify-center", children: [
161
+ /* @__PURE__ */ jsx(BookOpenText, { alt: "", variant: "fill", size: 8, className: "mb-2" }),
162
+ /* @__PURE__ */ jsx("span", { className: "text-p16", children: "Explore docs" }),
163
+ /* @__PURE__ */ jsx("span", { className: "text-p14 text-white/48", children: "Learn more about The Graph’s products." })
164
+ ] }) }),
165
+ /* @__PURE__ */ jsx(ExperimentalCard, { onClick: () => setCurrentStep("contact-support"), children: /* @__PURE__ */ jsxs("span", { className: "flex h-full flex-col items-center justify-center", children: [
166
+ /* @__PURE__ */ jsx(ChalkboardTeacher, { alt: "", variant: "fill", size: 8, className: "mb-2" }),
167
+ /* @__PURE__ */ jsx("span", { className: "text-p16", children: "Contact support" }),
168
+ /* @__PURE__ */ jsx("span", { className: "text-p14 text-white/48", children: "Get support, provide feedback, or report an issue." })
169
+ ] }) })
170
+ ] })
171
+ ] }),
172
+ /* @__PURE__ */ jsx(ExperimentalModal.Footer, {})
173
+ ] });
174
+ case "contact-support":
175
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
176
+ /* @__PURE__ */ jsx(ExperimentalModal.Header, { title: "Contact Support" }),
177
+ /* @__PURE__ */ jsxs(ExperimentalModal.Body, { children: [
178
+ /* @__PURE__ */ jsx("p", { className: "mb-6", children: "Please describe the issue you are experiencing in detail to aid the support team in troubleshooting." }),
179
+ /* @__PURE__ */ jsxs(
180
+ "form",
181
+ {
182
+ id: formId,
183
+ onSubmit: (event) => {
184
+ event.preventDefault();
185
+ void submitForm();
186
+ },
187
+ className: "flex flex-col gap-6",
188
+ children: [
189
+ /* @__PURE__ */ jsxs("div", { children: [
190
+ /* @__PURE__ */ jsx(
191
+ ExperimentalSelect,
192
+ {
193
+ label: "Topic",
194
+ placeholder: "Select a topic",
195
+ value: topic,
196
+ valueIdKey: "label",
197
+ onChange: setTopic,
198
+ children: TOPICS.map((topic2) => /* @__PURE__ */ jsx(ExperimentalSelect.Option, { value: topic2, children: topic2.label }, topic2.label))
199
+ }
200
+ ),
201
+ /* @__PURE__ */ jsx(ExperimentalTransition, { mode: "exit-enter", children: showOtherTopicUI ? /* @__PURE__ */ jsx("div", { className: "pt-3", children: /* @__PURE__ */ jsx(
202
+ ExperimentalInput,
203
+ {
204
+ "aria-label": "Enter a topic",
205
+ placeholder: "Enter a topic",
206
+ value: otherTopic,
207
+ onChange: setOtherTopic
208
+ }
209
+ ) }, "otherTopic") : showDeploymentIdUI ? /* @__PURE__ */ jsx("div", { className: "pt-3", children: /* @__PURE__ */ jsx(
210
+ ExperimentalInput,
211
+ {
212
+ "aria-label": "Deployment ID (starts with Qm...)",
213
+ placeholder: "Deployment ID (starts with Qm...)",
214
+ value: deploymentId,
215
+ onChange: setDeploymentId
216
+ }
217
+ ) }, "deploymentId") : null })
218
+ ] }),
219
+ /* @__PURE__ */ jsx(
220
+ ExperimentalTextArea,
221
+ {
222
+ label: "Details",
223
+ placeholder: "Provide a detailed description of the steps required to replicate the issue",
224
+ value: description,
225
+ onChange: setDescription
226
+ }
227
+ ),
228
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("fieldset", { children: [
229
+ /* @__PURE__ */ jsx("legend", { className: "text-c12", children: "Contact" }),
230
+ /* @__PURE__ */ jsx("p", { className: "text-p16 mt-1 text-white/64", children: "How do you want to be contacted?" }),
231
+ /* @__PURE__ */ jsx(ExperimentalRadio.Group, { className: "mt-4 flex flex-col gap-2", children: CONTACT_METHODS.map((method) => /* @__PURE__ */ jsx(
232
+ ExperimentalRadio,
233
+ {
234
+ checked: (contactMethod == null ? void 0 : contactMethod.label) === method.label,
235
+ onChange: () => setContactMethod(method),
236
+ children: method.label
237
+ },
238
+ method.label
239
+ )) }),
240
+ /* @__PURE__ */ jsx(ExperimentalTransition, { mode: "exit-enter", children: contactMethod ? /* @__PURE__ */ jsx("div", { className: "pt-4", children: /* @__PURE__ */ jsx(
241
+ ExperimentalInput,
242
+ {
243
+ type: contactMethod.label === "Email" ? "email" : "text",
244
+ "aria-label": contactMethod.contactValueLabel,
245
+ placeholder: contactMethod.contactValueLabel,
246
+ value: contactValue,
247
+ onChange: setContactValue
248
+ }
249
+ ) }) : null })
250
+ ] }) })
251
+ ]
252
+ }
253
+ )
254
+ ] }),
255
+ /* @__PURE__ */ jsx(
256
+ ExperimentalModal.Footer,
257
+ {
258
+ primaryButton: /* @__PURE__ */ jsx(ExperimentalButton, { type: "submit", form: formId, variant: "primary", disabled: !validateForm(), children: "Submit" }),
259
+ secondaryButton: /* @__PURE__ */ jsx(ExperimentalButton, { onClick: reset, children: "Cancel" })
260
+ }
261
+ )
262
+ ] });
263
+ case "message-sent":
264
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
265
+ /* @__PURE__ */ jsx(ExperimentalModal.Header, { title: "Message Sent", buttonBefore: null }),
266
+ /* @__PURE__ */ jsxs(ExperimentalModal.Body, { children: [
267
+ /* @__PURE__ */ jsx(
268
+ "div",
269
+ {
270
+ className: `
271
+ animate-opacity-from-0 absolute inset-0 flex items-center justify-center transition-opacity duration-500 pointer-events-none
272
+ group-data-[success]/support-modal:!opacity-0
273
+ `,
274
+ children: /* @__PURE__ */ jsx(LoadingSpinner, {})
275
+ }
276
+ ),
277
+ /* @__PURE__ */ jsxs(
278
+ "div",
279
+ {
280
+ className: `
281
+ invisible flex flex-col items-center py-8 text-center opacity-0 transition-opacity duration-500
282
+ group-data-[success]/support-modal:visible
283
+ group-data-[success]/support-modal:opacity-100
284
+ `,
285
+ children: [
286
+ /* @__PURE__ */ jsx(SuccessIllustration, { color: "Green", className: "mb-8 sm:mb-10" }),
287
+ /* @__PURE__ */ jsxs("p", { children: [
288
+ "Thank you for your submission.",
289
+ /* @__PURE__ */ jsx("br", {}),
290
+ "A support teammate will be in touch as soon as possible."
291
+ ] })
292
+ ]
293
+ }
294
+ )
295
+ ] }),
296
+ /* @__PURE__ */ jsx(
297
+ ExperimentalModal.Footer,
298
+ {
299
+ secondaryButton: /* @__PURE__ */ jsx(ExperimentalButton, { onClick: close, children: "Close" })
300
+ }
301
+ )
302
+ ] });
303
+ }
304
+ }
305
+ }
306
+ );
307
+ }
308
+ export {
309
+ SupportModal
310
+ };
@@ -0,0 +1,2 @@
1
+ export * from './SupportModal';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SupportModal/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,12 @@
1
+ type ZendeskRequest = {
2
+ contact: {
3
+ method: 'Email' | 'Discord' | 'Telegram';
4
+ value: string;
5
+ };
6
+ subject: string;
7
+ body: string;
8
+ deploymentId?: string;
9
+ };
10
+ export declare function submitToZendesk(request: ZendeskRequest): Promise<boolean>;
11
+ export {};
12
+ //# sourceMappingURL=submitToZendesk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitToZendesk.d.ts","sourceRoot":"","sources":["../../src/SupportModal/submitToZendesk.tsx"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE;QACP,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAA;QACxC,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,cAAc,oBA2B5D"}
@@ -0,0 +1,26 @@
1
+ async function submitToZendesk(request) {
2
+ try {
3
+ const response = await fetch(
4
+ process.env.ENVIRONMENT === "staging" ? "https://api.staging.thegraph.com/submit-to-zendesk" : "https://api.thegraph.com/submit-to-zendesk",
5
+ {
6
+ method: "POST",
7
+ headers: {
8
+ "Content-Type": "application/json",
9
+ Accept: "application/json"
10
+ },
11
+ body: JSON.stringify(request)
12
+ }
13
+ );
14
+ const responseJson = await response.json();
15
+ if (!responseJson.success) {
16
+ throw responseJson;
17
+ }
18
+ return true;
19
+ } catch (error) {
20
+ console.error(error);
21
+ return false;
22
+ }
23
+ }
24
+ export {
25
+ submitToZendesk
26
+ };
@@ -0,0 +1,10 @@
1
+ export * from './AnnouncementBanner';
2
+ export * from './CookieBanner';
3
+ export * from './FeaturedSubgraphs';
4
+ export * from './GlobalFooter';
5
+ export * from './GlobalHeader';
6
+ export * from './MarketingNavbar';
7
+ export * from './NetworkIcon';
8
+ export * from './NPSForm';
9
+ export * from './SupportModal';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ import { AnnouncementBanner } from "./AnnouncementBanner/AnnouncementBanner.js";
2
+ import { CookieBanner } from "./CookieBanner/CookieBanner.js";
3
+ import { FeaturedSubgraphsGrid } from "./FeaturedSubgraphs/FeaturedSubgraphsGrid.js";
4
+ import { featuredSubgraphsQueryOptions, useFeaturedSubgraphsQuery } from "./FeaturedSubgraphs/useFeaturedSubgrahsQuery.js";
5
+ import { GlobalFooter } from "./GlobalFooter/GlobalFooter.js";
6
+ import { GlobalHeader } from "./GlobalHeader/GlobalHeader.js";
7
+ import { MarketingNavbar } from "./MarketingNavbar/MarketingNavbar.js";
8
+ import { NetworkIcon } from "./NetworkIcon/NetworkIcon.js";
9
+ import { NPSForm } from "./NPSForm/NPSForm.js";
10
+ import { SupportModal } from "./SupportModal/SupportModal.js";
11
+ export {
12
+ AnnouncementBanner,
13
+ CookieBanner,
14
+ FeaturedSubgraphsGrid,
15
+ GlobalFooter,
16
+ GlobalHeader,
17
+ MarketingNavbar,
18
+ NPSForm,
19
+ NetworkIcon,
20
+ SupportModal,
21
+ featuredSubgraphsQueryOptions,
22
+ useFeaturedSubgraphsQuery
23
+ };
@@ -0,0 +1,10 @@
1
+ import { jsx as jsx$1, jsxs as jsxs$1 } from "@emotion/react/jsx-runtime";
2
+ import { parseProps } from "./parseProps.js";
3
+ import { Fragment } from "react";
4
+ const jsx = (type, props, key) => jsx$1(type, parseProps(props), key);
5
+ const jsxs = (type, props, key) => jsxs$1(type, parseProps(props), key);
6
+ export {
7
+ Fragment,
8
+ jsx,
9
+ jsxs
10
+ };
@@ -0,0 +1,48 @@
1
+ import { css } from "@theme-ui/css";
2
+ function parseProps(props, source) {
3
+ if (!props || !props.sx && !props.css) return props;
4
+ const next = {};
5
+ for (const key in props) {
6
+ if (key === "sx") continue;
7
+ next[key] = props[key];
8
+ }
9
+ next.css = (theme) => {
10
+ var _a, _b, _c;
11
+ if (!theme || typeof theme !== "object" || !("breakpoints" in theme) || (((_a = theme.breakpoints) == null ? void 0 : _a.length) ?? 0) === 0 || !("colors" in theme) || !("rawColors" in theme)) {
12
+ let error = "@graphprotocol/jsx: no theme found, make sure `GDSProvider` has `useThemeUI` when rendering components that require Theme UI";
13
+ throw new Error(error);
14
+ }
15
+ if (!((_b = theme.colors) == null ? void 0 : _b.White)) {
16
+ throw new Error(
17
+ "@graphprotocol/jsx: the provided theme seems empty, make sure there’s only one version of `@emotion/react` and Theme UI installed (check the lockfile)"
18
+ );
19
+ }
20
+ let sx = props.sx;
21
+ if (((_c = theme.breakpoints) == null ? void 0 : _c.length) === 2 && sx && typeof sx === "object" && hasArrayOrFunctionValues(sx)) {
22
+ sx = Object.fromEntries(
23
+ Object.entries(sx).map(([property, value]) => {
24
+ const values = typeof value === "function" ? value(theme) : value;
25
+ if (!Array.isArray(values) || values.length <= 2) {
26
+ return [property, values];
27
+ }
28
+ return [property, values.filter((_value, index) => index !== 1)];
29
+ })
30
+ );
31
+ }
32
+ const styles = css(sx)(theme);
33
+ const raw = typeof props.css === "function" ? props.css(theme) : props.css;
34
+ return [styles, raw];
35
+ };
36
+ return next;
37
+ }
38
+ function hasArrayOrFunctionValues(obj) {
39
+ for (const key in obj) {
40
+ if (Array.isArray(obj[key]) || typeof obj[key] === "function") {
41
+ return true;
42
+ }
43
+ }
44
+ return false;
45
+ }
46
+ export {
47
+ parseProps
48
+ };
package/package.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "@graphprotocol/go",
3
+ "private": false,
4
+ "version": "10.5.2",
5
+ "description": "Graph Organisms (GO)",
6
+ "author": "Edge & Node",
7
+ "license": "UNLICENSED",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/graphprotocol/components.git",
11
+ "directory": "packages/go"
12
+ },
13
+ "type": "module",
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "./dist/*": {
22
+ "types": "./dist/*.d.ts",
23
+ "default": "./dist/*"
24
+ }
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "sideEffects": false,
30
+ "dependencies": {
31
+ "@graphql-typed-document-node/core": "^3.2.0",
32
+ "@theme-ui/css": "^0.17.2",
33
+ "@radix-ui/react-collapsible": "^1.1.3",
34
+ "@radix-ui/react-dialog": "^1.1.6",
35
+ "@radix-ui/react-navigation-menu": "^1.2.5",
36
+ "@radix-ui/react-portal": "^1.1.4",
37
+ "@react-aria/utils": "^3.28.1",
38
+ "@web3icons/react": "^4.1.6",
39
+ "escape-string-regexp": "^5.0.0",
40
+ "motion": "^12.6.3",
41
+ "tailwindcss": "^3.4.17"
42
+ },
43
+ "peerDependencies": {
44
+ "@emotion/react": "^11",
45
+ "@tanstack/react-query": "^5",
46
+ "graphql": ">=16.9",
47
+ "graphql-request": ">=7",
48
+ "next": ">=13",
49
+ "react": "^18",
50
+ "react-dom": "^18",
51
+ "theme-ui": ">=0.16",
52
+ "@graphprotocol/common": "^7.0.4",
53
+ "@graphprotocol/gds": "^6.9.1",
54
+ "@graphprotocol/ens": "^2.3.1"
55
+ },
56
+ "peerDependenciesMeta": {
57
+ "next": {
58
+ "optional": true
59
+ }
60
+ },
61
+ "devDependencies": {
62
+ "@graphql-codegen/cli": "^5.0.5",
63
+ "@graphql-codegen/client-preset": "^4.8.0",
64
+ "@graphql-codegen/plugin-helpers": "^5.1.0",
65
+ "@graphql-codegen/typescript": "^4.1.6",
66
+ "@graphql-codegen/typescript-operations": "^4.6.0",
67
+ "@pinax/graph-networks-registry": "^0.6.7",
68
+ "@tanstack/react-query": "^5.72.0",
69
+ "@types/react": "^18.3.20",
70
+ "@types/react-dom": "^18.3.6",
71
+ "graphql": "^16.10.0",
72
+ "graphql-request": "^7.1.2",
73
+ "next": "^14.2.27",
74
+ "react": "^18.3.1",
75
+ "react-dom": "^18.3.1",
76
+ "@graphprotocol/common": "^7.0.4",
77
+ "@graphprotocol/test-utils": "^2.1.0",
78
+ "@graphprotocol/jsx": "^1.1.0",
79
+ "@graphprotocol/gds": "^6.9.1"
80
+ },
81
+ "scripts": {
82
+ "gql-codegen": "graphql-codegen --require dotenv/config --config graphql.codegen.ts",
83
+ "build": "vite build",
84
+ "analyze:export-size": "pnpx export-size .",
85
+ "check": "pnpm typecheck && pnpm lint && pnpm prettier:check",
86
+ "check:fix": "pnpm lint:fix; pnpm prettier",
87
+ "lint": "eslint . --max-warnings 0",
88
+ "lint:fix": "eslint . --fix",
89
+ "prettier": "prettier . --write --list-different --ignore-path ../../.prettierignore",
90
+ "prettier:check": "prettier . --check --ignore-path ../../.prettierignore",
91
+ "typecheck": "tsc",
92
+ "test": "vitest run",
93
+ "test:coverage": "vitest run --coverage && jest-coverage-badges"
94
+ }
95
+ }