@innovaccer/design-system 2.36.1 → 2.37.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/CHANGELOG.md +99 -0
- package/css/Readme.md +3 -3
- package/css/dist/index.css +96 -40
- package/css/dist/index.css.map +1 -1
- package/css/src/components/actionCard.css +13 -10
- package/css/src/components/avatar.css +25 -2
- package/css/src/components/avatarGroup.css +8 -0
- package/css/src/components/avatarSelection.css +1 -1
- package/css/src/components/chip.css +12 -7
- package/css/src/components/message.css +1 -1
- package/css/src/components/select.css +8 -1
- package/css/src/components/selectionCard.css +17 -11
- package/css/src/tokens/index.css +3 -3
- package/css/src/utils/cursor.css +4 -0
- package/dist/.lib/tsconfig.type.tsbuildinfo +36 -34
- package/dist/core/components/atoms/avatar/Avatar.d.ts +3 -0
- package/dist/core/components/atoms/avatarGroup/AvatarGroup.d.ts +2 -0
- package/dist/core/components/atoms/avatarSelection/AvatarSelection.d.ts +2 -0
- package/dist/core/components/atoms/avatarSelection/avatarPopover/AvatarSelectionOption.d.ts +1 -0
- package/dist/core/components/atoms/avatarSelection/avatarsSelection/SelectionAvatar.d.ts +2 -0
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +1 -0
- package/dist/core/components/molecules/popover/Popover.d.ts +1 -0
- package/dist/core/components/organisms/combobox/Combobox.d.ts +2 -0
- package/dist/core/components/organisms/select/Select.d.ts +2 -0
- package/dist/index.esm.js +163 -60
- package/dist/index.js +169 -62
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1719911531711
|
|
4
4
|
* Package: @innovaccer/design-system
|
|
5
|
-
* Version: v2.
|
|
5
|
+
* Version: v2.37.0
|
|
6
6
|
* License: MIT
|
|
7
7
|
* Docs: https://mds.innovaccer.com
|
|
8
8
|
*/
|
|
@@ -548,16 +548,27 @@
|
|
|
548
548
|
className = props.className,
|
|
549
549
|
appearance = props.appearance,
|
|
550
550
|
shape = props.shape,
|
|
551
|
+
disabled = props.disabled,
|
|
552
|
+
tooltipSuffix = props.tooltipSuffix,
|
|
553
|
+
tabIndex = props.tabIndex,
|
|
551
554
|
_e = props.role,
|
|
552
555
|
role = _e === void 0 ? 'presentation' : _e;
|
|
553
556
|
var baseProps = extractBaseProps(props);
|
|
554
557
|
var initials = children && typeof children === 'string' ? children.trim().slice(0, initialsLength) : "" + (firstName ? firstName.trim()[0] : '') + (lastName ? lastName.trim()[0] : '');
|
|
555
|
-
|
|
558
|
+
|
|
559
|
+
var getTooltipName = function getTooltipName() {
|
|
560
|
+
if (children && typeof children === 'string') {
|
|
561
|
+
return children + " " + (tooltipSuffix || '');
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
return (firstName || '') + " " + (lastName || '') + " " + (tooltipSuffix || '') || '';
|
|
565
|
+
};
|
|
566
|
+
|
|
556
567
|
var AvatarAppearance = appearance || colors[(initials.charCodeAt(0) + (initials.charCodeAt(1) || 0)) % 8] || DefaultAppearance;
|
|
557
568
|
var AvatarClassNames = classNames__default["default"]((_a = {
|
|
558
569
|
Avatar: true
|
|
559
|
-
}, _a['Avatar--square'] = shape === 'square', _a["Avatar--" + size] = shape !== 'square', _a["Avatar--" + AvatarAppearance] = AvatarAppearance, _a['Avatar--
|
|
560
|
-
var AvatarWrapperClassNames = classNames__default["default"]((_b = {}, _b['Avatar--
|
|
570
|
+
}, _a['Avatar--square'] = shape === 'square', _a["Avatar--" + size] = shape !== 'square', _a["Avatar--" + AvatarAppearance] = AvatarAppearance, _a['Avatar--noInitials'] = !initials || !withTooltip, _a['Avatar--disabled'] = disabled, _a['Avatar--default'] = !disabled, _a), className);
|
|
571
|
+
var AvatarWrapperClassNames = classNames__default["default"]((_b = {}, _b['Avatar-wrapper--square'] = shape === 'square', _b["Avatar--" + size] = shape === 'square', _b));
|
|
561
572
|
var TextClassNames = classNames__default["default"]((_c = {}, _c["Avatar-content--" + size] = size, _c["Avatar-content--" + AvatarAppearance] = AvatarAppearance, _c));
|
|
562
573
|
var IconClassNames = classNames__default["default"]((_d = {}, _d["Avatar-content--" + AvatarAppearance] = AvatarAppearance, _d));
|
|
563
574
|
var sharedProp = {
|
|
@@ -578,7 +589,8 @@
|
|
|
578
589
|
}, /*#__PURE__*/React__namespace.createElement("span", __assign$1({
|
|
579
590
|
"data-test": "DesignSystem-Avatar"
|
|
580
591
|
}, baseProps, {
|
|
581
|
-
className: AvatarClassNames
|
|
592
|
+
className: AvatarClassNames,
|
|
593
|
+
tabIndex: tabIndex || disabled ? -1 : 0
|
|
582
594
|
}), children)));
|
|
583
595
|
}
|
|
584
596
|
|
|
@@ -589,7 +601,8 @@
|
|
|
589
601
|
}, /*#__PURE__*/React__namespace.createElement("span", __assign$1({
|
|
590
602
|
"data-test": "DesignSystem-Avatar"
|
|
591
603
|
}, baseProps, {
|
|
592
|
-
className: AvatarClassNames
|
|
604
|
+
className: AvatarClassNames,
|
|
605
|
+
tabIndex: tabIndex || disabled ? -1 : 0
|
|
593
606
|
}), initials && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
594
607
|
weight: "medium",
|
|
595
608
|
appearance: 'white',
|
|
@@ -606,7 +619,7 @@
|
|
|
606
619
|
var renderTooltip = function renderTooltip() {
|
|
607
620
|
if (withTooltip && initials) {
|
|
608
621
|
return /*#__PURE__*/React__namespace.createElement(Tooltip, {
|
|
609
|
-
tooltip:
|
|
622
|
+
tooltip: getTooltipName(),
|
|
610
623
|
position: tooltipPosition,
|
|
611
624
|
triggerClass: 'flex-grow-0'
|
|
612
625
|
}, renderAvatar());
|
|
@@ -637,11 +650,13 @@
|
|
|
637
650
|
var ContentClass = classNames__default["default"]((_a = {}, _a["Avatar-content--secondary"] = true, _a["Avatar-content--tiny"] = size === 'tiny', _a));
|
|
638
651
|
var AvatarVariantsClass = classNames__default["default"]((_b = {
|
|
639
652
|
Avatar: true
|
|
640
|
-
}, _b["Avatar--regular"] = size === 'regular', _b["Avatar--tiny"] = size === 'tiny', _b["Avatar--secondary"] = true, _b['
|
|
653
|
+
}, _b["Avatar--regular"] = size === 'regular', _b["Avatar--tiny"] = size === 'tiny', _b["Avatar--secondary"] = true, _b['cursor-default'] = true, _b['cursor-pointer'] = on === 'click', _b));
|
|
641
654
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
642
655
|
"data-test": "DesignSystem-AvatarGroup--TriggerAvatar",
|
|
643
656
|
className: "AvatarCount-wrapper",
|
|
644
|
-
style: avatarStyle
|
|
657
|
+
style: avatarStyle,
|
|
658
|
+
tabIndex: 0,
|
|
659
|
+
role: "button"
|
|
645
660
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
646
661
|
"data-test": "DesignSystem-AvatarGroup--TriggerAvatarVariants",
|
|
647
662
|
className: AvatarVariantsClass
|
|
@@ -664,7 +679,9 @@
|
|
|
664
679
|
firstName = item.firstName,
|
|
665
680
|
lastName = item.lastName,
|
|
666
681
|
icon = item.icon,
|
|
667
|
-
image = item.image
|
|
682
|
+
image = item.image,
|
|
683
|
+
disabled = item.disabled,
|
|
684
|
+
tooltipSuffix = item.tooltipSuffix;
|
|
668
685
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
669
686
|
"data-test": "DesignSystem-AvatarGroup--Avatar",
|
|
670
687
|
className: GroupClass,
|
|
@@ -676,7 +693,9 @@
|
|
|
676
693
|
firstName: firstName,
|
|
677
694
|
lastName: lastName,
|
|
678
695
|
withTooltip: true,
|
|
679
|
-
|
|
696
|
+
disabled: disabled,
|
|
697
|
+
tooltipPosition: tooltipPosition,
|
|
698
|
+
tooltipSuffix: tooltipSuffix
|
|
680
699
|
}, image || icon));
|
|
681
700
|
});
|
|
682
701
|
return avatars;
|
|
@@ -705,8 +724,10 @@
|
|
|
705
724
|
var _b = item.firstName,
|
|
706
725
|
firstName = _b === void 0 ? '' : _b,
|
|
707
726
|
_c = item.lastName,
|
|
708
|
-
lastName = _c === void 0 ? '' : _c
|
|
709
|
-
|
|
727
|
+
lastName = _c === void 0 ? '' : _c,
|
|
728
|
+
_d = item.tooltipSuffix,
|
|
729
|
+
tooltipSuffix = _d === void 0 ? '' : _d;
|
|
730
|
+
var name = firstName + " " + lastName + " " + tooltipSuffix;
|
|
710
731
|
var AvatarTextClass = classNames__default["default"]((_a = {}, _a["mb-4"] = ind < hiddenAvatarList.length - 1, _a));
|
|
711
732
|
return /*#__PURE__*/React__namespace.createElement(Text, {
|
|
712
733
|
key: ind,
|
|
@@ -2694,10 +2715,10 @@
|
|
|
2694
2715
|
var iconAppearance = function iconAppearance(align) {
|
|
2695
2716
|
var _a;
|
|
2696
2717
|
|
|
2697
|
-
return classNames__default["default"]((_a = {}, _a['
|
|
2718
|
+
return classNames__default["default"]((_a = {}, _a['primary_dark'] = selected, _a['subtle'] = !selected && align === 'right', _a['inverse'] = !selected && align === 'left', _a));
|
|
2698
2719
|
};
|
|
2699
2720
|
|
|
2700
|
-
var textColor = classNames__default["default"]((_a = {}, _a['primary-
|
|
2721
|
+
var textColor = classNames__default["default"]((_a = {}, _a['primary-dark'] = selected, _a['inverse'] = !disabled && !selected, _a));
|
|
2701
2722
|
|
|
2702
2723
|
var renderLabel = function renderLabel() {
|
|
2703
2724
|
if (typeof label === 'string') {
|
|
@@ -8660,7 +8681,9 @@
|
|
|
8660
8681
|
var options = on === 'hover' ? {
|
|
8661
8682
|
ref: ref,
|
|
8662
8683
|
onMouseEnter: this.handleMouseEnter,
|
|
8663
|
-
onMouseLeave: this.handleMouseLeave
|
|
8684
|
+
onMouseLeave: this.handleMouseLeave,
|
|
8685
|
+
onFocus: this.handleMouseEnter,
|
|
8686
|
+
onBlur: this.handleMouseLeave
|
|
8664
8687
|
} : {
|
|
8665
8688
|
ref: ref,
|
|
8666
8689
|
onClick: function onClick(ev) {
|
|
@@ -8796,7 +8819,8 @@
|
|
|
8796
8819
|
appendToBody = _a.appendToBody,
|
|
8797
8820
|
hide = _a.hide,
|
|
8798
8821
|
boundaryElement = _a.boundaryElement,
|
|
8799
|
-
triggerCoordinates = _a.triggerCoordinates
|
|
8822
|
+
triggerCoordinates = _a.triggerCoordinates,
|
|
8823
|
+
computeStyles = _a.computeStyles;
|
|
8800
8824
|
var _b = this.state,
|
|
8801
8825
|
animationKeyframe = _b.animationKeyframe,
|
|
8802
8826
|
isOpen = _b.isOpen;
|
|
@@ -8809,7 +8833,8 @@
|
|
|
8809
8833
|
},
|
|
8810
8834
|
hide: {
|
|
8811
8835
|
enabled: hide
|
|
8812
|
-
}
|
|
8836
|
+
},
|
|
8837
|
+
computeStyles: computeStyles
|
|
8813
8838
|
}, triggerCoordinates && {
|
|
8814
8839
|
offset: {
|
|
8815
8840
|
offset: triggerCoordinates.x + "px, " + triggerCoordinates.y + "px"
|
|
@@ -8830,11 +8855,15 @@
|
|
|
8830
8855
|
},
|
|
8831
8856
|
hide: {
|
|
8832
8857
|
enabled: hide
|
|
8833
|
-
}
|
|
8858
|
+
},
|
|
8859
|
+
computeStyles: computeStyles
|
|
8834
8860
|
}
|
|
8835
8861
|
}, this.getPopperChildren), document.body), isOpen && appendToBody && triggerCoordinates && /*#__PURE__*/ReactDOM__namespace.createPortal(coordinatesPopper, document.body), isOpen && !appendToBody && !triggerCoordinates && /*#__PURE__*/React__namespace.createElement(reactPopper.Popper, {
|
|
8836
8862
|
placement: placement,
|
|
8837
|
-
innerRef: this.popupRef
|
|
8863
|
+
innerRef: this.popupRef,
|
|
8864
|
+
modifiers: {
|
|
8865
|
+
computeStyles: computeStyles
|
|
8866
|
+
}
|
|
8838
8867
|
}, this.getPopperChildren));
|
|
8839
8868
|
};
|
|
8840
8869
|
|
|
@@ -17262,10 +17291,16 @@
|
|
|
17262
17291
|
onClick = props.onClick,
|
|
17263
17292
|
rest = __rest(props, ["children", "disabled", "className", "zIndex", "onClick"]);
|
|
17264
17293
|
|
|
17265
|
-
var classes = classNames__default["default"]((_a = {}, _a['ActionCard'] = true, _a['ActionCard--disabled'] = disabled, _a), className);
|
|
17294
|
+
var classes = classNames__default["default"]((_a = {}, _a['ActionCard'] = true, _a['ActionCard--default'] = !disabled, _a['ActionCard--disabled'] = disabled, _a), className);
|
|
17266
17295
|
|
|
17267
17296
|
var onKeyDownHandler = function onKeyDownHandler(event) {
|
|
17268
|
-
if (event.key === 'Enter' && onClick) {
|
|
17297
|
+
if (event.key === 'Enter' && onClick && !disabled) {
|
|
17298
|
+
onClick(event);
|
|
17299
|
+
}
|
|
17300
|
+
};
|
|
17301
|
+
|
|
17302
|
+
var onClickHandler = function onClickHandler(event) {
|
|
17303
|
+
if (!disabled && onClick) {
|
|
17269
17304
|
onClick(event);
|
|
17270
17305
|
}
|
|
17271
17306
|
};
|
|
@@ -17275,7 +17310,7 @@
|
|
|
17275
17310
|
role: "link",
|
|
17276
17311
|
"data-test": "DesignSystem-ActionCard",
|
|
17277
17312
|
className: classes,
|
|
17278
|
-
onClick:
|
|
17313
|
+
onClick: onClickHandler,
|
|
17279
17314
|
onKeyDown: onKeyDownHandler
|
|
17280
17315
|
}, rest), disabled && /*#__PURE__*/React__namespace.createElement("div", {
|
|
17281
17316
|
style: {
|
|
@@ -17372,14 +17407,16 @@
|
|
|
17372
17407
|
className = props.className,
|
|
17373
17408
|
rest = __rest(props, ["children", "onClick", "disabled", "id", "cardValue", "overlayZIndex", "selected", "className"]);
|
|
17374
17409
|
|
|
17375
|
-
var classes = classNames__default["default"]((_a = {}, _a['Selection-card'] = true, _a['Selection-card--selected'] = selected, _a['Selection-card--disabled'] = disabled && !selected, _a['Selection-card--selected-disabled'] = disabled && selected, _a), className);
|
|
17410
|
+
var classes = classNames__default["default"]((_a = {}, _a['Selection-card'] = true, _a['Selection-card--default'] = !disabled, _a['Selection-card--selected'] = selected && !disabled, _a['Selection-card--disabled'] = disabled, _a['Selection-card--default-disabled'] = disabled && !selected, _a['Selection-card--selected-disabled'] = disabled && selected, _a), className);
|
|
17376
17411
|
|
|
17377
17412
|
var onClickHandler = function onClickHandler(event) {
|
|
17378
|
-
|
|
17413
|
+
if (!disabled && onClick) {
|
|
17414
|
+
onClick(event, id, cardValue);
|
|
17415
|
+
}
|
|
17379
17416
|
};
|
|
17380
17417
|
|
|
17381
17418
|
var onKeyDownHandler = function onKeyDownHandler(event) {
|
|
17382
|
-
if (event.key === 'Enter') {
|
|
17419
|
+
if (event.key === 'Enter' && !disabled) {
|
|
17383
17420
|
onClickHandler(event);
|
|
17384
17421
|
}
|
|
17385
17422
|
};
|
|
@@ -17387,7 +17424,7 @@
|
|
|
17387
17424
|
return /*#__PURE__*/React__namespace.createElement("div", __assign$1({
|
|
17388
17425
|
role: "checkbox",
|
|
17389
17426
|
"aria-checked": selected,
|
|
17390
|
-
tabIndex: 0,
|
|
17427
|
+
tabIndex: disabled ? -1 : 0,
|
|
17391
17428
|
onKeyDown: onKeyDownHandler,
|
|
17392
17429
|
onClick: function onClick(event) {
|
|
17393
17430
|
return onClickHandler(event);
|
|
@@ -18493,15 +18530,20 @@
|
|
|
18493
18530
|
TextField.displayName = 'TextField';
|
|
18494
18531
|
|
|
18495
18532
|
var SelectionAvatar = function SelectionAvatar(props) {
|
|
18533
|
+
var _a;
|
|
18534
|
+
|
|
18496
18535
|
var icon = props.icon,
|
|
18497
18536
|
image = props.image,
|
|
18498
|
-
|
|
18537
|
+
disabled = props.disabled,
|
|
18538
|
+
rest = __rest(props, ["icon", "image", "disabled"]);
|
|
18499
18539
|
|
|
18540
|
+
var avatarClassName = classNames__default["default"]((_a = {}, _a['cursor-pointer'] = !disabled, _a));
|
|
18500
18541
|
return /*#__PURE__*/React__namespace.createElement(Avatar, __assign$1({
|
|
18501
18542
|
role: "checkbox"
|
|
18502
18543
|
}, rest, {
|
|
18544
|
+
disabled: disabled,
|
|
18503
18545
|
withTooltip: true,
|
|
18504
|
-
className:
|
|
18546
|
+
className: avatarClassName
|
|
18505
18547
|
}), image || icon);
|
|
18506
18548
|
};
|
|
18507
18549
|
|
|
@@ -18519,6 +18561,10 @@
|
|
|
18519
18561
|
onSelect = contextProp.onSelect;
|
|
18520
18562
|
|
|
18521
18563
|
var onClickHandler = function onClickHandler(item) {
|
|
18564
|
+
if (item.disabled) {
|
|
18565
|
+
return;
|
|
18566
|
+
}
|
|
18567
|
+
|
|
18522
18568
|
var list = selectedItems;
|
|
18523
18569
|
|
|
18524
18570
|
if (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.includes(item)) {
|
|
@@ -18534,6 +18580,10 @@
|
|
|
18534
18580
|
};
|
|
18535
18581
|
|
|
18536
18582
|
var handleKeyDown = function handleKeyDown(event, item) {
|
|
18583
|
+
if (item.disabled) {
|
|
18584
|
+
return;
|
|
18585
|
+
}
|
|
18586
|
+
|
|
18537
18587
|
switch (event.key) {
|
|
18538
18588
|
case 'Enter':
|
|
18539
18589
|
onClickHandler(item);
|
|
@@ -18548,8 +18598,10 @@
|
|
|
18548
18598
|
firstName = avatarItem.firstName,
|
|
18549
18599
|
lastName = avatarItem.lastName,
|
|
18550
18600
|
icon = avatarItem.icon,
|
|
18551
|
-
image = avatarItem.image
|
|
18552
|
-
|
|
18601
|
+
image = avatarItem.image,
|
|
18602
|
+
disabled = avatarItem.disabled,
|
|
18603
|
+
tooltipSuffix = avatarItem.tooltipSuffix;
|
|
18604
|
+
var GroupClass = classNames__default["default"]((_a = {}, _a["SelectionAvatarGroup-item"] = true, _a["SelectionAvatarGroup-item--active"] = !disabled, _a["SelectionAvatarGroup-item--selected"] = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.includes(avatarItem), _a));
|
|
18553
18605
|
|
|
18554
18606
|
if (avatarRenderer) {
|
|
18555
18607
|
return avatarRenderer(avatarItem);
|
|
@@ -18559,7 +18611,7 @@
|
|
|
18559
18611
|
key: index,
|
|
18560
18612
|
className: "SelectionAvatarGroup-wrapper"
|
|
18561
18613
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
18562
|
-
tabIndex:
|
|
18614
|
+
tabIndex: -1,
|
|
18563
18615
|
role: "checkbox",
|
|
18564
18616
|
style: avatarStyle,
|
|
18565
18617
|
className: GroupClass,
|
|
@@ -18579,7 +18631,9 @@
|
|
|
18579
18631
|
withTooltip: true,
|
|
18580
18632
|
tooltipPosition: tooltipPosition,
|
|
18581
18633
|
icon: icon,
|
|
18582
|
-
image: image
|
|
18634
|
+
image: image,
|
|
18635
|
+
disabled: disabled,
|
|
18636
|
+
tooltipSuffix: tooltipSuffix
|
|
18583
18637
|
})));
|
|
18584
18638
|
}));
|
|
18585
18639
|
};
|
|
@@ -18648,7 +18702,7 @@
|
|
|
18648
18702
|
selectedItemCount = _b[0],
|
|
18649
18703
|
setSelectedItemCount = _b[1];
|
|
18650
18704
|
|
|
18651
|
-
var wrapperClassName = classNames__default["default"]((_a = {}, _a['SelectionAvatarCount-wrapper'] = true, _a['SelectionAvatarCount--selected'] = selectedItemCount > 0, _a));
|
|
18705
|
+
var wrapperClassName = classNames__default["default"]((_a = {}, _a['SelectionAvatarCount-wrapper'] = true, _a["SelectionAvatarGroup-item"] = true, _a['SelectionAvatarCount--selected'] = selectedItemCount > 0, _a));
|
|
18652
18706
|
React__namespace.useEffect(function () {
|
|
18653
18707
|
var selectedList = hiddenAvatarList.filter(function (data1) {
|
|
18654
18708
|
return selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.some(function (data2) {
|
|
@@ -18671,6 +18725,7 @@
|
|
|
18671
18725
|
"aria-controls": popoverId,
|
|
18672
18726
|
ref: triggerRef
|
|
18673
18727
|
}, /*#__PURE__*/React__namespace.createElement(Avatar, {
|
|
18728
|
+
tabIndex: -1,
|
|
18674
18729
|
size: size,
|
|
18675
18730
|
appearance: "secondary",
|
|
18676
18731
|
className: "SelectionAvatarCount cursor-pointer"
|
|
@@ -18796,7 +18851,8 @@
|
|
|
18796
18851
|
var AvatarSelectionOption = function AvatarSelectionOption(props) {
|
|
18797
18852
|
var children = props.children,
|
|
18798
18853
|
value = props.value,
|
|
18799
|
-
|
|
18854
|
+
disabled = props.disabled,
|
|
18855
|
+
rest = __rest(props, ["children", "value", "disabled"]);
|
|
18800
18856
|
|
|
18801
18857
|
var contextProp = React__namespace.useContext(AvatarSelectionContext);
|
|
18802
18858
|
var setSelectedItems = contextProp.setSelectedItems,
|
|
@@ -18813,6 +18869,11 @@
|
|
|
18813
18869
|
|
|
18814
18870
|
var onSelectHandler = function onSelectHandler(event, avatarData) {
|
|
18815
18871
|
event.preventDefault();
|
|
18872
|
+
|
|
18873
|
+
if (disabled) {
|
|
18874
|
+
return;
|
|
18875
|
+
}
|
|
18876
|
+
|
|
18816
18877
|
var list = selectedItems ? __spreadArrays(selectedItems) : [];
|
|
18817
18878
|
|
|
18818
18879
|
if (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.includes(avatarData)) {
|
|
@@ -18841,6 +18902,7 @@
|
|
|
18841
18902
|
},
|
|
18842
18903
|
selected: selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.includes(value),
|
|
18843
18904
|
"data-test": "DesignSystem-AvatarSelection--Option",
|
|
18905
|
+
disabled: disabled,
|
|
18844
18906
|
tabIndex: -1
|
|
18845
18907
|
}, rest), children);
|
|
18846
18908
|
};
|
|
@@ -18881,8 +18943,10 @@
|
|
|
18881
18943
|
var _b = avatarData.firstName,
|
|
18882
18944
|
firstName = _b === void 0 ? '' : _b,
|
|
18883
18945
|
_c = avatarData.lastName,
|
|
18884
|
-
lastName = _c === void 0 ? '' : _c
|
|
18885
|
-
|
|
18946
|
+
lastName = _c === void 0 ? '' : _c,
|
|
18947
|
+
disabled = avatarData.disabled,
|
|
18948
|
+
tooltipSuffix = avatarData.tooltipSuffix;
|
|
18949
|
+
var name = (firstName || '') + " " + (lastName || '') + " " + (tooltipSuffix || '') || '';
|
|
18886
18950
|
return /*#__PURE__*/React__namespace.createElement(Tooltip, {
|
|
18887
18951
|
showOnTruncation: true,
|
|
18888
18952
|
tooltip: name,
|
|
@@ -18890,6 +18954,7 @@
|
|
|
18890
18954
|
open: showTooltip
|
|
18891
18955
|
}, /*#__PURE__*/React__namespace.createElement(AvatarSelectionOption, {
|
|
18892
18956
|
value: avatarData,
|
|
18957
|
+
disabled: disabled,
|
|
18893
18958
|
onFocus: function onFocus() {
|
|
18894
18959
|
setShowTooltip(true);
|
|
18895
18960
|
},
|
|
@@ -19671,6 +19736,7 @@
|
|
|
19671
19736
|
multiSelect = props.multiSelect,
|
|
19672
19737
|
className = props.className,
|
|
19673
19738
|
maxHeight = props.maxHeight,
|
|
19739
|
+
minHeight = props.minHeight,
|
|
19674
19740
|
width = props.width,
|
|
19675
19741
|
value = props.value,
|
|
19676
19742
|
placeholder = props.placeholder,
|
|
@@ -19686,7 +19752,8 @@
|
|
|
19686
19752
|
clearButton = props.clearButton,
|
|
19687
19753
|
onSearch = props.onSearch,
|
|
19688
19754
|
onKeyDown = props.onKeyDown,
|
|
19689
|
-
onKeyUp = props.onKeyUp
|
|
19755
|
+
onKeyUp = props.onKeyUp,
|
|
19756
|
+
computeStyles = props.computeStyles;
|
|
19690
19757
|
|
|
19691
19758
|
var _a = React__namespace.useState(),
|
|
19692
19759
|
popoverStyle = _a[0],
|
|
@@ -19736,6 +19803,16 @@
|
|
|
19736
19803
|
|
|
19737
19804
|
var inputTriggerRef = React__namespace.useRef();
|
|
19738
19805
|
var popoverId = "DesignSystem-Combobox--Popover-" + uidGenerator();
|
|
19806
|
+
var defaultPopoverStyle = {
|
|
19807
|
+
fn: function fn(data) {
|
|
19808
|
+
return __assign$1(__assign$1({}, data), {
|
|
19809
|
+
styles: __assign$1(__assign$1({}, data.styles), {
|
|
19810
|
+
position: 'fixed'
|
|
19811
|
+
})
|
|
19812
|
+
});
|
|
19813
|
+
}
|
|
19814
|
+
};
|
|
19815
|
+
var popoverComputeStyle = computeStyles !== null && computeStyles !== void 0 ? computeStyles : defaultPopoverStyle;
|
|
19739
19816
|
React__namespace.useEffect(function () {
|
|
19740
19817
|
var _a;
|
|
19741
19818
|
|
|
@@ -19745,6 +19822,7 @@
|
|
|
19745
19822
|
};
|
|
19746
19823
|
var wrapperStyle = {
|
|
19747
19824
|
maxHeight: maxHeight || 'var(--spacing-9)',
|
|
19825
|
+
minHeight: minHeight,
|
|
19748
19826
|
overflowY: 'auto',
|
|
19749
19827
|
boxSizing: 'border-box'
|
|
19750
19828
|
};
|
|
@@ -19856,7 +19934,8 @@
|
|
|
19856
19934
|
triggerClass: "d-block",
|
|
19857
19935
|
customStyle: popoverStyle,
|
|
19858
19936
|
onToggle: onToggleHandler,
|
|
19859
|
-
trigger: /*#__PURE__*/React__namespace.createElement(ComboboxTrigger, __assign$1({}, triggerProps))
|
|
19937
|
+
trigger: /*#__PURE__*/React__namespace.createElement(ComboboxTrigger, __assign$1({}, triggerProps)),
|
|
19938
|
+
computeStyles: popoverComputeStyle
|
|
19860
19939
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
19861
19940
|
style: wrapperStyle,
|
|
19862
19941
|
ref: listRef,
|
|
@@ -19931,8 +20010,10 @@
|
|
|
19931
20010
|
return newList;
|
|
19932
20011
|
};
|
|
19933
20012
|
var computeValue = function computeValue(multiSelect, selectValue, setLabel) {
|
|
20013
|
+
var _a;
|
|
20014
|
+
|
|
19934
20015
|
if (!multiSelect) {
|
|
19935
|
-
return (selectValue === null || selectValue === void 0 ? void 0 : selectValue.label.trim()) || '';
|
|
20016
|
+
return ((_a = selectValue === null || selectValue === void 0 ? void 0 : selectValue.label) === null || _a === void 0 ? void 0 : _a.trim()) || '';
|
|
19936
20017
|
}
|
|
19937
20018
|
|
|
19938
20019
|
var label = setLabel === null || setLabel === void 0 ? void 0 : setLabel(selectValue.length);
|
|
@@ -20076,12 +20157,14 @@
|
|
|
20076
20157
|
};
|
|
20077
20158
|
|
|
20078
20159
|
var SelectOption = function SelectOption(props) {
|
|
20160
|
+
var _a, _b;
|
|
20161
|
+
|
|
20079
20162
|
var children = props.children,
|
|
20080
20163
|
option = props.option,
|
|
20081
20164
|
checkedState = props.checkedState,
|
|
20082
20165
|
onClick = props.onClick,
|
|
20083
|
-
|
|
20084
|
-
withCheckbox =
|
|
20166
|
+
_c = props.withCheckbox,
|
|
20167
|
+
withCheckbox = _c === void 0 ? true : _c,
|
|
20085
20168
|
disabled = props.disabled,
|
|
20086
20169
|
rest = __rest(props, ["children", "option", "checkedState", "onClick", "withCheckbox", "disabled"]);
|
|
20087
20170
|
|
|
@@ -20116,6 +20199,8 @@
|
|
|
20116
20199
|
|
|
20117
20200
|
var checked = checkedState === 'checked' || elementExist(option, selectValue) !== -1;
|
|
20118
20201
|
var indeterminate = checkedState === 'indeterminate';
|
|
20202
|
+
var optionItemClass = classNames__default["default"]((_a = {}, _a['Select-option'] = true, _a));
|
|
20203
|
+
var textClass = classNames__default["default"]((_b = {}, _b['Select-option--text'] = true, _b['pt-2'] = multiSelect, _b));
|
|
20119
20204
|
|
|
20120
20205
|
var onKeyDownHandler = function onKeyDownHandler(event) {
|
|
20121
20206
|
handleKeyDown$2(event, focusedOption, setFocusedOption, setHighlightFirstItem, setHighlightLastItem, listRef, withSearch, setOpenPopover, triggerRef);
|
|
@@ -20134,14 +20219,14 @@
|
|
|
20134
20219
|
disabled: disabled,
|
|
20135
20220
|
"data-test": "DesignSystem-Select-Option"
|
|
20136
20221
|
}, rest), /*#__PURE__*/React__namespace.createElement("div", {
|
|
20137
|
-
className:
|
|
20222
|
+
className: optionItemClass
|
|
20138
20223
|
}, multiSelect && withCheckbox && /*#__PURE__*/React__namespace.createElement(Checkbox, {
|
|
20139
20224
|
tabIndex: -1,
|
|
20140
20225
|
"aria-checked": indeterminate ? 'mixed' : checked,
|
|
20141
20226
|
checked: checked,
|
|
20142
20227
|
indeterminate: indeterminate
|
|
20143
20228
|
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
20144
|
-
className:
|
|
20229
|
+
className: textClass
|
|
20145
20230
|
}, children)));
|
|
20146
20231
|
};
|
|
20147
20232
|
SelectOption.defaultProps = {
|
|
@@ -20173,12 +20258,16 @@
|
|
|
20173
20258
|
setOpenPopover = contextProp.setOpenPopover,
|
|
20174
20259
|
setHighlightFirstItem = contextProp.setHighlightFirstItem,
|
|
20175
20260
|
setHighlightLastItem = contextProp.setHighlightLastItem,
|
|
20176
|
-
triggerRef = contextProp.triggerRef
|
|
20261
|
+
triggerRef = contextProp.triggerRef,
|
|
20262
|
+
width = contextProp.width;
|
|
20177
20263
|
var buttonDisabled = disabled ? 'disabled' : 'default';
|
|
20178
20264
|
var trimmedPlaceholder = placeholder === null || placeholder === void 0 ? void 0 : placeholder.trim();
|
|
20179
20265
|
var displayValue = computeValue(multiSelect, selectValue, setLabel);
|
|
20180
20266
|
var value = isOptionSelected && displayValue.length > 0 ? displayValue : trimmedPlaceholder;
|
|
20181
20267
|
var iconName = openPopover ? 'keyboard_arrow_up' : 'keyboard_arrow_down';
|
|
20268
|
+
var triggerStyle = {
|
|
20269
|
+
width: width
|
|
20270
|
+
};
|
|
20182
20271
|
|
|
20183
20272
|
var onClearHandler = function onClearHandler(event) {
|
|
20184
20273
|
event.stopPropagation();
|
|
@@ -20195,7 +20284,7 @@
|
|
|
20195
20284
|
};
|
|
20196
20285
|
|
|
20197
20286
|
var buttonClass = classNames__default["default"]((_a = {}, _a['Button'] = true, _a['Select-trigger'] = true, _a["Select-trigger--" + triggerSize] = triggerSize, _a['Select-trigger--placeholder'] = !isOptionSelected, _a['Select-trigger--icon'] = icon, _a['Select-trigger--open'] = openPopover, _a));
|
|
20198
|
-
var textClass = classNames__default["default"]((_b = {}, _b['Text'] = true, _b['Text--regular'] = true, _b['Select-trigger
|
|
20287
|
+
var textClass = classNames__default["default"]((_b = {}, _b['Text'] = true, _b['Text--regular'] = true, _b['Select-trigger--text'] = true, _b));
|
|
20199
20288
|
return /*#__PURE__*/React__namespace.createElement(Tooltip, {
|
|
20200
20289
|
showOnTruncation: true,
|
|
20201
20290
|
showTooltip: !openPopover,
|
|
@@ -20212,6 +20301,7 @@
|
|
|
20212
20301
|
className: buttonClass,
|
|
20213
20302
|
disabled: disabled,
|
|
20214
20303
|
tabIndex: 0,
|
|
20304
|
+
style: triggerStyle,
|
|
20215
20305
|
"aria-haspopup": "listbox",
|
|
20216
20306
|
"aria-expanded": openPopover,
|
|
20217
20307
|
"aria-label": "trigger",
|
|
@@ -20354,7 +20444,9 @@
|
|
|
20354
20444
|
multiSelect = _a === void 0 ? false : _a,
|
|
20355
20445
|
onOutsideClick = props.onOutsideClick,
|
|
20356
20446
|
triggerOptions = props.triggerOptions,
|
|
20357
|
-
popoverWidth = props.popoverWidth
|
|
20447
|
+
popoverWidth = props.popoverWidth,
|
|
20448
|
+
trigger = props.trigger,
|
|
20449
|
+
onToggle = props.onToggle;
|
|
20358
20450
|
|
|
20359
20451
|
var _b = React__namespace.useState(false),
|
|
20360
20452
|
openPopover = _b[0],
|
|
@@ -20395,16 +20487,29 @@
|
|
|
20395
20487
|
popoverStyle = _j[0],
|
|
20396
20488
|
setPopoverStyle = _j[1];
|
|
20397
20489
|
|
|
20398
|
-
var triggerStyle = {
|
|
20399
|
-
width: width
|
|
20400
|
-
};
|
|
20401
20490
|
var baseProps = extractBaseProps(props);
|
|
20491
|
+
|
|
20492
|
+
var getTriggerElement = function getTriggerElement() {
|
|
20493
|
+
if (trigger) {
|
|
20494
|
+
return /*#__PURE__*/React__namespace.cloneElement(trigger, {
|
|
20495
|
+
ref: triggerRef
|
|
20496
|
+
});
|
|
20497
|
+
}
|
|
20498
|
+
|
|
20499
|
+
return /*#__PURE__*/React__namespace.createElement(SelectTrigger, __assign$1({
|
|
20500
|
+
"aria-controls": "select-listbox"
|
|
20501
|
+
}, triggerOptions));
|
|
20502
|
+
};
|
|
20503
|
+
|
|
20402
20504
|
React__namespace.useEffect(function () {
|
|
20403
|
-
var _a
|
|
20505
|
+
var _a;
|
|
20404
20506
|
|
|
20405
|
-
|
|
20507
|
+
var MIN_WIDTH = 176;
|
|
20508
|
+
var triggerWidth = (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth;
|
|
20509
|
+
|
|
20510
|
+
if (!popoverWidth && triggerWidth) {
|
|
20406
20511
|
setPopoverStyle(__assign$1(__assign$1({}, popoverStyle), {
|
|
20407
|
-
width:
|
|
20512
|
+
width: trigger ? Math.max(triggerWidth || 0, MIN_WIDTH) : triggerWidth
|
|
20408
20513
|
}));
|
|
20409
20514
|
}
|
|
20410
20515
|
}, []);
|
|
@@ -20459,11 +20564,15 @@
|
|
|
20459
20564
|
}, [value]);
|
|
20460
20565
|
|
|
20461
20566
|
var onToggleHandler = function onToggleHandler(open) {
|
|
20567
|
+
if (onToggle) {
|
|
20568
|
+
onToggle(open);
|
|
20569
|
+
}
|
|
20570
|
+
|
|
20462
20571
|
if (triggerOptions && triggerOptions.disabled) {
|
|
20463
20572
|
setOpenPopover(false);
|
|
20464
20573
|
} else {
|
|
20465
|
-
setHighlightFirstItem(open);
|
|
20466
20574
|
setOpenPopover(open);
|
|
20575
|
+
setHighlightFirstItem(open);
|
|
20467
20576
|
}
|
|
20468
20577
|
};
|
|
20469
20578
|
|
|
@@ -20502,19 +20611,17 @@
|
|
|
20502
20611
|
}, /*#__PURE__*/React__namespace.createElement("div", __assign$1({
|
|
20503
20612
|
"data-test": "DesignSystem-Select",
|
|
20504
20613
|
"aria-haspopup": "listbox",
|
|
20505
|
-
"aria-expanded": openPopover
|
|
20506
|
-
style: triggerStyle
|
|
20614
|
+
"aria-expanded": openPopover
|
|
20507
20615
|
}, baseProps), /*#__PURE__*/React__namespace.createElement(Popover$1, {
|
|
20508
20616
|
open: openPopover,
|
|
20509
20617
|
onToggle: onToggleHandler,
|
|
20510
20618
|
className: "mt-3",
|
|
20511
20619
|
triggerClass: "d-block",
|
|
20620
|
+
position: "bottom-start",
|
|
20512
20621
|
customStyle: popoverStyle,
|
|
20513
20622
|
boundaryElement: boundaryElement,
|
|
20514
20623
|
appendToBody: appendToBody,
|
|
20515
|
-
trigger:
|
|
20516
|
-
"aria-controls": "select-listbox"
|
|
20517
|
-
}, triggerOptions))
|
|
20624
|
+
trigger: getTriggerElement()
|
|
20518
20625
|
}, /*#__PURE__*/React__namespace.createElement(OutsideClick, {
|
|
20519
20626
|
onOutsideClick: onOutsideClickHandler
|
|
20520
20627
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -20989,7 +21096,7 @@
|
|
|
20989
21096
|
position: 'bottom-start'
|
|
20990
21097
|
};
|
|
20991
21098
|
|
|
20992
|
-
var img$4 = "data:image/svg+xml,%3csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 0C10 5.52285 5.52285 10 0 10C5.52285 10 10 14.4772 10 20C10 14.4772 14.4772 10 20 10C14.4772 10 10 5.52285 10 0ZM20 14C20 17.3137 17.3137 20 14 20C17.3137 20 20 22.6863 20 26C20 22.6863 22.6863 20 26 20C22.6863 20 20 17.3137 20 14Z' fill='%
|
|
21099
|
+
var img$4 = "data:image/svg+xml,%3csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 0C10 5.52285 5.52285 10 0 10C5.52285 10 10 14.4772 10 20C10 14.4772 14.4772 10 20 10C14.4772 10 10 5.52285 10 0ZM20 14C20 17.3137 17.3137 20 14 20C17.3137 20 20 22.6863 20 26C20 22.6863 22.6863 20 26 20C22.6863 20 20 17.3137 20 14Z' fill='%231f1f1f'/%3e%3c/svg%3e";
|
|
20993
21100
|
|
|
20994
21101
|
var img$3 = "data:image/svg+xml,%3csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 0C10 5.52285 5.52285 10 0 10C5.52285 10 10 14.4772 10 20C10 14.4772 14.4772 10 20 10C14.4772 10 10 5.52285 10 0ZM20 14C20 17.3137 17.3137 20 14 20C17.3137 20 20 22.6863 20 26C20 22.6863 22.6863 20 26 20C22.6863 20 20 17.3137 20 14Z' fill='%23A6A6A6'/%3e%3c/svg%3e";
|
|
20995
21102
|
|
|
@@ -25391,7 +25498,7 @@
|
|
|
25391
25498
|
AIResponse.ActionBar = ChatActionBar;
|
|
25392
25499
|
AIResponse.Body = ChatBody;
|
|
25393
25500
|
|
|
25394
|
-
var version = "2.
|
|
25501
|
+
var version = "2.37.0";
|
|
25395
25502
|
|
|
25396
25503
|
exports.AIButton = AIButton;
|
|
25397
25504
|
exports.AIChip = AIChip;
|