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

Update Getting-Started, Icons, Tokens and Guides for a first preview release of the documentation #532

Merged
merged 52 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1423ab0
added preview notif for components / swapped hopper logo
fraincs Nov 7, 2024
56dfe18
added new hopper logo - added preview tag in all components sections …
fraincs Nov 7, 2024
ccfaffb
linting error
fraincs Nov 7, 2024
1dc80d4
Added Preview Tag to Components sections/links - [feature/ds-452] (#…
fraincs Nov 7, 2024
e5aea3b
small fixes to tag
fraincs Nov 7, 2024
50ea62f
small fixes to tag - (#527)
fraincs Nov 7, 2024
7548df5
Merge branch 'main' into alpha
fraincs Nov 8, 2024
26f951b
Merge branch 'alpha' of github.com:gsoft-inc/wl-hopper into alpha
fraincs Nov 9, 2024
ba752d4
components are now shown in preview
alexasselin008 Nov 23, 2024
0d1804d
first draft of the getting started section
alexasselin008 Nov 23, 2024
db5c0de
update content
alexasselin008 Nov 25, 2024
93e3341
fixing doc
alexasselin008 Nov 26, 2024
c7dbfac
update icon documentation
alexasselin008 Nov 26, 2024
ed4e360
added a cardLink components - links are now purple
fraincs Nov 26, 2024
79c9341
Merge branch 'feature/guides' of github.com:gsoft-inc/wl-hopper into …
fraincs Nov 26, 2024
e927dde
updated RAC to 1.5 / fix for Collapsible component / small rework of …
fraincs Nov 27, 2024
8e9af4d
removed unneccessary key
fraincs Nov 27, 2024
b0884b0
upadated cardLink css
fraincs Nov 27, 2024
da2001c
reworked default tags
fraincs Nov 27, 2024
bfbece6
added expand component to documentatino
fraincs Nov 27, 2024
2977dbf
add guides navigation
alexasselin008 Nov 27, 2024
d5a38c4
update guides
alexasselin008 Nov 27, 2024
efbfd39
Merge branch 'main' into alpha
alexasselin008 Nov 28, 2024
ce579bc
Merge branch 'alpha' into feature/guides
alexasselin008 Nov 28, 2024
c68ec99
fix 404 and move guides under getting started
alexasselin008 Nov 28, 2024
d8fbd22
update dependencies and gitignore
alexasselin008 Nov 28, 2024
72424d4
fix comments
alexasselin008 Nov 28, 2024
40a660b
fix links
alexasselin008 Nov 28, 2024
13b8a92
review fixes
alexasselin008 Nov 29, 2024
c54651d
update doc
alexasselin008 Nov 29, 2024
29f352a
reworked the icon introduciton page
fraincs Nov 29, 2024
234a090
merge
fraincs Nov 29, 2024
dfd577b
styled the 404 page
fraincs Nov 29, 2024
890862c
fix link and dev script
alexasselin008 Nov 29, 2024
6d7b681
Merge branch 'feature/guides' of https://github.com/workleap/wl-hoppe…
alexasselin008 Nov 29, 2024
c07330b
doc ui fixes
fraincs Nov 29, 2024
a0ca826
Merge branch 'feature/guides' of github.com:gsoft-inc/wl-hopper into …
fraincs Nov 29, 2024
3699d9c
extract icons in their own file + convert data to TS + add controlled…
alexasselin008 Nov 29, 2024
cee960a
Merge branch 'feature/guides' of https://github.com/workleap/wl-hoppe…
alexasselin008 Nov 29, 2024
c9a136e
change url import style
alexasselin008 Nov 29, 2024
a298bb8
update indentation in examples
alexasselin008 Nov 29, 2024
d98008d
fix build
alexasselin008 Nov 29, 2024
8679ee0
added a Figure component to the documentation
fraincs Nov 29, 2024
1b45037
Merge branch 'feature/guides' of github.com:gsoft-inc/wl-hopper into …
fraincs Nov 29, 2024
a527bb3
update doc
alexasselin008 Nov 29, 2024
d8d23a5
updated npm logo
fraincs Nov 29, 2024
bcb0767
add line highlight
alexasselin008 Nov 29, 2024
38cdaf7
Merge branch 'feature/guides' of https://github.com/workleap/wl-hoppe…
alexasselin008 Nov 29, 2024
aca3c00
remove broken file
alexasselin008 Nov 29, 2024
5a905d9
Merge branch 'main' into alpha
alexasselin008 Nov 29, 2024
88b3779
Merge branch 'alpha' into feature/guides
alexasselin008 Nov 29, 2024
27aeec2
copy fix / collapsible shadow dark mode adjustments
fraincs Nov 30, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ next-env.d.ts

# storybook
build-storybook.log
storybook-static

# storybook generated doc
/packages/tokens/docs/
Expand Down
5 changes: 5 additions & 0 deletions apps/docs/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@
"globals": {
"BreakpointTable": true,
"Card": true,
"CardLink": true,
"CardLinkList": true,
"Callout": true,
"Collapsible": true,
"Expand": true,
"TokenTable": true,
"MotionPreview": true,
"Figure": true,
"Footnote": true,
"TypographyTable": true,
"TypographyVariantTable": true,
"Tag": true,
"Tabs": true,
"TableSection": true,
"SimpleTable": true,
Expand Down
38 changes: 38 additions & 0 deletions apps/docs/app/404.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.hd-layout_404 {
text-align: center;
}

.hd-404__title {
font-weight: 400;
font-size: clamp(2rem, 5vw, 4rem);
margin-top: 1rem;
margin-bottom: 2rem
}

.hd-404__subtitle {
font-weight: 400;
font-size: clamp(1rem, 4vw, 1.825rem);
margin-bottom: 2rem;
}

.hd-404__button {
border: none;
border-radius: var(--hd-border-radius-md);
height: 3rem;
padding: 0 1rem;
font-size: 1.25rem;
text-align: center;
background-color: var(--hd-accent-700);
display: inline-flex;
align-items: center;
color: var(--hd-white);
margin-top: 2rem;
}

.hd-404__button:hover {
background-color: var(--hd-accent-900);
}

.hd-404__button:active {
background-color: var(--hd-accent-400);
}
9 changes: 4 additions & 5 deletions apps/docs/app/getting-started/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { notFound } from "next/navigation";
import { allGettingStarteds } from "contentlayer/generated";
import { notFound } from "next/navigation";

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

interface PageProps {
Expand All @@ -19,9 +19,8 @@ export async function generateStaticParams() {
}

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

const pages = allGettingStarteds.find(page => page.slug === slug);
const [section, type] = params.slug;
const pages = allGettingStarteds.find(page => page.slug === type && page.section === section);

if (!pages) {
notFound();
Expand Down
39 changes: 20 additions & 19 deletions apps/docs/app/getting-started/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
"use client";

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

export default function TokenLayout({ children }: { children: ReactNode }) {
const slug = useSelectedLayoutSegment();
const pageContent = allGettingStarteds.find(page => page.slug === slug);
const allGettingStartedsLinks = getPageLinks(allGettingStarteds);
export default function GettingStartedLayout({ children }: { children: ReactNode }) {
const selectedLayoutSegment = useSelectedLayoutSegment();
const [section, type] = selectedLayoutSegment?.split("/") ?? ["", ""];

const pageContent = allGettingStarteds.find(page => page.slug === type && page.section === section);
if (!pageContent) {
return null;
return notFound();
}

const sectionLinks = getSectionLinks(pageContent);
const allGettingStartedsLinks = getPageLinks(allGettingStarteds, {
order: ["overview", "installation-path", "advanced-options", "guides"]
});

return (
<>
<SidebarProvider>
<SubHeader links={sectionLinks} />
<Wrapper type="with-sidebar">
<Sidebar links={allGettingStartedsLinks} />
{children}
</Wrapper>
</SidebarProvider>
</>
<SidebarProvider>
<SubHeader links={sectionLinks} />
<Wrapper type="with-sidebar">
<Sidebar links={allGettingStartedsLinks} />
{children}
</Wrapper>
</SidebarProvider>
);
}
23 changes: 0 additions & 23 deletions apps/docs/app/getting-started/page.tsx

This file was deleted.

14 changes: 8 additions & 6 deletions apps/docs/app/guides/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ import Mdx from "@/components/mdx/Mdx.tsx";

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

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

export default function GuidePage({ params }: PageProps) {
const [section, type] = params.slug;
const guides = allGuides.find(icon => icon.slug === type && icon.section === section);
const [section, type] = params.slug.length === 1 ? ["guides", ...params.slug] : params.slug;
const guides = allGuides.find(guide => guide.slug === type && guide.section === section);

if (!guides) {
notFound();
Expand Down
42 changes: 23 additions & 19 deletions apps/docs/app/guides/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
"use client";

import type { ReactNode } from "react";
import { allGuides } from "contentlayer/generated";
import { useSelectedLayoutSegment } from "next/navigation";
import getPageLinks from "@/app/lib/getPageLinks";
import getSectionLinks from "@/app/lib/getSectionLinks";
import Sidebar from "@/app/ui/layout/sidebar/Sidebar";
import Wrapper from "@/app/ui/layout/wrapper/Wrapper";
import SubHeader from "@/app/ui/layout/subHeader/SubHeader";
import getSectionLinks from "@/app/lib/getSectionLinks";
import Wrapper from "@/app/ui/layout/wrapper/Wrapper";
import { SidebarProvider } from "@/context/sidebar/SidebarProvider";
import getPageLinks from "@/app/lib/getPageLinks";
import { allGuides } from "contentlayer/generated";
import { notFound, useSelectedLayoutSegment } from "next/navigation";
import type { ReactNode } from "react";

export default function TokenLayout({ children }: { children: ReactNode }) {
export default function GuideLayout({ children }: { children: ReactNode }) {
const selectedLayoutSegment = useSelectedLayoutSegment();
const [section, type] = selectedLayoutSegment?.split("/") ?? ["", ""];
let segments = selectedLayoutSegment?.split("/") ?? ["", ""];
if (segments.length === 1) {
segments = ["guides", ...segments];
}
const [section, type] = segments;

const pageContent = allGuides.find(icon => icon.slug === type && icon.section === section);

if (!pageContent) {
return null;
return notFound();
}

const sectionLinks = getSectionLinks(pageContent);
const allGuidesLinks = getPageLinks(allGuides);
const allGuidesLinks = getPageLinks(allGuides, {
order: ["overview", "guides"]
});

return (
<>
<SidebarProvider>
<SubHeader links={sectionLinks} />
<Wrapper type="with-sidebar">
<Sidebar links={allGuidesLinks} />
{children}
</Wrapper>
</SidebarProvider>
</>
<SidebarProvider>
<SubHeader links={sectionLinks} />
<Wrapper type="with-sidebar">
<Sidebar links={allGuidesLinks} />
{children}
</Wrapper>
</SidebarProvider>
);
}
10 changes: 10 additions & 0 deletions apps/docs/app/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ a.hd-home-sample__item:hover::after {
transition: opacity 0.2s ease, transform 0.1s ease-in;
}

.hd-home-sample__title-tag {
align-self: center;
border-radius: var(--hd-border-radius-sm);
background-color: var(--hd-color-accent-surface-strong);
color: var(--hd-white);
font-size: 0.75rem;
alexasselin008 marked this conversation as resolved.
Show resolved Hide resolved
font-weight: 400;
padding: var(--hd-space-05);
}

.hd-home-sample__tagline {
color: var(--hd-color-neutral-text-weak);
font-size: 1rem;
Expand Down
12 changes: 6 additions & 6 deletions apps/docs/app/icons/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use client";

import type { ReactNode } from "react";
import { allIcons } from "contentlayer/generated";
import { useSelectedLayoutSegment } from "next/navigation";
import getPageLinks from "@/app/lib/getPageLinks";
import getSectionLinks from "@/app/lib/getSectionLinks";
import Sidebar from "@/app/ui/layout/sidebar/Sidebar";
import SubHeader from "@/app/ui/layout/subHeader/SubHeader";
import Wrapper from "@/app/ui/layout/wrapper/Wrapper";
import getSectionLinks from "@/app/lib/getSectionLinks";
import { SidebarProvider } from "@/context/sidebar/SidebarProvider";
import getPageLinks from "@/app/lib/getPageLinks";
import { allIcons } from "contentlayer/generated";
import { notFound, useSelectedLayoutSegment } from "next/navigation";
import type { ReactNode } from "react";

export default function TokenLayout({ children }: { children: ReactNode }) {
const selectedLayoutSegment = useSelectedLayoutSegment();
Expand All @@ -17,7 +17,7 @@ export default function TokenLayout({ children }: { children: ReactNode }) {
const pageContent = allIcons.find(icon => icon.slug === type && icon.section === section);

if (!pageContent) {
return null;
return notFound;
}

const sectionLinks = getSectionLinks(pageContent);
Expand Down
1 change: 1 addition & 0 deletions apps/docs/app/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ main {
.hd-content p a,
.hd-content li a {
text-decoration: underline;
color: var(--hd-color-accent-text)
}

/* reset the underline for the card */
Expand Down
10 changes: 8 additions & 2 deletions apps/docs/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
"use client";

import "./404.css";

export default function Custom404() {
return (
<main className="hd-wrapper">
<main className="hd-layout__wrapper hd-layout_404">
<article>
<h1>404 - Page Not Found</h1>
<h1 className="hd-404__title">Oops!</h1>
<h2 className="hd-404__subtitle">You hopped on the wrong side of the pond.</h2>
<a className="hd-404__button" href="/">Back to the shore</a>
</article>
</main>
);
Expand Down
Loading