Skip to content

Commit

Permalink
Merge branch 'main' into pfg-phase-1-new4
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-kot authored Sep 9, 2024
2 parents f3a4b50 + 824074c commit d7a63c3
Show file tree
Hide file tree
Showing 16 changed files with 733 additions and 181 deletions.
317 changes: 169 additions & 148 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"ts-loader": "^9.2.6",
"typescript": "^4.6.4",
"wait-on": "^7.2.0",
"webpack": "^5.76.0",
"webpack": "^5.94.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.7.4"
},
Expand Down
10 changes: 9 additions & 1 deletion src/popover/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import React, { useCallback, useEffect, useRef } from 'react';
import clsx from 'clsx';

import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';

import { ButtonProps } from '../button/interfaces';
import { InternalButton } from '../button/internal';
import { useInternalI18n } from '../i18n/context';
Expand All @@ -24,6 +26,8 @@ export interface PopoverBodyProps {

className?: string;
ariaLabelledby?: string;

closeAnalyticsAction?: string;
}

export default function PopoverBody({
Expand All @@ -36,6 +40,7 @@ export default function PopoverBody({
overflowVisible,
className,
ariaLabelledby,
closeAnalyticsAction,
}: PopoverBodyProps) {
const i18n = useInternalI18n('popover');
const labelledById = useUniqueId('awsui-popover-');
Expand Down Expand Up @@ -63,7 +68,10 @@ export default function PopoverBody({
}, [showDismissButton]);

const dismissButton = (showDismissButton ?? null) && (
<div className={styles.dismiss}>
<div
className={styles.dismiss}
{...(closeAnalyticsAction ? getAnalyticsMetadataAttribute({ action: closeAnalyticsAction }) : {})}
>
<InternalButton
variant="icon"
formAction="none"
Expand Down
3 changes: 3 additions & 0 deletions src/popover/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface InternalPopoverProps extends Omit<PopoverProps, 'triggerType' |
__onOpen?: NonCancelableEventHandler<null>;
triggerType?: PopoverProps.TriggerType | 'filtering-token';
size: PopoverProps.Size | 'content';
__closeAnalyticsAction?: string;
}

export interface InternalPopoverRef {
Expand Down Expand Up @@ -54,6 +55,7 @@ function InternalPopover(

__onOpen,
__internalRootRef = null,
__closeAnalyticsAction,
...restProps
}: InternalPopoverProps,
ref: React.Ref<InternalPopoverRef>
Expand Down Expand Up @@ -166,6 +168,7 @@ function InternalPopover(
header={header}
onDismiss={onDismiss}
overflowVisible="both"
closeAnalyticsAction={__closeAnalyticsAction}
>
{content}
</PopoverBody>
Expand Down
Loading

0 comments on commit d7a63c3

Please sign in to comment.