@@ -60,13 +60,14 @@ See [API](#api) for all available options.
6060 Make sure your inputs fit their container, especially on small screens.
6161
6262- In the background, InputGroup uses the [ ` fieldset ` ] [ fieldset ] element. Not
63- only it improves the [ accessibility] of the group, it also allows you to make
64- use of its built-in features like disabling all nested inputs or pairing the
65- group with a form outside. Consult [ the MDN docs] [ fieldset ] to learn more.
63+ only does it improve the [ accessibility] of the group, it also allows you to
64+ make use of its built-in features like disabling all nested inputs or pairing
65+ the group with a form outside. Consult [ the MDN docs] [ fieldset ] to learn more.
6666
6767- InputGroup currently ** supports grouping of**
6868 [ TextField] ( /components/TextField ) , [ SelectField] ( /components/SelectField ) ,
69- and [ Button] ( /components/Button ) components.
69+ [ FileInputField] ( /components/FileInputField ) , and [ Button] ( /components/Button )
70+ components.
7071
7172- To group [ Buttons] ( /components/Button ) only, use the
7273 [ ButtonGroup] ( /components/ButtonGroup ) component which is designed
@@ -104,7 +105,7 @@ You can set the `size` property directly on InputGroup to be shared for all
104105fields and buttons inside the group. This property is then passed over to
105106individual elements. At the same time, it ** cannot be overridden** on the
106107fields' or buttons' level. While technically possible, from the design point of
107- view it's undesirable to group elements of totally different types or sizes.
108+ view, it's undesirable to group elements of totally different types or sizes.
108109
109110## Invisible Label
110111
@@ -136,9 +137,9 @@ the input.
136137
137138## Horizontal layout
138139
139- The default vertical layout is very easy to use and work with. However, there
140- are situations where horizontal layout suits better — and that's why React UI
141- supports this kind of layout as well.
140+ The default vertical layout is straightforward to use and work with. However,
141+ there are situations where horizontal layout suits better — and that's why
142+ React UI supports this kind of layout as well.
142143
143144``` docoff-react-preview
144145<InputGroup
@@ -150,6 +151,57 @@ supports this kind of layout as well.
150151</InputGroup>
151152```
152153
154+ ## Help Text
155+
156+ You may provide one or more additional help texts to clarify how the input group
157+ should be filled.
158+
159+ These messages are not semantically tied to the ` children ` elements, the
160+ connection should be expressed in textual form in the actual message.
161+
162+ ⚠️ Help texts passed to input elements' ` helpText ` prop are ignored within
163+ InputGroup.
164+
165+ ``` docoff-react-preview
166+ React.createElement(() => {
167+ const [fruit, setFruit] = React.useState('apple');
168+ const options = [
169+ {
170+ label: 'Apple',
171+ value: 'apple',
172+ },
173+ {
174+ label: 'Pear',
175+ value: 'pear',
176+ },
177+ {
178+ label: 'Cherry',
179+ value: 'cherry',
180+ },
181+ ];
182+ return (
183+ <InputGroup
184+ label="Your favourite fruit"
185+ helpTexts={[
186+ "Choose one or more kinds of fruit to feel happy.",
187+ ]}
188+ >
189+ <SelectField
190+ label="Your favourite fruit"
191+ onChange={(e) => setFruit(e.target.value)}
192+ options={options}
193+ value={fruit}
194+ />
195+ <TextField
196+ label="Variety"
197+ placeholder="Eg. Golden delicious"
198+ />
199+ <Button label="Submit" />
200+ </InputGroup>
201+ );
202+ })
203+ ```
204+
153205## States
154206
155207### Disabled State
@@ -169,12 +221,15 @@ Validation states visually present the result of validation of the grouped
169221inputs. Input group's validation state is taken from its child inputs. You
170222should always ** provide validation messages for states other than valid**
171223directly through ` validationTexts ` prop so users know what happened and what
172- action they should take or what options they have. These messages are not
173- semantically tied to the ` children ` elements, the connection should be expressed
174- in textual form in the actual message. The individual ` children ` elements must
175- not show any ` validationText ` , they only show their respective ` validationState ` .
176- Validation messages passed to input elements' ` validationText ` prop will be
177- ignored.
224+ action they should take or what options they have.
225+
226+ These messages are not semantically tied to the ` children ` elements, the
227+ connection should be expressed in textual form in the actual message. The
228+ individual ` children ` elements must not show any ` validationText ` , they only
229+ show their respective ` validationState ` .
230+
231+ ⚠️ Validation messages passed to input elements' ` validationText ` prop are
232+ ignored within InputGroup.
178233
179234👉 While there is a ` required ` property to visually denote the whole input group
180235is required, there is no functional effect as there is no such HTML attribute
0 commit comments