@arc-ui/components 11.19.0 → 11.20.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/Avatar/Avatar.cjs.js +18 -0
- package/dist/Avatar/Avatar.esm.js +10 -0
- package/dist/Avatar/package.json +7 -0
- package/dist/AvatarGroup/AvatarGroup.cjs.js +37 -0
- package/dist/AvatarGroup/AvatarGroup.esm.js +29 -0
- package/dist/AvatarGroup/package.json +7 -0
- package/dist/Checkbox/Checkbox.cjs.js +2 -2
- package/dist/Checkbox/Checkbox.esm.js +2 -2
- package/dist/DatePicker/DatePicker.cjs.js +2 -2
- package/dist/DatePicker/DatePicker.esm.js +2 -2
- package/dist/FormControl/FormControl.cjs.js +1 -1
- package/dist/FormControl/FormControl.esm.js +1 -1
- package/dist/InformationCard/InformationCard.cjs.js +4 -4
- package/dist/InformationCard/InformationCard.esm.js +1 -1
- package/dist/MediaCard/MediaCard.cjs.js +6 -10
- package/dist/MediaCard/MediaCard.esm.js +3 -7
- package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
- package/dist/RadioGroup/RadioGroup.esm.js +2 -2
- package/dist/Rule/Rule.cjs.js +11 -7
- package/dist/Rule/Rule.esm.js +11 -7
- package/dist/ScrollToTop/ScrollToTop.cjs.js +1 -1
- package/dist/ScrollToTop/ScrollToTop.esm.js +1 -1
- package/dist/Select/Select.cjs.js +8 -6
- package/dist/Select/Select.esm.js +8 -6
- package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +1 -1
- package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +1 -1
- package/dist/SkipLink/SkipLink.cjs.js +23 -0
- package/dist/SkipLink/SkipLink.esm.js +15 -0
- package/dist/SkipLink/package.json +7 -0
- package/dist/Switch/Switch.cjs.js +1 -1
- package/dist/Switch/Switch.esm.js +1 -1
- package/dist/TextArea/TextArea.cjs.js +6 -6
- package/dist/TextArea/TextArea.esm.js +6 -6
- package/dist/TextInput/TextInput.cjs.js +2 -2
- package/dist/TextInput/TextInput.esm.js +2 -2
- package/dist/TypographyCard/TypographyCard.cjs.js +4 -4
- package/dist/TypographyCard/TypographyCard.esm.js +2 -2
- package/dist/_shared/cjs/Avatar-12ece0dd.js +65 -0
- package/dist/_shared/cjs/{CardFooter-f6cba651.js → CardFooter-4a68a862.js} +2 -2
- package/dist/_shared/cjs/{Checkbox-4d4b432f.js → Checkbox-8915fcd9.js} +1 -1
- package/dist/_shared/cjs/ConditionalWrapper-be3b2625.js +14 -0
- package/dist/_shared/cjs/{FormControl-b26ad353.js → FormControl-5f3b6ce4.js} +9 -4
- package/dist/_shared/cjs/{RadioGroup-60845bb3.js → RadioGroup-07bb155e.js} +3 -2
- package/dist/_shared/cjs/{SiteHeaderV2-8c8f3f5c.js → SiteHeaderV2-301c765c.js} +9 -25
- package/dist/_shared/cjs/{TextInput-acbd8eda.js → TextInput-5da70ec2.js} +1 -1
- package/dist/_shared/esm/Avatar-d01e2b7b.js +59 -0
- package/dist/_shared/esm/{CardFooter-55ae9a37.js → CardFooter-a08b70ee.js} +1 -1
- package/dist/_shared/esm/{Checkbox-720b074d.js → Checkbox-0e051546.js} +1 -1
- package/dist/_shared/esm/ConditionalWrapper-59be8f35.js +8 -0
- package/dist/_shared/esm/{FormControl-f0b8fe91.js → FormControl-cc99cde0.js} +9 -4
- package/dist/_shared/esm/{RadioGroup-d42dba3a.js → RadioGroup-362be63f.js} +3 -2
- package/dist/_shared/esm/{SiteHeaderV2-6d0ff35b.js → SiteHeaderV2-0096e25b.js} +9 -25
- package/dist/_shared/esm/{TextInput-ddf4cc7a.js → TextInput-1d1c5fd6.js} +1 -1
- package/dist/index.es.js +267 -205
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +267 -203
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -4
- package/dist/types/components/Avatar/Avatar.d.ts +13 -0
- package/dist/types/components/Avatar/components/AvatarContent/AvatarContent.d.ts +9 -0
- package/dist/types/components/Avatar/index.d.ts +1 -0
- package/dist/types/components/Avatar/types/avatar-icon-size.d.ts +1 -0
- package/dist/types/components/Avatar/types/avatar-image.d.ts +2 -0
- package/dist/types/components/Avatar/types/avatar-size.d.ts +1 -0
- package/dist/types/components/Avatar/types/avatar-text-size.d.ts +2 -0
- package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +13 -0
- package/dist/types/components/AvatarGroup/index.d.ts +1 -0
- package/dist/types/components/AvatarGroup/types/group-avatar.d.ts +2 -0
- package/dist/types/components/AvatarGroup/utils/get-avatars.d.ts +2 -0
- package/dist/types/components/Rule/Rule.d.ts +2 -1
- package/dist/types/components/Select/Select.d.ts +4 -0
- package/dist/types/components/SkipLink/SkipLink.d.ts +11 -0
- package/dist/types/components/SkipLink/SkipLinkItem/SkipLinkItem.d.ts +16 -0
- package/dist/types/components/SkipLink/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/private-components/ConditionalWrapper/ConditionalWrapper.d.ts +1 -0
- package/dist/types/styles.d.ts +3 -0
- package/package.json +2 -2
- package/dist/_shared/cjs/{CardLabel-768abf20.js → BtIconArrowRight.esm-50d96943.js} +20 -20
- package/dist/_shared/esm/{CardLabel-d6d71407.js → BtIconArrowRight.esm-9b181878.js} +20 -20
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { createContext, useContext, useState,
|
|
2
|
+
import React__default, { createContext, useContext, useState, useEffect, useId, useRef, forwardRef, useCallback, useMemo, createElement, useLayoutEffect, Children, isValidElement, cloneElement, Fragment, useReducer } from 'react';
|
|
3
3
|
|
|
4
4
|
/******************************************************************************
|
|
5
5
|
Copyright (c) Microsoft Corporation.
|
|
@@ -599,6 +599,233 @@ var Alert = function (_a) {
|
|
|
599
599
|
React__default.createElement(Icon, { icon: BtIconCrossAlt2Px, size: 24 }))))));
|
|
600
600
|
};
|
|
601
601
|
|
|
602
|
+
var CardHeading = function (_a) {
|
|
603
|
+
var onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onBlur = _a.onBlur, onFocus = _a.onFocus, href = _a.href, heading = _a.heading, _b = _a.size, size = _b === void 0 ? "s" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.linkData, linkData = _d === void 0 ? {} : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e;
|
|
604
|
+
var HeadingElement = "h".concat(headingLevel);
|
|
605
|
+
return (React__default.createElement(HeadingElement, { className: classNames("arc-CardHeading", "arc-CardHeading--".concat(size), {
|
|
606
|
+
"arc-CardHeading--darkPathway": isDarkPathway
|
|
607
|
+
}) }, href ? (React__default.createElement("a", __assign({ className: "arc-CardHeading-link", href: href, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onBlur: onBlur }, filterDataAttrs(linkData)), heading)) : (heading)));
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
var CardLabel = function (_a) {
|
|
611
|
+
var _b;
|
|
612
|
+
var text = _a.text, _c = _a.color, color = _c === void 0 ? "muted" : _c, _d = _a.isBold, isBold = _d === void 0 ? true : _d, _e = _a.isDarkPathway, isDarkPathway = _e === void 0 ? false : _e;
|
|
613
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
614
|
+
React__default.createElement("span", { className: classNames("arc-CardLabel", (_b = {},
|
|
615
|
+
_b[suffixModifier("arc-CardLabel--color", color)] = !isDarkPathway,
|
|
616
|
+
_b["arc-CardLabel--bold"] = isBold,
|
|
617
|
+
_b["arc-CardLabel--darkPathway"] = isDarkPathway,
|
|
618
|
+
_b)) }, text)));
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
const BtIconArrowRight = (props) =>
|
|
622
|
+
/*#__PURE__*/ React__default.createElement(
|
|
623
|
+
"svg",
|
|
624
|
+
Object.assign(
|
|
625
|
+
{
|
|
626
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
627
|
+
viewBox: "0 0 32 32",
|
|
628
|
+
},
|
|
629
|
+
props,
|
|
630
|
+
),
|
|
631
|
+
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
632
|
+
/*#__PURE__*/ React__default.createElement("path", {
|
|
633
|
+
d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,27A13,13,0,1,1,29,16,13.01474,13.01474,0,0,1,16,29Z",
|
|
634
|
+
fill: "currentColor",
|
|
635
|
+
}),
|
|
636
|
+
/*#__PURE__*/ React__default.createElement("path", {
|
|
637
|
+
d: "M18.14648,11.64648a.49983.49983,0,0,0,0,.707L21.293,15.5H9.5a.5.5,0,0,0,0,1H21.293l-3.14649,3.14648a.5.5,0,1,0,.707.707L23.207,16l-4.35351-4.35352A.49983.49983,0,0,0,18.14648,11.64648Z",
|
|
638
|
+
fill: "currentColor",
|
|
639
|
+
}),
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
const BtIconPlay = (props) =>
|
|
643
|
+
/*#__PURE__*/ React__default.createElement(
|
|
644
|
+
"svg",
|
|
645
|
+
Object.assign(
|
|
646
|
+
{
|
|
647
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
648
|
+
viewBox: "0 0 32 32",
|
|
649
|
+
},
|
|
650
|
+
props,
|
|
651
|
+
),
|
|
652
|
+
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
653
|
+
/*#__PURE__*/ React__default.createElement("path", {
|
|
654
|
+
d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,27A13,13,0,1,1,29,16,13.01474,13.01474,0,0,1,16,29Z",
|
|
655
|
+
fill: "currentColor",
|
|
656
|
+
}),
|
|
657
|
+
/*#__PURE__*/ React__default.createElement("path", {
|
|
658
|
+
d: "M20.83887,15.03955,13.66113,10.896A1.107,1.107,0,0,0,12,11.85449v8.2876a1.10534,1.10534,0,0,0,1.66113.95947L20.83887,16.957a1.10688,1.10688,0,0,0,0-1.91748Zm-.5,1.05176-7.17774,4.14453a.10437.10437,0,0,1-.10742-.00049A.10314.10314,0,0,1,13,20.14209v-8.2876a.10229.10229,0,0,1,.05371-.09277.10284.10284,0,0,1,.10742,0l7.17774,4.14307a.10421.10421,0,0,1,.05371.09375A.10285.10285,0,0,1,20.33887,16.09131Z",
|
|
659
|
+
fill: "currentColor",
|
|
660
|
+
}),
|
|
661
|
+
);
|
|
662
|
+
|
|
663
|
+
const BtIconArrowRightFill = (props) =>
|
|
664
|
+
/*#__PURE__*/ React__default.createElement(
|
|
665
|
+
"svg",
|
|
666
|
+
Object.assign(
|
|
667
|
+
{
|
|
668
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
669
|
+
viewBox: "0 0 32 32",
|
|
670
|
+
},
|
|
671
|
+
props,
|
|
672
|
+
),
|
|
673
|
+
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
674
|
+
/*#__PURE__*/ React__default.createElement("path", {
|
|
675
|
+
d: "M2,16A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm16.85352-4.35352L23.207,16l-4.35351,4.35352a.5.5,0,0,1-.707-.707L21.293,16.5H9.5a.5.5,0,0,1,0-1H21.293l-3.14649-3.14648a.5.5,0,0,1,.707-.707Z",
|
|
676
|
+
fill: "currentColor",
|
|
677
|
+
}),
|
|
678
|
+
);
|
|
679
|
+
|
|
680
|
+
const BtIconPlayFill = (props) =>
|
|
681
|
+
/*#__PURE__*/ React__default.createElement(
|
|
682
|
+
"svg",
|
|
683
|
+
Object.assign(
|
|
684
|
+
{
|
|
685
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
686
|
+
viewBox: "0 0 32 32",
|
|
687
|
+
},
|
|
688
|
+
props,
|
|
689
|
+
),
|
|
690
|
+
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
691
|
+
/*#__PURE__*/ React__default.createElement("path", {
|
|
692
|
+
d: "M13.16113,11.76172a.10284.10284,0,0,0-.10742,0A.10229.10229,0,0,0,13,11.85449v8.2876a.10314.10314,0,0,0,.05371.09326.10451.10451,0,0,0,.10742.00049l7.17774-4.14453a.10285.10285,0,0,0,.05371-.09277.10421.10421,0,0,0-.05371-.09375Z",
|
|
693
|
+
fill: "currentColor",
|
|
694
|
+
}),
|
|
695
|
+
/*#__PURE__*/ React__default.createElement("path", {
|
|
696
|
+
d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm4.83887,14.957-7.17774,4.14453A1.10791,1.10791,0,0,1,12,20.14209v-8.2876a1.107,1.107,0,0,1,1.66113-.95849l7.17774,4.14355a1.10688,1.10688,0,0,1,0,1.91748Z",
|
|
697
|
+
fill: "currentColor",
|
|
698
|
+
}),
|
|
699
|
+
);
|
|
700
|
+
|
|
701
|
+
var CardFooter = function (_a) {
|
|
702
|
+
var metaText = _a.metaText, _b = _a.buttonIcon, buttonIcon = _b === void 0 ? "arrow" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.showButton, showButton = _d === void 0 ? true : _d, _e = _a.showFilledIcon, showFilledIcon = _e === void 0 ? false : _e;
|
|
703
|
+
var icons = {
|
|
704
|
+
arrow: {
|
|
705
|
+
regular: BtIconArrowRight,
|
|
706
|
+
filled: BtIconArrowRightFill
|
|
707
|
+
},
|
|
708
|
+
play: {
|
|
709
|
+
regular: BtIconPlay,
|
|
710
|
+
filled: BtIconPlayFill
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
return (React__default.createElement("div", { className: classNames("arc-CardFooter", {
|
|
714
|
+
"arc-CardFooter--darkPathway": isDarkPathway,
|
|
715
|
+
"arc-CardFooter--showFilledIcon": showFilledIcon
|
|
716
|
+
}) },
|
|
717
|
+
React__default.createElement("div", { className: "arc-CardFooter-metaTextContainer" }, metaText && (React__default.createElement("span", { className: "arc-CardFooter-metaText" }, metaText))),
|
|
718
|
+
showButton && (React__default.createElement("div", null,
|
|
719
|
+
React__default.createElement("div", { className: "arc-CardFooter-button" },
|
|
720
|
+
React__default.createElement("div", { className: classNames("arc-CardFooter-buttonIcon", "arc-CardFooter-buttonIcon--regular") },
|
|
721
|
+
React__default.createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
|
|
722
|
+
React__default.createElement("div", { className: "arc-CardFooter-buttonIcon arc-CardFooter-buttonIcon--filled" },
|
|
723
|
+
React__default.createElement(Icon, { icon: icons[buttonIcon].filled, size: 40 })))))));
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
var ConditionalWrapper = function (_a) {
|
|
727
|
+
var condition = _a.condition, wrapper = _a.wrapper, fallback = _a.fallback, children = _a.children;
|
|
728
|
+
return (React__default.createElement(React__default.Fragment, null, condition ? wrapper(children) : fallback ? fallback(children) : children));
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
const BtIconUser = (props) =>
|
|
732
|
+
/*#__PURE__*/ React__default.createElement(
|
|
733
|
+
"svg",
|
|
734
|
+
Object.assign(
|
|
735
|
+
{
|
|
736
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
737
|
+
viewBox: "0 0 32 32",
|
|
738
|
+
},
|
|
739
|
+
props,
|
|
740
|
+
),
|
|
741
|
+
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
742
|
+
/*#__PURE__*/ React__default.createElement("path", {
|
|
743
|
+
d: "M20.87579,16.014a6.99843,6.99843,0,1,0-9.75378.00091C6.725,17.77887,4,21.452,4,25.66113V27a1.001,1.001,0,0,0,1,1H27a1.001,1.001,0,0,0,1-1V25.66113C28,21.45129,25.27423,17.77765,20.87579,16.014ZM10,11a5.998,5.998,0,1,1,6,6A6.0068,6.0068,0,0,1,10,11ZM27,27H5V25.66113c0-4.61181,3.46484-7.57324,6.707-8.80761l.29492-.11206a6.97581,6.97581,0,0,0,7.99457-.00062l.29645.11268C23.53516,18.08789,27,21.04932,27,25.66113Z",
|
|
744
|
+
fill: "currentColor",
|
|
745
|
+
}),
|
|
746
|
+
);
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Use `Image` to render a single image, or set of images, with support for
|
|
750
|
+
* image fitting and art direction.
|
|
751
|
+
*/
|
|
752
|
+
var Image = function (_a) {
|
|
753
|
+
var _b;
|
|
754
|
+
var alt = _a.alt, _c = _a.anchor, anchor = _c === void 0 ? "C" : _c, children = _a.children, fillColor = _a.fillColor, fit = _a.fit, height = _a.height, loading = _a.loading, overlay = _a.overlay, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet, width = _a.width, props = __rest(_a, ["alt", "anchor", "children", "fillColor", "fit", "height", "loading", "overlay", "sizes", "src", "srcSet", "width"]);
|
|
755
|
+
useEffect(function () {
|
|
756
|
+
React__default.Children.map(children, function (item) {
|
|
757
|
+
if (item && item.type !== ImageSource) {
|
|
758
|
+
throw new Error("Illegal child passed to <Image />. Ensure to only use <Image.Source />.");
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
}, [children]);
|
|
762
|
+
var img = (React__default.createElement("img", { className: "arc-Image-img", alt: alt, height: fit === "cover" ? undefined : height, loading: loading, sizes: children ? undefined : sizes, src: src, srcSet: children ? undefined : srcSet, width: fit === "cover" ? undefined : width }));
|
|
763
|
+
return (React__default.createElement("div", __assign({ className: classNames((_b = {
|
|
764
|
+
"arc-Image": true,
|
|
765
|
+
"arc-Image--cover": fit === "cover"
|
|
766
|
+
},
|
|
767
|
+
_b["arc-Image--anchor".concat(anchor)] = fit === "cover",
|
|
768
|
+
_b[suffixModifier("arc-Image--overlay", overlay || "")] = overlay,
|
|
769
|
+
_b)), style: __assign(__assign(__assign({}, (fillColor && { backgroundColor: fillColor })), (fit === "cover" && height ? { height: "".concat(height, "px") } : null)), (fit === "cover" && width ? { width: "".concat(width, "px") } : null)) }, filterDataAttrs(props)), children ? (React__default.createElement("picture", null,
|
|
770
|
+
children,
|
|
771
|
+
" ",
|
|
772
|
+
img)) : (React__default.createElement(React__default.Fragment, null, img))));
|
|
773
|
+
};
|
|
774
|
+
var ImageSource = function (_a) {
|
|
775
|
+
var height = _a.height, media = _a.media, srcSet = _a.srcSet, sizes = _a.sizes, type = _a.type; _a.width; var props = __rest(_a, ["height", "media", "srcSet", "sizes", "type", "width"]);
|
|
776
|
+
return (React__default.createElement("source", __assign({ height: height, media: media, sizes: sizes, srcSet: srcSet, type: type }, filterDataAttrs(props))));
|
|
777
|
+
};
|
|
778
|
+
Image.Source = ImageSource;
|
|
779
|
+
|
|
780
|
+
var AvatarContent = function (_a) {
|
|
781
|
+
var img = _a.img, initials = _a.initials, _b = _a.size, size = _b === void 0 ? "xl" : _b;
|
|
782
|
+
var textSize = {
|
|
783
|
+
s: "xxxs",
|
|
784
|
+
m: "xxs",
|
|
785
|
+
l: "xs",
|
|
786
|
+
xl: "s"
|
|
787
|
+
};
|
|
788
|
+
var iconSize = {
|
|
789
|
+
s: 16,
|
|
790
|
+
m: 24,
|
|
791
|
+
l: 32,
|
|
792
|
+
xl: 40
|
|
793
|
+
};
|
|
794
|
+
if (img) {
|
|
795
|
+
return React__default.createElement(Image, __assign({ fit: "cover" }, img));
|
|
796
|
+
}
|
|
797
|
+
if (initials) {
|
|
798
|
+
return (React__default.createElement(Heading, { size: textSize[size] }, initials.substring(0, 3).toUpperCase()));
|
|
799
|
+
}
|
|
800
|
+
return React__default.createElement(Icon, { size: iconSize[size], icon: BtIconUser });
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
var Avatar = function (_a) {
|
|
804
|
+
var img = _a.img, initials = _a.initials, href = _a.href, title = _a.title, ariaLabel = _a.ariaLabel, onClick = _a.onClick, _b = _a.size, size = _b === void 0 ? "xl" : _b, props = __rest(_a, ["img", "initials", "href", "title", "ariaLabel", "onClick", "size"]);
|
|
805
|
+
var wrapperAttrs = __assign({ className: classNames("arc-Avatar", "arc-Avatar--".concat(size), {
|
|
806
|
+
"arc-Avatar--img": Boolean(img)
|
|
807
|
+
}) }, filterDataAttrs(props));
|
|
808
|
+
return (React__default.createElement(ConditionalWrapper, { condition: Boolean(href), wrapper: function (children) { return (React__default.createElement("a", __assign({ href: href, "aria-label": ariaLabel, onClick: onClick, title: title }, wrapperAttrs), children)); }, fallback: function (children) { return React__default.createElement("div", __assign({}, wrapperAttrs), children); } },
|
|
809
|
+
React__default.createElement(AvatarContent, { size: size, img: img, initials: initials })));
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
var getAvatars = function (avatars, max) {
|
|
813
|
+
var maxAvatars = avatars.slice(0, max);
|
|
814
|
+
var hasHiddenAvatars = maxAvatars.length < avatars.length;
|
|
815
|
+
return __spreadArray(__spreadArray([], maxAvatars, true), (hasHiddenAvatars && max
|
|
816
|
+
? [{ initials: "+".concat(avatars.length - max) }]
|
|
817
|
+
: []), true);
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
var AvatarGroup = function (_a) {
|
|
821
|
+
var title = _a.title, ariaLabel = _a.ariaLabel, href = _a.href, avatars = _a.avatars, onClick = _a.onClick, max = _a.max, _b = _a.size, size = _b === void 0 ? "xl" : _b, props = __rest(_a, ["title", "ariaLabel", "href", "avatars", "onClick", "max", "size"]);
|
|
822
|
+
var id = useId();
|
|
823
|
+
var wrapperAttrs = __assign({ className: "arc-AvatarGroup" }, filterDataAttrs(props));
|
|
824
|
+
return (React__default.createElement(ConditionalWrapper, { condition: Boolean(href), wrapper: function (children) { return (React__default.createElement("a", __assign({ href: href, "aria-label": ariaLabel, onClick: onClick, title: title }, wrapperAttrs), children)); }, fallback: function (children) { return React__default.createElement("div", __assign({}, wrapperAttrs), children); } },
|
|
825
|
+
React__default.createElement("div", { className: "arc-AvatarGroup-avatarContainer" }, getAvatars(avatars, max).map(function (props, i) { return (React__default.createElement("div", { key: "".concat(id, "-avatar-").concat(i), className: classNames("arc-AvatarGroup-avatar", "arc-AvatarGroup-avatar--".concat(size)) },
|
|
826
|
+
React__default.createElement(Avatar, __assign({ size: size }, props)))); }))));
|
|
827
|
+
};
|
|
828
|
+
|
|
602
829
|
/** Use `Badge` component to visually display a small amount of information, such as notification counts or status indicators. */
|
|
603
830
|
var Badge = function (_a) {
|
|
604
831
|
var _b, _c;
|
|
@@ -1419,38 +1646,6 @@ var ButtonIcon = function (_a) {
|
|
|
1419
1646
|
return (React__default.createElement("span", { className: "arc-Button-icon" }, isChevron ? (React__default.createElement(Icon, { icon: isBeforeText ? BtIconChevronLeftMid : BtIconChevronRightMid })) : (React__default.createElement(Icon, { icon: icon }))));
|
|
1420
1647
|
};
|
|
1421
1648
|
|
|
1422
|
-
/**
|
|
1423
|
-
* Use `Image` to render a single image, or set of images, with support for
|
|
1424
|
-
* image fitting and art direction.
|
|
1425
|
-
*/
|
|
1426
|
-
var Image = function (_a) {
|
|
1427
|
-
var _b;
|
|
1428
|
-
var alt = _a.alt, _c = _a.anchor, anchor = _c === void 0 ? "C" : _c, children = _a.children, fillColor = _a.fillColor, fit = _a.fit, height = _a.height, loading = _a.loading, overlay = _a.overlay, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet, width = _a.width, props = __rest(_a, ["alt", "anchor", "children", "fillColor", "fit", "height", "loading", "overlay", "sizes", "src", "srcSet", "width"]);
|
|
1429
|
-
useEffect(function () {
|
|
1430
|
-
React__default.Children.map(children, function (item) {
|
|
1431
|
-
if (item && item.type !== ImageSource) {
|
|
1432
|
-
throw new Error("Illegal child passed to <Image />. Ensure to only use <Image.Source />.");
|
|
1433
|
-
}
|
|
1434
|
-
});
|
|
1435
|
-
}, [children]);
|
|
1436
|
-
var img = (React__default.createElement("img", { className: "arc-Image-img", alt: alt, height: fit === "cover" ? undefined : height, loading: loading, sizes: children ? undefined : sizes, src: src, srcSet: children ? undefined : srcSet, width: fit === "cover" ? undefined : width }));
|
|
1437
|
-
return (React__default.createElement("div", __assign({ className: classNames((_b = {
|
|
1438
|
-
"arc-Image": true,
|
|
1439
|
-
"arc-Image--cover": fit === "cover"
|
|
1440
|
-
},
|
|
1441
|
-
_b["arc-Image--anchor".concat(anchor)] = fit === "cover",
|
|
1442
|
-
_b[suffixModifier("arc-Image--overlay", overlay || "")] = overlay,
|
|
1443
|
-
_b)), style: __assign(__assign(__assign({}, (fillColor && { backgroundColor: fillColor })), (fit === "cover" && height ? { height: "".concat(height, "px") } : null)), (fit === "cover" && width ? { width: "".concat(width, "px") } : null)) }, filterDataAttrs(props)), children ? (React__default.createElement("picture", null,
|
|
1444
|
-
children,
|
|
1445
|
-
" ",
|
|
1446
|
-
img)) : (React__default.createElement(React__default.Fragment, null, img))));
|
|
1447
|
-
};
|
|
1448
|
-
var ImageSource = function (_a) {
|
|
1449
|
-
var height = _a.height, media = _a.media, srcSet = _a.srcSet, sizes = _a.sizes, type = _a.type; _a.width; var props = __rest(_a, ["height", "media", "srcSet", "sizes", "type", "width"]);
|
|
1450
|
-
return (React__default.createElement("source", __assign({ height: height, media: media, sizes: sizes, srcSet: srcSet, type: type }, filterDataAttrs(props))));
|
|
1451
|
-
};
|
|
1452
|
-
Image.Source = ImageSource;
|
|
1453
|
-
|
|
1454
1649
|
/**
|
|
1455
1650
|
* Optionally define ariaDescribedBy if errorMessage or helper exist.
|
|
1456
1651
|
*/
|
|
@@ -1758,11 +1953,16 @@ var FormControl = function (_a) {
|
|
|
1758
1953
|
"arc-FormControl--smallLabel": labelSize === "s",
|
|
1759
1954
|
"arc-FormControl--onDarkSurface": surface === "dark"
|
|
1760
1955
|
}), id: id }, elementProps, filterDataAttrs(props)),
|
|
1761
|
-
|
|
1956
|
+
hideLabel === true ? (React__default.createElement(VisuallyHidden, null,
|
|
1957
|
+
React__default.createElement(LabelType, __assign({ className: classNames("arc-FormControl-label", {
|
|
1958
|
+
"arc-FormControl-label--withHelperUnderLabel": helperUnderLabel && helper
|
|
1959
|
+
}) }, labelProps),
|
|
1960
|
+
label,
|
|
1961
|
+
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))))) : (React__default.createElement(LabelType, __assign({ className: classNames("arc-FormControl-label", {
|
|
1962
|
+
"arc-FormControl-label--withHelperUnderLabel": helperUnderLabel && helper
|
|
1963
|
+
}) }, labelProps),
|
|
1762
1964
|
label,
|
|
1763
|
-
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))))
|
|
1764
|
-
label,
|
|
1765
|
-
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))))),
|
|
1965
|
+
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)")))),
|
|
1766
1966
|
helperUnderLabel && (React__default.createElement(React__default.Fragment, null, helper && (React__default.createElement("div", { className: "arc-FormControl-helper arc-FormControl-helper--underLabel", id: idHelper }, helper)))),
|
|
1767
1967
|
children,
|
|
1768
1968
|
React__default.createElement("div", { className: classNames("arc-FormControl-info", {
|
|
@@ -2103,27 +2303,6 @@ var ArcBreakpointS = 636;
|
|
|
2103
2303
|
var ArcBreakpointM = 768;
|
|
2104
2304
|
var ArcBreakpointL = 1024;
|
|
2105
2305
|
|
|
2106
|
-
const BtIconArrowRight = (props) =>
|
|
2107
|
-
/*#__PURE__*/ React__default.createElement(
|
|
2108
|
-
"svg",
|
|
2109
|
-
Object.assign(
|
|
2110
|
-
{
|
|
2111
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2112
|
-
viewBox: "0 0 32 32",
|
|
2113
|
-
},
|
|
2114
|
-
props,
|
|
2115
|
-
),
|
|
2116
|
-
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
2117
|
-
/*#__PURE__*/ React__default.createElement("path", {
|
|
2118
|
-
d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,27A13,13,0,1,1,29,16,13.01474,13.01474,0,0,1,16,29Z",
|
|
2119
|
-
fill: "currentColor",
|
|
2120
|
-
}),
|
|
2121
|
-
/*#__PURE__*/ React__default.createElement("path", {
|
|
2122
|
-
d: "M18.14648,11.64648a.49983.49983,0,0,0,0,.707L21.293,15.5H9.5a.5.5,0,0,0,0,1H21.293l-3.14649,3.14648a.5.5,0,1,0,.707.707L23.207,16l-4.35351-4.35352A.49983.49983,0,0,0,18.14648,11.64648Z",
|
|
2123
|
-
fill: "currentColor",
|
|
2124
|
-
}),
|
|
2125
|
-
);
|
|
2126
|
-
|
|
2127
2306
|
const BtIconCross = (props) =>
|
|
2128
2307
|
/*#__PURE__*/ React__default.createElement(
|
|
2129
2308
|
"svg",
|
|
@@ -2213,114 +2392,6 @@ var VerticalSpace = function (_a) {
|
|
|
2213
2392
|
_b)) }, filterDataAttrs(props))));
|
|
2214
2393
|
};
|
|
2215
2394
|
|
|
2216
|
-
var CardHeading = function (_a) {
|
|
2217
|
-
var onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onBlur = _a.onBlur, onFocus = _a.onFocus, href = _a.href, heading = _a.heading, _b = _a.size, size = _b === void 0 ? "s" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.linkData, linkData = _d === void 0 ? {} : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e;
|
|
2218
|
-
var HeadingElement = "h".concat(headingLevel);
|
|
2219
|
-
return (React__default.createElement(HeadingElement, { className: classNames("arc-CardHeading", "arc-CardHeading--".concat(size), {
|
|
2220
|
-
"arc-CardHeading--darkPathway": isDarkPathway
|
|
2221
|
-
}) }, href ? (React__default.createElement("a", __assign({ className: "arc-CardHeading-link", href: href, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onBlur: onBlur }, filterDataAttrs(linkData)), heading)) : (heading)));
|
|
2222
|
-
};
|
|
2223
|
-
|
|
2224
|
-
var CardLabel = function (_a) {
|
|
2225
|
-
var _b;
|
|
2226
|
-
var text = _a.text, _c = _a.color, color = _c === void 0 ? "muted" : _c, _d = _a.isBold, isBold = _d === void 0 ? true : _d, _e = _a.isDarkPathway, isDarkPathway = _e === void 0 ? false : _e;
|
|
2227
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
2228
|
-
React__default.createElement("span", { className: classNames("arc-CardLabel", (_b = {},
|
|
2229
|
-
_b[suffixModifier("arc-CardLabel--color", color)] = !isDarkPathway,
|
|
2230
|
-
_b["arc-CardLabel--bold"] = isBold,
|
|
2231
|
-
_b["arc-CardLabel--darkPathway"] = isDarkPathway,
|
|
2232
|
-
_b)) }, text)));
|
|
2233
|
-
};
|
|
2234
|
-
|
|
2235
|
-
const BtIconPlay = (props) =>
|
|
2236
|
-
/*#__PURE__*/ React__default.createElement(
|
|
2237
|
-
"svg",
|
|
2238
|
-
Object.assign(
|
|
2239
|
-
{
|
|
2240
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2241
|
-
viewBox: "0 0 32 32",
|
|
2242
|
-
},
|
|
2243
|
-
props,
|
|
2244
|
-
),
|
|
2245
|
-
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
2246
|
-
/*#__PURE__*/ React__default.createElement("path", {
|
|
2247
|
-
d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,27A13,13,0,1,1,29,16,13.01474,13.01474,0,0,1,16,29Z",
|
|
2248
|
-
fill: "currentColor",
|
|
2249
|
-
}),
|
|
2250
|
-
/*#__PURE__*/ React__default.createElement("path", {
|
|
2251
|
-
d: "M20.83887,15.03955,13.66113,10.896A1.107,1.107,0,0,0,12,11.85449v8.2876a1.10534,1.10534,0,0,0,1.66113.95947L20.83887,16.957a1.10688,1.10688,0,0,0,0-1.91748Zm-.5,1.05176-7.17774,4.14453a.10437.10437,0,0,1-.10742-.00049A.10314.10314,0,0,1,13,20.14209v-8.2876a.10229.10229,0,0,1,.05371-.09277.10284.10284,0,0,1,.10742,0l7.17774,4.14307a.10421.10421,0,0,1,.05371.09375A.10285.10285,0,0,1,20.33887,16.09131Z",
|
|
2252
|
-
fill: "currentColor",
|
|
2253
|
-
}),
|
|
2254
|
-
);
|
|
2255
|
-
|
|
2256
|
-
const BtIconArrowRightFill = (props) =>
|
|
2257
|
-
/*#__PURE__*/ React__default.createElement(
|
|
2258
|
-
"svg",
|
|
2259
|
-
Object.assign(
|
|
2260
|
-
{
|
|
2261
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2262
|
-
viewBox: "0 0 32 32",
|
|
2263
|
-
},
|
|
2264
|
-
props,
|
|
2265
|
-
),
|
|
2266
|
-
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
2267
|
-
/*#__PURE__*/ React__default.createElement("path", {
|
|
2268
|
-
d: "M2,16A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm16.85352-4.35352L23.207,16l-4.35351,4.35352a.5.5,0,0,1-.707-.707L21.293,16.5H9.5a.5.5,0,0,1,0-1H21.293l-3.14649-3.14648a.5.5,0,0,1,.707-.707Z",
|
|
2269
|
-
fill: "currentColor",
|
|
2270
|
-
}),
|
|
2271
|
-
);
|
|
2272
|
-
|
|
2273
|
-
const BtIconPlayFill = (props) =>
|
|
2274
|
-
/*#__PURE__*/ React__default.createElement(
|
|
2275
|
-
"svg",
|
|
2276
|
-
Object.assign(
|
|
2277
|
-
{
|
|
2278
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2279
|
-
viewBox: "0 0 32 32",
|
|
2280
|
-
},
|
|
2281
|
-
props,
|
|
2282
|
-
),
|
|
2283
|
-
/*#__PURE__*/ React__default.createElement("defs", null),
|
|
2284
|
-
/*#__PURE__*/ React__default.createElement("path", {
|
|
2285
|
-
d: "M13.16113,11.76172a.10284.10284,0,0,0-.10742,0A.10229.10229,0,0,0,13,11.85449v8.2876a.10314.10314,0,0,0,.05371.09326.10451.10451,0,0,0,.10742.00049l7.17774-4.14453a.10285.10285,0,0,0,.05371-.09277.10421.10421,0,0,0-.05371-.09375Z",
|
|
2286
|
-
fill: "currentColor",
|
|
2287
|
-
}),
|
|
2288
|
-
/*#__PURE__*/ React__default.createElement("path", {
|
|
2289
|
-
d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm4.83887,14.957-7.17774,4.14453A1.10791,1.10791,0,0,1,12,20.14209v-8.2876a1.107,1.107,0,0,1,1.66113-.95849l7.17774,4.14355a1.10688,1.10688,0,0,1,0,1.91748Z",
|
|
2290
|
-
fill: "currentColor",
|
|
2291
|
-
}),
|
|
2292
|
-
);
|
|
2293
|
-
|
|
2294
|
-
var CardFooter = function (_a) {
|
|
2295
|
-
var metaText = _a.metaText, _b = _a.buttonIcon, buttonIcon = _b === void 0 ? "arrow" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.showButton, showButton = _d === void 0 ? true : _d, _e = _a.showFilledIcon, showFilledIcon = _e === void 0 ? false : _e;
|
|
2296
|
-
var icons = {
|
|
2297
|
-
arrow: {
|
|
2298
|
-
regular: BtIconArrowRight,
|
|
2299
|
-
filled: BtIconArrowRightFill
|
|
2300
|
-
},
|
|
2301
|
-
play: {
|
|
2302
|
-
regular: BtIconPlay,
|
|
2303
|
-
filled: BtIconPlayFill
|
|
2304
|
-
}
|
|
2305
|
-
};
|
|
2306
|
-
return (React__default.createElement("div", { className: classNames("arc-CardFooter", {
|
|
2307
|
-
"arc-CardFooter--darkPathway": isDarkPathway,
|
|
2308
|
-
"arc-CardFooter--showFilledIcon": showFilledIcon
|
|
2309
|
-
}) },
|
|
2310
|
-
React__default.createElement("div", { className: "arc-CardFooter-metaTextContainer" }, metaText && (React__default.createElement("span", { className: "arc-CardFooter-metaText" }, metaText))),
|
|
2311
|
-
showButton && (React__default.createElement("div", null,
|
|
2312
|
-
React__default.createElement("div", { className: "arc-CardFooter-button" },
|
|
2313
|
-
React__default.createElement("div", { className: classNames("arc-CardFooter-buttonIcon", "arc-CardFooter-buttonIcon--regular") },
|
|
2314
|
-
React__default.createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
|
|
2315
|
-
React__default.createElement("div", { className: "arc-CardFooter-buttonIcon arc-CardFooter-buttonIcon--filled" },
|
|
2316
|
-
React__default.createElement(Icon, { icon: icons[buttonIcon].filled, size: 40 })))))));
|
|
2317
|
-
};
|
|
2318
|
-
|
|
2319
|
-
var ConditionalWrapper = function (_a) {
|
|
2320
|
-
var condition = _a.condition, wrapper = _a.wrapper, children = _a.children;
|
|
2321
|
-
return (React__default.createElement(React__default.Fragment, null, condition ? wrapper(children) : children));
|
|
2322
|
-
};
|
|
2323
|
-
|
|
2324
2395
|
var InformationCard = function (_a) {
|
|
2325
2396
|
var cardUrl = _a.cardUrl, onClick = _a.onClick, heading = _a.heading, text = _a.text, label = _a.label, footerLogo = _a.footerLogo, button = _a.button, image = _a.image, tags = _a.tags, icon = _a.icon, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, props = __rest(_a, ["cardUrl", "onClick", "heading", "text", "label", "footerLogo", "button", "image", "tags", "icon", "headingLevel"]);
|
|
2326
2397
|
var isMinWidthArcBreakpointS = useMediaQuery("(min-width: ".concat(ArcBreakpointS, "px)"));
|
|
@@ -35736,19 +35807,24 @@ var RadioGroup = function (_a) {
|
|
|
35736
35807
|
size: size
|
|
35737
35808
|
} },
|
|
35738
35809
|
React__default.createElement("div", __assign({ className: "arc-RadioGroup" }, filterDataAttrs(props)),
|
|
35739
|
-
React__default.createElement(FormControl, { elementType: "fieldset", label: label, labelSize: labelSize, helper: helper, id: id, requirementStatus: "not-applicable", helperUnderLabel: true },
|
|
35810
|
+
React__default.createElement(FormControl, { elementType: "fieldset", label: label, labelSize: labelSize, helper: helper, id: id, requirementStatus: "not-applicable", helperUnderLabel: true },
|
|
35811
|
+
React__default.createElement("span", { className: "arc-RadioGroup-radioButtonContainer" }, children)))));
|
|
35740
35812
|
};
|
|
35741
35813
|
RadioGroup.RadioButton = RadioButton;
|
|
35742
35814
|
|
|
35743
35815
|
/**
|
|
35744
|
-
* Use `Rule` to display a horizontal rule.
|
|
35816
|
+
* Use `Rule` to display a horizontal or vertical rule.
|
|
35745
35817
|
*/
|
|
35746
|
-
var Rule = function (props) {
|
|
35818
|
+
var Rule = function (_a, props) {
|
|
35819
|
+
var _b;
|
|
35820
|
+
var _c = _a.orientation, orientation = _c === void 0 ? "horizontal" : _c;
|
|
35747
35821
|
var surface = useContext(Context$5).surface;
|
|
35748
|
-
return (React__default.createElement("hr", __assign({ className: classNames({
|
|
35749
|
-
|
|
35750
|
-
|
|
35751
|
-
|
|
35822
|
+
return (React__default.createElement("hr", __assign({ className: classNames((_b = {
|
|
35823
|
+
"arc-Rule": true
|
|
35824
|
+
},
|
|
35825
|
+
_b["arc-Rule--".concat(orientation)] = true,
|
|
35826
|
+
_b["arc-Rule--onDarkSurface"] = surface === "dark",
|
|
35827
|
+
_b)) }, filterDataAttrs(props))));
|
|
35752
35828
|
};
|
|
35753
35829
|
|
|
35754
35830
|
const BtIconArrowAltUp = (props) =>
|
|
@@ -35794,7 +35870,7 @@ var ScrollToTop = function (_a) {
|
|
|
35794
35870
|
"arc-ScrollToTop--visible": appear === "always" || (appear === "afterScroll" && hasScrolled)
|
|
35795
35871
|
}) }, filterDataAttrs(props)),
|
|
35796
35872
|
React__default.createElement("div", { className: "arc-ScrollToTop-textWrapper" },
|
|
35797
|
-
React__default.createElement("span", { className: "arc-ScrollToTop-text" }, "
|
|
35873
|
+
React__default.createElement("span", { className: "arc-ScrollToTop-text" }, "Back to top")),
|
|
35798
35874
|
React__default.createElement("span", { className: "arc-ScrollToTop-iconContainer" },
|
|
35799
35875
|
React__default.createElement(Icon, { icon: BtIconArrowAltUp, size: 44 }))));
|
|
35800
35876
|
};
|
|
@@ -39208,14 +39284,16 @@ const BtIconChevronUp2Px = (props) =>
|
|
|
39208
39284
|
/** Use `Select` to choose from a dropdown list of options. */
|
|
39209
39285
|
var Select = function (_a) {
|
|
39210
39286
|
var _b;
|
|
39211
|
-
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, hideLabel = _a.hideLabel, name = _a.name, width = _a.width, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = __rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "hideLabel", "name", "width", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
|
|
39287
|
+
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, value = _a.value, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, hideLabel = _a.hideLabel, name = _a.name, width = _a.width, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = __rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "value", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "hideLabel", "name", "width", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
|
|
39212
39288
|
var id = useId();
|
|
39213
39289
|
var arcRootElement = useContext(ArcRootElementContext);
|
|
39214
39290
|
var surface = useContext(Context$5).surface;
|
|
39215
|
-
var _e = useState(defaultValue),
|
|
39291
|
+
var _e = useState(defaultValue), uncontrolledValue = _e[0], setUncontrolledValue = _e[1];
|
|
39292
|
+
var isControlled = typeof value !== "undefined";
|
|
39293
|
+
var selectValue = isControlled ? value : uncontrolledValue;
|
|
39216
39294
|
var onValueChange = function (value) {
|
|
39217
39295
|
onChange && onChange(value);
|
|
39218
|
-
|
|
39296
|
+
setUncontrolledValue(value);
|
|
39219
39297
|
};
|
|
39220
39298
|
var getSelectedValueName = function (value) {
|
|
39221
39299
|
var _a;
|
|
@@ -39232,7 +39310,7 @@ var Select = function (_a) {
|
|
|
39232
39310
|
}
|
|
39233
39311
|
};
|
|
39234
39312
|
return (React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, hideLabel: hideLabel, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", isDisabled: isDisabled, disclosureText: disclosureText, disclosureTitle: disclosureTitle, onClickDisclosure: onClickDisclosure },
|
|
39235
|
-
React__default.createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value:
|
|
39313
|
+
React__default.createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value: selectValue, onOpenChange: onOpenChange, onValueChange: function (value) { return onValueChange(value); } },
|
|
39236
39314
|
React__default.createElement("div", { className: "arc-Select-wrapper" },
|
|
39237
39315
|
React__default.createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, __assign({ id: id, name: name, onBlur: onBlur, "aria-label": ariaLabel, style: { width: width }, className: classNames("arc-Select-trigger", (_b = {
|
|
39238
39316
|
"arc-Select-trigger--constrained": !isFluid,
|
|
@@ -39241,7 +39319,7 @@ var Select = function (_a) {
|
|
|
39241
39319
|
},
|
|
39242
39320
|
_b["arc-Select-trigger--size".concat(selectSize && selectSize.toUpperCase())] = selectSize && selectSize !== "m",
|
|
39243
39321
|
_b)) }, filterDataAttrs(props)),
|
|
39244
|
-
React__default.createElement($cc7e05a45900e73f$export$4c8d1a57a761ef94, { className: "arc-Select-triggerText", placeholder: placeholder, "aria-label": getSelectedValueName(
|
|
39322
|
+
React__default.createElement($cc7e05a45900e73f$export$4c8d1a57a761ef94, { className: "arc-Select-triggerText", placeholder: placeholder, "aria-label": getSelectedValueName(uncontrolledValue) }),
|
|
39245
39323
|
React__default.createElement($cc7e05a45900e73f$export$f04a61298a47a40f, { className: "arc-Select-triggerIcon" },
|
|
39246
39324
|
React__default.createElement(Icon, { icon: BtIconChevronDown2Px, size: getIconSize(selectSize) }))),
|
|
39247
39325
|
React__default.createElement($cc7e05a45900e73f$export$602eac185826482c, { container: arcRootElement || undefined },
|
|
@@ -39990,9 +40068,9 @@ var Item = function (_a) {
|
|
|
39990
40068
|
_b["arc-SiteHeaderV2Item--emphasised"] = true,
|
|
39991
40069
|
_b)) }, filterDataAttrs(props)),
|
|
39992
40070
|
React__default.createElement("a", { onClick: handleLinkClick({ handler: onClick }), className: "arc-SiteHeaderV2Item-link", href: href },
|
|
40071
|
+
children,
|
|
39993
40072
|
React__default.createElement("span", { className: "arc-SiteHeaderV2Item-linkIcon" },
|
|
39994
|
-
React__default.createElement(BtIconChevronRightMid, null))
|
|
39995
|
-
children)));
|
|
40073
|
+
React__default.createElement(BtIconChevronRightMid, null)))));
|
|
39996
40074
|
};
|
|
39997
40075
|
|
|
39998
40076
|
var ItemGroup = function (_a) {
|
|
@@ -40094,6 +40172,7 @@ var Panel = function (_a) {
|
|
|
40094
40172
|
}
|
|
40095
40173
|
// Close the panel.
|
|
40096
40174
|
setOpen(false);
|
|
40175
|
+
setOpenPanelOnFirstClick(false);
|
|
40097
40176
|
};
|
|
40098
40177
|
document.addEventListener("click", handleClick);
|
|
40099
40178
|
return function () {
|
|
@@ -40271,32 +40350,15 @@ var HorizontalPanel = function (_a) {
|
|
|
40271
40350
|
// Where appropriate, close the Panel when clicking outside of it,
|
|
40272
40351
|
// by listening to clicks on the entire document and acting accordingly.
|
|
40273
40352
|
var handleClick = function (e) {
|
|
40274
|
-
var _a
|
|
40275
|
-
//
|
|
40353
|
+
var _a;
|
|
40354
|
+
// Close the Horizontal Panel…
|
|
40276
40355
|
if (
|
|
40277
|
-
// The click is inside the current
|
|
40278
|
-
((_a =
|
|
40279
|
-
|
|
40280
|
-
|
|
40281
|
-
// and the target is not a link
|
|
40282
|
-
(((_b = navItemRef === null || navItemRef === void 0 ? void 0 : navItemRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target)) &&
|
|
40283
|
-
!subNavItemRef &&
|
|
40284
|
-
!e.target.getAttribute("href")) ||
|
|
40285
|
-
// The Panel is inside a SubNavItem
|
|
40286
|
-
// and the click is not on a SubNavItem-link.
|
|
40287
|
-
// This ensures that one SubNavItem Panel per NavItem always remains open.
|
|
40288
|
-
(subNavItemRef &&
|
|
40289
|
-
!e.target.classList.contains(subNavLink) &&
|
|
40290
|
-
!e.target.classList.contains("".concat(subNavLink, "Title")) &&
|
|
40291
|
-
!e.target.classList.contains("".concat(subNavLink, "SubTitle"))) ||
|
|
40292
|
-
// Panel is inside a SubNavItem
|
|
40293
|
-
// and the click is not inside the Panel's NavItem parent.
|
|
40294
|
-
// This prevents SubNavItem Panels in sibling NavItems from being closed.
|
|
40295
|
-
(subNavItemRef && !(navItemRef === null || navItemRef === void 0 ? void 0 : navItemRef.current.contains(e.target)))) {
|
|
40356
|
+
// The click is not inside the current NavItem
|
|
40357
|
+
!((_a = navItemRef === null || navItemRef === void 0 ? void 0 : navItemRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) ||
|
|
40358
|
+
e.target.classList.contains("arc-SiteHeaderV2HorizontalPanel--open")) {
|
|
40359
|
+
setOpen(false);
|
|
40296
40360
|
return;
|
|
40297
40361
|
}
|
|
40298
|
-
// Close the panel.
|
|
40299
|
-
setOpen(false);
|
|
40300
40362
|
};
|
|
40301
40363
|
document.addEventListener("click", handleClick);
|
|
40302
40364
|
return function () {
|
|
@@ -42692,5 +42754,5 @@ var UniversalHeaderItem = function (_a) {
|
|
|
42692
42754
|
};
|
|
42693
42755
|
UniversalHeader.Item = UniversalHeaderItem;
|
|
42694
42756
|
|
|
42695
|
-
export { Alert, Align, Badge, Base, Box, BrandLogo, Breadcrumbs, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, DisclosureMini, Elevation, Filter, FormControl, Group, Heading, Icon, Image, InformationCard, Markup, MediaCard, Modal, Pagination, PaginationSimple, Poster, ProgressBar, ProgressStepper, RadioGroup, Rule, ScrollToTop, Section, Select, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, SiteHeaderV2, Surface, Context$5 as SurfaceContext, Switch, Tabs, Tag, Text, TextArea, TextInput, Toast, Truncate, TypographyCard, UniversalHeader, VerticalSpace, VisuallyHidden };
|
|
42757
|
+
export { Alert, Align, Avatar, AvatarGroup, Badge, Base, Box, BrandLogo, Breadcrumbs, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, DisclosureMini, Elevation, Filter, FormControl, Group, Heading, Icon, Image, InformationCard, Markup, MediaCard, Modal, Pagination, PaginationSimple, Poster, ProgressBar, ProgressStepper, RadioGroup, Rule, ScrollToTop, Section, Select, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, SiteHeaderV2, Surface, Context$5 as SurfaceContext, Switch, Tabs, Tag, Text, TextArea, TextInput, Toast, Truncate, TypographyCard, UniversalHeader, VerticalSpace, VisuallyHidden };
|
|
42696
42758
|
//# sourceMappingURL=index.es.js.map
|