@atlaskit/menu 2.0.0 → 2.1.0
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 +12 -0
- package/codemods/2.1.0-invalid-link-item-to-button-item.tsx +208 -0
- package/codemods/__tests__/next-invalid-link-item-to-button-item.tsx +308 -0
- package/dist/cjs/internal/components/menu-item-primitive.js +22 -30
- package/dist/cjs/menu-item/button-item.js +2 -1
- package/dist/cjs/menu-item/custom-item.js +2 -1
- package/dist/cjs/menu-item/link-item.js +2 -1
- package/dist/es2019/internal/components/menu-item-primitive.js +22 -30
- package/dist/es2019/menu-item/button-item.js +2 -1
- package/dist/es2019/menu-item/custom-item.js +2 -1
- package/dist/es2019/menu-item/link-item.js +2 -1
- package/dist/esm/internal/components/menu-item-primitive.js +22 -30
- package/dist/esm/menu-item/button-item.js +2 -1
- package/dist/esm/menu-item/custom-item.js +2 -1
- package/dist/esm/menu-item/link-item.js +2 -1
- package/dist/types/internal/components/menu-item-primitive.d.ts +1 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-item/button-item.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-item/custom-item.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-item/heading-item.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-item/link-item.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-item/skeleton-heading-item.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-item/skeleton-item.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-section/menu-group.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-section/popup-menu-group.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/menu-section/section.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +11 -0
- package/dist/types-ts4.5/internal/components/menu-context.d.ts +18 -0
- package/dist/types-ts4.5/internal/components/menu-item-primitive.d.ts +18 -0
- package/dist/types-ts4.5/internal/components/skeleton-shimmer.d.ts +24 -0
- package/dist/types-ts4.5/menu-item/button-item.d.ts +12 -0
- package/dist/types-ts4.5/menu-item/custom-item.d.ts +18 -0
- package/dist/types-ts4.5/menu-item/heading-item.d.ts +13 -0
- package/dist/types-ts4.5/menu-item/link-item.d.ts +12 -0
- package/dist/types-ts4.5/menu-item/skeleton-heading-item.d.ts +12 -0
- package/dist/types-ts4.5/menu-item/skeleton-item.d.ts +12 -0
- package/dist/types-ts4.5/menu-section/menu-group.d.ts +13 -0
- package/dist/types-ts4.5/menu-section/popup-menu-group.d.ts +8 -0
- package/dist/types-ts4.5/menu-section/section.d.ts +12 -0
- package/dist/types-ts4.5/types.d.ts +397 -0
- package/package.json +2 -2
- package/tmp/api-report-tmp.d.ts +222 -0
|
@@ -23,34 +23,22 @@ const contentStyles = css({
|
|
|
23
23
|
flexGrow: 1,
|
|
24
24
|
lineHeight: "var(--ds-font-lineHeight-100, 16px)",
|
|
25
25
|
outline: 'none',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'@supports not (overflow-x: clip)': {
|
|
29
|
-
overflow: 'hidden'
|
|
30
|
-
},
|
|
31
|
-
'@supports (overflow-x: clip)': {
|
|
32
|
-
overflowX: 'clip'
|
|
33
|
-
}
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
textAlign: 'left'
|
|
34
28
|
});
|
|
35
29
|
const truncateStyles = css({
|
|
36
30
|
display: 'block',
|
|
31
|
+
overflow: 'hidden',
|
|
37
32
|
textOverflow: 'ellipsis',
|
|
38
|
-
whiteSpace: 'nowrap'
|
|
39
|
-
// Use "clip" overflow to allow ellipses on x-axis without clipping descenders
|
|
40
|
-
'@supports not (overflow-x: clip)': {
|
|
41
|
-
overflow: 'hidden'
|
|
42
|
-
},
|
|
43
|
-
'@supports (overflow-x: clip)': {
|
|
44
|
-
overflowX: 'clip'
|
|
45
|
-
}
|
|
33
|
+
whiteSpace: 'nowrap'
|
|
46
34
|
});
|
|
47
35
|
const wordBreakStyles = css({
|
|
48
36
|
wordBreak: 'break-word'
|
|
49
37
|
});
|
|
50
38
|
const descriptionStyles = css({
|
|
39
|
+
marginTop: "var(--ds-space-050, 4px)",
|
|
51
40
|
color: `var(--ds-text-subtlest, ${N200})`,
|
|
52
|
-
fontSize: "var(--ds-font-size-075, 12px)"
|
|
53
|
-
marginBlockStart: "var(--ds-space-050, 4px)"
|
|
41
|
+
fontSize: "var(--ds-font-size-075, 12px)"
|
|
54
42
|
});
|
|
55
43
|
const disabledDescriptionStyles = css({
|
|
56
44
|
color: `var(--ds-text-disabled, ${N200})`
|
|
@@ -120,23 +108,23 @@ const selectedBorderStyles = css({
|
|
|
120
108
|
'&::before': {
|
|
121
109
|
width: 2,
|
|
122
110
|
position: 'absolute',
|
|
111
|
+
top: 0,
|
|
112
|
+
bottom: 0,
|
|
113
|
+
left: 0,
|
|
123
114
|
background: "var(--ds-border-selected, transparent)",
|
|
124
|
-
content: '""'
|
|
125
|
-
insetBlockEnd: 0,
|
|
126
|
-
insetBlockStart: 0,
|
|
127
|
-
insetInlineStart: 0
|
|
115
|
+
content: '""'
|
|
128
116
|
}
|
|
129
117
|
});
|
|
130
118
|
const selectedNotchStyles = css({
|
|
131
119
|
'&::before': {
|
|
132
120
|
width: 4,
|
|
133
121
|
position: 'absolute',
|
|
122
|
+
top: "var(--ds-space-150, 12px)",
|
|
123
|
+
bottom: "var(--ds-space-150, 12px)",
|
|
124
|
+
left: 0,
|
|
134
125
|
background: "var(--ds-border-selected, transparent)",
|
|
135
126
|
borderRadius: `0 ${"var(--ds-border-radius, 4px)"} ${"var(--ds-border-radius, 4px)"} 0`,
|
|
136
|
-
content: '""'
|
|
137
|
-
insetBlockEnd: "var(--ds-space-150, 12px)",
|
|
138
|
-
insetBlockStart: "var(--ds-space-150, 12px)",
|
|
139
|
-
insetInlineStart: 0
|
|
127
|
+
content: '""'
|
|
140
128
|
}
|
|
141
129
|
});
|
|
142
130
|
const selectedStyles = css({
|
|
@@ -185,7 +173,8 @@ const MenuItemPrimitive = ({
|
|
|
185
173
|
shouldTitleWrap = false,
|
|
186
174
|
shouldDescriptionWrap = false,
|
|
187
175
|
isDisabled = false,
|
|
188
|
-
isSelected = false
|
|
176
|
+
isSelected = false,
|
|
177
|
+
testId
|
|
189
178
|
}) => {
|
|
190
179
|
propDeprecationWarning("@atlaskit/menu" || '', 'overrides', overrides !== undefined, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
|
|
191
180
|
);
|
|
@@ -207,10 +196,12 @@ const MenuItemPrimitive = ({
|
|
|
207
196
|
spread: "space-between",
|
|
208
197
|
alignBlock: "center",
|
|
209
198
|
space: gapMap[spacing],
|
|
210
|
-
grow: "fill"
|
|
199
|
+
grow: "fill",
|
|
200
|
+
testId: testId && `${testId}--container`
|
|
211
201
|
}, iconBefore && jsx("span", {
|
|
212
202
|
"data-item-elem-before": true,
|
|
213
|
-
css: beforeAfterElementStyles
|
|
203
|
+
css: beforeAfterElementStyles,
|
|
204
|
+
"data-testid": testId && `${testId}--icon-before`
|
|
214
205
|
}, iconBefore), title && jsx("span", {
|
|
215
206
|
css: contentStyles
|
|
216
207
|
}, renderTitle('span', {
|
|
@@ -222,7 +213,8 @@ const MenuItemPrimitive = ({
|
|
|
222
213
|
css: [descriptionStyles, isDisabled && disabledDescriptionStyles, shouldDescriptionWrap ? wordBreakStyles : truncateStyles]
|
|
223
214
|
}, description)), iconAfter && jsx("span", {
|
|
224
215
|
"data-item-elem-after": true,
|
|
225
|
-
css: beforeAfterElementStyles
|
|
216
|
+
css: beforeAfterElementStyles,
|
|
217
|
+
"data-testid": testId && `${testId}--icon-after`
|
|
226
218
|
}, iconAfter))
|
|
227
219
|
}));
|
|
228
220
|
});
|
|
@@ -26,34 +26,22 @@ var contentStyles = css({
|
|
|
26
26
|
flexGrow: 1,
|
|
27
27
|
lineHeight: "var(--ds-font-lineHeight-100, 16px)",
|
|
28
28
|
outline: 'none',
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'@supports not (overflow-x: clip)': {
|
|
32
|
-
overflow: 'hidden'
|
|
33
|
-
},
|
|
34
|
-
'@supports (overflow-x: clip)': {
|
|
35
|
-
overflowX: 'clip'
|
|
36
|
-
}
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
textAlign: 'left'
|
|
37
31
|
});
|
|
38
32
|
var truncateStyles = css({
|
|
39
33
|
display: 'block',
|
|
34
|
+
overflow: 'hidden',
|
|
40
35
|
textOverflow: 'ellipsis',
|
|
41
|
-
whiteSpace: 'nowrap'
|
|
42
|
-
// Use "clip" overflow to allow ellipses on x-axis without clipping descenders
|
|
43
|
-
'@supports not (overflow-x: clip)': {
|
|
44
|
-
overflow: 'hidden'
|
|
45
|
-
},
|
|
46
|
-
'@supports (overflow-x: clip)': {
|
|
47
|
-
overflowX: 'clip'
|
|
48
|
-
}
|
|
36
|
+
whiteSpace: 'nowrap'
|
|
49
37
|
});
|
|
50
38
|
var wordBreakStyles = css({
|
|
51
39
|
wordBreak: 'break-word'
|
|
52
40
|
});
|
|
53
41
|
var descriptionStyles = css({
|
|
42
|
+
marginTop: "var(--ds-space-050, 4px)",
|
|
54
43
|
color: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
55
|
-
fontSize: "var(--ds-font-size-075, 12px)"
|
|
56
|
-
marginBlockStart: "var(--ds-space-050, 4px)"
|
|
44
|
+
fontSize: "var(--ds-font-size-075, 12px)"
|
|
57
45
|
});
|
|
58
46
|
var disabledDescriptionStyles = css({
|
|
59
47
|
color: "var(--ds-text-disabled, ".concat(N200, ")")
|
|
@@ -123,23 +111,23 @@ var selectedBorderStyles = css({
|
|
|
123
111
|
'&::before': {
|
|
124
112
|
width: 2,
|
|
125
113
|
position: 'absolute',
|
|
114
|
+
top: 0,
|
|
115
|
+
bottom: 0,
|
|
116
|
+
left: 0,
|
|
126
117
|
background: "var(--ds-border-selected, transparent)",
|
|
127
|
-
content: '""'
|
|
128
|
-
insetBlockEnd: 0,
|
|
129
|
-
insetBlockStart: 0,
|
|
130
|
-
insetInlineStart: 0
|
|
118
|
+
content: '""'
|
|
131
119
|
}
|
|
132
120
|
});
|
|
133
121
|
var selectedNotchStyles = css({
|
|
134
122
|
'&::before': {
|
|
135
123
|
width: 4,
|
|
136
124
|
position: 'absolute',
|
|
125
|
+
top: "var(--ds-space-150, 12px)",
|
|
126
|
+
bottom: "var(--ds-space-150, 12px)",
|
|
127
|
+
left: 0,
|
|
137
128
|
background: "var(--ds-border-selected, transparent)",
|
|
138
129
|
borderRadius: "0 ".concat("var(--ds-border-radius, 4px)", " ", "var(--ds-border-radius, 4px)", " 0"),
|
|
139
|
-
content: '""'
|
|
140
|
-
insetBlockEnd: "var(--ds-space-150, 12px)",
|
|
141
|
-
insetBlockStart: "var(--ds-space-150, 12px)",
|
|
142
|
-
insetInlineStart: 0
|
|
130
|
+
content: '""'
|
|
143
131
|
}
|
|
144
132
|
});
|
|
145
133
|
var selectedStyles = css({
|
|
@@ -192,7 +180,8 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
|
|
|
192
180
|
_ref$isDisabled = _ref.isDisabled,
|
|
193
181
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
194
182
|
_ref$isSelected = _ref.isSelected,
|
|
195
|
-
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected
|
|
183
|
+
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
184
|
+
testId = _ref.testId;
|
|
196
185
|
propDeprecationWarning("@atlaskit/menu" || '', 'overrides', overrides !== undefined, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
|
|
197
186
|
);
|
|
198
187
|
|
|
@@ -212,10 +201,12 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
|
|
|
212
201
|
spread: "space-between",
|
|
213
202
|
alignBlock: "center",
|
|
214
203
|
space: gapMap[spacing],
|
|
215
|
-
grow: "fill"
|
|
204
|
+
grow: "fill",
|
|
205
|
+
testId: testId && "".concat(testId, "--container")
|
|
216
206
|
}, iconBefore && jsx("span", {
|
|
217
207
|
"data-item-elem-before": true,
|
|
218
|
-
css: beforeAfterElementStyles
|
|
208
|
+
css: beforeAfterElementStyles,
|
|
209
|
+
"data-testid": testId && "".concat(testId, "--icon-before")
|
|
219
210
|
}, iconBefore), title && jsx("span", {
|
|
220
211
|
css: contentStyles
|
|
221
212
|
}, renderTitle('span', {
|
|
@@ -227,7 +218,8 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
|
|
|
227
218
|
css: [descriptionStyles, isDisabled && disabledDescriptionStyles, shouldDescriptionWrap ? wordBreakStyles : truncateStyles]
|
|
228
219
|
}, description)), iconAfter && jsx("span", {
|
|
229
220
|
"data-item-elem-after": true,
|
|
230
|
-
css: beforeAfterElementStyles
|
|
221
|
+
css: beforeAfterElementStyles,
|
|
222
|
+
"data-testid": testId && "".concat(testId, "--icon-after")
|
|
231
223
|
}, iconAfter))
|
|
232
224
|
}));
|
|
233
225
|
});
|
|
@@ -68,7 +68,8 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
68
68
|
css: css(cssFn({
|
|
69
69
|
isDisabled: isDisabled,
|
|
70
70
|
isSelected: isSelected
|
|
71
|
-
}))
|
|
71
|
+
})),
|
|
72
|
+
testId: testId && "".concat(testId, "--primitive")
|
|
72
73
|
}), function (_ref2) {
|
|
73
74
|
var children = _ref2.children,
|
|
74
75
|
className = _ref2.className;
|
|
@@ -67,7 +67,8 @@ function (props, ref) {
|
|
|
67
67
|
isSelected: isSelected,
|
|
68
68
|
isDisabled: isDisabled
|
|
69
69
|
}),
|
|
70
|
-
title: children
|
|
70
|
+
title: children,
|
|
71
|
+
testId: testId && "".concat(testId, "--primitive")
|
|
71
72
|
}), function (_ref) {
|
|
72
73
|
var children = _ref.children,
|
|
73
74
|
className = _ref.className;
|
|
@@ -14,5 +14,5 @@ import type { MenuItemPrimitiveProps } from '../../types';
|
|
|
14
14
|
* </MenuItemPrimitive>
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
declare const MenuItemPrimitive: ({ children, title, description, iconAfter, iconBefore, overrides, className: UNSAFE_externalClassName, shouldTitleWrap, shouldDescriptionWrap, isDisabled, isSelected, }: MenuItemPrimitiveProps) => jsx.JSX.Element;
|
|
17
|
+
declare const MenuItemPrimitive: ({ children, title, description, iconAfter, iconBefore, overrides, className: UNSAFE_externalClassName, shouldTitleWrap, shouldDescriptionWrap, isDisabled, isSelected, testId, }: MenuItemPrimitiveProps) => jsx.JSX.Element;
|
|
18
18
|
export default MenuItemPrimitive;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-item/button-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-item/custom-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-item/heading-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-item/link-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-item/skeleton-heading-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-item/skeleton-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-section/menu-group';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-section/popup-menu-group';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../../menu-section/section';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as ButtonItem } from './menu-item/button-item';
|
|
2
|
+
export { default as LinkItem } from './menu-item/link-item';
|
|
3
|
+
export { default as CustomItem } from './menu-item/custom-item';
|
|
4
|
+
export { default as SkeletonItem } from './menu-item/skeleton-item';
|
|
5
|
+
export { SpacingContext, SELECTION_STYLE_CONTEXT_DO_NOT_USE, } from './internal/components/menu-context';
|
|
6
|
+
export { default as HeadingItem } from './menu-item/heading-item';
|
|
7
|
+
export { default as SkeletonHeadingItem } from './menu-item/skeleton-heading-item';
|
|
8
|
+
export { default as Section } from './menu-section/section';
|
|
9
|
+
export { default as MenuGroup } from './menu-section/menu-group';
|
|
10
|
+
export { default as PopupMenuGroup } from './menu-section/popup-menu-group';
|
|
11
|
+
export type { ButtonItemProps, CSSFn, StatelessCSSFn, CustomItemComponentProps, CustomItemProps, HeadingItemProps, ItemState, LinkItemProps, MenuGroupProps, SectionProps, SkeletonHeadingItemProps, SkeletonItemProps, Dimension, MenuItemProps as BaseItemProps, Overrides, MenuGroupSizing, RenderFunction, SectionProps as SectionBaseProps, TitleOverrides, } from './types';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type SpacingMode = 'compact' | 'cozy';
|
|
3
|
+
/**
|
|
4
|
+
* __Spacing context__
|
|
5
|
+
*
|
|
6
|
+
* The spacing context is used to provide spacing values to menu item primitives.
|
|
7
|
+
*
|
|
8
|
+
* @internal Do not use directly.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SpacingContext: import("react").Context<SpacingMode>;
|
|
11
|
+
/**
|
|
12
|
+
* __Selection context__
|
|
13
|
+
*
|
|
14
|
+
* The selection context is used to set what selection mode the menu items display as.
|
|
15
|
+
*
|
|
16
|
+
* @internal Do not use directly.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SELECTION_STYLE_CONTEXT_DO_NOT_USE: import("react").Context<"notch" | "border" | "none">;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { MenuItemPrimitiveProps } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* __Menu item primitive__
|
|
5
|
+
*
|
|
6
|
+
* Menu item primitive contains all the styles for menu items,
|
|
7
|
+
* including support for selected, disabled, and interaction states.
|
|
8
|
+
*
|
|
9
|
+
* Using children as function prop you wire up this to your own host element.
|
|
10
|
+
*
|
|
11
|
+
* ```jsx
|
|
12
|
+
* <MenuItemPrimitive>
|
|
13
|
+
* {({ children, ...props }) => <button {...props}>{children}</button>}
|
|
14
|
+
* </MenuItemPrimitive>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare const MenuItemPrimitive: ({ children, title, description, iconAfter, iconBefore, overrides, className: UNSAFE_externalClassName, shouldTitleWrap, shouldDescriptionWrap, isDisabled, isSelected, testId, }: MenuItemPrimitiveProps) => jsx.JSX.Element;
|
|
18
|
+
export default MenuItemPrimitive;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
type SkeletonShimmerProps = {
|
|
5
|
+
children: ({ className }: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
isShimmering?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* __Skeleton shimmer__
|
|
12
|
+
*
|
|
13
|
+
* A skeleton shimmer is the animation shown on loading skeletons for
|
|
14
|
+
* perceived performance and user satisfaction.
|
|
15
|
+
*
|
|
16
|
+
* This component provides a `className` through render props. This value will
|
|
17
|
+
* have type:
|
|
18
|
+
* + `string`, when `isShimmering={true}`.
|
|
19
|
+
* + `undefined`, when `isShimmering={false}`.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
declare const SkeletonShimmer: ({ children, isShimmering, }: SkeletonShimmerProps) => jsx.JSX.Element;
|
|
24
|
+
export default SkeletonShimmer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ButtonItemProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* __Button item__
|
|
5
|
+
*
|
|
6
|
+
* A button item is used to populate a menu with items that are buttons.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/button-item)
|
|
9
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
10
|
+
*/
|
|
11
|
+
declare const ButtonItem: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<ButtonItemProps & import("react").RefAttributes<HTMLElement>>>;
|
|
12
|
+
export default ButtonItem;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import type { CustomItemComponentProps, CustomItemProps } from '../types';
|
|
4
|
+
interface CustomItemTypeGenericHackProps {
|
|
5
|
+
<TComponentProps>(props: CustomItemProps<TComponentProps> & {
|
|
6
|
+
ref?: any;
|
|
7
|
+
} & Omit<TComponentProps, keyof CustomItemComponentProps>): JSX.Element | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* __Custom item__
|
|
11
|
+
*
|
|
12
|
+
* A custom item is used to populate a menu with items that can be any element.
|
|
13
|
+
*
|
|
14
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/custom-item)
|
|
15
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
16
|
+
*/
|
|
17
|
+
declare const CustomItem: CustomItemTypeGenericHackProps;
|
|
18
|
+
export default CustomItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { HeadingItemProps } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* __Heading item__
|
|
6
|
+
*
|
|
7
|
+
* A heading item is used to describe sibling menu items.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/heading-item)
|
|
10
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
11
|
+
*/
|
|
12
|
+
declare const HeadingItem: import("react").MemoExoticComponent<({ children, testId, id, cssFn, className: UNSAFE_className, ...rest }: HeadingItemProps) => jsx.JSX.Element>;
|
|
13
|
+
export default HeadingItem;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { LinkItemProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* __Link item__
|
|
5
|
+
*
|
|
6
|
+
* A link item is used to populate a menu with items that are links.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/link-item)
|
|
9
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
10
|
+
*/
|
|
11
|
+
declare const LinkItem: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<LinkItemProps & import("react").RefAttributes<HTMLElement>>>;
|
|
12
|
+
export default LinkItem;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { SkeletonHeadingItemProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* __Skeleton heading item__
|
|
5
|
+
*
|
|
6
|
+
* A skeleton heading item is used in place of a heading item when its contents it not ready.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-heading-item)
|
|
9
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
10
|
+
*/
|
|
11
|
+
declare const SkeletonHeadingItem: ({ isShimmering, testId, width, cssFn, }: SkeletonHeadingItemProps) => jsx.JSX.Element;
|
|
12
|
+
export default SkeletonHeadingItem;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { SkeletonItemProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* __Skeleton item__
|
|
5
|
+
*
|
|
6
|
+
* A skeleton item is used in place of an item when its contents it not ready.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-item)
|
|
9
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
10
|
+
*/
|
|
11
|
+
declare const SkeletonItem: ({ hasAvatar, hasIcon, isShimmering, testId, width, cssFn, }: SkeletonItemProps) => jsx.JSX.Element;
|
|
12
|
+
export default SkeletonItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { MenuGroupProps } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* __Menu group__
|
|
6
|
+
*
|
|
7
|
+
* A menu group includes all the actions or items in a menu.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/menu-group)
|
|
10
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
11
|
+
*/
|
|
12
|
+
declare const MenuGroup: ({ isLoading, maxWidth, minWidth, minHeight, maxHeight, testId, role, spacing, className: UNSAFE_className, ...rest }: MenuGroupProps) => jsx.JSX.Element;
|
|
13
|
+
export default MenuGroup;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { MenuGroupProps } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
*/
|
|
7
|
+
declare const PopupMenuGroup: ({ maxWidth, minWidth, ...rest }: MenuGroupProps) => jsx.JSX.Element;
|
|
8
|
+
export default PopupMenuGroup;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { SectionProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* __Section__
|
|
5
|
+
*
|
|
6
|
+
* A section includes related actions or items in a menu.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/section)
|
|
9
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
10
|
+
*/
|
|
11
|
+
declare const Section: import("react").ForwardRefExoticComponent<SectionProps & import("react").RefAttributes<HTMLElement>>;
|
|
12
|
+
export default Section;
|