Skip to content

Commit 00943d5

Browse files
committed
feat(ui): add ui-components package
1 parent d4de2a6 commit 00943d5

File tree

183 files changed

+1309
-1539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+1309
-1539
lines changed

apps/site/.storybook/main.ts

-62
This file was deleted.

apps/site/.storybook/preview-head.html

-20
This file was deleted.

apps/site/.storybook/preview.tsx

-40
This file was deleted.

apps/site/app/[locale]/error.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ArrowRightIcon } from '@heroicons/react/24/solid';
44
import { useTranslations } from 'next-intl';
55
import type { FC } from 'react';
66

7-
import Button from '@/components/Common/Button';
7+
import WithButton from '@/components/withButton';
88
import GlowingBackdropLayout from '@/layouts/GlowingBackdrop';
99

1010
const ErrorPage: FC<{ error: Error }> = () => {
@@ -19,10 +19,10 @@ const ErrorPage: FC<{ error: Error }> = () => {
1919
<p className="-mt-4 max-w-sm text-center text-lg">
2020
{t('layouts.error.internalServerError.description')}
2121
</p>
22-
<Button href="/">
22+
<WithButton href="/">
2323
{t('layouts.error.backToHome')}
2424
<ArrowRightIcon />
25-
</Button>
25+
</WithButton>
2626
</GlowingBackdropLayout>
2727
);
2828
};

apps/site/app/[locale]/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { availableLocalesMap, defaultLocale } from '@/next.locales.mjs';
1010
import { LocaleProvider } from '@/providers/localeProvider';
1111
import { ThemeProvider } from '@/providers/themeProvider';
1212

13-
import '@/styles/index.css';
13+
import '@node-core/ui-components/styles/index.css';
1414

1515
const fontClasses = classNames(IBM_PLEX_MONO.variable, OPEN_SANS.variable);
1616

apps/site/app/[locale]/not-found.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Image from 'next/image';
55
import { useTranslations } from 'next-intl';
66
import type { FC } from 'react';
77

8-
import Button from '@/components/Common/Button';
8+
import WithButton from '@/components/withButton';
99
import GlowingBackdropLayout from '@/layouts/GlowingBackdrop';
1010

1111
const NotFoundPage: FC = () => {
@@ -30,10 +30,10 @@ const NotFoundPage: FC = () => {
3030
<p className="-mt-4 max-w-sm text-center text-lg">
3131
{t('layouts.error.notFound.description')}
3232
</p>
33-
<Button href="/">
33+
<WithButton href="/">
3434
{t('layouts.error.backToHome')}
3535
<ArrowRightIcon />
36-
</Button>
36+
</WithButton>
3737
</GlowingBackdropLayout>
3838
);
3939
};

apps/site/app/global-error.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { ArrowRightIcon } from '@heroicons/react/24/solid';
44
import type { FC } from 'react';
55

6-
import Button from '@/components/Common/Button';
6+
import WithButton from '@/components/withButton';
77
import BaseLayout from '@/layouts/Base';
88
import GlowingBackdropLayout from '@/layouts/GlowingBackdrop';
99

@@ -17,10 +17,10 @@ const GlobalErrorPage: FC<{ error: Error }> = () => (
1717
<p className="-mt-4 max-w-sm text-center text-lg">
1818
This page has thrown a non-recoverable error.
1919
</p>
20-
<Button href="/">
20+
<WithButton href="/">
2121
Back to Home
2222
<ArrowRightIcon />
23-
</Button>
23+
</WithButton>
2424
</GlowingBackdropLayout>
2525
</BaseLayout>
2626
</body>

apps/site/components/Common/AvatarGroup/Avatar/index.tsx

-53
This file was deleted.

apps/site/components/Common/AvatarGroup/Overlay/index.stories.tsx

-21
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ArrowUpRightIcon } from '@heroicons/react/24/outline';
2+
import type { BannerProps } from '@node-core/ui-components/Common/Banner';
3+
import Banner from '@node-core/ui-components/Common/Banner';
4+
import type { FC, PropsWithChildren } from 'react';
5+
6+
import Link from '@/components/Link';
7+
8+
type BannerWithLinkProps = BannerProps & {
9+
link: string;
10+
};
11+
12+
const BannerWithLink: FC<PropsWithChildren<BannerWithLinkProps>> = ({
13+
type = 'default',
14+
link,
15+
children,
16+
}) => (
17+
<Banner type={type}>
18+
{link ? <Link href={link}>{children}</Link> : children}
19+
{link && <ArrowUpRightIcon />}
20+
</Banner>
21+
);
22+
23+
export default BannerWithLink;

apps/site/components/Common/BlogPostCard/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import Preview from '@node-core/ui-components/Common/Preview';
12
import { useTranslations } from 'next-intl';
23
import type { FC } from 'react';
34

45
import FormattedTime from '@/components/Common/FormattedTime';
5-
import Preview from '@/components/Common/Preview';
66
import Link from '@/components/Link';
77
import WithAvatarGroup from '@/components/withAvatarGroup';
88
import { mapBlogCategoryToPreviewType } from '@/util/blogUtils';

apps/site/components/Common/Button/index.tsx

-70
This file was deleted.

0 commit comments

Comments
 (0)