Skip to content

Commit 2466177

Browse files
committed
chore: review icons & description
1 parent 011a060 commit 2466177

File tree

10 files changed

+68
-78
lines changed

10 files changed

+68
-78
lines changed
File renamed without changes.

apps/docs/src/app/layout.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
import "nextra-theme-docs/style.css";
2+
import "./globals.css";
3+
14
import { type NextraMetadata } from "nextra";
25
import { Layout, Navbar, ThemeSwitch } from "nextra-theme-docs";
36
import { Head, Search } from "nextra/components";
47
import { getPageMap } from "nextra/page-map";
58

6-
import "nextra-theme-docs/style.css";
7-
import "../globals.css";
8-
9+
import { UIKitLogo } from "../assets/logos";
910
import { Footer } from "../components/Footer";
10-
import { ThemeSwitcher } from "../components/home/ThemeSwitcher";
11-
import { UIKitLogo } from "../components/logo/uikit";
1211
import { Main } from "../components/Main";
12+
import { ThemeSwitcher } from "../components/ThemeSwitcher";
1313

1414
const title = "UI Kit";
1515
const description = "UI Kit documentation site";

apps/docs/src/assets/logos.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
export const UIKitLogo = () => (
2+
<svg width="100" viewBox="0 0 439 160" fill="light-dark(#333, #fff)">
3+
<title>UI Kit Logo</title>
4+
<path d="M0 12C0 5.37258 5.37258 0 12 0H165C171.627 0 177 5.37258 177 12V148C177 154.627 171.627 160 165 160H12C5.37258 160 0 154.627 0 148V12Z" />
5+
<path
6+
d="M82.2727 39.7273H105.966V95.6364C105.966 102.284 104.375 108.037 101.193 112.895C98.0398 117.724 93.6364 121.46 87.983 124.102C82.3295 126.716 75.767 128.023 68.2955 128.023C60.767 128.023 54.1761 126.716 48.5227 124.102C42.8693 121.46 38.4659 117.724 35.3125 112.895C32.1875 108.037 30.625 102.284 30.625 95.6364V39.7273H54.3182V93.5909C54.3182 96.2898 54.9148 98.7045 56.108 100.835C57.3011 102.937 58.9489 104.585 61.0511 105.778C63.1818 106.972 65.5966 107.568 68.2955 107.568C71.0227 107.568 73.4375 106.972 75.5398 105.778C77.642 104.585 79.2898 102.937 80.483 100.835C81.6761 98.7045 82.2727 96.2898 82.2727 93.5909V39.7273ZM140.92 39.7273V127H117.227V39.7273H140.92Z"
7+
fill="light-dark(#fff, #333)"
8+
/>
9+
<path d="M214.608 127V39.7273H230.418V79.8267H231.483L265.531 39.7273H284.835L251.085 78.8892L285.134 127H266.128L240.091 89.5852L230.418 101.006V127H214.608ZM311.629 39.7273V127H295.819V39.7273H311.629ZM324.913 52.9801V39.7273H394.544V52.9801H367.57V127H351.888V52.9801H324.913Z" />
10+
</svg>
11+
);
12+
13+
export const GitHubLogo = () => (
14+
<svg
15+
width="1em"
16+
height="1em"
17+
viewBox="0 0 16 16"
18+
fill="light-dark(#000, #fff)"
19+
>
20+
<title>GitHub Logo</title>
21+
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" />
22+
</svg>
23+
);
24+
25+
export const NpmLogo = () => (
26+
<svg width="1em" height="1em" viewBox="0 0 256 256">
27+
<title>NPM Logo</title>
28+
<path d="M0 256V0h256v256z" fill="#C12127" />
29+
<path d="M48 48h160v160h-32V80h-48v128H48z" fill="#FFF" />
30+
</svg>
31+
);

apps/docs/src/components/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Link from "next/link";
22

3-
import { UIKitLogo } from "./logo/uikit";
3+
import { UIKitLogo } from "../assets/logos";
44

55
const footerLinks = [
66
{

apps/docs/src/components/home/ThemeSwitcher.tsx renamed to apps/docs/src/components/ThemeSwitcher.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { usePathname } from "next/navigation";
44
import { HvSelect } from "@hitachivantara/uikit-react-core";
55

6-
import { useDocsTheme } from "../../hooks/useDocsTheme";
6+
import { useDocsTheme } from "../hooks/useDocsTheme";
77

88
const themes = [
99
{ value: "pentahoPlus", label: "Pentaho+" },

apps/docs/src/components/logo/gh.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

apps/docs/src/components/logo/npm.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

apps/docs/src/components/logo/storybook.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

apps/docs/src/components/logo/uikit.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
"use client";
22

33
import ReactMarkdown from "react-markdown";
4-
import { ArrowUpRight } from "@phosphor-icons/react";
54
import { HvTypography } from "@hitachivantara/uikit-react-core";
65

7-
import { ComponentMeta } from "../../utils/component";
8-
import { GitHubLogo } from "../logo/gh";
9-
import { NpmLogo } from "../logo/npm";
6+
import { GitHubLogo, NpmLogo } from "../../assets/logos";
7+
import type { ComponentMeta } from "../../utils/component";
108
import { AlignmentBadge } from "./AlignmentBadge";
119

1210
/**
1311
* The `Description` component displays metadata information
1412
* about the current component, including its name, description,
1513
* GitHub source link, and NPM package link.
1614
*/
17-
export const Description = ({ meta }: { meta: ComponentMeta }) => {
15+
export function Description({ meta }: { meta: ComponentMeta }) {
16+
const links = [
17+
{ logo: <GitHubLogo />, label: "Source Code", href: meta.source },
18+
{
19+
logo: <NpmLogo />,
20+
label: `uikit-react-${meta.package}`,
21+
href: `https://npm.im/@hitachivantara/uikit-react-${meta.package}`,
22+
},
23+
];
24+
1825
return (
1926
<>
20-
<div className="flex flex-row gap-xs items-center">
27+
<div className="flex gap-1 items-center">
2128
<HvTypography variant="title1">{meta.component}</HvTypography>
2229
<AlignmentBadge component={meta.component} />
2330
</div>
2431
<ReactMarkdown className="markdown">
2532
{meta.docgen?.description}
2633
</ReactMarkdown>
27-
<div className="flex flex-row gap-md mt-md">
28-
<div className="flex flex-row gap-xs items-center">
29-
<GitHubLogo />
30-
<HvTypography link component="a" href={meta.source} target="_blank">
31-
Source Code
32-
</HvTypography>
33-
<ArrowUpRight />
34-
</div>
35-
<div className="flex flex-row gap-xs items-center">
36-
<NpmLogo />
37-
<HvTypography
38-
link
39-
component="a"
40-
target="_blank"
41-
href={`https://www.npmjs.com/package/@hitachivantara/uikit-react-${meta.package}`}
42-
>
43-
{`uikit-react-${meta.package}`}
44-
</HvTypography>
45-
<ArrowUpRight />
46-
</div>
34+
<div className="flex gap-sm mt-sm">
35+
{links.map(({ logo, label, href }, i) => (
36+
<div key={i} className="flex gap-xs items-center">
37+
{logo}
38+
<HvTypography
39+
link
40+
component="a"
41+
href={href}
42+
target="_blank"
43+
className="flex items-center"
44+
>
45+
{label}
46+
<div className="i-ph-arrow-up-right" />
47+
</HvTypography>
48+
</div>
49+
))}
4750
</div>
4851
</>
4952
);
50-
};
53+
}

0 commit comments

Comments
 (0)