@innovaccer/design-system 2.27.0 → 2.28.1
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 +79 -0
- package/css/dist/index.css +14 -1
- package/css/dist/index.css.map +1 -1
- package/css/src/components/avatar.css +11 -0
- package/css/src/components/avatarGroup.css +2 -0
- package/css/src/components/textarea.css +1 -1
- package/dist/.lib/tsconfig.type.tsbuildinfo +12 -12
- package/dist/core/common.type.d.ts +1 -0
- package/dist/core/components/atoms/avatar/Avatar.d.ts +3 -1
- package/dist/core/components/atoms/avatarGroup/AvatarGroup.d.ts +3 -0
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +1 -1
- package/dist/core/utils/navigationHelper.d.ts +6 -0
- package/dist/index.esm.js +71 -19
- package/dist/index.js +63 -20
- 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
|
@@ -12,6 +12,17 @@
|
|
|
12
12
|
cursor: default;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
.Avatar--wrapper {
|
|
16
|
+
padding: var(--spacing-xs);
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.Avatar--square {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
border-radius: var(--spacing-m);
|
|
24
|
+
}
|
|
25
|
+
|
|
15
26
|
.Avatar--regular {
|
|
16
27
|
height: var(--spacing-3);
|
|
17
28
|
width: var(--spacing-3);
|
|
@@ -287,8 +287,8 @@
|
|
|
287
287
|
"affectsGlobalScope": false
|
|
288
288
|
},
|
|
289
289
|
"../../core/components/atoms/avatar/Avatar.tsx": {
|
|
290
|
-
"version": "
|
|
291
|
-
"signature": "
|
|
290
|
+
"version": "eee8412d715d9aeb2bce5e153921f3e709f56ff53313d80ee9ed4eee9b6615e5",
|
|
291
|
+
"signature": "c057a5e30a8496a407cd5b866594866f473ac335a314bc9d189c1ecb002f9564",
|
|
292
292
|
"affectsGlobalScope": false
|
|
293
293
|
},
|
|
294
294
|
"../../core/components/atoms/avatar/index.tsx": {
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
"affectsGlobalScope": false
|
|
303
303
|
},
|
|
304
304
|
"../../core/components/atoms/avatarGroup/Avatars.tsx": {
|
|
305
|
-
"version": "
|
|
305
|
+
"version": "2ebb430d6b98659ad239c589d291a3c76ad4c119da043444938630c29db708c3",
|
|
306
306
|
"signature": "695e51eeb303f29c0263fa5c6b977153066291197a52797f11988ab8e4e7e43b",
|
|
307
307
|
"affectsGlobalScope": false
|
|
308
308
|
},
|
|
@@ -312,8 +312,8 @@
|
|
|
312
312
|
"affectsGlobalScope": false
|
|
313
313
|
},
|
|
314
314
|
"../../core/components/atoms/avatarGroup/AvatarGroup.tsx": {
|
|
315
|
-
"version": "
|
|
316
|
-
"signature": "
|
|
315
|
+
"version": "00e07a879d4488cb0321aa4e666afc18293c05275c2f3002ba5679fd9b0106b6",
|
|
316
|
+
"signature": "ce3f3fd390bd9db8bae71aa4bd609a13cc1c13ff45b2a72f8de33ff7677e4cd6",
|
|
317
317
|
"affectsGlobalScope": false
|
|
318
318
|
},
|
|
319
319
|
"../../core/components/atoms/avatarGroup/index.tsx": {
|
|
@@ -697,7 +697,7 @@
|
|
|
697
697
|
"affectsGlobalScope": false
|
|
698
698
|
},
|
|
699
699
|
"../../core/components/atoms/metricInput/MetricInput.tsx": {
|
|
700
|
-
"version": "
|
|
700
|
+
"version": "7d02c2bb3c95e24914c9639543261c57779bc7d184bbca02f5497e61272d1d61",
|
|
701
701
|
"signature": "d0d75acbdbaa6aa769ad0c3be2ac9f90957e741170bfc459023f454385bc828b",
|
|
702
702
|
"affectsGlobalScope": false
|
|
703
703
|
},
|
|
@@ -742,8 +742,8 @@
|
|
|
742
742
|
"affectsGlobalScope": false
|
|
743
743
|
},
|
|
744
744
|
"../../core/utils/navigationHelper.tsx": {
|
|
745
|
-
"version": "
|
|
746
|
-
"signature": "
|
|
745
|
+
"version": "714b964d2364d5db4398249ccaa3ddfe3f39fca2b470707529eacdccedb1d577",
|
|
746
|
+
"signature": "2e3da2aacaddd7bb64ecb9e7b7b9da839b3771ce64fb6e2c5c49111bc4c5901d",
|
|
747
747
|
"affectsGlobalScope": false
|
|
748
748
|
},
|
|
749
749
|
"../../core/components/organisms/verticalNav/MenuItem.tsx": {
|
|
@@ -752,7 +752,7 @@
|
|
|
752
752
|
"affectsGlobalScope": false
|
|
753
753
|
},
|
|
754
754
|
"../../core/components/organisms/verticalNav/VerticalNav.tsx": {
|
|
755
|
-
"version": "
|
|
755
|
+
"version": "7311d817228228ec6fa49fdd2af55dee35f57927e71d2a533b99d00a5d0ff52b",
|
|
756
756
|
"signature": "b6a81d40026ba8bd3a2cbf23c794ebad04a3cd7ae697b1a3fcbca6f0cb11ad7f",
|
|
757
757
|
"affectsGlobalScope": false
|
|
758
758
|
},
|
|
@@ -1203,7 +1203,7 @@
|
|
|
1203
1203
|
},
|
|
1204
1204
|
"../../core/components/atoms/popperWrapper/PopperWrapper.tsx": {
|
|
1205
1205
|
"version": "a9b0f82d2ae14e36df05c70e60ad62c2200abe32e03ac56f4e86bacf43304be4",
|
|
1206
|
-
"signature": "
|
|
1206
|
+
"signature": "d3a1dcb83226bbb67f2a55e75d8024e63960ec04dbff72fef6e01a684ef16b0b",
|
|
1207
1207
|
"affectsGlobalScope": false
|
|
1208
1208
|
},
|
|
1209
1209
|
"../../core/components/atoms/popperWrapper/index.tsx": {
|
|
@@ -1752,8 +1752,8 @@
|
|
|
1752
1752
|
"affectsGlobalScope": false
|
|
1753
1753
|
},
|
|
1754
1754
|
"../../core/common.type.tsx": {
|
|
1755
|
-
"version": "
|
|
1756
|
-
"signature": "
|
|
1755
|
+
"version": "6a0b5cea6e6f34ef002f1de547407cf2bfcb3a0b2d5e58c590018793f7adca26",
|
|
1756
|
+
"signature": "e7bb809f66394d9532c72477519acf0e8ea603e3ec409c80aaae82fdf5709b9f",
|
|
1757
1757
|
"affectsGlobalScope": false
|
|
1758
1758
|
},
|
|
1759
1759
|
"../../core/global.d.ts": {
|
|
@@ -12,4 +12,5 @@ export declare type NumberRange = [number, number];
|
|
|
12
12
|
export declare type ChangeEvent = React.ChangeEvent<HTMLInputElement>;
|
|
13
13
|
export declare type TextColor = 'white' | 'primary' | 'secondary' | 'success' | 'alert' | 'warning' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'inverse' | 'primary-dark' | 'secondary-dark' | 'success-dark' | 'alert-dark' | 'warning-dark' | 'accent1-dark' | 'accent2-dark' | 'accent3-dark' | 'accent4-dark' | 'primary-darker' | 'success-darker' | 'alert-darker' | 'warning-darker' | 'accent1-darker' | 'accent2-darker' | 'accent3-darker' | 'accent4-darker' | 'primary-light' | 'secondary-light' | 'success-light' | 'alert-light' | 'warning-light' | 'accent1-light' | 'accent2-light' | 'accent3-light' | 'accent4-light' | 'inverse-light' | 'primary-lighter' | 'secondary-lighter' | 'success-lighter' | 'alert-lighter' | 'warning-lighter' | 'accent1-lighter' | 'accent2-lighter' | 'accent3-lighter' | 'accent4-lighter' | 'inverse-lighter' | 'primary-lightest' | 'secondary-lightest' | 'success-lightest' | 'alert-lightest' | 'warning-lightest' | 'accent1-lightest' | 'accent2-lightest' | 'accent3-lightest' | 'accent4-lightest' | 'inverse-lightest' | 'primary-shadow' | 'secondary-shadow' | 'success-shadow' | 'alert-shadow' | 'warning-shadow' | 'accent1-shadow' | 'accent2-shadow' | 'accent3-shadow' | 'accent4-shadow' | 'inverse-shadow';
|
|
14
14
|
export declare type AvatarSize = 'regular' | 'tiny';
|
|
15
|
+
export declare type AvatarShape = 'round' | 'square';
|
|
15
16
|
export declare type IconType = 'rounded' | 'outlined';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseProps } from "../../../utils/types";
|
|
3
3
|
import { TooltipProps } from "../../../index.type";
|
|
4
|
-
import { AccentAppearance, AvatarSize } from "../../../common.type";
|
|
4
|
+
import { AccentAppearance, AvatarSize, AvatarShape } from "../../../common.type";
|
|
5
5
|
export interface AvatarProps extends BaseProps {
|
|
6
6
|
appearance?: AccentAppearance;
|
|
7
7
|
children?: string | React.ReactNode;
|
|
@@ -10,6 +10,7 @@ export interface AvatarProps extends BaseProps {
|
|
|
10
10
|
withTooltip: boolean;
|
|
11
11
|
tooltipPosition: TooltipProps['position'];
|
|
12
12
|
size: AvatarSize;
|
|
13
|
+
shape: AvatarShape;
|
|
13
14
|
}
|
|
14
15
|
export declare const Avatar: {
|
|
15
16
|
(props: AvatarProps): JSX.Element;
|
|
@@ -20,6 +21,7 @@ export declare const Avatar: {
|
|
|
20
21
|
tooltipPosition: string;
|
|
21
22
|
withTooltip: boolean;
|
|
22
23
|
size: string;
|
|
24
|
+
shape: string;
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
export default Avatar;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { BaseProps } from "../../../utils/types";
|
|
2
3
|
import { AvatarProps, PopoverProps } from "../../../index.type";
|
|
3
4
|
import { AvatarSize } from "../../../common.type";
|
|
@@ -5,6 +6,8 @@ interface AvatarData extends Record<string, any> {
|
|
|
5
6
|
firstName?: string;
|
|
6
7
|
lastName?: string;
|
|
7
8
|
appearance?: AvatarProps['appearance'];
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
image?: React.ReactNode;
|
|
8
11
|
}
|
|
9
12
|
interface AvatarPopoverProps {
|
|
10
13
|
popperRenderer?: (names: AvatarData[]) => JSX.Element;
|
|
@@ -845,7 +845,7 @@ export declare class PopperWrapper extends React.Component<PopperWrapperProps, P
|
|
|
845
845
|
stroke?: "none" | (string & {}) | "white" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "transparent" | "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "grey" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "whitesmoke" | "yellow" | "yellowgreen" | "ActiveBorder" | "ActiveCaption" | "AppWorkspace" | "Background" | "ButtonFace" | "ButtonHighlight" | "ButtonShadow" | "ButtonText" | "CaptionText" | "GrayText" | "Highlight" | "HighlightText" | "InactiveBorder" | "InactiveCaption" | "InactiveCaptionText" | "InfoBackground" | "InfoText" | "Menu" | "MenuText" | "Scrollbar" | "ThreeDDarkShadow" | "ThreeDFace" | "ThreeDHighlight" | "ThreeDLightShadow" | "ThreeDShadow" | "Window" | "WindowFrame" | "WindowText" | "currentcolor" | "child" | "context-fill" | "context-stroke" | undefined;
|
|
846
846
|
strokeDasharray?: string | number | (string & {}) | (number & {}) | undefined;
|
|
847
847
|
strokeDashoffset?: string | number | (string & {}) | undefined;
|
|
848
|
-
strokeLinecap?: "round" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "
|
|
848
|
+
strokeLinecap?: "round" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "square" | "butt" | undefined;
|
|
849
849
|
strokeLinejoin?: "round" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "bevel" | "miter" | undefined;
|
|
850
850
|
strokeMiterlimit?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | (number & {}) | undefined;
|
|
851
851
|
strokeOpacity?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | (number & {}) | undefined;
|
|
@@ -9,6 +9,7 @@ export declare type Menu = {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
subMenu?: Menu[];
|
|
11
11
|
iconType?: IconType;
|
|
12
|
+
expanded?: boolean;
|
|
12
13
|
};
|
|
13
14
|
export declare type ActiveMenu = ({
|
|
14
15
|
name: string;
|
|
@@ -19,6 +20,11 @@ export declare const getTextAppearance: (isActive: boolean, disabled?: boolean |
|
|
|
19
20
|
export declare const getIconAppearance: (isActive: boolean, disabled?: boolean | undefined) => "default" | "disabled" | "primary_dark";
|
|
20
21
|
export declare const getPillsAppearance: (isActive: boolean) => "secondary" | "primary";
|
|
21
22
|
export declare const getMenu: (menus: Menu[], active: ActiveMenu) => Menu | null;
|
|
23
|
+
export declare const getExpandedMenus: (menus: Menu[], active?: ({
|
|
24
|
+
name: string;
|
|
25
|
+
} & Partial<Menu>) | ({
|
|
26
|
+
link: string;
|
|
27
|
+
} & Partial<Menu>) | undefined) => Record<string, boolean>;
|
|
22
28
|
export declare const isMenuActive: (menus: Menu[], menu: Menu, active?: ({
|
|
23
29
|
name: string;
|
|
24
30
|
} & Partial<Menu>) | ({
|
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1708350879254
|
|
4
4
|
* Package: @innovaccer/design-system
|
|
5
|
-
* Version: v2.
|
|
5
|
+
* Version: v2.28.1
|
|
6
6
|
* License: MIT
|
|
7
7
|
* Docs: https://innovaccer.github.io/design-system
|
|
8
8
|
*/
|
|
@@ -895,7 +895,7 @@ var initialsLength = 2;
|
|
|
895
895
|
var DefaultAppearance = 'secondary';
|
|
896
896
|
var colors = ['accent4', 'primary', 'accent3', 'alert', 'accent2', 'warning', 'accent1', 'success'];
|
|
897
897
|
var Avatar = function Avatar(props) {
|
|
898
|
-
var _classNames, _classNames2;
|
|
898
|
+
var _classNames, _classNames2, _classNames3;
|
|
899
899
|
|
|
900
900
|
var withTooltip = props.withTooltip,
|
|
901
901
|
tooltipPosition = props.tooltipPosition,
|
|
@@ -904,15 +904,17 @@ var Avatar = function Avatar(props) {
|
|
|
904
904
|
firstName = props.firstName,
|
|
905
905
|
lastName = props.lastName,
|
|
906
906
|
className = props.className,
|
|
907
|
-
appearance = props.appearance
|
|
907
|
+
appearance = props.appearance,
|
|
908
|
+
shape = props.shape;
|
|
908
909
|
var baseProps = extractBaseProps(props);
|
|
909
910
|
var initials = children && typeof children === 'string' ? children.trim().slice(0, initialsLength) : "".concat(firstName ? firstName.trim()[0] : '').concat(lastName ? lastName.trim()[0] : '');
|
|
910
911
|
var tooltip = children && typeof children === 'string' ? children : "".concat(firstName || '', " ").concat(lastName || '') || '';
|
|
911
912
|
var AvatarAppearance = appearance || colors[(initials.charCodeAt(0) + (initials.charCodeAt(1) || 0)) % 8] || DefaultAppearance;
|
|
912
913
|
var AvatarClassNames = classnames((_classNames = {
|
|
913
914
|
Avatar: true
|
|
914
|
-
}, _defineProperty$1(_classNames, "Avatar--".concat(size),
|
|
915
|
-
var
|
|
915
|
+
}, _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--disabled', !initials || !withTooltip), _classNames), className);
|
|
916
|
+
var AvatarWrapperClassNames = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Avatar--wrapper', shape === 'square'), _defineProperty$1(_classNames2, "Avatar--".concat(size), shape === 'square'), _classNames2), className);
|
|
917
|
+
var TextClassNames = classnames((_classNames3 = {}, _defineProperty$1(_classNames3, "Avatar-content--".concat(size), size), _defineProperty$1(_classNames3, "Avatar-content--".concat(AvatarAppearance), AvatarAppearance), _classNames3));
|
|
916
918
|
var IconClassNames = classnames(_defineProperty$1({}, "Avatar-content--".concat(AvatarAppearance), AvatarAppearance));
|
|
917
919
|
var sharedProp = {
|
|
918
920
|
size: size,
|
|
@@ -923,16 +925,22 @@ var Avatar = function Avatar(props) {
|
|
|
923
925
|
|
|
924
926
|
var renderAvatar = function renderAvatar() {
|
|
925
927
|
if (children && typeof children !== 'string') {
|
|
926
|
-
return /*#__PURE__*/React.createElement(
|
|
928
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
929
|
+
"data-test": "DesignSystem-AvatarWrapper",
|
|
930
|
+
className: AvatarWrapperClassNames
|
|
931
|
+
}, /*#__PURE__*/React.createElement(AvatarProvider, {
|
|
927
932
|
value: sharedProp
|
|
928
933
|
}, /*#__PURE__*/React.createElement("span", _extends$2({
|
|
929
934
|
"data-test": "DesignSystem-Avatar"
|
|
930
935
|
}, baseProps, {
|
|
931
936
|
className: AvatarClassNames
|
|
932
|
-
}), children));
|
|
937
|
+
}), children)));
|
|
933
938
|
}
|
|
934
939
|
|
|
935
|
-
return /*#__PURE__*/React.createElement("span",
|
|
940
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
941
|
+
"data-test": "DesignSystem-AvatarWrapper",
|
|
942
|
+
className: AvatarWrapperClassNames
|
|
943
|
+
}, /*#__PURE__*/React.createElement("span", _extends$2({
|
|
936
944
|
"data-test": "DesignSystem-Avatar"
|
|
937
945
|
}, baseProps, {
|
|
938
946
|
className: AvatarClassNames
|
|
@@ -946,7 +954,7 @@ var Avatar = function Avatar(props) {
|
|
|
946
954
|
size: size === 'regular' ? 20 : 16,
|
|
947
955
|
appearance: 'white',
|
|
948
956
|
className: IconClassNames
|
|
949
|
-
}));
|
|
957
|
+
})));
|
|
950
958
|
};
|
|
951
959
|
|
|
952
960
|
var renderTooltip = function renderTooltip() {
|
|
@@ -969,7 +977,8 @@ Avatar.Image = AvatarImage;
|
|
|
969
977
|
Avatar.defaultProps = {
|
|
970
978
|
tooltipPosition: 'bottom',
|
|
971
979
|
withTooltip: true,
|
|
972
|
-
size: 'regular'
|
|
980
|
+
size: 'regular',
|
|
981
|
+
shape: 'round'
|
|
973
982
|
};
|
|
974
983
|
|
|
975
984
|
var AvatarCount = function AvatarCount(props) {
|
|
@@ -1005,7 +1014,9 @@ var Avatars = function Avatars(props) {
|
|
|
1005
1014
|
var avatars = avatarList.map(function (item, index) {
|
|
1006
1015
|
var appearance = item.appearance,
|
|
1007
1016
|
firstName = item.firstName,
|
|
1008
|
-
lastName = item.lastName
|
|
1017
|
+
lastName = item.lastName,
|
|
1018
|
+
icon = item.icon,
|
|
1019
|
+
image = item.image;
|
|
1009
1020
|
return /*#__PURE__*/React.createElement("div", {
|
|
1010
1021
|
"data-test": "DesignSystem-AvatarGroup--Avatar",
|
|
1011
1022
|
className: GroupClass,
|
|
@@ -1018,7 +1029,7 @@ var Avatars = function Avatars(props) {
|
|
|
1018
1029
|
lastName: lastName,
|
|
1019
1030
|
withTooltip: true,
|
|
1020
1031
|
tooltipPosition: tooltipPosition
|
|
1021
|
-
}));
|
|
1032
|
+
}, image || icon));
|
|
1022
1033
|
});
|
|
1023
1034
|
return avatars;
|
|
1024
1035
|
};
|
|
@@ -6879,6 +6890,7 @@ var MetricInput = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
6879
6890
|
}, suffix), showActionButton && /*#__PURE__*/React.createElement("div", {
|
|
6880
6891
|
className: "MetricInput-arrowIcons"
|
|
6881
6892
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
6893
|
+
type: "button",
|
|
6882
6894
|
icon: "keyboard_arrow_up",
|
|
6883
6895
|
size: actionButtonSize,
|
|
6884
6896
|
className: "".concat(actionButton, " mb-2"),
|
|
@@ -6887,6 +6899,7 @@ var MetricInput = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
6887
6899
|
},
|
|
6888
6900
|
"data-test": "DesignSystem-MetricInput--upIcon"
|
|
6889
6901
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
6902
|
+
type: "button",
|
|
6890
6903
|
icon: "keyboard_arrow_down",
|
|
6891
6904
|
size: actionButtonSize,
|
|
6892
6905
|
className: actionButton,
|
|
@@ -14300,6 +14313,31 @@ var getMenu = function getMenu(menus, active) {
|
|
|
14300
14313
|
|
|
14301
14314
|
return null;
|
|
14302
14315
|
};
|
|
14316
|
+
var getExpandedMenus = function getExpandedMenus(menus, active) {
|
|
14317
|
+
var expandedMenus = {};
|
|
14318
|
+
var activeMenu = active ? getMenu(menus, active) : null;
|
|
14319
|
+
|
|
14320
|
+
var _iterator2 = _createForOfIteratorHelper(menus),
|
|
14321
|
+
_step2;
|
|
14322
|
+
|
|
14323
|
+
try {
|
|
14324
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
14325
|
+
var menu = _step2.value;
|
|
14326
|
+
// Determine if the current menu is active or should be expanded by default
|
|
14327
|
+
var isActiveOrExpanded = (activeMenu === null || activeMenu === void 0 ? void 0 : activeMenu.name.split('.')[0]) === menu.name || menu.expanded;
|
|
14328
|
+
|
|
14329
|
+
if (menu.subMenu) {
|
|
14330
|
+
expandedMenus[menu.name] = !!isActiveOrExpanded;
|
|
14331
|
+
}
|
|
14332
|
+
}
|
|
14333
|
+
} catch (err) {
|
|
14334
|
+
_iterator2.e(err);
|
|
14335
|
+
} finally {
|
|
14336
|
+
_iterator2.f();
|
|
14337
|
+
}
|
|
14338
|
+
|
|
14339
|
+
return expandedMenus;
|
|
14340
|
+
};
|
|
14303
14341
|
var isMenuActive = function isMenuActive(menus, menu, active) {
|
|
14304
14342
|
if (active) {
|
|
14305
14343
|
var currActiveMenu = getMenu(menus, active);
|
|
@@ -14453,8 +14491,13 @@ var VerticalNav = function VerticalNav(props) {
|
|
|
14453
14491
|
|
|
14454
14492
|
var _React$useState = React.useState({}),
|
|
14455
14493
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14456
|
-
|
|
14457
|
-
|
|
14494
|
+
subMenuExpandedState = _React$useState2[0],
|
|
14495
|
+
setSubMenuExpandedState = _React$useState2[1];
|
|
14496
|
+
|
|
14497
|
+
var _React$useState3 = React.useState({}),
|
|
14498
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
14499
|
+
menuState = _React$useState4[0],
|
|
14500
|
+
setMenuState = _React$useState4[1];
|
|
14458
14501
|
|
|
14459
14502
|
var baseProps = extractBaseProps(props);
|
|
14460
14503
|
React.useEffect(function () {
|
|
@@ -14463,6 +14506,10 @@ var VerticalNav = function VerticalNav(props) {
|
|
|
14463
14506
|
if (currMenu) updateMenuState(currMenu, true);
|
|
14464
14507
|
}
|
|
14465
14508
|
}, [props.active]);
|
|
14509
|
+
React.useEffect(function () {
|
|
14510
|
+
var expandedMenus = getExpandedMenus(menus, active);
|
|
14511
|
+
setSubMenuExpandedState(expandedMenus);
|
|
14512
|
+
}, []);
|
|
14466
14513
|
|
|
14467
14514
|
var updateMenuState = function updateMenuState(menu, val) {
|
|
14468
14515
|
var currMenu = getMenu(menus, menu);
|
|
@@ -14494,7 +14541,12 @@ var VerticalNav = function VerticalNav(props) {
|
|
|
14494
14541
|
if (!expanded) {
|
|
14495
14542
|
if (onClick) onClick(menu.subMenu[0]);
|
|
14496
14543
|
} else {
|
|
14497
|
-
|
|
14544
|
+
if (!subMenuExpandedState[menu.name]) {
|
|
14545
|
+
updateMenuState(menu);
|
|
14546
|
+
}
|
|
14547
|
+
|
|
14548
|
+
setMenuState(_objectSpread2(_objectSpread2({}, menuState), {}, _defineProperty$1({}, menu.name, false)));
|
|
14549
|
+
setSubMenuExpandedState(_objectSpread2(_objectSpread2({}, subMenuExpandedState), {}, _defineProperty$1({}, menu.name, !subMenuExpandedState[menu.name])));
|
|
14498
14550
|
}
|
|
14499
14551
|
} else {
|
|
14500
14552
|
if (onClick) onClick(menu);
|
|
@@ -14507,7 +14559,7 @@ var VerticalNav = function VerticalNav(props) {
|
|
|
14507
14559
|
|
|
14508
14560
|
var isActive = !menuState[menu.name] && isMenuActive(menus, menu, active);
|
|
14509
14561
|
var hasSubmenu = menu.subMenu && menu.subMenu.length > 0;
|
|
14510
|
-
var isChildrenVisible = hasSubmenu && menuState[menu.name];
|
|
14562
|
+
var isChildrenVisible = hasSubmenu && (menuState[menu.name] || subMenuExpandedState[menu.name]);
|
|
14511
14563
|
var hasGroup = index === 0 || menus[index - 1].group !== menu.group;
|
|
14512
14564
|
var sectionClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'VerticalNav-section', true), _defineProperty$1(_classNames, 'VerticalNav-section--border', index !== 0), _classNames));
|
|
14513
14565
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
@@ -14544,7 +14596,7 @@ var VerticalNav = function VerticalNav(props) {
|
|
|
14544
14596
|
isChildrenVisible: isChildrenVisible,
|
|
14545
14597
|
onClick: onClickHandler,
|
|
14546
14598
|
customItemRenderer: customItemRenderer
|
|
14547
|
-
}),
|
|
14599
|
+
}), isChildrenVisible && menu.subMenu.map(function (subMenu, id) {
|
|
14548
14600
|
return showTooltip ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
14549
14601
|
tooltip: subMenu.label,
|
|
14550
14602
|
position: "right"
|
|
@@ -23539,6 +23591,6 @@ var TextField = function TextField(props) {
|
|
|
23539
23591
|
};
|
|
23540
23592
|
TextField.displayName = 'TextField';
|
|
23541
23593
|
|
|
23542
|
-
var version = "2.
|
|
23594
|
+
var version = "2.28.1";
|
|
23543
23595
|
|
|
23544
23596
|
export { ActionCard, Avatar, AvatarGroup, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, 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, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderImage, PlaceholderParagraph, Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, SelectionCard, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, TextField, Textarea, TimePicker, Toast, Tooltip, index as Utils, VerificationCodeInput, VerticalNav, version };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1708350879498
|
|
4
4
|
* Package: @innovaccer/design-system
|
|
5
|
-
* Version: v2.
|
|
5
|
+
* Version: v2.28.1
|
|
6
6
|
* License: MIT
|
|
7
7
|
* Docs: https://innovaccer.github.io/design-system
|
|
8
8
|
*/
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
var DefaultAppearance = 'secondary';
|
|
538
538
|
var colors = ['accent4', 'primary', 'accent3', 'alert', 'accent2', 'warning', 'accent1', 'success'];
|
|
539
539
|
var Avatar = function Avatar(props) {
|
|
540
|
-
var _a, _b, _c;
|
|
540
|
+
var _a, _b, _c, _d;
|
|
541
541
|
|
|
542
542
|
var withTooltip = props.withTooltip,
|
|
543
543
|
tooltipPosition = props.tooltipPosition,
|
|
@@ -546,16 +546,18 @@
|
|
|
546
546
|
firstName = props.firstName,
|
|
547
547
|
lastName = props.lastName,
|
|
548
548
|
className = props.className,
|
|
549
|
-
appearance = props.appearance
|
|
549
|
+
appearance = props.appearance,
|
|
550
|
+
shape = props.shape;
|
|
550
551
|
var baseProps = extractBaseProps(props);
|
|
551
552
|
var initials = children && typeof children === 'string' ? children.trim().slice(0, initialsLength) : "" + (firstName ? firstName.trim()[0] : '') + (lastName ? lastName.trim()[0] : '');
|
|
552
553
|
var tooltip = children && typeof children === 'string' ? children : (firstName || '') + " " + (lastName || '') || '';
|
|
553
554
|
var AvatarAppearance = appearance || colors[(initials.charCodeAt(0) + (initials.charCodeAt(1) || 0)) % 8] || DefaultAppearance;
|
|
554
555
|
var AvatarClassNames = classNames__default["default"]((_a = {
|
|
555
556
|
Avatar: true
|
|
556
|
-
}, _a["Avatar--" + size] =
|
|
557
|
-
var
|
|
558
|
-
var
|
|
557
|
+
}, _a['Avatar--square'] = shape === 'square', _a["Avatar--" + size] = shape !== 'square', _a["Avatar--" + AvatarAppearance] = AvatarAppearance, _a['Avatar--disabled'] = !initials || !withTooltip, _a), className);
|
|
558
|
+
var AvatarWrapperClassNames = classNames__default["default"]((_b = {}, _b['Avatar--wrapper'] = shape === 'square', _b["Avatar--" + size] = shape === 'square', _b), className);
|
|
559
|
+
var TextClassNames = classNames__default["default"]((_c = {}, _c["Avatar-content--" + size] = size, _c["Avatar-content--" + AvatarAppearance] = AvatarAppearance, _c));
|
|
560
|
+
var IconClassNames = classNames__default["default"]((_d = {}, _d["Avatar-content--" + AvatarAppearance] = AvatarAppearance, _d));
|
|
559
561
|
var sharedProp = {
|
|
560
562
|
size: size,
|
|
561
563
|
firstName: firstName,
|
|
@@ -565,16 +567,22 @@
|
|
|
565
567
|
|
|
566
568
|
var renderAvatar = function renderAvatar() {
|
|
567
569
|
if (children && typeof children !== 'string') {
|
|
568
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
570
|
+
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
571
|
+
"data-test": "DesignSystem-AvatarWrapper",
|
|
572
|
+
className: AvatarWrapperClassNames
|
|
573
|
+
}, /*#__PURE__*/React__namespace.createElement(AvatarProvider, {
|
|
569
574
|
value: sharedProp
|
|
570
575
|
}, /*#__PURE__*/React__namespace.createElement("span", __assign({
|
|
571
576
|
"data-test": "DesignSystem-Avatar"
|
|
572
577
|
}, baseProps, {
|
|
573
578
|
className: AvatarClassNames
|
|
574
|
-
}), children));
|
|
579
|
+
}), children)));
|
|
575
580
|
}
|
|
576
581
|
|
|
577
|
-
return /*#__PURE__*/React__namespace.createElement("span",
|
|
582
|
+
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
583
|
+
"data-test": "DesignSystem-AvatarWrapper",
|
|
584
|
+
className: AvatarWrapperClassNames
|
|
585
|
+
}, /*#__PURE__*/React__namespace.createElement("span", __assign({
|
|
578
586
|
"data-test": "DesignSystem-Avatar"
|
|
579
587
|
}, baseProps, {
|
|
580
588
|
className: AvatarClassNames
|
|
@@ -588,7 +596,7 @@
|
|
|
588
596
|
size: size === 'regular' ? 20 : 16,
|
|
589
597
|
appearance: 'white',
|
|
590
598
|
className: IconClassNames
|
|
591
|
-
}));
|
|
599
|
+
})));
|
|
592
600
|
};
|
|
593
601
|
|
|
594
602
|
var renderTooltip = function renderTooltip() {
|
|
@@ -611,7 +619,8 @@
|
|
|
611
619
|
Avatar.defaultProps = {
|
|
612
620
|
tooltipPosition: 'bottom',
|
|
613
621
|
withTooltip: true,
|
|
614
|
-
size: 'regular'
|
|
622
|
+
size: 'regular',
|
|
623
|
+
shape: 'round'
|
|
615
624
|
};
|
|
616
625
|
|
|
617
626
|
var AvatarCount = function AvatarCount(props) {
|
|
@@ -647,7 +656,9 @@
|
|
|
647
656
|
var avatars = avatarList.map(function (item, index) {
|
|
648
657
|
var appearance = item.appearance,
|
|
649
658
|
firstName = item.firstName,
|
|
650
|
-
lastName = item.lastName
|
|
659
|
+
lastName = item.lastName,
|
|
660
|
+
icon = item.icon,
|
|
661
|
+
image = item.image;
|
|
651
662
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
652
663
|
"data-test": "DesignSystem-AvatarGroup--Avatar",
|
|
653
664
|
className: GroupClass,
|
|
@@ -660,7 +671,7 @@
|
|
|
660
671
|
lastName: lastName,
|
|
661
672
|
withTooltip: true,
|
|
662
673
|
tooltipPosition: tooltipPosition
|
|
663
|
-
}));
|
|
674
|
+
}, image || icon));
|
|
664
675
|
});
|
|
665
676
|
return avatars;
|
|
666
677
|
};
|
|
@@ -6269,6 +6280,7 @@
|
|
|
6269
6280
|
}, suffix), showActionButton && /*#__PURE__*/React__namespace.createElement("div", {
|
|
6270
6281
|
className: "MetricInput-arrowIcons"
|
|
6271
6282
|
}, /*#__PURE__*/React__namespace.createElement(Button, {
|
|
6283
|
+
type: "button",
|
|
6272
6284
|
icon: "keyboard_arrow_up",
|
|
6273
6285
|
size: actionButtonSize,
|
|
6274
6286
|
className: actionButton + " mb-2",
|
|
@@ -6277,6 +6289,7 @@
|
|
|
6277
6289
|
},
|
|
6278
6290
|
"data-test": "DesignSystem-MetricInput--upIcon"
|
|
6279
6291
|
}), /*#__PURE__*/React__namespace.createElement(Button, {
|
|
6292
|
+
type: "button",
|
|
6280
6293
|
icon: "keyboard_arrow_down",
|
|
6281
6294
|
size: actionButtonSize,
|
|
6282
6295
|
className: actionButton,
|
|
@@ -8956,6 +8969,21 @@
|
|
|
8956
8969
|
|
|
8957
8970
|
return null;
|
|
8958
8971
|
};
|
|
8972
|
+
var getExpandedMenus = function getExpandedMenus(menus, active) {
|
|
8973
|
+
var expandedMenus = {};
|
|
8974
|
+
var activeMenu = active ? getMenu(menus, active) : null;
|
|
8975
|
+
|
|
8976
|
+
for (var _i = 0, menus_2 = menus; _i < menus_2.length; _i++) {
|
|
8977
|
+
var menu = menus_2[_i];
|
|
8978
|
+
var isActiveOrExpanded = (activeMenu === null || activeMenu === void 0 ? void 0 : activeMenu.name.split('.')[0]) === menu.name || menu.expanded;
|
|
8979
|
+
|
|
8980
|
+
if (menu.subMenu) {
|
|
8981
|
+
expandedMenus[menu.name] = !!isActiveOrExpanded;
|
|
8982
|
+
}
|
|
8983
|
+
}
|
|
8984
|
+
|
|
8985
|
+
return expandedMenus;
|
|
8986
|
+
};
|
|
8959
8987
|
var isMenuActive = function isMenuActive(menus, menu, active) {
|
|
8960
8988
|
if (active) {
|
|
8961
8989
|
var currActiveMenu = getMenu(menus, active);
|
|
@@ -9103,8 +9131,12 @@
|
|
|
9103
9131
|
showTooltip = props.showTooltip;
|
|
9104
9132
|
|
|
9105
9133
|
var _b = React__namespace.useState({}),
|
|
9106
|
-
|
|
9107
|
-
|
|
9134
|
+
subMenuExpandedState = _b[0],
|
|
9135
|
+
setSubMenuExpandedState = _b[1];
|
|
9136
|
+
|
|
9137
|
+
var _c = React__namespace.useState({}),
|
|
9138
|
+
menuState = _c[0],
|
|
9139
|
+
setMenuState = _c[1];
|
|
9108
9140
|
|
|
9109
9141
|
var baseProps = extractBaseProps(props);
|
|
9110
9142
|
React__namespace.useEffect(function () {
|
|
@@ -9113,6 +9145,10 @@
|
|
|
9113
9145
|
if (currMenu) updateMenuState(currMenu, true);
|
|
9114
9146
|
}
|
|
9115
9147
|
}, [props.active]);
|
|
9148
|
+
React__namespace.useEffect(function () {
|
|
9149
|
+
var expandedMenus = getExpandedMenus(menus, active);
|
|
9150
|
+
setSubMenuExpandedState(expandedMenus);
|
|
9151
|
+
}, []);
|
|
9116
9152
|
|
|
9117
9153
|
var updateMenuState = function updateMenuState(menu, val) {
|
|
9118
9154
|
var _a;
|
|
@@ -9142,11 +9178,18 @@
|
|
|
9142
9178
|
};
|
|
9143
9179
|
|
|
9144
9180
|
var onClickHandler = function onClickHandler(menu) {
|
|
9181
|
+
var _a, _b;
|
|
9182
|
+
|
|
9145
9183
|
if (menu.subMenu) {
|
|
9146
9184
|
if (!expanded) {
|
|
9147
9185
|
if (onClick) onClick(menu.subMenu[0]);
|
|
9148
9186
|
} else {
|
|
9149
|
-
|
|
9187
|
+
if (!subMenuExpandedState[menu.name]) {
|
|
9188
|
+
updateMenuState(menu);
|
|
9189
|
+
}
|
|
9190
|
+
|
|
9191
|
+
setMenuState(__assign(__assign({}, menuState), (_a = {}, _a[menu.name] = false, _a)));
|
|
9192
|
+
setSubMenuExpandedState(__assign(__assign({}, subMenuExpandedState), (_b = {}, _b[menu.name] = !subMenuExpandedState[menu.name], _b)));
|
|
9150
9193
|
}
|
|
9151
9194
|
} else {
|
|
9152
9195
|
if (onClick) onClick(menu);
|
|
@@ -9159,7 +9202,7 @@
|
|
|
9159
9202
|
|
|
9160
9203
|
var isActive = !menuState[menu.name] && isMenuActive(menus, menu, active);
|
|
9161
9204
|
var hasSubmenu = menu.subMenu && menu.subMenu.length > 0;
|
|
9162
|
-
var isChildrenVisible = hasSubmenu && menuState[menu.name];
|
|
9205
|
+
var isChildrenVisible = hasSubmenu && (menuState[menu.name] || subMenuExpandedState[menu.name]);
|
|
9163
9206
|
var hasGroup = index === 0 || menus[index - 1].group !== menu.group;
|
|
9164
9207
|
var sectionClass = classNames__default["default"]((_a = {}, _a['VerticalNav-section'] = true, _a['VerticalNav-section--border'] = index !== 0, _a));
|
|
9165
9208
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, {
|
|
@@ -9196,7 +9239,7 @@
|
|
|
9196
9239
|
isChildrenVisible: isChildrenVisible,
|
|
9197
9240
|
onClick: onClickHandler,
|
|
9198
9241
|
customItemRenderer: customItemRenderer
|
|
9199
|
-
}),
|
|
9242
|
+
}), isChildrenVisible && menu.subMenu.map(function (subMenu, id) {
|
|
9200
9243
|
return showTooltip ? /*#__PURE__*/React__namespace.createElement(Tooltip, {
|
|
9201
9244
|
tooltip: subMenu.label,
|
|
9202
9245
|
position: "right"
|
|
@@ -17781,7 +17824,7 @@
|
|
|
17781
17824
|
};
|
|
17782
17825
|
TextField.displayName = 'TextField';
|
|
17783
17826
|
|
|
17784
|
-
var version = "2.
|
|
17827
|
+
var version = "2.28.1";
|
|
17785
17828
|
|
|
17786
17829
|
exports.ActionCard = ActionCard;
|
|
17787
17830
|
exports.Avatar = Avatar;
|