@atlaskit/avatar-group 12.10.10 → 12.10.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/avatar-group
2
2
 
3
+ ## 12.10.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 12.10.11
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 12.10.10
4
16
 
5
17
  ### Patch Changes
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/avatar-group.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/avatar-group.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/avatar-group.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "12.10.10",
3
+ "version": "12.10.12",
4
4
  "description": "An avatar group displays a number of avatars grouped together in a stack or grid.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,10 +37,10 @@
37
37
  "@atlaskit/menu": "^8.5.0",
38
38
  "@atlaskit/motion": "^6.2.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
- "@atlaskit/popup": "^4.23.0",
41
- "@atlaskit/tokens": "^13.3.0",
40
+ "@atlaskit/popup": "^4.25.0",
41
+ "@atlaskit/tokens": "^13.4.0",
42
42
  "@atlaskit/tooltip": "^22.6.0",
43
- "@atlaskit/top-layer": "^0.16.0",
43
+ "@atlaskit/top-layer": "^0.18.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@compiled/react": "^0.20.0",
46
46
  "bind-event-listener": "^3.0.0"
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/form": "^15.5.0",
59
59
  "@atlaskit/icon": "^35.4.0",
60
60
  "@atlaskit/link": "^3.4.0",
61
- "@atlaskit/modal-dialog": "^15.2.0",
61
+ "@atlaskit/modal-dialog": "^15.3.0",
62
62
  "@atlaskit/primitives": "^19.0.0",
63
63
  "@atlaskit/section-message": "^8.13.0",
64
64
  "@atlaskit/toggle": "^16.1.0",
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/types.d.ts"
17
10
  }
@@ -1,25 +0,0 @@
1
- import React, { type ElementType } from 'react';
2
- import Avatar from '@atlaskit/avatar';
3
- import { type getOverrides } from './get-overrides';
4
- import { type AvatarProps, type onAvatarClickHandler } from './types';
5
- export interface AvatarGroupItemProps {
6
- avatar: AvatarProps;
7
- /**
8
- * Custom component used to render the avatar inside the dropdown menu item.
9
- * When not provided, defaults to the standard Avatar component.
10
- */
11
- avatarComponent?: typeof Avatar | ElementType<AvatarProps>;
12
- isActive?: boolean;
13
- isHover?: boolean;
14
- avatarOverrides?: ReturnType<typeof getOverrides>['Avatar'];
15
- index: number;
16
- onAvatarClick?: onAvatarClickHandler;
17
- testId?: string;
18
- /**
19
- * Use this to override the accessibility role for the element.
20
- * When used inside a dropdown menu, this should be set to "menuitem".
21
- */
22
- role?: string;
23
- }
24
- declare const AvatarGroupItem: React.ForwardRefExoticComponent<React.PropsWithoutRef<AvatarGroupItemProps> & React.RefAttributes<HTMLElement>>;
25
- export default AvatarGroupItem;
@@ -1,44 +0,0 @@
1
- import React, { type MouseEventHandler } from 'react';
2
- import { type AvatarGroupOverrides, type AvatarProps, type onAvatarClickHandler } from './types';
3
- type TMoreDropdownTopLayerProps = {
4
- isOpen: boolean;
5
- onClose: () => void;
6
- isTriggeredUsingKeyboard: boolean;
7
- data: Array<AvatarProps>;
8
- max: number;
9
- overrides?: AvatarGroupOverrides;
10
- onAvatarClick?: onAvatarClickHandler;
11
- testId?: string;
12
- labelId: string;
13
- renderMoreButton: (props: {
14
- 'aria-controls'?: string;
15
- 'aria-expanded'?: boolean;
16
- 'aria-haspopup'?: boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid';
17
- onClick: MouseEventHandler;
18
- ref?: React.Ref<HTMLElement>;
19
- }) => React.ReactNode;
20
- handleTriggerClicked: (event: React.MouseEvent | KeyboardEvent) => void;
21
- bindFocus: {
22
- onFocus: (event: React.FocusEvent) => void;
23
- onBlur: (event: React.FocusEvent) => void;
24
- };
25
- };
26
- /**
27
- * Top-layer implementation of the avatar group overflow dropdown.
28
- *
29
- * Replaces the legacy `@atlaskit/popup` rendering pipeline
30
- * (Popper.js + Portal + focus-trap + @atlaskit/layering)
31
- * with the native Popover API + CSS Anchor Positioning via `@atlaskit/top-layer`.
32
- *
33
- * Uses `role="menu"` with arrow key navigation for correct menu semantics.
34
- *
35
- * Gated behind the `platform-dst-top-layer` feature flag.
36
- *
37
- * Legacy props that are no-ops in the top-layer path (not accepted here):
38
- * - zIndex: stacking managed by browser top layer
39
- * - shouldRenderToParent: always renders in top layer
40
- * - boundary / rootBoundary: viewport is the natural boundary
41
- * - shouldFlip: CSS Anchor Positioning handles flipping
42
- */
43
- export declare function MoreDropdownTopLayer({ isOpen, onClose, isTriggeredUsingKeyboard: _isTriggeredUsingKeyboard, data, max, overrides, onAvatarClick, testId, labelId, renderMoreButton, handleTriggerClicked, bindFocus: _bindFocus, }: TMoreDropdownTopLayerProps): React.JSX.Element;
44
- export {};
@@ -1,127 +0,0 @@
1
- import React, { type ElementType, type MouseEventHandler } from 'react';
2
- import Avatar, { type AppearanceType } from '@atlaskit/avatar';
3
- import { type PositionType } from '@atlaskit/tooltip';
4
- import { type AvatarGroupOverrides, type AvatarGroupSize, type AvatarProps, type onAvatarClickHandler } from './types';
5
- export interface AvatarGroupProps {
6
- /**
7
- * Indicates the layout of the avatar group.
8
- * Avatars will either be overlapped in a stack, or
9
- * laid out in an even grid formation.
10
- * Defaults to "stack".
11
- */
12
- appearance?: 'grid' | 'stack';
13
- /**
14
- * Indicates the shape of the more indicator. Most more indicators are circular, but square more indicators
15
- * can be used for 'container' objects.
16
- */
17
- moreIndicatorAppearance?: AppearanceType;
18
- /**
19
- * Component used to render each avatar.
20
- */
21
- avatar?: typeof Avatar | ElementType<AvatarProps>;
22
- /**
23
- * The maximum number of avatars allowed in the list.
24
- * Defaults to 5 when displayed as a stack,
25
- * and 11 when displayed as a grid.
26
- */
27
- maxCount?: number;
28
- /**
29
- * Defines the size of the avatar.
30
- * Defaults to "medium".
31
- *
32
- * Note: The "xsmall" size that exists on Avatar is not supported here because elements such as the more indicator cannot be displayed in an accessible manner at that size.
33
- */
34
- size?: AvatarGroupSize;
35
- /**
36
- * Typically the background color that the avatar is presented on.
37
- * Accepts any color argument that the CSS border-color property accepts.
38
- */
39
- borderColor?: string;
40
- /**
41
- * An array of avatar prop data, that are spread onto each `avatar` component.
42
- *
43
- * For further usage information on AvatarPropTypes, the supported props for `avatar`, refer to [Avatar's prop documentation](https://atlassian.design/components/avatar/code).
44
- */
45
- data: Array<AvatarProps>;
46
- /**
47
- * Handle the click event on the avatar item.
48
- * Note that if an onClick prop is provided as part of avatar data, it will take precedence over onAvatarClick.
49
- */
50
- onAvatarClick?: onAvatarClickHandler;
51
- /**
52
- * Take control of the click event on the more indicator.
53
- * This will cancel the default dropdown behavior.
54
- */
55
- onMoreClick?: MouseEventHandler;
56
- /**
57
- * Provide additional props to the MoreButton.
58
- * Example use cases: altering tab order by providing tabIndex;
59
- * adding onClick behaviour without losing the default dropdown
60
- */
61
- showMoreButtonProps?: Partial<React.HTMLAttributes<HTMLElement>>;
62
- /**
63
- * Element the overflow popup should be attached to.
64
- * Defaults to "viewport".
65
- */
66
- boundariesElement?: 'viewport' | 'window' | 'scrollParent';
67
- /**
68
- * A `testId` prop is provided for specified elements,
69
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
70
- * serving as a hook for automated tests.
71
- */
72
- /**
73
- * Will set these elements when defined:
74
- * - Container element - `{testId}--avatar-group`
75
- * - Avatar items - `{testId}--avatar-{index}`
76
- * - Overflow menu button - `{testId}--overflow-menu--trigger`
77
- * - Overflow menu content - `{testId}--overflow-menu--content`
78
- */
79
- testId?: string;
80
- /**
81
- * Custom overrides for the composed components.
82
- */
83
- overrides?: AvatarGroupOverrides;
84
- /**
85
- *
86
- * Where the tooltip should appear relative to its target.
87
- * Defaults to tooltip position "bottom".
88
- */
89
- tooltipPosition?: Extract<PositionType, 'bottom' | 'top'>;
90
- /**
91
- * Disables tooltips.
92
- */
93
- isTooltipDisabled?: boolean;
94
- /**
95
- * Text to be used as aria-label for the list of avatars.
96
- * Screen reader announcement with default label, which is `avatar group`, is `list, avatar group, X items`.
97
- *
98
- * The label should describe the `AvatarGroup`'s entities, for instance:
99
- * - `label="team members"`, screen reader announcement would be `list team members, X items`
100
- * - `label="reviewers"` screen reader announcement would be `list reviewers, X items`
101
- *
102
- * When there are several AvatarGroups on the page you should use a unique label to let users distinguish different lists.
103
- */
104
- label?: string;
105
- /**
106
- * Determines whether the 'show more' popup has `shouldRenderToParent` applied.
107
- */
108
- shouldPopupRenderToParent?: boolean;
109
- /**
110
- * Text to be used as aria-label for the more indicator.
111
- * If provided, this will be used exactly as-is for the aria-label.
112
- * If not provided, but an `aria-label` is provided via `showMoreButtonProps`, that will be used instead.
113
- * If neither is provided, the aria-label will default to "N more people" where N is the number of people that are not visible (e.g. "5 more people").
114
- */
115
- moreIndicatorLabel?: string;
116
- }
117
- /**
118
- * __Avatar group__
119
- *
120
- * An avatar group displays a number of avatars grouped together in a stack or grid.
121
- *
122
- * - [Examples](https://atlassian.design/components/avatar-group/examples)
123
- * - [Code](https://atlassian.design/components/avatar-group/code)
124
- * - [Usage](https://atlassian.design/components/avatar-group/usage)
125
- */
126
- declare const AvatarGroup: ({ appearance, moreIndicatorAppearance, avatar, borderColor, boundariesElement, data, isTooltipDisabled, maxCount, onAvatarClick, onMoreClick, overrides, showMoreButtonProps, size, testId, label, moreIndicatorLabel, tooltipPosition, shouldPopupRenderToParent, }: AvatarGroupProps) => React.JSX.Element;
127
- export default AvatarGroup;
@@ -1,2 +0,0 @@
1
- import type { AvatarGroupOverrides, DeepRequired } from './types';
2
- export declare function getOverrides(overrides?: AvatarGroupOverrides): DeepRequired<AvatarGroupOverrides>;
@@ -1,12 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type FC, type ReactNode } from 'react';
6
- declare const Grid: FC<{
7
- children: ReactNode;
8
- testId?: string;
9
- 'aria-label': string;
10
- id?: string;
11
- }>;
12
- export default Grid;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { type FocusableElement } from '../../types';
3
- /**
4
- * Context provider which maintains the list of focusable elements and a method to
5
- * register new menu items.
6
- * This list drives the keyboard navgation of the menu.
7
- *
8
- */
9
- export declare const FocusManagerContext: React.Context<{
10
- menuItemRefs: FocusableElement[];
11
- registerRef: (ref: FocusableElement) => void;
12
- }>;
@@ -1,14 +0,0 @@
1
- import { type FC, type ReactNode } from 'react';
2
- /**
3
- * __Focus manager__
4
- *
5
- * A focus manager {description}.
6
- *
7
- * - [Examples](https://atlassian.design/components/{packageName}/examples)
8
- * - [Code](https://atlassian.design/components/{packageName}/code)
9
- * - [Usage](https://atlassian.design/components/{packageName}/usage)
10
- */
11
- declare const FocusManager: FC<{
12
- children: ReactNode;
13
- }>;
14
- export default FocusManager;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { type PopupAvatarGroupProps } from '../../types';
3
- /**
4
- * It sets focus to the first avatar when popup is open.
5
- */
6
- declare const PopupAvatarGroup: ({ children, isLoading, maxHeight, maxWidth, minHeight, minWidth, onClick, role, setInitialFocusRef, spacing, testId, ...rest }: PopupAvatarGroupProps) => React.JSX.Element;
7
- export default PopupAvatarGroup;
@@ -1,4 +0,0 @@
1
- import { type RefObject } from 'react';
2
- import { type FocusableElement } from '../../types';
3
- declare function useRegisterItemWithFocusManager(): RefObject<FocusableElement>;
4
- export default useRegisterItemWithFocusManager;
@@ -1,2 +0,0 @@
1
- import { type FocusableElement } from '../../types';
2
- export default function handleFocus(refs: Array<FocusableElement>): (e: KeyboardEvent) => void;
@@ -1,18 +0,0 @@
1
- import { type AppearanceType, type AvatarClickEventHandler } from '@atlaskit/avatar';
2
- import { type AvatarGroupSize } from './types';
3
- export interface MoreIndicatorProps {
4
- count: number;
5
- 'aria-controls'?: string;
6
- 'aria-expanded'?: boolean;
7
- 'aria-haspopup'?: boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid';
8
- moreIndicatorLabel?: string;
9
- buttonProps: Partial<React.HTMLAttributes<HTMLElement>>;
10
- onClick: AvatarClickEventHandler;
11
- isActive: boolean;
12
- size: AvatarGroupSize;
13
- appearance?: AppearanceType;
14
- borderColor?: string;
15
- testId?: string;
16
- }
17
- declare const MoreIndicator: React.ForwardRefExoticComponent<React.PropsWithoutRef<MoreIndicatorProps> & React.RefAttributes<HTMLButtonElement>>;
18
- export default MoreIndicator;
@@ -1,14 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type FC, type ReactNode } from 'react';
6
- import { type AvatarGroupSize } from './types';
7
- declare const Stack: FC<{
8
- children: ReactNode;
9
- testId?: string;
10
- 'aria-label': string;
11
- size: AvatarGroupSize;
12
- id?: string;
13
- }>;
14
- export default Stack;
@@ -1,32 +0,0 @@
1
- import type { ElementType, ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
2
- import type { AnalyticsEvent } from '@atlaskit/analytics-next';
3
- import { type default as Avatar, type AvatarPropTypes, type SizeType } from '@atlaskit/avatar';
4
- import { type MenuGroupProps } from '@atlaskit/menu';
5
- import { type ContentProps } from '@atlaskit/popup';
6
- import type { AvatarGroupItemProps } from './avatar-group-item';
7
- import { type MoreIndicatorProps } from './more-indicator';
8
- export type DeepRequired<T> = {
9
- [P in keyof T]-?: Required<T[P]>;
10
- };
11
- export type AvatarProps = AvatarPropTypes & {
12
- name: string;
13
- key?: string | number;
14
- };
15
- export interface AvatarGroupOverrides {
16
- AvatarGroupItem?: {
17
- render?: (Component: ForwardRefExoticComponent<AvatarGroupItemProps & RefAttributes<HTMLElement>>, props: AvatarGroupItemProps, index: number) => ReactNode;
18
- };
19
- Avatar?: {
20
- render?: (Component: typeof Avatar | ElementType<AvatarProps>, props: AvatarProps, index: number) => ReactNode;
21
- };
22
- MoreIndicator?: {
23
- render?: (Component: ForwardRefExoticComponent<MoreIndicatorProps & RefAttributes<HTMLButtonElement>>, props: MoreIndicatorProps) => ReactNode;
24
- };
25
- }
26
- export type onAvatarClickHandler = (event: React.MouseEvent, analyticsEvent: AnalyticsEvent | undefined, index: number) => void;
27
- export type FocusableElement = HTMLAnchorElement | HTMLButtonElement;
28
- export type Action = 'next' | 'prev' | 'first' | 'last';
29
- export interface PopupAvatarGroupProps extends MenuGroupProps {
30
- setInitialFocusRef?: ContentProps['setInitialFocusRef'];
31
- }
32
- export type AvatarGroupSize = Exclude<SizeType, 'xsmall'>;
@@ -1,2 +0,0 @@
1
- import type { AvatarProps } from './types';
2
- export declare const composeUniqueKey: (props: AvatarProps, index: number) => string | number;
@@ -1,2 +0,0 @@
1
- export { default } from '../components/avatar-group';
2
- export type { AvatarGroupProps } from '../components/avatar-group';
@@ -1 +0,0 @@
1
- export type { AvatarProps, AvatarGroupOverrides } from '../components/types';
@@ -1,3 +0,0 @@
1
- export { default } from './components/avatar-group';
2
- export type { AvatarGroupProps } from './components/avatar-group';
3
- export type { AvatarProps, AvatarGroupOverrides } from './components/types';