@atlaskit/menu 1.9.5 → 1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 1.9.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`71c51a488d7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/71c51a488d7) - Removes max-height constraint on compact density.
8
+
3
9
  ## 1.9.5
4
10
 
5
11
  ### Patch Changes
@@ -85,7 +85,6 @@ var spacingMapStyles = {
85
85
  }),
86
86
  compact: (0, _react2.css)({
87
87
  minHeight: 32,
88
- maxHeight: 32,
89
88
  // 4 * 2 (8) + icon (24) === 32
90
89
  paddingBlock: "var(--ds-space-050, 4px)",
91
90
  paddingInline: "var(--ds-space-150, 12px)"
@@ -15,7 +15,7 @@ var _constants = require("@atlaskit/theme/constants");
15
15
  var _typography = require("@atlaskit/theme/typography");
16
16
  var _headingItem = _interopRequireDefault(require("../menu-item/heading-item"));
17
17
  var _excluded = ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id", "isList"];
18
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
18
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview */
19
19
  /** @jsx jsx */
20
20
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
21
21
  var gridSize = (0, _constants.gridSize)();
@@ -38,7 +38,7 @@ var sectionStyles = (0, _react2.css)({
38
38
  height: sectionPaddingTopBottom,
39
39
  content: '""'
40
40
  },
41
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
41
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
42
42
  '& [data-ds--menu--heading-item]': {
43
43
  marginTop: itemHeadingTopMargin,
44
44
  marginBottom: itemHeadingBottomMargin,
@@ -46,7 +46,7 @@ var sectionStyles = (0, _react2.css)({
46
46
  marginTop: itemHeadingTopMargin - sectionPaddingTopBottom
47
47
  }
48
48
  },
49
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
49
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
50
50
  '& [data-ds--menu--skeleton-heading-item]': {
51
51
  marginTop: skeletonHeadingTopMargin,
52
52
  marginBottom: skeletonHeadingBottomMargin,
@@ -74,7 +74,7 @@ var separatorStyles = (0, _react2.css)({
74
74
  });
75
75
  var noSeparatorStyles = (0, _react2.css)({
76
76
  // this is to ensure that adjacent sections without separators don't get additional margins.
77
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
77
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
78
78
  '[data-section] + &': {
79
79
  marginTop: -6
80
80
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "sideEffects": false
5
5
  }
@@ -74,7 +74,6 @@ const spacingMapStyles = {
74
74
  }),
75
75
  compact: css({
76
76
  minHeight: 32,
77
- maxHeight: 32,
78
77
  // 4 * 2 (8) + icon (24) === 32
79
78
  paddingBlock: "var(--ds-space-050, 4px)",
80
79
  paddingInline: "var(--ds-space-150, 12px)"
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview */
3
3
  /** @jsx jsx */
4
4
  import { Children, forwardRef, Fragment } from 'react';
5
5
  import { css, jsx } from '@emotion/react';
@@ -29,7 +29,7 @@ const sectionStyles = css({
29
29
  height: sectionPaddingTopBottom,
30
30
  content: '""'
31
31
  },
32
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
32
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
33
33
  '& [data-ds--menu--heading-item]': {
34
34
  marginTop: itemHeadingTopMargin,
35
35
  marginBottom: itemHeadingBottomMargin,
@@ -37,7 +37,7 @@ const sectionStyles = css({
37
37
  marginTop: itemHeadingTopMargin - sectionPaddingTopBottom
38
38
  }
39
39
  },
40
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
40
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
41
41
  '& [data-ds--menu--skeleton-heading-item]': {
42
42
  marginTop: skeletonHeadingTopMargin,
43
43
  marginBottom: skeletonHeadingBottomMargin,
@@ -65,7 +65,7 @@ const separatorStyles = css({
65
65
  });
66
66
  const noSeparatorStyles = css({
67
67
  // this is to ensure that adjacent sections without separators don't get additional margins.
68
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
68
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
69
69
  '[data-section] + &': {
70
70
  marginTop: -6
71
71
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "sideEffects": false
5
5
  }
@@ -77,7 +77,6 @@ var spacingMapStyles = {
77
77
  }),
78
78
  compact: css({
79
79
  minHeight: 32,
80
- maxHeight: 32,
81
80
  // 4 * 2 (8) + icon (24) === 32
82
81
  paddingBlock: "var(--ds-space-050, 4px)",
83
82
  paddingInline: "var(--ds-space-150, 12px)"
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id", "isList"];
4
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
4
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview */
5
5
  /** @jsx jsx */
6
6
  import { Children, forwardRef, Fragment } from 'react';
7
7
  import { css, jsx } from '@emotion/react';
@@ -31,7 +31,7 @@ var sectionStyles = css({
31
31
  height: sectionPaddingTopBottom,
32
32
  content: '""'
33
33
  },
34
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
34
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
35
35
  '& [data-ds--menu--heading-item]': {
36
36
  marginTop: itemHeadingTopMargin,
37
37
  marginBottom: itemHeadingBottomMargin,
@@ -39,7 +39,7 @@ var sectionStyles = css({
39
39
  marginTop: itemHeadingTopMargin - sectionPaddingTopBottom
40
40
  }
41
41
  },
42
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
42
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
43
43
  '& [data-ds--menu--skeleton-heading-item]': {
44
44
  marginTop: skeletonHeadingTopMargin,
45
45
  marginBottom: skeletonHeadingBottomMargin,
@@ -67,7 +67,7 @@ var separatorStyles = css({
67
67
  });
68
68
  var noSeparatorStyles = css({
69
69
  // this is to ensure that adjacent sections without separators don't get additional margins.
70
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
70
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
71
71
  '[data-section] + &': {
72
72
  marginTop: -6
73
73
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "sideEffects": false
5
5
  }
@@ -111,7 +111,7 @@ export interface SectionProps {
111
111
  */
112
112
  title?: string;
113
113
  /**
114
- * Specifically adds <ul> and <li> elements around the items for better semantic markup if it is a list of items
114
+ * Adds `<ul>` and `<li>` tags around the items for better semantic markup in a list of items.
115
115
  */
116
116
  isList?: boolean;
117
117
  }
@@ -111,7 +111,7 @@ export interface SectionProps {
111
111
  */
112
112
  title?: string;
113
113
  /**
114
- * Specifically adds <ul> and <li> elements around the items for better semantic markup if it is a list of items
114
+ * Adds `<ul>` and `<li>` tags around the items for better semantic markup in a list of items.
115
115
  */
116
116
  isList?: boolean;
117
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "description": "A collection of composable menu components that can be used anywhere.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -15,7 +15,7 @@
15
15
  "sideEffects": false,
16
16
  "atlaskit:src": "src/index.tsx",
17
17
  "atlassian": {
18
- "team": "Design System Team",
18
+ "team": "Design System Pyxis",
19
19
  "productPushConsumption": [
20
20
  "jira"
21
21
  ],
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/platform-feature-flags": "^0.2.0",
33
33
  "@atlaskit/primitives": "^1.0.0",
34
34
  "@atlaskit/theme": "^12.5.0",
35
- "@atlaskit/tokens": "^1.11.0",
35
+ "@atlaskit/tokens": "^1.13.0",
36
36
  "@babel/runtime": "^7.0.0",
37
37
  "@emotion/react": "^11.7.1"
38
38
  },
@@ -0,0 +1,221 @@
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, ...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: ({ maxWidth, minWidth, minHeight, maxHeight, testId, role, spacing, ...rest }: MenuGroupProps) => jsx.JSX.Element;
117
+
118
+ // @public (undocumented)
119
+ export interface MenuGroupProps extends MenuGroupSizing {
120
+ children: React.ReactNode;
121
+ onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void;
122
+ role?: string;
123
+ spacing?: SpacingMode;
124
+ testId?: string;
125
+ }
126
+
127
+ // @public (undocumented)
128
+ export interface MenuGroupSizing {
129
+ maxHeight?: Dimension;
130
+ maxWidth?: Dimension;
131
+ minHeight?: Dimension;
132
+ minWidth?: Dimension;
133
+ }
134
+
135
+ // @public @deprecated (undocumented)
136
+ export interface Overrides {
137
+ // (undocumented)
138
+ Title?: TitleOverrides;
139
+ }
140
+
141
+ // @public @deprecated (undocumented)
142
+ export const PopupMenuGroup: ({ maxWidth, minWidth, ...rest }: MenuGroupProps) => jsx.JSX.Element;
143
+
144
+ // @public (undocumented)
145
+ export interface RenderFunction<TProps = {}> {
146
+ // (undocumented)
147
+ (Component: ComponentType | string, props: TProps): React.ReactNode;
148
+ }
149
+
150
+ // @public
151
+ export const Section: ForwardRefExoticComponent<SectionProps & RefAttributes<HTMLElement>>;
152
+
153
+ // @public (undocumented)
154
+ interface SectionProps {
155
+ children: React.ReactNode;
156
+ hasSeparator?: boolean;
157
+ id?: string;
158
+ isList?: boolean;
159
+ isScrollable?: boolean;
160
+ // @deprecated (undocumented)
161
+ overrides?: {
162
+ HeadingItem?: {
163
+ cssFn?: StatelessCSSFn;
164
+ };
165
+ };
166
+ testId?: string;
167
+ title?: string;
168
+ }
169
+ export { SectionProps as SectionBaseProps }
170
+ export { SectionProps }
171
+
172
+ // @internal
173
+ export const SELECTION_STYLE_CONTEXT_DO_NOT_USE: Context<"border" | "none" | "notch">;
174
+
175
+ // @public
176
+ export const SkeletonHeadingItem: ({ isShimmering, testId, width, cssFn, }: SkeletonHeadingItemProps) => jsx.JSX.Element;
177
+
178
+ // @public (undocumented)
179
+ export interface SkeletonHeadingItemProps {
180
+ // @deprecated
181
+ cssFn?: StatelessCSSFn;
182
+ isShimmering?: boolean;
183
+ testId?: string;
184
+ width?: Dimension;
185
+ }
186
+
187
+ // @public
188
+ export const SkeletonItem: ({ hasAvatar, hasIcon, isShimmering, testId, width, cssFn, }: SkeletonItemProps) => jsx.JSX.Element;
189
+
190
+ // @public (undocumented)
191
+ export interface SkeletonItemProps {
192
+ cssFn?: StatelessCSSFn;
193
+ hasAvatar?: boolean;
194
+ hasIcon?: boolean;
195
+ isShimmering?: boolean;
196
+ testId?: string;
197
+ width?: Dimension;
198
+ }
199
+
200
+ // @internal
201
+ export const SpacingContext: Context<SpacingMode>;
202
+
203
+ // @public (undocumented)
204
+ type SpacingMode = 'compact' | 'cozy';
205
+
206
+ // @public @deprecated (undocumented)
207
+ export type StatelessCSSFn = CSSFn<void>;
208
+
209
+ // @public @deprecated (undocumented)
210
+ export interface TitleOverrides {
211
+ // (undocumented)
212
+ render?: RenderFunction<{
213
+ className?: string;
214
+ children: ReactNode;
215
+ 'data-item-title': boolean;
216
+ }>;
217
+ }
218
+
219
+ // (No @packageDocumentation comment for this package)
220
+
221
+ ```