@bigbinary/neeto-molecules 4.1.54 → 4.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Columns-cUgR6NTO.js → Columns-BVXRaORo.js} +8 -11
- package/dist/Columns-BVXRaORo.js.map +1 -0
- package/dist/{ConfigureView-C84AmCMq.js → ConfigureView-DAZrBZPv.js} +3 -2
- package/dist/{ConfigureView-C84AmCMq.js.map → ConfigureView-DAZrBZPv.js.map} +1 -1
- package/dist/cjs/{Columns-D3eocaeY.js → Columns-ZySdkGqV.js} +12 -15
- package/dist/cjs/Columns-ZySdkGqV.js.map +1 -0
- package/dist/cjs/{ConfigureView-DGf7cRMQ.js → ConfigureView-CAWRNNYI.js} +12 -11
- package/dist/cjs/{ConfigureView-DGf7cRMQ.js.map → ConfigureView-CAWRNNYI.js.map} +1 -1
- package/dist/cjs/v2/AuditLogs.js +19 -80
- package/dist/cjs/v2/AuditLogs.js.map +1 -1
- package/dist/cjs/v2/Breadcrumbs.js +7 -7
- package/dist/cjs/v2/Breadcrumbs.js.map +1 -1
- package/dist/cjs/v2/Columns.js +2 -1
- package/dist/cjs/v2/Columns.js.map +1 -1
- package/dist/cjs/v2/ConfigurePageSidebar.js +7 -6
- package/dist/cjs/v2/ConfigurePageSidebar.js.map +1 -1
- package/dist/cjs/v2/CopyToClipboardButton.js +11 -17
- package/dist/cjs/v2/CopyToClipboardButton.js.map +1 -1
- package/dist/cjs/v2/FloatingActionMenu.js +48 -66
- package/dist/cjs/v2/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/v2/Header.js +2 -1
- package/dist/cjs/v2/Header.js.map +1 -1
- package/dist/cjs/v2/HelpPopover.js +51 -54
- package/dist/cjs/v2/HelpPopover.js.map +1 -1
- package/dist/cjs/v2/KeyboardShortcuts.js +7 -15
- package/dist/cjs/v2/KeyboardShortcuts.js.map +1 -1
- package/dist/cjs/v2/MoreDropdown.js +59 -78
- package/dist/cjs/v2/MoreDropdown.js.map +1 -1
- package/dist/cjs/v2/Settings.js +1 -0
- package/dist/cjs/v2/Settings.js.map +1 -1
- package/dist/cjs/v2/Sidebar.js +101 -116
- package/dist/cjs/v2/Sidebar.js.map +1 -1
- package/dist/cjs/v2/SubHeader.js +31 -43
- package/dist/cjs/v2/SubHeader.js.map +1 -1
- package/dist/v2/AuditLogs.js +20 -81
- package/dist/v2/AuditLogs.js.map +1 -1
- package/dist/v2/Breadcrumbs.js +1 -1
- package/dist/v2/Breadcrumbs.js.map +1 -1
- package/dist/v2/Columns.js +2 -1
- package/dist/v2/Columns.js.map +1 -1
- package/dist/v2/ConfigurePageSidebar.js +3 -2
- package/dist/v2/ConfigurePageSidebar.js.map +1 -1
- package/dist/v2/CopyToClipboardButton.js +13 -19
- package/dist/v2/CopyToClipboardButton.js.map +1 -1
- package/dist/v2/FloatingActionMenu.js +25 -43
- package/dist/v2/FloatingActionMenu.js.map +1 -1
- package/dist/v2/Header.js +2 -1
- package/dist/v2/Header.js.map +1 -1
- package/dist/v2/HelpPopover.js +53 -56
- package/dist/v2/HelpPopover.js.map +1 -1
- package/dist/v2/KeyboardShortcuts.js +8 -16
- package/dist/v2/KeyboardShortcuts.js.map +1 -1
- package/dist/v2/MoreDropdown.js +61 -80
- package/dist/v2/MoreDropdown.js.map +1 -1
- package/dist/v2/Settings.js +1 -0
- package/dist/v2/Settings.js.map +1 -1
- package/dist/v2/Sidebar.js +87 -102
- package/dist/v2/Sidebar.js.map +1 -1
- package/dist/v2/SubHeader.js +32 -44
- package/dist/v2/SubHeader.js.map +1 -1
- package/package.json +5 -3
- package/src/translations/et.json +2 -2
- package/src/translations/fi.json +2 -2
- package/src/translations/hi.json +2 -2
- package/src/translations/hu.json +2 -2
- package/src/translations/ja.json +2 -2
- package/src/translations/ko.json +2 -2
- package/src/translations/tr.json +2 -2
- package/src/translations/zh-CN.json +2 -2
- package/src/translations/zh-TW.json +2 -2
- package/dist/Columns-cUgR6NTO.js.map +0 -1
- package/dist/cjs/Columns-D3eocaeY.js.map +0 -1
|
@@ -2,11 +2,11 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
4
|
import { useState, useRef, useEffect, useLayoutEffect } from 'react';
|
|
5
|
-
import { Button,
|
|
5
|
+
import { Button, Tooltip } from '@bigbinary/neeto-atoms';
|
|
6
6
|
import classnames from 'classnames';
|
|
7
7
|
import { copyToClipboard } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
|
-
import {
|
|
9
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
import { c as createLucideIcon } from '../createLucideIcon-mNMhCCpf.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -90,30 +90,24 @@ var CopyToClipboardButton = function CopyToClipboardButton(_ref) {
|
|
|
90
90
|
var currentTooltipContent = isChecked ? successTooltipContent || t("neetoMolecules.common.copied") : tooltipContent || t("neetoMolecules.common.copy");
|
|
91
91
|
var buttonLabel = isChecked && label ? successLabel || t("neetoMolecules.common.copied") : label;
|
|
92
92
|
var ButtonIcon = isChecked ? Check : Icon;
|
|
93
|
-
var button = /*#__PURE__*/
|
|
93
|
+
var button = /*#__PURE__*/jsx(Button, _objectSpread({
|
|
94
94
|
ref: ref,
|
|
95
95
|
"data-testid": "copy-to-clipboard-button",
|
|
96
|
+
icon: ButtonIcon,
|
|
97
|
+
iconPosition: "left",
|
|
98
|
+
label: buttonLabel || undefined,
|
|
96
99
|
size: resolvedSize,
|
|
97
100
|
variant: isChecked ? "default" : variant,
|
|
98
101
|
className: classnames("neeto-molecules-copy-button", isChecked && "neeto-molecules-copy-button--active", className),
|
|
99
102
|
onClick: onHandleClick
|
|
100
|
-
}, otherProps)
|
|
101
|
-
children: [/*#__PURE__*/jsx(ButtonIcon, {
|
|
102
|
-
size: 16
|
|
103
|
-
}), buttonLabel]
|
|
104
|
-
}));
|
|
103
|
+
}, otherProps));
|
|
105
104
|
if (label) return button;
|
|
106
|
-
return /*#__PURE__*/jsx(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
side: "top",
|
|
113
|
-
children: currentTooltipContent
|
|
114
|
-
})]
|
|
115
|
-
}))
|
|
116
|
-
});
|
|
105
|
+
return /*#__PURE__*/jsx(Tooltip, _objectSpread(_objectSpread({
|
|
106
|
+
content: currentTooltipContent,
|
|
107
|
+
position: "top"
|
|
108
|
+
}, tooltipProps), {}, {
|
|
109
|
+
children: button
|
|
110
|
+
}));
|
|
117
111
|
};
|
|
118
112
|
|
|
119
113
|
export { CopyToClipboardButton as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyToClipboardButton.js","sources":["../../node_modules/lucide-react/dist/esm/icons/check.js","../../node_modules/lucide-react/dist/esm/icons/copy.js","../../src/v2/components/CopyToClipboardButton/constants.js","../../src/v2/components/CopyToClipboardButton/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\", key: \"17jyea\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\", key: \"zix9uf\" }]\n];\nconst Copy = createLucideIcon(\"copy\", __iconNode);\n\nexport { __iconNode, Copy as default };\n//# sourceMappingURL=copy.js.map\n","const TIME_OUT = 2000;\n\nexport { TIME_OUT };\n","import { useState, useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"CopyToClipboardButton.js","sources":["../../node_modules/lucide-react/dist/esm/icons/check.js","../../node_modules/lucide-react/dist/esm/icons/copy.js","../../src/v2/components/CopyToClipboardButton/constants.js","../../src/v2/components/CopyToClipboardButton/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\", key: \"17jyea\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\", key: \"zix9uf\" }]\n];\nconst Copy = createLucideIcon(\"copy\", __iconNode);\n\nexport { __iconNode, Copy as default };\n//# sourceMappingURL=copy.js.map\n","const TIME_OUT = 2000;\n\nexport { TIME_OUT };\n","import { useState, useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport { Button, Tooltip } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { Copy, Check } from \"lucide-react\";\nimport { copyToClipboard } from \"neetocommons/utils/general\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { TIME_OUT } from \"./constants\";\n\nconst CopyToClipboardButton = ({\n className,\n icon: Icon = Copy,\n label = \"\",\n successLabel,\n tooltipContent,\n successTooltipContent,\n value,\n variant = \"outline\",\n size,\n tooltipProps,\n onClick,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n const [isChecked, setIsChecked] = useState(false);\n\n const ref = useRef();\n const timerRef = useRef();\n\n const resolvedSize = size || (label ? \"default\" : \"icon\");\n\n const onHandleClick = event => {\n event.preventDefault();\n event.stopPropagation();\n\n if (onClick) onClick(event);\n else copyToClipboard(value, { showToastr: false });\n\n clearTimeout(timerRef.current);\n setIsChecked(true);\n timerRef.current = setTimeout(() => {\n setIsChecked(false);\n }, TIME_OUT);\n };\n\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n useLayoutEffect(() => {\n if (!ref.current) return;\n ref.current.style.minWidth = \"\";\n const buttonWidth = ref.current.clientWidth;\n ref.current.style.minWidth = `${buttonWidth}px`;\n }, [resolvedSize, label]);\n\n const currentTooltipContent = isChecked\n ? successTooltipContent || t(\"neetoMolecules.common.copied\")\n : tooltipContent || t(\"neetoMolecules.common.copy\");\n\n const buttonLabel =\n isChecked && label\n ? successLabel || t(\"neetoMolecules.common.copied\")\n : label;\n const ButtonIcon = isChecked ? Check : Icon;\n\n const button = (\n <Button\n {...{ ref }}\n data-testid=\"copy-to-clipboard-button\"\n icon={ButtonIcon}\n iconPosition=\"left\"\n label={buttonLabel || undefined}\n size={resolvedSize}\n variant={isChecked ? \"default\" : variant}\n className={classnames(\n \"neeto-molecules-copy-button\",\n isChecked && \"neeto-molecules-copy-button--active\",\n className\n )}\n onClick={onHandleClick}\n {...otherProps}\n />\n );\n\n if (label) return button;\n\n return (\n <Tooltip content={currentTooltipContent} position=\"top\" {...tooltipProps}>\n {button}\n </Tooltip>\n );\n};\n\nCopyToClipboardButton.propTypes = {\n className: PropTypes.string,\n icon: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.func,\n PropTypes.object,\n ]),\n label: PropTypes.string,\n successLabel: PropTypes.string,\n value: PropTypes.string,\n variant: PropTypes.string,\n size: PropTypes.string,\n tooltipContent: PropTypes.string,\n successTooltipContent: PropTypes.string,\n};\n\nexport default CopyToClipboardButton;\n"],"names":["__iconNode","TIME_OUT","CopyToClipboardButton","_ref","className","_ref$icon","icon","Icon","Copy","_ref$label","label","successLabel","tooltipContent","successTooltipContent","value","_ref$variant","variant","size","tooltipProps","onClick","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","isChecked","setIsChecked","ref","useRef","timerRef","resolvedSize","onHandleClick","event","preventDefault","stopPropagation","copyToClipboard","showToastr","clearTimeout","current","setTimeout","useEffect","useLayoutEffect","style","minWidth","buttonWidth","clientWidth","concat","currentTooltipContent","buttonLabel","ButtonIcon","Check","button","_jsx","Button","_objectSpread","iconPosition","undefined","classnames","Tooltip","content","position","children"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AACtE,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,EAAEA,YAAU,CAAC;;ACVnD;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC1F,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,yDAAyD,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC1F,CAAC;AACD,MAAM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AAIY,CAAC,CAAC,8BAA8B,CAAC,GAC1Db,cAAc,IAAIa,CAAC,CAAC,4BAA4B,CAAC;AAErD,EAAA,IAAM4B,WAAW,GACfvB,SAAS,IAAIpB,KAAK,GACdC,YAAY,IAAIc,CAAC,CAAC,8BAA8B,CAAC,GACjDf,KAAK;AACX,EAAA,IAAM4C,UAAU,GAAGxB,SAAS,GAAGyB,KAAK,GAAGhD,IAAI;AAE3C,EAAA,IAAMiD,MAAM,gBACVC,GAAA,CAACC,MAAM,EAAAC,aAAA,CAAA;AACC3B,IAAAA,GAAG,EAAHA,GAAG;AACT,IAAA,aAAA,EAAY,0BAA0B;AACtC1B,IAAAA,IAAI,EAAEgD,UAAW;AACjBM,IAAAA,YAAY,EAAC,MAAM;IACnBlD,KAAK,EAAE2C,WAAW,IAAIQ,SAAU;AAChC5C,IAAAA,IAAI,EAAEkB,YAAa;AACnBnB,IAAAA,OAAO,EAAEc,SAAS,GAAG,SAAS,GAAGd,OAAQ;IACzCZ,SAAS,EAAE0D,UAAU,CACnB,6BAA6B,EAC7BhC,SAAS,IAAI,qCAAqC,EAClD1B,SACF,CAAE;AACFe,IAAAA,OAAO,EAAEiB;GAAc,EACnBhB,UAAU,CACf,CACF;EAED,IAAIV,KAAK,EAAE,OAAO8C,MAAM;AAExB,EAAA,oBACEC,GAAA,CAACM,OAAO,EAAAJ,aAAA,CAAAA,aAAA,CAAA;AAACK,IAAAA,OAAO,EAAEZ,qBAAsB;AAACa,IAAAA,QAAQ,EAAC;AAAK,GAAA,EAAK/C,YAAY,CAAA,EAAA,EAAA,EAAA;AAAAgD,IAAAA,QAAA,EACrEV;AAAM,GAAA,CACA,CAAC;AAEd;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -4,7 +4,8 @@ import { memo, useState, useRef, useEffect, useMemo, forwardRef, useCallback } f
|
|
|
4
4
|
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
5
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
6
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
|
-
import { Spinner, Input, Dialog,
|
|
7
|
+
import { Spinner, Input, Dialog, Badge, Avatar } from '@bigbinary/neeto-atoms';
|
|
8
|
+
import { Popover, PopoverAnchor, PopoverContent, Separator } from '@bigbinary/neeto-atoms/primitives';
|
|
8
9
|
import { isNotEmpty, isNotPresent, isPresent, truncate, humanize } from '@bigbinary/neeto-cist';
|
|
9
10
|
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
10
11
|
import Profile from '@bigbinary/neeto-team-members-frontend/Profile';
|
|
@@ -490,23 +491,19 @@ var Menu = function Menu(_ref) {
|
|
|
490
491
|
var Modal = function Modal(_ref) {
|
|
491
492
|
var isOpen = _ref.isOpen,
|
|
492
493
|
onClose = _ref.onClose;
|
|
493
|
-
return /*#__PURE__*/
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
className: "
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
"data-testid": "product-switcher-modal",
|
|
507
|
-
children: /*#__PURE__*/jsx(Menu, {})
|
|
508
|
-
})]
|
|
509
|
-
})
|
|
494
|
+
return /*#__PURE__*/jsxs(Dialog, {
|
|
495
|
+
isOpen: isOpen,
|
|
496
|
+
onClose: onClose,
|
|
497
|
+
"aria-describedby": undefined,
|
|
498
|
+
className: "sm:max-w-4xl",
|
|
499
|
+
closeButton: false,
|
|
500
|
+
children: [/*#__PURE__*/jsx(Dialog.Title, {
|
|
501
|
+
className: "sr-only",
|
|
502
|
+
children: "Product Switcher"
|
|
503
|
+
}), /*#__PURE__*/jsx("div", {
|
|
504
|
+
"data-testid": "product-switcher-modal",
|
|
505
|
+
children: /*#__PURE__*/jsx(Menu, {})
|
|
506
|
+
})]
|
|
510
507
|
});
|
|
511
508
|
};
|
|
512
509
|
|
|
@@ -863,11 +860,6 @@ var ProductSwitcher = function ProductSwitcher(_ref) {
|
|
|
863
860
|
|
|
864
861
|
var MENU_ITEM_CLASS = "flex h-9 w-full items-center gap-2 neeto-ui-rounded-md px-2.5 text-sm font-medium hover:bg-accent";
|
|
865
862
|
|
|
866
|
-
var getInitials$1 = function getInitials(name) {
|
|
867
|
-
return (name || "").split(" ").filter(Boolean).map(function (n) {
|
|
868
|
-
return n[0];
|
|
869
|
-
}).join("").toUpperCase().slice(0, 2);
|
|
870
|
-
};
|
|
871
863
|
var ProfileHeader = function ProfileHeader(_ref) {
|
|
872
864
|
var profileInfo = _ref.profileInfo;
|
|
873
865
|
var name = profileInfo.name,
|
|
@@ -876,15 +868,13 @@ var ProfileHeader = function ProfileHeader(_ref) {
|
|
|
876
868
|
return /*#__PURE__*/jsxs("span", {
|
|
877
869
|
className: "flex w-full min-w-0 items-center gap-2 text-start",
|
|
878
870
|
"data-testid": "floating-action-menu-profile-header",
|
|
879
|
-
children: [/*#__PURE__*/
|
|
871
|
+
children: [/*#__PURE__*/jsx(Avatar, {
|
|
880
872
|
className: "size-8 shrink-0",
|
|
881
873
|
"data-testid": "floating-action-menu-header-profile-icon",
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
886
|
-
children: getInitials$1(name)
|
|
887
|
-
})]
|
|
874
|
+
user: {
|
|
875
|
+
name: name,
|
|
876
|
+
imageUrl: imageUrl
|
|
877
|
+
}
|
|
888
878
|
}), /*#__PURE__*/jsxs("span", {
|
|
889
879
|
className: "flex min-w-0 flex-grow flex-col gap-1",
|
|
890
880
|
children: [/*#__PURE__*/jsx("span", {
|
|
@@ -1319,11 +1309,6 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
1319
1309
|
|
|
1320
1310
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1321
1311
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1322
|
-
var getInitials = function getInitials(name) {
|
|
1323
|
-
return (name || "").split(" ").filter(Boolean).map(function (n) {
|
|
1324
|
-
return n[0];
|
|
1325
|
-
}).join("").toUpperCase().slice(0, 2);
|
|
1326
|
-
};
|
|
1327
1312
|
var ProfileButton = function ProfileButton(_ref) {
|
|
1328
1313
|
var profileInfoOverrides = _ref.profileInfoOverrides,
|
|
1329
1314
|
showProductSwitcher = _ref.showProductSwitcher,
|
|
@@ -1417,16 +1402,13 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
1417
1402
|
type: "button",
|
|
1418
1403
|
onMouseEnter: handleMouseEnter,
|
|
1419
1404
|
onMouseLeave: handleMouseLeave,
|
|
1420
|
-
children: [/*#__PURE__*/
|
|
1405
|
+
children: [/*#__PURE__*/jsx(Avatar, {
|
|
1421
1406
|
className: "size-[1.625rem] shrink-0 rounded-full border-2 border-white",
|
|
1422
1407
|
"data-testid": "profile-avatar",
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
}
|
|
1427
|
-
className: "text-[10px]",
|
|
1428
|
-
children: getInitials(profileInfo.name)
|
|
1429
|
-
})]
|
|
1408
|
+
user: {
|
|
1409
|
+
name: profileInfo.name,
|
|
1410
|
+
imageUrl: profileInfo.imageUrl
|
|
1411
|
+
}
|
|
1430
1412
|
}), /*#__PURE__*/jsx("span", {
|
|
1431
1413
|
className: "flex size-[1.625rem] items-center justify-center rounded-full bg-white",
|
|
1432
1414
|
children: /*#__PURE__*/jsx(CircleQuestionMark, {
|