@arc-ui/components 4.0.1 → 6.1.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 +184 -147
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +184 -147
- package/dist/index.js.map +1 -1
- package/dist/polyfills.js +3331 -17
- package/dist/polyfills.js.map +1 -1
- package/dist/styles.bt.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.ee.css +1 -1
- package/dist/types/components/Button/Button.d.ts +4 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +13 -9
- package/dist/types/components/FormControl/FormControl.d.ts +8 -2
- package/dist/types/components/FormControl/index.d.ts +1 -1
- package/dist/types/components/RadioGroup/RadioButton/RadioButton.d.ts +4 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +17 -12
- package/dist/types/components/RadioGroup/context.d.ts +5 -6
- package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.d.ts +16 -1
- package/dist/types/components/TextInput/TextInput.d.ts +15 -9
- package/package.json +6 -4
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$
|
|
312
|
-
var Context$
|
|
313
|
-
var 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$
|
|
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$
|
|
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",
|
|
@@ -369,6 +369,10 @@ var BrandLogo = function (_a) {
|
|
|
369
369
|
} }, filterDataAttrs(props)), label ? React.createElement("span", { className: "arc-BrandLogo-text" }, label) : null));
|
|
370
370
|
};
|
|
371
371
|
|
|
372
|
+
/**
|
|
373
|
+
* Do not edit directly
|
|
374
|
+
* Generated file
|
|
375
|
+
*/
|
|
372
376
|
const ArcBreakpointM = 768;
|
|
373
377
|
const ArcBreakpointL = 1024;
|
|
374
378
|
const iconsSelected = [
|
|
@@ -635,7 +639,7 @@ const iconsSelected = [
|
|
|
635
639
|
var Icon = function (_a) {
|
|
636
640
|
var _b;
|
|
637
641
|
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$
|
|
642
|
+
var surface = useContext(Context$3).surface;
|
|
639
643
|
return (React.createElement("span", __assign({ "aria-label": label, className: classNames((_b = {},
|
|
640
644
|
_b["arc-Icon"] = true,
|
|
641
645
|
_b[suffixModifier("arc-Icon--color", color)] = color !== "auto",
|
|
@@ -653,8 +657,8 @@ var Icon = function (_a) {
|
|
|
653
657
|
*/
|
|
654
658
|
var Button = forwardRef(function (_a, ref) {
|
|
655
659
|
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$
|
|
660
|
+
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"]);
|
|
661
|
+
var surface = useContext(Context$3).surface;
|
|
658
662
|
var buttonClasses = classNames((_b = {
|
|
659
663
|
"arc-Button": true,
|
|
660
664
|
"arc-Button--displayBlock": isDisplayBlock
|
|
@@ -664,19 +668,23 @@ var Button = forwardRef(function (_a, ref) {
|
|
|
664
668
|
_b[suffixModifier("arc-Button--icon", iconPosition.replace("icon", ""))] = (icon || fill === "flat") &&
|
|
665
669
|
iconPosition &&
|
|
666
670
|
iconPosition !== "afterText",
|
|
671
|
+
_b["arc-Button--hasSupportingText"] = supportingText,
|
|
667
672
|
_b["arc-Button--onDarkSurface"] = surface === "dark",
|
|
668
673
|
_b));
|
|
669
674
|
var commonProps = __assign({ id: id, onClick: onClick, ref: ref }, filterDataAttrs(props));
|
|
675
|
+
var buttonText = supportingText ? (React.createElement("span", null,
|
|
676
|
+
React.createElement("span", { className: "arc-Button-text" }, label),
|
|
677
|
+
React.createElement("span", { className: "arc-Button-supportingText" }, supportingText))) : (React.createElement("span", { className: "arc-Button-text" }, label));
|
|
670
678
|
var buttonIcon = icon || fill === "flat" ? (React.createElement(ButtonIcon, { icon: icon, isChevron: !icon && fill === "flat", isBeforeText: iconPosition === "beforeText" })) : null;
|
|
671
679
|
if (href && !isDisabled) {
|
|
672
680
|
return (React.createElement("a", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, href: href, rel: rel, target: target }),
|
|
673
681
|
React.createElement("span", { className: "arc-Button-inner" },
|
|
674
|
-
|
|
682
|
+
buttonText,
|
|
675
683
|
buttonIcon)));
|
|
676
684
|
}
|
|
677
685
|
return (React.createElement("button", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type }),
|
|
678
686
|
React.createElement("span", { className: "arc-Button-inner" },
|
|
679
|
-
|
|
687
|
+
buttonText,
|
|
680
688
|
buttonIcon)));
|
|
681
689
|
});
|
|
682
690
|
var ButtonIcon = function (_a) {
|
|
@@ -709,7 +717,7 @@ var Image = function (_a) {
|
|
|
709
717
|
var Heading = function (_a) {
|
|
710
718
|
var _b;
|
|
711
719
|
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$
|
|
720
|
+
var surface = useContext(Context$3).surface;
|
|
713
721
|
var Element = "span";
|
|
714
722
|
if (level) {
|
|
715
723
|
Element = "h".concat(level);
|
|
@@ -853,7 +861,7 @@ var useNumericInput = function (props) {
|
|
|
853
861
|
var Card = function (_a) {
|
|
854
862
|
var _b;
|
|
855
863
|
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$
|
|
864
|
+
var surface = useContext(Context$3).surface;
|
|
857
865
|
var interactionMode = useInteractionMode().interactionMode;
|
|
858
866
|
var Wrapper = function (_a) {
|
|
859
867
|
var children = _a.children;
|
|
@@ -912,7 +920,7 @@ Card.Image = CardImage;
|
|
|
912
920
|
*/
|
|
913
921
|
var CardLink = function (_a) {
|
|
914
922
|
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$
|
|
923
|
+
var surface = useContext(Context$3).surface;
|
|
916
924
|
return (React.createElement("a", { "aria-describedby": actionId, className: classNames({
|
|
917
925
|
"arc-CardLink": true,
|
|
918
926
|
"arc-CardLink--button": isButton,
|
|
@@ -924,38 +932,87 @@ var CardLink = function (_a) {
|
|
|
924
932
|
React.createElement(Icon, { icon: "btChevronRight2px", size: 8 })))));
|
|
925
933
|
};
|
|
926
934
|
|
|
935
|
+
var defaultContext$2 = {
|
|
936
|
+
requirementStatus: null
|
|
937
|
+
};
|
|
938
|
+
var Context$2 = createContext(defaultContext$2);
|
|
939
|
+
var Provider$3 = Context$2.Provider;
|
|
940
|
+
/**
|
|
941
|
+
* Use `FormControl` to provide inputs with labels, helper text and error messages
|
|
942
|
+
*/
|
|
943
|
+
var FormControl = function (_a) {
|
|
944
|
+
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"]);
|
|
945
|
+
var surface = useContext(Context$3).surface;
|
|
946
|
+
var _e = useAriaDescribedby({
|
|
947
|
+
errorMessage: errorMessage,
|
|
948
|
+
helper: helper,
|
|
949
|
+
id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
|
|
950
|
+
}), ariaDescribedby = _e.ariaDescribedby, idError = _e.idError, idHelper = _e.idHelper;
|
|
951
|
+
var LabelType = ElementType === "div" ? "label" : "legend";
|
|
952
|
+
var elementProps = {};
|
|
953
|
+
var labelProps = {};
|
|
954
|
+
if (LabelType === "label") {
|
|
955
|
+
labelProps["htmlFor"] = htmlFor;
|
|
956
|
+
if (htmlFor) {
|
|
957
|
+
labelProps["id"] = "".concat(htmlFor, "-label");
|
|
958
|
+
}
|
|
959
|
+
else if (id) {
|
|
960
|
+
labelProps["id"] = "".concat(id, "-label");
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
else {
|
|
964
|
+
elementProps["aria-describedby"] = ariaDescribedby;
|
|
965
|
+
}
|
|
966
|
+
return (React.createElement(Provider$3, { value: { requirementStatus: requirementStatus } },
|
|
967
|
+
React.createElement(ElementType, __assign({ className: classNames({
|
|
968
|
+
"arc-FormControl": true,
|
|
969
|
+
"arc-FormControl--smallLabel": labelSize === "s",
|
|
970
|
+
"arc-FormControl--onDarkSurface": surface === "dark"
|
|
971
|
+
}), id: id }, elementProps, filterDataAttrs(props)),
|
|
972
|
+
React.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
|
|
973
|
+
label,
|
|
974
|
+
requirementStatus === "optional" && (React.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
|
|
975
|
+
helper && (React.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper)),
|
|
976
|
+
children,
|
|
977
|
+
errorMessage && (React.createElement("div", { className: "arc-FormControl-error", id: idError }, errorMessage)))));
|
|
978
|
+
};
|
|
979
|
+
|
|
927
980
|
/**
|
|
928
981
|
* Use `Checkbox` to allow users to select individual options.
|
|
929
982
|
*/
|
|
930
983
|
var Checkbox = forwardRef(function (_a, ref) {
|
|
931
|
-
var
|
|
932
|
-
var
|
|
933
|
-
var
|
|
984
|
+
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"]);
|
|
985
|
+
var requirementStatus = useContext(Context$2).requirementStatus;
|
|
986
|
+
var surface = useContext(Context$3).surface;
|
|
987
|
+
var _f = useAriaDescribedby({
|
|
934
988
|
id: id,
|
|
935
|
-
errorMessage: errorMessage
|
|
936
|
-
|
|
937
|
-
}), ariaDescribedby = _e.ariaDescribedby, idHelper = _e.idHelper, idError = _e.idError;
|
|
989
|
+
errorMessage: errorMessage
|
|
990
|
+
}), ariaDescribedby = _f.ariaDescribedby, idError = _f.idError;
|
|
938
991
|
var idLabel = "".concat(id, "-label");
|
|
939
992
|
var checkedProps = {};
|
|
940
993
|
if (typeof onChange === "function") {
|
|
941
|
-
checkedProps.checked =
|
|
994
|
+
checkedProps.checked = checked;
|
|
942
995
|
}
|
|
943
|
-
else if (
|
|
996
|
+
else if (checked && !onChange) {
|
|
944
997
|
checkedProps.defaultChecked = true;
|
|
945
998
|
}
|
|
999
|
+
if (requirementStatus === "required") {
|
|
1000
|
+
isRequired = true;
|
|
1001
|
+
}
|
|
946
1002
|
return (React.createElement("div", { className: classNames({
|
|
947
1003
|
"arc-Checkbox": true,
|
|
948
1004
|
"arc-Checkbox--disabled": isDisabled,
|
|
949
1005
|
"arc-Checkbox--invalid": errorMessage,
|
|
1006
|
+
"arc-Checkbox--small": size === "s",
|
|
950
1007
|
"arc-Checkbox--onDarkSurface": surface === "dark"
|
|
951
1008
|
}) },
|
|
952
1009
|
React.createElement("label", { id: idLabel, htmlFor: id, className: "arc-Checkbox-label" },
|
|
953
|
-
React.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-
|
|
1010
|
+
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
1011
|
React.createElement("span", { className: "arc-Checkbox-box" }),
|
|
955
1012
|
React.createElement("span", null,
|
|
956
1013
|
label,
|
|
957
|
-
!isRequired && " (
|
|
958
|
-
|
|
1014
|
+
!isRequired && requirementStatus !== "optional" ? (React.createElement("span", { className: "arc-Checkbox-labelOptional" }, "(optional)")) : null,
|
|
1015
|
+
helper && React.createElement("span", { className: "arc-Checkbox-helper" }, helper))),
|
|
959
1016
|
errorMessage && (React.createElement("div", { id: idError, className: "arc-Checkbox-error" }, errorMessage))));
|
|
960
1017
|
});
|
|
961
1018
|
|
|
@@ -1058,7 +1115,7 @@ var Curve = function (_a) {
|
|
|
1058
1115
|
*/
|
|
1059
1116
|
var Disclosure = function (_a) {
|
|
1060
1117
|
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$
|
|
1118
|
+
var surface = useContext(Context$3).surface;
|
|
1062
1119
|
return (React.createElement("details", __assign({ className: classNames({
|
|
1063
1120
|
"arc-Disclosure": true,
|
|
1064
1121
|
"arc-Disclosure--indentDetails": indentDetails,
|
|
@@ -1081,53 +1138,13 @@ var Elevation = function (_a) {
|
|
|
1081
1138
|
_b)) }, filterDataAttrs(props)), children));
|
|
1082
1139
|
};
|
|
1083
1140
|
|
|
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
1141
|
/**
|
|
1125
1142
|
* Use `Group` to arrange flexible items in a row.
|
|
1126
1143
|
*/
|
|
1127
1144
|
var Group = function (_a) {
|
|
1128
1145
|
var _b;
|
|
1129
1146
|
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$
|
|
1147
|
+
var surface = useContext(Context$3).surface;
|
|
1131
1148
|
useEffect(function () {
|
|
1132
1149
|
React.Children.map(children, function (item) {
|
|
1133
1150
|
if (item && item.type !== GroupItem) {
|
|
@@ -1162,7 +1179,7 @@ Group.Item = GroupItem;
|
|
|
1162
1179
|
*/
|
|
1163
1180
|
var Markup = function (_a) {
|
|
1164
1181
|
var children = _a.children, _b = _a.isMeasured, isMeasured = _b === void 0 ? false : _b, props = __rest(_a, ["children", "isMeasured"]);
|
|
1165
|
-
var surface = useContext(Context$
|
|
1182
|
+
var surface = useContext(Context$3).surface;
|
|
1166
1183
|
return (React.createElement("div", __assign({ className: classNames({
|
|
1167
1184
|
"arc-Markup": true,
|
|
1168
1185
|
"arc-Markup--measured": isMeasured,
|
|
@@ -1234,9 +1251,6 @@ var RadioContext = createContext({});
|
|
|
1234
1251
|
var Provider$2 = RadioContext.Provider;
|
|
1235
1252
|
var useRadioContext = function () {
|
|
1236
1253
|
var context = useContext(RadioContext);
|
|
1237
|
-
if (!context) {
|
|
1238
|
-
console.warn("Ensure to use <RadioGroup.RadioButton /> within the <RadioGroup /> or its branded version.");
|
|
1239
|
-
}
|
|
1240
1254
|
return context;
|
|
1241
1255
|
};
|
|
1242
1256
|
|
|
@@ -1244,60 +1258,57 @@ var useRadioContext = function () {
|
|
|
1244
1258
|
* Radio Button component.
|
|
1245
1259
|
*/
|
|
1246
1260
|
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(),
|
|
1249
|
-
var surface = useContext(Context$
|
|
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;
|
|
1261
|
+
var helper = _a.helper, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, value = _a.value, props = __rest(_a, ["helper", "id", "isDisabled", "label", "value"]);
|
|
1262
|
+
var _b = useRadioContext(), blurEvent = _b.blurEvent, changeEvent = _b.changeEvent, groupDisabled = _b.groupDisabled, checkedValue = _b.checkedValue, labelSize = _b.labelSize, name = _b.name, size = _b.size;
|
|
1263
|
+
var surface = useContext(Context$3).surface;
|
|
1256
1264
|
var idLabel = "".concat(id, "-label");
|
|
1257
|
-
var checked =
|
|
1258
|
-
var disabled = isDisabled ? isDisabled : false;
|
|
1265
|
+
var checked = checkedValue === value ? true : false;
|
|
1259
1266
|
return (React.createElement("div", __assign({ className: classNames({
|
|
1260
1267
|
"arc-RadioButton": true,
|
|
1261
|
-
"arc-RadioButton--
|
|
1262
|
-
"arc-RadioButton--
|
|
1263
|
-
"arc-RadioButton--
|
|
1264
|
-
"arc-RadioButton--required": isRequired,
|
|
1268
|
+
"arc-RadioButton--disabled": isDisabled || groupDisabled,
|
|
1269
|
+
"arc-RadioButton--small": size === "s",
|
|
1270
|
+
"arc-RadioButton--smallLabel": labelSize === "s",
|
|
1265
1271
|
"arc-RadioButton--onDarkSurface": surface === "dark"
|
|
1266
1272
|
}) }, filterDataAttrs(props)),
|
|
1267
|
-
React.createElement("
|
|
1268
|
-
|
|
1269
|
-
|
|
1273
|
+
React.createElement("label", { className: "arc-RadioButton-label", htmlFor: id, id: idLabel },
|
|
1274
|
+
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 }),
|
|
1275
|
+
React.createElement("span", null,
|
|
1276
|
+
label,
|
|
1277
|
+
helper && React.createElement("span", { className: "arc-RadioButton-helper" }, helper)))));
|
|
1270
1278
|
});
|
|
1271
1279
|
|
|
1272
1280
|
/**
|
|
1273
1281
|
* Use `RadioGroup` to wrap and control radio buttons and apply default values
|
|
1274
1282
|
*/
|
|
1275
1283
|
var RadioGroup = function (_a) {
|
|
1276
|
-
var children = _a.children,
|
|
1284
|
+
var children = _a.children, checkedValue = _a.checkedValue, _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", "checkedValue", "isDisabled", "id", "helper", "label", "labelSize", "name", "onBlur", "onChange", "size"]);
|
|
1285
|
+
useEffect(function () {
|
|
1286
|
+
React.Children.map(children, function (item) {
|
|
1287
|
+
if (item && item.type !== RadioButton) {
|
|
1288
|
+
throw new Error("Illegal child passed to <RadioGroup />. Ensure to only use <RadioGroup.RadioButton />.");
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
}, [children]);
|
|
1277
1292
|
return (React.createElement(Provider$2, { value: {
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
errorMessage: errorMessage,
|
|
1293
|
+
blurEvent: onBlur,
|
|
1294
|
+
changeEvent: onChange,
|
|
1295
|
+
groupDisabled: isDisabled,
|
|
1296
|
+
checkedValue: checkedValue,
|
|
1297
|
+
labelSize: labelSize,
|
|
1284
1298
|
name: name,
|
|
1285
|
-
|
|
1299
|
+
size: size
|
|
1286
1300
|
} },
|
|
1287
|
-
React.createElement(
|
|
1288
|
-
React.createElement("
|
|
1289
|
-
"arc-RadioGroup": true,
|
|
1290
|
-
"arc-RadioGroup--invalid": errorMessage,
|
|
1291
|
-
"arc-RadioGroup--disabled": isDisabled
|
|
1292
|
-
}) }, filterDataAttrs(props)), children))));
|
|
1301
|
+
React.createElement("div", __assign({ className: "arc-RadioGroup" }, filterDataAttrs(props)),
|
|
1302
|
+
React.createElement(FormControl, { elementType: "fieldset", label: label, labelSize: labelSize, helper: helper, id: id, requirementStatus: "not-applicable" }, children))));
|
|
1293
1303
|
};
|
|
1304
|
+
RadioButton.displayName = "RadioGroup.RadioButton";
|
|
1294
1305
|
RadioGroup.RadioButton = RadioButton;
|
|
1295
1306
|
|
|
1296
1307
|
/**
|
|
1297
1308
|
* Use `Rule` to display a horizontal rule.
|
|
1298
1309
|
*/
|
|
1299
1310
|
var Rule = function (props) {
|
|
1300
|
-
var surface = useContext(Context$
|
|
1311
|
+
var surface = useContext(Context$3).surface;
|
|
1301
1312
|
return (React.createElement("hr", __assign({ className: classNames({
|
|
1302
1313
|
"arc-Rule": true,
|
|
1303
1314
|
"arc-Rule--onDarkSurface": surface === "dark"
|
|
@@ -1501,7 +1512,9 @@ var Panel = function (_a) {
|
|
|
1501
1512
|
// and the click is not on a SubNavItem-link.
|
|
1502
1513
|
// This ensures that one SubNavItem Panel per NavItem always remains open.
|
|
1503
1514
|
(subNavItemRef &&
|
|
1504
|
-
!e.target.classList.contains(subNavLink)
|
|
1515
|
+
!e.target.classList.contains(subNavLink) &&
|
|
1516
|
+
!e.target.classList.contains("".concat(subNavLink, "Title")) &&
|
|
1517
|
+
!e.target.classList.contains("".concat(subNavLink, "SubTitle"))) ||
|
|
1505
1518
|
// Panel is inside a SubNavItem
|
|
1506
1519
|
// and the click is not inside the Panel's NavItem parent.
|
|
1507
1520
|
// This prevents SubNavItem Panels in sibling NavItems from being closed.
|
|
@@ -1629,12 +1642,31 @@ var NavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void
|
|
|
1629
1642
|
});
|
|
1630
1643
|
}); });
|
|
1631
1644
|
|
|
1645
|
+
/**
|
|
1646
|
+
* Use `Text` to display text.
|
|
1647
|
+
*/
|
|
1648
|
+
var Text = function (_a) {
|
|
1649
|
+
var _b;
|
|
1650
|
+
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"]);
|
|
1651
|
+
var surface = useContext(Context$3).surface;
|
|
1652
|
+
return (React.createElement("span", __assign({ className: classNames((_b = {
|
|
1653
|
+
"arc-Text": true
|
|
1654
|
+
},
|
|
1655
|
+
_b[suffixModifier("arc-Text--align", align)] = align !== "left",
|
|
1656
|
+
_b["arc-Text--inline"] = isInline,
|
|
1657
|
+
_b["arc-Text--measured"] = isMeasured,
|
|
1658
|
+
_b["arc-Text--size".concat(size && size.toUpperCase())] = size && size !== "m",
|
|
1659
|
+
_b["arc-Text--".concat(tone)] = tone !== "default",
|
|
1660
|
+
_b["arc-Text--onDarkSurface"] = surface === "dark",
|
|
1661
|
+
_b)) }, filterDataAttrs(props)), children));
|
|
1662
|
+
};
|
|
1663
|
+
|
|
1632
1664
|
var SubNavItem = function (_a) {
|
|
1633
1665
|
var _b, _c;
|
|
1634
|
-
var children = _a.children, _d = _a.isDefaultItem, isDefaultItem = _d === void 0 ? false : _d, href = _a.href, promo = _a.promo, title = _a.title, props = __rest(_a, ["children", "isDefaultItem", "href", "promo", "title"]);
|
|
1635
|
-
var
|
|
1666
|
+
var children = _a.children, _d = _a.isDefaultItem, isDefaultItem = _d === void 0 ? false : _d, href = _a.href, offsetXL = _a.offsetXL, promo = _a.promo, subTitle = _a.subTitle, title = _a.title, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["children", "isDefaultItem", "href", "offsetXL", "promo", "subTitle", "title", "viewAllTitle"]);
|
|
1667
|
+
var navItem = useContext(Context$1).navItem;
|
|
1636
1668
|
var subNavItem = useRef();
|
|
1637
|
-
var
|
|
1669
|
+
var _e = useState(false), panelOpen = _e[0], setPanelOpen = _e[1];
|
|
1638
1670
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
1639
1671
|
useEffect(function () {
|
|
1640
1672
|
React.Children.map(children, function (item) {
|
|
@@ -1654,52 +1686,75 @@ var SubNavItem = function (_a) {
|
|
|
1654
1686
|
setPanelOpen(false);
|
|
1655
1687
|
}
|
|
1656
1688
|
}, [isDefaultItem, isMinWidthArcBreakpointL]);
|
|
1689
|
+
var linkTitle = (React.createElement(React.Fragment, null,
|
|
1690
|
+
React.createElement("span", { className: "arc-SiteHeaderSubNavItem-linkTitle" }, title),
|
|
1691
|
+
subTitle ? (React.createElement("span", { className: "arc-SiteHeaderSubNavItem-linkSubTitle" }, subTitle)) : null));
|
|
1657
1692
|
return (React.createElement("li", __assign({ className: classNames((_b = {},
|
|
1658
1693
|
_b["arc-SiteHeaderSubNavItem"] = true,
|
|
1659
1694
|
_b["arc-SiteHeaderSubNavItem--linkSelected"] = children && panelOpen,
|
|
1660
|
-
_b
|
|
1695
|
+
_b[suffixModifier("arc-SiteHeaderSubNavItem--offsetXL", offsetXL || "")] = offsetXL,
|
|
1696
|
+
_b)), ref: subNavItem }, filterDataAttrs(props), { "data-default-item": isDefaultItem || null }), !children ? (href ? (React.createElement("a", { className: "arc-SiteHeaderSubNavItem-link", href: href }, linkTitle)) : null) : (React.createElement(React.Fragment, null,
|
|
1661
1697
|
React.createElement("button", { "aria-expanded": panelOpen, className: classNames((_c = {},
|
|
1662
1698
|
_c["arc-SiteHeaderSubNavItem-link"] = true,
|
|
1663
1699
|
_c["arc-SiteHeaderSubNavItem-link--itemHasChildren"] = children,
|
|
1664
1700
|
_c)), onClick: function () {
|
|
1665
1701
|
setPanelOpen(true);
|
|
1666
|
-
} },
|
|
1667
|
-
React.createElement(Panel, { navItemRef: navItem, open: panelOpen, setOpen: setPanelOpen, subNavItemRef: subNavItem, subNavLink: "arc-SiteHeaderSubNavItem-link", promo: promo, title: React.createElement(
|
|
1668
|
-
|
|
1669
|
-
React.createElement("
|
|
1702
|
+
} }, linkTitle),
|
|
1703
|
+
React.createElement(Panel, { navItemRef: navItem, open: panelOpen, setOpen: setPanelOpen, subNavItemRef: subNavItem, subNavLink: "arc-SiteHeaderSubNavItem-link", promo: promo, title: React.createElement("span", null,
|
|
1704
|
+
title,
|
|
1705
|
+
subTitle && (React.createElement(Text, { size: "xs", tone: "supporting" }, subTitle))), viewAll: href ? (React.createElement(Panel.ViewAll, { href: href, title: viewAllTitle || "View all ".concat(title.toLowerCase()) })) : (undefined) }, children)))));
|
|
1670
1706
|
};
|
|
1671
1707
|
|
|
1672
1708
|
var SubNavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1673
|
-
var children, promo, link, href, title, props;
|
|
1674
|
-
|
|
1675
|
-
|
|
1709
|
+
var children, promo, link, linkTitle, viewAll, href, title, offsetXL, props;
|
|
1710
|
+
var _a;
|
|
1711
|
+
return __generator(this, function (_b) {
|
|
1712
|
+
switch (_b.label) {
|
|
1676
1713
|
case 0:
|
|
1677
1714
|
children = el.querySelector(".arc-SiteHeaderPanel-items");
|
|
1678
1715
|
promo = el.querySelector(".arc-SiteHeaderPanel-promo");
|
|
1679
1716
|
if (!children) return [3 /*break*/, 2];
|
|
1680
1717
|
return [4 /*yield*/, hydrate(children)];
|
|
1681
1718
|
case 1:
|
|
1682
|
-
children =
|
|
1683
|
-
|
|
1719
|
+
children = _b.sent();
|
|
1720
|
+
_b.label = 2;
|
|
1684
1721
|
case 2:
|
|
1685
1722
|
if (!promo) return [3 /*break*/, 4];
|
|
1686
1723
|
return [4 /*yield*/, hydrate(promo)];
|
|
1687
1724
|
case 3:
|
|
1688
|
-
promo =
|
|
1689
|
-
|
|
1725
|
+
promo = _b.sent();
|
|
1726
|
+
_b.label = 4;
|
|
1690
1727
|
case 4:
|
|
1691
1728
|
link = el.querySelector(".arc-SiteHeaderSubNavItem-link");
|
|
1729
|
+
linkTitle = el.querySelector(".arc-SiteHeaderSubNavItem-linkTitle");
|
|
1730
|
+
viewAll = el.querySelector(".arc-SiteHeaderPanel-viewAll");
|
|
1692
1731
|
href = "";
|
|
1693
1732
|
title = "";
|
|
1694
1733
|
if (link) {
|
|
1695
1734
|
href = link.getAttribute("href") || /* istanbul ignore next */ "";
|
|
1696
|
-
|
|
1735
|
+
}
|
|
1736
|
+
if (linkTitle) {
|
|
1737
|
+
title = linkTitle.textContent || /* istanbul ignore next */ "";
|
|
1738
|
+
}
|
|
1739
|
+
if (viewAll) {
|
|
1740
|
+
href = viewAll.getAttribute("href") || /* istanbul ignore next */ "";
|
|
1741
|
+
}
|
|
1742
|
+
offsetXL = undefined;
|
|
1743
|
+
if (el.classList.contains("arc-SiteHeaderSubNavItem--offsetXL24")) {
|
|
1744
|
+
offsetXL = "24";
|
|
1745
|
+
}
|
|
1746
|
+
if (el.classList.contains("arc-SiteHeaderSubNavItem--offsetXL48")) {
|
|
1747
|
+
offsetXL = "48";
|
|
1697
1748
|
}
|
|
1698
1749
|
props = {
|
|
1699
1750
|
href: href,
|
|
1700
1751
|
isDefaultItem: Boolean(el.dataset.defaultItem),
|
|
1752
|
+
offsetXL: offsetXL,
|
|
1701
1753
|
promo: promo || undefined,
|
|
1702
|
-
|
|
1754
|
+
subTitle: ((_a = el.querySelector(".arc-SiteHeaderSubNavItem-linkSubTitle")) === null || _a === void 0 ? void 0 : _a.textContent) ||
|
|
1755
|
+
undefined,
|
|
1756
|
+
title: title,
|
|
1757
|
+
viewAllTitle: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.textContent) || undefined
|
|
1703
1758
|
};
|
|
1704
1759
|
return [2 /*return*/, React.createElement(SubNavItem, __assign({}, props), children)];
|
|
1705
1760
|
}
|
|
@@ -1766,7 +1821,7 @@ function wrap(el, wrapper) {
|
|
|
1766
1821
|
wrapper.appendChild(el);
|
|
1767
1822
|
}
|
|
1768
1823
|
var NavItemWithSubNavRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1769
|
-
var subNavItem1, subNavItem2, subNavItem3, div1, div2, slot1, slot2, slot3, div3, link, subTitle, viewAll, title, props;
|
|
1824
|
+
var subNavItem1, subNavItem2, subNavItem3, div1, div2, slot1, slot2, slot3, div3, link, subTitle, viewAllNodes, viewAll, title, props;
|
|
1770
1825
|
return __generator(this, function (_a) {
|
|
1771
1826
|
switch (_a.label) {
|
|
1772
1827
|
case 0:
|
|
@@ -1796,7 +1851,8 @@ var NavItemWithSubNavRehydrator = (function (el, hydrate) { return __awaiter(voi
|
|
|
1796
1851
|
case 4:
|
|
1797
1852
|
link = el.querySelector(".arc-SiteHeaderNavItem-link");
|
|
1798
1853
|
subTitle = el.querySelector(".arc-SiteHeaderPanel-title");
|
|
1799
|
-
|
|
1854
|
+
viewAllNodes = el.querySelectorAll(".arc-SiteHeaderPanel-viewAll");
|
|
1855
|
+
viewAll = viewAllNodes[viewAllNodes.length - 1];
|
|
1800
1856
|
title = "";
|
|
1801
1857
|
if (link) {
|
|
1802
1858
|
title = link.textContent || /* istanbul ignore next */ "";
|
|
@@ -1963,31 +2019,12 @@ SiteHeaderRehydrator.NavItemRehydrator = NavItemRehydrator;
|
|
|
1963
2019
|
SiteHeaderRehydrator.NavItemWithSubNavRehydrator = NavItemWithSubNavRehydrator;
|
|
1964
2020
|
SiteHeaderRehydrator.SubNavItemRehydrator = SubNavItemRehydrator;
|
|
1965
2021
|
|
|
1966
|
-
/**
|
|
1967
|
-
* Use `Text` to display text.
|
|
1968
|
-
*/
|
|
1969
|
-
var Text = function (_a) {
|
|
1970
|
-
var _b;
|
|
1971
|
-
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;
|
|
1973
|
-
return (React.createElement("span", __assign({ className: classNames((_b = {
|
|
1974
|
-
"arc-Text": true
|
|
1975
|
-
},
|
|
1976
|
-
_b[suffixModifier("arc-Text--align", align)] = align !== "left",
|
|
1977
|
-
_b["arc-Text--inline"] = isInline,
|
|
1978
|
-
_b["arc-Text--measured"] = isMeasured,
|
|
1979
|
-
_b["arc-Text--size".concat(size && size.toUpperCase())] = size && size !== "m",
|
|
1980
|
-
_b["arc-Text--".concat(tone)] = tone !== "default",
|
|
1981
|
-
_b["arc-Text--onDarkSurface"] = surface === "dark",
|
|
1982
|
-
_b)) }, filterDataAttrs(props)), children));
|
|
1983
|
-
};
|
|
1984
|
-
|
|
1985
2022
|
/**
|
|
1986
2023
|
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
1987
2024
|
*/
|
|
1988
2025
|
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$
|
|
2026
|
+
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"]);
|
|
2027
|
+
var surface = useContext(Context$3).surface;
|
|
1991
2028
|
var inferredInputProps = useNumericInput({ inputMode: inputMode, pattern: pattern, type: type });
|
|
1992
2029
|
// Although this is used within FormControlWrapper, it's deterministic so we can call it here too
|
|
1993
2030
|
var ariaDescribedby = useAriaDescribedby({
|
|
@@ -2000,8 +2037,8 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
2000
2037
|
"arc-TextInput--invalid": errorMessage,
|
|
2001
2038
|
"arc-TextInput--onDarkSurface": surface === "dark"
|
|
2002
2039
|
}) }, filterDataAttrs(props)),
|
|
2003
|
-
React.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id,
|
|
2004
|
-
React.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false",
|
|
2040
|
+
React.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional" },
|
|
2041
|
+
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
2042
|
});
|
|
2006
2043
|
|
|
2007
2044
|
/**
|
|
@@ -2018,5 +2055,5 @@ var VerticalSpace = function (_a) {
|
|
|
2018
2055
|
_b)) }, filterDataAttrs(props))));
|
|
2019
2056
|
};
|
|
2020
2057
|
|
|
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$
|
|
2058
|
+
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
2059
|
//# sourceMappingURL=index.es.js.map
|