Skip to content

Commit

Permalink
feat: init docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdevnull committed May 19, 2024
1 parent 609af23 commit e0e0adb
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 30 deletions.
7 changes: 4 additions & 3 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"dev": "tsup src --watch"
},
"peerDependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"@internationalized/date": "^3.5.3",
Expand All @@ -46,7 +46,8 @@
"@react-types/datepicker": "^3.7.3",
"@react-types/dialog": "^3.5.9",
"@react-types/shared": "^3.23.0",
"@types/react": "18.0.15"
"@types/react": "18.2.0",
"@types/react-dom": "18.2.0"
},
"sideEffects": false,
"repository": {
Expand Down
20 changes: 20 additions & 0 deletions lib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react",
"noEmit": true,
"baseUrl": "."
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "dist"]
}
31 changes: 16 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion website/src/app/(home)/components/NpmBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useCopy } from '@/hooks/useCopy';
const NpmBox = () => {
const [isCopied, copy] = useCopy();
return (
<div className="gradient-border-gradient-nav gradient-border-DEFAULT bg-background relative flex min-h-14 flex-nowrap items-center gap-6 rounded-2xl px-4 lg:gap-24">
<div className="gradient-border-gradient-nav gradient-border-DEFAULT bg-background relative flex min-h-14 w-full max-w-[410px] flex-nowrap items-center justify-between gap-6 rounded-2xl px-4 lg:gap-24">
<div className="flex flex-nowrap items-center gap-2 text-xs md:text-base lg:gap-4">
<span className="text-secondary ">$</span>npm install react-calendar-kit
</div>
Expand Down
20 changes: 15 additions & 5 deletions website/src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import Image from 'next/image';
import Link from 'next/link';
import { Icons } from '@/assets/icons';

import { Button } from '@/components/ui/button';
Expand Down Expand Up @@ -57,11 +58,20 @@ const HomePage = () => {
<div className={subtitle({ className: 'text-center' })}>Accessible and Customizable Calendar Components</div>

<HStack noWrap={{ initial: false, sm: true }}>
<Button>Documents</Button>
<Button variant="secondary">
<Icons.github />
Github
</Button>
<Link className="w-full" href="/getting-started">
<Button>Documents</Button>
</Link>
<Link
className="w-full"
href="http://github.com/react-calendar-kit/react-calendar-kit"
target="_blank"
rel="noopener noreferrer"
>
<Button variant="secondary">
<Icons.github />
Github
</Button>
</Link>
</HStack>

<NpmBox />
Expand Down
38 changes: 38 additions & 0 deletions website/src/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"getting-started": {
"title": "Getting Started",
"href": "/getting-started"
},
"-- API": {
"type": "separator",
"title": "API"
},
"Calendar": {
"title": "Calendar",
"href": "/calendar"
},
"DateInput": {
"title": "DateInput",
"href": "/date-input"
},
"TimeInput": {
"title": "timeInput",
"href": "/time-input"
},
"DatePicker": {
"title": "DatePicker",
"href": "/date-picker"
},
"DateRangePicker": {
"title": "DateRangePicker",
"href": "/date-range-picker"
},
"-- More": {
"type": "separator",
"title": "Guides"
},
"styling": {
"title": "Styling",
"href": "/styling"
}
}
48 changes: 48 additions & 0 deletions website/src/pages/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Card, Cards, Steps, Tab, Tabs } from 'nextra-theme-docs';

# Getting Started

React Calendar Kit is a powerful and flexible library for building accessible and highly customizable calendar and date/time picker components in your React applications. Built on top of the robust accessibility features of the [@react-aria](https://react-spectrum.adobe.com/react-aria/index.html) library, React Calendar Kit provides a solid foundation for creating inclusive user experiences.

<Steps>
### Install

<Tabs items={['pnpm', 'npm', 'yarn', 'bun']}>
<Tab>
```bash
pnpm i react-calendar-kit
```

</Tab>
<Tab>
```bash
npm i react-calendar-kit
```
</Tab>
<Tab>
```bash
yarn add react-calendar-kit
```
</Tab>
<Tab>
```bash
bun add react-calendar-kit
```
</Tab>
</Tabs>

### Add Calendar to your app

It can be placed anywhere, even in server components such as `layout.tsx`.

```tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
```

</Steps>
25 changes: 19 additions & 6 deletions website/theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@ import React from 'react';
import { type DocsThemeConfig } from 'nextra-theme-docs';

const config: DocsThemeConfig = {
logo: <span>My Project</span>,
logo: <span>React Calendar Kit</span>,
project: {
link: 'https://github.com/shuding/nextra-docs-template',
link: 'https://github.com/HoangDevNull/react-calendar-kit',
},
chat: {
link: 'https://discord.com',
docsRepositoryBase: 'https://github.com/HoangDevNull/react-calendar-kit/tree/main/website',
useNextSeoProps() {
return {
titleTemplate: '%s – Sonner',
};
},
feedback: {
content: null,
},
docsRepositoryBase: 'https://github.com/shuding/nextra-docs-template',
footer: {
text: 'Nextra Docs Template',
text: (
<span>
MIT {new Date().getFullYear()} ©{' '}
<a href="https://github.com/HoangDevNull" target="_blank">
HoangDevNull
</a>
.
</span>
),
},
};

Expand Down

0 comments on commit e0e0adb

Please sign in to comment.