@innovaccer/design-system 2.36.2 → 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 +61 -0
- package/css/dist/index.css +89 -33
- 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/utils/cursor.css +4 -0
- package/dist/.lib/tsconfig.type.tsbuildinfo +31 -29
- 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/organisms/select/Select.d.ts +2 -0
- package/dist/index.esm.js +136 -53
- package/dist/index.js +142 -55
- 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.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1719911531454
|
|
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
|
*/
|
|
@@ -906,16 +906,27 @@ var Avatar = function Avatar(props) {
|
|
|
906
906
|
className = props.className,
|
|
907
907
|
appearance = props.appearance,
|
|
908
908
|
shape = props.shape,
|
|
909
|
+
disabled = props.disabled,
|
|
910
|
+
tooltipSuffix = props.tooltipSuffix,
|
|
911
|
+
tabIndex = props.tabIndex,
|
|
909
912
|
_props$role = props.role,
|
|
910
913
|
role = _props$role === void 0 ? 'presentation' : _props$role;
|
|
911
914
|
var baseProps = extractBaseProps(props);
|
|
912
915
|
var initials = children && typeof children === 'string' ? children.trim().slice(0, initialsLength) : "".concat(firstName ? firstName.trim()[0] : '').concat(lastName ? lastName.trim()[0] : '');
|
|
913
|
-
|
|
916
|
+
|
|
917
|
+
var getTooltipName = function getTooltipName() {
|
|
918
|
+
if (children && typeof children === 'string') {
|
|
919
|
+
return "".concat(children, " ").concat(tooltipSuffix || '');
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
return "".concat(firstName || '', " ").concat(lastName || '', " ").concat(tooltipSuffix || '') || '';
|
|
923
|
+
};
|
|
924
|
+
|
|
914
925
|
var AvatarAppearance = appearance || colors[(initials.charCodeAt(0) + (initials.charCodeAt(1) || 0)) % 8] || DefaultAppearance;
|
|
915
926
|
var AvatarClassNames = classnames((_classNames = {
|
|
916
927
|
Avatar: true
|
|
917
|
-
}, _defineProperty$1(_classNames, 'Avatar--square', shape === 'square'), _defineProperty$1(_classNames, "Avatar--".concat(size), shape !== 'square'), _defineProperty$1(_classNames, "Avatar--".concat(AvatarAppearance), AvatarAppearance), _defineProperty$1(_classNames, 'Avatar--
|
|
918
|
-
var AvatarWrapperClassNames = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Avatar--
|
|
928
|
+
}, _defineProperty$1(_classNames, 'Avatar--square', shape === 'square'), _defineProperty$1(_classNames, "Avatar--".concat(size), shape !== 'square'), _defineProperty$1(_classNames, "Avatar--".concat(AvatarAppearance), AvatarAppearance), _defineProperty$1(_classNames, 'Avatar--noInitials', !initials || !withTooltip), _defineProperty$1(_classNames, 'Avatar--disabled', disabled), _defineProperty$1(_classNames, 'Avatar--default', !disabled), _classNames), className);
|
|
929
|
+
var AvatarWrapperClassNames = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Avatar-wrapper--square', shape === 'square'), _defineProperty$1(_classNames2, "Avatar--".concat(size), shape === 'square'), _classNames2));
|
|
919
930
|
var TextClassNames = classnames((_classNames3 = {}, _defineProperty$1(_classNames3, "Avatar-content--".concat(size), size), _defineProperty$1(_classNames3, "Avatar-content--".concat(AvatarAppearance), AvatarAppearance), _classNames3));
|
|
920
931
|
var IconClassNames = classnames(_defineProperty$1({}, "Avatar-content--".concat(AvatarAppearance), AvatarAppearance));
|
|
921
932
|
var sharedProp = {
|
|
@@ -936,7 +947,8 @@ var Avatar = function Avatar(props) {
|
|
|
936
947
|
}, /*#__PURE__*/React.createElement("span", _extends$2({
|
|
937
948
|
"data-test": "DesignSystem-Avatar"
|
|
938
949
|
}, baseProps, {
|
|
939
|
-
className: AvatarClassNames
|
|
950
|
+
className: AvatarClassNames,
|
|
951
|
+
tabIndex: tabIndex || disabled ? -1 : 0
|
|
940
952
|
}), children)));
|
|
941
953
|
}
|
|
942
954
|
|
|
@@ -947,7 +959,8 @@ var Avatar = function Avatar(props) {
|
|
|
947
959
|
}, /*#__PURE__*/React.createElement("span", _extends$2({
|
|
948
960
|
"data-test": "DesignSystem-Avatar"
|
|
949
961
|
}, baseProps, {
|
|
950
|
-
className: AvatarClassNames
|
|
962
|
+
className: AvatarClassNames,
|
|
963
|
+
tabIndex: tabIndex || disabled ? -1 : 0
|
|
951
964
|
}), initials && /*#__PURE__*/React.createElement(Text, {
|
|
952
965
|
weight: "medium",
|
|
953
966
|
appearance: 'white',
|
|
@@ -964,7 +977,7 @@ var Avatar = function Avatar(props) {
|
|
|
964
977
|
var renderTooltip = function renderTooltip() {
|
|
965
978
|
if (withTooltip && initials) {
|
|
966
979
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
967
|
-
tooltip:
|
|
980
|
+
tooltip: getTooltipName(),
|
|
968
981
|
position: tooltipPosition,
|
|
969
982
|
triggerClass: 'flex-grow-0'
|
|
970
983
|
}, renderAvatar());
|
|
@@ -995,11 +1008,13 @@ var AvatarCount = function AvatarCount(props) {
|
|
|
995
1008
|
var ContentClass = classnames((_classNames = {}, _defineProperty$1(_classNames, "Avatar-content--secondary", true), _defineProperty$1(_classNames, "Avatar-content--tiny", size === 'tiny'), _classNames));
|
|
996
1009
|
var AvatarVariantsClass = classnames((_classNames2 = {
|
|
997
1010
|
Avatar: true
|
|
998
|
-
}, _defineProperty$1(_classNames2, "Avatar--regular", size === 'regular'), _defineProperty$1(_classNames2, "Avatar--tiny", size === 'tiny'), _defineProperty$1(_classNames2, "Avatar--secondary", true), _defineProperty$1(_classNames2, '
|
|
1011
|
+
}, _defineProperty$1(_classNames2, "Avatar--regular", size === 'regular'), _defineProperty$1(_classNames2, "Avatar--tiny", size === 'tiny'), _defineProperty$1(_classNames2, "Avatar--secondary", true), _defineProperty$1(_classNames2, 'cursor-default', true), _defineProperty$1(_classNames2, 'cursor-pointer', on === 'click'), _classNames2));
|
|
999
1012
|
return /*#__PURE__*/React.createElement("div", {
|
|
1000
1013
|
"data-test": "DesignSystem-AvatarGroup--TriggerAvatar",
|
|
1001
1014
|
className: "AvatarCount-wrapper",
|
|
1002
|
-
style: avatarStyle
|
|
1015
|
+
style: avatarStyle,
|
|
1016
|
+
tabIndex: 0,
|
|
1017
|
+
role: "button"
|
|
1003
1018
|
}, /*#__PURE__*/React.createElement("span", {
|
|
1004
1019
|
"data-test": "DesignSystem-AvatarGroup--TriggerAvatarVariants",
|
|
1005
1020
|
className: AvatarVariantsClass
|
|
@@ -1022,7 +1037,9 @@ var Avatars = function Avatars(props) {
|
|
|
1022
1037
|
firstName = item.firstName,
|
|
1023
1038
|
lastName = item.lastName,
|
|
1024
1039
|
icon = item.icon,
|
|
1025
|
-
image = item.image
|
|
1040
|
+
image = item.image,
|
|
1041
|
+
disabled = item.disabled,
|
|
1042
|
+
tooltipSuffix = item.tooltipSuffix;
|
|
1026
1043
|
return /*#__PURE__*/React.createElement("div", {
|
|
1027
1044
|
"data-test": "DesignSystem-AvatarGroup--Avatar",
|
|
1028
1045
|
className: GroupClass,
|
|
@@ -1034,7 +1051,9 @@ var Avatars = function Avatars(props) {
|
|
|
1034
1051
|
firstName: firstName,
|
|
1035
1052
|
lastName: lastName,
|
|
1036
1053
|
withTooltip: true,
|
|
1037
|
-
|
|
1054
|
+
disabled: disabled,
|
|
1055
|
+
tooltipPosition: tooltipPosition,
|
|
1056
|
+
tooltipSuffix: tooltipSuffix
|
|
1038
1057
|
}, image || icon));
|
|
1039
1058
|
});
|
|
1040
1059
|
return avatars;
|
|
@@ -1061,8 +1080,10 @@ var AvatarPopperBody = function AvatarPopperBody(props) {
|
|
|
1061
1080
|
var _item$firstName = item.firstName,
|
|
1062
1081
|
firstName = _item$firstName === void 0 ? '' : _item$firstName,
|
|
1063
1082
|
_item$lastName = item.lastName,
|
|
1064
|
-
lastName = _item$lastName === void 0 ? '' : _item$lastName
|
|
1065
|
-
|
|
1083
|
+
lastName = _item$lastName === void 0 ? '' : _item$lastName,
|
|
1084
|
+
_item$tooltipSuffix = item.tooltipSuffix,
|
|
1085
|
+
tooltipSuffix = _item$tooltipSuffix === void 0 ? '' : _item$tooltipSuffix;
|
|
1086
|
+
var name = "".concat(firstName, " ").concat(lastName, " ").concat(tooltipSuffix);
|
|
1066
1087
|
var AvatarTextClass = classnames(_defineProperty$1({}, "mb-4", ind < hiddenAvatarList.length - 1));
|
|
1067
1088
|
return /*#__PURE__*/React.createElement(Text, {
|
|
1068
1089
|
key: ind,
|
|
@@ -3085,10 +3106,10 @@ var GenericChip = function GenericChip(props) {
|
|
|
3085
3106
|
var iconAppearance = function iconAppearance(align) {
|
|
3086
3107
|
var _classNames2;
|
|
3087
3108
|
|
|
3088
|
-
return classnames((_classNames2 = {}, _defineProperty$1(_classNames2, '
|
|
3109
|
+
return classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'primary_dark', selected), _defineProperty$1(_classNames2, 'subtle', !selected && align === 'right'), _defineProperty$1(_classNames2, 'inverse', !selected && align === 'left'), _classNames2));
|
|
3089
3110
|
};
|
|
3090
3111
|
|
|
3091
|
-
var textColor = classnames((_classNames3 = {}, _defineProperty$1(_classNames3, 'primary-
|
|
3112
|
+
var textColor = classnames((_classNames3 = {}, _defineProperty$1(_classNames3, 'primary-dark', selected), _defineProperty$1(_classNames3, 'inverse', !disabled && !selected), _classNames3));
|
|
3092
3113
|
|
|
3093
3114
|
var renderLabel = function renderLabel() {
|
|
3094
3115
|
if (typeof label === 'string') {
|
|
@@ -13981,7 +14002,9 @@ var PopperWrapper = /*#__PURE__*/function (_React$Component) {
|
|
|
13981
14002
|
var options = on === 'hover' ? {
|
|
13982
14003
|
ref: ref,
|
|
13983
14004
|
onMouseEnter: this.handleMouseEnter,
|
|
13984
|
-
onMouseLeave: this.handleMouseLeave
|
|
14005
|
+
onMouseLeave: this.handleMouseLeave,
|
|
14006
|
+
onFocus: this.handleMouseEnter,
|
|
14007
|
+
onBlur: this.handleMouseLeave
|
|
13985
14008
|
} : {
|
|
13986
14009
|
ref: ref,
|
|
13987
14010
|
onClick: function onClick(ev) {
|
|
@@ -23021,10 +23044,16 @@ var ActionCard = function ActionCard(props) {
|
|
|
23021
23044
|
onClick = props.onClick,
|
|
23022
23045
|
rest = _objectWithoutProperties(props, _excluded$r);
|
|
23023
23046
|
|
|
23024
|
-
var classes = classnames((_classNames = {}, _defineProperty$1(_classNames, 'ActionCard', true), _defineProperty$1(_classNames, 'ActionCard--disabled', disabled), _classNames), className);
|
|
23047
|
+
var classes = classnames((_classNames = {}, _defineProperty$1(_classNames, 'ActionCard', true), _defineProperty$1(_classNames, 'ActionCard--default', !disabled), _defineProperty$1(_classNames, 'ActionCard--disabled', disabled), _classNames), className);
|
|
23025
23048
|
|
|
23026
23049
|
var onKeyDownHandler = function onKeyDownHandler(event) {
|
|
23027
|
-
if (event.key === 'Enter' && onClick) {
|
|
23050
|
+
if (event.key === 'Enter' && onClick && !disabled) {
|
|
23051
|
+
onClick(event);
|
|
23052
|
+
}
|
|
23053
|
+
};
|
|
23054
|
+
|
|
23055
|
+
var onClickHandler = function onClickHandler(event) {
|
|
23056
|
+
if (!disabled && onClick) {
|
|
23028
23057
|
onClick(event);
|
|
23029
23058
|
}
|
|
23030
23059
|
};
|
|
@@ -23034,7 +23063,7 @@ var ActionCard = function ActionCard(props) {
|
|
|
23034
23063
|
role: "link",
|
|
23035
23064
|
"data-test": "DesignSystem-ActionCard",
|
|
23036
23065
|
className: classes,
|
|
23037
|
-
onClick:
|
|
23066
|
+
onClick: onClickHandler,
|
|
23038
23067
|
onKeyDown: onKeyDownHandler
|
|
23039
23068
|
}, rest), disabled && /*#__PURE__*/React.createElement("div", {
|
|
23040
23069
|
style: {
|
|
@@ -23135,14 +23164,16 @@ var SelectionCard = function SelectionCard(props) {
|
|
|
23135
23164
|
className = props.className,
|
|
23136
23165
|
rest = _objectWithoutProperties(props, _excluded$q);
|
|
23137
23166
|
|
|
23138
|
-
var classes = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Selection-card', true), _defineProperty$1(_classNames, 'Selection-card--selected', selected), _defineProperty$1(_classNames, 'Selection-card--disabled', disabled && !selected), _defineProperty$1(_classNames, 'Selection-card--selected-disabled', disabled && selected), _classNames), className);
|
|
23167
|
+
var classes = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Selection-card', true), _defineProperty$1(_classNames, 'Selection-card--default', !disabled), _defineProperty$1(_classNames, 'Selection-card--selected', selected && !disabled), _defineProperty$1(_classNames, 'Selection-card--disabled', disabled), _defineProperty$1(_classNames, 'Selection-card--default-disabled', disabled && !selected), _defineProperty$1(_classNames, 'Selection-card--selected-disabled', disabled && selected), _classNames), className);
|
|
23139
23168
|
|
|
23140
23169
|
var onClickHandler = function onClickHandler(event) {
|
|
23141
|
-
|
|
23170
|
+
if (!disabled && onClick) {
|
|
23171
|
+
onClick(event, id, cardValue);
|
|
23172
|
+
}
|
|
23142
23173
|
};
|
|
23143
23174
|
|
|
23144
23175
|
var onKeyDownHandler = function onKeyDownHandler(event) {
|
|
23145
|
-
if (event.key === 'Enter') {
|
|
23176
|
+
if (event.key === 'Enter' && !disabled) {
|
|
23146
23177
|
onClickHandler(event);
|
|
23147
23178
|
}
|
|
23148
23179
|
};
|
|
@@ -23150,7 +23181,7 @@ var SelectionCard = function SelectionCard(props) {
|
|
|
23150
23181
|
return /*#__PURE__*/React.createElement("div", _extends$2({
|
|
23151
23182
|
role: "checkbox",
|
|
23152
23183
|
"aria-checked": selected,
|
|
23153
|
-
tabIndex: 0,
|
|
23184
|
+
tabIndex: disabled ? -1 : 0,
|
|
23154
23185
|
onKeyDown: onKeyDownHandler,
|
|
23155
23186
|
onClick: function onClick(event) {
|
|
23156
23187
|
return onClickHandler(event);
|
|
@@ -24295,17 +24326,20 @@ var TextField = function TextField(props) {
|
|
|
24295
24326
|
};
|
|
24296
24327
|
TextField.displayName = 'TextField';
|
|
24297
24328
|
|
|
24298
|
-
var _excluded$n = ["icon", "image"];
|
|
24329
|
+
var _excluded$n = ["icon", "image", "disabled"];
|
|
24299
24330
|
var SelectionAvatar = function SelectionAvatar(props) {
|
|
24300
24331
|
var icon = props.icon,
|
|
24301
24332
|
image = props.image,
|
|
24333
|
+
disabled = props.disabled,
|
|
24302
24334
|
rest = _objectWithoutProperties(props, _excluded$n);
|
|
24303
24335
|
|
|
24336
|
+
var avatarClassName = classnames(_defineProperty$1({}, 'cursor-pointer', !disabled));
|
|
24304
24337
|
return /*#__PURE__*/React.createElement(Avatar, _extends$2({
|
|
24305
24338
|
role: "checkbox"
|
|
24306
24339
|
}, rest, {
|
|
24340
|
+
disabled: disabled,
|
|
24307
24341
|
withTooltip: true,
|
|
24308
|
-
className:
|
|
24342
|
+
className: avatarClassName
|
|
24309
24343
|
}), image || icon);
|
|
24310
24344
|
};
|
|
24311
24345
|
|
|
@@ -24323,6 +24357,10 @@ var SelectionAvatarsWrapper = function SelectionAvatarsWrapper(props) {
|
|
|
24323
24357
|
onSelect = contextProp.onSelect;
|
|
24324
24358
|
|
|
24325
24359
|
var onClickHandler = function onClickHandler(item) {
|
|
24360
|
+
if (item.disabled) {
|
|
24361
|
+
return;
|
|
24362
|
+
}
|
|
24363
|
+
|
|
24326
24364
|
var list = selectedItems;
|
|
24327
24365
|
|
|
24328
24366
|
if (selectedItems !== null && selectedItems !== void 0 && selectedItems.includes(item)) {
|
|
@@ -24340,6 +24378,10 @@ var SelectionAvatarsWrapper = function SelectionAvatarsWrapper(props) {
|
|
|
24340
24378
|
};
|
|
24341
24379
|
|
|
24342
24380
|
var handleKeyDown = function handleKeyDown(event, item) {
|
|
24381
|
+
if (item.disabled) {
|
|
24382
|
+
return;
|
|
24383
|
+
}
|
|
24384
|
+
|
|
24343
24385
|
switch (event.key) {
|
|
24344
24386
|
case 'Enter':
|
|
24345
24387
|
onClickHandler(item);
|
|
@@ -24354,8 +24396,10 @@ var SelectionAvatarsWrapper = function SelectionAvatarsWrapper(props) {
|
|
|
24354
24396
|
firstName = avatarItem.firstName,
|
|
24355
24397
|
lastName = avatarItem.lastName,
|
|
24356
24398
|
icon = avatarItem.icon,
|
|
24357
|
-
image = avatarItem.image
|
|
24358
|
-
|
|
24399
|
+
image = avatarItem.image,
|
|
24400
|
+
disabled = avatarItem.disabled,
|
|
24401
|
+
tooltipSuffix = avatarItem.tooltipSuffix;
|
|
24402
|
+
var GroupClass = classnames((_classNames = {}, _defineProperty$1(_classNames, "SelectionAvatarGroup-item", true), _defineProperty$1(_classNames, "SelectionAvatarGroup-item--active", !disabled), _defineProperty$1(_classNames, "SelectionAvatarGroup-item--selected", selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.includes(avatarItem)), _classNames));
|
|
24359
24403
|
|
|
24360
24404
|
if (avatarRenderer) {
|
|
24361
24405
|
return avatarRenderer(avatarItem);
|
|
@@ -24365,7 +24409,7 @@ var SelectionAvatarsWrapper = function SelectionAvatarsWrapper(props) {
|
|
|
24365
24409
|
key: index,
|
|
24366
24410
|
className: "SelectionAvatarGroup-wrapper"
|
|
24367
24411
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24368
|
-
tabIndex:
|
|
24412
|
+
tabIndex: -1,
|
|
24369
24413
|
role: "checkbox",
|
|
24370
24414
|
style: avatarStyle,
|
|
24371
24415
|
className: GroupClass,
|
|
@@ -24385,7 +24429,9 @@ var SelectionAvatarsWrapper = function SelectionAvatarsWrapper(props) {
|
|
|
24385
24429
|
withTooltip: true,
|
|
24386
24430
|
tooltipPosition: tooltipPosition,
|
|
24387
24431
|
icon: icon,
|
|
24388
|
-
image: image
|
|
24432
|
+
image: image,
|
|
24433
|
+
disabled: disabled,
|
|
24434
|
+
tooltipSuffix: tooltipSuffix
|
|
24389
24435
|
})));
|
|
24390
24436
|
}));
|
|
24391
24437
|
};
|
|
@@ -24457,7 +24503,7 @@ var AvatarSelectionCount = function AvatarSelectionCount(props) {
|
|
|
24457
24503
|
selectedItemCount = _React$useState2[0],
|
|
24458
24504
|
setSelectedItemCount = _React$useState2[1];
|
|
24459
24505
|
|
|
24460
|
-
var wrapperClassName = classnames((_classNames = {}, _defineProperty$1(_classNames, 'SelectionAvatarCount-wrapper', true), _defineProperty$1(_classNames, 'SelectionAvatarCount--selected', selectedItemCount > 0), _classNames));
|
|
24506
|
+
var wrapperClassName = classnames((_classNames = {}, _defineProperty$1(_classNames, 'SelectionAvatarCount-wrapper', true), _defineProperty$1(_classNames, "SelectionAvatarGroup-item", true), _defineProperty$1(_classNames, 'SelectionAvatarCount--selected', selectedItemCount > 0), _classNames));
|
|
24461
24507
|
React.useEffect(function () {
|
|
24462
24508
|
var selectedList = hiddenAvatarList.filter(function (data1) {
|
|
24463
24509
|
return selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.some(function (data2) {
|
|
@@ -24480,6 +24526,7 @@ var AvatarSelectionCount = function AvatarSelectionCount(props) {
|
|
|
24480
24526
|
"aria-controls": popoverId,
|
|
24481
24527
|
ref: triggerRef
|
|
24482
24528
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
24529
|
+
tabIndex: -1,
|
|
24483
24530
|
size: size,
|
|
24484
24531
|
appearance: "secondary",
|
|
24485
24532
|
className: "SelectionAvatarCount cursor-pointer"
|
|
@@ -24600,10 +24647,11 @@ AvatarSelectionList.defaultProps = {
|
|
|
24600
24647
|
tagName: 'ul'
|
|
24601
24648
|
};
|
|
24602
24649
|
|
|
24603
|
-
var _excluded$m = ["children", "value"];
|
|
24650
|
+
var _excluded$m = ["children", "value", "disabled"];
|
|
24604
24651
|
var AvatarSelectionOption = function AvatarSelectionOption(props) {
|
|
24605
24652
|
var children = props.children,
|
|
24606
24653
|
value = props.value,
|
|
24654
|
+
disabled = props.disabled,
|
|
24607
24655
|
rest = _objectWithoutProperties(props, _excluded$m);
|
|
24608
24656
|
|
|
24609
24657
|
var contextProp = React.useContext(AvatarSelectionContext);
|
|
@@ -24621,6 +24669,11 @@ var AvatarSelectionOption = function AvatarSelectionOption(props) {
|
|
|
24621
24669
|
|
|
24622
24670
|
var onSelectHandler = function onSelectHandler(event, avatarData) {
|
|
24623
24671
|
event.preventDefault();
|
|
24672
|
+
|
|
24673
|
+
if (disabled) {
|
|
24674
|
+
return;
|
|
24675
|
+
}
|
|
24676
|
+
|
|
24624
24677
|
var list = selectedItems ? _toConsumableArray(selectedItems) : [];
|
|
24625
24678
|
|
|
24626
24679
|
if (selectedItems !== null && selectedItems !== void 0 && selectedItems.includes(avatarData)) {
|
|
@@ -24649,6 +24702,7 @@ var AvatarSelectionOption = function AvatarSelectionOption(props) {
|
|
|
24649
24702
|
},
|
|
24650
24703
|
selected: selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.includes(value),
|
|
24651
24704
|
"data-test": "DesignSystem-AvatarSelection--Option",
|
|
24705
|
+
disabled: disabled,
|
|
24652
24706
|
tabIndex: -1
|
|
24653
24707
|
}, rest), children);
|
|
24654
24708
|
};
|
|
@@ -24690,8 +24744,10 @@ var AvatarSelectionItem = function AvatarSelectionItem(props) {
|
|
|
24690
24744
|
var _avatarData$firstName = avatarData.firstName,
|
|
24691
24745
|
firstName = _avatarData$firstName === void 0 ? '' : _avatarData$firstName,
|
|
24692
24746
|
_avatarData$lastName = avatarData.lastName,
|
|
24693
|
-
lastName = _avatarData$lastName === void 0 ? '' : _avatarData$lastName
|
|
24694
|
-
|
|
24747
|
+
lastName = _avatarData$lastName === void 0 ? '' : _avatarData$lastName,
|
|
24748
|
+
disabled = avatarData.disabled,
|
|
24749
|
+
tooltipSuffix = avatarData.tooltipSuffix;
|
|
24750
|
+
var name = "".concat(firstName || '', " ").concat(lastName || '', " ").concat(tooltipSuffix || '') || '';
|
|
24695
24751
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
24696
24752
|
showOnTruncation: true,
|
|
24697
24753
|
tooltip: name,
|
|
@@ -24699,6 +24755,7 @@ var AvatarSelectionItem = function AvatarSelectionItem(props) {
|
|
|
24699
24755
|
open: showTooltip
|
|
24700
24756
|
}, /*#__PURE__*/React.createElement(AvatarSelectionOption, {
|
|
24701
24757
|
value: avatarData,
|
|
24758
|
+
disabled: disabled,
|
|
24702
24759
|
onFocus: function onFocus() {
|
|
24703
24760
|
setShowTooltip(true);
|
|
24704
24761
|
},
|
|
@@ -25785,7 +25842,9 @@ var removeOrAddToList = function removeOrAddToList(targetObject, prevList) {
|
|
|
25785
25842
|
};
|
|
25786
25843
|
var computeValue = function computeValue(multiSelect, selectValue, setLabel) {
|
|
25787
25844
|
if (!multiSelect) {
|
|
25788
|
-
|
|
25845
|
+
var _selectValue$label;
|
|
25846
|
+
|
|
25847
|
+
return (selectValue === null || selectValue === void 0 ? void 0 : (_selectValue$label = selectValue.label) === null || _selectValue$label === void 0 ? void 0 : _selectValue$label.trim()) || '';
|
|
25789
25848
|
}
|
|
25790
25849
|
|
|
25791
25850
|
var label = setLabel === null || setLabel === void 0 ? void 0 : setLabel(selectValue.length);
|
|
@@ -25928,6 +25987,8 @@ var handleInputKeyDown = function handleInputKeyDown(event, listRef, setFocusedO
|
|
|
25928
25987
|
|
|
25929
25988
|
var _excluded$h = ["children", "option", "checkedState", "onClick", "withCheckbox", "disabled"];
|
|
25930
25989
|
var SelectOption = function SelectOption(props) {
|
|
25990
|
+
var _classNames2;
|
|
25991
|
+
|
|
25931
25992
|
var children = props.children,
|
|
25932
25993
|
option = props.option,
|
|
25933
25994
|
checkedState = props.checkedState,
|
|
@@ -25968,6 +26029,8 @@ var SelectOption = function SelectOption(props) {
|
|
|
25968
26029
|
|
|
25969
26030
|
var checked = checkedState === 'checked' || elementExist(option, selectValue) !== -1;
|
|
25970
26031
|
var indeterminate = checkedState === 'indeterminate';
|
|
26032
|
+
var optionItemClass = classnames(_defineProperty$1({}, 'Select-option', true));
|
|
26033
|
+
var textClass = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Select-option--text', true), _defineProperty$1(_classNames2, 'pt-2', multiSelect), _classNames2));
|
|
25971
26034
|
|
|
25972
26035
|
var onKeyDownHandler = function onKeyDownHandler(event) {
|
|
25973
26036
|
handleKeyDown$2(event, focusedOption, setFocusedOption, setHighlightFirstItem, setHighlightLastItem, listRef, withSearch, setOpenPopover, triggerRef);
|
|
@@ -25986,14 +26049,14 @@ var SelectOption = function SelectOption(props) {
|
|
|
25986
26049
|
disabled: disabled,
|
|
25987
26050
|
"data-test": "DesignSystem-Select-Option"
|
|
25988
26051
|
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
25989
|
-
className:
|
|
26052
|
+
className: optionItemClass
|
|
25990
26053
|
}, multiSelect && withCheckbox && /*#__PURE__*/React.createElement(Checkbox, {
|
|
25991
26054
|
tabIndex: -1,
|
|
25992
26055
|
"aria-checked": indeterminate ? 'mixed' : checked,
|
|
25993
26056
|
checked: checked,
|
|
25994
26057
|
indeterminate: indeterminate
|
|
25995
26058
|
}), /*#__PURE__*/React.createElement("div", {
|
|
25996
|
-
className:
|
|
26059
|
+
className: textClass
|
|
25997
26060
|
}, children)));
|
|
25998
26061
|
};
|
|
25999
26062
|
SelectOption.defaultProps = {
|
|
@@ -26027,12 +26090,16 @@ var SelectTrigger = function SelectTrigger(props) {
|
|
|
26027
26090
|
setOpenPopover = contextProp.setOpenPopover,
|
|
26028
26091
|
setHighlightFirstItem = contextProp.setHighlightFirstItem,
|
|
26029
26092
|
setHighlightLastItem = contextProp.setHighlightLastItem,
|
|
26030
|
-
triggerRef = contextProp.triggerRef
|
|
26093
|
+
triggerRef = contextProp.triggerRef,
|
|
26094
|
+
width = contextProp.width;
|
|
26031
26095
|
var buttonDisabled = disabled ? 'disabled' : 'default';
|
|
26032
26096
|
var trimmedPlaceholder = placeholder === null || placeholder === void 0 ? void 0 : placeholder.trim();
|
|
26033
26097
|
var displayValue = computeValue(multiSelect, selectValue, setLabel);
|
|
26034
26098
|
var value = isOptionSelected && displayValue.length > 0 ? displayValue : trimmedPlaceholder;
|
|
26035
26099
|
var iconName = openPopover ? 'keyboard_arrow_up' : 'keyboard_arrow_down';
|
|
26100
|
+
var triggerStyle = {
|
|
26101
|
+
width: width
|
|
26102
|
+
};
|
|
26036
26103
|
|
|
26037
26104
|
var onClearHandler = function onClearHandler(event) {
|
|
26038
26105
|
event.stopPropagation();
|
|
@@ -26049,7 +26116,7 @@ var SelectTrigger = function SelectTrigger(props) {
|
|
|
26049
26116
|
};
|
|
26050
26117
|
|
|
26051
26118
|
var buttonClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Button', true), _defineProperty$1(_classNames, 'Select-trigger', true), _defineProperty$1(_classNames, "Select-trigger--".concat(triggerSize), triggerSize), _defineProperty$1(_classNames, 'Select-trigger--placeholder', !isOptionSelected), _defineProperty$1(_classNames, 'Select-trigger--icon', icon), _defineProperty$1(_classNames, 'Select-trigger--open', openPopover), _classNames));
|
|
26052
|
-
var textClass = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Text', true), _defineProperty$1(_classNames2, 'Text--regular', true), _defineProperty$1(_classNames2, 'Select-trigger
|
|
26119
|
+
var textClass = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Text', true), _defineProperty$1(_classNames2, 'Text--regular', true), _defineProperty$1(_classNames2, 'Select-trigger--text', true), _classNames2));
|
|
26053
26120
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
26054
26121
|
showOnTruncation: true,
|
|
26055
26122
|
showTooltip: !openPopover,
|
|
@@ -26066,6 +26133,7 @@ var SelectTrigger = function SelectTrigger(props) {
|
|
|
26066
26133
|
className: buttonClass,
|
|
26067
26134
|
disabled: disabled,
|
|
26068
26135
|
tabIndex: 0,
|
|
26136
|
+
style: triggerStyle,
|
|
26069
26137
|
"aria-haspopup": "listbox",
|
|
26070
26138
|
"aria-expanded": openPopover,
|
|
26071
26139
|
"aria-label": "trigger",
|
|
@@ -26213,7 +26281,9 @@ var Select = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
26213
26281
|
multiSelect = _props$multiSelect === void 0 ? false : _props$multiSelect,
|
|
26214
26282
|
onOutsideClick = props.onOutsideClick,
|
|
26215
26283
|
triggerOptions = props.triggerOptions,
|
|
26216
|
-
popoverWidth = props.popoverWidth
|
|
26284
|
+
popoverWidth = props.popoverWidth,
|
|
26285
|
+
trigger = props.trigger,
|
|
26286
|
+
onToggle = props.onToggle;
|
|
26217
26287
|
|
|
26218
26288
|
var _React$useState = React.useState(false),
|
|
26219
26289
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -26262,19 +26332,30 @@ var Select = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
26262
26332
|
popoverStyle = _React$useState16[0],
|
|
26263
26333
|
setPopoverStyle = _React$useState16[1];
|
|
26264
26334
|
|
|
26265
|
-
var triggerStyle = {
|
|
26266
|
-
width: width
|
|
26267
|
-
};
|
|
26268
26335
|
var baseProps = extractBaseProps(props);
|
|
26336
|
+
|
|
26337
|
+
var getTriggerElement = function getTriggerElement() {
|
|
26338
|
+
if (trigger) {
|
|
26339
|
+
return /*#__PURE__*/React.cloneElement(trigger, {
|
|
26340
|
+
ref: triggerRef
|
|
26341
|
+
});
|
|
26342
|
+
}
|
|
26343
|
+
|
|
26344
|
+
return /*#__PURE__*/React.createElement(SelectTrigger, _extends$2({
|
|
26345
|
+
"aria-controls": "select-listbox"
|
|
26346
|
+
}, triggerOptions));
|
|
26347
|
+
};
|
|
26348
|
+
|
|
26269
26349
|
React.useEffect(function () {
|
|
26270
26350
|
var _triggerRef$current;
|
|
26271
26351
|
|
|
26272
26352
|
// if popover width is not provided explicitly, apply the trigger width to popover width
|
|
26273
|
-
|
|
26274
|
-
|
|
26353
|
+
var MIN_WIDTH = 176;
|
|
26354
|
+
var triggerWidth = (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.clientWidth;
|
|
26275
26355
|
|
|
26356
|
+
if (!popoverWidth && triggerWidth) {
|
|
26276
26357
|
setPopoverStyle(_objectSpread2(_objectSpread2({}, popoverStyle), {}, {
|
|
26277
|
-
width:
|
|
26358
|
+
width: trigger ? Math.max(triggerWidth || 0, MIN_WIDTH) : triggerWidth
|
|
26278
26359
|
}));
|
|
26279
26360
|
}
|
|
26280
26361
|
}, []);
|
|
@@ -26329,11 +26410,15 @@ var Select = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
26329
26410
|
}, [value]);
|
|
26330
26411
|
|
|
26331
26412
|
var onToggleHandler = function onToggleHandler(open) {
|
|
26413
|
+
if (onToggle) {
|
|
26414
|
+
onToggle(open);
|
|
26415
|
+
}
|
|
26416
|
+
|
|
26332
26417
|
if (triggerOptions && triggerOptions.disabled) {
|
|
26333
26418
|
setOpenPopover(false);
|
|
26334
26419
|
} else {
|
|
26335
|
-
setHighlightFirstItem(open);
|
|
26336
26420
|
setOpenPopover(open);
|
|
26421
|
+
setHighlightFirstItem(open);
|
|
26337
26422
|
}
|
|
26338
26423
|
};
|
|
26339
26424
|
|
|
@@ -26372,19 +26457,17 @@ var Select = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
26372
26457
|
}, /*#__PURE__*/React.createElement("div", _extends$2({
|
|
26373
26458
|
"data-test": "DesignSystem-Select",
|
|
26374
26459
|
"aria-haspopup": "listbox",
|
|
26375
|
-
"aria-expanded": openPopover
|
|
26376
|
-
style: triggerStyle
|
|
26460
|
+
"aria-expanded": openPopover
|
|
26377
26461
|
}, baseProps), /*#__PURE__*/React.createElement(Popover$1, {
|
|
26378
26462
|
open: openPopover,
|
|
26379
26463
|
onToggle: onToggleHandler,
|
|
26380
26464
|
className: "mt-3",
|
|
26381
26465
|
triggerClass: "d-block",
|
|
26466
|
+
position: "bottom-start",
|
|
26382
26467
|
customStyle: popoverStyle,
|
|
26383
26468
|
boundaryElement: boundaryElement,
|
|
26384
26469
|
appendToBody: appendToBody,
|
|
26385
|
-
trigger:
|
|
26386
|
-
"aria-controls": "select-listbox"
|
|
26387
|
-
}, triggerOptions))
|
|
26470
|
+
trigger: getTriggerElement()
|
|
26388
26471
|
}, /*#__PURE__*/React.createElement(OutsideClick, {
|
|
26389
26472
|
onOutsideClick: onOutsideClickHandler
|
|
26390
26473
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -31281,6 +31364,6 @@ AIResponse.Button = ChatButton;
|
|
|
31281
31364
|
AIResponse.ActionBar = ChatActionBar;
|
|
31282
31365
|
AIResponse.Body = ChatBody;
|
|
31283
31366
|
|
|
31284
|
-
var version = "2.
|
|
31367
|
+
var version = "2.37.0";
|
|
31285
31368
|
|
|
31286
31369
|
export { AIButton, AIChip, AIIconButton, AIResponse, ActionCard, Avatar, AvatarGroup, AvatarSelection, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, Combobox, DatePicker, DateRangePicker, Dialog, Divider, Dropdown, Dropzone, EditableChipInput, EditableDropdown, EditableInput, EmptyState, FileList, FileUploader, FileUploaderList, FullscreenModal, Grid, GridCell, Heading, HelpText, HorizontalNav, Icon, InlineMessage, Input, X as InputMask, Label, Legend, Link, LinkButton, List, Listbox, Menu, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderImage, PlaceholderParagraph, Popover$1 as Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, Sara, SaraSparkle, Select, SelectionCard, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, TextField, Textarea, TimePicker, Toast, Tooltip, index as Utils, VerificationCodeInput, VerticalNav, version };
|