Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
229bdef
Fix typo in npm install command. (#977)
fahadsohail482 Jun 16, 2023
8562068
Adding more docs and new components (#976)
aranlucas Jun 18, 2023
e20af4c
fix provider page and use color var
bluebill1049 Jun 18, 2023
ab5d92d
update with Form component at get started
bluebill1049 Jun 20, 2023
6fdadc2
update doc on resetField and dirty check (#980)
bluebill1049 Jun 21, 2023
30e71c2
improve table list style
bluebill1049 Jun 21, 2023
c17e061
move to the last
bluebill1049 Jun 21, 2023
75a41ea
fix: make start script reference dev script (#982)
Adrastopoulos Jun 23, 2023
6fa9229
fix: add space in reset section (#981)
Adrastopoulos Jun 25, 2023
de9a786
Upgrading RHF dependencies + Adding content layer (#978)
aranlucas Jun 26, 2023
81629d5
fix: devtools dependency stripped out in prod (#986)
aranlucas Jun 26, 2023
6665cb2
feat: adding formprovider, getvalues, seterror, trigger, errormessage…
aranlucas Jun 26, 2023
fba3e11
Fix: typo in alert (#988)
santhosh-c1 Jun 27, 2023
a99625e
fix #987
bluebill1049 Jun 29, 2023
ebc4c4d
fix #989
bluebill1049 Jun 29, 2023
8510f43
close #984
bluebill1049 Jun 29, 2023
d2fb101
feat: adding form and getFieldState to mdx (#991)
aranlucas Jul 13, 2023
028b083
refactor in useForm page (#997)
fahadsohail482 Jul 13, 2023
d8cbfe7
fix: update typo in get started example (#1000)
tomavanc Jul 16, 2023
981913b
added typescript for watch in field and removed some error in code an…
lordvader501 Jul 16, 2023
e7cdd0f
Fix typo in form.mdx (#1002)
tsabolov Jul 18, 2023
a884730
fix: Fix some incorrect linked URLs (#1005)
roottool Jul 21, 2023
a396710
fix: correct useForm defaultValues type in documentation (#1006)
martinnester Jul 26, 2023
98efa1d
Remove unnecessary optional chaining (#903)
frontendlane Aug 5, 2023
a189b26
Fixed Hover state missing (#983) (#1008)
Devanshi-Crypto Aug 12, 2023
b4bb856
defaultValues - link to legacy React docs*(issue#993) - updated link …
lordvader501 Aug 12, 2023
a47d32b
update footer
bluebill1049 Aug 17, 2023
b40f476
remove unnecessary semicolon
fahadsohail482 Aug 18, 2023
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
3 changes: 0 additions & 3 deletions .browserslistrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ module.exports = {
"react/jsx-curly-brace-presence": "warn",
// jsx-ally
"jsx-a11y/no-onchange": WARN,
"import/no-anonymous-default-export": OFF,
},
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ yarn-error.log*
package-lock.json
.vscode
tsconfig.tsbuildinfo
.next/
.next/

# contentlayer
.contentlayer
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
15 changes: 0 additions & 15 deletions .lighthouserc.js

This file was deleted.

54 changes: 54 additions & 0 deletions contentlayer.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { defineDocumentType, makeSource } from "contentlayer/source-files"
import { remarkHeadingId } from "remark-custom-heading-id"
import remarkGfm from "remark-gfm"
import rehypeMdxCodeProps from "rehype-mdx-code-props"
import emoji from "remark-emoji"
import * as sidebar from "./src/components/Menu/MenuLinks"

export const Doc = defineDocumentType(() => ({
name: "Doc",
contentType: "mdx",
filePathPattern: "**/*.mdx",
fields: {
title: { type: "string", required: true },
description: { type: "string", required: true },
sidebar: {
type: "enum",
options: [
"apiLinks",
"advancedLinks",
"tsLinks",
"faqLinks",
"getStartedLinks",
],
required: true,
},
},
computedFields: {
slug: {
type: "string",
resolve: (doc) => `/${doc._raw.flattenedPath}`,
},
slugAsParams: {
type: "string",
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/"),
},
segment: {
type: "list",
resolve: (doc) => doc._raw.flattenedPath.split("/"),
},
pages: {
type: "list",
resolve: (doc) => sidebar[doc.sidebar] ?? [],
},
},
}))

export default makeSource({
contentDirPath: "src/content",
documentTypes: [Doc],
mdx: {
remarkPlugins: [remarkGfm, remarkHeadingId, emoji],
rehypePlugins: [rehypeMdxCodeProps],
},
})
19 changes: 2 additions & 17 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import withMDX from "@next/mdx"
import { remarkHeadingId } from "remark-custom-heading-id"
import remarkGfm from "remark-gfm"
import rehypeMdxCodeProps from "rehype-mdx-code-props"
import emoji from "remark-emoji"

import { withContentlayer } from "next-contentlayer"
import withBundleAnalyzer from "@next/bundle-analyzer"

/** @type {import('next').NextConfig} */
Expand All @@ -19,14 +14,4 @@ const bundleAnalyzer = withBundleAnalyzer({
enabled: process.env.ANALYZE === "true",
})

export default bundleAnalyzer(
withMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm, remarkHeadingId, emoji],
rehypePlugins: [rehypeMdxCodeProps],
// If you use `MDXProvider`, uncomment the following line.
providerImportSource: "@mdx-js/react",
},
})(nextConfig)
)
export default bundleAnalyzer(withContentlayer(nextConfig))
50 changes: 24 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,50 @@
"version": "6.0.1",
"author": "beier luo",
"dependencies": {
"@hookform/devtools": "2.0.0-beta.1",
"@hookform/devtools": "4.3.1",
"@mdx-js/loader": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@next/mdx": "^13.4.4",
"@types/node": "^20.2.5",
"@next/mdx": "^13.4.5",
"@types/node": "^20.3.1",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
"contentlayer": "^0.3.3",
"date-fns": "^2.30.0",
"little-state-machine": "^4.8.0",
"next": "^13.4.4",
"next": "^13.4.5",
"next-contentlayer": "^0.3.3",
"next-themes": "^0.2.1",
"prism-react-renderer": "^2.0.4",
"prism-react-renderer": "^2.0.5",
"prismjs": "^1.29.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-github-btn": "1.4.0",
"react-helmet": "6.1.0",
"react-hook-form": "6.0.0",
"react-hook-form": "7.44.3",
"react-simple-animate": "^3.5.2",
"react-simple-img": "3.0.0",
"react-sortablejs": "1.5.1",
"react-syntax-highlighter": "^15.5.0",
"rehype-mdx-code-props": "^1.0.0",
"remark-custom-heading-id": "^1.0.1",
"remark-emoji": "^3.1.1",
"remark-emoji": "^3.1.2",
"remark-gfm": "^3.0.1",
"sortablejs": "1.15.0"
},
"devDependencies": {
"@next/bundle-analyzer": "^13.4.4",
"@next/bundle-analyzer": "^13.4.5",
"@types/react-helmet": "^6.1.6",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"cross-env": "^7.0.3",
"eslint": "^8.41.0",
"eslint-config-next": "^13.4.4",
"eslint": "^8.42.0",
"eslint-config-next": "^13.4.5",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^4.3.8",
"lint-staged": "^10.5.4",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"prettier": "^2.8.8",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"keywords": [
"react-hook-form",
Expand All @@ -56,19 +58,15 @@
"analyze": "cross-env ANALYZE=true next build",
"build": "next build",
"dev": "next dev",
"format": "prettier --write \"src/**/*.{ts,tsx,mdx}\"",
"format": "prettier --write",
"lint": "next lint --fix",
"now-build": "npm run build",
"start": "npm run develop",
"typecheck": "tsc --noEmit"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"start": "next start",
"typecheck": "tsc --noEmit",
"prepare": "husky install"
},
"lint-staged": {
"*.{ts,tsx,mdx}": [
"*.{ts,tsx,mdx,css,json}": [
"npm run format"
]
}
Expand Down
14 changes: 0 additions & 14 deletions src/actions/settingActions.ts

This file was deleted.

59 changes: 59 additions & 0 deletions src/components/Admonition.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.admonition {
margin-top: 1rem;
margin-bottom: 1em;
padding: 15px 30px 15px 15px;
border-radius: 0.4rem;
}

.admonitionIcon {
display: inline-block;
vertical-align: middle;
margin-right: 0.2em;
}

.admonitionIcon svg {
display: inline-block;
width: 22px;
height: 22px;
stroke-width: 0;
}

.admonitionIcon svg {
stroke: rgb(253, 253, 254);
fill: rgb(253, 253, 254);
}

.admonitionContent > :last-child {
margin-bottom: 0;
}

/** Customization */
.admonitionWarning {
background-color: rgba(230, 126, 34, 0.1);
border-left: 8px solid var(--color-orange);
}

.admonitionTip {
background-color: rgba(46, 204, 113, 0.1);
border-left: 8px solid var(--color-green);
}

.admonitionCaution {
background-color: rgba(231, 76, 60, 0.1);
border-left: 8px solid var(--color-secondary);
}

.admonitionImportant {
background-color: rgb(25, 60, 71, 0.1);
border-left: 8px solid var(--color-blue);
}

.admonitionNote {
background-color: rgb(71, 71, 72, 0.1);
border-left: 8px solid var(--color-text);
}

.admonitionQuestion {
background-color: rgba(8, 61, 119, 0.1);
border-left: 8px solid var(--color-light-blue);
}
Loading