@arc-ui/components 4.0.1 → 5.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/index.es.js CHANGED
@@ -308,9 +308,9 @@ var Base = function (_a) {
308
308
  return (React.createElement("div", __assign({ className: "arc".concat(brand ? " arc-".concat(brand) : "") }, filterDataAttrs(props)), children));
309
309
  };
310
310
 
311
- var defaultContext$2 = { surface: "light" };
312
- var Context$2 = createContext(defaultContext$2);
313
- var Provider$3 = Context$2.Provider;
311
+ var defaultContext$3 = { surface: "light" };
312
+ var Context$3 = createContext(defaultContext$3);
313
+ var Provider$4 = Context$3.Provider;
314
314
  /**
315
315
  * Use `Surface` to compose content using the Arc system.
316
316
  */
@@ -325,7 +325,7 @@ var Surface = function (_a) {
325
325
  background === "darker") {
326
326
  surface = "dark";
327
327
  }
328
- return (React.createElement(Provider$3, { value: { surface: surface } },
328
+ return (React.createElement(Provider$4, { value: { surface: surface } },
329
329
  React.createElement("div", __assign({ className: classNames((_b = {
330
330
  "arc-Surface": true
331
331
  },
@@ -357,7 +357,7 @@ __spreadArray([], backgroundsShared, true);
357
357
  var BrandLogo = function (_a) {
358
358
  var _b;
359
359
  var _c = _a.color, color = _c === void 0 ? "auto" : _c, label = _a.label, _d = _a.size, size = _d === void 0 ? 34 : _d, subBrand = _a.subBrand, props = __rest(_a, ["color", "label", "size", "subBrand"]);
360
- var surface = useContext(Context$2).surface;
360
+ var surface = useContext(Context$3).surface;
361
361
  return (React.createElement("div", __assign({ className: classNames((_b = {
362
362
  "arc-BrandLogo": true,
363
363
  "arc-BrandLogo--colorBrand": color === "brand",
@@ -635,7 +635,7 @@ const iconsSelected = [
635
635
  var Icon = function (_a) {
636
636
  var _b;
637
637
  var _c = _a.color, color = _c === void 0 ? "auto" : _c, icon = _a.icon, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isSelected, isSelected = _e === void 0 ? false : _e, label = _a.label, size = _a.size, props = __rest(_a, ["color", "icon", "isInline", "isSelected", "label", "size"]);
638
- var surface = useContext(Context$2).surface;
638
+ var surface = useContext(Context$3).surface;
639
639
  return (React.createElement("span", __assign({ "aria-label": label, className: classNames((_b = {},
640
640
  _b["arc-Icon"] = true,
641
641
  _b[suffixModifier("arc-Icon--color", color)] = color !== "auto",
@@ -653,8 +653,8 @@ var Icon = function (_a) {
653
653
  */
654
654
  var Button = forwardRef(function (_a, ref) {
655
655
  var _b;
656
- var ariaLabel = _a.ariaLabel, _c = _a.fill, fill = _c === void 0 ? "solid" : _c, href = _a.href, icon = _a.icon, _d = _a.iconPosition, iconPosition = _d === void 0 ? "afterText" : _d, id = _a.id, _e = _a.isDisabled, isDisabled = _e === void 0 ? false : _e, _f = _a.isDisplayBlock, isDisplayBlock = _f === void 0 ? false : _f, _g = _a.isFullWidth, isFullWidth = _g === void 0 ? false : _g, label = _a.label, onClick = _a.onClick, rel = _a.rel, target = _a.target, type = _a.type, props = __rest(_a, ["ariaLabel", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "target", "type"]);
657
- var surface = useContext(Context$2).surface;
656
+ var ariaLabel = _a.ariaLabel, _c = _a.fill, fill = _c === void 0 ? "solid" : _c, href = _a.href, icon = _a.icon, _d = _a.iconPosition, iconPosition = _d === void 0 ? "afterText" : _d, id = _a.id, _e = _a.isDisabled, isDisabled = _e === void 0 ? false : _e, _f = _a.isDisplayBlock, isDisplayBlock = _f === void 0 ? false : _f, _g = _a.isFullWidth, isFullWidth = _g === void 0 ? false : _g, label = _a.label, onClick = _a.onClick, rel = _a.rel, supportingText = _a.supportingText, target = _a.target, type = _a.type, props = __rest(_a, ["ariaLabel", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "supportingText", "target", "type"]);
657
+ var surface = useContext(Context$3).surface;
658
658
  var buttonClasses = classNames((_b = {
659
659
  "arc-Button": true,
660
660
  "arc-Button--displayBlock": isDisplayBlock
@@ -664,19 +664,23 @@ var Button = forwardRef(function (_a, ref) {
664
664
  _b[suffixModifier("arc-Button--icon", iconPosition.replace("icon", ""))] = (icon || fill === "flat") &&
665
665
  iconPosition &&
666
666
  iconPosition !== "afterText",
667
+ _b["arc-Button--hasSupportingText"] = supportingText,
667
668
  _b["arc-Button--onDarkSurface"] = surface === "dark",
668
669
  _b));
669
670
  var commonProps = __assign({ id: id, onClick: onClick, ref: ref }, filterDataAttrs(props));
671
+ var buttonText = supportingText ? (React.createElement("span", null,
672
+ React.createElement("span", { className: "arc-Button-text" }, label),
673
+ React.createElement("span", { className: "arc-Button-supportingText" }, supportingText))) : (React.createElement("span", { className: "arc-Button-text" }, label));
670
674
  var buttonIcon = icon || fill === "flat" ? (React.createElement(ButtonIcon, { icon: icon, isChevron: !icon && fill === "flat", isBeforeText: iconPosition === "beforeText" })) : null;
671
675
  if (href && !isDisabled) {
672
676
  return (React.createElement("a", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, href: href, rel: rel, target: target }),
673
677
  React.createElement("span", { className: "arc-Button-inner" },
674
- React.createElement("span", { className: "arc-Button-text" }, label),
678
+ buttonText,
675
679
  buttonIcon)));
676
680
  }
677
681
  return (React.createElement("button", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type }),
678
682
  React.createElement("span", { className: "arc-Button-inner" },
679
- React.createElement("span", { className: "arc-Button-text" }, label),
683
+ buttonText,
680
684
  buttonIcon)));
681
685
  });
682
686
  var ButtonIcon = function (_a) {
@@ -709,7 +713,7 @@ var Image = function (_a) {
709
713
  var Heading = function (_a) {
710
714
  var _b;
711
715
  var _c = _a.align, align = _c === void 0 ? "left" : _c, _d = _a.casing, casing = _d === void 0 ? "auto" : _d, children = _a.children, _e = _a.color, color = _e === void 0 ? "auto" : _e, level = _a.level, size = _a.size, _f = _a.typeface, typeface = _f === void 0 ? "default" : _f, props = __rest(_a, ["align", "casing", "children", "color", "level", "size", "typeface"]);
712
- var surface = useContext(Context$2).surface;
716
+ var surface = useContext(Context$3).surface;
713
717
  var Element = "span";
714
718
  if (level) {
715
719
  Element = "h".concat(level);
@@ -853,7 +857,7 @@ var useNumericInput = function (props) {
853
857
  var Card = function (_a) {
854
858
  var _b;
855
859
  var actionId = _a.actionId, _c = _a.actionLabel, actionLabel = _c === void 0 ? "Read more" : _c, children = _a.children, _d = _a.fill, fill = _d === void 0 ? "solid" : _d, href = _a.href, imageAlt = _a.imageAlt, imageSrc = _a.imageSrc, imageSrcSet = _a.imageSrcSet, imageHeight = _a.imageHeight, minHeight = _a.minHeight, target = _a.target, title = _a.title, _e = _a.titleSize, titleSize = _e === void 0 ? "s" : _e, props = __rest(_a, ["actionId", "actionLabel", "children", "fill", "href", "imageAlt", "imageSrc", "imageSrcSet", "imageHeight", "minHeight", "target", "title", "titleSize"]);
856
- var surface = useContext(Context$2).surface;
860
+ var surface = useContext(Context$3).surface;
857
861
  var interactionMode = useInteractionMode().interactionMode;
858
862
  var Wrapper = function (_a) {
859
863
  var children = _a.children;
@@ -912,7 +916,7 @@ Card.Image = CardImage;
912
916
  */
913
917
  var CardLink = function (_a) {
914
918
  var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, fill = _a.fill, href = _a.href, stretch = _a.stretch, target = _a.target;
915
- var surface = useContext(Context$2).surface;
919
+ var surface = useContext(Context$3).surface;
916
920
  return (React.createElement("a", { "aria-describedby": actionId, className: classNames({
917
921
  "arc-CardLink": true,
918
922
  "arc-CardLink--button": isButton,
@@ -924,38 +928,89 @@ var CardLink = function (_a) {
924
928
  React.createElement(Icon, { icon: "btChevronRight2px", size: 8 })))));
925
929
  };
926
930
 
931
+ var defaultContext$2 = {
932
+ requirementStatus: null
933
+ };
934
+ var Context$2 = createContext(defaultContext$2);
935
+ var Provider$3 = Context$2.Provider;
936
+ /**
937
+ * Use `FormControl` to provide inputs with labels, helper text and error messages
938
+ */
939
+ var FormControl = function (_a) {
940
+ var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, props = __rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus"]);
941
+ var surface = useContext(Context$3).surface;
942
+ var _e = useAriaDescribedby({
943
+ errorMessage: errorMessage,
944
+ helper: helper,
945
+ id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
946
+ }), ariaDescribedby = _e.ariaDescribedby, idError = _e.idError, idHelper = _e.idHelper;
947
+ var LabelType = ElementType === "div" ? "label" : "legend";
948
+ var elementProps = {};
949
+ var labelProps = {};
950
+ if (LabelType === "label") {
951
+ labelProps["htmlFor"] = htmlFor;
952
+ if (htmlFor) {
953
+ labelProps["id"] = "".concat(htmlFor, "-label");
954
+ }
955
+ else if (id) {
956
+ labelProps["id"] = "".concat(id, "-label");
957
+ }
958
+ }
959
+ else {
960
+ elementProps["aria-describedby"] = ariaDescribedby;
961
+ }
962
+ return (React.createElement(Provider$3, { value: { requirementStatus: requirementStatus } },
963
+ React.createElement(ElementType, __assign({ className: classNames({
964
+ "arc-FormControl": true,
965
+ "arc-FormControl--smallLabel": labelSize === "s",
966
+ "arc-FormControl--onDarkSurface": surface === "dark"
967
+ }), id: id }, elementProps, filterDataAttrs(props)),
968
+ React.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
969
+ label,
970
+ " ",
971
+ requirementStatus === "optional" && (React.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
972
+ helper && (React.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper)),
973
+ children,
974
+ errorMessage && (React.createElement("div", { className: "arc-FormControl-error", id: idError }, errorMessage)))));
975
+ };
976
+
927
977
  /**
928
978
  * Use `Checkbox` to allow users to select individual options.
929
979
  */
930
980
  var Checkbox = forwardRef(function (_a, ref) {
931
- var errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, _b = _a.isChecked, isChecked = _b === void 0 ? false : _b, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, label = _a.label, name = _a.name, onChange = _a.onChange, value = _a.value, props = __rest(_a, ["errorMessage", "helper", "id", "isChecked", "isDisabled", "isRequired", "label", "name", "onChange", "value"]);
932
- var surface = useContext(Context$2).surface;
933
- var _e = useAriaDescribedby({
981
+ var _b = _a.checked, checked = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, label = _a.label, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, _e = _a.size, size = _e === void 0 ? "l" : _e, value = _a.value, props = __rest(_a, ["checked", "errorMessage", "helper", "id", "isDisabled", "isRequired", "label", "name", "onBlur", "onChange", "size", "value"]);
982
+ var requirementStatus = useContext(Context$2).requirementStatus;
983
+ var surface = useContext(Context$3).surface;
984
+ var _f = useAriaDescribedby({
934
985
  id: id,
935
- errorMessage: errorMessage,
936
- helper: helper
937
- }), ariaDescribedby = _e.ariaDescribedby, idHelper = _e.idHelper, idError = _e.idError;
986
+ errorMessage: errorMessage
987
+ }), ariaDescribedby = _f.ariaDescribedby, idError = _f.idError;
938
988
  var idLabel = "".concat(id, "-label");
939
989
  var checkedProps = {};
940
990
  if (typeof onChange === "function") {
941
- checkedProps.checked = isChecked;
991
+ checkedProps.checked = checked;
942
992
  }
943
- else if (isChecked && !onChange) {
993
+ else if (checked && !onChange) {
944
994
  checkedProps.defaultChecked = true;
945
995
  }
996
+ if (requirementStatus === "required") {
997
+ isRequired = true;
998
+ }
946
999
  return (React.createElement("div", { className: classNames({
947
1000
  "arc-Checkbox": true,
948
1001
  "arc-Checkbox--disabled": isDisabled,
949
1002
  "arc-Checkbox--invalid": errorMessage,
1003
+ "arc-Checkbox--small": size === "s",
950
1004
  "arc-Checkbox--onDarkSurface": surface === "dark"
951
1005
  }) },
952
1006
  React.createElement("label", { id: idLabel, htmlFor: id, className: "arc-Checkbox-label" },
953
- React.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-disabled": isDisabled, "aria-invalid": errorMessage ? "true" : "false", "aria-required": isRequired ? "true" : undefined, className: "arc-Checkbox-input" }, checkedProps, { disabled: isDisabled, id: id, name: name, onChange: onChange, ref: ref, required: isRequired, type: "checkbox", value: value }, filterDataAttrs(props))),
1007
+ React.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-Checkbox-input" }, checkedProps, { disabled: isDisabled, id: id, name: name, onBlur: onBlur, onChange: onChange, ref: ref, required: isRequired, type: "checkbox", value: value }, filterDataAttrs(props))),
954
1008
  React.createElement("span", { className: "arc-Checkbox-box" }),
955
1009
  React.createElement("span", null,
956
1010
  label,
957
- !isRequired && " (Optional)")),
958
- helper && (React.createElement("div", { id: idHelper, className: "arc-Checkbox-helper" }, helper)),
1011
+ " ",
1012
+ !isRequired && requirementStatus !== "optional" ? (React.createElement("span", { className: "arc-Checkbox-labelOptional" }, "(optional)")) : null,
1013
+ helper && React.createElement("span", { className: "arc-Checkbox-helper" }, helper))),
959
1014
  errorMessage && (React.createElement("div", { id: idError, className: "arc-Checkbox-error" }, errorMessage))));
960
1015
  });
961
1016
 
@@ -1058,7 +1113,7 @@ var Curve = function (_a) {
1058
1113
  */
1059
1114
  var Disclosure = function (_a) {
1060
1115
  var children = _a.children, headingLevel = _a.headingLevel, _b = _a.indentDetails, indentDetails = _b === void 0 ? false : _b, _c = _a.isOpen, isOpen = _c === void 0 ? false : _c, summary = _a.summary, props = __rest(_a, ["children", "headingLevel", "indentDetails", "isOpen", "summary"]);
1061
- var surface = useContext(Context$2).surface;
1116
+ var surface = useContext(Context$3).surface;
1062
1117
  return (React.createElement("details", __assign({ className: classNames({
1063
1118
  "arc-Disclosure": true,
1064
1119
  "arc-Disclosure--indentDetails": indentDetails,
@@ -1081,53 +1136,13 @@ var Elevation = function (_a) {
1081
1136
  _b)) }, filterDataAttrs(props)), children));
1082
1137
  };
1083
1138
 
1084
- /**
1085
- * Use `FormControl` to provide inputs with labels, helper text and error messages
1086
- */
1087
- var FormControl = function (_a) {
1088
- var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, id = _a.id, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, label = _a.label, _d = _a.labelSize, labelSize = _d === void 0 ? "l" : _d, props = __rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "isRequired", "label", "labelSize"]);
1089
- var surface = useContext(Context$2).surface;
1090
- var _e = useAriaDescribedby({
1091
- errorMessage: errorMessage,
1092
- helper: helper,
1093
- id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
1094
- }), ariaDescribedby = _e.ariaDescribedby, idError = _e.idError, idHelper = _e.idHelper;
1095
- var LabelType = ElementType === "div" ? "label" : "legend";
1096
- var elementProps = {};
1097
- var labelProps = {};
1098
- if (LabelType === "label") {
1099
- labelProps["htmlFor"] = htmlFor;
1100
- if (htmlFor) {
1101
- labelProps["id"] = "".concat(htmlFor, "-label");
1102
- }
1103
- else if (id) {
1104
- labelProps["id"] = "".concat(id, "-label");
1105
- }
1106
- }
1107
- else {
1108
- elementProps["aria-describedby"] = ariaDescribedby;
1109
- }
1110
- return (React.createElement(ElementType, __assign({ className: classNames({
1111
- "arc-FormControl": true,
1112
- "arc-FormControl--smallLabel": labelSize === "s",
1113
- "arc-FormControl--onDarkSurface": surface === "dark"
1114
- }), id: id }, elementProps, filterDataAttrs(props)),
1115
- React.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
1116
- label,
1117
- " ",
1118
- !isRequired && (React.createElement("span", { className: "arc-FormControl-labelOptional" }, "(Optional)"))),
1119
- helper && (React.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper)),
1120
- children,
1121
- errorMessage && (React.createElement("div", { className: "arc-FormControl-error", id: idError }, errorMessage))));
1122
- };
1123
-
1124
1139
  /**
1125
1140
  * Use `Group` to arrange flexible items in a row.
1126
1141
  */
1127
1142
  var Group = function (_a) {
1128
1143
  var _b;
1129
1144
  var children = _a.children, _c = _a.grow, grow = _c === void 0 ? false : _c, _d = _a.growEqual, growEqual = _d === void 0 ? false : _d, _e = _a.gutterBorder, gutterBorder = _e === void 0 ? false : _e, _f = _a.noWrap, noWrap = _f === void 0 ? false : _f, props = __rest(_a, ["children", "grow", "growEqual", "gutterBorder", "noWrap"]);
1130
- var surface = useContext(Context$2).surface;
1145
+ var surface = useContext(Context$3).surface;
1131
1146
  useEffect(function () {
1132
1147
  React.Children.map(children, function (item) {
1133
1148
  if (item && item.type !== GroupItem) {
@@ -1162,7 +1177,7 @@ Group.Item = GroupItem;
1162
1177
  */
1163
1178
  var Markup = function (_a) {
1164
1179
  var children = _a.children, _b = _a.isMeasured, isMeasured = _b === void 0 ? false : _b, props = __rest(_a, ["children", "isMeasured"]);
1165
- var surface = useContext(Context$2).surface;
1180
+ var surface = useContext(Context$3).surface;
1166
1181
  return (React.createElement("div", __assign({ className: classNames({
1167
1182
  "arc-Markup": true,
1168
1183
  "arc-Markup--measured": isMeasured,
@@ -1244,60 +1259,50 @@ var useRadioContext = function () {
1244
1259
  * Radio Button component.
1245
1260
  */
1246
1261
  var RadioButton = forwardRef(function (_a, ref) {
1247
- var helper = _a.helper, id = _a.id, label = _a.label, value = _a.value, props = __rest(_a, ["helper", "id", "label", "value"]);
1248
- var _b = useRadioContext(), isDisabled = _b.isDisabled, isInvalid = _b.isInvalid, isRequired = _b.isRequired, isChecked = _b.isChecked, name = _b.name, changeEvent = _b.changeEvent, errorMessage = _b.errorMessage, errorId = _b.errorId;
1249
- var surface = useContext(Context$2).surface;
1250
- var _c = useAriaDescribedby({
1251
- id: id,
1252
- idError: "".concat(errorId, "-error"),
1253
- helper: helper,
1254
- errorMessage: errorMessage
1255
- }), ariaDescribedby = _c.ariaDescribedby, idHelper = _c.idHelper;
1262
+ var helper = _a.helper, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, value = _a.value, props = __rest(_a, ["helper", "id", "isDisabled", "label", "value"]);
1263
+ var _b = useRadioContext(), blurEvent = _b.blurEvent, changeEvent = _b.changeEvent, groupDisabled = _b.groupDisabled, isChecked = _b.isChecked, labelSize = _b.labelSize, name = _b.name, size = _b.size;
1264
+ var surface = useContext(Context$3).surface;
1256
1265
  var idLabel = "".concat(id, "-label");
1257
1266
  var checked = isChecked === value ? true : false;
1258
- var disabled = isDisabled ? isDisabled : false;
1259
1267
  return (React.createElement("div", __assign({ className: classNames({
1260
1268
  "arc-RadioButton": true,
1261
- "arc-RadioButton--checked": isChecked,
1262
- "arc-RadioButton--disabled": disabled,
1263
- "arc-RadioButton--invalid": isInvalid,
1264
- "arc-RadioButton--required": isRequired,
1269
+ "arc-RadioButton--disabled": isDisabled || groupDisabled,
1270
+ "arc-RadioButton--small": size === "s",
1271
+ "arc-RadioButton--smallLabel": labelSize === "s",
1265
1272
  "arc-RadioButton--onDarkSurface": surface === "dark"
1266
1273
  }) }, filterDataAttrs(props)),
1267
- React.createElement("input", { "aria-describedby": ariaDescribedby, "aria-disabled": disabled, className: "arc-RadioButton-input", defaultChecked: checked, disabled: isDisabled, id: id, name: name, onChange: changeEvent, ref: ref, required: isRequired, type: "radio", value: value }),
1268
- React.createElement("label", { className: "arc-RadioButton-label", htmlFor: id, id: idLabel }, label),
1269
- helper && (React.createElement("p", { className: "arc-RadioButton-helper", id: idHelper }, helper))));
1274
+ React.createElement("label", { className: "arc-RadioButton-label", htmlFor: id, id: idLabel },
1275
+ React.createElement("input", { className: "arc-RadioButton-input", checked: typeof changeEvent !== "function" ? undefined : checked, defaultChecked: typeof changeEvent !== "function" ? checked : undefined, disabled: isDisabled || groupDisabled, id: id, name: name, onBlur: blurEvent, onChange: changeEvent, ref: ref, type: "radio", value: value }),
1276
+ React.createElement("span", null,
1277
+ label,
1278
+ helper && React.createElement("span", { className: "arc-RadioButton-helper" }, helper)))));
1270
1279
  });
1271
1280
 
1272
1281
  /**
1273
1282
  * Use `RadioGroup` to wrap and control radio buttons and apply default values
1274
1283
  */
1275
1284
  var RadioGroup = function (_a) {
1276
- var children = _a.children, defaultValue = _a.defaultValue, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, errorMessage = _a.errorMessage, id = _a.id, helper = _a.helper, label = _a.label, name = _a.name, onChange = _a.onChange, props = __rest(_a, ["children", "defaultValue", "isDisabled", "isRequired", "errorMessage", "id", "helper", "label", "name", "onChange"]);
1285
+ var children = _a.children, defaultValue = _a.defaultValue, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, id = _a.id, helper = _a.helper, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? "l" : _d, props = __rest(_a, ["children", "defaultValue", "isDisabled", "id", "helper", "label", "labelSize", "name", "onBlur", "onChange", "size"]);
1277
1286
  return (React.createElement(Provider$2, { value: {
1287
+ blurEvent: onBlur,
1288
+ changeEvent: onChange,
1289
+ groupDisabled: isDisabled,
1278
1290
  isChecked: defaultValue,
1279
- isRequired: isRequired,
1280
- isDisabled: isDisabled,
1281
- isInvalid: errorMessage ? true : false,
1282
- errorId: id,
1283
- errorMessage: errorMessage,
1291
+ labelSize: labelSize,
1284
1292
  name: name,
1285
- changeEvent: onChange
1293
+ size: size
1286
1294
  } },
1287
- React.createElement(FormControl, { elementType: "fieldset", label: label, errorMessage: errorMessage, helper: helper, isRequired: isRequired, id: id },
1288
- React.createElement("div", __assign({ className: classNames({
1289
- "arc-RadioGroup": true,
1290
- "arc-RadioGroup--invalid": errorMessage,
1291
- "arc-RadioGroup--disabled": isDisabled
1292
- }) }, filterDataAttrs(props)), children))));
1295
+ React.createElement("div", __assign({ className: "arc-RadioGroup" }, filterDataAttrs(props)),
1296
+ React.createElement(FormControl, { elementType: "fieldset", label: label, labelSize: labelSize, helper: helper, id: id, requirementStatus: "not-applicable" }, children))));
1293
1297
  };
1298
+ RadioButton.displayName = "RadioGroup.RadioButton";
1294
1299
  RadioGroup.RadioButton = RadioButton;
1295
1300
 
1296
1301
  /**
1297
1302
  * Use `Rule` to display a horizontal rule.
1298
1303
  */
1299
1304
  var Rule = function (props) {
1300
- var surface = useContext(Context$2).surface;
1305
+ var surface = useContext(Context$3).surface;
1301
1306
  return (React.createElement("hr", __assign({ className: classNames({
1302
1307
  "arc-Rule": true,
1303
1308
  "arc-Rule--onDarkSurface": surface === "dark"
@@ -1969,7 +1974,7 @@ SiteHeaderRehydrator.SubNavItemRehydrator = SubNavItemRehydrator;
1969
1974
  var Text = function (_a) {
1970
1975
  var _b;
1971
1976
  var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, props = __rest(_a, ["align", "children", "isInline", "isMeasured", "size", "tone"]);
1972
- var surface = useContext(Context$2).surface;
1977
+ var surface = useContext(Context$3).surface;
1973
1978
  return (React.createElement("span", __assign({ className: classNames((_b = {
1974
1979
  "arc-Text": true
1975
1980
  },
@@ -1986,8 +1991,8 @@ var Text = function (_a) {
1986
1991
  * Use `TextInput` to allow custom user text entry with a keyboard.
1987
1992
  */
1988
1993
  var TextInput = forwardRef(function (_a, ref) {
1989
- var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isReadOnly, isReadOnly = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, label = _a.label, _f = _a.labelSize, labelSize = _f === void 0 ? "l" : _f, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onChange = _a.onChange, pattern = _a.pattern, _g = _a.type, type = _g === void 0 ? "text" : _g, value = _a.value, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onChange", "pattern", "type", "value"]);
1990
- var surface = useContext(Context$2).surface;
1994
+ var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isReadOnly, isReadOnly = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, label = _a.label, _f = _a.labelSize, labelSize = _f === void 0 ? "l" : _f, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, pattern = _a.pattern, _g = _a.type, type = _g === void 0 ? "text" : _g, value = _a.value, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "pattern", "type", "value"]);
1995
+ var surface = useContext(Context$3).surface;
1991
1996
  var inferredInputProps = useNumericInput({ inputMode: inputMode, pattern: pattern, type: type });
1992
1997
  // Although this is used within FormControlWrapper, it's deterministic so we can call it here too
1993
1998
  var ariaDescribedby = useAriaDescribedby({
@@ -2000,8 +2005,8 @@ var TextInput = forwardRef(function (_a, ref) {
2000
2005
  "arc-TextInput--invalid": errorMessage,
2001
2006
  "arc-TextInput--onDarkSurface": surface === "dark"
2002
2007
  }) }, filterDataAttrs(props)),
2003
- React.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isRequired: isRequired, label: label, labelSize: labelSize },
2004
- React.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", "aria-required": isRequired ? "true" : undefined, className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined }, inferredInputProps)))));
2008
+ React.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional" },
2009
+ React.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, onBlur: onBlur, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined }, inferredInputProps)))));
2005
2010
  });
2006
2011
 
2007
2012
  /**
@@ -2018,5 +2023,5 @@ var VerticalSpace = function (_a) {
2018
2023
  _b)) }, filterDataAttrs(props))));
2019
2024
  };
2020
2025
 
2021
- export { Align, Base, BrandLogo, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, Elevation, FormControl, Group, Heading, Icon, Image, Markup, Poster, RadioGroup, Rule, Section, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, Surface, Context$2 as SurfaceContext, Text, TextInput, UniversalHeader, VerticalSpace };
2026
+ export { Align, Base, BrandLogo, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, Elevation, FormControl, Group, Heading, Icon, Image, Markup, Poster, RadioGroup, Rule, Section, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, Surface, Context$3 as SurfaceContext, Text, TextInput, UniversalHeader, VerticalSpace };
2022
2027
  //# sourceMappingURL=index.es.js.map