Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aba29e6

Browse files
authored
Merge branch 'master' into master
2 parents ddc2e23 + 2e86046 commit aba29e6

File tree

15 files changed

+1008
-816
lines changed

15 files changed

+1008
-816
lines changed

β€Žnext-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

β€Žpnpm-lock.yaml

Lines changed: 718 additions & 704 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpublic/images/twicsy.png

818 Bytes

β€Žsrc/components/Footer.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
padding: 40px 0;
33
font-size: 0.8rem;
44
font-weight: 400;
5-
margin-bottom: 60px;
65
text-align: center;
76
}
87

β€Žsrc/components/Menu/Menu.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ function Menu({ pages = [] }: { pages: Pages }) {
7070
)
7171
})}
7272
</ul>
73+
74+
<div id="carbon-cover" />
7375
</div>
7476
</aside>
7577
)

β€Žsrc/components/Menu/MenuLinks.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,14 @@ export const getStartedLinks: Pages = [
277277
name: "Integrating with global state",
278278
pathname: "#Integratingwithglobalstate",
279279
},
280-
{
281-
name: "Integrating with services",
282-
pathname: "#Integratingwithservices",
283-
},
284280
{
285281
name: "Handle errors",
286282
pathname: "#Handleerrors",
287283
},
284+
{
285+
name: "Integrating with services",
286+
pathname: "#Integratingwithservices",
287+
},
288288
{
289289
name: "Schema Validation",
290290
pathname: "#SchemaValidation",

β€Žsrc/components/layout.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,11 @@ table {
335335
border: 1px solid var(--color-light-grey);
336336
}
337337

338+
.scrollToTop,
339+
.editPage {
340+
display: none;
341+
}
342+
338343
.editPage:hover,
339344
.scrollToTop:hover {
340345
border-color: var(--color-secondary);
@@ -388,6 +393,11 @@ a.active {
388393
padding-left: 0;
389394
padding-right: 0;
390395
}
396+
397+
.scrollToTop,
398+
.editPage {
399+
display: block;
400+
}
391401
}
392402

393403
.editPage {
@@ -923,3 +933,11 @@ pre[class*="language-"] {
923933
height: auto;
924934
}
925935
}
936+
937+
#carbon-responsive {
938+
margin: 0 auto 50px;
939+
}
940+
941+
#carbon-cover {
942+
margin: 0 auto 50px;
943+
}

β€Žsrc/components/sponsorsList.module.css

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
.logoGroup {
3030
display: grid;
31-
grid-template-columns: repeat(3, 1fr);
32-
gap: 0.5rem;
31+
grid-template-columns: repeat(2, 1fr);
32+
gap: 1rem;
3333
margin: 0 1rem;
3434
}
3535

@@ -44,12 +44,16 @@
4444
padding: 0.5rem;
4545
}
4646

47+
.twicsy {
48+
border-radius: 50px;
49+
}
50+
4751
@media (min-width: 768px) {
4852
.logoGroup {
4953
display: grid;
50-
max-width: 500px;
54+
max-width: 600px;
5155
margin: 0 auto;
52-
grid-template-columns: repeat(3, 1fr);
53-
gap: 0.5rem;
56+
grid-template-columns: repeat(4, 1fr);
57+
gap: 1.5rem;
5458
}
5559
}

β€Žsrc/components/sponsorsList.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ export function SponsorsList() {
3333
alt="route4me"
3434
/>
3535
</a>
36+
<a
37+
href="https://twicsy.com/"
38+
target="_blank"
39+
rel="noopener noreferrer"
40+
>
41+
<img
42+
className={styles.twicsy}
43+
src="/images/twicsy.png"
44+
alt="twicsy"
45+
/>
46+
</a>
3647
</div>
3748
</div>
3849
)

β€Žsrc/content/docs/useform.mdx

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ sidebar: apiLinks
9292
| [delayError](#delayError) | Delay error from appearing instantly. |
9393
| [shouldUseNativeValidation](#shouldUseNativeValidation) | Use browser built-in form constraint API. |
9494
| [shouldUnregister](#shouldUnregister) | Enable and disable input unregister after unmount. |
95+
| [disabled](#disabled) | Disable the entire form with all associated inputs. |
9596

9697
**Schema validation props:**
9798

@@ -322,7 +323,7 @@ This config will enable [browser native validation](https://developer.mozilla.or
322323

323324
- Only works with `onSubmit` and `onChange` modes, as the `reportValidity` execution will focus the error input.
324325
- Each registered field's validation message is required to be string to display them natively.
325-
- This feature only works with the `register` API and`useController/Controller` that are connected with actual DOM references.
326+
- This feature only works with the `register` API and`useController/Controller` that are connected with actual DOM references.
326327

327328
**Examples:**
328329

@@ -352,6 +353,54 @@ export default function App() {
352353
}
353354
```
354355

356+
#### disabled: <TypeText>boolean = false</TypeText> {#disabled}
357+
358+
---
359+
360+
This config allows you to disable the entire form and all associated inputs when set to `true`.<br />
361+
This can be useful for preventing user interaction during asynchronous tasks or other
362+
situations where inputs should be temporarily unresponsive.
363+
364+
**Examples:**
365+
366+
---
367+
368+
```javascript copy
369+
import { useForm, Controller } from "react-hook-form"
370+
371+
const App = () => {
372+
const [disabled, setDisabled] = useState(false)
373+
const { register, handleSubmit, control } = useForm({
374+
disabled,
375+
})
376+
377+
return (
378+
<form
379+
onSubmit={handleSubmit(async () => {
380+
setDisabled(true)
381+
await sleep(100)
382+
setDisabled(false)
383+
})}
384+
>
385+
<input
386+
type={"checkbox"}
387+
{...register("checkbox")}
388+
data-testid={"checkbox"}
389+
/>
390+
<select {...register("select")} data-testid={"select"} />
391+
392+
<Controller
393+
control={control}
394+
render={({ field }) => <input disabled={field.disabled} />}
395+
name="test"
396+
/>
397+
398+
<button type="submit">Submit</button>
399+
</form>
400+
)
401+
}
402+
```
403+
355404
#### resolver: [Resolver](/ts#Resolver) {#resolver}
356405

357406
---

0 commit comments

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /