@theguild/components 9.2.0-alpha-20250121195137-9d86406d5fb26aecdea804524f4eaa66f51ff603 → 9.2.0
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useEffect, useId, useRef, useState } from "react";
|
|
4
|
+
import NextLink from "next/link";
|
|
4
5
|
import { cn } from "../cn";
|
|
5
6
|
const DropdownContext = createContext(null);
|
|
6
7
|
function useDropdownContext() {
|
|
@@ -118,7 +119,7 @@ function DropdownContent({ children, className, ...props }) {
|
|
|
118
119
|
}
|
|
119
120
|
function DropdownItem({ children, onClick, className, href, ...props }) {
|
|
120
121
|
if (href) {
|
|
121
|
-
return /* @__PURE__ */ jsx(
|
|
122
|
+
return /* @__PURE__ */ jsx(NextLink, { role: "menuitem", href, className, onClick, ...props, children });
|
|
122
123
|
}
|
|
123
124
|
return /* @__PURE__ */ jsx(
|
|
124
125
|
"button",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cloneElement, useId } from "react";
|
|
3
3
|
import { cn } from "../../cn";
|
|
4
4
|
import { DecorationIsolation } from "../decorations";
|
|
@@ -8,28 +8,6 @@ const Hero = (props) => {
|
|
|
8
8
|
const gradientWhiteId = useId();
|
|
9
9
|
const gradientWhiteId2 = useId();
|
|
10
10
|
const greenBgId = useId();
|
|
11
|
-
const decorations = props.decorations === void 0 ? props.logo && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
-
cloneElement(props.logo, {
|
|
13
|
-
className: cn(
|
|
14
|
-
"absolute stroke-white/10 max-lg:hidden",
|
|
15
|
-
"-left-1/2 top-1/2 -translate-y-1/2"
|
|
16
|
-
),
|
|
17
|
-
fill: `url(#${gradientWhiteId2})`,
|
|
18
|
-
strokeWidth: "0.1",
|
|
19
|
-
width: "auto",
|
|
20
|
-
height: "50%"
|
|
21
|
-
}),
|
|
22
|
-
cloneElement(props.logo, {
|
|
23
|
-
className: cn(
|
|
24
|
-
"absolute top-1/2 -translate-y-1/2 stroke-white/10",
|
|
25
|
-
"-right-1/2 lg:-right-1/3",
|
|
26
|
-
"h-2/3 lg:h-[calc(100%-5%)]"
|
|
27
|
-
),
|
|
28
|
-
fill: `url(#${gradientWhiteId2})`,
|
|
29
|
-
strokeWidth: "0.1",
|
|
30
|
-
width: "auto"
|
|
31
|
-
})
|
|
32
|
-
] }) : props.decorations;
|
|
33
11
|
return /* @__PURE__ */ jsxs(
|
|
34
12
|
"div",
|
|
35
13
|
{
|
|
@@ -38,8 +16,29 @@ const Hero = (props) => {
|
|
|
38
16
|
props.className
|
|
39
17
|
),
|
|
40
18
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
19
|
+
/* @__PURE__ */ jsxs(DecorationIsolation, { className: "-z-10", children: [
|
|
20
|
+
cloneElement(props.logo, {
|
|
21
|
+
className: cn(
|
|
22
|
+
"absolute stroke-white/10 max-lg:hidden",
|
|
23
|
+
"-left-1/2 top-1/2 -translate-y-1/2"
|
|
24
|
+
),
|
|
25
|
+
fill: `url(#${gradientWhiteId2})`,
|
|
26
|
+
strokeWidth: "0.1",
|
|
27
|
+
width: "auto",
|
|
28
|
+
height: "50%"
|
|
29
|
+
}),
|
|
30
|
+
cloneElement(props.logo, {
|
|
31
|
+
className: cn(
|
|
32
|
+
"absolute top-1/2 -translate-y-1/2 stroke-white/10",
|
|
33
|
+
"-right-1/2 lg:-right-1/3",
|
|
34
|
+
"h-2/3 lg:h-[calc(100%-5%)]"
|
|
35
|
+
),
|
|
36
|
+
fill: `url(#${gradientWhiteId2})`,
|
|
37
|
+
strokeWidth: "0.1",
|
|
38
|
+
width: "auto"
|
|
39
|
+
})
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
43
42
|
cloneElement(props.logo, {
|
|
44
43
|
fill: `url(#${gradientWhiteId})`,
|
|
45
44
|
className: "absolute inset-1/2 -translate-x-1/2 -translate-y-1/2 size-1/2"
|
|
@@ -68,10 +68,7 @@ function HiveNavigation({
|
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
70
70
|
ref: containerRef,
|
|
71
|
-
className:
|
|
72
|
-
"sticky top-0 z-20 border-b border-beige-400/[var(--border-opacity)] bg-[rgb(var(--nextra-bg))] px-6 py-4 text-green-1000 transition-[border-color] duration-500 md:mb-[7px] md:mt-2 dark:border-neutral-700/[var(--border-opacity)] dark:text-neutral-200",
|
|
73
|
-
WIDTH_STYLE
|
|
74
|
-
),
|
|
71
|
+
className: "sticky top-0 z-20 border-b border-beige-400/[var(--border-opacity)] bg-[rgb(var(--nextra-bg))] px-6 py-4 text-green-1000 transition-[border-color] duration-500 md:mb-[7px] md:mt-2 dark:border-neutral-700/[var(--border-opacity)] dark:text-neutral-200",
|
|
75
72
|
style: { "--border-opacity": 0 },
|
|
76
73
|
children: [
|
|
77
74
|
/* @__PURE__ */ jsx(
|
|
@@ -87,52 +84,59 @@ function HiveNavigation({
|
|
|
87
84
|
logo,
|
|
88
85
|
/* @__PURE__ */ jsx(HamburgerButton, {})
|
|
89
86
|
] }),
|
|
90
|
-
/* @__PURE__ */ jsxs(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
87
|
+
/* @__PURE__ */ jsxs(
|
|
88
|
+
NavigationMenu,
|
|
89
|
+
{
|
|
90
|
+
className: cn("mx-auto hidden md:flex", WIDTH_STYLE, className),
|
|
91
|
+
delayDuration: 0,
|
|
92
|
+
children: [
|
|
93
|
+
logo,
|
|
94
|
+
/* @__PURE__ */ jsxs(NavigationMenuList, { className: "ml-4 bg-white dark:bg-transparent [@media(min-width:1180px)]:ml-16", children: [
|
|
95
|
+
/* @__PURE__ */ jsxs(NavigationMenuItem, { children: [
|
|
96
|
+
/* @__PURE__ */ jsx(NavigationMenuTrigger, { children: "Products" }),
|
|
97
|
+
/* @__PURE__ */ jsx(NavigationMenuContent, { children: /* @__PURE__ */ jsx(ProductsMenu, { productName }) })
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ jsxs(NavigationMenuItem, { children: [
|
|
100
|
+
/* @__PURE__ */ jsx(NavigationMenuTrigger, { children: "Developer" }),
|
|
101
|
+
/* @__PURE__ */ jsx(NavigationMenuContent, { children: /* @__PURE__ */ jsx(DeveloperMenu, { developerMenu }) })
|
|
102
|
+
] }),
|
|
103
|
+
!ENTERPRISE_MENU_HIDDEN && /* @__PURE__ */ jsxs(NavigationMenuItem, { children: [
|
|
104
|
+
/* @__PURE__ */ jsx(NavigationMenuTrigger, { children: "Enterprise" }),
|
|
105
|
+
/* @__PURE__ */ jsx(NavigationMenuContent, { children: /* @__PURE__ */ jsx(EnterpriseMenu, {}) })
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ jsxs(NavigationMenuItem, { children: [
|
|
108
|
+
/* @__PURE__ */ jsx(NavigationMenuTrigger, { children: "Company" }),
|
|
109
|
+
/* @__PURE__ */ jsx(NavigationMenuContent, { children: /* @__PURE__ */ jsx(CompanyMenu, { children: companyMenuChildren }) })
|
|
110
|
+
] }),
|
|
111
|
+
navLinks.map(({ href, children: children2 }, i) => /* @__PURE__ */ jsx(NavigationMenuItem, { className: "flex", children: /* @__PURE__ */ jsx(NavigationMenuLink, { href, className: "font-medium", children: children2 }) }, i))
|
|
112
|
+
] }),
|
|
113
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1" }),
|
|
114
|
+
children,
|
|
115
|
+
search,
|
|
116
|
+
/* @__PURE__ */ jsxs(
|
|
117
|
+
CallToAction,
|
|
118
|
+
{
|
|
119
|
+
className: "ml-4 max-lg:hidden",
|
|
120
|
+
variant: "tertiary",
|
|
121
|
+
href: `${siteOrigin}/contact`,
|
|
122
|
+
target: "_blank",
|
|
123
|
+
rel: "noopener noreferrer",
|
|
124
|
+
onClick: (event) => {
|
|
125
|
+
if (window.$crisp) {
|
|
126
|
+
window.$crisp.push(["do", "chat:open"]);
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
children: [
|
|
131
|
+
"Contact ",
|
|
132
|
+
/* @__PURE__ */ jsx("span", { className: "hidden xl:contents", children: "us" })
|
|
133
|
+
]
|
|
126
134
|
}
|
|
127
|
-
|
|
128
|
-
children:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
productName === "Hive" ? /* @__PURE__ */ jsx(CallToAction, { variant: "primary", href: "https://app.graphql-hive.com/", className: "ml-4", children: "Sign in" }) : /* @__PURE__ */ jsx(CallToAction, { variant: "primary", href: "/docs", className: "ml-4", children: "Docs" })
|
|
135
|
-
] })
|
|
135
|
+
),
|
|
136
|
+
productName === "Hive" ? /* @__PURE__ */ jsx(CallToAction, { variant: "primary", href: "https://app.graphql-hive.com/", className: "ml-4", children: "Sign in" }) : /* @__PURE__ */ jsx(CallToAction, { variant: "primary", href: "/docs", className: "ml-4", children: "Docs" })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
)
|
|
136
140
|
]
|
|
137
141
|
}
|
|
138
142
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theguild/components",
|
|
3
|
-
"version": "9.2.0
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/the-guild-org/docs",
|
|
6
6
|
"directory": "packages/components"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@giscus/react": "3.1.0",
|
|
48
|
-
"@next/bundle-analyzer": "15.1.
|
|
48
|
+
"@next/bundle-analyzer": "15.1.5",
|
|
49
49
|
"@radix-ui/react-accordion": "^1.2.2",
|
|
50
50
|
"@radix-ui/react-icons": "^1.3.2",
|
|
51
51
|
"@radix-ui/react-navigation-menu": "^1.2.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"dedent": "1.5.3",
|
|
71
71
|
"esbuild-plugin-svgr": "^3.0.0",
|
|
72
72
|
"graphql": "16.10.0",
|
|
73
|
-
"next": "15.1.
|
|
73
|
+
"next": "15.1.5",
|
|
74
74
|
"react": "18.3.1",
|
|
75
75
|
"react-dom": "18.3.1",
|
|
76
76
|
"unified": "^11.0.3",
|