@arc-ui/components 3.0.0 → 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 +251 -187
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +251 -187
- package/dist/index.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/Base/Base.d.ts +1 -1
- package/dist/types/components/BrandLogo/BrandLogo.d.ts +5 -0
- package/dist/types/components/Button/Button.d.ts +4 -0
- package/dist/types/components/Card/Card.d.ts +2 -2
- package/dist/types/components/Checkbox/Checkbox.d.ts +15 -6
- package/dist/types/components/FormControl/FormControl.d.ts +8 -2
- package/dist/types/components/FormControl/index.d.ts +1 -1
- package/dist/types/components/Icon/Icon.d.ts +0 -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 +4 -5
- package/dist/types/components/SiteHeader/SiteHeader.d.ts +5 -0
- package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.d.ts +10 -0
- package/dist/types/components/TextInput/TextInput.d.ts +15 -9
- package/package.json +8 -5
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
|
},
|
|
@@ -355,15 +355,17 @@ __spreadArray([], backgroundsShared, true);
|
|
|
355
355
|
* Use `BrandLogo` to display the brand logo.
|
|
356
356
|
*/
|
|
357
357
|
var BrandLogo = function (_a) {
|
|
358
|
-
var _b
|
|
359
|
-
var
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
358
|
+
var _b;
|
|
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$3).surface;
|
|
361
|
+
return (React.createElement("div", __assign({ className: classNames((_b = {
|
|
362
|
+
"arc-BrandLogo": true,
|
|
363
|
+
"arc-BrandLogo--colorBrand": color === "brand",
|
|
364
|
+
"arc-BrandLogo--onDarkSurface": surface === "dark"
|
|
365
|
+
},
|
|
366
|
+
_b[suffixModifier("arc-BrandLogo--subBrand", subBrand || "")] = subBrand,
|
|
367
|
+
_b)), style: {
|
|
368
|
+
width: size !== 34 ? size : undefined
|
|
367
369
|
} }, filterDataAttrs(props)), label ? React.createElement("span", { className: "arc-BrandLogo-text" }, label) : null));
|
|
368
370
|
};
|
|
369
371
|
|
|
@@ -390,6 +392,8 @@ const iconsSelected = [
|
|
|
390
392
|
"btArrowLeftRightFill",
|
|
391
393
|
"btArrowRightFill",
|
|
392
394
|
"btArrowUpFill",
|
|
395
|
+
"btAttachmentAltFill",
|
|
396
|
+
"btAttachmentFill",
|
|
393
397
|
"btBagFill",
|
|
394
398
|
"btBasketFill",
|
|
395
399
|
"btBinFill",
|
|
@@ -410,6 +414,8 @@ const iconsSelected = [
|
|
|
410
414
|
"btChatFill",
|
|
411
415
|
"btChatMessageFill",
|
|
412
416
|
"btChatTypingFill",
|
|
417
|
+
"btClipboardFill",
|
|
418
|
+
"btClipboardTickFill",
|
|
413
419
|
"btClockFill",
|
|
414
420
|
"btCloudAlertFill",
|
|
415
421
|
"btCloudDesktopFill",
|
|
@@ -462,6 +468,7 @@ const iconsSelected = [
|
|
|
462
468
|
"btFaceVeryHappyFill",
|
|
463
469
|
"btFolderFill",
|
|
464
470
|
"btGamingFill",
|
|
471
|
+
"btGenderFemaleAndMaleFill",
|
|
465
472
|
"btGenderFemaleFill",
|
|
466
473
|
"btGenderMaleFill",
|
|
467
474
|
"btGenderNeutralFill",
|
|
@@ -469,6 +476,7 @@ const iconsSelected = [
|
|
|
469
476
|
"btGlobalConnectivityFill",
|
|
470
477
|
"btGlobeFill",
|
|
471
478
|
"btGlossaryFill",
|
|
479
|
+
"btGraphBarAndPlotFill",
|
|
472
480
|
"btGraphBarChartFill",
|
|
473
481
|
"btGraphDownFill",
|
|
474
482
|
"btGraphUpAndDownFill",
|
|
@@ -493,6 +501,7 @@ const iconsSelected = [
|
|
|
493
501
|
"btLanFill",
|
|
494
502
|
"btLaptopAndMobileFill",
|
|
495
503
|
"btLaptopConnectAndShareFill",
|
|
504
|
+
"btLaptopDetectionFill",
|
|
496
505
|
"btLaptopFill",
|
|
497
506
|
"btLaptopSecureFill",
|
|
498
507
|
"btLaptopVideoConferenceFill",
|
|
@@ -520,6 +529,7 @@ const iconsSelected = [
|
|
|
520
529
|
"btMoneyFill",
|
|
521
530
|
"btMonitorFill",
|
|
522
531
|
"btMonitorTickFill",
|
|
532
|
+
"btMoonFill",
|
|
523
533
|
"btMouseFill",
|
|
524
534
|
"btNamingFill",
|
|
525
535
|
"btNewWindowFill",
|
|
@@ -528,12 +538,16 @@ const iconsSelected = [
|
|
|
528
538
|
"btNoSpeechFill",
|
|
529
539
|
"btNoViewFill",
|
|
530
540
|
"btNotificationFill",
|
|
541
|
+
"btPasswordFIll",
|
|
531
542
|
"btPaymentMethodFill",
|
|
532
543
|
"btPayphoneFill",
|
|
533
544
|
"btPhoneBarredFill",
|
|
534
545
|
"btPhoneFill",
|
|
535
546
|
"btPictureFill",
|
|
547
|
+
"btPinAltFill",
|
|
548
|
+
"btPinFill",
|
|
536
549
|
"btPlaneFill",
|
|
550
|
+
"btPlanningFill",
|
|
537
551
|
"btPlantFill",
|
|
538
552
|
"btPlayFill",
|
|
539
553
|
"btPodcastFill",
|
|
@@ -547,15 +561,18 @@ const iconsSelected = [
|
|
|
547
561
|
"btRecyclingFill",
|
|
548
562
|
"btRefreshFill",
|
|
549
563
|
"btRefundFill",
|
|
564
|
+
"btReleaseFill",
|
|
550
565
|
"btResolution4KFill",
|
|
551
566
|
"btResolutionHdFill",
|
|
552
567
|
"btResolutionSdFill",
|
|
553
568
|
"btScaleFill",
|
|
554
569
|
"btSearchFill",
|
|
555
570
|
"btServerFill",
|
|
571
|
+
"btSettingsAltFill",
|
|
556
572
|
"btSettingsFill",
|
|
557
573
|
"btShieldAddFill",
|
|
558
574
|
"btShieldFill",
|
|
575
|
+
"btShieldQuestionMarkFIll",
|
|
559
576
|
"btShieldSecurityFill",
|
|
560
577
|
"btShieldTickFill",
|
|
561
578
|
"btShipFill",
|
|
@@ -584,6 +601,7 @@ const iconsSelected = [
|
|
|
584
601
|
"btTvAndHubAndPhoneFill",
|
|
585
602
|
"btTabletFill",
|
|
586
603
|
"btTabletWithKeyboardFill",
|
|
604
|
+
"btTagFill",
|
|
587
605
|
"btTaxonomyFill",
|
|
588
606
|
"btTechBarFill",
|
|
589
607
|
"btThumbsDownFill",
|
|
@@ -617,13 +635,13 @@ const iconsSelected = [
|
|
|
617
635
|
var Icon = function (_a) {
|
|
618
636
|
var _b;
|
|
619
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"]);
|
|
620
|
-
var surface = useContext(Context$
|
|
638
|
+
var surface = useContext(Context$3).surface;
|
|
621
639
|
return (React.createElement("span", __assign({ "aria-label": label, className: classNames((_b = {},
|
|
622
640
|
_b["arc-Icon"] = true,
|
|
623
|
-
_b[suffixModifier("arc-Icon--color", color
|
|
641
|
+
_b[suffixModifier("arc-Icon--color", color)] = color !== "auto",
|
|
624
642
|
_b["arc-Icon--".concat(icon).concat(isSelected && iconsSelected.includes("".concat(icon, "Fill")) ? "Fill" : "")] = icon,
|
|
625
643
|
_b["arc-Icon--inline"] = isInline,
|
|
626
|
-
_b["arc-Icon--
|
|
644
|
+
_b["arc-Icon--onDarkSurface"] = surface === "dark",
|
|
627
645
|
_b)), role: label ? "img" : undefined, style: {
|
|
628
646
|
height: size,
|
|
629
647
|
width: size
|
|
@@ -635,31 +653,34 @@ var Icon = function (_a) {
|
|
|
635
653
|
*/
|
|
636
654
|
var Button = forwardRef(function (_a, ref) {
|
|
637
655
|
var _b;
|
|
638
|
-
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"]);
|
|
639
|
-
var surface = useContext(Context$
|
|
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;
|
|
640
658
|
var buttonClasses = classNames((_b = {
|
|
641
659
|
"arc-Button": true,
|
|
642
|
-
"arc-Button--displayBlock": isDisplayBlock
|
|
643
|
-
"arc-Button--fillFlat": fill === "flat",
|
|
644
|
-
"arc-Button--fillOutlined": fill === "outlined",
|
|
645
|
-
"arc-Button--fullWidth": isFullWidth
|
|
660
|
+
"arc-Button--displayBlock": isDisplayBlock
|
|
646
661
|
},
|
|
662
|
+
_b[suffixModifier("arc-Button--fill", fill)] = fill !== "solid",
|
|
663
|
+
_b["arc-Button--fullWidth"] = isFullWidth,
|
|
647
664
|
_b[suffixModifier("arc-Button--icon", iconPosition.replace("icon", ""))] = (icon || fill === "flat") &&
|
|
648
665
|
iconPosition &&
|
|
649
666
|
iconPosition !== "afterText",
|
|
667
|
+
_b["arc-Button--hasSupportingText"] = supportingText,
|
|
650
668
|
_b["arc-Button--onDarkSurface"] = surface === "dark",
|
|
651
669
|
_b));
|
|
652
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));
|
|
653
674
|
var buttonIcon = icon || fill === "flat" ? (React.createElement(ButtonIcon, { icon: icon, isChevron: !icon && fill === "flat", isBeforeText: iconPosition === "beforeText" })) : null;
|
|
654
675
|
if (href && !isDisabled) {
|
|
655
676
|
return (React.createElement("a", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, href: href, rel: rel, target: target }),
|
|
656
677
|
React.createElement("span", { className: "arc-Button-inner" },
|
|
657
|
-
|
|
678
|
+
buttonText,
|
|
658
679
|
buttonIcon)));
|
|
659
680
|
}
|
|
660
681
|
return (React.createElement("button", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type }),
|
|
661
682
|
React.createElement("span", { className: "arc-Button-inner" },
|
|
662
|
-
|
|
683
|
+
buttonText,
|
|
663
684
|
buttonIcon)));
|
|
664
685
|
});
|
|
665
686
|
var ButtonIcon = function (_a) {
|
|
@@ -692,7 +713,7 @@ var Image = function (_a) {
|
|
|
692
713
|
var Heading = function (_a) {
|
|
693
714
|
var _b;
|
|
694
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"]);
|
|
695
|
-
var surface = useContext(Context$
|
|
716
|
+
var surface = useContext(Context$3).surface;
|
|
696
717
|
var Element = "span";
|
|
697
718
|
if (level) {
|
|
698
719
|
Element = "h".concat(level);
|
|
@@ -700,7 +721,7 @@ var Heading = function (_a) {
|
|
|
700
721
|
return (React.createElement(Element, __assign({ className: classNames((_b = {
|
|
701
722
|
"arc-Heading": true
|
|
702
723
|
},
|
|
703
|
-
_b[suffixModifier("arc-Heading--align", align
|
|
724
|
+
_b[suffixModifier("arc-Heading--align", align)] = align && align !== "left",
|
|
704
725
|
_b["arc-Heading--size".concat(size && size.toUpperCase())] = size,
|
|
705
726
|
_b["arc-Heading--casingNone"] = casing === "none",
|
|
706
727
|
_b["arc-Heading--colorBrand"] = color === "brand",
|
|
@@ -830,25 +851,24 @@ var useNumericInput = function (props) {
|
|
|
830
851
|
return { inputMode: inputMode, pattern: pattern, type: type };
|
|
831
852
|
};
|
|
832
853
|
|
|
833
|
-
var defaultActionLabel = "Read more";
|
|
834
854
|
/**
|
|
835
855
|
* Use `Card` to contain content and actions about a single subject.
|
|
836
856
|
*/
|
|
837
857
|
var Card = function (_a) {
|
|
838
858
|
var _b;
|
|
839
|
-
var actionId = _a.actionId, _c = _a.actionLabel, actionLabel = _c === void 0 ?
|
|
840
|
-
var surface = useContext(Context$
|
|
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"]);
|
|
860
|
+
var surface = useContext(Context$3).surface;
|
|
841
861
|
var interactionMode = useInteractionMode().interactionMode;
|
|
842
862
|
var Wrapper = function (_a) {
|
|
843
863
|
var children = _a.children;
|
|
844
|
-
return fill === "outlined" ? (React.createElement("div", null, children)) : (React.createElement(Surface, { background: surface === "dark" ? "white" : "darker" }, children));
|
|
864
|
+
return fill === "outlined" || fill === "neutral" ? (React.createElement("div", null, children)) : (React.createElement(Surface, { background: surface === "dark" ? "white" : "darker" }, children));
|
|
845
865
|
};
|
|
846
866
|
var coverImage = imageSrc && (React.createElement(CardImage, { alt: imageAlt, src: imageSrc, srcSet: imageSrcSet, height: imageHeight }));
|
|
847
867
|
return (React.createElement("div", __assign({ className: classNames((_b = {
|
|
848
868
|
"arc-Card": true,
|
|
849
|
-
"arc-Card--onDarkSurface": surface === "dark"
|
|
850
|
-
"arc-Card--fillOutlined": fill === "outlined"
|
|
869
|
+
"arc-Card--onDarkSurface": surface === "dark"
|
|
851
870
|
},
|
|
871
|
+
_b[suffixModifier("arc-Card--fill", fill)] = fill !== "solid",
|
|
852
872
|
_b["arc-is-".concat(interactionMode, "InteractionMode")] = interactionMode,
|
|
853
873
|
_b)) }, filterDataAttrs(props)),
|
|
854
874
|
React.createElement(Wrapper, null,
|
|
@@ -856,12 +876,12 @@ var Card = function (_a) {
|
|
|
856
876
|
React.createElement("div", { className: "arc-Card-header" },
|
|
857
877
|
React.createElement("div", { className: "arc-Card-title" },
|
|
858
878
|
React.createElement(Heading, { size: titleSize },
|
|
859
|
-
React.createElement(CardLink, { actionId: actionId, href: href, stretch: true, target: target }, title))),
|
|
879
|
+
React.createElement(CardLink, { actionId: actionId, fill: fill, href: href, stretch: true, target: target }, title))),
|
|
860
880
|
coverImage),
|
|
861
881
|
React.createElement("div", { className: "arc-Card-children" },
|
|
862
882
|
React.createElement(Card.Block, null, children)),
|
|
863
883
|
href && (React.createElement(CardBlock, null,
|
|
864
|
-
React.createElement(CardLink, { href: href, actionId: actionId, isButton: true }, actionLabel
|
|
884
|
+
React.createElement(CardLink, { href: href, fill: fill, actionId: actionId, isButton: true }, actionLabel)))))));
|
|
865
885
|
};
|
|
866
886
|
/**
|
|
867
887
|
* Internal `Card.Block` component to section blocks of content within a Card.
|
|
@@ -895,12 +915,12 @@ Card.Image = CardImage;
|
|
|
895
915
|
* Internal `CardLink` component.
|
|
896
916
|
*/
|
|
897
917
|
var CardLink = function (_a) {
|
|
898
|
-
var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, href = _a.href, stretch = _a.stretch, target = _a.target;
|
|
899
|
-
var surface = useContext(Context$
|
|
918
|
+
var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, fill = _a.fill, href = _a.href, stretch = _a.stretch, target = _a.target;
|
|
919
|
+
var surface = useContext(Context$3).surface;
|
|
900
920
|
return (React.createElement("a", { "aria-describedby": actionId, className: classNames({
|
|
901
921
|
"arc-CardLink": true,
|
|
902
922
|
"arc-CardLink--button": isButton,
|
|
903
|
-
"arc-CardLink--onDarkSurface": surface === "dark",
|
|
923
|
+
"arc-CardLink--onDarkSurface": surface === "dark" && fill !== "neutral",
|
|
904
924
|
"arc-CardLink--stretch": stretch
|
|
905
925
|
}), href: href, rel: target === "_blank" ? "noopener noreferrer" : undefined, tabIndex: isButton ? -1 : undefined, target: target },
|
|
906
926
|
React.createElement("span", { className: "arc-CardLink-text" }, children),
|
|
@@ -908,38 +928,89 @@ var CardLink = function (_a) {
|
|
|
908
928
|
React.createElement(Icon, { icon: "btChevronRight2px", size: 8 })))));
|
|
909
929
|
};
|
|
910
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
|
+
|
|
911
977
|
/**
|
|
912
978
|
* Use `Checkbox` to allow users to select individual options.
|
|
913
979
|
*/
|
|
914
980
|
var Checkbox = forwardRef(function (_a, ref) {
|
|
915
|
-
var
|
|
916
|
-
var
|
|
917
|
-
var
|
|
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({
|
|
918
985
|
id: id,
|
|
919
|
-
errorMessage: errorMessage
|
|
920
|
-
|
|
921
|
-
}), ariaDescribedby = _e.ariaDescribedby, idHelper = _e.idHelper, idError = _e.idError;
|
|
986
|
+
errorMessage: errorMessage
|
|
987
|
+
}), ariaDescribedby = _f.ariaDescribedby, idError = _f.idError;
|
|
922
988
|
var idLabel = "".concat(id, "-label");
|
|
923
989
|
var checkedProps = {};
|
|
924
990
|
if (typeof onChange === "function") {
|
|
925
|
-
checkedProps.checked =
|
|
991
|
+
checkedProps.checked = checked;
|
|
926
992
|
}
|
|
927
|
-
else if (
|
|
993
|
+
else if (checked && !onChange) {
|
|
928
994
|
checkedProps.defaultChecked = true;
|
|
929
995
|
}
|
|
996
|
+
if (requirementStatus === "required") {
|
|
997
|
+
isRequired = true;
|
|
998
|
+
}
|
|
930
999
|
return (React.createElement("div", { className: classNames({
|
|
931
1000
|
"arc-Checkbox": true,
|
|
932
1001
|
"arc-Checkbox--disabled": isDisabled,
|
|
933
1002
|
"arc-Checkbox--invalid": errorMessage,
|
|
1003
|
+
"arc-Checkbox--small": size === "s",
|
|
934
1004
|
"arc-Checkbox--onDarkSurface": surface === "dark"
|
|
935
1005
|
}) },
|
|
936
1006
|
React.createElement("label", { id: idLabel, htmlFor: id, className: "arc-Checkbox-label" },
|
|
937
|
-
React.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-
|
|
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))),
|
|
938
1008
|
React.createElement("span", { className: "arc-Checkbox-box" }),
|
|
939
1009
|
React.createElement("span", null,
|
|
940
1010
|
label,
|
|
941
|
-
|
|
942
|
-
|
|
1011
|
+
" ",
|
|
1012
|
+
!isRequired && requirementStatus !== "optional" ? (React.createElement("span", { className: "arc-Checkbox-labelOptional" }, "(optional)")) : null,
|
|
1013
|
+
helper && React.createElement("span", { className: "arc-Checkbox-helper" }, helper))),
|
|
943
1014
|
errorMessage && (React.createElement("div", { id: idError, className: "arc-Checkbox-error" }, errorMessage))));
|
|
944
1015
|
});
|
|
945
1016
|
|
|
@@ -996,9 +1067,7 @@ var Col = function (_a) {
|
|
|
996
1067
|
var align = _a.align, children = _a.children, _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, offset = _a.offset, offsetS = _a.offsetS, offsetM = _a.offsetM, offsetL = _a.offsetL, offsetXL = _a.offsetXL, span = _a.span, spanS = _a.spanS, spanM = _a.spanM, spanL = _a.spanL, spanXL = _a.spanXL, props = __rest(_a, ["align", "children", "isDebugVisible", "offset", "offsetS", "offsetM", "offsetL", "offsetXL", "span", "spanS", "spanM", "spanL", "spanXL"]);
|
|
997
1068
|
return (React.createElement("div", __assign({ className: classNames((_b = {},
|
|
998
1069
|
_b["arc-Col"] = true,
|
|
999
|
-
_b["arc-Col--
|
|
1000
|
-
_b["arc-Col--alignCenter"] = align === "center",
|
|
1001
|
-
_b["arc-Col--alignTop"] = align === "top",
|
|
1070
|
+
_b[suffixModifier("arc-Col--align", align || "")] = align,
|
|
1002
1071
|
_b["arc-Col--".concat(span)] = typeof span !== "undefined",
|
|
1003
1072
|
_b["arc-Col--S".concat(spanS)] = typeof spanS !== "undefined",
|
|
1004
1073
|
_b["arc-Col--M".concat(spanM)] = typeof spanM !== "undefined",
|
|
@@ -1030,7 +1099,7 @@ var Curve = function (_a) {
|
|
|
1030
1099
|
return (React.createElement("div", __assign({ className: classNames((_b = {
|
|
1031
1100
|
"arc-Curve": true
|
|
1032
1101
|
},
|
|
1033
|
-
_b[suffixModifier("arc-Curve--from", from
|
|
1102
|
+
_b[suffixModifier("arc-Curve--from", from)] = from && from !== "top",
|
|
1034
1103
|
_b["arc-Curve--size".concat(size && size.toUpperCase())] = size && size !== "m",
|
|
1035
1104
|
_b[suffixModifier("arc-Curve--bottomColor", bottomColor || "")] = bottomColor,
|
|
1036
1105
|
_b[suffixModifier("arc-Curve--topColor", topColor || "")] = topColor,
|
|
@@ -1044,7 +1113,7 @@ var Curve = function (_a) {
|
|
|
1044
1113
|
*/
|
|
1045
1114
|
var Disclosure = function (_a) {
|
|
1046
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"]);
|
|
1047
|
-
var surface = useContext(Context$
|
|
1116
|
+
var surface = useContext(Context$3).surface;
|
|
1048
1117
|
return (React.createElement("details", __assign({ className: classNames({
|
|
1049
1118
|
"arc-Disclosure": true,
|
|
1050
1119
|
"arc-Disclosure--indentDetails": indentDetails,
|
|
@@ -1067,53 +1136,13 @@ var Elevation = function (_a) {
|
|
|
1067
1136
|
_b)) }, filterDataAttrs(props)), children));
|
|
1068
1137
|
};
|
|
1069
1138
|
|
|
1070
|
-
/**
|
|
1071
|
-
* Use `FormControl` to provide inputs with labels, helper text and error messages
|
|
1072
|
-
*/
|
|
1073
|
-
var FormControl = function (_a) {
|
|
1074
|
-
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"]);
|
|
1075
|
-
var surface = useContext(Context$2).surface;
|
|
1076
|
-
var _e = useAriaDescribedby({
|
|
1077
|
-
errorMessage: errorMessage,
|
|
1078
|
-
helper: helper,
|
|
1079
|
-
id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
|
|
1080
|
-
}), ariaDescribedby = _e.ariaDescribedby, idError = _e.idError, idHelper = _e.idHelper;
|
|
1081
|
-
var LabelType = ElementType === "div" ? "label" : "legend";
|
|
1082
|
-
var elementProps = {};
|
|
1083
|
-
var labelProps = {};
|
|
1084
|
-
if (LabelType === "label") {
|
|
1085
|
-
labelProps["htmlFor"] = htmlFor;
|
|
1086
|
-
if (htmlFor) {
|
|
1087
|
-
labelProps["id"] = "".concat(htmlFor, "-label");
|
|
1088
|
-
}
|
|
1089
|
-
else if (id) {
|
|
1090
|
-
labelProps["id"] = "".concat(id, "-label");
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
else {
|
|
1094
|
-
elementProps["aria-describedby"] = ariaDescribedby;
|
|
1095
|
-
}
|
|
1096
|
-
return (React.createElement(ElementType, __assign({ className: classNames({
|
|
1097
|
-
"arc-FormControl": true,
|
|
1098
|
-
"arc-FormControl--smallLabel": labelSize === "s",
|
|
1099
|
-
"arc-FormControl--onDarkSurface": surface === "dark"
|
|
1100
|
-
}), id: id }, elementProps, filterDataAttrs(props)),
|
|
1101
|
-
React.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
|
|
1102
|
-
label,
|
|
1103
|
-
" ",
|
|
1104
|
-
!isRequired && (React.createElement("span", { className: "arc-FormControl-labelOptional" }, "(Optional)"))),
|
|
1105
|
-
helper && (React.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper)),
|
|
1106
|
-
children,
|
|
1107
|
-
errorMessage && (React.createElement("div", { className: "arc-FormControl-error", id: idError }, errorMessage))));
|
|
1108
|
-
};
|
|
1109
|
-
|
|
1110
1139
|
/**
|
|
1111
1140
|
* Use `Group` to arrange flexible items in a row.
|
|
1112
1141
|
*/
|
|
1113
1142
|
var Group = function (_a) {
|
|
1114
1143
|
var _b;
|
|
1115
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"]);
|
|
1116
|
-
var surface = useContext(Context$
|
|
1145
|
+
var surface = useContext(Context$3).surface;
|
|
1117
1146
|
useEffect(function () {
|
|
1118
1147
|
React.Children.map(children, function (item) {
|
|
1119
1148
|
if (item && item.type !== GroupItem) {
|
|
@@ -1148,7 +1177,7 @@ Group.Item = GroupItem;
|
|
|
1148
1177
|
*/
|
|
1149
1178
|
var Markup = function (_a) {
|
|
1150
1179
|
var children = _a.children, _b = _a.isMeasured, isMeasured = _b === void 0 ? false : _b, props = __rest(_a, ["children", "isMeasured"]);
|
|
1151
|
-
var surface = useContext(Context$
|
|
1180
|
+
var surface = useContext(Context$3).surface;
|
|
1152
1181
|
return (React.createElement("div", __assign({ className: classNames({
|
|
1153
1182
|
"arc-Markup": true,
|
|
1154
1183
|
"arc-Markup--measured": isMeasured,
|
|
@@ -1230,60 +1259,50 @@ var useRadioContext = function () {
|
|
|
1230
1259
|
* Radio Button component.
|
|
1231
1260
|
*/
|
|
1232
1261
|
var RadioButton = forwardRef(function (_a, ref) {
|
|
1233
|
-
var helper = _a.helper, id = _a.id, label = _a.label, value = _a.value, props = __rest(_a, ["helper", "id", "label", "value"]);
|
|
1234
|
-
var _b = useRadioContext(),
|
|
1235
|
-
var surface = useContext(Context$
|
|
1236
|
-
var _c = useAriaDescribedby({
|
|
1237
|
-
id: id,
|
|
1238
|
-
idError: "".concat(errorId, "-error"),
|
|
1239
|
-
helper: helper,
|
|
1240
|
-
errorMessage: errorMessage
|
|
1241
|
-
}), 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;
|
|
1242
1265
|
var idLabel = "".concat(id, "-label");
|
|
1243
1266
|
var checked = isChecked === value ? true : false;
|
|
1244
|
-
var disabled = isDisabled ? isDisabled : false;
|
|
1245
1267
|
return (React.createElement("div", __assign({ className: classNames({
|
|
1246
1268
|
"arc-RadioButton": true,
|
|
1247
|
-
"arc-RadioButton--
|
|
1248
|
-
"arc-RadioButton--
|
|
1249
|
-
"arc-RadioButton--
|
|
1250
|
-
"arc-RadioButton--required": isRequired,
|
|
1269
|
+
"arc-RadioButton--disabled": isDisabled || groupDisabled,
|
|
1270
|
+
"arc-RadioButton--small": size === "s",
|
|
1271
|
+
"arc-RadioButton--smallLabel": labelSize === "s",
|
|
1251
1272
|
"arc-RadioButton--onDarkSurface": surface === "dark"
|
|
1252
1273
|
}) }, filterDataAttrs(props)),
|
|
1253
|
-
React.createElement("
|
|
1254
|
-
|
|
1255
|
-
|
|
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)))));
|
|
1256
1279
|
});
|
|
1257
1280
|
|
|
1258
1281
|
/**
|
|
1259
1282
|
* Use `RadioGroup` to wrap and control radio buttons and apply default values
|
|
1260
1283
|
*/
|
|
1261
1284
|
var RadioGroup = function (_a) {
|
|
1262
|
-
var children = _a.children, defaultValue = _a.defaultValue, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = _a.
|
|
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"]);
|
|
1263
1286
|
return (React.createElement(Provider$2, { value: {
|
|
1287
|
+
blurEvent: onBlur,
|
|
1288
|
+
changeEvent: onChange,
|
|
1289
|
+
groupDisabled: isDisabled,
|
|
1264
1290
|
isChecked: defaultValue,
|
|
1265
|
-
|
|
1266
|
-
isDisabled: isDisabled,
|
|
1267
|
-
isInvalid: errorMessage ? true : false,
|
|
1268
|
-
errorId: id,
|
|
1269
|
-
errorMessage: errorMessage,
|
|
1291
|
+
labelSize: labelSize,
|
|
1270
1292
|
name: name,
|
|
1271
|
-
|
|
1293
|
+
size: size
|
|
1272
1294
|
} },
|
|
1273
|
-
React.createElement(
|
|
1274
|
-
React.createElement("
|
|
1275
|
-
"arc-RadioGroup": true,
|
|
1276
|
-
"arc-RadioGroup--invalid": errorMessage,
|
|
1277
|
-
"arc-RadioGroup--disabled": isDisabled
|
|
1278
|
-
}) }, 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))));
|
|
1279
1297
|
};
|
|
1298
|
+
RadioButton.displayName = "RadioGroup.RadioButton";
|
|
1280
1299
|
RadioGroup.RadioButton = RadioButton;
|
|
1281
1300
|
|
|
1282
1301
|
/**
|
|
1283
1302
|
* Use `Rule` to display a horizontal rule.
|
|
1284
1303
|
*/
|
|
1285
1304
|
var Rule = function (props) {
|
|
1286
|
-
var surface = useContext(Context$
|
|
1305
|
+
var surface = useContext(Context$3).surface;
|
|
1287
1306
|
return (React.createElement("hr", __assign({ className: classNames({
|
|
1288
1307
|
"arc-Rule": true,
|
|
1289
1308
|
"arc-Rule--onDarkSurface": surface === "dark"
|
|
@@ -1328,10 +1347,8 @@ var SiteFooter = function (_a) {
|
|
|
1328
1347
|
children && (React.createElement("ul", { className: "arc-SiteFooter-secondaryItems" }, children)),
|
|
1329
1348
|
React.createElement("div", { className: "arc-SiteFooter-brand" },
|
|
1330
1349
|
React.createElement("div", { className: "arc-SiteFooter-copyright" },
|
|
1331
|
-
React.createElement("span", { className: "arc-SiteFooter-copyrightSymbol" }, "\u00A9"),
|
|
1332
|
-
|
|
1333
|
-
currentYear || new Date().getFullYear()),
|
|
1334
|
-
React.createElement(BrandLogo, { label: logoLabel, size: 32 }))))))));
|
|
1350
|
+
React.createElement("span", { className: "arc-SiteFooter-copyrightSymbol" }, "\u00A9"), " ".concat(currentYear || new Date().getFullYear())),
|
|
1351
|
+
React.createElement(BrandLogo, { label: logoLabel }))))))));
|
|
1335
1352
|
};
|
|
1336
1353
|
var SiteFooterItemGroup = function (_a) {
|
|
1337
1354
|
var children = _a.children, title = _a.title;
|
|
@@ -1359,16 +1376,20 @@ SiteFooterItemGroup.displayName = "SiteFooter.ItemGroup";
|
|
|
1359
1376
|
SiteFooter.ItemGroup = SiteFooterItemGroup;
|
|
1360
1377
|
|
|
1361
1378
|
var SiteFooter_rehydrator = (function (el, rehydrateChildren) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1362
|
-
var children, props;
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
switch (_b.label) {
|
|
1379
|
+
var children, titleElement, title, props;
|
|
1380
|
+
return __generator(this, function (_a) {
|
|
1381
|
+
switch (_a.label) {
|
|
1366
1382
|
case 0: return [4 /*yield*/, rehydrateChildren(el.querySelector(".arc-SiteFooter-mainItems"))];
|
|
1367
1383
|
case 1:
|
|
1368
|
-
children =
|
|
1384
|
+
children = _a.sent();
|
|
1385
|
+
titleElement = el.querySelector(".arc-SiteFooter-title");
|
|
1386
|
+
title = "";
|
|
1387
|
+
if (titleElement) {
|
|
1388
|
+
title = titleElement.textContent || /* istanbul ignore next */ "";
|
|
1389
|
+
}
|
|
1369
1390
|
props = {
|
|
1370
1391
|
children: children,
|
|
1371
|
-
title:
|
|
1392
|
+
title: title
|
|
1372
1393
|
};
|
|
1373
1394
|
return [2 /*return*/, React.createElement(SiteFooter.ItemGroup, __assign({}, props), children)];
|
|
1374
1395
|
}
|
|
@@ -1386,7 +1407,8 @@ var Item = function (_a) {
|
|
|
1386
1407
|
};
|
|
1387
1408
|
|
|
1388
1409
|
var ItemGroup = function (_a) {
|
|
1389
|
-
var children = _a.children, title = _a.title, props = __rest(_a, ["children", "title"]);
|
|
1410
|
+
var children = _a.children, href = _a.href, title = _a.title, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["children", "href", "title", "viewAllTitle"]);
|
|
1411
|
+
var _b = useState(false), hasClientSideJavaScript = _b[0], setHasClientSideJavaScript = _b[1];
|
|
1390
1412
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
1391
1413
|
useEffect(function () {
|
|
1392
1414
|
React.Children.map(children, function (item) {
|
|
@@ -1395,24 +1417,43 @@ var ItemGroup = function (_a) {
|
|
|
1395
1417
|
}
|
|
1396
1418
|
});
|
|
1397
1419
|
}, [children]);
|
|
1420
|
+
useEffect(function () {
|
|
1421
|
+
// useEffect does not run in ReactDomServer renders
|
|
1422
|
+
setHasClientSideJavaScript(true);
|
|
1423
|
+
}, [setHasClientSideJavaScript]);
|
|
1398
1424
|
return (React.createElement("li", { className: "arc-SiteHeaderItemGroup" },
|
|
1399
1425
|
React.createElement("details", __assign({ className: "arc-SiteHeaderItemGroup-details", open: isMinWidthArcBreakpointL }, filterDataAttrs(props)),
|
|
1400
|
-
React.createElement("summary", { className: "arc-SiteHeaderItemGroup-summary", tabIndex: isMinWidthArcBreakpointL ? -1 : 0 },
|
|
1401
|
-
|
|
1402
|
-
|
|
1426
|
+
React.createElement("summary", { className: "arc-SiteHeaderItemGroup-summary", tabIndex: isMinWidthArcBreakpointL ? -1 : 0 }, href ? (React.createElement("a", { className: "arc-SiteHeaderItemGroup-title", href: href, tabIndex: !hasClientSideJavaScript || isMinWidthArcBreakpointL ? 0 : -1 }, title)) : (React.createElement("div", { className: "arc-SiteHeaderItemGroup-title" }, title))),
|
|
1427
|
+
React.createElement("ul", { className: "arc-SiteHeaderItemGroup-items" },
|
|
1428
|
+
children,
|
|
1429
|
+
href ? (React.createElement("li", { className: "arc-SiteHeaderItem arc-SiteHeaderItem--viewAll" },
|
|
1430
|
+
React.createElement("a", { className: "arc-SiteHeaderItem-link", href: href }, viewAllTitle || "View all ".concat(title.toLowerCase())))) : null))));
|
|
1403
1431
|
};
|
|
1404
1432
|
|
|
1405
1433
|
var ItemGroupRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1406
|
-
var children, props;
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
switch (_b.label) {
|
|
1434
|
+
var children, titleElement, viewAllElement, title, href, viewAllTitle, props;
|
|
1435
|
+
return __generator(this, function (_a) {
|
|
1436
|
+
switch (_a.label) {
|
|
1410
1437
|
case 0: return [4 /*yield*/, hydrate(el.querySelector(".arc-SiteHeaderItemGroup-items"))];
|
|
1411
1438
|
case 1:
|
|
1412
|
-
children =
|
|
1439
|
+
children = _a.sent();
|
|
1440
|
+
titleElement = el.querySelector(".arc-SiteHeaderItemGroup-title");
|
|
1441
|
+
viewAllElement = el.querySelector(".arc-SiteHeaderItem--viewAll");
|
|
1442
|
+
title = "";
|
|
1443
|
+
href = "";
|
|
1444
|
+
viewAllTitle = "";
|
|
1445
|
+
if (titleElement) {
|
|
1446
|
+
title = titleElement.textContent || /* istanbul ignore next */ "";
|
|
1447
|
+
href = titleElement.getAttribute("href") || /* istanbul ignore next */ "";
|
|
1448
|
+
}
|
|
1449
|
+
if (viewAllElement) {
|
|
1450
|
+
viewAllTitle = viewAllElement.textContent || /* istanbul ignore next */ "";
|
|
1451
|
+
}
|
|
1413
1452
|
props = {
|
|
1414
1453
|
children: children,
|
|
1415
|
-
|
|
1454
|
+
href: href,
|
|
1455
|
+
title: title,
|
|
1456
|
+
viewAllTitle: viewAllTitle
|
|
1416
1457
|
};
|
|
1417
1458
|
return [2 /*return*/, React.createElement(ItemGroup, __assign({}, props), children)];
|
|
1418
1459
|
}
|
|
@@ -1442,7 +1483,7 @@ var BackButton = function (_a) {
|
|
|
1442
1483
|
|
|
1443
1484
|
var Panel = function (_a) {
|
|
1444
1485
|
var _b;
|
|
1445
|
-
var children = _a.children, navItemRef = _a.navItemRef,
|
|
1486
|
+
var children = _a.children, navItemRef = _a.navItemRef, open = _a.open, promo = _a.promo, setOpen = _a.setOpen, subNavItemRef = _a.subNavItemRef, _c = _a.subNavLink, subNavLink = _c === void 0 ? "" : _c, title = _a.title, viewAll = _a.viewAll, withSubNav = _a.withSubNav, props = __rest(_a, ["children", "navItemRef", "open", "promo", "setOpen", "subNavItemRef", "subNavLink", "title", "viewAll", "withSubNav"]);
|
|
1446
1487
|
var transparent = useContext(Context).transparent;
|
|
1447
1488
|
useEffect(function () {
|
|
1448
1489
|
// Where appropriate, close the Panel when clicking outside of it,
|
|
@@ -1552,7 +1593,7 @@ var NavItem = function (_a) {
|
|
|
1552
1593
|
};
|
|
1553
1594
|
|
|
1554
1595
|
var NavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1555
|
-
var children, promo, link, viewAll, props;
|
|
1596
|
+
var children, promo, link, viewAll, href, title, props;
|
|
1556
1597
|
return __generator(this, function (_a) {
|
|
1557
1598
|
switch (_a.label) {
|
|
1558
1599
|
case 0:
|
|
@@ -1572,11 +1613,20 @@ var NavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void
|
|
|
1572
1613
|
case 4:
|
|
1573
1614
|
link = el.querySelector(".arc-SiteHeaderNavItem-link");
|
|
1574
1615
|
viewAll = el.querySelector(".arc-SiteHeaderPanel-viewAll");
|
|
1616
|
+
href = "";
|
|
1617
|
+
title = "";
|
|
1618
|
+
if (link) {
|
|
1619
|
+
title = link.textContent || /* istanbul ignore next */ "";
|
|
1620
|
+
href = link.getAttribute("href") || /* istanbul ignore next */ "";
|
|
1621
|
+
}
|
|
1622
|
+
if (viewAll) {
|
|
1623
|
+
href = viewAll.getAttribute("href") || /* istanbul ignore next */ "";
|
|
1624
|
+
}
|
|
1575
1625
|
props = {
|
|
1576
|
-
href:
|
|
1626
|
+
href: href,
|
|
1577
1627
|
isCurrent: el.classList.contains("arc-SiteHeaderNavItem--linkSelected") || undefined,
|
|
1578
1628
|
promo: promo || undefined,
|
|
1579
|
-
title:
|
|
1629
|
+
title: title,
|
|
1580
1630
|
viewAllTitle: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.textContent) || undefined
|
|
1581
1631
|
};
|
|
1582
1632
|
return [2 /*return*/, React.createElement(NavItem, __assign({}, props), children)];
|
|
@@ -1625,7 +1675,7 @@ var SubNavItem = function (_a) {
|
|
|
1625
1675
|
};
|
|
1626
1676
|
|
|
1627
1677
|
var SubNavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1628
|
-
var children, promo, link, props;
|
|
1678
|
+
var children, promo, link, href, title, props;
|
|
1629
1679
|
return __generator(this, function (_a) {
|
|
1630
1680
|
switch (_a.label) {
|
|
1631
1681
|
case 0:
|
|
@@ -1644,11 +1694,17 @@ var SubNavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, vo
|
|
|
1644
1694
|
_a.label = 4;
|
|
1645
1695
|
case 4:
|
|
1646
1696
|
link = el.querySelector(".arc-SiteHeaderSubNavItem-link");
|
|
1697
|
+
href = "";
|
|
1698
|
+
title = "";
|
|
1699
|
+
if (link) {
|
|
1700
|
+
href = link.getAttribute("href") || /* istanbul ignore next */ "";
|
|
1701
|
+
title = link.textContent || /* istanbul ignore next */ "";
|
|
1702
|
+
}
|
|
1647
1703
|
props = {
|
|
1648
|
-
href:
|
|
1704
|
+
href: href,
|
|
1649
1705
|
isDefaultItem: Boolean(el.dataset.defaultItem),
|
|
1650
1706
|
promo: promo || undefined,
|
|
1651
|
-
title:
|
|
1707
|
+
title: title
|
|
1652
1708
|
};
|
|
1653
1709
|
return [2 /*return*/, React.createElement(SubNavItem, __assign({}, props), children)];
|
|
1654
1710
|
}
|
|
@@ -1669,7 +1725,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
1669
1725
|
if (item && item.type !== SubNavItem && item.type !== Fragment) {
|
|
1670
1726
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot1` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
1671
1727
|
}
|
|
1672
|
-
if (item
|
|
1728
|
+
if (item.props.isDefaultItem) {
|
|
1673
1729
|
setDefaultItem(false);
|
|
1674
1730
|
}
|
|
1675
1731
|
});
|
|
@@ -1677,7 +1733,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
1677
1733
|
if (item && item.type !== SubNavItem && item.type !== Fragment) {
|
|
1678
1734
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot2` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
1679
1735
|
}
|
|
1680
|
-
if (item
|
|
1736
|
+
if (item.props.isDefaultItem) {
|
|
1681
1737
|
setDefaultItem(false);
|
|
1682
1738
|
}
|
|
1683
1739
|
});
|
|
@@ -1685,7 +1741,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
1685
1741
|
if (item && item.type !== SubNavItem && item.type !== Fragment) {
|
|
1686
1742
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot3` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
1687
1743
|
}
|
|
1688
|
-
if (item
|
|
1744
|
+
if (item.props.isDefaultItem) {
|
|
1689
1745
|
setDefaultItem(false);
|
|
1690
1746
|
}
|
|
1691
1747
|
});
|
|
@@ -1715,7 +1771,7 @@ function wrap(el, wrapper) {
|
|
|
1715
1771
|
wrapper.appendChild(el);
|
|
1716
1772
|
}
|
|
1717
1773
|
var NavItemWithSubNavRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1718
|
-
var subNavItem1, subNavItem2, subNavItem3, div1, div2, slot1, slot2, slot3, div3, link, subTitle, viewAll, props;
|
|
1774
|
+
var subNavItem1, subNavItem2, subNavItem3, div1, div2, slot1, slot2, slot3, div3, link, subTitle, viewAll, title, props;
|
|
1719
1775
|
return __generator(this, function (_a) {
|
|
1720
1776
|
switch (_a.label) {
|
|
1721
1777
|
case 0:
|
|
@@ -1746,13 +1802,17 @@ var NavItemWithSubNavRehydrator = (function (el, hydrate) { return __awaiter(voi
|
|
|
1746
1802
|
link = el.querySelector(".arc-SiteHeaderNavItem-link");
|
|
1747
1803
|
subTitle = el.querySelector(".arc-SiteHeaderPanel-title");
|
|
1748
1804
|
viewAll = el.querySelector(".arc-SiteHeaderPanel-viewAll");
|
|
1805
|
+
title = "";
|
|
1806
|
+
if (link) {
|
|
1807
|
+
title = link.textContent || /* istanbul ignore next */ "";
|
|
1808
|
+
}
|
|
1749
1809
|
props = {
|
|
1750
1810
|
href: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.getAttribute("href")) || undefined,
|
|
1751
|
-
slot1: slot1 || undefined,
|
|
1752
|
-
slot2: slot2 || undefined,
|
|
1811
|
+
slot1: slot1 || /* istanbul ignore next */ undefined,
|
|
1812
|
+
slot2: slot2 || /* istanbul ignore next */ undefined,
|
|
1753
1813
|
slot3: slot3 || undefined,
|
|
1754
1814
|
subTitle: (subTitle === null || subTitle === void 0 ? void 0 : subTitle.textContent) || undefined,
|
|
1755
|
-
title:
|
|
1815
|
+
title: title,
|
|
1756
1816
|
viewAllTitle: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.textContent) || undefined
|
|
1757
1817
|
};
|
|
1758
1818
|
return [2 /*return*/, React.createElement(NavItemWithSubNav, __assign({}, props))];
|
|
@@ -1782,7 +1842,7 @@ var Provider = Context.Provider;
|
|
|
1782
1842
|
*/
|
|
1783
1843
|
var SiteHeader = function (_a) {
|
|
1784
1844
|
var _b;
|
|
1785
|
-
var children = _a.children, _c = _a.basketHref, basketHref = _c === void 0 ? "/basket" : _c, _d = _a.hasBasket, hasBasket = _d === void 0 ? false : _d, _e = _a.hasLogin, hasLogin = _e === void 0 ? true : _e, _f = _a.isTransparent, isTransparent = _f === void 0 ? false : _f, _g = _a.loginHref, loginHref = _g === void 0 ? "/login" : _g, _h = _a.loginTitle, loginTitle = _h === void 0 ? "Login / Register" : _h, _j = _a.logoHref, logoHref = _j === void 0 ? "/" : _j, _k = _a.logoLabel, logoLabel = _k === void 0 ? "Home" : _k, search = _a.search, props = __rest(_a, ["children", "basketHref", "hasBasket", "hasLogin", "isTransparent", "loginHref", "loginTitle", "logoHref", "logoLabel", "search"]);
|
|
1845
|
+
var children = _a.children, _c = _a.basketHref, basketHref = _c === void 0 ? "/basket" : _c, _d = _a.hasBasket, hasBasket = _d === void 0 ? false : _d, _e = _a.hasLogin, hasLogin = _e === void 0 ? true : _e, _f = _a.isTransparent, isTransparent = _f === void 0 ? false : _f, _g = _a.loginHref, loginHref = _g === void 0 ? "/login" : _g, _h = _a.loginTitle, loginTitle = _h === void 0 ? "Login / Register" : _h, _j = _a.logoHref, logoHref = _j === void 0 ? "/" : _j, _k = _a.logoLabel, logoLabel = _k === void 0 ? "Home" : _k, search = _a.search, subBrand = _a.subBrand, props = __rest(_a, ["children", "basketHref", "hasBasket", "hasLogin", "isTransparent", "loginHref", "loginTitle", "logoHref", "logoLabel", "search", "subBrand"]);
|
|
1786
1846
|
var _l = useState(false), hasClientSideJavaScript = _l[0], setHasClientSideJavaScript = _l[1];
|
|
1787
1847
|
var _m = useState(false), menuOpen = _m[0], setMenuOpen = _m[1];
|
|
1788
1848
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
@@ -1833,15 +1893,15 @@ var SiteHeader = function (_a) {
|
|
|
1833
1893
|
: undefined },
|
|
1834
1894
|
React.createElement("div", { className: "arc-SiteHeader-inner" },
|
|
1835
1895
|
React.createElement("a", { className: "arc-SiteHeader-brand", href: logoHref },
|
|
1836
|
-
React.createElement(BrandLogo, { label: logoLabel,
|
|
1837
|
-
React.createElement("nav", { className: "arc-SiteHeader-nav" },
|
|
1896
|
+
React.createElement(BrandLogo, { label: logoLabel, subBrand: subBrand })),
|
|
1897
|
+
children && (React.createElement("nav", { className: "arc-SiteHeader-nav" },
|
|
1838
1898
|
React.createElement("div", { className: "arc-SiteHeader-menuButton" },
|
|
1839
1899
|
React.createElement(MenuButton, { menuOpen: menuOpen, setMenuOpen: setMenuOpen })),
|
|
1840
1900
|
React.createElement("div", { className: "arc-SiteHeader-main" },
|
|
1841
1901
|
React.createElement("ul", { className: "arc-SiteHeader-navItems" }, children),
|
|
1842
1902
|
hasLogin && (React.createElement("div", { className: "arc-SiteHeader-loginButton" },
|
|
1843
|
-
React.createElement(Button, { href: loginHref, isFullWidth: true, label: loginTitle }))))))
|
|
1844
|
-
(
|
|
1903
|
+
React.createElement(Button, { href: loginHref, isFullWidth: true, label: loginTitle })))))),
|
|
1904
|
+
(hasBasket || hasLogin || search) && (React.createElement("div", { className: "arc-SiteHeader-secondary" },
|
|
1845
1905
|
search ? (React.createElement("div", { className: "arc-SiteHeader-search" }, search)) : null,
|
|
1846
1906
|
hasBasket ? (React.createElement("a", { className: "arc-SiteHeader-basket", href: basketHref },
|
|
1847
1907
|
React.createElement(Icon, { icon: "btBasket", label: "Basket", size: 24 }))) : null,
|
|
@@ -1861,27 +1921,33 @@ SiteHeader.NavItemWithSubNav = NavItemWithSubNav;
|
|
|
1861
1921
|
SiteHeader.SubNavItem = SubNavItem;
|
|
1862
1922
|
|
|
1863
1923
|
var SiteHeaderRehydrator = function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1864
|
-
var children, search, basket, login, props;
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
switch (_c.label) {
|
|
1924
|
+
var children, search, basket, brand, login, logoHref, logoLabel, props;
|
|
1925
|
+
return __generator(this, function (_a) {
|
|
1926
|
+
switch (_a.label) {
|
|
1868
1927
|
case 0:
|
|
1869
1928
|
children = el.querySelector(".arc-SiteHeader-navItems");
|
|
1870
1929
|
search = el.querySelector(".arc-SiteHeader-search");
|
|
1871
1930
|
if (!children) return [3 /*break*/, 2];
|
|
1872
1931
|
return [4 /*yield*/, hydrate(children)];
|
|
1873
1932
|
case 1:
|
|
1874
|
-
children =
|
|
1875
|
-
|
|
1933
|
+
children = _a.sent();
|
|
1934
|
+
_a.label = 2;
|
|
1876
1935
|
case 2:
|
|
1877
1936
|
if (!search) return [3 /*break*/, 4];
|
|
1878
1937
|
return [4 /*yield*/, hydrate(search)];
|
|
1879
1938
|
case 3:
|
|
1880
|
-
search =
|
|
1881
|
-
|
|
1939
|
+
search = _a.sent();
|
|
1940
|
+
_a.label = 4;
|
|
1882
1941
|
case 4:
|
|
1883
1942
|
basket = el.querySelector(".arc-SiteHeader-basket");
|
|
1943
|
+
brand = el.querySelector(".arc-SiteHeader-brand");
|
|
1884
1944
|
login = el.querySelector(".arc-SiteHeader-loginLink");
|
|
1945
|
+
logoHref = "";
|
|
1946
|
+
logoLabel = "";
|
|
1947
|
+
if (brand) {
|
|
1948
|
+
logoHref = brand.getAttribute("href") || /* istanbul ignore next */ "";
|
|
1949
|
+
logoLabel = brand.textContent || /* istanbul ignore next */ "";
|
|
1950
|
+
}
|
|
1885
1951
|
props = {
|
|
1886
1952
|
basketHref: (basket === null || basket === void 0 ? void 0 : basket.getAttribute("href")) || undefined,
|
|
1887
1953
|
hasBasket: Boolean(basket),
|
|
@@ -1889,9 +1955,8 @@ var SiteHeaderRehydrator = function (el, hydrate) { return __awaiter(void 0, voi
|
|
|
1889
1955
|
isTransparent: Boolean(el.dataset.transparent),
|
|
1890
1956
|
loginHref: (login === null || login === void 0 ? void 0 : login.getAttribute("href")) || undefined,
|
|
1891
1957
|
loginTitle: (login === null || login === void 0 ? void 0 : login.textContent) || undefined,
|
|
1892
|
-
logoHref:
|
|
1893
|
-
|
|
1894
|
-
logoLabel: ((_b = el.querySelector("arc-BrandLogo-text")) === null || _b === void 0 ? void 0 : _b.textContent) || undefined,
|
|
1958
|
+
logoHref: logoHref,
|
|
1959
|
+
logoLabel: logoLabel,
|
|
1895
1960
|
search: search
|
|
1896
1961
|
};
|
|
1897
1962
|
return [2 /*return*/, React.createElement(SiteHeader, __assign({}, props), children)];
|
|
@@ -1909,14 +1974,13 @@ SiteHeaderRehydrator.SubNavItemRehydrator = SubNavItemRehydrator;
|
|
|
1909
1974
|
var Text = function (_a) {
|
|
1910
1975
|
var _b;
|
|
1911
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"]);
|
|
1912
|
-
var surface = useContext(Context$
|
|
1977
|
+
var surface = useContext(Context$3).surface;
|
|
1913
1978
|
return (React.createElement("span", __assign({ className: classNames((_b = {
|
|
1914
|
-
"arc-Text": true
|
|
1915
|
-
"arc-Text--alignCenter": align === "center",
|
|
1916
|
-
"arc-Text--alignRight": align === "right",
|
|
1917
|
-
"arc-Text--inline": isInline,
|
|
1918
|
-
"arc-Text--measured": isMeasured
|
|
1979
|
+
"arc-Text": true
|
|
1919
1980
|
},
|
|
1981
|
+
_b[suffixModifier("arc-Text--align", align)] = align !== "left",
|
|
1982
|
+
_b["arc-Text--inline"] = isInline,
|
|
1983
|
+
_b["arc-Text--measured"] = isMeasured,
|
|
1920
1984
|
_b["arc-Text--size".concat(size && size.toUpperCase())] = size && size !== "m",
|
|
1921
1985
|
_b["arc-Text--".concat(tone)] = tone !== "default",
|
|
1922
1986
|
_b["arc-Text--onDarkSurface"] = surface === "dark",
|
|
@@ -1927,8 +1991,8 @@ var Text = function (_a) {
|
|
|
1927
1991
|
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
1928
1992
|
*/
|
|
1929
1993
|
var TextInput = forwardRef(function (_a, ref) {
|
|
1930
|
-
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"]);
|
|
1931
|
-
var surface = useContext(Context$
|
|
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;
|
|
1932
1996
|
var inferredInputProps = useNumericInput({ inputMode: inputMode, pattern: pattern, type: type });
|
|
1933
1997
|
// Although this is used within FormControlWrapper, it's deterministic so we can call it here too
|
|
1934
1998
|
var ariaDescribedby = useAriaDescribedby({
|
|
@@ -1941,8 +2005,8 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
1941
2005
|
"arc-TextInput--invalid": errorMessage,
|
|
1942
2006
|
"arc-TextInput--onDarkSurface": surface === "dark"
|
|
1943
2007
|
}) }, filterDataAttrs(props)),
|
|
1944
|
-
React.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id,
|
|
1945
|
-
React.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false",
|
|
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)))));
|
|
1946
2010
|
});
|
|
1947
2011
|
|
|
1948
2012
|
/**
|
|
@@ -1959,5 +2023,5 @@ var VerticalSpace = function (_a) {
|
|
|
1959
2023
|
_b)) }, filterDataAttrs(props))));
|
|
1960
2024
|
};
|
|
1961
2025
|
|
|
1962
|
-
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$
|
|
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 };
|
|
1963
2027
|
//# sourceMappingURL=index.es.js.map
|