@atlaskit/atlassian-navigation 2.9.2 → 3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/atlassian-navigation
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#59797](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59797) [`ea972e5bd62f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ea972e5bd62f) - Removing PrimarySplitButton which relies on (about to be removed) UNSAFE exports from @atlaskit/button. See LDR https://hello.atlassian.net/l/cp/xNFyPqkm
8
+
9
+ ## 2.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#56868](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56868) [`73ad379b73c6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73ad379b73c6) - [ux] Add proper labels to icon buttons.
14
+
3
15
  ## 2.9.2
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1,58 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.confluence.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "composite": true,
7
+ "outDir": "../dist",
8
+ "rootDir": "../",
9
+ "baseUrl": "../"
10
+ },
11
+ "include": [
12
+ "../src/**/*.ts",
13
+ "../src/**/*.tsx"
14
+ ],
15
+ "exclude": [
16
+ "../src/**/__tests__/*",
17
+ "../src/**/*.test.*",
18
+ "../src/**/test.*"
19
+ ],
20
+ "references": [
21
+ {
22
+ "path": "../../../analytics/analytics-namespaced-context/afm-cc/tsconfig.json"
23
+ },
24
+ {
25
+ "path": "../../button/afm-cc/tsconfig.json"
26
+ },
27
+ {
28
+ "path": "../../ds-lib/afm-cc/tsconfig.json"
29
+ },
30
+ {
31
+ "path": "../../icon/afm-cc/tsconfig.json"
32
+ },
33
+ {
34
+ "path": "../../logo/afm-cc/tsconfig.json"
35
+ },
36
+ {
37
+ "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
38
+ },
39
+ {
40
+ "path": "../../popup/afm-cc/tsconfig.json"
41
+ },
42
+ {
43
+ "path": "../../primitives/afm-cc/tsconfig.json"
44
+ },
45
+ {
46
+ "path": "../../theme/afm-cc/tsconfig.json"
47
+ },
48
+ {
49
+ "path": "../../tokens/afm-cc/tsconfig.json"
50
+ },
51
+ {
52
+ "path": "../../tooltip/afm-cc/tsconfig.json"
53
+ },
54
+ {
55
+ "path": "../../width-detector/afm-cc/tsconfig.json"
56
+ }
57
+ ]
58
+ }
@@ -13,7 +13,7 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
13
13
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
14
14
  var _theme = require("../../theme");
15
15
  var _styles = require("./styles");
16
- var _excluded = ["icon", "testId", "tooltip"];
16
+ var _excluded = ["icon", "label", "testId", "tooltip"];
17
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
19
  /**
@@ -27,12 +27,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
27
27
  */
28
28
  var IconButton = exports.IconButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
29
29
  var icon = props.icon,
30
+ label = props.label,
30
31
  testId = props.testId,
31
32
  tooltip = props.tooltip,
32
33
  buttonProps = (0, _objectWithoutProperties2.default)(props, _excluded);
33
34
  var theme = (0, _theme.useTheme)();
34
35
  var button = /*#__PURE__*/_react.default.createElement(_customThemeButton.default, (0, _extends2.default)({
35
36
  appearance: "primary",
37
+ "aria-label": label,
36
38
  testId: testId,
37
39
  iconBefore: icon,
38
40
  ref: ref
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.default = exports.Profile = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _react = _interopRequireWildcard(require("react"));
7
11
  var _IconButton = require("../IconButton");
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
8
14
  /**
9
15
  * __Profile__
10
16
  *
@@ -14,7 +20,20 @@ var _IconButton = require("../IconButton");
14
20
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
15
21
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
16
22
  */
17
- var Profile = exports.Profile = _IconButton.IconButton;
23
+ var Profile = exports.Profile = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
24
+ var labelProp = props.label,
25
+ tooltip = props.tooltip;
26
+ var label = labelProp || (typeof tooltip === 'string' ? tooltip : 'Your profile and settings');
27
+
28
+ // All other implementations of IconButton within the components are using spread props, so
29
+ // to use explicit props could cause regressions.
30
+ // TODO: Remove these spread props for better static analysis
31
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
32
+ return /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, (0, _extends2.default)({
33
+ label: label,
34
+ ref: ref
35
+ }, props));
36
+ });
18
37
 
19
38
  // This exists only to extract props.
20
39
  // eslint-disable-next-line @repo/internal/react/use-noop
package/dist/cjs/index.js CHANGED
@@ -63,12 +63,6 @@ Object.defineProperty(exports, "PrimaryDropdownButton", {
63
63
  return _PrimaryDropdownButton.PrimaryDropdownButton;
64
64
  }
65
65
  });
66
- Object.defineProperty(exports, "PrimarySplitButton", {
67
- enumerable: true,
68
- get: function get() {
69
- return _PrimarySplitButton.PrimarySplitButton;
70
- }
71
- });
72
66
  Object.defineProperty(exports, "ProductHome", {
73
67
  enumerable: true,
74
68
  get: function get() {
@@ -130,7 +124,6 @@ var _Help = require("./components/Help");
130
124
  var _Notifications = require("./components/Notifications");
131
125
  var _PrimaryButton = require("./components/PrimaryButton");
132
126
  var _PrimaryDropdownButton = require("./components/PrimaryDropdownButton");
133
- var _PrimarySplitButton = require("./components/PrimarySplitButton");
134
127
  var _IconButton = require("./components/IconButton");
135
128
  var _ProductHome = require("./components/ProductHome");
136
129
  var _Profile = require("./components/Profile");
@@ -16,6 +16,7 @@ import { getIconButtonTheme } from './styles';
16
16
  export const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
17
17
  const {
18
18
  icon,
19
+ label,
19
20
  testId,
20
21
  tooltip,
21
22
  ...buttonProps
@@ -23,6 +24,7 @@ export const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
23
24
  const theme = useTheme();
24
25
  const button = /*#__PURE__*/React.createElement(Button, _extends({
25
26
  appearance: "primary",
27
+ "aria-label": label,
26
28
  testId: testId,
27
29
  iconBefore: icon,
28
30
  ref: ref
@@ -1,3 +1,5 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { forwardRef } from 'react';
1
3
  import { IconButton } from '../IconButton';
2
4
  /**
3
5
  * __Profile__
@@ -8,7 +10,22 @@ import { IconButton } from '../IconButton';
8
10
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
9
11
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
10
12
  */
11
- export const Profile = IconButton;
13
+ export const Profile = /*#__PURE__*/forwardRef((props, ref) => {
14
+ const {
15
+ label: labelProp,
16
+ tooltip
17
+ } = props;
18
+ const label = labelProp || (typeof tooltip === 'string' ? tooltip : 'Your profile and settings');
19
+
20
+ // All other implementations of IconButton within the components are using spread props, so
21
+ // to use explicit props could cause regressions.
22
+ // TODO: Remove these spread props for better static analysis
23
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
24
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
25
+ label: label,
26
+ ref: ref
27
+ }, props));
28
+ });
12
29
 
13
30
  // This exists only to extract props.
14
31
  // eslint-disable-next-line @repo/internal/react/use-noop
@@ -5,7 +5,6 @@ export { Help } from './components/Help';
5
5
  export { Notifications } from './components/Notifications';
6
6
  export { PrimaryButton } from './components/PrimaryButton';
7
7
  export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
8
- export { PrimarySplitButton } from './components/PrimarySplitButton';
9
8
  export { IconButton } from './components/IconButton';
10
9
  export { CustomProductHome, ProductHome } from './components/ProductHome';
11
10
  export { Profile } from './components/Profile';
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["icon", "testId", "tooltip"];
3
+ var _excluded = ["icon", "label", "testId", "tooltip"];
4
4
  import React, { forwardRef } from 'react';
5
5
  import Button from '@atlaskit/button/custom-theme-button';
6
6
  import Tooltip from '@atlaskit/tooltip';
@@ -17,12 +17,14 @@ import { getIconButtonTheme } from './styles';
17
17
  */
18
18
  export var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
19
19
  var icon = props.icon,
20
+ label = props.label,
20
21
  testId = props.testId,
21
22
  tooltip = props.tooltip,
22
23
  buttonProps = _objectWithoutProperties(props, _excluded);
23
24
  var theme = useTheme();
24
25
  var button = /*#__PURE__*/React.createElement(Button, _extends({
25
26
  appearance: "primary",
27
+ "aria-label": label,
26
28
  testId: testId,
27
29
  iconBefore: icon,
28
30
  ref: ref
@@ -1,3 +1,5 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { forwardRef } from 'react';
1
3
  import { IconButton } from '../IconButton';
2
4
  /**
3
5
  * __Profile__
@@ -8,7 +10,20 @@ import { IconButton } from '../IconButton';
8
10
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
9
11
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
10
12
  */
11
- export var Profile = IconButton;
13
+ export var Profile = /*#__PURE__*/forwardRef(function (props, ref) {
14
+ var labelProp = props.label,
15
+ tooltip = props.tooltip;
16
+ var label = labelProp || (typeof tooltip === 'string' ? tooltip : 'Your profile and settings');
17
+
18
+ // All other implementations of IconButton within the components are using spread props, so
19
+ // to use explicit props could cause regressions.
20
+ // TODO: Remove these spread props for better static analysis
21
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
22
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
23
+ label: label,
24
+ ref: ref
25
+ }, props));
26
+ });
12
27
 
13
28
  // This exists only to extract props.
14
29
  // eslint-disable-next-line @repo/internal/react/use-noop
package/dist/esm/index.js CHANGED
@@ -5,7 +5,6 @@ export { Help } from './components/Help';
5
5
  export { Notifications } from './components/Notifications';
6
6
  export { PrimaryButton } from './components/PrimaryButton';
7
7
  export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
8
- export { PrimarySplitButton } from './components/PrimarySplitButton';
9
8
  export { IconButton } from './components/IconButton';
10
9
  export { CustomProductHome, ProductHome } from './components/ProductHome';
11
10
  export { Profile } from './components/Profile';
@@ -91,6 +91,10 @@ export interface BaseIconButtonProps {
91
91
  * Makes the element appear selected.
92
92
  */
93
93
  isSelected?: boolean;
94
+ /**
95
+ * Adds a label to the button for users of assistive technologies.
96
+ */
97
+ label?: string;
94
98
  }
95
99
  export interface IconButtonSkeletonProps {
96
100
  className?: string;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { IconButtonProps } from '../IconButton/types';
3
3
  /**
4
4
  * __Profile__
@@ -9,9 +9,9 @@ import { IconButtonProps } from '../IconButton/types';
9
9
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
10
10
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
11
11
  */
12
- export declare const Profile: import("react").ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
13
- icon: import("react").ReactChild | undefined;
12
+ export declare const Profile: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
13
+ icon: React.ReactChild | undefined;
14
14
  theme?: ((current: (props: import("@atlaskit/button").ThemeProps) => import("@atlaskit/button").ThemeTokens, props: import("@atlaskit/button").ThemeProps) => import("@atlaskit/button").ThemeTokens) | undefined;
15
- } & import("react").RefAttributes<HTMLElement>>;
15
+ } & React.RefAttributes<HTMLElement>>;
16
16
  declare const _default: (props: IconButtonProps) => void;
17
17
  export default _default;
@@ -12,7 +12,6 @@ export { PrimaryButton } from './components/PrimaryButton';
12
12
  export type { PrimaryButtonProps } from './components/PrimaryButton/types';
13
13
  export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
14
14
  export type { PrimaryDropdownButtonProps } from './components/PrimaryDropdownButton/types';
15
- export { PrimarySplitButton } from './components/PrimarySplitButton';
16
15
  export { IconButton } from './components/IconButton';
17
16
  export type { IconButtonProps } from './components/IconButton/types';
18
17
  export { CustomProductHome, ProductHome } from './components/ProductHome';
@@ -91,6 +91,10 @@ export interface BaseIconButtonProps {
91
91
  * Makes the element appear selected.
92
92
  */
93
93
  isSelected?: boolean;
94
+ /**
95
+ * Adds a label to the button for users of assistive technologies.
96
+ */
97
+ label?: string;
94
98
  }
95
99
  export interface IconButtonSkeletonProps {
96
100
  className?: string;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { IconButtonProps } from '../IconButton/types';
3
3
  /**
4
4
  * __Profile__
@@ -9,9 +9,9 @@ import { IconButtonProps } from '../IconButton/types';
9
9
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
10
10
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
11
11
  */
12
- export declare const Profile: import("react").ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
13
- icon: import("react").ReactChild | undefined;
12
+ export declare const Profile: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
13
+ icon: React.ReactChild | undefined;
14
14
  theme?: ((current: (props: import("@atlaskit/button").ThemeProps) => import("@atlaskit/button").ThemeTokens, props: import("@atlaskit/button").ThemeProps) => import("@atlaskit/button").ThemeTokens) | undefined;
15
- } & import("react").RefAttributes<HTMLElement>>;
15
+ } & React.RefAttributes<HTMLElement>>;
16
16
  declare const _default: (props: IconButtonProps) => void;
17
17
  export default _default;
@@ -12,7 +12,6 @@ export { PrimaryButton } from './components/PrimaryButton';
12
12
  export type { PrimaryButtonProps } from './components/PrimaryButton/types';
13
13
  export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
14
14
  export type { PrimaryDropdownButtonProps } from './components/PrimaryDropdownButton/types';
15
- export { PrimarySplitButton } from './components/PrimarySplitButton';
16
15
  export { IconButton } from './components/IconButton';
17
16
  export type { IconButtonProps } from './components/IconButton/types';
18
17
  export { CustomProductHome, ProductHome } from './components/ProductHome';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.9.2",
3
+ "version": "3.0.0",
4
4
  "description": "A horizontal navigation component for Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,15 +33,15 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/analytics-namespaced-context": "^6.7.0",
36
- "@atlaskit/button": "^16.16.0",
36
+ "@atlaskit/button": "^16.18.0",
37
37
  "@atlaskit/ds-lib": "^2.2.0",
38
38
  "@atlaskit/icon": "^22.0.0",
39
39
  "@atlaskit/logo": "*",
40
40
  "@atlaskit/platform-feature-flags": "^0.2.0",
41
41
  "@atlaskit/popup": "^1.11.0",
42
- "@atlaskit/primitives": "^1.10.0",
42
+ "@atlaskit/primitives": "^1.13.0",
43
43
  "@atlaskit/theme": "^12.6.0",
44
- "@atlaskit/tokens": "^1.28.0",
44
+ "@atlaskit/tokens": "^1.29.0",
45
45
  "@atlaskit/tooltip": "^18.0.0",
46
46
  "@atlaskit/width-detector": "^4.1.0",
47
47
  "@babel/runtime": "^7.0.0",
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PrimarySplitButton = void 0;
7
- var _react = require("@emotion/react");
8
- var _unsafe = require("@atlaskit/button/unsafe");
9
- /** @jsx jsx */
10
-
11
- // Copied from packages/design-system/atlassian-navigation/src/components/PrimaryButton/index.tsx
12
- var buttonBaseStyles = (0, _react.css)({
13
- display: 'flex',
14
- height: '100%',
15
- position: 'relative',
16
- alignItems: 'center',
17
- justifyContent: 'center',
18
- flexDirection: 'column'
19
- });
20
-
21
- // Mostly copied from packages/design-system/atlassian-navigation/src/components/PrimaryButton/index.tsx
22
- var buttonHighlightedStyles = (0, _react.css)({
23
- '&:after': {
24
- height: 3,
25
- position: 'absolute',
26
- backgroundColor: "var(--ds-border-selected, #0052cc)",
27
- borderStartEndRadius: "var(--ds-border-radius-050, 1px)",
28
- borderStartStartRadius: "var(--ds-border-radius-050, 1px)",
29
- content: '""',
30
- insetBlockEnd: 0,
31
- insetInlineEnd: "var(--ds-space-050, 4px)",
32
- insetInlineStart: "var(--ds-space-050, 4px)"
33
- }
34
- });
35
- /**
36
- * TODO: Add JSDoc
37
- */
38
- var PrimarySplitButton = exports.PrimarySplitButton = function PrimarySplitButton(_ref) {
39
- var children = _ref.children,
40
- _ref$isHighlighted = _ref.isHighlighted,
41
- isHighlighted = _ref$isHighlighted === void 0 ? false : _ref$isHighlighted;
42
- var _getActions = (0, _unsafe.UNSAFE_GET_ACTIONS)(children),
43
- PrimaryAction = _getActions.PrimaryAction,
44
- SecondaryAction = _getActions.SecondaryAction;
45
- return (0, _react.jsx)("div", {
46
- css: [buttonBaseStyles, isHighlighted && buttonHighlightedStyles]
47
- }, (0, _react.jsx)(_unsafe.UNSAFE_SPLIT_BUTTON_CONTAINER, null, (0, _react.jsx)(_unsafe.UNSAFE_SPLIT_BUTTON_CONTEXT.Provider, {
48
- value: {
49
- appearance: 'navigation',
50
- isHighlighted: isHighlighted
51
- }
52
- }, PrimaryAction, (0, _react.jsx)(_unsafe.UNSAFE_DIVIDER, {
53
- appearance: "navigation",
54
- spacing: "default",
55
- isDisabled: false
56
- }), SecondaryAction)));
57
- };
@@ -1,52 +0,0 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
4
- import { UNSAFE_DIVIDER as Divider, UNSAFE_GET_ACTIONS as getActions, UNSAFE_SPLIT_BUTTON_CONTAINER as SplitButtonContainer, UNSAFE_SPLIT_BUTTON_CONTEXT as SplitButtonContext } from '@atlaskit/button/unsafe';
5
- // Copied from packages/design-system/atlassian-navigation/src/components/PrimaryButton/index.tsx
6
- const buttonBaseStyles = css({
7
- display: 'flex',
8
- height: '100%',
9
- position: 'relative',
10
- alignItems: 'center',
11
- justifyContent: 'center',
12
- flexDirection: 'column'
13
- });
14
-
15
- // Mostly copied from packages/design-system/atlassian-navigation/src/components/PrimaryButton/index.tsx
16
- const buttonHighlightedStyles = css({
17
- '&:after': {
18
- height: 3,
19
- position: 'absolute',
20
- backgroundColor: "var(--ds-border-selected, #0052cc)",
21
- borderStartEndRadius: "var(--ds-border-radius-050, 1px)",
22
- borderStartStartRadius: "var(--ds-border-radius-050, 1px)",
23
- content: '""',
24
- insetBlockEnd: 0,
25
- insetInlineEnd: "var(--ds-space-050, 4px)",
26
- insetInlineStart: "var(--ds-space-050, 4px)"
27
- }
28
- });
29
- /**
30
- * TODO: Add JSDoc
31
- */
32
- export const PrimarySplitButton = ({
33
- children,
34
- isHighlighted = false
35
- }) => {
36
- const {
37
- PrimaryAction,
38
- SecondaryAction
39
- } = getActions(children);
40
- return jsx("div", {
41
- css: [buttonBaseStyles, isHighlighted && buttonHighlightedStyles]
42
- }, jsx(SplitButtonContainer, null, jsx(SplitButtonContext.Provider, {
43
- value: {
44
- appearance: 'navigation',
45
- isHighlighted
46
- }
47
- }, PrimaryAction, jsx(Divider, {
48
- appearance: "navigation",
49
- spacing: "default",
50
- isDisabled: false
51
- }), SecondaryAction)));
52
- };
@@ -1,51 +0,0 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
4
- import { UNSAFE_DIVIDER as Divider, UNSAFE_GET_ACTIONS as getActions, UNSAFE_SPLIT_BUTTON_CONTAINER as SplitButtonContainer, UNSAFE_SPLIT_BUTTON_CONTEXT as SplitButtonContext } from '@atlaskit/button/unsafe';
5
- // Copied from packages/design-system/atlassian-navigation/src/components/PrimaryButton/index.tsx
6
- var buttonBaseStyles = css({
7
- display: 'flex',
8
- height: '100%',
9
- position: 'relative',
10
- alignItems: 'center',
11
- justifyContent: 'center',
12
- flexDirection: 'column'
13
- });
14
-
15
- // Mostly copied from packages/design-system/atlassian-navigation/src/components/PrimaryButton/index.tsx
16
- var buttonHighlightedStyles = css({
17
- '&:after': {
18
- height: 3,
19
- position: 'absolute',
20
- backgroundColor: "var(--ds-border-selected, #0052cc)",
21
- borderStartEndRadius: "var(--ds-border-radius-050, 1px)",
22
- borderStartStartRadius: "var(--ds-border-radius-050, 1px)",
23
- content: '""',
24
- insetBlockEnd: 0,
25
- insetInlineEnd: "var(--ds-space-050, 4px)",
26
- insetInlineStart: "var(--ds-space-050, 4px)"
27
- }
28
- });
29
- /**
30
- * TODO: Add JSDoc
31
- */
32
- export var PrimarySplitButton = function PrimarySplitButton(_ref) {
33
- var children = _ref.children,
34
- _ref$isHighlighted = _ref.isHighlighted,
35
- isHighlighted = _ref$isHighlighted === void 0 ? false : _ref$isHighlighted;
36
- var _getActions = getActions(children),
37
- PrimaryAction = _getActions.PrimaryAction,
38
- SecondaryAction = _getActions.SecondaryAction;
39
- return jsx("div", {
40
- css: [buttonBaseStyles, isHighlighted && buttonHighlightedStyles]
41
- }, jsx(SplitButtonContainer, null, jsx(SplitButtonContext.Provider, {
42
- value: {
43
- appearance: 'navigation',
44
- isHighlighted: isHighlighted
45
- }
46
- }, PrimaryAction, jsx(Divider, {
47
- appearance: "navigation",
48
- spacing: "default",
49
- isDisabled: false
50
- }), SecondaryAction)));
51
- };
@@ -1,12 +0,0 @@
1
- /** @jsx jsx */
2
- import { type ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
- type PrimarySplitButtonProps = {
5
- children: ReactNode;
6
- isHighlighted?: boolean;
7
- };
8
- /**
9
- * TODO: Add JSDoc
10
- */
11
- export declare const PrimarySplitButton: ({ children, isHighlighted, }: PrimarySplitButtonProps) => jsx.JSX.Element;
12
- export {};
@@ -1,12 +0,0 @@
1
- /** @jsx jsx */
2
- import { type ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
- type PrimarySplitButtonProps = {
5
- children: ReactNode;
6
- isHighlighted?: boolean;
7
- };
8
- /**
9
- * TODO: Add JSDoc
10
- */
11
- export declare const PrimarySplitButton: ({ children, isHighlighted, }: PrimarySplitButtonProps) => jsx.JSX.Element;
12
- export {};
@@ -1,334 +0,0 @@
1
- ## API Report File for "@atlaskit/atlassian-navigation"
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="lodash" />
8
- /// <reference types="react" />
9
-
10
- import { AllHTMLAttributes } from 'react';
11
- import { ComponentType } from 'react';
12
- import { CSSObject } from '@emotion/react';
13
- import { CustomThemeButtonProps } from '@atlaskit/button/types';
14
- import { CustomThemeButtonProps as CustomThemeButtonProps_2 } from '@atlaskit/button/custom-theme-button';
15
- import { ElementType } from 'react';
16
- import { ForwardRefExoticComponent } from 'react';
17
- import { jsx } from '@emotion/react';
18
- import { LogoProps } from '@atlaskit/logo';
19
- import { MouseEvent as MouseEvent_2 } from 'react';
20
- import noop from '@atlaskit/ds-lib/noop';
21
- import { Provider } from 'react';
22
- import { default as React_2 } from 'react';
23
- import { ReactChild } from 'react';
24
- import { ReactNode } from 'react';
25
- import { ReactNodeArray } from 'react';
26
- import { RefAttributes } from 'react';
27
- import { ThemeProps } from '@atlaskit/button/custom-theme-button';
28
- import { ThemeProps as ThemeProps_2 } from '@atlaskit/button';
29
- import { ThemeTokens } from '@atlaskit/button/custom-theme-button';
30
- import { ThemeTokens as ThemeTokens_2 } from '@atlaskit/button';
31
-
32
- // @public
33
- export const AppSwitcher: React_2.ForwardRefExoticComponent<BaseIconButtonProps & React_2.RefAttributes<any>>;
34
-
35
- // @public (undocumented)
36
- export type AppSwitcherProps = BaseIconButtonProps;
37
-
38
- // @public
39
- export const AtlassianNavigation: (props: AtlassianNavigationProps) => jsx.JSX.Element;
40
-
41
- // @public (undocumented)
42
- export interface AtlassianNavigationProps {
43
- label: string;
44
- moreLabel?: ReactNode;
45
- primaryItems: ReactNodeArray;
46
- renderAppSwitcher?: React_2.ComponentType<{}>;
47
- renderCreate?: React_2.ComponentType<{}>;
48
- renderHelp?: React_2.ComponentType<{}>;
49
- renderNotifications?: React_2.ComponentType<{}>;
50
- renderProductHome: React_2.ComponentType<{}>;
51
- renderProfile?: React_2.ComponentType<{}>;
52
- renderSearch?: React_2.ComponentType<{}>;
53
- renderSettings?: React_2.ComponentType<{}>;
54
- renderSignIn?: React_2.ComponentType<{}>;
55
- testId?: string;
56
- theme?: NavigationTheme;
57
- }
58
-
59
- // @public (undocumented)
60
- export const atlassianTheme: NavigationTheme;
61
-
62
- // @public
63
- interface BaseIconButtonProps {
64
- component?: CustomThemeButtonProps['component'];
65
- href?: string;
66
- id?: string;
67
- isDisabled?: boolean;
68
- isSelected?: boolean;
69
- onBlur?: React.FocusEventHandler<HTMLElement>;
70
- onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
71
- onFocus?: React.FocusEventHandler<HTMLElement>;
72
- onMouseDown?: React.MouseEventHandler<HTMLElement>;
73
- onMouseEnter?: React.MouseEventHandler<HTMLElement>;
74
- onMouseLeave?: React.MouseEventHandler<HTMLElement>;
75
- onMouseUp?: React.MouseEventHandler<HTMLElement>;
76
- target?: string;
77
- testId?: string;
78
- tooltip: React.ReactNode;
79
- }
80
-
81
- // @public (undocumented)
82
- type ButtonCSSContext = {
83
- default: ButtonCSSProperties;
84
- hover: ButtonCSSProperties;
85
- focus: ButtonCSSProperties;
86
- active: ButtonCSSProperties;
87
- selected: ButtonCSSProperties;
88
- selectedHover?: ButtonCSSProperties;
89
- };
90
-
91
- // @public (undocumented)
92
- type ButtonCSSProperties = CSSProperties & {
93
- boxShadow: string;
94
- };
95
-
96
- // @public (undocumented)
97
- export type Colors = {
98
- backgroundColor: string;
99
- color: string;
100
- };
101
-
102
- // @public
103
- export const Create: ({ onClick, href, text, buttonTooltip, iconButtonTooltip, testId, }: CreateProps) => jsx.JSX.Element;
104
-
105
- // @public (undocumented)
106
- export type CreateCSS = ButtonCSSContext;
107
-
108
- // @public (undocumented)
109
- export interface CreateProps {
110
- buttonTooltip?: React_2.ReactNode;
111
- href?: string;
112
- iconButtonTooltip?: React_2.ReactNode;
113
- onClick?: (e: React_2.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
114
- testId?: string;
115
- text: string;
116
- }
117
-
118
- // @public (undocumented)
119
- type CSSProperties = CSSObject & {
120
- backgroundColor: string;
121
- color: string;
122
- };
123
-
124
- // @public
125
- export const CustomProductHome: (props: CustomProductHomeProps) => jsx.JSX.Element;
126
-
127
- // @public (undocumented)
128
- export interface CustomProductHomeProps {
129
- href?: string;
130
- iconAlt: string;
131
- iconUrl: string;
132
- logoAlt: string;
133
- logoMaxWidth?: number;
134
- logoUrl: string;
135
- onClick?: (event: MouseEvent_2<HTMLElement>) => void;
136
- onMouseDown?: (event: MouseEvent_2<HTMLElement>) => void;
137
- siteTitle?: string;
138
- testId?: string;
139
- }
140
-
141
- // @public (undocumented)
142
- export const generateTheme: (themeColors: GenerateThemeArgs) => NavigationTheme;
143
-
144
- // @public (undocumented)
145
- export type GenerateThemeArgs = {
146
- name?: string;
147
- backgroundColor: string;
148
- highlightColor: string;
149
- };
150
-
151
- // @public
152
- export const Help: React_2.ForwardRefExoticComponent<BaseIconButtonProps & {
153
- badge?: React_2.ComponentType<{}> | undefined;
154
- } & React_2.RefAttributes<any>>;
155
-
156
- // @public (undocumented)
157
- export type HelpProps = BaseIconButtonProps & {
158
- badge?: ComponentType<{}>;
159
- };
160
-
161
- // @public (undocumented)
162
- export const HORIZONTAL_GLOBAL_NAV_HEIGHT = 56;
163
-
164
- // @public
165
- export const IconButton: React_2.ForwardRefExoticComponent<BaseIconButtonProps & {
166
- icon: React_2.ReactChild | undefined;
167
- theme?: ((current: (props: ThemeProps) => ThemeTokens, props: ThemeProps) => ThemeTokens) | undefined;
168
- } & React_2.RefAttributes<HTMLElement>>;
169
-
170
- // @public (undocumented)
171
- export type IconButtonCSS = ButtonCSSContext;
172
-
173
- // @public (undocumented)
174
- export type IconButtonProps = BaseIconButtonProps & {
175
- icon: CustomThemeButtonProps['iconBefore'];
176
- theme?: CustomThemeButtonProps['theme'];
177
- };
178
-
179
- // @public (undocumented)
180
- type LogoStyleProps = {
181
- iconGradientStart?: string;
182
- iconGradientStop?: string;
183
- iconColor?: string;
184
- textColor?: string;
185
- };
186
-
187
- // @public (undocumented)
188
- export type Mode = {
189
- create: CreateCSS;
190
- iconButton: IconButtonCSS;
191
- navigation: NavigationCSS;
192
- primaryButton: PrimaryButtonCSS;
193
- productHome: ProductHomeCSS;
194
- search: SearchCSS;
195
- skeleton: SkeletonCSS;
196
- };
197
-
198
- // @public (undocumented)
199
- export type NavigationCSS = CSSProperties;
200
-
201
- // @public (undocumented)
202
- export type NavigationTheme = {
203
- mode: Mode;
204
- };
205
-
206
- // @public
207
- export const Notifications: React_2.ForwardRefExoticComponent<BaseIconButtonProps & {
208
- badge: React_2.ComponentType<{}>;
209
- } & React_2.RefAttributes<any>>;
210
-
211
- // @public (undocumented)
212
- export type NotificationsProps = BaseIconButtonProps & {
213
- badge: ComponentType<{}>;
214
- };
215
-
216
- // @public
217
- export const PrimaryButton: ForwardRefExoticComponent<Omit<CustomThemeButtonProps_2, "appearance" | "onClick"> & {
218
- component?: ComponentType<AllHTMLAttributes<HTMLElement>> | ElementType<any> | undefined;
219
- isHighlighted?: boolean | undefined;
220
- testId?: string | undefined;
221
- tooltip?: ReactNode;
222
- onClick?: ((event: MouseEvent_2<HTMLElement, MouseEvent>, analyticsEvent: any) => void) | undefined;
223
- } & RefAttributes<HTMLElement>>;
224
-
225
- // @public (undocumented)
226
- export type PrimaryButtonCSS = ButtonCSSContext;
227
-
228
- // @public (undocumented)
229
- export type PrimaryButtonProps = Omit<CustomThemeButtonProps, 'appearance' | 'onClick'> & {
230
- component?: ComponentType<AllHTMLAttributes<HTMLElement>> | ElementType<any>;
231
- isHighlighted?: boolean;
232
- testId?: string;
233
- tooltip?: React.ReactNode;
234
- onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
235
- };
236
-
237
- // @public
238
- export const PrimaryDropdownButton: ForwardRefExoticComponent<Omit<PrimaryButtonProps, "iconAfter"> & {
239
- isHighlighted?: boolean | undefined;
240
- testId?: string | undefined;
241
- tooltip?: ReactNode;
242
- } & RefAttributes<HTMLElement>>;
243
-
244
- // @public (undocumented)
245
- export type PrimaryDropdownButtonProps = Omit<PrimaryButtonProps, 'iconAfter'> & {
246
- isHighlighted?: boolean;
247
- testId?: string;
248
- tooltip?: React.ReactNode;
249
- };
250
-
251
- // @public
252
- export const PrimarySplitButton: ({ children, isHighlighted, }: PrimarySplitButtonProps) => jsx.JSX.Element;
253
-
254
- // @public (undocumented)
255
- type PrimarySplitButtonProps = {
256
- children: ReactNode;
257
- isHighlighted?: boolean;
258
- };
259
-
260
- // @public
261
- export const ProductHome: ({ icon: Icon, logo: Logo, siteTitle, onClick, href, onMouseDown, testId, logoMaxWidth, ...rest }: ProductHomeProps) => jsx.JSX.Element;
262
-
263
- // @public (undocumented)
264
- type ProductHomeCSS = CSSProperties & LogoStyleProps;
265
-
266
- // @public (undocumented)
267
- export interface ProductHomeProps {
268
- href?: string;
269
- icon: ComponentType<Partial<LogoProps>>;
270
- logo: ComponentType<Partial<LogoProps>>;
271
- logoMaxWidth?: number;
272
- onClick?: (event: MouseEvent_2<HTMLElement>) => void;
273
- onMouseDown?: (event: MouseEvent_2<HTMLElement>) => void;
274
- siteTitle?: string;
275
- testId?: string;
276
- }
277
-
278
- // @public
279
- export const Profile: ForwardRefExoticComponent<BaseIconButtonProps & {
280
- icon: ReactChild | undefined;
281
- theme?: ((current: (props: ThemeProps_2) => ThemeTokens_2, props: ThemeProps_2) => ThemeTokens_2) | undefined;
282
- } & RefAttributes<HTMLElement>>;
283
-
284
- // @public (undocumented)
285
- export type ProfileProps = IconButtonProps;
286
-
287
- // @public
288
- export const Search: (props: SearchProps) => jsx.JSX.Element;
289
-
290
- // @public (undocumented)
291
- export type SearchCSS = {
292
- default: CSSProperties;
293
- focus: CSSObject;
294
- hover: CSSObject;
295
- };
296
-
297
- // @public (undocumented)
298
- export type SearchProps = BaseIconButtonProps & {
299
- placeholder: string;
300
- label: string;
301
- value?: string;
302
- };
303
-
304
- // @public
305
- export const Settings: React_2.ForwardRefExoticComponent<BaseIconButtonProps & React_2.RefAttributes<any>>;
306
-
307
- // @public (undocumented)
308
- export type SettingsProps = BaseIconButtonProps;
309
-
310
- // @public
311
- export const SignIn: (props: SignInProps) => JSX.Element;
312
-
313
- // @public (undocumented)
314
- export type SignInProps = BaseIconButtonProps;
315
-
316
- // @public (undocumented)
317
- export type SkeletonCSS = CSSObject & {
318
- backgroundColor: string;
319
- opacity: number;
320
- };
321
-
322
- // @public
323
- export const ThemeProvider: Provider<NavigationTheme>;
324
-
325
- // @public
326
- export const useOverflowStatus: () => {
327
- isVisible: boolean;
328
- openOverflowMenu: typeof noop;
329
- closeOverflowMenu: typeof noop;
330
- };
331
-
332
- // (No @packageDocumentation comment for this package)
333
-
334
- ```