@atlaskit/avatar-group 9.3.1 → 9.3.2

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,11 @@
1
1
  # @atlaskit/avatar-group
2
2
 
3
+ ## 9.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
3
9
  ## 9.3.1
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.3.1",
3
+ "version": "9.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.3.1",
3
+ "version": "9.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.3.1",
3
+ "version": "9.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { AvatarProps, onAvatarClickHandler } from './types';
3
+ export interface AvatarGroupItemProps {
4
+ avatar: AvatarProps;
5
+ isActive?: boolean;
6
+ isHover?: boolean;
7
+ index: number;
8
+ onAvatarClick?: onAvatarClickHandler;
9
+ testId?: string;
10
+ }
11
+ declare const AvatarGroupItem: FC<AvatarGroupItemProps>;
12
+ export default AvatarGroupItem;
@@ -0,0 +1,110 @@
1
+ /** @jsx jsx */
2
+ import { ElementType, MouseEventHandler } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import { SizeType } from '@atlaskit/avatar';
5
+ import { PositionType } from '@atlaskit/tooltip';
6
+ import { AvatarGroupOverrides, AvatarProps, onAvatarClickHandler } from './types';
7
+ export interface AvatarGroupProps {
8
+ /**
9
+ * Indicates the layout of the avatar-group.
10
+ * Avatars will either be overlapped in a stack, or
11
+ * laid out in an even grid formation
12
+ * Defaults to "stack".
13
+ */
14
+ appearance?: 'grid' | 'stack';
15
+ /**
16
+ * Component used to render each avatar
17
+ */
18
+ avatar?: ElementType<AvatarProps>;
19
+ /**
20
+ * The maximum number of avatars allowed in the list.
21
+ * Defaults to 5 when displayed as a stack,
22
+ * and 11 when displayed as a grid.
23
+ */
24
+ maxCount?: number;
25
+ /**
26
+ * Defines the size of the avatar.
27
+ * Defaults to "medium".
28
+ */
29
+ size?: SizeType;
30
+ /**
31
+ * Typically the background color that the avatar is presented on.
32
+ * Accepts any color argument that the CSS border-color property accepts.
33
+ */
34
+ borderColor?: string;
35
+ /**
36
+ * Array of avatar data passed to each `avatar` component.
37
+ * These props will be spread on to the component passed into avatar.
38
+ */
39
+ data: Array<AvatarProps>;
40
+ /**
41
+ * Handle the click event on the avatar item.
42
+ * Note that if an onClick prop is provided as part of avatar data, it will take precedence over onAvatarClick.
43
+ */
44
+ onAvatarClick?: onAvatarClickHandler;
45
+ /**
46
+ * Take control of the click event on the more indicator.
47
+ * This will cancel the default dropdown behavior.
48
+ */
49
+ onMoreClick?: MouseEventHandler;
50
+ /**
51
+ * Provide additional props to the MoreButton.
52
+ * Example use cases: altering tab order by providing tabIndex;
53
+ * adding onClick behaviour without losing the default dropdown
54
+ */
55
+ showMoreButtonProps?: Partial<React.HTMLAttributes<HTMLElement>>;
56
+ /**
57
+ * Element the overflow popup should be attached to.
58
+ * Defaults to "viewport".
59
+ */
60
+ boundariesElement?: 'viewport' | 'window' | 'scrollParent';
61
+ /**
62
+ * A `testId` prop is provided for specified elements,
63
+ * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
64
+ * serving as a hook for automated tests.
65
+ */
66
+ /**
67
+ * Will set these elements when defined:
68
+ * - Container element - `{testId}--avatar-group`
69
+ * - Avatar items - `{testId}--avatar-{index}`
70
+ * - Overflow menu button - `{testId}--overflow-menu--trigger`
71
+ * - Overflow menu content - `{testId}--overflow-menu--content`
72
+ */
73
+ testId?: string;
74
+ /**
75
+ * Custom overrides for the composed components.
76
+ */
77
+ overrides?: AvatarGroupOverrides;
78
+ /**
79
+ *
80
+ * Where the tooltip should appear relative to its target.
81
+ * Defaults to tooltip position "bottom".
82
+ */
83
+ tooltipPosition?: Extract<PositionType, 'bottom' | 'top'>;
84
+ /**
85
+ * Disables tooltips
86
+ */
87
+ isTooltipDisabled?: boolean;
88
+ /**
89
+ Text to be used as aria-label for the list of avatars.
90
+ Screen reader announcement with default label, which is `avatar group`, is `list, avatar group, X items`.
91
+
92
+ The label should describe the `AvatarGroup`'s entities, for instance:
93
+ - `label="team members"`, screen reader announcement would be `list team members, X items`
94
+ - `label="reviewers"` screen reader announcement would be `list reviewers, X items`
95
+
96
+ When there are several AvatarGroups on the page you should use a unique label to let users distinguish different lists.
97
+ */
98
+ label?: string;
99
+ }
100
+ /**
101
+ * __Avatar group__
102
+ *
103
+ * An avatar group displays a number of avatars grouped together in a stack or grid.
104
+ *
105
+ * - [Examples](https://atlassian.design/components/avatar-group/examples)
106
+ * - [Code](https://atlassian.design/components/avatar-group/code)
107
+ * - [Usage](https://atlassian.design/components/avatar-group/usage)
108
+ */
109
+ declare const AvatarGroup: ({ appearance, avatar, borderColor, boundariesElement, data, isTooltipDisabled, maxCount, onAvatarClick, onMoreClick, overrides, showMoreButtonProps, size, testId, label, tooltipPosition, }: AvatarGroupProps) => jsx.JSX.Element;
110
+ export default AvatarGroup;
@@ -0,0 +1,8 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode } from 'react';
3
+ declare const Grid: FC<{
4
+ children: ReactNode;
5
+ testId?: string;
6
+ 'aria-label': string;
7
+ }>;
8
+ export default Grid;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { AvatarClickEventHandler, AvatarPropTypes } from '@atlaskit/avatar';
3
+ export interface MoreIndicatorProps extends AvatarPropTypes {
4
+ count: number;
5
+ 'aria-controls'?: string;
6
+ 'aria-expanded'?: boolean;
7
+ 'aria-haspopup'?: boolean;
8
+ buttonProps: Partial<React.HTMLAttributes<HTMLElement>>;
9
+ onClick: AvatarClickEventHandler;
10
+ isActive: boolean;
11
+ }
12
+ declare const MoreIndicator: import("react").ForwardRefExoticComponent<MoreIndicatorProps & import("react").RefAttributes<HTMLButtonElement>>;
13
+ export default MoreIndicator;
@@ -0,0 +1,8 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode } from 'react';
3
+ declare const Stack: FC<{
4
+ children: ReactNode;
5
+ testId?: string;
6
+ 'aria-label': string;
7
+ }>;
8
+ export default Stack;
@@ -0,0 +1,20 @@
1
+ import type { ElementType, ReactNode } from 'react';
2
+ import type { AnalyticsEvent } from '@atlaskit/analytics-next';
3
+ import type { AvatarPropTypes } from '@atlaskit/avatar';
4
+ import type { AvatarGroupItemProps } from './avatar-group-item';
5
+ export type DeepRequired<T> = {
6
+ [P in keyof T]-?: Required<T[P]>;
7
+ };
8
+ export type AvatarProps = AvatarPropTypes & {
9
+ name: string;
10
+ key?: string | number;
11
+ };
12
+ export interface AvatarGroupOverrides {
13
+ AvatarGroupItem?: {
14
+ render?: (Component: ElementType<AvatarGroupItemProps>, props: AvatarGroupItemProps, index: number) => ReactNode;
15
+ };
16
+ Avatar?: {
17
+ render?: (Component: ElementType<AvatarProps>, props: AvatarProps, index: number) => ReactNode;
18
+ };
19
+ }
20
+ export type onAvatarClickHandler = (event: React.MouseEvent, analyticsEvent: AnalyticsEvent | undefined, index: number) => void;
@@ -0,0 +1,2 @@
1
+ import { AvatarProps } from './types';
2
+ export declare const composeUniqueKey: (props: AvatarProps, index: number) => string | number;
@@ -0,0 +1,3 @@
1
+ export { default } from './components/avatar-group';
2
+ export type { AvatarGroupProps } from './components/avatar-group';
3
+ export type { AvatarProps } from './components/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.3.1",
3
+ "version": "9.3.2",
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/"
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@atlaskit/avatar": "^21.3.0",
38
- "@atlaskit/menu": "^1.6.0",
38
+ "@atlaskit/menu": "^1.7.0",
39
39
  "@atlaskit/popup": "^1.6.0",
40
40
  "@atlaskit/theme": "^12.5.0",
41
41
  "@atlaskit/tokens": "^1.4.0",