Skip to content

Commit afe5897

Browse files
committed
Merge branch 'main' of github.com:heroui-inc/heroui into canary
2 parents 2ee356b + a06ab9b commit afe5897

26 files changed

+552
-298
lines changed

apps/docs/app/layout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {siteConfig} from "@/config/site";
1212
import {fonts} from "@/config/fonts";
1313
import {Navbar} from "@/components/navbar";
1414
import {Footer} from "@/components/footer";
15-
import {ProBanner} from "@/components/pro-banner";
15+
import {HeroUIChatBanner} from "@/components/heroui-chat-banner";
1616

1717
export const metadata: Metadata = {
1818
title: {
@@ -82,7 +82,7 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
8282
>
8383
<Providers themeProps={{attribute: "class", defaultTheme: "dark"}}>
8484
<div className="relative flex flex-col" id="app-container">
85-
<ProBanner />
85+
<HeroUIChatBanner />
8686
<Navbar mobileRoutes={manifest.mobileRoutes} routes={manifest.routes} />
8787
{children}
8888
<Analytics mode="production" />

apps/docs/app/providers.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import * as React from "react";
4-
import {HeroUIProvider, ToastProvider} from "@heroui/react";
4+
import {HeroUIProvider} from "@heroui/react";
55
import {ThemeProvider as NextThemesProvider} from "next-themes";
66
import {ThemeProviderProps} from "next-themes";
77
import {useRouter} from "next/navigation";
@@ -44,7 +44,6 @@ export function Providers({children, themeProps}: ProvidersProps) {
4444
return (
4545
<ProviderWrapper>
4646
<HeroUIProvider navigate={router.push}>
47-
<ToastProvider />
4847
<NextThemesProvider {...themeProps}>{children}</NextThemesProvider>
4948
</HeroUIProvider>
5049
</ProviderWrapper>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
"use client";
2+
3+
import {Icon} from "@iconify/react/dist/offline";
4+
import arrowRightIcon from "@iconify/icons-solar/arrow-right-linear";
5+
import {usePathname} from "next/navigation";
6+
import {useEffect} from "react";
7+
import {usePostHog} from "posthog-js/react";
8+
9+
import emitter from "@/libs/emitter";
10+
11+
const hideOnPaths = ["examples"];
12+
13+
export const HeroUIChatBanner = () => {
14+
const posthog = usePostHog();
15+
16+
const handleClick = () => {
17+
posthog.capture("HeroUI Chat Banner", {
18+
action: "click",
19+
category: "landing-page",
20+
});
21+
};
22+
23+
const pathname = usePathname();
24+
const shouldBeVisible = !hideOnPaths.some((path) => pathname.includes(path));
25+
26+
useEffect(() => {
27+
if (!shouldBeVisible) return;
28+
29+
// listen to scroll event, dispatch an event when scroll is at the top < 48 px
30+
const handleScroll = () => {
31+
if (window.scrollY < 48) {
32+
emitter.emit("proBannerVisibilityChange", "visible");
33+
} else {
34+
emitter.emit("proBannerVisibilityChange", "hidden");
35+
}
36+
};
37+
38+
window.addEventListener("scroll", handleScroll);
39+
40+
return () => {
41+
window.removeEventListener("scroll", handleScroll);
42+
};
43+
}, [shouldBeVisible]);
44+
45+
if (!shouldBeVisible) return null;
46+
47+
return (
48+
<div className="relative z-50 isolate flex items-center gap-x-6 overflow-hidden bg-background border-b-1 border-divider px-6 py-2 sm:px-3.5 sm:before:flex-1">
49+
<div className="flex w-full items-center justify-between md:justify-center gap-x-3">
50+
<a
51+
className="text-small flex items-end sm:text-[0.93rem] text-foreground hover:opacity-80 transition-opacity"
52+
href="https://heroui.pro?utm_source=heroui.com&utm_medium=top-banner"
53+
rel="noopener noreferrer"
54+
target="_blank"
55+
onClick={handleClick}
56+
>
57+
<span aria-label="rocket" className="hidden md:block" role="img">
58+
🚀
59+
</span>
60+
<span
61+
className="inline-flex md:ml-1 animate-text-gradient font-medium bg-clip-text text-transparent bg-[linear-gradient(90deg,#27272A_0%,#52525B_50%,#52525B_100%)] dark:bg-[linear-gradient(90deg,#E5E5E5_0%,#A1A1AA_50%,#E5E5E5_100%)]"
62+
style={{
63+
fontSize: "inherit",
64+
backgroundSize: "200%",
65+
backgroundClip: "text",
66+
WebkitBackgroundClip: "text",
67+
color: "transparent",
68+
}}
69+
>
70+
Generate, edit and deploy beautiful apps
71+
</span>
72+
</a>
73+
<a
74+
className="flex group min-w-[120px] items-center font-semibold text-background bg-foreground shadow-sm gap-1.5 relative overflow-hidden rounded-full p-[1px] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
75+
href="https://heroui.chat?utm_source=heroui.com&utm_medium=top-banner"
76+
rel="noopener noreferrer"
77+
onClick={handleClick}
78+
>
79+
<div className="inline-flex h-full w-full cursor-pointer items-center justify-center rounded-full bg-foreground group-hover:bg-foreground/70 transition-background px-3 py-1 text-sm font-medium text-background">
80+
HeroUI Chat
81+
<Icon
82+
aria-hidden="true"
83+
className="outline-none transition-transform group-hover:translate-x-0.5 [&>path]:stroke-[2px]"
84+
icon={arrowRightIcon}
85+
width={16}
86+
/>
87+
</div>
88+
</a>
89+
</div>
90+
</div>
91+
);
92+
};
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {IconSvgProps} from "@/types";
2+
3+
export const CircleInfo = ({size = 24, width, height, ...props}: IconSvgProps) => (
4+
<svg
5+
aria-label="CircleInfo"
6+
focusable="false"
7+
height={size || height}
8+
viewBox="0 0 16 16"
9+
width={size || width}
10+
xmlns="http://www.w3.org/2000/svg"
11+
{...props}
12+
>
13+
<path
14+
clipRule="evenodd"
15+
d="M8 13.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-9.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-.25 3a.75.75 0 0 0-1.5 0V11a.75.75 0 0 0 1.5 0z"
16+
fill="#A1A1AA"
17+
fillRule="evenodd"
18+
/>
19+
</svg>
20+
);

apps/docs/components/icons/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ export * from "./mirror-left";
1717
export * from "./palette-round";
1818
export * from "./filters";
1919
export * from "./scaling";
20+
export * from "./circle-info";

apps/docs/components/icons/sponsors.tsx

+20
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,23 @@ export const CodeRabbitLogo = () => (
8989
/>
9090
</svg>
9191
);
92+
93+
export const MochiiAILogo = () => (
94+
<svg height="16.918" viewBox="0 0 100 16.918" width="100" xmlns="http://www.w3.org/2000/svg">
95+
<g
96+
fill="#7078fc"
97+
fillRule="evenodd"
98+
fontSize="9pt"
99+
id="svgGroup"
100+
stroke="#9b7bfa"
101+
strokeLinecap="round"
102+
strokeWidth="0.25mm"
103+
style={{stroke: "#9b7bfa", strokeWidth: "0.25mm", fill: "#7078fc"}}
104+
>
105+
<path
106+
d="M 2.156 16.654 L 0 16.654 L 0 0.264 L 1.98 0.264 L 8.118 8.998 L 7.106 8.998 L 13.2 0.264 L 15.18 0.264 L 15.18 16.654 L 13.002 16.654 L 13.002 2.992 L 13.772 3.234 L 7.678 11.814 L 7.502 11.814 L 1.474 3.234 L 2.156 2.992 L 2.156 16.654 Z M 48.268 16.654 L 46.222 16.654 L 46.222 0 L 48.268 0 L 48.268 7.106 L 47.894 6.908 Q 48.334 5.786 49.313 5.159 A 3.96 3.96 0 0 1 50.973 4.571 A 5.069 5.069 0 0 1 51.612 4.532 A 4.869 4.869 0 0 1 52.96 4.713 A 4.198 4.198 0 0 1 53.889 5.104 Q 54.89 5.676 55.473 6.688 A 4.393 4.393 0 0 1 56.042 8.584 A 5.331 5.331 0 0 1 56.056 8.976 L 56.056 16.654 L 53.988 16.654 L 53.988 9.636 A 4.486 4.486 0 0 0 53.928 8.882 Q 53.857 8.465 53.701 8.12 A 2.628 2.628 0 0 0 53.625 7.964 Q 53.262 7.282 52.624 6.897 A 2.681 2.681 0 0 0 51.512 6.531 A 3.367 3.367 0 0 0 51.15 6.512 A 2.961 2.961 0 0 0 50.092 6.698 A 2.777 2.777 0 0 0 49.676 6.897 Q 49.016 7.282 48.642 7.975 Q 48.268 8.667 48.268 9.634 A 3.42 3.42 0 0 0 48.268 9.636 L 48.268 16.654 Z M 77.352 16.654 L 75.042 16.654 L 80.916 0.264 L 83.468 0.264 L 89.342 16.654 L 87.032 16.654 L 85.69 12.804 L 78.694 12.804 L 77.352 16.654 Z M 43.538 7.722 L 41.712 8.602 Q 41.294 7.678 40.436 7.095 A 3.385 3.385 0 0 0 38.681 6.518 A 4.171 4.171 0 0 0 38.456 6.512 Q 37.378 6.512 36.509 7.062 Q 35.64 7.612 35.134 8.558 Q 34.628 9.504 34.628 10.736 A 4.8 4.8 0 0 0 34.816 12.098 A 4.221 4.221 0 0 0 35.134 12.881 A 3.953 3.953 0 0 0 36.196 14.167 A 3.853 3.853 0 0 0 36.509 14.388 Q 37.378 14.938 38.456 14.938 A 3.659 3.659 0 0 0 39.661 14.744 A 3.287 3.287 0 0 0 40.436 14.355 Q 41.294 13.772 41.712 12.804 L 43.538 13.728 A 4.294 4.294 0 0 1 42.487 15.3 A 4.992 4.992 0 0 1 42.416 15.367 Q 41.646 16.082 40.634 16.5 A 5.609 5.609 0 0 1 38.601 16.916 A 6.426 6.426 0 0 1 38.456 16.918 A 6.332 6.332 0 0 1 36.623 16.66 A 5.509 5.509 0 0 1 35.365 16.104 Q 34.012 15.29 33.242 13.882 A 6.328 6.328 0 0 1 32.493 11.282 A 7.674 7.674 0 0 1 32.472 10.714 Q 32.472 8.932 33.242 7.546 Q 34.012 6.16 35.365 5.346 Q 36.718 4.532 38.456 4.532 A 5.745 5.745 0 0 1 40.249 4.808 A 5.376 5.376 0 0 1 40.634 4.95 Q 41.646 5.368 42.416 6.072 Q 43.186 6.776 43.538 7.722 Z M 22.09 16.572 A 6.319 6.319 0 0 0 24.2 16.918 Q 25.872 16.918 27.247 16.115 Q 28.622 15.312 29.458 13.915 A 5.696 5.696 0 0 0 30.037 12.59 A 6.626 6.626 0 0 0 30.294 10.714 A 7.463 7.463 0 0 0 30.244 9.838 A 5.956 5.956 0 0 0 29.491 7.524 Q 28.688 6.138 27.302 5.335 A 5.832 5.832 0 0 0 26.31 4.878 A 6.319 6.319 0 0 0 24.2 4.532 Q 22.462 4.532 21.076 5.346 Q 19.69 6.16 18.887 7.546 Q 18.084 8.932 18.084 10.714 A 7.441 7.441 0 0 0 18.104 11.262 A 6.103 6.103 0 0 0 18.898 13.904 Q 19.712 15.312 21.098 16.115 A 5.832 5.832 0 0 0 22.09 16.572 Z M 93.566 16.654 L 91.41 16.654 L 91.41 0.264 L 93.566 0.264 L 93.566 16.654 Z M 61.028 16.654 L 58.982 16.654 L 58.982 4.796 L 61.028 4.796 L 61.028 16.654 Z M 66.242 16.654 L 64.196 16.654 L 64.196 4.796 L 66.242 4.796 L 66.242 16.654 Z M 24.2 14.938 Q 25.3 14.938 26.191 14.388 Q 27.082 13.838 27.599 12.87 A 4.425 4.425 0 0 0 28.108 11.008 A 5.279 5.279 0 0 0 28.116 10.714 A 4.819 4.819 0 0 0 27.97 9.507 A 3.988 3.988 0 0 0 27.599 8.569 Q 27.082 7.634 26.191 7.073 Q 25.3 6.512 24.2 6.512 Q 23.078 6.512 22.187 7.073 Q 21.296 7.634 20.768 8.569 A 4.086 4.086 0 0 0 20.273 10.126 A 5.114 5.114 0 0 0 20.24 10.714 A 4.619 4.619 0 0 0 20.467 12.179 A 4.215 4.215 0 0 0 20.768 12.87 A 4.041 4.041 0 0 0 21.866 14.167 A 3.935 3.935 0 0 0 22.187 14.388 A 3.714 3.714 0 0 0 24.026 14.935 A 4.471 4.471 0 0 0 24.2 14.938 Z M 82.5 1.826 L 79.376 10.824 L 85.008 10.824 L 81.884 1.826 L 82.5 1.826 Z M 72.38 16.654 L 70.246 16.654 L 70.246 14.014 L 72.38 14.014 L 72.38 16.654 Z M 61.028 2.904 L 58.982 2.904 L 58.982 0.264 L 61.028 0.264 L 61.028 2.904 Z M 66.242 2.904 L 64.196 2.904 L 64.196 0.264 L 66.242 0.264 L 66.242 2.904 Z"
107+
vectorEffect="non-scaling-stroke"
108+
/>
109+
</g>
110+
</svg>
111+
);

apps/docs/components/marketing/sponsors.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Button, Link} from "@heroui/react";
22

33
import {sectionWrapper} from "@/components/primitives";
4-
import {Story2DesignLogo, CodeRabbitLogo} from "@/components/icons/sponsors";
4+
import {Story2DesignLogo, CodeRabbitLogo, MochiiAILogo} from "@/components/icons/sponsors";
55
import {HeartFilledIcon} from "@/components/icons";
66
import {siteConfig} from "@/config/site";
77
import {Sponsor, SponsorItem} from "@/components/marketing/sponsor-item";
@@ -17,6 +17,11 @@ const sponsors: Sponsor[] = [
1717
href: "https://coderabbit.ai/?utm_source=heroui&utm_marketing=oss",
1818
logo: <CodeRabbitLogo />,
1919
},
20+
{
21+
name: "Mochii.AI",
22+
href: "https://www.mochii.ai/?utm_source=heroui&utm_marketing=oss",
23+
logo: <MochiiAILogo />,
24+
},
2025
];
2126

2227
export const Sponsors = () => {

apps/docs/components/themes/components/config-section.tsx

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
1+
import {Tooltip} from "@heroui/react";
12
import {clsx} from "@heroui/shared-utils";
23

4+
import {CircleInfo} from "@/components/icons";
5+
36
interface ConfigurationSectionProps {
47
children: React.ReactNode;
58
id?: string;
69
title: string;
710
icon?: React.ReactNode;
11+
visualPurposeOnly?: boolean;
812
}
913

10-
export function ConfigSection({children, id, title, icon}: ConfigurationSectionProps) {
14+
export function ConfigSection({
15+
children,
16+
id,
17+
title,
18+
icon,
19+
visualPurposeOnly,
20+
}: ConfigurationSectionProps) {
1121
return (
1222
<div id={id}>
1323
<div className="text-[#71717A] dark:text-[#A1A1AA] text-md font-medium leading-7 flex gap-1.5 items-center">
1424
<div>{icon}</div>
1525
<div>{title}</div>
26+
{visualPurposeOnly && (
27+
<Tooltip
28+
classNames={{content: "text-tiny text-default-600"}}
29+
content="For visual purpose only"
30+
placement="right"
31+
>
32+
<div>
33+
<CircleInfo className="h-4 w-4 opacity-80 dark:opacity-60" />
34+
</div>
35+
</Tooltip>
36+
)}
1637
</div>
1738
<div className={clsx("flex flex-wrap gap-2 mt-3")}>{children}</div>
1839
</div>

apps/docs/components/themes/components/configuration/border-widths.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function BorderWidths() {
1515
const {borderWidthValue, setBorderWidthValue} = useThemeBuilder();
1616

1717
return (
18-
<ConfigSection icon={<Crop className="w-4 h-4" />} title="Border width">
18+
<ConfigSection visualPurposeOnly icon={<Crop className="w-4 h-4" />} title="Border width">
1919
{BORDER_WIDTHS.map(({title, className}) => (
2020
<EditableButton
2121
key={title}

apps/docs/components/themes/components/configuration/fonts.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function Fonts() {
99
const {font, setFont} = useThemeBuilder();
1010

1111
return (
12-
<ConfigSection icon={<TextSquare className="h-4 w-4" />} title="Font Family">
12+
<ConfigSection visualPurposeOnly icon={<TextSquare className="h-4 w-4" />} title="Font Family">
1313
<FontButton className="rounded-tl-none" setValue={setFont} title="Inter" value={font} />
1414
<FontButton className="rounded-tl-sm" setValue={setFont} title="Roboto" value={font} />
1515
<FontButton className="rounded-tl-md" setValue={setFont} title="Outfit" value={font} />

0 commit comments

Comments
 (0)