@entur/form 6.1.0 → 7.0.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/dist/form.cjs.development.js +171 -86
- package/dist/form.cjs.development.js.map +1 -1
- package/dist/form.cjs.production.min.js +1 -1
- package/dist/form.cjs.production.min.js.map +1 -1
- package/dist/form.esm.js +173 -89
- package/dist/form.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/inputPanel/CheckboxPanel.d.ts +30 -0
- package/dist/inputPanel/InputPanelBase.d.ts +33 -0
- package/dist/{RadioPanel.d.ts → inputPanel/RadioPanel.d.ts} +9 -10
- package/dist/inputPanel/index.d.ts +2 -0
- package/dist/styles.css +515 -490
- package/package.json +5 -5
package/dist/form.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useRandomId, useOnMount, warnAboutMissingStyles } from '@entur/utils';
|
|
1
|
+
import { mergeRefs, useRandomId, useForceUpdate, useOnMount, warnAboutMissingStyles } from '@entur/utils';
|
|
2
2
|
import { Tooltip } from '@entur/tooltip';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import React__default from 'react';
|
|
5
|
+
import React__default, { useRef } from 'react';
|
|
6
6
|
import { ValidationExclamationIcon, ValidationErrorIcon, ValidationCheckIcon, QuestionIcon, CheckIcon, CloseSmallIcon } from '@entur/icons';
|
|
7
7
|
import { SubLabel, Paragraph, Heading5, Label } from '@entur/typography';
|
|
8
8
|
import { colors } from '@entur/tokens';
|
|
@@ -34,7 +34,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
34
34
|
return target;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
var _excluded$
|
|
37
|
+
var _excluded$g = ["children", "hideIcon", "variant", "className"];
|
|
38
38
|
var AlertIcon = function AlertIcon(_ref) {
|
|
39
39
|
var variant = _ref.variant;
|
|
40
40
|
var iconClass = "eds-feedback-text__icon eds-feedback-text__icon--" + variant;
|
|
@@ -63,7 +63,7 @@ var FeedbackText = function FeedbackText(_ref2) {
|
|
|
63
63
|
hideIcon = _ref2$hideIcon === void 0 ? false : _ref2$hideIcon,
|
|
64
64
|
variant = _ref2.variant,
|
|
65
65
|
className = _ref2.className,
|
|
66
|
-
rest = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
66
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded$g);
|
|
67
67
|
return React__default.createElement(SubLabel, _extends({
|
|
68
68
|
className: classNames('eds-feedback-text', {
|
|
69
69
|
'eds-feedback-text--info': variant === 'info'
|
|
@@ -97,14 +97,14 @@ var useInputGroupContext = function useInputGroupContext() {
|
|
|
97
97
|
return React.useContext(InputGroupContext);
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
var _excluded$
|
|
100
|
+
var _excluded$f = ["label", "required", "labelId", "staticAnimation"];
|
|
101
101
|
var InputGroupLabel = function InputGroupLabel(_ref) {
|
|
102
102
|
var label = _ref.label,
|
|
103
103
|
required = _ref.required,
|
|
104
104
|
labelId = _ref.labelId,
|
|
105
105
|
_ref$staticAnimation = _ref.staticAnimation,
|
|
106
106
|
staticAnimation = _ref$staticAnimation === void 0 ? false : _ref$staticAnimation,
|
|
107
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
107
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
108
108
|
var _useInputGroupContext = useInputGroupContext(),
|
|
109
109
|
isFilled = _useInputGroupContext.isFilled;
|
|
110
110
|
var filler = staticAnimation || isFilled;
|
|
@@ -134,7 +134,7 @@ var useVariant = function useVariant() {
|
|
|
134
134
|
return context;
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
var _excluded$
|
|
137
|
+
var _excluded$e = ["children", "className", "dark", "disabled", "readOnly", "variant", "prepend", "append", "size", "isFilled", "label", "required", "labelTooltip", "feedback", "labelId", "labelProps", "style", "disableLabelAnimation", "ariaAlertOnFeedback"];
|
|
138
138
|
var BaseFormControl = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
139
139
|
var children = _ref.children,
|
|
140
140
|
className = _ref.className,
|
|
@@ -161,7 +161,7 @@ var BaseFormControl = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
|
161
161
|
disableLabelAnimation = _ref$disableLabelAnim === void 0 ? false : _ref$disableLabelAnim,
|
|
162
162
|
_ref$ariaAlertOnFeedb = _ref.ariaAlertOnFeedback,
|
|
163
163
|
ariaAlertOnFeedback = _ref$ariaAlertOnFeedb === void 0 ? false : _ref$ariaAlertOnFeedb,
|
|
164
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
164
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
165
165
|
var contextVariant = useVariant();
|
|
166
166
|
var currentVariant = variant || contextVariant;
|
|
167
167
|
return React__default.createElement(InputGroupContextProvider, null, React__default.createElement("div", _extends({
|
|
@@ -197,7 +197,7 @@ var BaseFormControl = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
|
197
197
|
}, feedback));
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
-
var _excluded$
|
|
200
|
+
var _excluded$d = ["checked", "className", "children", "style", "disabled", "reduceClickArea"];
|
|
201
201
|
var Checkbox = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
202
202
|
var checked = _ref.checked,
|
|
203
203
|
className = _ref.className,
|
|
@@ -206,19 +206,13 @@ var Checkbox = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
206
206
|
_ref$disabled = _ref.disabled,
|
|
207
207
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
208
208
|
reduceClickArea = _ref.reduceClickArea,
|
|
209
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
210
|
-
|
|
211
|
-
// Read more at https://reactjs.org/docs/hooks-reference.html#useimperativehandle
|
|
212
|
-
var innerRef = React__default.useRef(null);
|
|
213
|
-
//eslint-disable-next-line
|
|
214
|
-
React__default.useImperativeHandle(ref, function () {
|
|
215
|
-
return innerRef.current;
|
|
216
|
-
});
|
|
209
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
210
|
+
var inputRef = React__default.useRef(null);
|
|
217
211
|
var isIndeterminate = checked === 'indeterminate';
|
|
218
212
|
var isControlled = checked !== undefined;
|
|
219
213
|
React__default.useEffect(function () {
|
|
220
|
-
if (
|
|
221
|
-
|
|
214
|
+
if (inputRef && inputRef.current) {
|
|
215
|
+
inputRef.current.indeterminate = isIndeterminate;
|
|
222
216
|
}
|
|
223
217
|
}, [isIndeterminate]);
|
|
224
218
|
return React__default.createElement("label", {
|
|
@@ -229,7 +223,7 @@ var Checkbox = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
229
223
|
style: style
|
|
230
224
|
}, React__default.createElement("input", _extends({
|
|
231
225
|
type: "checkbox",
|
|
232
|
-
ref:
|
|
226
|
+
ref: mergeRefs(ref, inputRef),
|
|
233
227
|
checked: isControlled ? checked === true : undefined,
|
|
234
228
|
disabled: disabled
|
|
235
229
|
}, rest)), React__default.createElement("span", {
|
|
@@ -265,12 +259,12 @@ var CheckboxIcon = function CheckboxIcon(_ref2) {
|
|
|
265
259
|
}));
|
|
266
260
|
};
|
|
267
261
|
|
|
268
|
-
var _excluded$
|
|
262
|
+
var _excluded$c = ["children", "className", "label"];
|
|
269
263
|
var Fieldset = function Fieldset(_ref) {
|
|
270
264
|
var children = _ref.children,
|
|
271
265
|
className = _ref.className,
|
|
272
266
|
label = _ref.label,
|
|
273
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
267
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
274
268
|
return React__default.createElement("fieldset", _extends({
|
|
275
269
|
className: classNames('eds-fieldset', className)
|
|
276
270
|
}, rest), label && React__default.createElement(Heading5, {
|
|
@@ -288,13 +282,14 @@ var useRadioGroupContext = function useRadioGroupContext() {
|
|
|
288
282
|
return context;
|
|
289
283
|
};
|
|
290
284
|
|
|
291
|
-
var _excluded$
|
|
285
|
+
var _excluded$b = ["className", "children", "value", "disabled"];
|
|
292
286
|
var Radio = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
287
|
+
var _rest$name, _rest$checked, _rest$onChange;
|
|
293
288
|
var className = _ref.className,
|
|
294
289
|
children = _ref.children,
|
|
295
290
|
value = _ref.value,
|
|
296
291
|
disabled = _ref.disabled,
|
|
297
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
292
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
298
293
|
var classList = classNames(className, 'eds-form-component--radio__radio', {
|
|
299
294
|
'eds-form-component--radio__radio--disabled': disabled
|
|
300
295
|
});
|
|
@@ -306,11 +301,11 @@ var Radio = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
306
301
|
className: "eds-form-component--radio__container"
|
|
307
302
|
}, React__default.createElement("input", _extends({
|
|
308
303
|
type: "radio",
|
|
309
|
-
name: name,
|
|
304
|
+
name: (_rest$name = rest.name) != null ? _rest$name : name,
|
|
310
305
|
ref: ref,
|
|
311
306
|
value: value,
|
|
312
|
-
checked: selectedValue === value,
|
|
313
|
-
onChange: onChange,
|
|
307
|
+
checked: (_rest$checked = rest.checked) != null ? _rest$checked : selectedValue === value,
|
|
308
|
+
onChange: (_rest$onChange = rest.onChange) != null ? _rest$onChange : onChange,
|
|
314
309
|
disabled: disabled
|
|
315
310
|
}, rest)), React__default.createElement("span", {
|
|
316
311
|
className: classList
|
|
@@ -323,30 +318,9 @@ var Radio = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
323
318
|
}, children));
|
|
324
319
|
});
|
|
325
320
|
|
|
326
|
-
var _excluded$
|
|
327
|
-
var
|
|
328
|
-
var
|
|
329
|
-
value = _ref.value,
|
|
330
|
-
children = _ref.children,
|
|
331
|
-
onChange = _ref.onChange,
|
|
332
|
-
label = _ref.label,
|
|
333
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
334
|
-
var contextValue = React__default.useMemo(function () {
|
|
335
|
-
return {
|
|
336
|
-
name: name,
|
|
337
|
-
value: value,
|
|
338
|
-
onChange: onChange
|
|
339
|
-
};
|
|
340
|
-
}, [name, value, onChange]);
|
|
341
|
-
return React__default.createElement(RadioGroupContextProvider, {
|
|
342
|
-
value: contextValue
|
|
343
|
-
}, label ? React__default.createElement(Fieldset, _extends({
|
|
344
|
-
label: label
|
|
345
|
-
}, rest), children) : children);
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
var _excluded$7 = ["className", "children", "value", "title", "secondaryLabel", "size", "hideCheckbox", "style", "id", "disabled"];
|
|
349
|
-
var RadioPanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
321
|
+
var _excluded$a = ["className", "children", "value", "title", "secondaryLabel", "size", "hideSelectionIndicator", "style", "id", "disabled", "type", "onChange", "checked", "name"];
|
|
322
|
+
var InputPanelBase = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
323
|
+
var _ref2, _inputRef$current, _ref3, _inputRef$current2;
|
|
350
324
|
var className = _ref.className,
|
|
351
325
|
children = _ref.children,
|
|
352
326
|
value = _ref.value,
|
|
@@ -354,60 +328,170 @@ var RadioPanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
354
328
|
secondaryLabel = _ref.secondaryLabel,
|
|
355
329
|
_ref$size = _ref.size,
|
|
356
330
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
357
|
-
_ref$
|
|
358
|
-
|
|
331
|
+
_ref$hideSelectionInd = _ref.hideSelectionIndicator,
|
|
332
|
+
hideSelectionIndicator = _ref$hideSelectionInd === void 0 ? false : _ref$hideSelectionInd,
|
|
359
333
|
style = _ref.style,
|
|
360
334
|
id = _ref.id,
|
|
361
335
|
_ref$disabled = _ref.disabled,
|
|
362
336
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
var
|
|
372
|
-
var
|
|
337
|
+
_ref$type = _ref.type,
|
|
338
|
+
type = _ref$type === void 0 ? 'radio' : _ref$type,
|
|
339
|
+
onChange = _ref.onChange,
|
|
340
|
+
checked = _ref.checked,
|
|
341
|
+
name = _ref.name,
|
|
342
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
343
|
+
var classList = classNames(className, 'eds-input-panel__container', "eds-input-panel--" + size);
|
|
344
|
+
var inputRef = useRef(null);
|
|
345
|
+
var defaultId = useRandomId('eds-inputpanel');
|
|
346
|
+
var inputPanelId = id || defaultId;
|
|
347
|
+
var forceUpdate = useForceUpdate();
|
|
348
|
+
var handleOnChange = function handleOnChange(e) {
|
|
349
|
+
if (onChange === undefined) forceUpdate();
|
|
350
|
+
onChange == null ? void 0 : onChange(e);
|
|
351
|
+
};
|
|
373
352
|
return React__default.createElement("label", {
|
|
374
|
-
className: "eds-
|
|
375
|
-
htmlFor:
|
|
353
|
+
className: "eds-input-panel",
|
|
354
|
+
htmlFor: inputPanelId
|
|
376
355
|
}, React__default.createElement("input", _extends({
|
|
377
|
-
type:
|
|
356
|
+
type: type,
|
|
378
357
|
name: name,
|
|
379
|
-
ref: ref,
|
|
358
|
+
ref: mergeRefs(ref, inputRef),
|
|
380
359
|
value: value,
|
|
381
|
-
checked:
|
|
382
|
-
onChange:
|
|
383
|
-
id:
|
|
360
|
+
checked: checked,
|
|
361
|
+
onChange: handleOnChange,
|
|
362
|
+
id: inputPanelId,
|
|
384
363
|
disabled: disabled
|
|
385
364
|
}, rest)), React__default.createElement("div", {
|
|
386
365
|
className: classList,
|
|
387
366
|
style: style
|
|
388
367
|
}, React__default.createElement("div", {
|
|
389
|
-
className: "eds-
|
|
368
|
+
className: "eds-input-panel__title-wrapper"
|
|
390
369
|
}, React__default.createElement("div", {
|
|
391
|
-
className: "eds-
|
|
370
|
+
className: "eds-input-panel__title"
|
|
392
371
|
}, title), React__default.createElement("div", {
|
|
393
|
-
className: "eds-
|
|
394
|
-
}, secondaryLabel && React__default.createElement(
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
372
|
+
className: "eds-input-panel__secondary-label-and-icon-wrapper"
|
|
373
|
+
}, secondaryLabel !== undefined && React__default.createElement(React__default.Fragment, null, secondaryLabel), React__default.createElement("span", {
|
|
374
|
+
style: {
|
|
375
|
+
pointerEvents: 'none'
|
|
376
|
+
}
|
|
377
|
+
}, !(disabled || hideSelectionIndicator) && (type === 'radio' ? React__default.createElement(Radio, {
|
|
378
|
+
name: "",
|
|
379
|
+
value: "",
|
|
380
|
+
checked: (_ref2 = checked != null ? checked : (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.checked) != null ? _ref2 : false,
|
|
381
|
+
onChange: function onChange() {
|
|
382
|
+
return;
|
|
383
|
+
},
|
|
384
|
+
"aria-hidden": "true",
|
|
385
|
+
tabIndex: -1
|
|
386
|
+
}) : React__default.createElement(Checkbox, {
|
|
387
|
+
checked: (_ref3 = checked != null ? checked : (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.checked) != null ? _ref3 : false,
|
|
388
|
+
onChange: function onChange() {
|
|
389
|
+
return null;
|
|
390
|
+
},
|
|
391
|
+
"aria-hidden": "true",
|
|
392
|
+
tabIndex: -1
|
|
393
|
+
}))))), children && React__default.createElement("div", {
|
|
394
|
+
className: "eds-input-panel__additional-content"
|
|
398
395
|
}, children)));
|
|
399
396
|
});
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
397
|
+
|
|
398
|
+
var _excluded$9 = ["className", "children", "value", "title", "secondaryLabel", "size", "hideRadioButton", "style", "id", "disabled"];
|
|
399
|
+
var RadioPanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
400
|
+
var className = _ref.className,
|
|
401
|
+
children = _ref.children,
|
|
402
|
+
value = _ref.value,
|
|
403
|
+
title = _ref.title,
|
|
404
|
+
secondaryLabel = _ref.secondaryLabel,
|
|
405
|
+
_ref$size = _ref.size,
|
|
406
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
407
|
+
_ref$hideRadioButton = _ref.hideRadioButton,
|
|
408
|
+
hideRadioButton = _ref$hideRadioButton === void 0 ? false : _ref$hideRadioButton,
|
|
409
|
+
style = _ref.style,
|
|
410
|
+
id = _ref.id,
|
|
411
|
+
_ref$disabled = _ref.disabled,
|
|
412
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
413
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
414
|
+
var _useRadioGroupContext = useRadioGroupContext(),
|
|
415
|
+
name = _useRadioGroupContext.name,
|
|
416
|
+
selected = _useRadioGroupContext.value,
|
|
417
|
+
onChange = _useRadioGroupContext.onChange;
|
|
418
|
+
return React__default.createElement(InputPanelBase, _extends({
|
|
419
|
+
type: "radio",
|
|
420
|
+
name: name,
|
|
421
|
+
title: title,
|
|
422
|
+
value: value,
|
|
423
|
+
checked: selected === value,
|
|
424
|
+
onChange: onChange,
|
|
425
|
+
className: className,
|
|
426
|
+
secondaryLabel: secondaryLabel,
|
|
427
|
+
size: size,
|
|
428
|
+
hideSelectionIndicator: hideRadioButton,
|
|
429
|
+
style: style,
|
|
430
|
+
id: id,
|
|
431
|
+
disabled: disabled
|
|
432
|
+
}, rest, {
|
|
433
|
+
ref: ref
|
|
434
|
+
}), children);
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
var _excluded$8 = ["name", "checked", "onChange", "className", "children", "value", "title", "secondaryLabel", "size", "hideCheckbox", "style", "id", "disabled"];
|
|
438
|
+
var CheckboxPanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
439
|
+
var name = _ref.name,
|
|
440
|
+
checked = _ref.checked,
|
|
441
|
+
onChange = _ref.onChange,
|
|
442
|
+
className = _ref.className,
|
|
443
|
+
children = _ref.children,
|
|
444
|
+
value = _ref.value,
|
|
445
|
+
title = _ref.title,
|
|
446
|
+
secondaryLabel = _ref.secondaryLabel,
|
|
447
|
+
_ref$size = _ref.size,
|
|
448
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
449
|
+
_ref$hideCheckbox = _ref.hideCheckbox,
|
|
450
|
+
hideCheckbox = _ref$hideCheckbox === void 0 ? false : _ref$hideCheckbox,
|
|
451
|
+
style = _ref.style,
|
|
452
|
+
id = _ref.id,
|
|
453
|
+
_ref$disabled = _ref.disabled,
|
|
454
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
455
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
456
|
+
return React__default.createElement(InputPanelBase, _extends({
|
|
457
|
+
type: "checkbox",
|
|
458
|
+
name: name,
|
|
459
|
+
title: title,
|
|
460
|
+
value: value,
|
|
461
|
+
checked: checked,
|
|
462
|
+
onChange: onChange,
|
|
463
|
+
className: className,
|
|
464
|
+
secondaryLabel: secondaryLabel,
|
|
465
|
+
size: size,
|
|
466
|
+
hideSelectionIndicator: hideCheckbox,
|
|
467
|
+
style: style,
|
|
468
|
+
id: id,
|
|
469
|
+
disabled: disabled
|
|
470
|
+
}, rest, {
|
|
471
|
+
ref: ref
|
|
472
|
+
}), children);
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
var _excluded$7 = ["name", "value", "children", "onChange", "label"];
|
|
476
|
+
var RadioGroup = function RadioGroup(_ref) {
|
|
477
|
+
var name = _ref.name,
|
|
478
|
+
value = _ref.value,
|
|
479
|
+
children = _ref.children,
|
|
480
|
+
onChange = _ref.onChange,
|
|
481
|
+
label = _ref.label,
|
|
482
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
483
|
+
var contextValue = React__default.useMemo(function () {
|
|
484
|
+
return {
|
|
485
|
+
name: name,
|
|
486
|
+
value: value,
|
|
487
|
+
onChange: onChange
|
|
488
|
+
};
|
|
489
|
+
}, [name, value, onChange]);
|
|
490
|
+
return React__default.createElement(RadioGroupContextProvider, {
|
|
491
|
+
value: contextValue
|
|
492
|
+
}, label ? React__default.createElement(Fieldset, _extends({
|
|
493
|
+
label: label
|
|
494
|
+
}, rest), children) : children);
|
|
411
495
|
};
|
|
412
496
|
|
|
413
497
|
var _excluded$6 = ["className", "children", "labelPlacement", "icon", "hideIcon", "color", "contrastColor", "size", "checked"];
|
|
@@ -813,5 +897,5 @@ var MultipleSegmentedControl = function MultipleSegmentedControl(_ref) {
|
|
|
813
897
|
|
|
814
898
|
warnAboutMissingStyles('form', 'icons', 'typography');
|
|
815
899
|
|
|
816
|
-
export { BaseFormControl, Checkbox, FeedbackText, Fieldset, InputGroupContextProvider, InputGroupLabel, MultipleSegmentedControl, Radio, RadioGroup, RadioPanel, SegmentedChoice, SegmentedControl, Switch, TextArea, TextField, VariantProvider, hasValue, isFilled, useInputGroupContext, useVariant };
|
|
900
|
+
export { BaseFormControl, Checkbox, CheckboxPanel, FeedbackText, Fieldset, InputGroupContextProvider, InputGroupLabel, MultipleSegmentedControl, Radio, RadioGroup, RadioPanel, SegmentedChoice, SegmentedControl, Switch, TextArea, TextField, VariantProvider, hasValue, isFilled, useInputGroupContext, useVariant };
|
|
817
901
|
//# sourceMappingURL=form.esm.js.map
|