@simplybusiness/mobius 3.1.3 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file, or link in
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.2.0] - 2023-01-04
9
+
10
+ ### Changed
11
+
12
+ - Allow providing a `ReactNode` as the `errorMessage` prop for `Question`
13
+
14
+ ### Fixed
15
+
16
+ - Fixed typo in `<Chopin.Actions />` docs
17
+
8
18
  ## [3.1.3] - 2022-12-19
9
19
 
10
20
  ### Fixed
@@ -121,6 +131,7 @@ Additionally, mobius and themes are available on the public NPM registry and can
121
131
 
122
132
  ## Github Links
123
133
 
134
+ [3.2.0]: https://github.com/simplybusiness/mobius/releases/tag/v3.2.0
124
135
  [3.1.3]: https://github.com/simplybusiness/mobius/releases/tag/v3.1.3
125
136
  [3.1.2]: https://github.com/simplybusiness/mobius/releases/tag/v3.1.2
126
137
  [3.1.1]: https://github.com/simplybusiness/mobius/releases/tag/v3.1.1
@@ -2,7 +2,7 @@ import { ReactNode, ReactElement } from "react";
2
2
  export interface QuestionProps {
3
3
  label?: ReactElement | string;
4
4
  description?: string | ReactNode;
5
- errorMessage?: string;
5
+ errorMessage?: ReactNode;
6
6
  children?: ReactNode;
7
7
  validationState?: "valid" | "invalid" | "";
8
8
  help?: ReactNode;
package/dist/mobius.d.ts CHANGED
@@ -813,7 +813,7 @@ declare type QuestionGroupRef = Ref<QuestionGroupElementType>;
813
813
  declare interface QuestionProps {
814
814
  label?: ReactElement | string;
815
815
  description?: string | ReactNode;
816
- errorMessage?: string;
816
+ errorMessage?: ReactNode;
817
817
  children?: ReactNode;
818
818
  validationState?: "valid" | "invalid" | "";
819
819
  help?: ReactNode;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simplybusiness/mobius",
3
3
  "license": "UNLICENSED",
4
- "version": "3.1.3",
4
+ "version": "3.2.0",
5
5
  "description": "Core library of Mobius react components",
6
6
  "repository": {
7
7
  "type": "git",
@@ -55,9 +55,9 @@ import { Chopin } from "@simplybusiness/mobius";
55
55
 
56
56
  <Chopin.Actions
57
57
  backLabel="Back"
58
- backButton={ href: "https://www.google.com" }
58
+ backButton={{ href: "https://www.google.com" }}
59
59
  nextLabel="Next Step"
60
- nextButton={ href: "https://www.google.com" }
60
+ nextButton={{ href: "https://www.google.com" }}
61
61
  />
62
62
  ```
63
63
 
@@ -84,7 +84,7 @@ import { Chopin } from "@simplybusiness/mobius";
84
84
 
85
85
  <Chopin.Actions
86
86
  nextLabel="Next Step"
87
- nextButton={ href: "https://www.google.com" }
87
+ nextButton={{ href: "https://www.google.com" }}
88
88
  />
89
89
  ```
90
90
 
@@ -111,10 +111,10 @@ import { Chopin } from "@simplybusiness/mobius";
111
111
 
112
112
  <Chopin.Actions
113
113
  backLabel="Back"
114
- backButton={
114
+ backButton={{
115
115
  href: "https://www.google.com",
116
116
  isDisabled: false,
117
- }
117
+ }}
118
118
  />
119
119
  ```
120
120
 
@@ -152,15 +152,15 @@ import { Chopin } from "@simplybusiness/mobius";
152
152
 
153
153
  <Chopin.Actions
154
154
  backLabel="Back"
155
- backButton={
155
+ backButton={{
156
156
  href: "https://www.google.com",
157
157
  isDisabled: false,
158
- }
158
+ }}
159
159
  nextLabel="Next Step"
160
- nextButton={
160
+ nextButton={{
161
161
  href: "https://www.google.com",
162
162
  isDisabled: true,
163
- }
163
+ }}
164
164
  />
165
165
  ```
166
166
 
@@ -343,6 +343,19 @@ import { Chopin } from "@simplybusiness/mobius";
343
343
  {args => <Question {...args} />}
344
344
  </Story>
345
345
 
346
+ <Story
347
+ name="With Rich Error"
348
+ args={{
349
+ label: "Question label",
350
+ children: <TextField />,
351
+ errorMessage: <>This <em>contains</em> <strong>HTML</strong> <u>formatting</u></>,
352
+ validationState: "invalid",
353
+ closeHelpOnOutsideClick: false,
354
+ }}
355
+ >
356
+ {args => <Question {...args} />}
357
+ </Story>
358
+
346
359
  <!-- prettier-ignore -->
347
360
  ```jsx
348
361
  import { Chopin } from "@simplybusiness/mobius";
@@ -16,7 +16,7 @@ import { QuestionHelp } from "../QuestionHelp/QuestionHelp";
16
16
  export interface QuestionProps {
17
17
  label?: ReactElement | string;
18
18
  description?: string | ReactNode;
19
- errorMessage?: string;
19
+ errorMessage?: ReactNode;
20
20
  children?: ReactNode;
21
21
  validationState?: "valid" | "invalid" | "";
22
22
  help?: ReactNode;