@theguild/components 9.0.0 → 9.1.0-alpha-20250115162659-07dd7a8867a83235ccc4f630fe6bfcb6d9ef54b3

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,4 +1,6 @@
1
- export { useMDXComponents } from './mdx-components.mjs';
1
+ export { useMDXComponents } from './mdx-components/mdx-components.mjs';
2
+ export { useHiveMDXComponents } from './mdx-components/hive-mdx-components.mjs';
3
+ export { MDXLink, MDXLinkProps } from './mdx-components/mdx-link.mjs';
2
4
  export { MDXRemote } from 'nextra/mdx-remote';
3
5
  export { fetchFilePathsFromGitHub } from 'nextra/fetch-filepaths-from-github';
4
6
  export { compileMdx } from 'nextra/compile';
@@ -14,6 +16,12 @@ import 'nextra';
14
16
  import 'nextra/mdx-components/pre/index';
15
17
  import 'react/jsx-runtime';
16
18
  import 'react';
19
+ import 'nextra/mdx-components';
20
+ import '../components/anchor.mjs';
21
+ import 'url';
22
+ import '../types/components.mjs';
23
+ import 'next/link';
24
+ import 'react-player';
17
25
  import '../products.mjs';
18
26
  import 'mdast';
19
27
  import 'unified';
@@ -1,4 +1,4 @@
1
- import { useMDXComponents } from "./mdx-components.js";
1
+ export * from "./mdx-components/index.js";
2
2
  import { MDXRemote } from "nextra/mdx-remote";
3
3
  import { fetchFilePathsFromGitHub } from "nextra/fetch-filepaths-from-github";
4
4
  import { compileMdx } from "nextra/compile";
@@ -30,6 +30,5 @@ export {
30
30
  mergeMetaWithPageMap,
31
31
  normalizePageMap,
32
32
  remarkLinkRewrite,
33
- sharedMetaItems,
34
- useMDXComponents
33
+ sharedMetaItems
35
34
  };
@@ -0,0 +1,8 @@
1
+ import { MDXComponents } from 'nextra/mdx-components';
2
+
3
+ /**
4
+ * MDX components used in Hive-rebranded websites.
5
+ */
6
+ declare const useHiveMDXComponents: (components?: MDXComponents) => MDXComponents;
7
+
8
+ export { useHiveMDXComponents };
@@ -0,0 +1,9 @@
1
+ import { useMDXComponents } from "./mdx-components";
2
+ import { MDXLink } from "./mdx-link";
3
+ const useHiveMDXComponents = (components) => useMDXComponents({
4
+ a: MDXLink,
5
+ ...components
6
+ });
7
+ export {
8
+ useHiveMDXComponents
9
+ };
@@ -0,0 +1,14 @@
1
+ export { useMDXComponents } from './mdx-components.mjs';
2
+ export { useHiveMDXComponents } from './hive-mdx-components.mjs';
3
+ export { MDXLink, MDXLinkProps } from './mdx-link.mjs';
4
+ import 'next/image';
5
+ import 'nextra';
6
+ import 'nextra/mdx-components/pre/index';
7
+ import 'react/jsx-runtime';
8
+ import 'react';
9
+ import 'nextra/mdx-components';
10
+ import '../../components/anchor.mjs';
11
+ import 'url';
12
+ import '../../types/components.mjs';
13
+ import 'next/link';
14
+ import 'react-player';
@@ -0,0 +1,3 @@
1
+ export * from "./mdx-components";
2
+ export * from "./hive-mdx-components";
3
+ export * from "./mdx-link";
@@ -15,7 +15,7 @@ const docsComponents = getDocsMDXComponents({
15
15
  await fs.access(filePath);
16
16
  } catch (error) {
17
17
  const relativePath = path.relative(process.cwd(), filePath);
18
- if (error.code === "ENOENT") {
18
+ if (typeof error === "object" && error && "code" in error && error.code === "ENOENT") {
19
19
  throw new Error(`File doesn't exist: ${relativePath}`);
20
20
  }
21
21
  throw new Error(`Error checking file: ${relativePath}`);
@@ -0,0 +1,15 @@
1
+ import * as react from 'react';
2
+ import { Anchor } from '../../components/anchor.mjs';
3
+ import 'url';
4
+ import '../../types/components.mjs';
5
+ import 'next/image';
6
+ import 'next/link';
7
+ import 'react-player';
8
+
9
+ interface MDXLinkProps extends Omit<React.ComponentProps<typeof Anchor>, 'href' | 'children'> {
10
+ href?: string;
11
+ children?: React.ReactNode;
12
+ }
13
+ declare const MDXLink: react.ForwardRefExoticComponent<Omit<MDXLinkProps, "ref"> & react.RefAttributes<HTMLAnchorElement>>;
14
+
15
+ export { MDXLink, type MDXLinkProps };
@@ -0,0 +1,25 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { cn } from "../../cn";
4
+ import { Anchor } from "../../components/anchor";
5
+ const MDXLink = forwardRef(
6
+ ({ className, href, children, ...rest }, ref) => {
7
+ return /* @__PURE__ */ jsx(
8
+ Anchor,
9
+ {
10
+ ref,
11
+ className: cn(
12
+ "hive-focus -mx-1 -my-0.5 rounded px-1 py-0.5 font-medium text-blue-700 underline underline-offset-2 hover:no-underline focus-visible:no-underline focus-visible:ring-current focus-visible:ring-offset-blue-200 dark:text-primary/90 dark:focus-visible:ring-primary/50",
13
+ className
14
+ ),
15
+ href: href || "",
16
+ ...rest,
17
+ children
18
+ }
19
+ );
20
+ }
21
+ );
22
+ MDXLink.displayName = "MDXLink";
23
+ export {
24
+ MDXLink
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theguild/components",
3
- "version": "9.0.0",
3
+ "version": "9.1.0-alpha-20250115162659-07dd7a8867a83235ccc4f630fe6bfcb6d9ef54b3",
4
4
  "repository": {
5
5
  "url": "https://github.com/the-guild-org/docs",
6
6
  "directory": "packages/components"