Skip to content

Commit fc15f89

Browse files
authored
Merge 94d14a8 into 7382e79
2 parents 7382e79 + 94d14a8 commit fc15f89

20 files changed

Lines changed: 100 additions & 74 deletions

.changeset/major-stars-crash.md

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

.changeset/pink-months-lose.md

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

.changeset/renovate-59bdb95.md

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

.changeset/renovate-600505b.md

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

.changeset/renovate-eb2da5b.md

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

.changeset/renovate-ecf4e10.md

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

.changeset/sweet-hoops-pull.md

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

.changeset/wise-eels-crash.md

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

packages/form/CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# Change Log
22

3+
## 6.3.0
4+
5+
### Minor Changes
6+
7+
- [#6241](https://github.com/scaleway/ultraviolet/pull/6241) [`fa4a28f`](https://github.com/scaleway/ultraviolet/commit/fa4a28f296a97518c1ca9e5bb4674ee9017c3c68) Thanks [@lisalupi](https://github.com/lisalupi)! - Form element can have a `errorLabel` (string) to use as a custom value to display (instead of the label) when an error is displayed (empty required element, min/max value not respected, etc.).
8+
9+
For instance, this component:
10+
11+
```js
12+
<NumberInputField
13+
label="Choose number of elements"
14+
errorLabel="Amount"
15+
value={20}
16+
max={10}
17+
/>
18+
```
19+
20+
Used with this error:
21+
22+
```js
23+
import type { FormErrors } from '@ultraviolet/form'
24+
import { NumberInputField } from '@ultraviolet/form'
25+
26+
const errors: FormErrors = {
27+
...
28+
isInteger: ...
29+
max: ({ max, label }) => `${label} must be less than ${max}$`,
30+
min: ...
31+
...
32+
}
33+
```
34+
35+
The displayed `max` error message is `Amount must be less than 10` instead of `Choose number of elements must be less than 10`.
36+
37+
It allows custom error labels with a fallback on the `label` if `errorLabel` is not defined — this can be useful when creating a default `useError`.
38+
39+
### Patch Changes
40+
41+
- [#6311](https://github.com/scaleway/ultraviolet/pull/6311) [`282df87`](https://github.com/scaleway/ultraviolet/commit/282df8713c9e9ac7b95a6eed66409edcbc51e166) Thanks [@renovate](https://github.com/apps/renovate)! - Updated dependency `react-hook-form` to `7.72.1`.
42+
43+
- Updated dependencies [[`6ba736b`](https://github.com/scaleway/ultraviolet/commit/6ba736b54cf84b993f751651bacf366930009978), [`9cfb3e9`](https://github.com/scaleway/ultraviolet/commit/9cfb3e96a6bc786708056cfb6723581139295540), [`7382e79`](https://github.com/scaleway/ultraviolet/commit/7382e79418f0205bbe37c637d9e1487e00692494), [`1e4cc20`](https://github.com/scaleway/ultraviolet/commit/1e4cc208ea3605a249d7cc85cb7b242ca844aa0c)]:
44+
- @ultraviolet/ui@3.13.2
45+
- @ultraviolet/icons@5.3.2
46+
347
## 6.2.7
448

549
### Patch Changes

packages/form/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ultraviolet/form",
3-
"version": "6.2.7",
3+
"version": "6.3.0",
44
"description": "Ultraviolet Form",
55
"keywords": [
66
"react",

0 commit comments

Comments
 (0)