@theguild/components 8.2.0-alpha-20250103134517-7241e5d50a127ba369dfaaacfd133dea72b9c87d → 8.2.0-alpha-20250103141522-0f0514ca373add829e5ba2d8422426460c6240a5
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,16 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../cn";
|
|
3
4
|
import { Dropdown, DropdownContent, DropdownItem, DropdownTrigger } from "./dropdown";
|
|
5
|
+
import { CaretSlimIcon, CheckIcon } from "./icons";
|
|
4
6
|
function VersionDropdown({ currentVersion, versions }) {
|
|
5
7
|
return /* @__PURE__ */ jsxs(Dropdown, { type: "hover", className: "relative", children: [
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
|
|
8
|
+
/* @__PURE__ */ jsxs(DropdownTrigger, { className: "hive-focus flex cursor-default items-center gap-1 py-2 font-medium leading-normal text-green-800 aria-expanded:text-green-1000 dark:text-neutral-300 dark:aria-expanded:text-neutral-100", children: [
|
|
9
|
+
currentVersion,
|
|
10
|
+
" ",
|
|
11
|
+
/* @__PURE__ */ jsx(CaretSlimIcon, { className: "size-3.5" })
|
|
12
|
+
] }),
|
|
13
|
+
/* @__PURE__ */ jsx(DropdownContent, { className: "absolute left-full min-w-16 -translate-x-full translate-y-2 rounded-xl border border-beige-200 bg-white p-1 shadow-[0px_16px_32px_-12px_rgba(14,18,27,0.10)] transition ease-in-out data-[state=closed]:pointer-events-none data-[state=closed]:translate-y-0 data-[state=closed]:scale-95 data-[state=closed]:opacity-0 data-[state=open]:fade-in-90 dark:border-neutral-800 dark:bg-neutral-900", children: versions.map((version) => /* @__PURE__ */ jsxs(
|
|
8
14
|
DropdownItem,
|
|
9
15
|
{
|
|
10
16
|
href: version.href,
|
|
11
17
|
onClick: version.onClick,
|
|
12
|
-
className:
|
|
13
|
-
|
|
18
|
+
className: cn(
|
|
19
|
+
"flex items-center justify-between gap-1 whitespace-nowrap rounded p-2 text-green-800 transition-colors hover:bg-beige-100 hover:text-green-1000 dark:text-neutral-300 dark:hover:bg-neutral-800/50 dark:hover:text-neutral-100",
|
|
20
|
+
version.value === currentVersion && "pointer-events-none font-medium"
|
|
21
|
+
),
|
|
22
|
+
children: [
|
|
23
|
+
version.label ?? version.value,
|
|
24
|
+
" ",
|
|
25
|
+
version.value === currentVersion && /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
|
|
26
|
+
]
|
|
14
27
|
},
|
|
15
28
|
version.value
|
|
16
29
|
)) })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theguild/components",
|
|
3
|
-
"version": "8.2.0-alpha-
|
|
3
|
+
"version": "8.2.0-alpha-20250103141522-0f0514ca373add829e5ba2d8422426460c6240a5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/the-guild-org/docs",
|
|
6
6
|
"directory": "packages/components"
|