@atlaskit/menu 2.1.1 → 2.1.3

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,18 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 2.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#58188](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58188) [`e15a2a9480ee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e15a2a9480ee) - update deprecation guidance for PopupMenuGroup
8
+
9
+ ## 2.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42474](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42474) [`d7400cb1aa2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7400cb1aa2) - Adds a platform feature flag to adjust Menu Section seperator border widths from 2px to 1px.
14
+ - Updated dependencies
15
+
3
16
  ## 2.1.1
4
17
 
5
18
  ### Patch Changes
@@ -12,7 +12,7 @@ var _menuGroup = _interopRequireDefault(require("./menu-group"));
12
12
  var _excluded = ["maxWidth", "minWidth"];
13
13
  /** @jsx jsx */
14
14
  /**
15
- * @deprecated
15
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
16
16
  */
17
17
  var PopupMenuGroup = function PopupMenuGroup(_ref) {
18
18
  var _ref$maxWidth = _ref.maxWidth,
@@ -70,9 +70,12 @@ var scrollableStyles = (0, _react2.css)({
70
70
  var unscrollableStyles = (0, _react2.css)({
71
71
  flexShrink: 0
72
72
  });
73
- var separatorStyles = (0, _react2.css)({
73
+ var thickSeparatorStyles = (0, _react2.css)({
74
74
  borderBlockStart: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, ".concat(_colors.N30A, ")"), ")")
75
75
  });
76
+ var thinSeparatorStyles = (0, _react2.css)({
77
+ borderBlockStart: "1px solid var(".concat(VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, ".concat(_colors.N30A, ")"), ")")
78
+ });
76
79
  var noSeparatorStyles = (0, _react2.css)({
77
80
  // this is to ensure that adjacent sections without separators don't get additional margins.
78
81
  // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
@@ -133,7 +136,7 @@ var Section = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
133
136
  // NOTE: Firefox allows elements that have "overflow: auto" to gain focus (as if it had tab-index="0")
134
137
  // We have made a deliberate choice to leave this behaviour as is.
135
138
  ,
136
- css: [sectionStyles, isScrollable ? scrollableStyles : unscrollableStyles, hasSeparator ? separatorStyles : noSeparatorStyles],
139
+ css: [sectionStyles, isScrollable ? scrollableStyles : unscrollableStyles, hasSeparator ? (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.section-1px-seperator-borders') ? thinSeparatorStyles : thickSeparatorStyles : noSeparatorStyles],
137
140
  "aria-label": title,
138
141
  "data-testid": testId,
139
142
  role: "group",
@@ -4,7 +4,7 @@ import { jsx } from '@emotion/react';
4
4
  import MenuGroup from './menu-group';
5
5
 
6
6
  /**
7
- * @deprecated
7
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
8
8
  */
9
9
  const PopupMenuGroup = ({
10
10
  maxWidth = 800,
@@ -61,9 +61,12 @@ const scrollableStyles = css({
61
61
  const unscrollableStyles = css({
62
62
  flexShrink: 0
63
63
  });
64
- const separatorStyles = css({
64
+ const thickSeparatorStyles = css({
65
65
  borderBlockStart: `2px solid var(${VAR_SEPARATOR_COLOR}, ${`var(--ds-border, ${N30A})`})`
66
66
  });
67
+ const thinSeparatorStyles = css({
68
+ borderBlockStart: `1px solid var(${VAR_SEPARATOR_COLOR}, ${`var(--ds-border, ${N30A})`})`
69
+ });
67
70
  const noSeparatorStyles = css({
68
71
  // this is to ensure that adjacent sections without separators don't get additional margins.
69
72
  // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
@@ -126,7 +129,7 @@ const Section = /*#__PURE__*/forwardRef(({
126
129
  // NOTE: Firefox allows elements that have "overflow: auto" to gain focus (as if it had tab-index="0")
127
130
  // We have made a deliberate choice to leave this behaviour as is.
128
131
  ,
129
- css: [sectionStyles, isScrollable ? scrollableStyles : unscrollableStyles, hasSeparator ? separatorStyles : noSeparatorStyles],
132
+ css: [sectionStyles, isScrollable ? scrollableStyles : unscrollableStyles, hasSeparator ? getBooleanFF('platform.design-system-team.section-1px-seperator-borders') ? thinSeparatorStyles : thickSeparatorStyles : noSeparatorStyles],
130
133
  "aria-label": title,
131
134
  "data-testid": testId,
132
135
  role: "group",
@@ -6,7 +6,7 @@ import { jsx } from '@emotion/react';
6
6
  import MenuGroup from './menu-group';
7
7
 
8
8
  /**
9
- * @deprecated
9
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
10
10
  */
11
11
  var PopupMenuGroup = function PopupMenuGroup(_ref) {
12
12
  var _ref$maxWidth = _ref.maxWidth,
@@ -63,9 +63,12 @@ var scrollableStyles = css({
63
63
  var unscrollableStyles = css({
64
64
  flexShrink: 0
65
65
  });
66
- var separatorStyles = css({
66
+ var thickSeparatorStyles = css({
67
67
  borderBlockStart: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, ".concat(N30A, ")"), ")")
68
68
  });
69
+ var thinSeparatorStyles = css({
70
+ borderBlockStart: "1px solid var(".concat(VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, ".concat(N30A, ")"), ")")
71
+ });
69
72
  var noSeparatorStyles = css({
70
73
  // this is to ensure that adjacent sections without separators don't get additional margins.
71
74
  // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
@@ -126,7 +129,7 @@ var Section = /*#__PURE__*/forwardRef(function (_ref, ref) {
126
129
  // NOTE: Firefox allows elements that have "overflow: auto" to gain focus (as if it had tab-index="0")
127
130
  // We have made a deliberate choice to leave this behaviour as is.
128
131
  ,
129
- css: [sectionStyles, isScrollable ? scrollableStyles : unscrollableStyles, hasSeparator ? separatorStyles : noSeparatorStyles],
132
+ css: [sectionStyles, isScrollable ? scrollableStyles : unscrollableStyles, hasSeparator ? getBooleanFF('platform.design-system-team.section-1px-seperator-borders') ? thinSeparatorStyles : thickSeparatorStyles : noSeparatorStyles],
130
133
  "aria-label": title,
131
134
  "data-testid": testId,
132
135
  role: "group",
@@ -2,7 +2,7 @@
2
2
  import { jsx } from '@emotion/react';
3
3
  import type { MenuGroupProps } from '../types';
4
4
  /**
5
- * @deprecated
5
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
6
6
  */
7
7
  declare const PopupMenuGroup: ({ maxWidth, minWidth, ...rest }: MenuGroupProps) => jsx.JSX.Element;
8
8
  export default PopupMenuGroup;
@@ -2,7 +2,7 @@
2
2
  import { jsx } from '@emotion/react';
3
3
  import type { MenuGroupProps } from '../types';
4
4
  /**
5
- * @deprecated
5
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
6
6
  */
7
7
  declare const PopupMenuGroup: ({ maxWidth, minWidth, ...rest }: MenuGroupProps) => jsx.JSX.Element;
8
8
  export default PopupMenuGroup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "A collection of composable menu components that can be used anywhere.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -22,6 +22,22 @@
22
22
  "releaseModel": "continuous",
23
23
  "website": {
24
24
  "name": "Menu",
25
+ "subPages": [
26
+ {
27
+ "title": "Popup menu group",
28
+ "id": "popup-menu-group",
29
+ "status": {
30
+ "type": "deprecated",
31
+ "description": "PopupMenuGroup has been deprecated. We recommend using the MenuGroup component instead.",
32
+ "actions": [
33
+ {
34
+ "text": "View MenuGroup documentation",
35
+ "href": "https://atlassian.design/components/menu/menu-group/examples"
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ ],
25
41
  "category": "Components"
26
42
  }
27
43
  },
@@ -29,9 +45,9 @@
29
45
  "@atlaskit/ds-lib": "^2.2.0",
30
46
  "@atlaskit/focus-ring": "^1.3.0",
31
47
  "@atlaskit/platform-feature-flags": "^0.2.0",
32
- "@atlaskit/primitives": "^1.6.0",
48
+ "@atlaskit/primitives": "^1.13.0",
33
49
  "@atlaskit/theme": "^12.6.0",
34
- "@atlaskit/tokens": "^1.28.0",
50
+ "@atlaskit/tokens": "^1.29.0",
35
51
  "@babel/runtime": "^7.0.0",
36
52
  "@emotion/react": "^11.7.1"
37
53
  },
@@ -41,6 +57,7 @@
41
57
  },
42
58
  "devDependencies": {
43
59
  "@af/accessibility-testing": "*",
60
+ "@af/integration-testing": "*",
44
61
  "@af/visual-regression": "*",
45
62
  "@atlaskit/visual-regression": "*",
46
63
  "@atlaskit/webdriver-runner": "*",
@@ -106,6 +123,9 @@
106
123
  "platform-feature-flags": {
107
124
  "platform.design-system-team.unsafe-overrides-killswitch_c8j9m": {
108
125
  "type": "boolean"
126
+ },
127
+ "platform.design-system-team.section-1px-seperator-borders": {
128
+ "type": "boolean"
109
129
  }
110
130
  },
111
131
  "homepage": "https://atlassian.design/components/menu/",
@@ -1,222 +0,0 @@
1
- ## API Report File for "@atlaskit/menu"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- /// <reference types="react" />
8
-
9
- import { ComponentType } from 'react';
10
- import { Context } from 'react';
11
- import { CSSObject } from '@emotion/react';
12
- import { ForwardRefExoticComponent } from 'react';
13
- import { jsx } from '@emotion/react';
14
- import { MemoExoticComponent } from 'react';
15
- import { ReactNode } from 'react';
16
- import { Ref } from 'react';
17
- import { RefAttributes } from 'react';
18
-
19
- // @public (undocumented)
20
- export interface BaseItemProps {
21
- children?: React.ReactNode;
22
- // @deprecated
23
- cssFn?: CSSFn;
24
- description?: JSX.Element | string;
25
- iconAfter?: React.ReactNode;
26
- iconBefore?: React.ReactNode;
27
- isDisabled?: boolean;
28
- isSelected?: boolean;
29
- onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void;
30
- onMouseDown?: React.MouseEventHandler;
31
- // @deprecated
32
- overrides?: Overrides;
33
- shouldDescriptionWrap?: boolean;
34
- shouldTitleWrap?: boolean;
35
- testId?: string;
36
- }
37
-
38
- // @public
39
- export const ButtonItem: MemoExoticComponent<ForwardRefExoticComponent<ButtonItemProps & RefAttributes<HTMLElement>>>;
40
-
41
- // @public (undocumented)
42
- export interface ButtonItemProps extends BaseItemProps {
43
- id?: string;
44
- role?: string;
45
- }
46
-
47
- // @public @deprecated
48
- export interface CSSFn<TState = ItemState extends void ? void : ItemState> {
49
- // (undocumented)
50
- (currentState: TState): CSSObject | CSSObject[];
51
- }
52
-
53
- // @public
54
- export const CustomItem: CustomItemTypeGenericHackProps;
55
-
56
- // @public (undocumented)
57
- export interface CustomItemComponentProps {
58
- 'data-testid'?: string;
59
- children: React.ReactNode;
60
- className: string;
61
- disabled?: boolean;
62
- draggable: boolean;
63
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
64
- onDragStart?: (event: React.DragEvent) => void;
65
- onMouseDown?: (event: React.MouseEvent<HTMLElement>) => void;
66
- ref?: Ref<any>;
67
- tabIndex?: number;
68
- }
69
-
70
- // @public (undocumented)
71
- export interface CustomItemProps<TCustomComponentProps = CustomItemComponentProps> extends BaseItemProps {
72
- component?: React.ComponentType<TCustomComponentProps>;
73
- }
74
-
75
- // @public (undocumented)
76
- interface CustomItemTypeGenericHackProps {
77
- // (undocumented)
78
- <TComponentProps>(props: CustomItemProps<TComponentProps> & {
79
- ref?: any;
80
- } & Omit<TComponentProps, keyof CustomItemComponentProps>): JSX.Element | null;
81
- }
82
-
83
- // @public (undocumented)
84
- export type Dimension = number | string;
85
-
86
- // @public
87
- export const HeadingItem: MemoExoticComponent<({ children, testId, id, cssFn, className: UNSAFE_className, ...rest }: HeadingItemProps) => jsx.JSX.Element>;
88
-
89
- // @public (undocumented)
90
- export interface HeadingItemProps {
91
- children: React.ReactNode;
92
- // @deprecated
93
- cssFn?: StatelessCSSFn;
94
- id?: string;
95
- testId?: string;
96
- }
97
-
98
- // @public (undocumented)
99
- export type ItemState = {
100
- isSelected: boolean;
101
- isDisabled: boolean;
102
- };
103
-
104
- // @public
105
- export const LinkItem: MemoExoticComponent<ForwardRefExoticComponent<LinkItemProps & RefAttributes<HTMLElement>>>;
106
-
107
- // @public (undocumented)
108
- export interface LinkItemProps extends BaseItemProps {
109
- href?: string;
110
- rel?: string;
111
- role?: string;
112
- target?: string;
113
- }
114
-
115
- // @public
116
- export const MenuGroup: ({ isLoading, maxWidth, minWidth, minHeight, maxHeight, testId, role, spacing, className: UNSAFE_className, ...rest }: MenuGroupProps) => jsx.JSX.Element;
117
-
118
- // @public (undocumented)
119
- export interface MenuGroupProps extends MenuGroupSizing {
120
- children: React.ReactNode;
121
- isLoading?: boolean;
122
- onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void;
123
- role?: string;
124
- spacing?: SpacingMode;
125
- testId?: string;
126
- }
127
-
128
- // @public (undocumented)
129
- export interface MenuGroupSizing {
130
- maxHeight?: Dimension;
131
- maxWidth?: Dimension;
132
- minHeight?: Dimension;
133
- minWidth?: Dimension;
134
- }
135
-
136
- // @public @deprecated (undocumented)
137
- export interface Overrides {
138
- // (undocumented)
139
- Title?: TitleOverrides;
140
- }
141
-
142
- // @public @deprecated (undocumented)
143
- export const PopupMenuGroup: ({ maxWidth, minWidth, ...rest }: MenuGroupProps) => jsx.JSX.Element;
144
-
145
- // @public (undocumented)
146
- export interface RenderFunction<TProps = {}> {
147
- // (undocumented)
148
- (Component: ComponentType | string, props: TProps): React.ReactNode;
149
- }
150
-
151
- // @public
152
- export const Section: ForwardRefExoticComponent<SectionProps & RefAttributes<HTMLElement>>;
153
-
154
- // @public (undocumented)
155
- interface SectionProps {
156
- children: React.ReactNode;
157
- hasSeparator?: boolean;
158
- id?: string;
159
- isList?: boolean;
160
- isScrollable?: boolean;
161
- // @deprecated (undocumented)
162
- overrides?: {
163
- HeadingItem?: {
164
- cssFn?: StatelessCSSFn;
165
- };
166
- };
167
- testId?: string;
168
- title?: string;
169
- }
170
- export { SectionProps as SectionBaseProps }
171
- export { SectionProps }
172
-
173
- // @internal
174
- export const SELECTION_STYLE_CONTEXT_DO_NOT_USE: Context<"border" | "none" | "notch">;
175
-
176
- // @public
177
- export const SkeletonHeadingItem: ({ isShimmering, testId, width, cssFn, }: SkeletonHeadingItemProps) => jsx.JSX.Element;
178
-
179
- // @public (undocumented)
180
- export interface SkeletonHeadingItemProps {
181
- // @deprecated
182
- cssFn?: StatelessCSSFn;
183
- isShimmering?: boolean;
184
- testId?: string;
185
- width?: Dimension;
186
- }
187
-
188
- // @public
189
- export const SkeletonItem: ({ hasAvatar, hasIcon, isShimmering, testId, width, cssFn, }: SkeletonItemProps) => jsx.JSX.Element;
190
-
191
- // @public (undocumented)
192
- export interface SkeletonItemProps {
193
- cssFn?: StatelessCSSFn;
194
- hasAvatar?: boolean;
195
- hasIcon?: boolean;
196
- isShimmering?: boolean;
197
- testId?: string;
198
- width?: Dimension;
199
- }
200
-
201
- // @internal
202
- export const SpacingContext: Context<SpacingMode>;
203
-
204
- // @public (undocumented)
205
- type SpacingMode = 'compact' | 'cozy';
206
-
207
- // @public @deprecated (undocumented)
208
- export type StatelessCSSFn = CSSFn<void>;
209
-
210
- // @public @deprecated (undocumented)
211
- export interface TitleOverrides {
212
- // (undocumented)
213
- render?: RenderFunction<{
214
- className?: string;
215
- children: ReactNode;
216
- 'data-item-title': boolean;
217
- }>;
218
- }
219
-
220
- // (No @packageDocumentation comment for this package)
221
-
222
- ```