Skip to content

Commit 0dbc53f

Browse files
authored
Merge pull request #367 from airjp73/announcement
feat: add v6 announcement to docs
2 parents eabb3f2 + bb4eb76 commit 0dbc53f

File tree

5 files changed

+63
-5
lines changed

5 files changed

+63
-5
lines changed

apps/docs/app/components/Alert.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const Alert: FC<AlertProps> = ({
5050
className
5151
)}
5252
>
53-
<div className="flex">
53+
<div className="flex items-center">
5454
<div className="flex-shrink-0">
5555
<Icon
5656
className={classNames(

apps/docs/app/components/Button.tsx

+38-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ const buttonStyles = (
2424
className
2525
);
2626

27-
export type ButtonProps = {
27+
type BaseButtonProps = {
2828
label: string;
2929
variant?: keyof typeof variantStyles;
3030
icon?: ReactElement;
3131
rightIcon?: ReactElement;
32-
} & JSX.IntrinsicElements["button"];
32+
};
33+
export type ButtonProps = BaseButtonProps &
34+
JSX.IntrinsicElements["button"];
3335

3436
export const Button = forwardRef<
3537
HTMLButtonElement,
@@ -64,3 +66,37 @@ export const Button = forwardRef<
6466
</button>
6567
)
6668
);
69+
70+
export type ButtonLinkProps = BaseButtonProps &
71+
JSX.IntrinsicElements["a"];
72+
73+
export const ButtonLink = forwardRef<
74+
HTMLAnchorElement,
75+
ButtonLinkProps
76+
>(
77+
(
78+
{
79+
className,
80+
variant = "primary",
81+
label,
82+
icon,
83+
rightIcon,
84+
...rest
85+
},
86+
ref
87+
) => (
88+
<a
89+
className={buttonStyles(variant, className)}
90+
ref={ref}
91+
{...rest}
92+
>
93+
{icon &&
94+
cloneElement(icon, { className: "h-4 w-4 mr-2" })}
95+
{label}
96+
{rightIcon &&
97+
cloneElement(rightIcon, {
98+
className: "h-4 w-4 ml-2",
99+
})}
100+
</a>
101+
)
102+
);

apps/docs/app/components/Layout.tsx

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { MenuAlt2Icon } from "@heroicons/react/outline";
2-
import { useLocation, useMatches } from "@remix-run/react";
2+
import {
3+
Link,
4+
useLocation,
5+
useMatches,
6+
} from "@remix-run/react";
37
import React, {
48
Fragment,
59
PropsWithChildren,
@@ -9,6 +13,8 @@ import React, {
913
import { Sidebar } from "../components/Sidebar";
1014
import { Footer } from "./Footer";
1115
import { GithubIcon } from "./GithubIcon";
16+
import { Alert } from "./Alert";
17+
import { Button, ButtonLink } from "./Button";
1218

1319
type Section = {
1420
header: string;
@@ -225,6 +231,21 @@ export const Layout = ({ children }: LayoutProps) => {
225231
</div>
226232

227233
<div className="flex flex-col flex-1">
234+
<Alert
235+
className="not-prose"
236+
variant="info"
237+
title="v6 is coming!"
238+
details="Check out the RFC to get an early look or leave a comment."
239+
action={
240+
<ButtonLink
241+
href="https://github.com/airjp73/remix-validated-form/discussions/364"
242+
variant="primary"
243+
label="View RFC"
244+
aria-label="Dismiss"
245+
/>
246+
}
247+
/>
248+
228249
<main className="relative focus:outline-none p-8 prose prose-invert flex-1 md:flex-initial">
229250
{children}
230251
</main>

apps/docs/styles/index.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
.overrides {
2626
code.hljs {
2727
margin: -11px -15px;
28-
border-radius: .375rem;
28+
border-radius: 0.375rem;
2929
}
3030
}
3131
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"vitest:run": "vitest run",
1919
"lint": "eslint --cache .",
2020
"prettier": "prettier --cache --check .",
21+
"format": "prettier --write .",
2122
"build": "turbo run build",
2223
"prepare": "husky install"
2324
},

0 commit comments

Comments
 (0)