@servicetitan/navigation 13.3.0 → 13.3.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.
|
@@ -204,7 +204,7 @@ function DesktopProfileDropdownComponent({ anvil1, ...props }) {
|
|
|
204
204
|
});
|
|
205
205
|
const hintPopover = (hintPopup === null || hintPopup === void 0 ? void 0 : hintPopup.content) && !open ? /*#__PURE__*/ _jsx(PopoverAnvil1, {
|
|
206
206
|
direction: "bl",
|
|
207
|
-
width: "
|
|
207
|
+
width: "auto",
|
|
208
208
|
trigger: triggerElement,
|
|
209
209
|
popoverContentClassName: Styles.hint1,
|
|
210
210
|
onClickOutside: hintPopup === null || hintPopup === void 0 ? void 0 : hintPopup.onClose,
|
|
@@ -224,7 +224,7 @@ function DesktopProfileDropdownComponent({ anvil1, ...props }) {
|
|
|
224
224
|
...rest,
|
|
225
225
|
children: hintPopover !== null && hintPopover !== void 0 ? hintPopover : /*#__PURE__*/ _jsx(PopoverAnvil1, {
|
|
226
226
|
direction: "bl",
|
|
227
|
-
width: "
|
|
227
|
+
width: "s",
|
|
228
228
|
trigger: triggerElement,
|
|
229
229
|
open: open,
|
|
230
230
|
portal: portal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/profile-dropdown/profile-dropdown.tsx"],"sourcesContent":["import { Divider, Icon, Popover, Text } from '@servicetitan/anvil2';\nimport SvgExpandLess from '@servicetitan/anvil2/assets/icons/material/round/expand_less.svg';\nimport SvgExpandMore from '@servicetitan/anvil2/assets/icons/material/round/expand_more.svg';\nimport SvgAccountActive from '@servicetitan/anvil2/assets/icons/st/gnav_account_active.svg';\nimport SvgAccountInactive from '@servicetitan/anvil2/assets/icons/st/gnav_account_inactive.svg';\nimport { Popover as PopoverAnvil1 } from '@servicetitan/design-system';\nimport { tokens } from '@servicetitan/tokens/core';\nimport classNames from 'classnames';\nimport {\n ComponentPropsWithoutRef,\n FC,\n MouseEvent,\n MouseEventHandler,\n createElement,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { CounterTagData, CounterTagValue } from '../../utils/counter-tag';\nimport { getCounterTag } from '../../utils/side-nav';\nimport { CounterTag } from '../counter-tag';\nimport { useTitanLayoutContext } from '../titan-layout';\nimport { withTooltip } from '../titan-layout/with-tooltip';\nimport {\n ProfileDropdownLinkProps,\n ProfileDropdownProps,\n ProfileDropdownSectionProps,\n ProfileDropdownTriggerProps,\n} from './interface';\nimport * as Styles from './profile-dropdown.module.less';\n\nconst ProfileDropdownTrigger = forwardRef<\n HTMLDivElement,\n ProfileDropdownTriggerProps & {\n hintArrow?: boolean;\n open: boolean;\n onClick: ComponentPropsWithoutRef<'div'>['onClick'];\n }\n>(({ info, imageSrc, avatarBadge, badge, className, hintArrow, open, onClick, ...rest }, ref) => {\n const [avatarSource, setAvatarSource] = useState(imageSrc ?? '');\n const [avatarSourceError, setAvatarSourceError] = useState(false);\n\n useEffect(() => {\n const src = imageSrc ?? '';\n\n if (src === avatarSource) {\n return;\n }\n\n setAvatarSource(src);\n setAvatarSourceError(false);\n }, [imageSrc, avatarSource]);\n\n const onAvatarError = useCallback(() => {\n setAvatarSourceError(true);\n }, []);\n\n return (\n <div\n data-cy=\"profile-dropdown-trigger\"\n data-pendo=\"profile-dropdown-trigger\"\n tabIndex={0}\n {...rest}\n className={classNames('profile-dropdown-trigger', Styles.triggerContainer, className)}\n onClick={onClick}\n ref={ref}\n >\n {avatarSource && !avatarSourceError ? (\n <img\n src={avatarSource}\n className={classNames(Styles.profileImage, 'profile-dropdown-image')}\n onError={onAvatarError}\n alt=\"user dropdown menu\"\n />\n ) : (\n <Icon\n className={Styles.profileIcon}\n size=\"large\"\n svg={open ? SvgAccountActive : SvgAccountInactive}\n />\n )}\n\n {!!info && (\n <div className={Styles.info}>\n <Text title={info.title} className={Styles.infoTitle} size=\"small\">\n {info.title}\n </Text>\n <Text title={info.text} className={Styles.infoText} size=\"small\" subdued>\n {info.text}\n </Text>\n </div>\n )}\n\n <Icon\n svg={open ? SvgExpandLess : SvgExpandMore}\n className={Styles.expandIcon}\n size=\"small\"\n />\n\n {!!avatarBadge && (\n <div\n className={Styles.avatarBadge}\n style={{\n backgroundColor: avatarBadge === true ? tokens.colorBlue500 : avatarBadge,\n }}\n />\n )}\n {!!badge && (\n <span\n className={classNames(\n Styles.badge,\n badge.content ? Styles.badgeWithContent : Styles.badgeNoContent\n )}\n style={{ backgroundColor: badge.color }}\n >\n {badge.content}\n </span>\n )}\n </div>\n );\n});\n\nconst useTag = (counter?: CounterTagValue, tag?: CounterTagData) =>\n useMemo(() => {\n const data = getCounterTag(counter, tag);\n\n return data ? (\n <div className={Styles.counterWrapper}>\n <CounterTag className={Styles.counter} data={data} />\n </div>\n ) : undefined;\n }, [counter, tag]);\n\nfunction DesktopProfileDropdownSection({\n children,\n className,\n counter,\n id,\n tag,\n text,\n tooltip,\n onClick,\n ...rest\n}: ProfileDropdownSectionProps) {\n const clickHandler: MouseEventHandler<never> = e => {\n if (onClick) {\n onClick(e);\n } else {\n e.stopPropagation();\n }\n };\n\n const tagElement = useTag(counter, tag);\n\n return withTooltip(\n <div\n className={classNames(\n Styles.dropdownSection,\n tagElement && Styles.dropdownSectionWithCounter,\n !!onClick && Styles.dropdownLink,\n className\n )}\n onClick={clickHandler}\n data-cy={`profile-dropdown-section-${id}`}\n data-pendo={`profile-dropdown-section-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </div>,\n tooltip,\n { placement: 'left' }\n );\n}\n\nconst DesktopProfileDropdownDivider: FC = Divider;\n\nfunction DesktopProfileDropdownLink({\n children,\n className,\n external,\n id,\n counter,\n tag,\n target,\n text,\n to,\n tooltip,\n onClick,\n ...rest\n}: ProfileDropdownLinkProps) {\n const { NavigationComponent } = useTitanLayoutContext();\n\n const isExternalLink = external ?? to?.startsWith('http');\n\n const tagElement = useTag(counter, tag);\n\n return withTooltip(\n isExternalLink ? (\n <a\n className={classNames(\n Styles.dropdownSection,\n tagElement && Styles.dropdownSectionWithCounter,\n Styles.dropdownLink,\n className\n )}\n href={to}\n target={target}\n data-cy={`profile-dropdown-link-${id}`}\n data-pendo={`profile-dropdown-link-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </a>\n ) : (\n <NavigationComponent\n className={classNames(\n Styles.dropdownSection,\n Styles.dropdownLink,\n { [Styles.dropdownSectionWithCounter]: !!tagElement },\n className\n )}\n target={target}\n to={to}\n data-cy={`profile-dropdown-link-${id}`}\n data-pendo={`profile-dropdown-link-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </NavigationComponent>\n ),\n tooltip,\n { placement: 'left' }\n );\n}\n\nfunction DesktopProfileDropdownComponent({ anvil1, ...props }: ProfileDropdownProps) {\n return anvil1 ? (\n <DesktopProfileDropdownComponentAnvil1 {...props} />\n ) : (\n <DesktopProfileDropdownComponentAnvil2 {...props} />\n );\n}\n\n/**\n * A2 profile dropdown popover sometimes rendered incorrectly in top left corner. It is seen on cypress test failed builds.\n * it needs to be investigated, but for now keeping an option for A1 popover\n */\nfunction DesktopProfileDropdownComponentAnvil1({\n children,\n\n trigger,\n hintPopup,\n portal,\n onClose,\n onOpen,\n\n ...rest\n}: ProfileDropdownProps) {\n const [open, setOpen] = useState(false);\n const handleClose = useCallback(() => {\n setOpen(false);\n onClose?.();\n }, [onClose]);\n const handleOpen = useCallback(() => {\n setOpen(true);\n onOpen?.();\n }, [onOpen]);\n const onTriggerClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n setOpen(!open);\n\n if (open) {\n onClose?.();\n } else {\n onOpen?.();\n }\n },\n [open, onOpen, onClose]\n );\n const hintShown = !!hintPopup && !open;\n\n const triggerElement = (\n <ProfileDropdownTrigger\n {...trigger}\n onClick={children ? onTriggerClick : undefined}\n hintArrow={hintShown}\n open={open}\n />\n );\n\n const hintPopover =\n hintPopup?.content && !open ? (\n <PopoverAnvil1\n direction=\"bl\"\n width=\"xs\"\n trigger={triggerElement}\n popoverContentClassName={Styles.hint1}\n onClickOutside={hintPopup?.onClose}\n open\n >\n <div\n className={classNames(Styles.hintContent1)}\n style={{ '--hint-background': hintPopup.bgColor ?? '#fff' } as any}\n >\n {createElement(hintPopup.content, { openProfile: handleOpen })}\n </div>\n </PopoverAnvil1>\n ) : null;\n\n return (\n <div data-cy=\"profile-dropdown\" {...rest}>\n {hintPopover ?? (\n <PopoverAnvil1\n direction=\"bl\"\n width=\"xs\"\n trigger={triggerElement}\n open={open}\n portal={portal}\n onClickOutside={handleClose}\n popoverContentClassName={classNames(Styles.dropdown1)}\n >\n <div\n className={Styles.dropdownContent}\n onClick={handleClose}\n data-cy=\"profile-dropdown-content\"\n >\n {children}\n </div>\n </PopoverAnvil1>\n )}\n </div>\n );\n}\n\nfunction DesktopProfileDropdownComponentAnvil2({\n children,\n\n trigger,\n hintPopup,\n portal,\n onClose,\n onOpen,\n\n ...rest\n}: ProfileDropdownProps) {\n const [open, setOpen] = useState(false);\n const handleClose = useCallback(() => {\n setOpen(false);\n onClose?.();\n }, [onClose]);\n const handleOpen = useCallback(() => {\n setOpen(true);\n onOpen?.();\n }, [onOpen]);\n const onTriggerClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n setOpen(!open);\n\n if (open) {\n onClose?.();\n } else {\n onOpen?.();\n }\n },\n [open, onOpen, onClose]\n );\n\n const triggerElement = (props: any) => (\n <ProfileDropdownTrigger\n {...trigger}\n {...props}\n open={open}\n onClick={children ? onTriggerClick : undefined}\n />\n );\n\n const hintPopover =\n hintPopup?.content && !open ? (\n <Popover placement=\"bottom-start\" onClickOutside={hintPopup?.onClose} noPadding open>\n <Popover.Trigger>{triggerElement}</Popover.Trigger>\n <Popover.Content\n className={Styles.hint2}\n style={{ '--hint-background': hintPopup.bgColor ?? '#fff' } as any}\n >\n <div className={classNames(Styles.hintContent2)}>\n {createElement(hintPopup.content, { openProfile: handleOpen })}\n </div>\n </Popover.Content>\n </Popover>\n ) : null;\n\n return (\n <div data-cy=\"profile-dropdown\" {...rest}>\n {hintPopover ?? (\n <Popover\n placement=\"bottom-start\"\n open={open}\n onClickOutside={handleClose}\n noPadding\n >\n <Popover.Trigger>{triggerElement}</Popover.Trigger>\n <Popover.Content className={Styles.dropdown2}>\n <div\n onClick={handleClose}\n data-cy=\"profile-dropdown-content\"\n className={Styles.dropdownContent}\n >\n {children}\n </div>\n </Popover.Content>\n </Popover>\n )}\n </div>\n );\n}\n\nexport const DesktopProfileDropdown = Object.assign(DesktopProfileDropdownComponent, {\n Divider: DesktopProfileDropdownDivider,\n Link: DesktopProfileDropdownLink,\n Section: DesktopProfileDropdownSection,\n});\n"],"names":["Divider","Icon","Popover","Text","SvgExpandLess","SvgExpandMore","SvgAccountActive","SvgAccountInactive","PopoverAnvil1","tokens","classNames","createElement","forwardRef","useCallback","useEffect","useMemo","useState","getCounterTag","CounterTag","useTitanLayoutContext","withTooltip","Styles","ProfileDropdownTrigger","info","imageSrc","avatarBadge","badge","className","hintArrow","open","onClick","rest","ref","avatarSource","setAvatarSource","avatarSourceError","setAvatarSourceError","src","onAvatarError","div","data-cy","data-pendo","tabIndex","triggerContainer","img","profileImage","onError","alt","profileIcon","size","svg","title","infoTitle","text","infoText","subdued","expandIcon","style","backgroundColor","colorBlue500","span","content","badgeWithContent","badgeNoContent","color","useTag","counter","tag","data","counterWrapper","undefined","DesktopProfileDropdownSection","children","id","tooltip","clickHandler","e","stopPropagation","tagElement","dropdownSection","dropdownSectionWithCounter","dropdownLink","placement","DesktopProfileDropdownDivider","DesktopProfileDropdownLink","external","target","to","NavigationComponent","isExternalLink","startsWith","a","href","DesktopProfileDropdownComponent","anvil1","props","DesktopProfileDropdownComponentAnvil1","DesktopProfileDropdownComponentAnvil2","trigger","hintPopup","portal","onClose","onOpen","setOpen","handleClose","handleOpen","onTriggerClick","hintShown","triggerElement","hintPopover","direction","width","popoverContentClassName","hint1","onClickOutside","hintContent1","bgColor","openProfile","dropdown1","dropdownContent","noPadding","Trigger","Content","hint2","hint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AAO7B;AAEA,OAAO,MAAMsD,yBAAyBC,OAAOC,MAAM,CAACnC,iCAAiC;IACjF7F,SAASmF;IACT8C,MAAM7C;IACN8C,SAAS3D;AACb,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/profile-dropdown/profile-dropdown.tsx"],"sourcesContent":["import { Divider, Icon, Popover, Text } from '@servicetitan/anvil2';\nimport SvgExpandLess from '@servicetitan/anvil2/assets/icons/material/round/expand_less.svg';\nimport SvgExpandMore from '@servicetitan/anvil2/assets/icons/material/round/expand_more.svg';\nimport SvgAccountActive from '@servicetitan/anvil2/assets/icons/st/gnav_account_active.svg';\nimport SvgAccountInactive from '@servicetitan/anvil2/assets/icons/st/gnav_account_inactive.svg';\nimport { Popover as PopoverAnvil1 } from '@servicetitan/design-system';\nimport { tokens } from '@servicetitan/tokens/core';\nimport classNames from 'classnames';\nimport {\n ComponentPropsWithoutRef,\n FC,\n MouseEvent,\n MouseEventHandler,\n createElement,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { CounterTagData, CounterTagValue } from '../../utils/counter-tag';\nimport { getCounterTag } from '../../utils/side-nav';\nimport { CounterTag } from '../counter-tag';\nimport { useTitanLayoutContext } from '../titan-layout';\nimport { withTooltip } from '../titan-layout/with-tooltip';\nimport {\n ProfileDropdownLinkProps,\n ProfileDropdownProps,\n ProfileDropdownSectionProps,\n ProfileDropdownTriggerProps,\n} from './interface';\nimport * as Styles from './profile-dropdown.module.less';\n\nconst ProfileDropdownTrigger = forwardRef<\n HTMLDivElement,\n ProfileDropdownTriggerProps & {\n hintArrow?: boolean;\n open: boolean;\n onClick: ComponentPropsWithoutRef<'div'>['onClick'];\n }\n>(({ info, imageSrc, avatarBadge, badge, className, hintArrow, open, onClick, ...rest }, ref) => {\n const [avatarSource, setAvatarSource] = useState(imageSrc ?? '');\n const [avatarSourceError, setAvatarSourceError] = useState(false);\n\n useEffect(() => {\n const src = imageSrc ?? '';\n\n if (src === avatarSource) {\n return;\n }\n\n setAvatarSource(src);\n setAvatarSourceError(false);\n }, [imageSrc, avatarSource]);\n\n const onAvatarError = useCallback(() => {\n setAvatarSourceError(true);\n }, []);\n\n return (\n <div\n data-cy=\"profile-dropdown-trigger\"\n data-pendo=\"profile-dropdown-trigger\"\n tabIndex={0}\n {...rest}\n className={classNames('profile-dropdown-trigger', Styles.triggerContainer, className)}\n onClick={onClick}\n ref={ref}\n >\n {avatarSource && !avatarSourceError ? (\n <img\n src={avatarSource}\n className={classNames(Styles.profileImage, 'profile-dropdown-image')}\n onError={onAvatarError}\n alt=\"user dropdown menu\"\n />\n ) : (\n <Icon\n className={Styles.profileIcon}\n size=\"large\"\n svg={open ? SvgAccountActive : SvgAccountInactive}\n />\n )}\n\n {!!info && (\n <div className={Styles.info}>\n <Text title={info.title} className={Styles.infoTitle} size=\"small\">\n {info.title}\n </Text>\n <Text title={info.text} className={Styles.infoText} size=\"small\" subdued>\n {info.text}\n </Text>\n </div>\n )}\n\n <Icon\n svg={open ? SvgExpandLess : SvgExpandMore}\n className={Styles.expandIcon}\n size=\"small\"\n />\n\n {!!avatarBadge && (\n <div\n className={Styles.avatarBadge}\n style={{\n backgroundColor: avatarBadge === true ? tokens.colorBlue500 : avatarBadge,\n }}\n />\n )}\n {!!badge && (\n <span\n className={classNames(\n Styles.badge,\n badge.content ? Styles.badgeWithContent : Styles.badgeNoContent\n )}\n style={{ backgroundColor: badge.color }}\n >\n {badge.content}\n </span>\n )}\n </div>\n );\n});\n\nconst useTag = (counter?: CounterTagValue, tag?: CounterTagData) =>\n useMemo(() => {\n const data = getCounterTag(counter, tag);\n\n return data ? (\n <div className={Styles.counterWrapper}>\n <CounterTag className={Styles.counter} data={data} />\n </div>\n ) : undefined;\n }, [counter, tag]);\n\nfunction DesktopProfileDropdownSection({\n children,\n className,\n counter,\n id,\n tag,\n text,\n tooltip,\n onClick,\n ...rest\n}: ProfileDropdownSectionProps) {\n const clickHandler: MouseEventHandler<never> = e => {\n if (onClick) {\n onClick(e);\n } else {\n e.stopPropagation();\n }\n };\n\n const tagElement = useTag(counter, tag);\n\n return withTooltip(\n <div\n className={classNames(\n Styles.dropdownSection,\n tagElement && Styles.dropdownSectionWithCounter,\n !!onClick && Styles.dropdownLink,\n className\n )}\n onClick={clickHandler}\n data-cy={`profile-dropdown-section-${id}`}\n data-pendo={`profile-dropdown-section-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </div>,\n tooltip,\n { placement: 'left' }\n );\n}\n\nconst DesktopProfileDropdownDivider: FC = Divider;\n\nfunction DesktopProfileDropdownLink({\n children,\n className,\n external,\n id,\n counter,\n tag,\n target,\n text,\n to,\n tooltip,\n onClick,\n ...rest\n}: ProfileDropdownLinkProps) {\n const { NavigationComponent } = useTitanLayoutContext();\n\n const isExternalLink = external ?? to?.startsWith('http');\n\n const tagElement = useTag(counter, tag);\n\n return withTooltip(\n isExternalLink ? (\n <a\n className={classNames(\n Styles.dropdownSection,\n tagElement && Styles.dropdownSectionWithCounter,\n Styles.dropdownLink,\n className\n )}\n href={to}\n target={target}\n data-cy={`profile-dropdown-link-${id}`}\n data-pendo={`profile-dropdown-link-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </a>\n ) : (\n <NavigationComponent\n className={classNames(\n Styles.dropdownSection,\n Styles.dropdownLink,\n { [Styles.dropdownSectionWithCounter]: !!tagElement },\n className\n )}\n target={target}\n to={to}\n data-cy={`profile-dropdown-link-${id}`}\n data-pendo={`profile-dropdown-link-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </NavigationComponent>\n ),\n tooltip,\n { placement: 'left' }\n );\n}\n\nfunction DesktopProfileDropdownComponent({ anvil1, ...props }: ProfileDropdownProps) {\n return anvil1 ? (\n <DesktopProfileDropdownComponentAnvil1 {...props} />\n ) : (\n <DesktopProfileDropdownComponentAnvil2 {...props} />\n );\n}\n\n/**\n * A2 profile dropdown popover sometimes rendered incorrectly in top left corner. It is seen on cypress test failed builds.\n * it needs to be investigated, but for now keeping an option for A1 popover\n */\nfunction DesktopProfileDropdownComponentAnvil1({\n children,\n\n trigger,\n hintPopup,\n portal,\n onClose,\n onOpen,\n\n ...rest\n}: ProfileDropdownProps) {\n const [open, setOpen] = useState(false);\n const handleClose = useCallback(() => {\n setOpen(false);\n onClose?.();\n }, [onClose]);\n const handleOpen = useCallback(() => {\n setOpen(true);\n onOpen?.();\n }, [onOpen]);\n const onTriggerClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n setOpen(!open);\n\n if (open) {\n onClose?.();\n } else {\n onOpen?.();\n }\n },\n [open, onOpen, onClose]\n );\n const hintShown = !!hintPopup && !open;\n\n const triggerElement = (\n <ProfileDropdownTrigger\n {...trigger}\n onClick={children ? onTriggerClick : undefined}\n hintArrow={hintShown}\n open={open}\n />\n );\n\n const hintPopover =\n hintPopup?.content && !open ? (\n <PopoverAnvil1\n direction=\"bl\"\n width=\"auto\"\n trigger={triggerElement}\n popoverContentClassName={Styles.hint1}\n onClickOutside={hintPopup?.onClose}\n open\n >\n <div\n className={classNames(Styles.hintContent1)}\n style={{ '--hint-background': hintPopup.bgColor ?? '#fff' } as any}\n >\n {createElement(hintPopup.content, { openProfile: handleOpen })}\n </div>\n </PopoverAnvil1>\n ) : null;\n\n return (\n <div data-cy=\"profile-dropdown\" {...rest}>\n {hintPopover ?? (\n <PopoverAnvil1\n direction=\"bl\"\n width=\"s\"\n trigger={triggerElement}\n open={open}\n portal={portal}\n onClickOutside={handleClose}\n popoverContentClassName={classNames(Styles.dropdown1)}\n >\n <div\n className={Styles.dropdownContent}\n onClick={handleClose}\n data-cy=\"profile-dropdown-content\"\n >\n {children}\n </div>\n </PopoverAnvil1>\n )}\n </div>\n );\n}\n\nfunction DesktopProfileDropdownComponentAnvil2({\n children,\n\n trigger,\n hintPopup,\n portal,\n onClose,\n onOpen,\n\n ...rest\n}: ProfileDropdownProps) {\n const [open, setOpen] = useState(false);\n const handleClose = useCallback(() => {\n setOpen(false);\n onClose?.();\n }, [onClose]);\n const handleOpen = useCallback(() => {\n setOpen(true);\n onOpen?.();\n }, [onOpen]);\n const onTriggerClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n setOpen(!open);\n\n if (open) {\n onClose?.();\n } else {\n onOpen?.();\n }\n },\n [open, onOpen, onClose]\n );\n\n const triggerElement = (props: any) => (\n <ProfileDropdownTrigger\n {...trigger}\n {...props}\n open={open}\n onClick={children ? onTriggerClick : undefined}\n />\n );\n\n const hintPopover =\n hintPopup?.content && !open ? (\n <Popover placement=\"bottom-start\" onClickOutside={hintPopup?.onClose} noPadding open>\n <Popover.Trigger>{triggerElement}</Popover.Trigger>\n <Popover.Content\n className={Styles.hint2}\n style={{ '--hint-background': hintPopup.bgColor ?? '#fff' } as any}\n >\n <div className={classNames(Styles.hintContent2)}>\n {createElement(hintPopup.content, { openProfile: handleOpen })}\n </div>\n </Popover.Content>\n </Popover>\n ) : null;\n\n return (\n <div data-cy=\"profile-dropdown\" {...rest}>\n {hintPopover ?? (\n <Popover\n placement=\"bottom-start\"\n open={open}\n onClickOutside={handleClose}\n noPadding\n >\n <Popover.Trigger>{triggerElement}</Popover.Trigger>\n <Popover.Content className={Styles.dropdown2}>\n <div\n onClick={handleClose}\n data-cy=\"profile-dropdown-content\"\n className={Styles.dropdownContent}\n >\n {children}\n </div>\n </Popover.Content>\n </Popover>\n )}\n </div>\n );\n}\n\nexport const DesktopProfileDropdown = Object.assign(DesktopProfileDropdownComponent, {\n Divider: DesktopProfileDropdownDivider,\n Link: DesktopProfileDropdownLink,\n Section: DesktopProfileDropdownSection,\n});\n"],"names":["Divider","Icon","Popover","Text","SvgExpandLess","SvgExpandMore","SvgAccountActive","SvgAccountInactive","PopoverAnvil1","tokens","classNames","createElement","forwardRef","useCallback","useEffect","useMemo","useState","getCounterTag","CounterTag","useTitanLayoutContext","withTooltip","Styles","ProfileDropdownTrigger","info","imageSrc","avatarBadge","badge","className","hintArrow","open","onClick","rest","ref","avatarSource","setAvatarSource","avatarSourceError","setAvatarSourceError","src","onAvatarError","div","data-cy","data-pendo","tabIndex","triggerContainer","img","profileImage","onError","alt","profileIcon","size","svg","title","infoTitle","text","infoText","subdued","expandIcon","style","backgroundColor","colorBlue500","span","content","badgeWithContent","badgeNoContent","color","useTag","counter","tag","data","counterWrapper","undefined","DesktopProfileDropdownSection","children","id","tooltip","clickHandler","e","stopPropagation","tagElement","dropdownSection","dropdownSectionWithCounter","dropdownLink","placement","DesktopProfileDropdownDivider","DesktopProfileDropdownLink","external","target","to","NavigationComponent","isExternalLink","startsWith","a","href","DesktopProfileDropdownComponent","anvil1","props","DesktopProfileDropdownComponentAnvil1","DesktopProfileDropdownComponentAnvil2","trigger","hintPopup","portal","onClose","onOpen","setOpen","handleClose","handleOpen","onTriggerClick","hintShown","triggerElement","hintPopover","direction","width","popoverContentClassName","hint1","onClickOutside","hintContent1","bgColor","openProfile","dropdown1","dropdownContent","noPadding","Trigger","Content","hint2","hintContent2","dropdown2","DesktopProfileDropdown","Object","assign","Link","Section"],"mappings":";AAAA,SAASA,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,IAAI,QAAQ,uBAAuB;AACpE,OAAOC,mBAAmB,mEAAmE;AAC7F,OAAOC,mBAAmB,mEAAmE;AAC7F,OAAOC,sBAAsB,+DAA+D;AAC5F,OAAOC,wBAAwB,iEAAiE;AAChG,SAASL,WAAWM,aAAa,QAAQ,8BAA8B;AACvE,SAASC,MAAM,QAAQ,4BAA4B;AACnD,OAAOC,gBAAgB,aAAa;AACpC,SAKIC,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACL,QAAQ;AAGf,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,WAAW,QAAQ,+BAA+B;AAO3D,YAAYC,YAAY,iCAAiC;AAEzD,MAAMC,uCAAyBV,WAO7B,CAAC,EA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lE,OAAO;oBAAE,mBAAmB,GAAE0C,qBAAAA,UAAUiB,OAAO,cAAjBjB,gCAAAA,qBAAqB;gBAAO;0BAE1D,cAAA,KAAC5D;oBAAIZ,WAAWjB,WAAWW,OAAOuG,YAAY;8BACzCjH,cAAAA,cAAcwF,UAAUtC,OAAO,EAAE;wBAAEwD,aAAaZ;oBAAW;;;;SAIxE;IAER,qBACI,KAAClE;QAAIC,WAAQ;QAAoB,GAAGT,IAAI;kBACnC8E,wBAAAA,yBAAAA,4BACG,MAAC3G;YACGgF,WAAU;YACVrD,MAAMA;YACNqF,gBAAgBV;YAChBgB,SAAS;;8BAET,KAACtH,QAAQuH,OAAO;8BAAEb;;8BAClB,KAAC1G,QAAQwH,OAAO;oBAAC/F,WAAWN,OAAOwG,SAAS;8BACxC,cAAA,KAACtF;wBACGT,SAAS0E;wBACThE,WAAQ;wBACRb,WAAWN,OAAOkG,eAAe;kCAEhC/C;;;;;;AAO7B;AAEA,OAAO,MAAMsD,yBAAyBC,OAAOC,MAAM,CAACnC,iCAAiC;IACjF7F,SAASmF;IACT8C,MAAM7C;IACN8C,SAAS3D;AACb,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/navigation",
|
|
3
|
-
"version": "13.3.
|
|
3
|
+
"version": "13.3.1",
|
|
4
4
|
"description": "Navigation components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"less": true,
|
|
36
36
|
"webpack": false
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "8cc3007728c77ed381924cb3b2619783fb2c2916"
|
|
39
39
|
}
|
|
@@ -299,7 +299,7 @@ function DesktopProfileDropdownComponentAnvil1({
|
|
|
299
299
|
hintPopup?.content && !open ? (
|
|
300
300
|
<PopoverAnvil1
|
|
301
301
|
direction="bl"
|
|
302
|
-
width="
|
|
302
|
+
width="auto"
|
|
303
303
|
trigger={triggerElement}
|
|
304
304
|
popoverContentClassName={Styles.hint1}
|
|
305
305
|
onClickOutside={hintPopup?.onClose}
|
|
@@ -319,7 +319,7 @@ function DesktopProfileDropdownComponentAnvil1({
|
|
|
319
319
|
{hintPopover ?? (
|
|
320
320
|
<PopoverAnvil1
|
|
321
321
|
direction="bl"
|
|
322
|
-
width="
|
|
322
|
+
width="s"
|
|
323
323
|
trigger={triggerElement}
|
|
324
324
|
open={open}
|
|
325
325
|
portal={portal}
|