@pega/cosmos-react-core 9.0.0-build.9.5 → 9.0.0-build.9.6

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.
@@ -66,7 +66,7 @@ const InfoDialog = forwardRef(function InfoDialog({ target, heading: headingProp
66
66
  }, label: t('close'), ref: closeButtonRef, children: _jsx(Icon, { name: 'times' }) }));
67
67
  return (_jsxs(StyledInfoDialog, { ...restProps, ...(typeof headingProp === 'string'
68
68
  ? { 'aria-labelledby': headingId }
69
- : { 'aria-label': headingProp?.primary }), arrow: true, target: target, progress: progressProp, ref: dialogRef, children: [headingProp && heading && (_jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2, gap: 1 }, item: { shrink: 0 }, as: StyledDialogHeader, children: [typeof headingProp === 'string' ? (heading) : (_jsx(SummaryItem, { primary: heading, secondary: headingProp.secondary ? (_jsx(Text, { variant: 'secondary', children: headingProp.secondary })) : undefined, visual: headingProp.visual })), dismissButton] })), (!headingProp || children || progressProp) && (_jsxs(Flex, { container: { direction: 'column' }, item: { grow: 1 }, as: StyledDialogContent, ref: dialogContentRef, children: [!headingProp && dismissButton, children && (_jsx(StyledChildrenWrap, { inert: progressProp ? '' : undefined, children: children })), progress] }))] }));
69
+ : { 'aria-label': headingProp?.primary }), arrow: true, target: target, progress: progressProp, ref: dialogRef, children: [headingProp && heading && (_jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: [1, 2], gap: 1 }, item: { shrink: 0 }, as: StyledDialogHeader, children: [typeof headingProp === 'string' ? (heading) : (_jsx(SummaryItem, { primary: heading, secondary: headingProp.secondary ? (_jsx(Text, { variant: 'secondary', children: headingProp.secondary })) : undefined, visual: headingProp.visual })), dismissButton] })), (!headingProp || children || progressProp) && (_jsxs(Flex, { container: { direction: 'column' }, item: { grow: 1 }, as: StyledDialogContent, ref: dialogContentRef, children: [!headingProp && dismissButton, children && (_jsx(StyledChildrenWrap, { inert: progressProp ? '' : undefined, children: children })), progress] }))] }));
70
70
  });
71
71
  export default InfoDialog;
72
72
  //# sourceMappingURL=InfoDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfoDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE9F,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CACjB,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,EAC3F,GAAG;IAEH,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,gBAAgB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACtD,MAAM,cAAc,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEvD,MAAM,QAAQ,GAAG,GAAG,EAAE;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ACd,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,SAAS,aAEb,WAAW,IAAI,OAAO,IAAI,CACzB,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EACvE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EACnB,EAAE,EAAE,kBAAkB,aAErB,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,CACjC,OAAO,CACR,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EACP,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CACtB,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,YAAE,WAAW,CAAC,SAAS,GAAQ,CACzD,CAAC,CAAC,CAAC,SAAS,EAEf,MAAM,EAAE,WAAW,CAAC,MAAM,GAC1B,CACH,EACA,aAAa,IACT,CACR,EAEA,CAAC,CAAC,WAAW,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI,CAC7C,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,EAAE,EAAE,mBAAmB,EACvB,GAAG,EAAE,gBAAgB,aAEpB,CAAC,WAAW,IAAI,aAAa,EAC7B,QAAQ,IAAI,CACX,KAAC,kBAAkB,IAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YACrD,QAAQ,GACU,CACtB,EACA,QAAQ,IACJ,CACR,IACgB,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useLayoutEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport { useConsolidatedRef, useEscape, useI18n, useOuterEvent, useUID } from '../../hooks';\nimport Text from '../Text';\nimport Icon from '../Icon';\nimport Progress from '../Progress';\nimport Flex from '../Flex';\nimport SummaryItem from '../SummaryItem';\nimport { getActiveElement, getFocusables } from '../../utils';\nimport type { RefElement } from '../../types';\n\nimport { StyledChildrenWrap, StyledDialogContent, StyledDialogHeader } from './Dialog.styles';\nimport type { InfoDialogProps } from './Dialog.types';\nimport { StyledDismissButton, StyledInfoDialog } from './InfoDialog.styles';\n\nconst InfoDialog = forwardRef<RefElement<InfoDialogProps>, PropsWithoutRef<InfoDialogProps>>(\n function InfoDialog(\n { target, heading: headingProp, children, progress: progressProp, onDismiss, ...restProps },\n ref\n ) {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n\n const setFocus = () => {\n if (progressProp) return;\n\n const focusables = getFocusables(dialogRef);\n\n const focusable =\n focusables.find(el => {\n return dialogContentRef.current?.contains(el);\n }) ??\n closeButtonRef.current ??\n focusables[0];\n\n focusable?.focus();\n };\n\n useEscape(\n e => {\n onDismiss?.();\n e.stopPropagation();\n },\n dialogRef,\n [onDismiss]\n );\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n onDismiss?.();\n });\n\n // Using layout effect to capture the focused element prior to dialog elements taking focus.\n useLayoutEffect(() => {\n const initiatorElement = getActiveElement();\n\n return () => {\n if (initiatorElement instanceof HTMLElement && initiatorElement.isConnected) {\n initiatorElement.focus();\n }\n };\n }, []);\n\n useEffect(() => {\n if (!progressProp) {\n setFocus();\n }\n }, [progressProp]);\n\n useEffect(() => {\n const closeDialog = () => {\n setTimeout(() => {\n onDismiss?.();\n // The 0 timeout ensures that the dialog will not re-open immediately after the close event is triggered.\n }, 0);\n };\n\n target.addEventListener('click', closeDialog);\n\n return () => {\n target.removeEventListener('click', closeDialog);\n };\n }, []);\n\n const heading = headingProp ? (\n <Text id={headingId} variant='h2'>\n {typeof headingProp === 'string' ? headingProp : headingProp.primary}\n </Text>\n ) : null;\n\n const progress = (\n <Progress\n visible={!!progressProp}\n focusOnVisible\n placement='local'\n message={typeof progressProp === 'string' ? progressProp : undefined}\n />\n );\n\n const dismissButton = (\n <StyledDismissButton\n icon\n variant='simple'\n onClick={() => {\n onDismiss();\n }}\n label={t('close')}\n ref={closeButtonRef}\n >\n <Icon name='times' />\n </StyledDismissButton>\n );\n\n return (\n <StyledInfoDialog\n {...restProps}\n {...(typeof headingProp === 'string'\n ? { 'aria-labelledby': headingId }\n : { 'aria-label': headingProp?.primary })}\n arrow\n target={target}\n progress={progressProp}\n ref={dialogRef}\n >\n {headingProp && heading && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2, gap: 1 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n {typeof headingProp === 'string' ? (\n heading\n ) : (\n <SummaryItem\n primary={heading}\n secondary={\n headingProp.secondary ? (\n <Text variant='secondary'>{headingProp.secondary}</Text>\n ) : undefined\n }\n visual={headingProp.visual}\n />\n )}\n {dismissButton}\n </Flex>\n )}\n\n {(!headingProp || children || progressProp) && (\n <Flex\n container={{ direction: 'column' }}\n item={{ grow: 1 }}\n as={StyledDialogContent}\n ref={dialogContentRef}\n >\n {!headingProp && dismissButton}\n {children && (\n <StyledChildrenWrap inert={progressProp ? '' : undefined}>\n {children}\n </StyledChildrenWrap>\n )}\n {progress}\n </Flex>\n )}\n </StyledInfoDialog>\n );\n }\n);\n\nexport default InfoDialog;\n"]}
1
+ {"version":3,"file":"InfoDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO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ACjC,OAAO,CACR,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EACP,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CACtB,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,YAAE,WAAW,CAAC,SAAS,GAAQ,CACzD,CAAC,CAAC,CAAC,SAAS,EAEf,MAAM,EAAE,WAAW,CAAC,MAAM,GAC1B,CACH,EACA,aAAa,IACT,CACR,EAEA,CAAC,CAAC,WAAW,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI,CAC7C,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,EAAE,EAAE,mBAAmB,EACvB,GAAG,EAAE,gBAAgB,aAEpB,CAAC,WAAW,IAAI,aAAa,EAC7B,QAAQ,IAAI,CACX,KAAC,kBAAkB,IAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YACrD,QAAQ,GACU,CACtB,EACA,QAAQ,IACJ,CACR,IACgB,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useLayoutEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport { useConsolidatedRef, useEscape, useI18n, useOuterEvent, useUID } from '../../hooks';\nimport Text from '../Text';\nimport Icon from '../Icon';\nimport Progress from '../Progress';\nimport Flex from '../Flex';\nimport SummaryItem from '../SummaryItem';\nimport { getActiveElement, getFocusables } from '../../utils';\nimport type { RefElement } from '../../types';\n\nimport { StyledChildrenWrap, StyledDialogContent, StyledDialogHeader } from './Dialog.styles';\nimport type { InfoDialogProps } from './Dialog.types';\nimport { StyledDismissButton, StyledInfoDialog } from './InfoDialog.styles';\n\nconst InfoDialog = forwardRef<RefElement<InfoDialogProps>, PropsWithoutRef<InfoDialogProps>>(\n function InfoDialog(\n { target, heading: headingProp, children, progress: progressProp, onDismiss, ...restProps },\n ref\n ) {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n\n const setFocus = () => {\n if (progressProp) return;\n\n const focusables = getFocusables(dialogRef);\n\n const focusable =\n focusables.find(el => {\n return dialogContentRef.current?.contains(el);\n }) ??\n closeButtonRef.current ??\n focusables[0];\n\n focusable?.focus();\n };\n\n useEscape(\n e => {\n onDismiss?.();\n e.stopPropagation();\n },\n dialogRef,\n [onDismiss]\n );\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n onDismiss?.();\n });\n\n // Using layout effect to capture the focused element prior to dialog elements taking focus.\n useLayoutEffect(() => {\n const initiatorElement = getActiveElement();\n\n return () => {\n if (initiatorElement instanceof HTMLElement && initiatorElement.isConnected) {\n initiatorElement.focus();\n }\n };\n }, []);\n\n useEffect(() => {\n if (!progressProp) {\n setFocus();\n }\n }, [progressProp]);\n\n useEffect(() => {\n const closeDialog = () => {\n setTimeout(() => {\n onDismiss?.();\n // The 0 timeout ensures that the dialog will not re-open immediately after the close event is triggered.\n }, 0);\n };\n\n target.addEventListener('click', closeDialog);\n\n return () => {\n target.removeEventListener('click', closeDialog);\n };\n }, []);\n\n const heading = headingProp ? (\n <Text id={headingId} variant='h2'>\n {typeof headingProp === 'string' ? headingProp : headingProp.primary}\n </Text>\n ) : null;\n\n const progress = (\n <Progress\n visible={!!progressProp}\n focusOnVisible\n placement='local'\n message={typeof progressProp === 'string' ? progressProp : undefined}\n />\n );\n\n const dismissButton = (\n <StyledDismissButton\n icon\n variant='simple'\n onClick={() => {\n onDismiss();\n }}\n label={t('close')}\n ref={closeButtonRef}\n >\n <Icon name='times' />\n </StyledDismissButton>\n );\n\n return (\n <StyledInfoDialog\n {...restProps}\n {...(typeof headingProp === 'string'\n ? { 'aria-labelledby': headingId }\n : { 'aria-label': headingProp?.primary })}\n arrow\n target={target}\n progress={progressProp}\n ref={dialogRef}\n >\n {headingProp && heading && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: [1, 2], gap: 1 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n {typeof headingProp === 'string' ? (\n heading\n ) : (\n <SummaryItem\n primary={heading}\n secondary={\n headingProp.secondary ? (\n <Text variant='secondary'>{headingProp.secondary}</Text>\n ) : undefined\n }\n visual={headingProp.visual}\n />\n )}\n {dismissButton}\n </Flex>\n )}\n\n {(!headingProp || children || progressProp) && (\n <Flex\n container={{ direction: 'column' }}\n item={{ grow: 1 }}\n as={StyledDialogContent}\n ref={dialogContentRef}\n >\n {!headingProp && dismissButton}\n {children && (\n <StyledChildrenWrap inert={progressProp ? '' : undefined}>\n {children}\n </StyledChildrenWrap>\n )}\n {progress}\n </Flex>\n )}\n </StyledInfoDialog>\n );\n }\n);\n\nexport default InfoDialog;\n"]}
@@ -44,7 +44,7 @@ export const StyledMetaListItem = styled.li(({ wrapItems }) => {
44
44
  });
45
45
  const MetaList = forwardRef(function MetaList({ testId, items, wrapItems = true, ...restProps }, ref) {
46
46
  const testIds = useTestIds(testId, getMetaListTestIds);
47
- const roleAttrValue = items.length <= 1 ? 'presentation' : undefined;
47
+ const roleAttrValue = items.length <= 1 ? 'none' : undefined;
48
48
  return (_jsx(Flex, { "data-testid": testIds.root, ...restProps, as: StyledMetaList, role: roleAttrValue, container: { colGap: 0.5, alignItems: 'center', wrap: wrapItems ? 'wrap' : 'nowrap' }, wrapItems: wrapItems, ref: ref, children: items.flatMap((item, i, arr) => item
49
49
  ? [
50
50
  _jsx(Text, { as: StyledMetaListItem, variant: 'secondary', role: roleAttrValue, wrapItems: wrapItems, children: item }, `${i + 0}`)
@@ -1 +1 @@
1
- {"version":3,"file":"MetaList.js","sourceRoot":"","sources":["../../../src/components/MetaList/MetaList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UA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AE,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,EACrF,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,YAEP,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,CAC9B,IAAI;YACF,CAAC,CAAC;gBACE,KAAC,IAAI,IACH,EAAE,EAAE,kBAAkB,EAEtB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,SAAS,YAEnB,IAAI,IALA,GAAG,CAAC,GAAG,CAAC,EAAE,CAMV;aACR,CAAC,MAAM,CACN,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC;gBAClB,CAAC,CAAC;oBACE,KAAC,IAAI,IACH,EAAE,EAAE,kBAAkB,uBAGtB,OAAO,EAAC,WAAW,wBADd,GAAG,CAAC,GAAG,CAAC,MAAM,CAId;iBACR;gBACH,CAAC,CAAC,EAAE,CACP;YACH,CAAC,CAAC,EAAE,CACP,GACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { ReactNode, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Text from '../Text';\nimport Flex from '../Flex';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp,\n TestIdProp\n} from '../../types';\nimport { useTestIds } from '../../hooks';\nimport { withTestIds } from '../../utils';\n\nimport { getMetaListTestIds } from './MetaList.test-ids';\n\nexport interface MetaListProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** Array of nodes or text to be rendered in the list. */\n items: ReactNode[];\n /**\n * If true, MetaList items that extend past the MetaList's container will wrap to a new line.\n * @default true\n */\n wrapItems?: boolean;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport const StyledMetaList = styled.ul<{ wrapItems: boolean }>(({ wrapItems }) => {\n return css`\n list-style: none;\n overflow: hidden;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n\n ${!wrapItems &&\n css`\n white-space: nowrap;\n `}\n `;\n});\n\nexport const StyledMetaListItem = styled.li<{ wrapItems: boolean }>(({ wrapItems }) => {\n return css`\n min-width: 0;\n display: inline-block;\n\n ${wrapItems\n ? css`\n overflow-wrap: break-word;\n `\n : css`\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n `}\n\n &[role='separator'] {\n -webkit-user-select: none;\n user-select: none;\n }\n `;\n});\n\nconst MetaList: ForwardRefForwardPropsComponent<MetaListProps> = forwardRef(function MetaList(\n { testId, items, wrapItems = true, ...restProps }: PropsWithoutRef<MetaListProps>,\n ref: MetaListProps['ref']\n) {\n const testIds = useTestIds(testId, getMetaListTestIds);\n const roleAttrValue = items.length <= 1 ? 'presentation' : undefined;\n\n return (\n <Flex\n data-testid={testIds.root}\n {...restProps}\n as={StyledMetaList}\n role={roleAttrValue}\n container={{ colGap: 0.5, alignItems: 'center', wrap: wrapItems ? 'wrap' : 'nowrap' }}\n wrapItems={wrapItems}\n ref={ref}\n >\n {items.flatMap((item, i, arr) =>\n item\n ? [\n <Text\n as={StyledMetaListItem}\n key={`${i + 0}`}\n variant='secondary'\n role={roleAttrValue}\n wrapItems={wrapItems}\n >\n {item}\n </Text>\n ].concat(\n i !== arr.length - 1\n ? [\n <Text\n as={StyledMetaListItem}\n aria-hidden\n key={`${i + 0}-sep`}\n variant='secondary'\n >\n •\n </Text>\n ]\n : []\n )\n : []\n )}\n </Flex>\n );\n});\n\nexport default withTestIds(MetaList, getMetaListTestIds);\n"]}
1
+ {"version":3,"file":"MetaList.js","sourceRoot":"","sources":["../../../src/components/MetaList/MetaList.tsx"],"names":[],"mappings":";AA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AAa,EACnB,SAAS,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,EACrF,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,YAEP,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,CAC9B,IAAI;YACF,CAAC,CAAC;gBACE,KAAC,IAAI,IACH,EAAE,EAAE,kBAAkB,EAEtB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,SAAS,YAEnB,IAAI,IALA,GAAG,CAAC,GAAG,CAAC,EAAE,CAMV;aACR,CAAC,MAAM,CACN,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC;gBAClB,CAAC,CAAC;oBACE,KAAC,IAAI,IACH,EAAE,EAAE,kBAAkB,uBAGtB,OAAO,EAAC,WAAW,wBADd,GAAG,CAAC,GAAG,CAAC,MAAM,CAId;iBACR;gBACH,CAAC,CAAC,EAAE,CACP;YACH,CAAC,CAAC,EAAE,CACP,GACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { ReactNode, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Text from '../Text';\nimport Flex from '../Flex';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp,\n TestIdProp\n} from '../../types';\nimport { useTestIds } from '../../hooks';\nimport { withTestIds } from '../../utils';\n\nimport { getMetaListTestIds } from './MetaList.test-ids';\n\nexport interface MetaListProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** Array of nodes or text to be rendered in the list. */\n items: ReactNode[];\n /**\n * If true, MetaList items that extend past the MetaList's container will wrap to a new line.\n * @default true\n */\n wrapItems?: boolean;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport const StyledMetaList = styled.ul<{ wrapItems: boolean }>(({ wrapItems }) => {\n return css`\n list-style: none;\n overflow: hidden;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n\n ${!wrapItems &&\n css`\n white-space: nowrap;\n `}\n `;\n});\n\nexport const StyledMetaListItem = styled.li<{ wrapItems: boolean }>(({ wrapItems }) => {\n return css`\n min-width: 0;\n display: inline-block;\n\n ${wrapItems\n ? css`\n overflow-wrap: break-word;\n `\n : css`\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n `}\n\n &[role='separator'] {\n -webkit-user-select: none;\n user-select: none;\n }\n `;\n});\n\nconst MetaList: ForwardRefForwardPropsComponent<MetaListProps> = forwardRef(function MetaList(\n { testId, items, wrapItems = true, ...restProps }: PropsWithoutRef<MetaListProps>,\n ref: MetaListProps['ref']\n) {\n const testIds = useTestIds(testId, getMetaListTestIds);\n const roleAttrValue = items.length <= 1 ? 'none' : undefined;\n\n return (\n <Flex\n data-testid={testIds.root}\n {...restProps}\n as={StyledMetaList}\n role={roleAttrValue}\n container={{ colGap: 0.5, alignItems: 'center', wrap: wrapItems ? 'wrap' : 'nowrap' }}\n wrapItems={wrapItems}\n ref={ref}\n >\n {items.flatMap((item, i, arr) =>\n item\n ? [\n <Text\n as={StyledMetaListItem}\n key={`${i + 0}`}\n variant='secondary'\n role={roleAttrValue}\n wrapItems={wrapItems}\n >\n {item}\n </Text>\n ].concat(\n i !== arr.length - 1\n ? [\n <Text\n as={StyledMetaListItem}\n aria-hidden\n key={`${i + 0}-sep`}\n variant='secondary'\n >\n •\n </Text>\n ]\n : []\n )\n : []\n )}\n </Flex>\n );\n});\n\nexport default withTestIds(MetaList, getMetaListTestIds);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,yGAW9B,CAAC;AAIF,eAAO,MAAM,aAAa;aAAyB,MAAM;aAAW,OAAO;SA8G1E,CAAC"}
1
+ {"version":3,"file":"Popover.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,yGAW9B,CAAC;AAIF,eAAO,MAAM,aAAa;aAAyB,MAAM;aAAW,OAAO;SA+H1E,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { defaultThemeProp } from '../../theme';
3
+ import { animations } from '../../styles';
3
4
  export const StyledPopoverArrow = styled.div `
4
5
  background-color: inherit;
5
6
 
@@ -13,7 +14,7 @@ export const StyledPopoverArrow = styled.div `
13
14
  }
14
15
  `;
15
16
  StyledPopoverArrow.defaultProps = defaultThemeProp;
16
- export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': borderRadius, 'z-index': { popover: popoverZIndex, backdrop: backdropZIndex }, shadow: { high }, palette }, components: { 'form-control': { 'border-radius': formControlBorderRadius }, popover: { background: popoverBackground } } }, portal, offset }) => {
17
+ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': borderRadius, 'z-index': { popover: popoverZIndex, backdrop: backdropZIndex }, shadow: { high }, palette, animation }, components: { 'form-control': { 'border-radius': formControlBorderRadius }, popover: { background: popoverBackground } } }, portal, offset }) => {
17
18
  return css `
18
19
  /*
19
20
  Margin should never be used with Popper.
@@ -25,12 +26,19 @@ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': bor
25
26
  border-radius: calc(${formControlBorderRadius} * ${borderRadius});
26
27
  box-shadow: ${high};
27
28
  color: ${palette['foreground-color']};
29
+ ${animations.subProperties}
30
+ --scale-in-size: 1;
31
+ --animation-duration: calc(2 * ${animation.speed});
32
+
28
33
  &[data-popper-reference-hidden='true'] {
29
34
  visibility: hidden;
30
35
  pointer-events: none;
31
36
  }
32
37
 
33
38
  &[data-popper-placement^='top'] {
39
+ transform-origin: center bottom;
40
+ animation-name: ${animations.reveal}, ${animations.slideInYEnd}, ${animations.scaleIn};
41
+
34
42
  > ${StyledPopoverArrow} {
35
43
  top: calc(100%);
36
44
 
@@ -50,6 +58,9 @@ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': bor
50
58
  }
51
59
 
52
60
  &[data-popper-placement^='bottom'] {
61
+ transform-origin: center top;
62
+ animation-name: ${animations.reveal}, ${animations.slideInYStart}, ${animations.scaleIn};
63
+
53
64
  > ${StyledPopoverArrow} {
54
65
  bottom: calc(100%);
55
66
 
@@ -69,6 +80,9 @@ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': bor
69
80
  }
70
81
 
71
82
  &[data-popper-placement^='right'] {
83
+ transform-origin: left center;
84
+ animation-name: ${animations.reveal}, ${animations.slideInXStart}, ${animations.scaleIn};
85
+
72
86
  > ${StyledPopoverArrow} {
73
87
  right: calc(100%);
74
88
 
@@ -88,6 +102,9 @@ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': bor
88
102
  }
89
103
 
90
104
  &[data-popper-placement^='left'] {
105
+ transform-origin: right center;
106
+ animation-name: ${animations.reveal}, ${animations.slideInXEnd}, ${animations.scaleIn};
107
+
91
108
  > ${StyledPopoverArrow} {
92
109
  left: calc(100%);
93
110
 
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.styles.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;CAW3C,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CACrC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,EAC/D,MAAM,EAAE,EAAE,IAAI,EAAE,EAChB,OAAO,EACR,EACD,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,eAAe,EAAE,uBAAuB,EAAE,EAC5D,OAAO,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAC3C,EACF,EACD,MAAM,EACN,MAAM,EACP,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;;;;;iBAMG,MAAM,CAAC,CAAC,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa;oBACxC,iBAAiB;4BACT,uBAAuB,MAAM,YAAY;oBACjD,IAAI;eACT,OAAO,CAAC,kBAAkB,CAAC;;;;;;;YAO9B,kBAAkB;;;;+CAIiB,YAAY;;;;;;;oBAOvC,MAAM;qBACL,MAAM;;;;;;;YAOf,kBAAkB;;;;2CAIa,YAAY;;;;;;;oBAOnC,MAAM;kBACR,MAAM;;;;;;;YAOZ,kBAAkB;;;;8CAIgB,YAAY;;;;;;;mBAOvC,MAAM;mBACN,MAAM;;;;;;;YAOb,kBAAkB;;;;4CAIc,YAAY;;;;;;;mBAOrC,MAAM;oBACL,MAAM;;;;;KAKrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\n\nexport const StyledPopoverArrow = styled.div`\n background-color: inherit;\n\n ::before {\n content: '';\n display: block;\n position: absolute;\n inset: -0.25rem;\n background-color: inherit;\n transform: rotate(45deg);\n }\n`;\n\nStyledPopoverArrow.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div<{ offset?: number; portal?: boolean }>(\n ({\n theme: {\n base: {\n 'border-radius': borderRadius,\n 'z-index': { popover: popoverZIndex, backdrop: backdropZIndex },\n shadow: { high },\n palette\n },\n components: {\n 'form-control': { 'border-radius': formControlBorderRadius },\n popover: { background: popoverBackground }\n }\n },\n portal,\n offset\n }) => {\n return css`\n /*\n Margin should never be used with Popper.\n https://popper.js.org/docs/v2/migration-guide/#4-remove-all-css-margins\n */\n margin: 0 !important;\n z-index: ${portal ? backdropZIndex - 1 : popoverZIndex};\n background: ${popoverBackground};\n border-radius: calc(${formControlBorderRadius} * ${borderRadius});\n box-shadow: ${high};\n color: ${palette['foreground-color']};\n &[data-popper-reference-hidden='true'] {\n visibility: hidden;\n pointer-events: none;\n }\n\n &[data-popper-placement^='top'] {\n > ${StyledPopoverArrow} {\n top: calc(100%);\n\n ::before {\n border-bottom-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n bottom: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='bottom'] {\n > ${StyledPopoverArrow} {\n bottom: calc(100%);\n\n ::before {\n border-top-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n top: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='right'] {\n > ${StyledPopoverArrow} {\n right: calc(100%);\n\n ::before {\n border-bottom-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n left: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n\n &[data-popper-placement^='left'] {\n > ${StyledPopoverArrow} {\n left: calc(100%);\n\n ::before {\n border-top-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n right: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n `;\n }\n);\n\nStyledPopover.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"Popover.styles.js","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aAAa,KAAK,UAAU,CAAC,OAAO;;YAEnF,kBAAkB;;;;2CAIa,YAAY;;;;;;;oBAOnC,MAAM;kBACR,MAAM;;;;;;;;0BAQE,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,aAAa,KAAK,UAAU,CAAC,OAAO;;YAEnF,kBAAkB;;;;8CAIgB,YAAY;;;;;;;mBAOvC,MAAM;mBACN,MAAM;;;;;;;;0BAQC,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,OAAO;;YAEjF,kBAAkB;;;;4CAIc,YAAY;;;;;;;mBAOrC,MAAM;oBACL,MAAM;;;;;KAKrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { animations } from '../../styles';\n\nexport const StyledPopoverArrow = styled.div`\n background-color: inherit;\n\n ::before {\n content: '';\n display: block;\n position: absolute;\n inset: -0.25rem;\n background-color: inherit;\n transform: rotate(45deg);\n }\n`;\n\nStyledPopoverArrow.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div<{ offset?: number; portal?: boolean }>(\n ({\n theme: {\n base: {\n 'border-radius': borderRadius,\n 'z-index': { popover: popoverZIndex, backdrop: backdropZIndex },\n shadow: { high },\n palette,\n animation\n },\n components: {\n 'form-control': { 'border-radius': formControlBorderRadius },\n popover: { background: popoverBackground }\n }\n },\n portal,\n offset\n }) => {\n return css`\n /*\n Margin should never be used with Popper.\n https://popper.js.org/docs/v2/migration-guide/#4-remove-all-css-margins\n */\n margin: 0 !important;\n z-index: ${portal ? backdropZIndex - 1 : popoverZIndex};\n background: ${popoverBackground};\n border-radius: calc(${formControlBorderRadius} * ${borderRadius});\n box-shadow: ${high};\n color: ${palette['foreground-color']};\n ${animations.subProperties}\n --scale-in-size: 1;\n --animation-duration: calc(2 * ${animation.speed});\n\n &[data-popper-reference-hidden='true'] {\n visibility: hidden;\n pointer-events: none;\n }\n\n &[data-popper-placement^='top'] {\n transform-origin: center bottom;\n animation-name: ${animations.reveal}, ${animations.slideInYEnd}, ${animations.scaleIn};\n\n > ${StyledPopoverArrow} {\n top: calc(100%);\n\n ::before {\n border-bottom-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n bottom: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='bottom'] {\n transform-origin: center top;\n animation-name: ${animations.reveal}, ${animations.slideInYStart}, ${animations.scaleIn};\n\n > ${StyledPopoverArrow} {\n bottom: calc(100%);\n\n ::before {\n border-top-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n top: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='right'] {\n transform-origin: left center;\n animation-name: ${animations.reveal}, ${animations.slideInXStart}, ${animations.scaleIn};\n\n > ${StyledPopoverArrow} {\n right: calc(100%);\n\n ::before {\n border-bottom-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n left: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n\n &[data-popper-placement^='left'] {\n transform-origin: right center;\n animation-name: ${animations.reveal}, ${animations.slideInXEnd}, ${animations.scaleIn};\n\n > ${StyledPopoverArrow} {\n left: calc(100%);\n\n ::before {\n border-top-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n right: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n `;\n }\n);\n\nStyledPopover.defaultProps = defaultThemeProp;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAQlD,CAAC;AAIH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAWxD,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAkK9D,CAAC"}
1
+ {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAQlD,CAAC;AAIH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAsBxD,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAkK9D,CAAC"}
@@ -15,10 +15,20 @@ export const fitToContent = Object.freeze({
15
15
  phase: 'beforeWrite',
16
16
  requires: ['computeStyles', 'offset'],
17
17
  fn({ state }) {
18
+ if (state.elements.popper.dataset.initialized !== 'true') {
19
+ state.elements.popper.style.visibility = 'hidden';
20
+ }
18
21
  state.styles.popper.width = 'fit-content';
19
22
  // Ideally, we would use `content-width.md` from the theme, but we can't access it outside of a React function component
20
23
  state.elements.popper.style.maxWidth = '60ch';
21
24
  state.elements.popper.style.minWidth = `${state.rects.reference.width}px`;
25
+ state.elements.popper.style.visibility = 'visible';
26
+ state.elements.popper.dataset.initialized = 'true';
27
+ },
28
+ effect({ instance }) {
29
+ requestAnimationFrame(() => {
30
+ instance.update();
31
+ });
22
32
  }
23
33
  });
24
34
  export const placeAndContain = Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"modifiers.js","sourceRoot":"","sources":["../../../src/components/Popover/modifiers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB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AC;YACtE,CAAC;QACH,CAAC;QAED,IAAI,iBAAiB,KAAK,MAAM,IAAI,iBAAiB,KAAK,OAAO,EAAE,CAAC;YAClE,gBAAgB,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;QACvD,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,gBAAgB,IAAI,CAAC;QAEhE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9F,iBAAiB,GAAG,GAAG,iBAAiB,GACtC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC,CAAC,EAAE,CAIvE,EAAE,CAAC;QAEH,IAAI,KAAK,CAAC,SAAS,KAAK,iBAAiB,EAAE,CAAC;YAC1C,KAAK,CAAC,SAAS,GAAG,iBAAiB,CAAC;YACpC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { Modifier } from '@popperjs/core';\n\nimport { documentIsAvailable, getScrollbarWidth, testElForOverflow } from '../../utils';\n\nexport const sameWidth: Modifier<'sameWidth', object> = Object.freeze({\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n fn({ state }) {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n requires: ['computeStyles']\n});\n\nconst scrollbarSize = documentIsAvailable ? getScrollbarWidth() : 0;\n\nexport const fitToContent: Modifier<'fitToContent', object> = Object.freeze({\n name: 'fitToContent',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles', 'offset'],\n fn({ state }) {\n state.styles.popper.width = 'fit-content';\n // Ideally, we would use `content-width.md` from the theme, but we can't access it outside of a React function component\n state.elements.popper.style.maxWidth = '60ch';\n state.elements.popper.style.minWidth = `${state.rects.reference.width}px`;\n }\n});\n\nexport const placeAndContain: Modifier<'placeAndContain', object> = Object.freeze({\n name: 'placeAndContain',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles', 'offset'],\n fn: ({ state }) => {\n const [requestedPrimaryPlacement, requestedSecondaryPlacement] = state.placement.split('-') as [\n primaryPlacement: 'top' | 'bottom' | 'left' | 'right' | 'auto',\n secondaryPlacement?: 'start' | 'end' | undefined\n ];\n\n const padding = {\n top: 0,\n bottom: 0,\n right: 0,\n left: 0\n };\n\n const preventOverflowPad = state.orderedModifiers.find(({ name }) => name === 'preventOverflow')\n ?.options?.padding;\n\n if (typeof preventOverflowPad === 'number') {\n padding.top = preventOverflowPad;\n padding.bottom = preventOverflowPad;\n padding.right = preventOverflowPad;\n padding.left = preventOverflowPad;\n } else if (preventOverflowPad) {\n padding.top = preventOverflowPad.top ?? padding.top;\n padding.bottom = preventOverflowPad.bottom ?? padding.bottom;\n padding.right = preventOverflowPad.right ?? padding.right;\n padding.left = preventOverflowPad.left ?? padding.left;\n }\n\n const vw = document.documentElement.clientWidth;\n const vh = document.documentElement.clientHeight;\n\n const targetRect = state.rects.reference;\n const targetRectXStart = targetRect.x;\n const targetRectXEnd = targetRectXStart + targetRect.width;\n const targetRectYStart = targetRect.y;\n const targetRectYEnd = targetRectYStart + targetRect.height;\n const targetXMid = (targetRectXStart + targetRectXEnd) / 2;\n const targetYMid = (targetRectYStart + targetRectYEnd) / 2;\n const targetIsInLeftHalfOfViewport = targetXMid < vw / 2;\n const targetIsInTopHalfOfViewport = targetYMid < vh / 2;\n\n const offsetFromTargetX = state.modifiersData.offset?.[state.placement]?.x ?? 0;\n const offsetFromTargetY = state.modifiersData.offset?.[state.placement]?.y ?? 0;\n\n let popoverMaxWidth: null | number = null;\n let popoverMaxHeight: null | number = null;\n\n // The elements whose natural content size should be measured to determine resolved placement\n const scrollableEls = [...state.elements.popper.children].flatMap(popoverChildEl => {\n // Default to measuring direct popover children unless they have measureable items declared within\n const elsToMeasure = popoverChildEl.querySelectorAll('[data-popover-scroll-el]');\n return elsToMeasure.length > 0 ? [...elsToMeasure] : popoverChildEl;\n });\n\n const totalScrollableChildHeight = scrollableEls.reduce((sum, el) => {\n if (el === state.elements.arrow) {\n return sum;\n }\n\n if (testElForOverflow(el)[0]) {\n return sum + el.scrollHeight + scrollbarSize;\n }\n\n return sum + el.scrollHeight;\n }, 0);\n\n const naturalPopoverHeight = Math.max(\n state.elements.popper.scrollHeight,\n totalScrollableChildHeight\n );\n\n const naturalPopoverWidth = Math.max(\n state.elements.popper.scrollWidth,\n ...Array.from(state.elements.popper.children).map(el => {\n if (el === state.elements.arrow) {\n return -Infinity;\n }\n\n if (testElForOverflow(el)[1]) {\n return el.scrollWidth + scrollbarSize;\n }\n\n return el.scrollWidth;\n })\n );\n\n let resolvedPlacement: `${'top' | 'bottom' | 'left' | 'right' | 'auto'}${\n | ''\n | '-start'\n | '-end'}` = requestedPrimaryPlacement;\n\n if (requestedPrimaryPlacement === 'bottom') {\n popoverMaxHeight = vh - targetRectYEnd - offsetFromTargetY - padding.bottom;\n\n if (\n // If the popover will overflow the viewport bottom\n targetRectYEnd + offsetFromTargetY + naturalPopoverHeight + padding.bottom >\n vh\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInTopHalfOfViewport ? 'bottom' : 'top';\n }\n } else if (requestedPrimaryPlacement === 'top') {\n popoverMaxHeight = targetRectYStart + offsetFromTargetY - padding.top;\n\n if (\n // If the popover will overflow the viewport top\n targetRectYStart + offsetFromTargetY - naturalPopoverHeight + padding.top <\n 0\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInTopHalfOfViewport ? 'bottom' : 'top';\n }\n } else if (requestedPrimaryPlacement === 'left') {\n popoverMaxWidth = targetRectXStart + offsetFromTargetX - padding.left;\n\n if (\n // If the popover will overflow the viewport left\n targetRectXStart + offsetFromTargetX - naturalPopoverWidth + padding.left <\n 0\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInLeftHalfOfViewport ? 'right' : 'left';\n }\n } else if (requestedPrimaryPlacement === 'right') {\n popoverMaxWidth = vw - targetRectXEnd - offsetFromTargetX - padding.right;\n\n if (\n // If the popover will overflow the viewport right\n targetRectXEnd + offsetFromTargetX + naturalPopoverWidth + padding.right >\n vw\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInLeftHalfOfViewport ? 'right' : 'left';\n }\n }\n\n if (resolvedPlacement === 'left' || resolvedPlacement === 'right') {\n popoverMaxHeight = vh - padding.top - padding.bottom;\n }\n\n state.elements.popper.style.maxHeight = `${popoverMaxHeight}px`;\n\n state.elements.popper.style.maxWidth = popoverMaxWidth !== null ? `${popoverMaxWidth}px` : '';\n\n resolvedPlacement = `${resolvedPlacement}${\n (requestedSecondaryPlacement ? `-${requestedSecondaryPlacement}` : '') as\n | ''\n | '-start'\n | '-end'\n }`;\n\n if (state.placement !== resolvedPlacement) {\n state.placement = resolvedPlacement;\n state.reset = true;\n }\n }\n});\n"]}
1
+ {"version":3,"file":"modifiers.js","sourceRoot":"","sources":["../../../src/components/Popover/modifiers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAExF,MAAM,CAAC,MAAM,SAAS,GAAkC,MAAM,CAAC,MAAM,CAAC;IACpE,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,aAAa;IACpB,EAAE,CAAC,EAAE,KAAK,EAAE;QACV,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACjE,CAAC;IACD,QAAQ,EAAE,CAAC,eAAe,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC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AC,CAAC,CAAC,MAAM,CAAC;YACtE,CAAC;QACH,CAAC;QAED,IAAI,iBAAiB,KAAK,MAAM,IAAI,iBAAiB,KAAK,OAAO,EAAE,CAAC;YAClE,gBAAgB,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;QACvD,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,gBAAgB,IAAI,CAAC;QAEhE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9F,iBAAiB,GAAG,GAAG,iBAAiB,GACtC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC,CAAC,EAAE,CAIvE,EAAE,CAAC;QAEH,IAAI,KAAK,CAAC,SAAS,KAAK,iBAAiB,EAAE,CAAC;YAC1C,KAAK,CAAC,SAAS,GAAG,iBAAiB,CAAC;YACpC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { Modifier } from '@popperjs/core';\n\nimport { documentIsAvailable, getScrollbarWidth, testElForOverflow } from '../../utils';\n\nexport const sameWidth: Modifier<'sameWidth', object> = Object.freeze({\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n fn({ state }) {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n requires: ['computeStyles']\n});\n\nconst scrollbarSize = documentIsAvailable ? getScrollbarWidth() : 0;\n\nexport const fitToContent: Modifier<'fitToContent', object> = Object.freeze({\n name: 'fitToContent',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles', 'offset'],\n fn({ state }) {\n if (state.elements.popper.dataset.initialized !== 'true') {\n state.elements.popper.style.visibility = 'hidden';\n }\n state.styles.popper.width = 'fit-content';\n // Ideally, we would use `content-width.md` from the theme, but we can't access it outside of a React function component\n state.elements.popper.style.maxWidth = '60ch';\n state.elements.popper.style.minWidth = `${state.rects.reference.width}px`;\n\n state.elements.popper.style.visibility = 'visible';\n state.elements.popper.dataset.initialized = 'true';\n },\n effect({ instance }) {\n requestAnimationFrame(() => {\n instance.update();\n });\n }\n});\n\nexport const placeAndContain: Modifier<'placeAndContain', object> = Object.freeze({\n name: 'placeAndContain',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles', 'offset'],\n fn: ({ state }) => {\n const [requestedPrimaryPlacement, requestedSecondaryPlacement] = state.placement.split('-') as [\n primaryPlacement: 'top' | 'bottom' | 'left' | 'right' | 'auto',\n secondaryPlacement?: 'start' | 'end' | undefined\n ];\n\n const padding = {\n top: 0,\n bottom: 0,\n right: 0,\n left: 0\n };\n\n const preventOverflowPad = state.orderedModifiers.find(({ name }) => name === 'preventOverflow')\n ?.options?.padding;\n\n if (typeof preventOverflowPad === 'number') {\n padding.top = preventOverflowPad;\n padding.bottom = preventOverflowPad;\n padding.right = preventOverflowPad;\n padding.left = preventOverflowPad;\n } else if (preventOverflowPad) {\n padding.top = preventOverflowPad.top ?? padding.top;\n padding.bottom = preventOverflowPad.bottom ?? padding.bottom;\n padding.right = preventOverflowPad.right ?? padding.right;\n padding.left = preventOverflowPad.left ?? padding.left;\n }\n\n const vw = document.documentElement.clientWidth;\n const vh = document.documentElement.clientHeight;\n\n const targetRect = state.rects.reference;\n const targetRectXStart = targetRect.x;\n const targetRectXEnd = targetRectXStart + targetRect.width;\n const targetRectYStart = targetRect.y;\n const targetRectYEnd = targetRectYStart + targetRect.height;\n const targetXMid = (targetRectXStart + targetRectXEnd) / 2;\n const targetYMid = (targetRectYStart + targetRectYEnd) / 2;\n const targetIsInLeftHalfOfViewport = targetXMid < vw / 2;\n const targetIsInTopHalfOfViewport = targetYMid < vh / 2;\n\n const offsetFromTargetX = state.modifiersData.offset?.[state.placement]?.x ?? 0;\n const offsetFromTargetY = state.modifiersData.offset?.[state.placement]?.y ?? 0;\n\n let popoverMaxWidth: null | number = null;\n let popoverMaxHeight: null | number = null;\n\n // The elements whose natural content size should be measured to determine resolved placement\n const scrollableEls = [...state.elements.popper.children].flatMap(popoverChildEl => {\n // Default to measuring direct popover children unless they have measureable items declared within\n const elsToMeasure = popoverChildEl.querySelectorAll('[data-popover-scroll-el]');\n return elsToMeasure.length > 0 ? [...elsToMeasure] : popoverChildEl;\n });\n\n const totalScrollableChildHeight = scrollableEls.reduce((sum, el) => {\n if (el === state.elements.arrow) {\n return sum;\n }\n\n if (testElForOverflow(el)[0]) {\n return sum + el.scrollHeight + scrollbarSize;\n }\n\n return sum + el.scrollHeight;\n }, 0);\n\n const naturalPopoverHeight = Math.max(\n state.elements.popper.scrollHeight,\n totalScrollableChildHeight\n );\n\n const naturalPopoverWidth = Math.max(\n state.elements.popper.scrollWidth,\n ...Array.from(state.elements.popper.children).map(el => {\n if (el === state.elements.arrow) {\n return -Infinity;\n }\n\n if (testElForOverflow(el)[1]) {\n return el.scrollWidth + scrollbarSize;\n }\n\n return el.scrollWidth;\n })\n );\n\n let resolvedPlacement: `${'top' | 'bottom' | 'left' | 'right' | 'auto'}${\n | ''\n | '-start'\n | '-end'}` = requestedPrimaryPlacement;\n\n if (requestedPrimaryPlacement === 'bottom') {\n popoverMaxHeight = vh - targetRectYEnd - offsetFromTargetY - padding.bottom;\n\n if (\n // If the popover will overflow the viewport bottom\n targetRectYEnd + offsetFromTargetY + naturalPopoverHeight + padding.bottom >\n vh\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInTopHalfOfViewport ? 'bottom' : 'top';\n }\n } else if (requestedPrimaryPlacement === 'top') {\n popoverMaxHeight = targetRectYStart + offsetFromTargetY - padding.top;\n\n if (\n // If the popover will overflow the viewport top\n targetRectYStart + offsetFromTargetY - naturalPopoverHeight + padding.top <\n 0\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInTopHalfOfViewport ? 'bottom' : 'top';\n }\n } else if (requestedPrimaryPlacement === 'left') {\n popoverMaxWidth = targetRectXStart + offsetFromTargetX - padding.left;\n\n if (\n // If the popover will overflow the viewport left\n targetRectXStart + offsetFromTargetX - naturalPopoverWidth + padding.left <\n 0\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInLeftHalfOfViewport ? 'right' : 'left';\n }\n } else if (requestedPrimaryPlacement === 'right') {\n popoverMaxWidth = vw - targetRectXEnd - offsetFromTargetX - padding.right;\n\n if (\n // If the popover will overflow the viewport right\n targetRectXEnd + offsetFromTargetX + naturalPopoverWidth + padding.right >\n vw\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInLeftHalfOfViewport ? 'right' : 'left';\n }\n }\n\n if (resolvedPlacement === 'left' || resolvedPlacement === 'right') {\n popoverMaxHeight = vh - padding.top - padding.bottom;\n }\n\n state.elements.popper.style.maxHeight = `${popoverMaxHeight}px`;\n\n state.elements.popper.style.maxWidth = popoverMaxWidth !== null ? `${popoverMaxWidth}px` : '';\n\n resolvedPlacement = `${resolvedPlacement}${\n (requestedSecondaryPlacement ? `-${requestedSecondaryPlacement}` : '') as\n | ''\n | '-start'\n | '-end'\n }`;\n\n if (state.placement !== resolvedPlacement) {\n state.placement = resolvedPlacement;\n state.reset = true;\n }\n }\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqC,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG/E,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG1F,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQtD,MAAM,WAAW,YAAa,SAAQ,SAAS,EAAE,UAAU;IACzD,oCAAoC;IACpC,QA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,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,yGAcxB,CAAC;;;;AA4LH,wBAAuD"}
@@ -15,9 +15,11 @@ export const StyledTooltip = styled.div(({ theme }) => {
15
15
  color: ${theme.components.tooltip['foreground-color']};
16
16
  font-size: ${fontSize.xxs};
17
17
  max-width: 40ch;
18
- padding: ${theme.base.spacing};
18
+ padding: calc(${theme.base.spacing} / 2);
19
19
  white-space: pre-line;
20
20
  word-break: break-word;
21
+ --scale-in-size: 0;
22
+ --animation-duration: ${theme.base.animation.speed};
21
23
  `;
22
24
  });
23
25
  StyledTooltip.defaultProps = defaultThemeProp;
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EA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AAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,WAAW,EAAE,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,EACD,UAAU,EAAE,GAAG,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAC9C,MAAM,EAAE,MAAM,EACd,KAAK,QACL,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,kBAAkB,QAClB,GAAG,EAAE,UAAU,YAEd,QAAQ,GACD,GACI,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { MutableRefObject, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\nimport type { Delay, PopoverProps } from '../Popover';\nimport { useConsolidatedRef, useTestIds, useTheme, useUID } from '../../hooks';\nimport { calculateFontSize, readableHue } from '../../styles';\nimport { getActiveElement, mouseState, testElForOverflow, withTestIds } from '../../utils';\nimport { ThemeOverride } from '../Configuration';\n\nimport { getTooltipTestIds } from './Tooltip.test-ids';\n\nexport interface TooltipProps extends BaseProps, TestIdProp {\n /** Text content for the tooltip. */\n children: ReactNode;\n /** Element to serve as the tooltip's target. */\n target: Element | null;\n /** Elements to ignore from within the tooltip's target. */\n ignoredElements?: TooltipProps['target'][];\n /**\n * Delay showing the tooltip on mouseenter.\n * @default 'short'\n */\n showDelay?: Delay;\n /**\n * Delay hiding the tooltip on mouseleave.\n * @default 'long'\n */\n hideDelay?: Delay;\n /**\n * If true, the Tooltip will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: PopoverProps['portal'];\n /**\n * If true, the Tooltip will automatically apply an aria-describedby attribute to its target.\n * @default true\n */\n describeTarget?: boolean;\n /**\n * Sets the placement of the tooltip relative to the target.\n * @default 'bottom'\n */\n placement?: PopoverProps['placement'];\n /**\n * Conditionally renders a tooltip only if the associated element's (or its descendants) text content is truncated.\n * To work, the associated element must be be displayed as a CSS \"block box\" i.e. block, inline-block, etc...\n * @default false\n */\n smart?: boolean;\n /**\n * The group that the Popover belongs to. Popovers in the same group will be closed when others open.\n * @default 'tooltip'\n */\n groupId?: PopoverProps['groupId'];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledTooltip = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.components.tooltip['foreground-color']};\n font-size: ${fontSize.xxs};\n max-width: 40ch;\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n `;\n});\n\nStyledTooltip.defaultProps = defaultThemeProp;\n\nconst Tooltip: ForwardRefForwardPropsComponent<TooltipProps> = forwardRef(function Tooltip(\n {\n testId,\n children,\n target,\n ignoredElements = [],\n showDelay = 'short',\n hideDelay = 'long',\n placement = 'top',\n describeTarget = true,\n smart,\n groupId = 'tooltip',\n ...restProps\n }: PropsWithoutRef<TooltipProps>,\n ref: TooltipProps['ref']\n) {\n const id = useUID();\n const [show, setShow] = useState(false);\n const [ignoreDelay, setIgnoreDelay] = useState(false);\n const tooltipRef = useConsolidatedRef(ref);\n const lastClickedRef: MutableRefObject<EventTarget | null> = useRef(null);\n const testIds = useTestIds(testId, getTooltipTestIds);\n\n const stringContentOnly =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every(child => typeof child === 'string'));\n\n const onMouseDown = useCallback(\n ({ target: eTarget }: MouseEvent) => {\n lastClickedRef.current = eTarget;\n if (eTarget === tooltipRef.current || eTarget === target) return;\n setShow(false);\n },\n [target]\n );\n\n useEffect(() => {\n if (!target) return;\n\n const showTooltip = () => {\n // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.\n // https://stackoverflow.com/a/64747288\n\n const checkTruncation = (element: Element): boolean => {\n if (\n testElForOverflow(element).some(Boolean) &&\n !['absolute', 'fixed'].includes(window.getComputedStyle(element).position)\n )\n return true;\n\n for (const child of element.children) {\n if (checkTruncation(child)) return true;\n }\n\n return false;\n };\n\n setShow(smart ? checkTruncation(target) : true);\n };\n\n const onFocusIn = () => {\n showTooltip();\n };\n\n const onFocusOut = () => {\n if (!lastClickedRef.current || lastClickedRef.current !== tooltipRef.current) {\n setShow(false);\n }\n lastClickedRef.current = null;\n };\n\n const onMouseEnter = () => {\n if (ignoredElements.some(exclusion => exclusion?.matches(':hover')) || mouseState.primary) {\n return;\n }\n\n showTooltip();\n };\n\n const onMouseLeave = () => {\n if (getActiveElement() !== target) {\n setShow(false);\n }\n };\n\n const onKeyDown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape' && show) {\n setIgnoreDelay(true);\n setShow(false);\n }\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n target.addEventListener('focusin', onFocusIn);\n target.addEventListener('focusout', onFocusOut);\n target.addEventListener('mouseenter', onMouseEnter);\n target.addEventListener('mouseleave', onMouseLeave);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n\n target.removeEventListener('focusin', onFocusIn);\n target.removeEventListener('focusout', onFocusOut);\n target.removeEventListener('mouseenter', onMouseEnter);\n target.removeEventListener('mouseleave', onMouseLeave);\n };\n }, [target, onMouseDown, smart, show]);\n\n useEffect(() => {\n if (target && describeTarget && show) {\n const describedBy = target.getAttribute('aria-describedby');\n // Set the attribute to the old attribute plus the id\n target.setAttribute('aria-describedby', describedBy ? `${describedBy} ${id}` : id);\n } else if (target) {\n // Get the old attribute\n const describedBy = target.getAttribute('aria-describedby');\n if (describedBy) {\n // If the old attribute matches the id just remove it entirely\n if (describedBy === id) {\n target.removeAttribute('aria-describedby');\n } else {\n // Otherwise we want to just remove the id that was added and reset the attribute to what it was before\n const oldDescribedBy = describedBy.replace(new RegExp(`(?:^|\\\\s+)${id}`), '');\n target.setAttribute('aria-describedby', oldDescribedBy);\n }\n }\n }\n }, [describeTarget, target, show]);\n\n useEffect(() => {\n if (!show && ignoreDelay) {\n setIgnoreDelay(false);\n }\n }, [show, ignoreDelay]);\n\n const theme = useTheme();\n const tooltipTheme = {\n base: {\n palette: {\n 'primary-background': theme.components.tooltip['background-color'],\n 'foreground-color': theme.components.tooltip['foreground-color'],\n interactive: readableHue(\n theme.base.palette.interactive,\n theme.components.tooltip['background-color']\n )\n }\n }\n };\n\n return (\n <ThemeOverride theme={tooltipTheme}>\n <Popover\n data-testid={testIds.root}\n id={id}\n groupId={groupId}\n {...restProps}\n show={show}\n showDelay={ignoreDelay ? 'none' : showDelay}\n hideDelay={ignoreDelay ? 'none' : hideDelay}\n onMouseOver={() => {\n setShow(true);\n }}\n onMouseOut={() => {\n setShow(false);\n }}\n strategy='fixed'\n as={StyledTooltip}\n role={stringContentOnly ? 'tooltip' : 'dialog'}\n target={target}\n arrow\n placement={placement}\n onMouseDown={onMouseDown}\n hideOnTargetHidden\n ref={tooltipRef}\n >\n {children}\n </Popover>\n </ThemeOverride>\n );\n});\n\nexport default withTestIds(Tooltip, getTooltipTestIds);\n"]}
1
+ {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAA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C9B,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAC7C;aACF;SACF;KACF,CAAC;IAEF,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,YAChC,KAAC,OAAO,mBACO,OAAO,CAAC,IAAI,EACzB,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,KACZ,SAAS,EACb,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,WAAW,EAAE,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,EACD,UAAU,EAAE,GAAG,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAC9C,MAAM,EAAE,MAAM,EACd,KAAK,QACL,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,kBAAkB,QAClB,GAAG,EAAE,UAAU,YAEd,QAAQ,GACD,GACI,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { MutableRefObject, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\nimport type { Delay, PopoverProps } from '../Popover';\nimport { useConsolidatedRef, useTestIds, useTheme, useUID } from '../../hooks';\nimport { calculateFontSize, readableHue } from '../../styles';\nimport { getActiveElement, mouseState, testElForOverflow, withTestIds } from '../../utils';\nimport { ThemeOverride } from '../Configuration';\n\nimport { getTooltipTestIds } from './Tooltip.test-ids';\n\nexport interface TooltipProps extends BaseProps, TestIdProp {\n /** Text content for the tooltip. */\n children: ReactNode;\n /** Element to serve as the tooltip's target. */\n target: Element | null;\n /** Elements to ignore from within the tooltip's target. */\n ignoredElements?: TooltipProps['target'][];\n /**\n * Delay showing the tooltip on mouseenter.\n * @default 'short'\n */\n showDelay?: Delay;\n /**\n * Delay hiding the tooltip on mouseleave.\n * @default 'long'\n */\n hideDelay?: Delay;\n /**\n * If true, the Tooltip will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: PopoverProps['portal'];\n /**\n * If true, the Tooltip will automatically apply an aria-describedby attribute to its target.\n * @default true\n */\n describeTarget?: boolean;\n /**\n * Sets the placement of the tooltip relative to the target.\n * @default 'bottom'\n */\n placement?: PopoverProps['placement'];\n /**\n * Conditionally renders a tooltip only if the associated element's (or its descendants) text content is truncated.\n * To work, the associated element must be be displayed as a CSS \"block box\" i.e. block, inline-block, etc...\n * @default false\n */\n smart?: boolean;\n /**\n * The group that the Popover belongs to. Popovers in the same group will be closed when others open.\n * @default 'tooltip'\n */\n groupId?: PopoverProps['groupId'];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledTooltip = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.components.tooltip['foreground-color']};\n font-size: ${fontSize.xxs};\n max-width: 40ch;\n padding: calc(${theme.base.spacing} / 2);\n white-space: pre-line;\n word-break: break-word;\n --scale-in-size: 0;\n --animation-duration: ${theme.base.animation.speed};\n `;\n});\n\nStyledTooltip.defaultProps = defaultThemeProp;\n\nconst Tooltip: ForwardRefForwardPropsComponent<TooltipProps> = forwardRef(function Tooltip(\n {\n testId,\n children,\n target,\n ignoredElements = [],\n showDelay = 'short',\n hideDelay = 'long',\n placement = 'top',\n describeTarget = true,\n smart,\n groupId = 'tooltip',\n ...restProps\n }: PropsWithoutRef<TooltipProps>,\n ref: TooltipProps['ref']\n) {\n const id = useUID();\n const [show, setShow] = useState(false);\n const [ignoreDelay, setIgnoreDelay] = useState(false);\n const tooltipRef = useConsolidatedRef(ref);\n const lastClickedRef: MutableRefObject<EventTarget | null> = useRef(null);\n const testIds = useTestIds(testId, getTooltipTestIds);\n\n const stringContentOnly =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every(child => typeof child === 'string'));\n\n const onMouseDown = useCallback(\n ({ target: eTarget }: MouseEvent) => {\n lastClickedRef.current = eTarget;\n if (eTarget === tooltipRef.current || eTarget === target) return;\n setShow(false);\n },\n [target]\n );\n\n useEffect(() => {\n if (!target) return;\n\n const showTooltip = () => {\n // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.\n // https://stackoverflow.com/a/64747288\n\n const checkTruncation = (element: Element): boolean => {\n if (\n testElForOverflow(element).some(Boolean) &&\n !['absolute', 'fixed'].includes(window.getComputedStyle(element).position)\n )\n return true;\n\n for (const child of element.children) {\n if (checkTruncation(child)) return true;\n }\n\n return false;\n };\n\n setShow(smart ? checkTruncation(target) : true);\n };\n\n const onFocusIn = () => {\n showTooltip();\n };\n\n const onFocusOut = () => {\n if (!lastClickedRef.current || lastClickedRef.current !== tooltipRef.current) {\n setShow(false);\n }\n lastClickedRef.current = null;\n };\n\n const onMouseEnter = () => {\n if (ignoredElements.some(exclusion => exclusion?.matches(':hover')) || mouseState.primary) {\n return;\n }\n\n showTooltip();\n };\n\n const onMouseLeave = () => {\n if (getActiveElement() !== target) {\n setShow(false);\n }\n };\n\n const onKeyDown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape' && show) {\n setIgnoreDelay(true);\n setShow(false);\n }\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n target.addEventListener('focusin', onFocusIn);\n target.addEventListener('focusout', onFocusOut);\n target.addEventListener('mouseenter', onMouseEnter);\n target.addEventListener('mouseleave', onMouseLeave);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n\n target.removeEventListener('focusin', onFocusIn);\n target.removeEventListener('focusout', onFocusOut);\n target.removeEventListener('mouseenter', onMouseEnter);\n target.removeEventListener('mouseleave', onMouseLeave);\n };\n }, [target, onMouseDown, smart, show]);\n\n useEffect(() => {\n if (target && describeTarget && show) {\n const describedBy = target.getAttribute('aria-describedby');\n // Set the attribute to the old attribute plus the id\n target.setAttribute('aria-describedby', describedBy ? `${describedBy} ${id}` : id);\n } else if (target) {\n // Get the old attribute\n const describedBy = target.getAttribute('aria-describedby');\n if (describedBy) {\n // If the old attribute matches the id just remove it entirely\n if (describedBy === id) {\n target.removeAttribute('aria-describedby');\n } else {\n // Otherwise we want to just remove the id that was added and reset the attribute to what it was before\n const oldDescribedBy = describedBy.replace(new RegExp(`(?:^|\\\\s+)${id}`), '');\n target.setAttribute('aria-describedby', oldDescribedBy);\n }\n }\n }\n }, [describeTarget, target, show]);\n\n useEffect(() => {\n if (!show && ignoreDelay) {\n setIgnoreDelay(false);\n }\n }, [show, ignoreDelay]);\n\n const theme = useTheme();\n const tooltipTheme = {\n base: {\n palette: {\n 'primary-background': theme.components.tooltip['background-color'],\n 'foreground-color': theme.components.tooltip['foreground-color'],\n interactive: readableHue(\n theme.base.palette.interactive,\n theme.components.tooltip['background-color']\n )\n }\n }\n };\n\n return (\n <ThemeOverride theme={tooltipTheme}>\n <Popover\n data-testid={testIds.root}\n id={id}\n groupId={groupId}\n {...restProps}\n show={show}\n showDelay={ignoreDelay ? 'none' : showDelay}\n hideDelay={ignoreDelay ? 'none' : hideDelay}\n onMouseOver={() => {\n setShow(true);\n }}\n onMouseOut={() => {\n setShow(false);\n }}\n strategy='fixed'\n as={StyledTooltip}\n role={stringContentOnly ? 'tooltip' : 'dialog'}\n target={target}\n arrow\n placement={placement}\n onMouseDown={onMouseDown}\n hideOnTargetHidden\n ref={tooltipRef}\n >\n {children}\n </Popover>\n </ThemeOverride>\n );\n});\n\nexport default withTestIds(Tooltip, getTooltipTestIds);\n"]}
@@ -606,12 +606,15 @@ declare const useI18n: () => import("../i18n/translate").TranslationFunction<Rea
606
606
  rte_edit_image: string;
607
607
  rte_delete_image: string;
608
608
  rte_image_key_command: string;
609
+ important: string;
609
610
  expand_trail: string;
610
611
  collapse_trail: string;
611
612
  copy_to: string;
612
613
  subject_label: string;
613
614
  search_results: string;
614
615
  get_next_email: string;
616
+ mark_email_as_important: string;
617
+ email_attachment: string;
615
618
  feed_post_type: string;
616
619
  feed_new_post: string;
617
620
  feed_new_post_submit: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../src/hooks/useI18n.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -602,12 +602,15 @@ declare const _default: {
602
602
  rte_edit_image: string;
603
603
  rte_delete_image: string;
604
604
  rte_image_key_command: string;
605
+ important: string;
605
606
  expand_trail: string;
606
607
  collapse_trail: string;
607
608
  copy_to: string;
608
609
  subject_label: string;
609
610
  search_results: string;
610
611
  get_next_email: string;
612
+ mark_email_as_important: string;
613
+ email_attachment: string;
611
614
  feed_post_type: string;
612
615
  feed_new_post: string;
613
616
  feed_new_post_submit: string;
@@ -1 +1 @@
1
- {"version":3,"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAy/CE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqMxB,6CAA6C;;;;IAK7C,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0F5C,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA7xDzC,wBAg1DE"}
@@ -667,12 +667,15 @@ export default {
667
667
  rte_delete_image: 'Delete image {0}',
668
668
  rte_image_key_command: 'Press enter to edit the image',
669
669
  /* social:Email */
670
+ important: 'Important',
670
671
  expand_trail: 'Expand trail',
671
672
  collapse_trail: 'Collapse trail',
672
673
  copy_to: 'Copy to',
673
674
  subject_label: 'Subject: {0}',
674
675
  search_results: 'Search results',
675
676
  get_next_email: 'Get next email',
677
+ mark_email_as_important: 'Mark email as important',
678
+ email_attachment: '{0} with {1}',
676
679
  /* social:Feed */
677
680
  feed_post_type: 'Post type',
678
681
  feed_new_post: 'Message',