@atlaskit/menu 1.11.0 → 2.0.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +102 -76
  2. package/dist/cjs/internal/components/menu-context.js +2 -4
  3. package/dist/cjs/internal/components/menu-item-primitive.js +13 -14
  4. package/dist/cjs/internal/components/skeleton-shimmer.js +1 -2
  5. package/dist/cjs/menu-item/button-item.js +2 -3
  6. package/dist/cjs/menu-item/custom-item.js +2 -3
  7. package/dist/cjs/menu-item/heading-item.js +2 -3
  8. package/dist/cjs/menu-item/link-item.js +2 -3
  9. package/dist/cjs/menu-item/skeleton-heading-item.js +2 -3
  10. package/dist/cjs/menu-item/skeleton-item.js +9 -13
  11. package/dist/cjs/menu-section/menu-group.js +1 -2
  12. package/dist/cjs/menu-section/popup-menu-group.js +1 -2
  13. package/dist/cjs/menu-section/section.js +10 -11
  14. package/dist/es2019/internal/components/menu-item-primitive.js +12 -12
  15. package/dist/es2019/menu-item/button-item.js +1 -1
  16. package/dist/es2019/menu-item/custom-item.js +1 -1
  17. package/dist/es2019/menu-item/heading-item.js +1 -1
  18. package/dist/es2019/menu-item/link-item.js +1 -1
  19. package/dist/es2019/menu-item/skeleton-heading-item.js +1 -1
  20. package/dist/es2019/menu-item/skeleton-item.js +8 -11
  21. package/dist/es2019/menu-section/section.js +9 -9
  22. package/dist/esm/internal/components/menu-item-primitive.js +12 -12
  23. package/dist/esm/menu-item/button-item.js +1 -1
  24. package/dist/esm/menu-item/custom-item.js +1 -1
  25. package/dist/esm/menu-item/heading-item.js +1 -1
  26. package/dist/esm/menu-item/link-item.js +1 -1
  27. package/dist/esm/menu-item/skeleton-heading-item.js +1 -1
  28. package/dist/esm/menu-item/skeleton-item.js +8 -11
  29. package/dist/esm/menu-section/section.js +9 -9
  30. package/package.json +1 -4
  31. package/dist/types-ts4.5/entry-points/menu-item/button-item.d.ts +0 -1
  32. package/dist/types-ts4.5/entry-points/menu-item/custom-item.d.ts +0 -1
  33. package/dist/types-ts4.5/entry-points/menu-item/heading-item.d.ts +0 -1
  34. package/dist/types-ts4.5/entry-points/menu-item/link-item.d.ts +0 -1
  35. package/dist/types-ts4.5/entry-points/menu-item/skeleton-heading-item.d.ts +0 -1
  36. package/dist/types-ts4.5/entry-points/menu-item/skeleton-item.d.ts +0 -1
  37. package/dist/types-ts4.5/entry-points/menu-section/menu-group.d.ts +0 -1
  38. package/dist/types-ts4.5/entry-points/menu-section/popup-menu-group.d.ts +0 -1
  39. package/dist/types-ts4.5/entry-points/menu-section/section.d.ts +0 -1
  40. package/dist/types-ts4.5/index.d.ts +0 -11
  41. package/dist/types-ts4.5/internal/components/menu-context.d.ts +0 -18
  42. package/dist/types-ts4.5/internal/components/menu-item-primitive.d.ts +0 -18
  43. package/dist/types-ts4.5/internal/components/skeleton-shimmer.d.ts +0 -24
  44. package/dist/types-ts4.5/menu-item/button-item.d.ts +0 -12
  45. package/dist/types-ts4.5/menu-item/custom-item.d.ts +0 -18
  46. package/dist/types-ts4.5/menu-item/heading-item.d.ts +0 -13
  47. package/dist/types-ts4.5/menu-item/link-item.d.ts +0 -12
  48. package/dist/types-ts4.5/menu-item/skeleton-heading-item.d.ts +0 -12
  49. package/dist/types-ts4.5/menu-item/skeleton-item.d.ts +0 -12
  50. package/dist/types-ts4.5/menu-section/menu-group.d.ts +0 -13
  51. package/dist/types-ts4.5/menu-section/popup-menu-group.d.ts +0 -8
  52. package/dist/types-ts4.5/menu-section/section.d.ts +0 -12
  53. package/dist/types-ts4.5/types.d.ts +0 -396
  54. package/tmp/api-report-tmp.d.ts +0 -222
@@ -27,14 +27,13 @@ var skeletonStyles = css({
27
27
  pointerEvents: 'none',
28
28
  '::after': {
29
29
  height: skeletonContentHeight,
30
+ backgroundColor: skeletonColor,
31
+ borderRadius: skeletonTextBorderRadius,
32
+ content: '""',
30
33
  // This is a little bespoke but we need to push everything down 1px
31
34
  // because the skeleton content should align to the bottom of the text.
32
35
  // Confirm VR test failures before accepting a change.
33
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
34
- marginTop: 1,
35
- backgroundColor: skeletonColor,
36
- borderRadius: skeletonTextBorderRadius,
37
- content: '""'
36
+ marginBlockStart: 1
38
37
  }
39
38
  });
40
39
  var defaultWidthStyles = css({
@@ -66,13 +65,11 @@ var beforeElementStyles = css({
66
65
  '::before': {
67
66
  width: skeletonItemElemSize,
68
67
  height: skeletonItemElemSize,
69
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
70
- marginRight: itemElemSpacing + itemElemSkeletonOffset,
71
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
72
- marginLeft: itemElemSkeletonOffset,
73
68
  flexShrink: 0,
74
69
  backgroundColor: skeletonColor,
75
- content: '""'
70
+ content: '""',
71
+ marginInlineEnd: itemElemSpacing + itemElemSkeletonOffset,
72
+ marginInlineStart: "var(--ds-space-025, 2px)"
76
73
  }
77
74
  });
78
75
  var avatarStyles = css({
@@ -103,7 +100,7 @@ var SkeletonItem = function SkeletonItem(_ref) {
103
100
  width = _ref.width,
104
101
  _ref$cssFn = _ref.cssFn,
105
102
  cssFn = _ref$cssFn === void 0 ? noop : _ref$cssFn;
106
- propDeprecationWarning("@atlaskit/menu", 'cssFn', cssFn !== noop, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
103
+ propDeprecationWarning("@atlaskit/menu" || '', 'cssFn', cssFn !== noop, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
107
104
  );
108
105
 
109
106
  var UNSAFE_overrides = getBooleanFF('platform.design-system-team.unsafe-overrides-killswitch_c8j9m') ? undefined : css(cssFn());
@@ -34,18 +34,18 @@ var sectionStyles = css({
34
34
  },
35
35
  // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
36
36
  '& [data-ds--menu--heading-item]': {
37
- marginTop: itemHeadingTopMargin,
38
- marginBottom: itemHeadingBottomMargin,
37
+ marginBlockEnd: itemHeadingBottomMargin,
38
+ marginBlockStart: itemHeadingTopMargin,
39
39
  '&:first-of-type': {
40
- marginTop: itemHeadingTopMargin - sectionPaddingTopBottom
40
+ marginBlockStart: itemHeadingTopMargin - sectionPaddingTopBottom
41
41
  }
42
42
  },
43
43
  // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
44
44
  '& [data-ds--menu--skeleton-heading-item]': {
45
- marginTop: skeletonHeadingTopMargin,
46
- marginBottom: skeletonHeadingBottomMargin,
45
+ marginBlockEnd: skeletonHeadingBottomMargin,
46
+ marginBlockStart: skeletonHeadingTopMargin,
47
47
  '&:first-of-type': {
48
- marginTop: skeletonHeadingTopMargin - sectionPaddingTopBottom
48
+ marginBlockStart: skeletonHeadingTopMargin - sectionPaddingTopBottom
49
49
  }
50
50
  },
51
51
  '&:focus': {
@@ -64,13 +64,13 @@ var unscrollableStyles = css({
64
64
  flexShrink: 0
65
65
  });
66
66
  var separatorStyles = css({
67
- borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, ".concat(N30A, ")"), ")")
67
+ borderBlockStart: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, ".concat(N30A, ")"), ")")
68
68
  });
69
69
  var noSeparatorStyles = css({
70
70
  // this is to ensure that adjacent sections without separators don't get additional margins.
71
71
  // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
72
72
  '[data-section] + &': {
73
- marginTop: -6
73
+ marginBlockStart: -6
74
74
  }
75
75
  });
76
76
 
@@ -94,7 +94,7 @@ var Section = /*#__PURE__*/forwardRef(function (_ref, ref) {
94
94
  isList = _ref$isList === void 0 ? false : _ref$isList,
95
95
  UNSAFE_className = _ref.className,
96
96
  rest = _objectWithoutProperties(_ref, _excluded);
97
- propDeprecationWarning("@atlaskit/menu", 'overrides', overrides !== undefined, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
97
+ propDeprecationWarning("@atlaskit/menu" || '', 'overrides', overrides !== undefined, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
98
98
  );
99
99
 
100
100
  var UNSAFE_headingOverrides = getBooleanFF('platform.design-system-team.unsafe-overrides-killswitch_c8j9m') ? undefined : overrides && overrides.HeadingItem && overrides.HeadingItem.cssFn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.11.0",
3
+ "version": "2.0.0",
4
4
  "description": "A collection of composable menu components that can be used anywhere.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -104,9 +104,6 @@
104
104
  ".": "./src/index.tsx"
105
105
  },
106
106
  "platform-feature-flags": {
107
- "platform.design-system-team.menu-selected-state-change_0see9": {
108
- "type": "boolean"
109
- },
110
107
  "platform.design-system-team.unsafe-overrides-killswitch_c8j9m": {
111
108
  "type": "boolean"
112
109
  }
@@ -1 +0,0 @@
1
- export { default } from '../../menu-item/button-item';
@@ -1 +0,0 @@
1
- export { default } from '../../menu-item/custom-item';
@@ -1 +0,0 @@
1
- export { default } from '../../menu-item/heading-item';
@@ -1 +0,0 @@
1
- export { default } from '../../menu-item/link-item';
@@ -1 +0,0 @@
1
- export { default } from '../../menu-item/skeleton-heading-item';
@@ -1 +0,0 @@
1
- export { default } from '../../menu-item/skeleton-item';
@@ -1 +0,0 @@
1
- export { default } from '../../menu-section/menu-group';
@@ -1 +0,0 @@
1
- export { default } from '../../menu-section/popup-menu-group';
@@ -1 +0,0 @@
1
- export { default } from '../../menu-section/section';
@@ -1,11 +0,0 @@
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';
@@ -1,18 +0,0 @@
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">;
@@ -1,18 +0,0 @@
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, }: MenuItemPrimitiveProps) => jsx.JSX.Element;
18
- export default MenuItemPrimitive;
@@ -1,24 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,18 +0,0 @@
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;
@@ -1,13 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,13 +0,0 @@
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;
@@ -1,8 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;