@theguild/components 9.3.5-alpha-20250217200039-d2528840d21aa99fef051fd129a7d8eebb1dde01 → 9.4.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,11 +1,26 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { AnchorProps } from './anchor.mjs';
|
|
4
|
+
import 'url';
|
|
5
|
+
import '../types/components.mjs';
|
|
6
|
+
import 'next/image';
|
|
7
|
+
import 'next/link';
|
|
8
|
+
import 'react-player';
|
|
3
9
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
declare namespace InfoCardProps {
|
|
11
|
+
interface InfoCardBaseProps {
|
|
12
|
+
icon: ReactNode;
|
|
13
|
+
heading: ReactNode;
|
|
14
|
+
scheme?: 'neutral' | 'green';
|
|
15
|
+
}
|
|
16
|
+
interface InfoCardLinkProps extends InfoCardBaseProps, Omit<AnchorProps, 'as'> {
|
|
17
|
+
href: AnchorProps['href'];
|
|
18
|
+
}
|
|
19
|
+
interface InfoCardInertProps extends InfoCardBaseProps, React.HTMLAttributes<HTMLElement> {
|
|
20
|
+
as: 'div' | 'li';
|
|
21
|
+
}
|
|
8
22
|
}
|
|
9
|
-
|
|
23
|
+
type InfoCardProps = InfoCardProps.InfoCardLinkProps | InfoCardProps.InfoCardInertProps;
|
|
24
|
+
declare function InfoCard({ icon, heading, className, children, scheme, ...rest }: InfoCardProps): react_jsx_runtime.JSX.Element;
|
|
10
25
|
|
|
11
|
-
export { InfoCard,
|
|
26
|
+
export { InfoCard, InfoCardProps };
|
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../cn";
|
|
3
|
+
import { Anchor } from "./anchor";
|
|
3
4
|
import { Stud } from "./stud";
|
|
4
5
|
function InfoCard({
|
|
5
|
-
as: Root = "div",
|
|
6
6
|
icon,
|
|
7
7
|
heading,
|
|
8
8
|
className,
|
|
9
9
|
children,
|
|
10
|
+
scheme = "neutral",
|
|
10
11
|
...rest
|
|
11
12
|
}) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
let Root;
|
|
14
|
+
if ("href" in rest) {
|
|
15
|
+
Root = Anchor;
|
|
16
|
+
} else {
|
|
17
|
+
Root = rest.as || "div";
|
|
18
|
+
delete rest.as;
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
Root,
|
|
22
|
+
{
|
|
23
|
+
className: cn(
|
|
24
|
+
"p-6 md:p-12",
|
|
25
|
+
scheme === "neutral" && "bg-beige-100 [--color-h:theme(colors.green.1000)] [--color-text:theme(colors.green.800)] [--hover-bg:theme(colors.beige.200)] dark:bg-neutral-900 dark:[--color-h:theme(colors.white)] dark:[--color-text:theme(colors.white)] dark:[--hover-bg:theme(colors.neutral.800)]",
|
|
26
|
+
scheme === "green" && "bg-green-900 [--color-h:theme(colors.white)] [--color-text:theme(colors.white)] [--hover-bg:theme(colors.green.800)]",
|
|
27
|
+
Root === Anchor && "hive-focus block cursor-pointer duration-300 hover:bg-[--hover-bg] focus-visible:bg-[--hover-bg]",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...rest,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx(Stud, { children: icon }),
|
|
33
|
+
/* @__PURE__ */ jsx("h3", { className: "mt-4 text-xl font-medium leading-[1.4] text-[--color-h] md:mt-6", children: heading }),
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 space-y-2 text-[--color-text] md:mt-4", children })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
17
38
|
}
|
|
18
39
|
export {
|
|
19
40
|
InfoCard
|
package/dist/index.d.mts
CHANGED
package/dist/next-types.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { UnionToIntersection } from './types/utility.mjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Next.js page props type.
|
|
3
5
|
* @see https://nextjs.org/docs/app/api-reference/file-conventions/page#props
|
|
@@ -13,9 +15,5 @@ interface NextPageProps<TParams extends string = never, TSearchParams extends st
|
|
|
13
15
|
[K in TSearchParams]?: string | string[];
|
|
14
16
|
}>;
|
|
15
17
|
}
|
|
16
|
-
type Prettify<T> = {
|
|
17
|
-
[K in keyof T]: T[K];
|
|
18
|
-
} & {};
|
|
19
|
-
type UnionToIntersection<T> = Prettify<(T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never>;
|
|
20
18
|
|
|
21
19
|
export type { NextPageProps };
|
|
File without changes
|
package/package.json
CHANGED