Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a getting started page #254

Merged
merged 33 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d0dab67
added getting started page
fraincs May 2, 2024
9fae47f
addes info in getting started page
fraincs May 6, 2024
4bf7cf1
added a callout component - updated getting started copy
fraincs May 7, 2024
2031007
intro adjustments
fraincs May 7, 2024
08384dc
updated copy and title size
fraincs May 7, 2024
ae089b2
removed package manager field in package to fix build issues
fraincs May 7, 2024
1eb877a
fixed linting error
fraincs May 7, 2024
21a493b
removed unneeded import
fraincs May 7, 2024
81c2ccc
fix for build issue of getting-started-page
fraincs May 7, 2024
6556066
fixed typing issue with new component
fraincs May 7, 2024
08cacc4
added dependency on react-aria
fraincs May 7, 2024
0776f0d
updated package lock file
fraincs May 7, 2024
c42273a
fix dependency version
alexasselin008 May 7, 2024
ad8854d
Merge branch 'main' into feature/getting-started
alexasselin008 May 7, 2024
d8c77a4
fix linting
alexasselin008 May 7, 2024
ef58cb9
fixed some typo
fraincs May 7, 2024
6896ecb
pr fixes
fraincs May 10, 2024
30a5012
Merge branch 'main' into feature/getting-started
fraincs May 15, 2024
c136145
swapped color for package picker
fraincs May 15, 2024
127a150
Merge branch 'main' into feature/getting-started
fraincs May 24, 2024
211abd3
merge
fraincs May 27, 2024
762429d
wip
fraincs May 29, 2024
4b08085
PR fixes
fraincs Jun 4, 2024
a2213aa
Merge branch 'main' into feature/getting-started
fraincs Jun 7, 2024
56afe60
wip
fraincs Jun 11, 2024
723cd2f
merge
fraincs Jun 11, 2024
d00c1d1
added nes getting-started sectino
fraincs Jun 12, 2024
433c2e0
fix render of getting-started pages
Jun 12, 2024
ca8749b
moved getting started files
fraincs Jun 13, 2024
3d57054
unfixed comments
fraincs Jun 13, 2024
d7009ad
pr fixes
fraincs Jun 13, 2024
4e39ea6
removed unnecessary pages
fraincs Jun 14, 2024
ed0b622
added an import
fraincs Jun 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/docs/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
},
"globals": {
"Card": true,
"Callout": true,
"Collapsible": true,
"Table": true,
"MotionPreview": true,
"Footnote": true,
Expand Down
43 changes: 43 additions & 0 deletions apps/docs/app/getting-started/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { notFound } from "next/navigation";
import { allGettingStarteds } from "contentlayer/generated";

import Aside from "@/app/ui/layout/aside/Aside.tsx";
import Mdx from "@/components/mdx/Mdx.tsx";
import getSectionLinks from "@/app/lib/getSectionLinks.ts";

interface PageProps {
params: {
slug: string[];
};
}

export async function generateStaticParams() {
return allGettingStarteds.map(({ section }) => ({
slug: [section]
}));
}

export default function GettingStartedPage({ params }: PageProps) {
const [section] = params.slug;

const pages = allGettingStarteds.find(page => page.slug === section);


if (!pages) {
notFound();
}

const sectionLinks = getSectionLinks(pages);

return (
<div className="hd-container">
<Aside title="On this page" links={sectionLinks} />
<main>
<article className="hd-content" key={pages._id}>
<h1 className="hd-title hd-title--level1">{pages.title}</h1>
fraincs marked this conversation as resolved.
Show resolved Hide resolved
<Mdx code={pages.body.code} />
</article>
</main>
</div>
);
}
32 changes: 32 additions & 0 deletions apps/docs/app/getting-started/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"use client";
fraincs marked this conversation as resolved.
Show resolved Hide resolved

import type { ReactNode } from "react";
import { allGettingStarteds } from "contentlayer/generated";
import { useSelectedLayoutSegment } from "next/navigation";
import Sidebar from "@/app/ui/layout/sidebar/Sidebar";
import SubHeader from "@/app/ui/layout/subHeader/SubHeader";
import getSectionLinks from "@/app/lib/getSectionLinks";
import { SidebarProvider } from "@/context/sidebar/SidebarProvider";

export default function TokenLayout({ children }: { children: ReactNode }) {
const slug = useSelectedLayoutSegment();
const pageContent = allGettingStarteds.find(page => page.slug === slug);

if (!pageContent) {
return null;
}

const sectionLinks = getSectionLinks(pageContent);

return (
<>
<SidebarProvider>
<SubHeader links={sectionLinks} />
<div className="hd-wrapper hd-flex">
<Sidebar data={allGettingStarteds} />
{children}
</div>
</SidebarProvider>
</>
);
}
23 changes: 23 additions & 0 deletions apps/docs/app/getting-started/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use client";

import { allPages } from "contentlayer/generated";
import Mdx from "@/components/mdx/Mdx";
import { notFound } from "next/navigation";

export default function IconPage() {
const page = allPages.find(iconPage => iconPage._id === "pages/icons.mdx");
fraincs marked this conversation as resolved.
Show resolved Hide resolved

if (!page) {
notFound();
}

return (
<div className="hd-wrapper hd-flex">
<main>
<article className="hd-content" key={page._id}>
{page.body && <Mdx code={page.body.code} />}
</article>
</main>
</div>
);
}
2 changes: 1 addition & 1 deletion apps/docs/app/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ p {
}

.hd-content p + * {
margin-block-start: var(--hd-space-3);
margin-block: var(--hd-space-3);
}

.hd-content ul li:not([class]) {
Expand Down
29 changes: 29 additions & 0 deletions apps/docs/app/pages/getting-started/individual-packages/page.tsx
fraincs marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"use client";

import { allPages } from "contentlayer/generated";
import Mdx from "@/components/mdx/Mdx";
import { notFound } from "next/navigation";
import Aside from "@/app/ui/layout/aside/Aside.tsx";
import getSectionLinks from "@/app/lib/getSectionLinks";

export default function GettingStartedPage() {
const page = allPages.find(gettingStartedPage => gettingStartedPage._id === "pages/individual-packages.mdx");

if (!page) {
notFound();
}

const sectionLinks = getSectionLinks(page);

return (
<div className="hd-wrapper hd-flex">
<Aside title="On this page" links={sectionLinks} />
<main>
<article className="hd-content" key={page._id}>
<h1 className="hd-title hd-title--level1">{page.title}</h1>
fraincs marked this conversation as resolved.
Show resolved Hide resolved
{page.body && <Mdx code={page.body.code} />}
</article>
</main>
</div>
);
}
29 changes: 29 additions & 0 deletions apps/docs/app/pages/getting-started/javascript/page.tsx
fraincs marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"use client";

import { allPages } from "contentlayer/generated";
import Mdx from "@/components/mdx/Mdx";
import { notFound } from "next/navigation";
import Aside from "@/app/ui/layout/aside/Aside.tsx";
import getSectionLinks from "@/app/lib/getSectionLinks";

export default function GettingStartedPage() {
const page = allPages.find(gettingStartedPage => gettingStartedPage._id === "pages/javascript.mdx");

if (!page) {
notFound();
}

const sectionLinks = getSectionLinks(page);

return (
<div className="hd-wrapper hd-flex">
<Aside title="On this page" links={sectionLinks} />
<main>
<article className="hd-content" key={page._id}>
<h1 className="hd-title hd-title--level1">{page.title}</h1>
fraincs marked this conversation as resolved.
Show resolved Hide resolved
{page.body && <Mdx code={page.body.code} />}
</article>
</main>
</div>
);
}
29 changes: 29 additions & 0 deletions apps/docs/app/pages/getting-started/page.tsx
fraincs marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"use client";

import { allPages } from "contentlayer/generated";
import Mdx from "@/components/mdx/Mdx";
import { notFound } from "next/navigation";
import Aside from "@/app/ui/layout/aside/Aside.tsx";
import getSectionLinks from "@/app/lib/getSectionLinks";

export default function GettingStartedPage() {
const page = allPages.find(gettingStartedPage => gettingStartedPage._id === "pages/getting-started.mdx");

if (!page) {
notFound();
}

const sectionLinks = getSectionLinks(page);

return (
<div className="hd-wrapper hd-flex">
<Aside title="On this page" links={sectionLinks} />
<main>
<article className="hd-content" key={page._id}>
<h1 className="hd-title hd-title--level1">{page.title}</h1>
fraincs marked this conversation as resolved.
Show resolved Hide resolved
{page.body && <Mdx code={page.body.code} />}
</article>
</main>
</div>
);
}
2 changes: 1 addition & 1 deletion apps/docs/app/playground/headings-link/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Aside from "@/app/ui/layout/aside/Aside.tsx";
import getSectionLinks from "@/app/lib/getSectionLinks";

export default function HeadingsLinkPage() {
const page = allPages.find(iconPage => iconPage._id === "pages/playground-headings-links.mdx");
const page = allPages.find(playgroundPage => playgroundPage._id === "pages/playground/headings-links.mdx");

if (!page) {
notFound();
Expand Down
4 changes: 3 additions & 1 deletion apps/docs/app/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
--hd-color-neutral-border: var(--hd-neutral-75);
--hd-color-neutral-border-weak: var(--hd-neutral-20);
--hd-color-accent-text: var(--hd-accent-700);
--hd-color-accent-border: var(--hd-accent-700);
--hd-color-accent-surface: var(--hd-accent-100);
--hd-color-surface-neutral-gradient: linear-gradient(0deg, #151515 0%, #353434 100%);
--hd-color-surface-neutral-gradient-hover: linear-gradient(0deg, #353434 0%, #151515 100%);
Expand All @@ -95,7 +96,7 @@
[data-theme="dark"] {
--hd-color-white-surface: var(--hd-neutral-800);
--hd-color-neutral-surface: var(--hd-neutral-900);
--hd-color-neutral-surface-weak: var(--hd-neutral-900);
--hd-color-neutral-surface-weak: var(--hd-neutral-800);
--hd-color-surface-neutral-selection: var(--hd-neutral-300);
--hd-color-neutral-text: var(--hd-neutral-0);
--hd-color-neutral-text-strong: var(--hd-neutral-900);
Expand All @@ -116,6 +117,7 @@
--hd-color-neutral-icon-weak-hover: var(--hd-neutral-0);
--hd-color-neutral-border: var(--hd-neutral-700);
--hd-color-accent-text: var(--hd-accent-300);
--hd-color-accent-border: var(--hd-accent-700);
--hd-color-accent-surface: var(--hd-accent-900);
--hd-color-surface-neutral-gradient: linear-gradient(0deg, #F4F3EE 0%, var(--hd-neutral-0) 100%);
--hd-color-surface-neutral-gradient-hover: linear-gradient(0deg, var(--hd-neutral-0) 0%, #F4F3EE 100%);
Expand Down
18 changes: 18 additions & 0 deletions apps/docs/components/callout/Callout.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Meta, StoryObj } from "@storybook/react";

import Callout from "./Callout.tsx";


fraincs marked this conversation as resolved.
Show resolved Hide resolved
const meta = {
title: "components/Callout",
component: Callout
} satisfies Meta<typeof Callout>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
children: "Content of the callout"
}
};
17 changes: 17 additions & 0 deletions apps/docs/components/callout/Callout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { ReactNode } from "react";

import "./callout.css";

export interface CalloutProps {
children: ReactNode;
}

const Callout = ({ children }: CalloutProps) => {
return (
<div className="hd-callout">
{children}
</div>
);
};

export default Callout;
6 changes: 6 additions & 0 deletions apps/docs/components/callout/callout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.hd-callout {
background-color: var(--hd-color-accent-surface);
border-radius: 0.25rem;
border-left: 0.25rem solid var(--hd-color-accent-border);
padding: 1rem;
}
2 changes: 2 additions & 0 deletions apps/docs/components/mdx/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { HTMLAttributes } from "react";
import dynamic from "next/dynamic";

import Card from "@/components/card/Card.tsx";
import Callout from "@/components/callout/Callout.tsx";
import NextImage from "@/components/image/Image.tsx";
import Pre from "@/components/pre/Pre.tsx";
import InlineCode from "@/components/code/InlineCode.tsx";
Expand Down Expand Up @@ -32,6 +33,7 @@ const PropTable = dynamic(() => import("@/app/ui/components/propTable/PropTable.
export const components = {
Card,
code: InlineCode,
Callout: Callout,
Image: NextImage,
pre: Pre,
MotionPreview: MotionPreview,
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/components/title/title.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
}

.hd-title--level4 {
font-size: 1em;
font-size: 1.125em;
margin-block: 1.5rem 0.75rem;
}

.hd-title--level5 {
font-size: 0.825em;
font-size: 1rem;
margin-block: 1rem 0.625rem;
}

Expand Down
Loading
Loading