@atlaskit/navigation-system 2.12.0 → 2.14.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 (32) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +57 -29
  3. package/dist/cjs/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +6 -2
  4. package/dist/cjs/ui/page-layout/side-nav/side-nav.compiled.css +1 -2
  5. package/dist/cjs/ui/page-layout/side-nav/side-nav.js +3 -6
  6. package/dist/cjs/ui/page-layout/side-nav/toggle-button.js +14 -2
  7. package/dist/cjs/ui/top-nav-items/themed/button.js +29 -25
  8. package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +33 -4
  9. package/dist/es2019/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +6 -2
  10. package/dist/es2019/ui/page-layout/side-nav/side-nav.compiled.css +1 -2
  11. package/dist/es2019/ui/page-layout/side-nav/side-nav.js +3 -6
  12. package/dist/es2019/ui/page-layout/side-nav/toggle-button.js +13 -3
  13. package/dist/es2019/ui/top-nav-items/themed/button.js +29 -25
  14. package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +57 -29
  15. package/dist/esm/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +6 -2
  16. package/dist/esm/ui/page-layout/side-nav/side-nav.compiled.css +1 -2
  17. package/dist/esm/ui/page-layout/side-nav/side-nav.js +3 -6
  18. package/dist/esm/ui/page-layout/side-nav/toggle-button.js +15 -3
  19. package/dist/esm/ui/top-nav-items/themed/button.js +29 -25
  20. package/dist/types/ui/menu-item/link-menu-item.d.ts +1 -17
  21. package/dist/types/ui/menu-item/menu-item.d.ts +19 -14
  22. package/dist/types/ui/menu-item/menu-list-item.d.ts +6 -5
  23. package/dist/types/ui/page-layout/panel-splitter/panel-splitter.d.ts +15 -1
  24. package/dist/types/ui/page-layout/panel-splitter/side-nav-panel-splitter.d.ts +1 -1
  25. package/dist/types/ui/page-layout/side-nav/toggle-button.d.ts +7 -1
  26. package/dist/types-ts4.5/ui/menu-item/link-menu-item.d.ts +1 -17
  27. package/dist/types-ts4.5/ui/menu-item/menu-item.d.ts +19 -14
  28. package/dist/types-ts4.5/ui/menu-item/menu-list-item.d.ts +6 -5
  29. package/dist/types-ts4.5/ui/page-layout/panel-splitter/panel-splitter.d.ts +15 -1
  30. package/dist/types-ts4.5/ui/page-layout/panel-splitter/side-nav-panel-splitter.d.ts +1 -1
  31. package/dist/types-ts4.5/ui/page-layout/side-nav/toggle-button.d.ts +7 -1
  32. package/package.json +9 -9
@@ -4,7 +4,7 @@
4
4
  * @jsx jsx
5
5
  */
6
6
  import React from 'react';
7
- import type { MenuItemOnClick } from './types';
7
+ import type { MenuItemLinkOrButtonCommonProps, MenuItemOnClick } from './types';
8
8
  /**
9
9
  * This is being _internally_ exported so it can be used in other menu item wrapper components, like
10
10
  * ExpandableMenuItemTrigger.
@@ -20,28 +20,33 @@ import type { MenuItemOnClick } from './types';
20
20
  */
21
21
  export declare const nestedOpenPopupCSSSelector = "&:has([aria-expanded=\"true\"][aria-haspopup=\"true\"])";
22
22
  /**
23
- * __MenuItemBase__
24
- *
25
- * The base menu item component used to compose ButtonMenuItem and LinkMenuItem.
23
+ * Includes all props that are used by any menu item, as MenuItembase is the base component for all menu item components.
26
24
  *
27
- * It contains a type argument `<T>`, to specify the type of the interactive element (`button` or `a`).
28
- * This can be inferred from the type of the `onClick` prop.
25
+ * We also include additional `aria` props to support the menu item being a trigger for the FlyoutMenuItem popup and for the
26
+ * expanded content for ExpandableMenuItem.
29
27
  */
30
- export declare const MenuItemBase: <T extends HTMLAnchorElement | HTMLButtonElement>(props: import("./types").MenuItemCommonProps & import("./types").MenuItemSlots & {
31
- description?: string;
32
- listItemRef?: React.Ref<HTMLDivElement>;
33
- } & {
28
+ type MenuItemBaseProps<T extends HTMLAnchorElement | HTMLButtonElement> = MenuItemLinkOrButtonCommonProps & {
34
29
  /**
35
30
  * ID attribute, passed to the interactive element (anchor/button). This is not publicly exposed, and is currently only
36
31
  * used internally by `ExpandableMenuItemTrigger` for the `aria-labelledby` attribute.
37
32
  */
38
33
  id?: string;
39
34
  href?: string | Record<string, any>;
40
- target?: HTMLAnchorElement["target"];
35
+ target?: HTMLAnchorElement['target'];
41
36
  isDisabled?: boolean;
42
37
  isSelected?: boolean;
43
38
  ariaControls?: string;
44
39
  ariaExpanded?: boolean;
45
- ariaHasPopup?: boolean | "dialog";
46
- onClick?: MenuItemOnClick<T> | undefined;
47
- } & React.RefAttributes<T>) => React.ReactElement | null;
40
+ ariaHasPopup?: boolean | 'dialog';
41
+ onClick?: MenuItemOnClick<T>;
42
+ };
43
+ /**
44
+ * __MenuItemBase__
45
+ *
46
+ * The base menu item component used to compose ButtonMenuItem and LinkMenuItem.
47
+ *
48
+ * It contains a type argument `<T>`, to specify the type of the interactive element (`button` or `a`).
49
+ * This can be inferred from the type of the `onClick` prop.
50
+ */
51
+ export declare const MenuItemBase: <T extends HTMLAnchorElement | HTMLButtonElement>(props: MenuItemBaseProps<T> & React.RefAttributes<T>) => React.ReactElement | null;
52
+ export {};
@@ -1,10 +1,11 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { ListItem } from '../../components/list-item';
1
6
  /**
2
7
  * __Menu list item__
3
8
  *
4
9
  * A [list item](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li) with visual styles removed.
5
10
  */
6
- export declare const MenuListItem: import("react").ForwardRefExoticComponent<{
7
- children: import("react").ReactNode;
8
- testId?: string;
9
- xcss?: import("@atlaskit/css").StrictXCSSProp<"display" | "scrollMarginInline", never>;
10
- } & import("react").RefAttributes<HTMLDivElement>>;
11
+ export declare const MenuListItem: typeof ListItem;
@@ -3,6 +3,7 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type ReactNode } from 'react';
6
+ import { type TooltipProps } from '@atlaskit/tooltip';
6
7
  import type { ResizeBounds, ResizeEndCallback, ResizeStartCallback } from './types';
7
8
  export type PanelSplitterProps = {
8
9
  /**
@@ -22,6 +23,19 @@ export type PanelSplitterProps = {
22
23
  * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
23
24
  */
24
25
  testId?: string;
26
+ /**
27
+ * Displays a tooltip with the provided content.
28
+ * The `tooltipContent` will not be announced by screen readers because it pertains to the draggable element, which lacks keyboard functionality.
29
+ * Use the `label` prop to provide accessible information about the panel splitter.
30
+ * Only used if the `platform-dst-tooltip-shortcuts` feature flag is enabled.
31
+ */
32
+ tooltipContent?: TooltipProps['content'];
33
+ /**
34
+ * The keyboard shortcut to display in the tooltip.
35
+ * Only used if the `platform-dst-tooltip-shortcuts` feature flag is enabled.
36
+ * Note this does not handle the keyboard shortcut functionality, it only displays the shortcut in the tooltip.
37
+ */
38
+ shortcut?: TooltipProps['shortcut'];
25
39
  };
26
40
  type PanelSplitterDragData = {
27
41
  panelId: string | symbol | undefined;
@@ -46,5 +60,5 @@ export declare function isPanelSplitterDragData(data: Record<string | symbol, un
46
60
  * </SideNav>
47
61
  * ```
48
62
  */
49
- export declare const PanelSplitter: ({ label, onResizeStart, onResizeEnd, testId, }: PanelSplitterProps) => ReactNode;
63
+ export declare const PanelSplitter: ({ label, onResizeStart, onResizeEnd, testId, tooltipContent, shortcut, }: PanelSplitterProps) => ReactNode;
50
64
  export {};
@@ -16,5 +16,5 @@ type SideNavPanelSplitterProps = Omit<PanelSplitterProps, 'onDoubleClick'> & {
16
16
  * </SideNav>
17
17
  * ```
18
18
  */
19
- export declare const SideNavPanelSplitter: ({ label, onResizeStart, onResizeEnd, testId, shouldCollapseOnDoubleClick, }: SideNavPanelSplitterProps) => ReactNode;
19
+ export declare const SideNavPanelSplitter: ({ label, onResizeStart, onResizeEnd, testId, shouldCollapseOnDoubleClick, tooltipContent, shortcut, }: SideNavPanelSplitterProps) => ReactNode;
20
20
  export {};
@@ -12,7 +12,7 @@ export type SideNavVisibilityChangeAnalyticsAttributes = {
12
12
  *
13
13
  * Button for toggling the side nav. It should be used in the top bar.
14
14
  */
15
- export declare const SideNavToggleButton: ({ defaultCollapsed, expandLabel, collapseLabel, testId, interactionName, onClick, }: {
15
+ export declare const SideNavToggleButton: ({ defaultCollapsed, expandLabel, collapseLabel, testId, interactionName, onClick, shortcut, }: {
16
16
  /**
17
17
  * @deprecated
18
18
  *
@@ -49,4 +49,10 @@ export declare const SideNavToggleButton: ({ defaultCollapsed, expandLabel, coll
49
49
  * The callback function that is called when the toggle button is clicked.
50
50
  */
51
51
  onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent, attributes?: SideNavVisibilityChangeAnalyticsAttributes) => void;
52
+ /**
53
+ * Display a keyboard shortcut in the tooltip.
54
+ * Only used if the `platform-dst-tooltip-shortcuts` feature flag is enabled.
55
+ * Note this does not handle the keyboard shortcut functionality, it only displays the shortcut in the tooltip.
56
+ */
57
+ shortcut?: string[];
52
58
  }) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "2.12.0",
3
+ "version": "2.14.0",
4
4
  "description": "The latest navigation system for Atlassian apps.",
5
5
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
6
6
  "author": "Atlassian Pty Ltd",
@@ -67,13 +67,13 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@atlaskit/analytics-next": "^11.1.0",
70
- "@atlaskit/avatar": "^25.2.0",
71
- "@atlaskit/button": "^23.4.0",
70
+ "@atlaskit/avatar": "^25.3.0",
71
+ "@atlaskit/button": "^23.5.0",
72
72
  "@atlaskit/css": "^0.14.0",
73
73
  "@atlaskit/ds-lib": "^5.1.0",
74
74
  "@atlaskit/icon": "^28.3.0",
75
75
  "@atlaskit/layering": "^3.0.0",
76
- "@atlaskit/logo": "^19.7.0",
76
+ "@atlaskit/logo": "^19.8.0",
77
77
  "@atlaskit/platform-feature-flags": "^1.1.0",
78
78
  "@atlaskit/popup": "^4.4.0",
79
79
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
@@ -98,7 +98,7 @@
98
98
  "@af/integration-testing": "workspace:^",
99
99
  "@af/visual-regression": "workspace:^",
100
100
  "@atlaskit/app-provider": "^3.2.0",
101
- "@atlaskit/badge": "^18.1.0",
101
+ "@atlaskit/badge": "^18.2.0",
102
102
  "@atlaskit/banner": "^14.0.0",
103
103
  "@atlaskit/breadcrumbs": "^15.3.0",
104
104
  "@atlaskit/dropdown-menu": "^16.3.0",
@@ -113,7 +113,7 @@
113
113
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
114
114
  "@atlaskit/select": "^21.3.0",
115
115
  "@atlaskit/skeleton": "^2.1.0",
116
- "@atlaskit/temp-nav-app-icons": "^0.10.0",
116
+ "@atlaskit/temp-nav-app-icons": "^0.13.0",
117
117
  "@atlaskit/textfield": "^8.0.0",
118
118
  "@atlassian/feature-flags-test-utils": "^0.3.0",
119
119
  "@atlassian/gemini": "^1.20.0",
@@ -150,9 +150,6 @@
150
150
  "type": "boolean",
151
151
  "referenceOnly": true
152
152
  },
153
- "platform_design_system_nav4_sidenav_border": {
154
- "type": "boolean"
155
- },
156
153
  "platform-team25-app-icon-tiles": {
157
154
  "type": "boolean"
158
155
  },
@@ -189,6 +186,9 @@
189
186
  "platform_dst_nav4_menu_section_heading_a11y": {
190
187
  "type": "boolean"
191
188
  },
189
+ "platform-dst-tooltip-shortcuts": {
190
+ "type": "boolean"
191
+ },
192
192
  "platform_dst_nav4_side_nav_click_outside_fix": {
193
193
  "type": "boolean"
194
194
  },