@atlaskit/navigation-system 5.12.1 → 5.12.2

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,14 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 5.12.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fd574581c5176`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fd574581c5176) -
8
+ Refactor ExpandableMenuItemTrigger props type to use RouterLinkComponentProps generic instead of
9
+ explicit href prop definition
10
+ - Updated dependencies
11
+
3
12
  ## 5.12.1
4
13
 
5
14
  ### Patch Changes
@@ -12,6 +12,7 @@ var _runtime = require("@compiled/react/runtime");
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _new = require("@atlaskit/button/new");
15
+ var _forwardRefWithGeneric = _interopRequireDefault(require("@atlaskit/ds-lib/forward-ref-with-generic"));
15
16
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
16
17
  var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
17
18
  var _menuItem = require("../menu-item");
@@ -52,7 +53,7 @@ var ExpandableMenuItemIcon = function ExpandableMenuItemIcon(_ref) {
52
53
  *
53
54
  * The trigger component for an `ExpandableMenuItem`. Interacting with it will expand or collapse the expandable.
54
55
  */
55
- var ExpandableMenuItemTrigger = exports.ExpandableMenuItemTrigger = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, forwardedRef) {
56
+ var ExpandableMenuItemTrigger = exports.ExpandableMenuItemTrigger = (0, _forwardRefWithGeneric.default)(function (_ref2, forwardedRef) {
56
57
  var actions = _ref2.actions,
57
58
  isSelected = _ref2.isSelected,
58
59
  href = _ref2.href,
@@ -2,8 +2,9 @@
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./expandable-menu-item-trigger.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import React, { forwardRef, useCallback, useId, useRef } from 'react';
5
+ import React, { useCallback, useId, useRef } from 'react';
6
6
  import { IconButton } from '@atlaskit/button/new';
7
+ import forwardRefWithGeneric from '@atlaskit/ds-lib/forward-ref-with-generic';
7
8
  import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
8
9
  import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
9
10
  import { MenuItemBase, nestedOpenPopupCSSSelector } from '../menu-item';
@@ -44,7 +45,7 @@ const ExpandableMenuItemIcon = ({
44
45
  *
45
46
  * The trigger component for an `ExpandableMenuItem`. Interacting with it will expand or collapse the expandable.
46
47
  */
47
- export const ExpandableMenuItemTrigger = /*#__PURE__*/forwardRef(({
48
+ export const ExpandableMenuItemTrigger = forwardRefWithGeneric(({
48
49
  actions,
49
50
  isSelected,
50
51
  href,
@@ -2,8 +2,9 @@
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./expandable-menu-item-trigger.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import React, { forwardRef, useCallback, useId, useRef } from 'react';
5
+ import React, { useCallback, useId, useRef } from 'react';
6
6
  import { IconButton } from '@atlaskit/button/new';
7
+ import forwardRefWithGeneric from '@atlaskit/ds-lib/forward-ref-with-generic';
7
8
  import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
8
9
  import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
9
10
  import { MenuItemBase, nestedOpenPopupCSSSelector } from '../menu-item';
@@ -43,7 +44,7 @@ var ExpandableMenuItemIcon = function ExpandableMenuItemIcon(_ref) {
43
44
  *
44
45
  * The trigger component for an `ExpandableMenuItem`. Interacting with it will expand or collapse the expandable.
45
46
  */
46
- export var ExpandableMenuItemTrigger = /*#__PURE__*/forwardRef(function (_ref2, forwardedRef) {
47
+ export var ExpandableMenuItemTrigger = forwardRefWithGeneric(function (_ref2, forwardedRef) {
47
48
  var actions = _ref2.actions,
48
49
  isSelected = _ref2.isSelected,
49
50
  href = _ref2.href,
@@ -5,8 +5,9 @@
5
5
  */
6
6
  import React, { type ReactNode } from 'react';
7
7
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
8
+ import type { RouterLinkComponentProps } from '@atlaskit/app-provider';
8
9
  import type { MenuItemCommonProps, MenuItemSlots } from '../types';
9
- export type ExpandableMenuItemTriggerProps = MenuItemCommonProps & Omit<MenuItemSlots, 'actionsOnHover' | 'elemBefore'> & {
10
+ export type ExpandableMenuItemTriggerProps<RouterLinkConfig extends Record<string, any> = never> = MenuItemCommonProps & Omit<RouterLinkComponentProps<RouterLinkConfig>, 'href'> & Omit<MenuItemSlots, 'actionsOnHover' | 'elemBefore'> & {
10
11
  /**
11
12
  * `ReactNode` to be placed visually after the `children` and will
12
13
  * only be displayed on hover or focus, or when the expandable menu item
@@ -41,7 +42,7 @@ export type ExpandableMenuItemTriggerProps = MenuItemCommonProps & Omit<MenuItem
41
42
  *
42
43
  * If a `href` is not provided, the chevron icon is rendered as part of the element.
43
44
  */
44
- href?: string;
45
+ href?: RouterLinkComponentProps<RouterLinkConfig>['href'];
45
46
  /**
46
47
  * Called when the user has clicked on the trigger content.
47
48
  *
@@ -61,4 +62,4 @@ export type ExpandableMenuItemTriggerProps = MenuItemCommonProps & Omit<MenuItem
61
62
  *
62
63
  * The trigger component for an `ExpandableMenuItem`. Interacting with it will expand or collapse the expandable.
63
64
  */
64
- export declare const ExpandableMenuItemTrigger: React.ForwardRefExoticComponent<React.PropsWithoutRef<ExpandableMenuItemTriggerProps> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
65
+ export declare const ExpandableMenuItemTrigger: <RouterLinkConfig extends Record<string, any> = never>(props: ExpandableMenuItemTriggerProps<RouterLinkConfig> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>) => React.ReactElement | null;
@@ -5,8 +5,9 @@
5
5
  */
6
6
  import React, { type ReactNode } from 'react';
7
7
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
8
+ import type { RouterLinkComponentProps } from '@atlaskit/app-provider';
8
9
  import type { MenuItemCommonProps, MenuItemSlots } from '../types';
9
- export type ExpandableMenuItemTriggerProps = MenuItemCommonProps & Omit<MenuItemSlots, 'actionsOnHover' | 'elemBefore'> & {
10
+ export type ExpandableMenuItemTriggerProps<RouterLinkConfig extends Record<string, any> = never> = MenuItemCommonProps & Omit<RouterLinkComponentProps<RouterLinkConfig>, 'href'> & Omit<MenuItemSlots, 'actionsOnHover' | 'elemBefore'> & {
10
11
  /**
11
12
  * `ReactNode` to be placed visually after the `children` and will
12
13
  * only be displayed on hover or focus, or when the expandable menu item
@@ -41,7 +42,7 @@ export type ExpandableMenuItemTriggerProps = MenuItemCommonProps & Omit<MenuItem
41
42
  *
42
43
  * If a `href` is not provided, the chevron icon is rendered as part of the element.
43
44
  */
44
- href?: string;
45
+ href?: RouterLinkComponentProps<RouterLinkConfig>['href'];
45
46
  /**
46
47
  * Called when the user has clicked on the trigger content.
47
48
  *
@@ -61,4 +62,4 @@ export type ExpandableMenuItemTriggerProps = MenuItemCommonProps & Omit<MenuItem
61
62
  *
62
63
  * The trigger component for an `ExpandableMenuItem`. Interacting with it will expand or collapse the expandable.
63
64
  */
64
- export declare const ExpandableMenuItemTrigger: React.ForwardRefExoticComponent<React.PropsWithoutRef<ExpandableMenuItemTriggerProps> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
65
+ export declare const ExpandableMenuItemTrigger: <RouterLinkConfig extends Record<string, any> = never>(props: ExpandableMenuItemTriggerProps<RouterLinkConfig> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>) => React.ReactElement | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "5.12.1",
3
+ "version": "5.12.2",
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",
@@ -71,7 +71,7 @@
71
71
  "@atlaskit/button": "^23.8.0",
72
72
  "@atlaskit/css": "^0.18.0",
73
73
  "@atlaskit/ds-lib": "^5.3.0",
74
- "@atlaskit/icon": "^29.2.0",
74
+ "@atlaskit/icon": "^29.3.0",
75
75
  "@atlaskit/layering": "^3.4.0",
76
76
  "@atlaskit/logo": "^19.9.0",
77
77
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -102,7 +102,7 @@
102
102
  "@atlaskit/banner": "^14.0.0",
103
103
  "@atlaskit/breadcrumbs": "^15.3.0",
104
104
  "@atlaskit/dropdown-menu": "^16.3.0",
105
- "@atlaskit/form": "^15.0.0",
105
+ "@atlaskit/form": "^15.1.0",
106
106
  "@atlaskit/heading": "^5.2.0",
107
107
  "@atlaskit/link": "^3.2.0",
108
108
  "@atlaskit/lozenge": "^13.2.0",