@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,19 @@
1
+ import { ButtonOrLinkProps } from '@graphprotocol/gds';
2
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
3
+ export interface AnnouncementBannerProps extends ComponentPropsWithoutRef<'div'> {
4
+ announcement: {
5
+ title?: ReactNode;
6
+ description?: ReactNode;
7
+ linkText?: ReactNode;
8
+ href?: ButtonOrLinkProps['href'];
9
+ target?: ButtonOrLinkProps['target'];
10
+ onClick?: ButtonOrLinkProps['onClick'];
11
+ };
12
+ visible?: boolean;
13
+ onDismiss?: () => void;
14
+ expanded?: boolean;
15
+ onExpandedChange?: ((expanded: boolean) => void) | null;
16
+ transition?: boolean;
17
+ }
18
+ export declare function AnnouncementBanner({ announcement, visible, onDismiss, expanded, onExpandedChange, transition, className, children, ...props }: AnnouncementBannerProps): import("react/jsx-runtime").JSX.Element;
19
+ //# sourceMappingURL=AnnouncementBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnouncementBanner.d.ts","sourceRoot":"","sources":["../../src/AnnouncementBanner/AnnouncementBanner.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EAQvB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhE,MAAM,WAAW,uBAAwB,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IAC9E,YAAY,EAAE;QACZ,KAAK,CAAC,EAAE,SAAS,CAAA;QACjB,WAAW,CAAC,EAAE,SAAS,CAAA;QACvB,QAAQ,CAAC,EAAE,SAAS,CAAA;QACpB,IAAI,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAA;QAChC,MAAM,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;QACpC,OAAO,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;KACvC,CAAA;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,CAAA;IACvD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,YAAY,EACZ,OAAc,EACd,SAAS,EACT,QAAgB,EAChB,gBAAgB,EAChB,UAAkB,EAClB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,2CAsHzB"}
@@ -0,0 +1,116 @@
1
+ "use client";
2
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
+ import { Link, Icon, classNames, Transition, MaybeButtonOrLink, Container, ExperimentalButton } from "@graphprotocol/gds";
4
+ import { Info } from "@graphprotocol/gds/dist/icons/Info.js";
5
+ import { X } from "@graphprotocol/gds/dist/icons/X.js";
6
+ function AnnouncementBanner({
7
+ announcement,
8
+ visible = true,
9
+ onDismiss,
10
+ expanded = false,
11
+ onExpandedChange,
12
+ transition = false,
13
+ className,
14
+ children,
15
+ ...props
16
+ }) {
17
+ const dismissible = Boolean(onDismiss);
18
+ const expandableOrCollapsible = Boolean(onExpandedChange);
19
+ const expandOrCollapseLink = expandableOrCollapsible ? /* @__PURE__ */ jsxs(Link.Secondary, { children: [
20
+ expanded ? "Hide" : "Show",
21
+ " details",
22
+ /* @__PURE__ */ jsx(Icon.CaretDown, { className: expanded ? "rotate-180" : void 0 })
23
+ ] }) : null;
24
+ return /* @__PURE__ */ jsx("div", { className: classNames(["overflow-clip", className]), ...props, children: /* @__PURE__ */ jsx(Transition, { disabled: !transition, children: !visible ? null : /* @__PURE__ */ jsxs("div", { className: "grid", children: [
25
+ /* @__PURE__ */ jsxs("div", { className: "text-p14 z-10 col-span-full row-span-1 row-start-1 text-center text-white/88", children: [
26
+ !expanded || expandableOrCollapsible ? /* @__PURE__ */ jsxs(
27
+ MaybeButtonOrLink,
28
+ {
29
+ defaultAs: "div",
30
+ href: !expandableOrCollapsible ? announcement.href : void 0,
31
+ target: !expandableOrCollapsible ? announcement.target : void 0,
32
+ onClick: expandableOrCollapsible || announcement.onClick ? (event) => {
33
+ var _a;
34
+ if (expandableOrCollapsible) {
35
+ onExpandedChange(!expanded);
36
+ }
37
+ (_a = announcement.onClick) == null ? void 0 : _a.call(announcement, event);
38
+ } : void 0,
39
+ className: classNames([
40
+ expanded ? "hidden bg-white/0 clickable:hocus:bg-white/4 clickable:active:bg-white/2 lg:flex" : "flex bg-purple/48 clickable:hocus:bg-purple/64 clickable:active:bg-purple/48",
41
+ `min-h-10 w-full items-center justify-center px-6 py-2.5 transition outline-none active:transition-none lg:py-2`
42
+ ]),
43
+ children: [
44
+ /* @__PURE__ */ jsxs(
45
+ Container,
46
+ {
47
+ className: classNames([
48
+ expanded ? "hidden" : "flex flex-col flex-wrap items-center justify-center gap-x-4 gap-y-0.5 lg:flex-row lg:items-baseline"
49
+ ]),
50
+ children: [
51
+ announcement.title ? /* @__PURE__ */ jsxs("span", { className: "static flex min-h-5 items-center justify-center gap-x-4 gap-y-1 xs:relative xs:pl-8", children: [
52
+ /* @__PURE__ */ jsx(Info, { alt: "", size: 5, className: "absolute -left-3 top-0 xs:left-0" }),
53
+ /* @__PURE__ */ jsx("span", { className: "text-c12", children: announcement.title })
54
+ ] }) : null,
55
+ announcement.title && (announcement.description || announcement.linkText) ? /* @__PURE__ */ jsx("span", { className: "hidden size-px items-center justify-center self-center lg:flex", children: /* @__PURE__ */ jsx("span", { className: "h-6 w-px bg-white/16" }) }) : null,
56
+ announcement.description || announcement.linkText || expandOrCollapseLink ? /* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-baseline justify-center gap-x-4 gap-y-1", children: [
57
+ announcement.description ? /* @__PURE__ */ jsx("span", { children: announcement.description }) : null,
58
+ announcement.linkText && !expandOrCollapseLink ? /* @__PURE__ */ jsxs(Link, { children: [
59
+ announcement.linkText,
60
+ /* @__PURE__ */ jsx(Icon.ArrowRight, {})
61
+ ] }) : null,
62
+ expandOrCollapseLink ? /* @__PURE__ */ jsx("span", { className: "inline lg:hidden", children: expandOrCollapseLink }) : null
63
+ ] }) : null
64
+ ]
65
+ }
66
+ ),
67
+ expandableOrCollapsible ? /* @__PURE__ */ jsx(
68
+ "span",
69
+ {
70
+ className: classNames([
71
+ "absolute inset-y-0 hidden items-center lg:flex",
72
+ dismissible ? "right-11" : "right-3"
73
+ ]),
74
+ children: expandOrCollapseLink
75
+ }
76
+ ) : null
77
+ ]
78
+ }
79
+ ) : null,
80
+ dismissible ? /* @__PURE__ */ jsx(
81
+ ExperimentalButton,
82
+ {
83
+ variant: "tertiary",
84
+ size: "small",
85
+ onClick: onDismiss,
86
+ className: "absolute right-1 top-1",
87
+ children: /* @__PURE__ */ jsx(X, { alt: "Close banner" })
88
+ }
89
+ ) : null
90
+ ] }),
91
+ expanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
92
+ /* @__PURE__ */ jsx("div", { className: "isolate col-span-full row-span-3 row-start-1", children }),
93
+ " ",
94
+ expandableOrCollapsible ? /* @__PURE__ */ jsx(
95
+ MaybeButtonOrLink,
96
+ {
97
+ defaultAs: "div",
98
+ onClick: (event) => {
99
+ var _a;
100
+ onExpandedChange(!expanded);
101
+ (_a = announcement.onClick) == null ? void 0 : _a.call(announcement, event);
102
+ },
103
+ className: `
104
+ text-p14 z-10 col-span-full row-span-1 row-start-3
105
+ flex w-full items-center justify-center bg-white/0 py-2.5 text-center transition outline-none
106
+ hocus:bg-white/4 active:bg-white/2 active:transition-none lg:hidden
107
+ `,
108
+ children: expandOrCollapseLink
109
+ }
110
+ ) : null
111
+ ] }) : null
112
+ ] }, expanded ? "expanded" : "collapsed") }) });
113
+ }
114
+ export {
115
+ AnnouncementBanner
116
+ };
@@ -0,0 +1,2 @@
1
+ export * from './AnnouncementBanner';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AnnouncementBanner/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { AnalyticsContext } from '@graphprotocol/gds';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+ type HasConsent = AnalyticsContext['defaultValue']['hasConsent'];
4
+ export type CookieBannerProps = {
5
+ hasConsent?: HasConsent;
6
+ setConsent?: (consent: boolean) => void;
7
+ visible?: boolean;
8
+ setVisible?: (visible: boolean) => void;
9
+ allowUpdate?: boolean;
10
+ } & ComponentPropsWithoutRef<'div'>;
11
+ /**
12
+ * Cookie banner component, can be controlled (if `hasConsent`, `setConsent`, `visible` and `setVisible` are provided) or uncontrolled (if not).
13
+ * Should be placed at the top of the `Layout` component for optimal accessibility.
14
+ */
15
+ export declare const CookieBanner: ({ hasConsent: controlledConsent, setConsent: setControlledConsent, visible: controlledVisible, setVisible: setControlledVisible, allowUpdate, className, ...props }: CookieBannerProps) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=CookieBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CookieBanner.d.ts","sourceRoot":"","sources":["../../src/CookieBanner/CookieBanner.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAOjB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAAE,KAAK,wBAAwB,EAAmC,MAAM,OAAO,CAAA;AAEtF,KAAK,UAAU,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAA;AAEhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACvC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACvC,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,qKAQ1B,iBAAiB,4CAmKnB,CAAA"}
@@ -0,0 +1,195 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useI18n, AnalyticsContext, useOutsideAlerter, Link, ExperimentalButton, ExperimentalTransition, ExperimentalRadio } from "@graphprotocol/gds";
4
+ import * as Collapsible from "@radix-ui/react-collapsible";
5
+ import { AnimatePresence, motion } from "motion/react";
6
+ import { useContext, useState, useEffect } from "react";
7
+ const CookieBanner = ({
8
+ hasConsent: controlledConsent,
9
+ setConsent: setControlledConsent,
10
+ visible: controlledVisible,
11
+ setVisible: setControlledVisible,
12
+ allowUpdate = false,
13
+ className,
14
+ ...props
15
+ }) => {
16
+ const { t } = useI18n();
17
+ const { hasConsent: contextConsent, setConsent: setContextConsent } = useContext(AnalyticsContext);
18
+ const [uncontrolledConsent, setUncontrolledConsent] = useState(null);
19
+ const hasConsent = controlledConsent !== void 0 ? controlledConsent : contextConsent ?? uncontrolledConsent;
20
+ const showUpdate = hasConsent !== null && allowUpdate;
21
+ const [uncontrolledVisible, setUncontrolledVisible] = useState(showUpdate);
22
+ const visible = controlledVisible ?? uncontrolledVisible;
23
+ const [updateExpanded, setUpdateExpanded] = useState(false);
24
+ const [radioConsent, setRadioConsent] = useState(null);
25
+ const [hasInteractedWithRadios, setHasInteractedWithRadios] = useState(false);
26
+ const setConsent = (consent) => {
27
+ setControlledConsent == null ? void 0 : setControlledConsent(consent);
28
+ setUncontrolledConsent(consent);
29
+ setContextConsent(consent);
30
+ setRadioConsent(consent);
31
+ if (!showUpdate) {
32
+ setControlledVisible == null ? void 0 : setControlledVisible(false);
33
+ }
34
+ };
35
+ useEffect(() => {
36
+ setUncontrolledVisible(hasConsent === null || showUpdate);
37
+ }, [hasConsent, showUpdate]);
38
+ const outsideAlerter = useOutsideAlerter(() => {
39
+ setUpdateExpanded(false);
40
+ });
41
+ return /* @__PURE__ */ jsx("div", { ...outsideAlerter, className, ...props, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: visible ? /* @__PURE__ */ jsx(
42
+ motion.div,
43
+ {
44
+ transition: { duration: 0.3, ease: [0.4, 0, 0.4, 1] },
45
+ initial: {
46
+ opacity: "var(--transition-opacity-from)",
47
+ scale: "var(--transition-scale-from)",
48
+ translate: "var(--transition-translate-from)"
49
+ },
50
+ animate: {
51
+ opacity: "var(--transition-opacity-to)",
52
+ scale: "var(--transition-scale-to)",
53
+ translate: "var(--transition-translate-to)"
54
+ },
55
+ exit: {
56
+ opacity: "var(--transition-opacity-from)",
57
+ scale: "var(--transition-scale-from)",
58
+ translate: "var(--transition-translate-from)"
59
+ },
60
+ role: "dialog",
61
+ className: `
62
+ fixed inset-x-0 bottom-0 z-1000 rounded-8 border border-white/4 bg-overlay
63
+ [--transition-opacity-from:100%]
64
+ [--transition-opacity-to:100%]
65
+ [--transition-scale-from:1]
66
+ [--transition-scale-to:1]
67
+ [--transition-translate-from:0_100%]
68
+ [--transition-translate-to:0_0%]
69
+ max-xs:rounded-b-none
70
+ max-xs:border-b-transparent
71
+ xs:bottom-8
72
+ xs:end-auto
73
+ xs:start-8
74
+ xs:max-w-110
75
+ xs:[--transition-opacity-from:0%]
76
+ xs:[--transition-scale-from:0.95]
77
+ xs:[--transition-translate-from:0]
78
+ xs:[--transition-translate-to:0]
79
+ `,
80
+ style: {
81
+ boxShadow: "0px 0px 24px 0px #131126"
82
+ },
83
+ children: !showUpdate ? /* @__PURE__ */ jsxs("div", { className: "-m-px p-6", children: [
84
+ /* @__PURE__ */ jsx(CookieIcon, { size: "48px", className: "mb-3" }),
85
+ /* @__PURE__ */ jsx("h2", { className: "text-h20 mb-2", children: t("components.cookieBanner.header") }),
86
+ /* @__PURE__ */ jsx("p", { className: "text-p16", children: t("components.cookieBanner.description", [
87
+ /* @__PURE__ */ jsx(Link.Inline, { href: "https://thegraph.com/privacy/", children: t("components.cookieBanner.privacyPolicy") }, "link")
88
+ ]) }),
89
+ /* @__PURE__ */ jsxs("div", { className: "mt-6 flex gap-2", children: [
90
+ /* @__PURE__ */ jsx(ExperimentalButton, { onClick: () => setConsent(false), children: t("components.cookieBanner.essentialsOnly") }),
91
+ /* @__PURE__ */ jsx(ExperimentalButton, { variant: "primary", onClick: () => setConsent(true), className: "grow", children: t("components.cookieBanner.allowAll") })
92
+ ] })
93
+ ] }) : /* @__PURE__ */ jsxs(
94
+ Collapsible.Root,
95
+ {
96
+ open: updateExpanded,
97
+ onOpenChange: (open) => {
98
+ setUpdateExpanded(open);
99
+ if (open) {
100
+ setRadioConsent(hasConsent);
101
+ setHasInteractedWithRadios(false);
102
+ }
103
+ },
104
+ className: "-m-px overflow-clip rounded-[inherit]",
105
+ children: [
106
+ /* @__PURE__ */ jsx(Collapsible.Trigger, { className: "w-full rounded-[inherit] p-6 transition data-[state=closed]:hocus-visible:bg-white/4", children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-3", children: [
107
+ /* @__PURE__ */ jsx(CookieIcon, { size: "32px" }),
108
+ /* @__PURE__ */ jsx("h2", { className: "text-h18", children: t("components.cookieBanner.updateSettings") })
109
+ ] }) }),
110
+ /* @__PURE__ */ jsx(Collapsible.Content, { forceMount: true, children: /* @__PURE__ */ jsx(ExperimentalTransition, { children: updateExpanded ? /* @__PURE__ */ jsxs("div", { className: "p-6 pt-2", children: [
111
+ /* @__PURE__ */ jsxs(ExperimentalRadio.Group, { className: "flex flex-col gap-4", children: [
112
+ /* @__PURE__ */ jsx(
113
+ ExperimentalRadio,
114
+ {
115
+ checked: radioConsent === false,
116
+ onChange: () => {
117
+ setRadioConsent(false);
118
+ setHasInteractedWithRadios(true);
119
+ },
120
+ children: t("components.cookieBanner.essentialsOnly")
121
+ }
122
+ ),
123
+ /* @__PURE__ */ jsx(
124
+ ExperimentalRadio,
125
+ {
126
+ checked: radioConsent === true,
127
+ onChange: () => {
128
+ setRadioConsent(true);
129
+ setHasInteractedWithRadios(true);
130
+ },
131
+ children: t("components.cookieBanner.allowAll")
132
+ }
133
+ )
134
+ ] }),
135
+ /* @__PURE__ */ jsx(
136
+ ExperimentalButton,
137
+ {
138
+ variant: "primary",
139
+ disabled: !hasInteractedWithRadios,
140
+ onClick: () => {
141
+ if (radioConsent === null) return;
142
+ setConsent(radioConsent);
143
+ setUpdateExpanded(false);
144
+ setHasInteractedWithRadios(false);
145
+ },
146
+ className: "mt-8 w-full",
147
+ children: t("components.cookieBanner.save")
148
+ }
149
+ )
150
+ ] }) : null }) })
151
+ ]
152
+ }
153
+ )
154
+ },
155
+ showUpdate ? "update" : "initial"
156
+ ) : null }) });
157
+ };
158
+ const CookieIcon = ({ size, ...props }) => {
159
+ return /* @__PURE__ */ jsxs(
160
+ "svg",
161
+ {
162
+ viewBox: "0 0 48 48",
163
+ "aria-label": "Cookie illustration",
164
+ style: { width: size, height: size, strokeWidth: 0 },
165
+ ...props,
166
+ children: [
167
+ /* @__PURE__ */ jsx(
168
+ "path",
169
+ {
170
+ d: "M45.859,20.404c-.625.236-1.362.372-2.151.372-1.91,0-3.516-.798-3.973-1.878-1.445,1.219-3.92,1.227-6.016-.112-1.865-1.191-2.896-3.108-2.756-4.805-.147.079-.303.141-.467.184-1.714.458-3.658-1.263-4.342-3.844-.366-1.381-.297-2.728.108-3.752-.959-.55-1.643-2.001-1.643-3.704,0-.303.022-.599.063-.883-2.745-1.516-6.312-1.724-9.549-.457C6.258,4.998,0,13.431,0,23.642c0,13.453,10.863,24.358,24.263,24.358,10.758,0,19.882-8.082,23.06-17.386,1.196-3.502.866-7.757-1.464-10.21Z",
171
+ fill: "#d3964e"
172
+ }
173
+ ),
174
+ /* @__PURE__ */ jsx("circle", { cx: "28.544", cy: "32.597", r: ".714", fill: "#774619" }),
175
+ /* @__PURE__ */ jsx("ellipse", { cx: "38.892", cy: "26.507", rx: "1.07", ry: "1.075", fill: "#774619" }),
176
+ /* @__PURE__ */ jsx("ellipse", { cx: "18.911", cy: "36.537", rx: "1.427", ry: "1.433", fill: "#774619" }),
177
+ /* @__PURE__ */ jsx("circle", { cx: "8.742", cy: "20.955", r: ".892", fill: "#774619" }),
178
+ /* @__PURE__ */ jsx("ellipse", { cx: "20.338", cy: "14.328", rx: "1.427", ry: "1.433", fill: "#774619" }),
179
+ /* @__PURE__ */ jsx("ellipse", { cx: "22.657", cy: "23.821", rx: "3.033", ry: "3.045", fill: "#774619" }),
180
+ /* @__PURE__ */ jsx("ellipse", { cx: "13.202", cy: "10.746", rx: "3.211", ry: "3.224", fill: "#774619" }),
181
+ /* @__PURE__ */ jsx("ellipse", { cx: "32.826", cy: "22.567", rx: "1.784", ry: "1.791", fill: "#774619" }),
182
+ /* @__PURE__ */ jsx("ellipse", { cx: "9.099", cy: "30.269", rx: "1.962", ry: "1.97", fill: "#774619" }),
183
+ /* @__PURE__ */ jsx("ellipse", { cx: "29.615", cy: "41.91", rx: "2.498", ry: "2.507", fill: "#774619" }),
184
+ /* @__PURE__ */ jsx("ellipse", { cx: "33.361", cy: "6.627", rx: "2.319", ry: "2.328", fill: "#d3964e" }),
185
+ /* @__PURE__ */ jsx("ellipse", { cx: "44.957", cy: "15.045", rx: "1.07", ry: "1.075", fill: "#d3964e" }),
186
+ /* @__PURE__ */ jsx("ellipse", { cx: "38.178", cy: "14.328", rx: "1.427", ry: "1.433", fill: "#d3964e" }),
187
+ /* @__PURE__ */ jsx("ellipse", { cx: "43.53", cy: "5.373", rx: "3.568", ry: "3.582", fill: "#d3964e" }),
188
+ /* @__PURE__ */ jsx("circle", { cx: "29.436", cy: ".896", r: ".892", fill: "#d3964e" })
189
+ ]
190
+ }
191
+ );
192
+ };
193
+ export {
194
+ CookieBanner
195
+ };
@@ -0,0 +1,2 @@
1
+ export * from './CookieBanner';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/CookieBanner/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { UseFeaturedSubgraphsQueryArgs } from './useFeaturedSubgrahsQuery';
2
+ export type FeaturedSubgraphsGridProps = Readonly<UseFeaturedSubgraphsQueryArgs>;
3
+ export declare function FeaturedSubgraphsGrid(props: FeaturedSubgraphsGridProps): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=FeaturedSubgraphsGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeaturedSubgraphsGrid.d.ts","sourceRoot":"","sources":["../../src/FeaturedSubgraphs/FeaturedSubgraphsGrid.tsx"],"names":[],"mappings":"AAUA,OAAO,EAA6B,KAAK,6BAA6B,EAAE,MAAM,4BAA4B,CAAA;AAK1G,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC,6BAA6B,CAAC,CAAA;AAChF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAqBtE"}
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { addrShortener, toGRT } from "@graphprotocol/common";
4
+ import { ExperimentalLoadingIndicator, ExperimentalSubgraphCard, createIdenticon } from "@graphprotocol/gds";
5
+ import { useFeaturedSubgraphsQuery } from "./useFeaturedSubgrahsQuery.js";
6
+ const defaultSubgraphImageSrc = "https://ipfs.thegraph.com/ipfs/QmdSeSQ3APFjLktQY3aNVu3M5QXPfE9ZRK5LqgghRgB7L9";
7
+ function FeaturedSubgraphsGrid(props) {
8
+ const subgraphsOrDeployments = [...props.subgraphs ?? [], ...props.deployments ?? []];
9
+ if (subgraphsOrDeployments.length === 0) {
10
+ throw new Error("Must pass either subgraphs or deployments");
11
+ }
12
+ const { data, isLoading } = useFeaturedSubgraphsQuery(props);
13
+ const subgraphs = data ?? [];
14
+ if (isLoading) {
15
+ return /* @__PURE__ */ jsx(ExperimentalLoadingIndicator, {});
16
+ }
17
+ return /* @__PURE__ */ jsx(ExperimentalSubgraphCard.Grid, { children: subgraphs.map((s) => /* @__PURE__ */ jsx(FeaturedSubgraphCard, { subgraph: s }, `FeaturedSubgraphs.${s.id}`)) });
18
+ }
19
+ function FeaturedSubgraphCard({ subgraph }) {
20
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
21
+ const categories = ((_a = subgraph.metadata) == null ? void 0 : _a.categories) || [];
22
+ const ownerName = ((_b = subgraph.owner.defaultName) == null ? void 0 : _b.name) ? subgraph.owner.defaultName.name.endsWith(".eth") ? subgraph.owner.defaultName.name : `${subgraph.owner.defaultName.name}.eth` : ((_c = subgraph.owner) == null ? void 0 : _c.id) ? addrShortener((_d = subgraph.owner) == null ? void 0 : _d.id) : "";
23
+ return /* @__PURE__ */ jsx(
24
+ ExperimentalSubgraphCard,
25
+ {
26
+ href: `https://thegraph.com/explorer/subgraphs/${subgraph.id}`,
27
+ avatar: ((_e = subgraph.metadata) == null ? void 0 : _e.image) || defaultSubgraphImageSrc,
28
+ name: ((_f = subgraph.metadata) == null ? void 0 : _f.displayName) || "",
29
+ owner: {
30
+ avatar: ((_h = (_g = subgraph.owner) == null ? void 0 : _g.metadata) == null ? void 0 : _h.image) || createIdenticon(((_i = subgraph.owner) == null ? void 0 : _i.id) || "0x0000000000000000000000000000000000000000"),
31
+ name: ownerName
32
+ },
33
+ categories,
34
+ properties: [
35
+ { label: "Signal", value: `${toGRT(subgraph.currentSignalledTokens || "0")} GRT`, variant: "caption" }
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ FeaturedSubgraphsGrid
42
+ };
@@ -0,0 +1,42 @@
1
+ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
2
+ import * as types from './graphql';
3
+ /**
4
+ * Map of all GraphQL operations in the project.
5
+ *
6
+ * This map has several performance disadvantages:
7
+ * 1. It is not tree-shakeable, so it will include all operations in the project.
8
+ * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.
9
+ * 3. It does not support dead code elimination, so it will add unused operations.
10
+ *
11
+ * Therefore it is highly recommended to use the babel or swc plugin for production.
12
+ * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
13
+ */
14
+ type Documents = {
15
+ '\n fragment SubgraphData on Subgraph {\n id\n metadata {\n id\n displayName\n description\n image\n categories\n }\n createdAt\n updatedAt\n currentSignalledTokens\n owner {\n id\n metadata {\n id\n image\n }\n defaultDisplayName\n defaultName {\n id\n name\n }\n }\n currentVersion {\n id\n subgraphDeployment {\n id\n queryFeesAmount\n ipfsHash\n stakedTokens\n manifest {\n id\n network\n }\n }\n }\n }\n': typeof types.SubgraphDataFragmentDoc;
16
+ '\n query FeaturedSubgraphs(\n $id_in: [ID!]\n $include_subgraphs: Boolean!\n $ipfsHash_in: [String!]\n $include_deployments: Boolean!\n ) {\n subgraphs(\n where: { id_in: $id_in, active: true, entityVersion: 2, owner_not: "0x0000000000000000000000000000000000000000" }\n ) @include(if: $include_subgraphs) {\n ...SubgraphData\n }\n subgraphDeployments(where: { ipfsHash_in: $ipfsHash_in, activeSubgraphCount_gt: 0 })\n @include(if: $include_deployments) {\n versions(\n orderDirection: asc\n orderBy: createdAt\n where: {\n subgraph_: { active: true, entityVersion: 2, owner_not: "0x0000000000000000000000000000000000000000" }\n }\n ) {\n subgraph {\n ...SubgraphData\n }\n }\n }\n }\n': typeof types.FeaturedSubgraphsDocument;
17
+ };
18
+ declare const documents: Documents;
19
+ /**
20
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
21
+ *
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
26
+ * ```
27
+ *
28
+ * The query argument is unknown!
29
+ * Please regenerate the types.
30
+ */
31
+ export declare function graphql(source: string): unknown;
32
+ /**
33
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
34
+ */
35
+ export declare function graphql(source: '\n fragment SubgraphData on Subgraph {\n id\n metadata {\n id\n displayName\n description\n image\n categories\n }\n createdAt\n updatedAt\n currentSignalledTokens\n owner {\n id\n metadata {\n id\n image\n }\n defaultDisplayName\n defaultName {\n id\n name\n }\n }\n currentVersion {\n id\n subgraphDeployment {\n id\n queryFeesAmount\n ipfsHash\n stakedTokens\n manifest {\n id\n network\n }\n }\n }\n }\n'): (typeof documents)['\n fragment SubgraphData on Subgraph {\n id\n metadata {\n id\n displayName\n description\n image\n categories\n }\n createdAt\n updatedAt\n currentSignalledTokens\n owner {\n id\n metadata {\n id\n image\n }\n defaultDisplayName\n defaultName {\n id\n name\n }\n }\n currentVersion {\n id\n subgraphDeployment {\n id\n queryFeesAmount\n ipfsHash\n stakedTokens\n manifest {\n id\n network\n }\n }\n }\n }\n'];
36
+ /**
37
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
38
+ */
39
+ export declare function graphql(source: '\n query FeaturedSubgraphs(\n $id_in: [ID!]\n $include_subgraphs: Boolean!\n $ipfsHash_in: [String!]\n $include_deployments: Boolean!\n ) {\n subgraphs(\n where: { id_in: $id_in, active: true, entityVersion: 2, owner_not: "0x0000000000000000000000000000000000000000" }\n ) @include(if: $include_subgraphs) {\n ...SubgraphData\n }\n subgraphDeployments(where: { ipfsHash_in: $ipfsHash_in, activeSubgraphCount_gt: 0 })\n @include(if: $include_deployments) {\n versions(\n orderDirection: asc\n orderBy: createdAt\n where: {\n subgraph_: { active: true, entityVersion: 2, owner_not: "0x0000000000000000000000000000000000000000" }\n }\n ) {\n subgraph {\n ...SubgraphData\n }\n }\n }\n }\n'): (typeof documents)['\n query FeaturedSubgraphs(\n $id_in: [ID!]\n $include_subgraphs: Boolean!\n $ipfsHash_in: [String!]\n $include_deployments: Boolean!\n ) {\n subgraphs(\n where: { id_in: $id_in, active: true, entityVersion: 2, owner_not: "0x0000000000000000000000000000000000000000" }\n ) @include(if: $include_subgraphs) {\n ...SubgraphData\n }\n subgraphDeployments(where: { ipfsHash_in: $ipfsHash_in, activeSubgraphCount_gt: 0 })\n @include(if: $include_deployments) {\n versions(\n orderDirection: asc\n orderBy: createdAt\n where: {\n subgraph_: { active: true, entityVersion: 2, owner_not: "0x0000000000000000000000000000000000000000" }\n }\n ) {\n subgraph {\n ...SubgraphData\n }\n }\n }\n }\n'];
40
+ export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
41
+ export {};
42
+ //# sourceMappingURL=gql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../src/FeaturedSubgraphs/generated/gql.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,WAAW,CAAA;AAClC,OAAO,KAAK,EAAE,iBAAiB,IAAI,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAE1F;;;;;;;;;;GAUG;AACH,KAAK,SAAS,GAAG;IACf,ulBAAulB,EAAE,OAAO,KAAK,CAAC,uBAAuB,CAAA;IAC7nB,uyBAAuyB,EAAE,OAAO,KAAK,CAAC,yBAAyB,CAAA;CACh1B,CAAA;AACD,QAAA,MAAM,SAAS,EAAE,SAKhB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;AAEhD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,ulBAAulB,GAC9lB,CAAC,OAAO,SAAS,CAAC,CAAC,ulBAAulB,CAAC,CAAA;AAC9mB;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,uyBAAuyB,GAC9yB,CAAC,OAAO,SAAS,CAAC,CAAC,uyBAAuyB,CAAC,CAAA;AAM9zB,MAAM,MAAM,YAAY,CAAC,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,IACnE,aAAa,SAAS,YAAY,CAAC,MAAM,KAAK,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { FeaturedSubgraphsDocument, SubgraphDataFragmentDoc } from "./graphql.js";
2
+ const documents = {
3
+ "\n fragment SubgraphData on Subgraph {\n id\n metadata {\n id\n displayName\n description\n image\n categories\n }\n createdAt\n updatedAt\n currentSignalledTokens\n owner {\n id\n metadata {\n id\n image\n }\n defaultDisplayName\n defaultName {\n id\n name\n }\n }\n currentVersion {\n id\n subgraphDeployment {\n id\n queryFeesAmount\n ipfsHash\n stakedTokens\n manifest {\n id\n network\n }\n }\n }\n }\n": SubgraphDataFragmentDoc,
4
+ '\n query FeaturedSubgraphs(\n $id_in: [ID!]\n $include_subgraphs: Boolean!\n $ipfsHash_in: [String!]\n $include_deployments: Boolean!\n ) {\n subgraphs(\n where: { id_in: $id_in, active: true, entityVersion: 2, owner_not: "0x0000000000000000000000000000000000000000" }\n ) @include(if: $include_subgraphs) {\n ...SubgraphData\n }\n subgraphDeployments(where: { ipfsHash_in: $ipfsHash_in, activeSubgraphCount_gt: 0 })\n @include(if: $include_deployments) {\n versions(\n orderDirection: asc\n orderBy: createdAt\n where: {\n subgraph_: { active: true, entityVersion: 2, owner_not: "0x0000000000000000000000000000000000000000" }\n }\n ) {\n subgraph {\n ...SubgraphData\n }\n }\n }\n }\n': FeaturedSubgraphsDocument
5
+ };
6
+ function graphql(source) {
7
+ return documents[source] ?? {};
8
+ }
9
+ export {
10
+ graphql
11
+ };