@atlaskit/atlassian-navigation 2.8.0 → 2.9.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 +81 -71
- package/dist/cjs/common/constants.js +9 -18
- package/dist/cjs/common/styles.js +3 -5
- package/dist/cjs/components/AppSwitcher/index.js +2 -4
- package/dist/cjs/components/AtlassianNavigation/index.js +2 -4
- package/dist/cjs/components/AtlassianNavigation/skeleton.js +2 -4
- package/dist/cjs/components/BadgeContainer/index.js +2 -3
- package/dist/cjs/components/Create/index.js +2 -4
- package/dist/cjs/components/Create/skeleton.js +2 -3
- package/dist/cjs/components/Create/styles.js +2 -3
- package/dist/cjs/components/Help/index.js +2 -4
- package/dist/cjs/components/IconButton/index.js +2 -3
- package/dist/cjs/components/IconButton/skeleton.js +2 -3
- package/dist/cjs/components/IconButton/styles.js +2 -3
- package/dist/cjs/components/Notifications/index.js +2 -4
- package/dist/cjs/components/PrimaryButton/index.js +8 -10
- package/dist/cjs/components/PrimaryButton/skeleton.js +2 -3
- package/dist/cjs/components/PrimaryButton/styles.js +2 -3
- package/dist/cjs/components/PrimaryDropdownButton/index.js +2 -4
- package/dist/cjs/components/PrimaryItemsContainer/index.js +2 -3
- package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +2 -3
- package/dist/cjs/components/PrimaryItemsContainerV2/index.js +2 -3
- package/dist/cjs/components/PrimarySplitButton/index.js +57 -0
- package/dist/cjs/components/ProductHome/custom-product-home.js +1 -2
- package/dist/cjs/components/ProductHome/product-home.js +1 -2
- package/dist/cjs/components/ProductHome/skeleton.js +2 -3
- package/dist/cjs/components/ProductHome/utils.js +2 -3
- package/dist/cjs/components/Profile/index.js +2 -4
- package/dist/cjs/components/Profile/skeleton.js +2 -3
- package/dist/cjs/components/Search/index.js +2 -4
- package/dist/cjs/components/Search/skeleton.js +2 -3
- package/dist/cjs/components/Settings/index.js +2 -4
- package/dist/cjs/components/SignIn/index.js +2 -4
- package/dist/cjs/components/SignIn/skeleton.js +2 -3
- package/dist/cjs/components/SkeletonCreateButton/index.js +2 -3
- package/dist/cjs/components/SkeletonIconButton/index.js +2 -3
- package/dist/cjs/components/SkeletonPrimaryButton/index.js +2 -3
- package/dist/cjs/controllers/overflow/index.js +4 -8
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/skeleton-help-button.js +2 -3
- package/dist/cjs/skeleton-notification-button.js +2 -3
- package/dist/cjs/skeleton-settings-button.js +2 -3
- package/dist/cjs/skeleton-switcher-button.js +2 -3
- package/dist/cjs/theme/default-theme.js +2 -4
- package/dist/cjs/theme/theme-generator.js +2 -4
- package/dist/cjs/theme/theme-helpers.js +6 -11
- package/dist/cjs/theme/theme-provider.js +2 -4
- package/dist/cjs/theme/themes.js +2 -4
- package/dist/cjs/theme/use-theme.js +2 -3
- package/dist/es2019/components/PrimaryButton/index.js +6 -6
- package/dist/es2019/components/PrimarySplitButton/index.js +52 -0
- package/dist/es2019/index.js +1 -0
- package/dist/esm/components/PrimaryButton/index.js +6 -6
- package/dist/esm/components/PrimarySplitButton/index.js +51 -0
- package/dist/esm/index.js +1 -0
- package/dist/types/components/PrimarySplitButton/index.d.ts +12 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types-ts4.5/components/PrimarySplitButton/index.d.ts +12 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/package.json +5 -4
- package/report.api.md +12 -0
- package/tmp/api-report-tmp.d.ts +9 -0
|
@@ -30,7 +30,7 @@ var OverflowContext = /*#__PURE__*/(0, _react.createContext)({
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
33
|
-
var OverflowProvider = function OverflowProvider(_ref) {
|
|
33
|
+
var OverflowProvider = exports.OverflowProvider = function OverflowProvider(_ref) {
|
|
34
34
|
var children = _ref.children,
|
|
35
35
|
isVisible = _ref.isVisible,
|
|
36
36
|
openOverflowMenu = _ref.openOverflowMenu,
|
|
@@ -55,12 +55,10 @@ var OverflowProvider = function OverflowProvider(_ref) {
|
|
|
55
55
|
*
|
|
56
56
|
* - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
|
|
57
57
|
*/
|
|
58
|
-
exports.
|
|
59
|
-
var useOverflowStatus = function useOverflowStatus() {
|
|
58
|
+
var useOverflowStatus = exports.useOverflowStatus = function useOverflowStatus() {
|
|
60
59
|
return (0, _react.useContext)(OverflowContext);
|
|
61
60
|
};
|
|
62
|
-
exports.
|
|
63
|
-
var useOverflowController = function useOverflowController(nodes) {
|
|
61
|
+
var useOverflowController = exports.useOverflowController = function useOverflowController(nodes) {
|
|
64
62
|
var items = _react.default.Children.toArray(nodes);
|
|
65
63
|
var _useState = (0, _react.useState)(9999),
|
|
66
64
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -150,6 +148,4 @@ var useOverflowController = function useOverflowController(nodes) {
|
|
|
150
148
|
|
|
151
149
|
// Used to extract props for useOverflowStatus();
|
|
152
150
|
// eslint-disable-next-line @repo/internal/react/use-noop
|
|
153
|
-
exports.
|
|
154
|
-
var _default = function _default(props) {};
|
|
155
|
-
exports.default = _default;
|
|
151
|
+
var _default = exports.default = function _default(props) {};
|
package/dist/cjs/index.js
CHANGED
|
@@ -63,6 +63,12 @@ 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
|
+
});
|
|
66
72
|
Object.defineProperty(exports, "ProductHome", {
|
|
67
73
|
enumerable: true,
|
|
68
74
|
get: function get() {
|
|
@@ -124,6 +130,7 @@ var _Help = require("./components/Help");
|
|
|
124
130
|
var _Notifications = require("./components/Notifications");
|
|
125
131
|
var _PrimaryButton = require("./components/PrimaryButton");
|
|
126
132
|
var _PrimaryDropdownButton = require("./components/PrimaryDropdownButton");
|
|
133
|
+
var _PrimarySplitButton = require("./components/PrimarySplitButton");
|
|
127
134
|
var _IconButton = require("./components/IconButton");
|
|
128
135
|
var _ProductHome = require("./components/ProductHome");
|
|
129
136
|
var _Profile = require("./components/Profile");
|
|
@@ -19,7 +19,7 @@ var _theme = require("./theme");
|
|
|
19
19
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
20
20
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
21
21
|
*/
|
|
22
|
-
var SkeletonHelpButton = function SkeletonHelpButton(_ref) {
|
|
22
|
+
var SkeletonHelpButton = exports.SkeletonHelpButton = function SkeletonHelpButton(_ref) {
|
|
23
23
|
var _ref$label = _ref.label,
|
|
24
24
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
25
25
|
var _useTheme = (0, _theme.useTheme)(),
|
|
@@ -28,5 +28,4 @@ var SkeletonHelpButton = function SkeletonHelpButton(_ref) {
|
|
|
28
28
|
label: label,
|
|
29
29
|
secondaryColor: navigation.backgroundColor
|
|
30
30
|
}));
|
|
31
|
-
};
|
|
32
|
-
exports.SkeletonHelpButton = SkeletonHelpButton;
|
|
31
|
+
};
|
|
@@ -18,11 +18,10 @@ var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
|
18
18
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
19
19
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
20
20
|
*/
|
|
21
|
-
var SkeletonNotificationButton = function SkeletonNotificationButton(_ref) {
|
|
21
|
+
var SkeletonNotificationButton = exports.SkeletonNotificationButton = function SkeletonNotificationButton(_ref) {
|
|
22
22
|
var _ref$label = _ref.label,
|
|
23
23
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement(_SkeletonIconButton.SkeletonIconButton, null, /*#__PURE__*/_react.default.createElement(_notification.default, {
|
|
25
25
|
label: label
|
|
26
26
|
}));
|
|
27
|
-
};
|
|
28
|
-
exports.SkeletonNotificationButton = SkeletonNotificationButton;
|
|
27
|
+
};
|
|
@@ -18,11 +18,10 @@ var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
|
18
18
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
19
19
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
20
20
|
*/
|
|
21
|
-
var SkeletonSettingsButton = function SkeletonSettingsButton(_ref) {
|
|
21
|
+
var SkeletonSettingsButton = exports.SkeletonSettingsButton = function SkeletonSettingsButton(_ref) {
|
|
22
22
|
var _ref$label = _ref.label,
|
|
23
23
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement(_SkeletonIconButton.SkeletonIconButton, null, /*#__PURE__*/_react.default.createElement(_settings.default, {
|
|
25
25
|
label: label
|
|
26
26
|
}));
|
|
27
|
-
};
|
|
28
|
-
exports.SkeletonSettingsButton = SkeletonSettingsButton;
|
|
27
|
+
};
|
|
@@ -18,11 +18,10 @@ var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
|
18
18
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
19
19
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
20
20
|
*/
|
|
21
|
-
var SkeletonSwitcherButton = function SkeletonSwitcherButton(_ref) {
|
|
21
|
+
var SkeletonSwitcherButton = exports.SkeletonSwitcherButton = function SkeletonSwitcherButton(_ref) {
|
|
22
22
|
var _ref$label = _ref.label,
|
|
23
23
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement(_SkeletonIconButton.SkeletonIconButton, null, /*#__PURE__*/_react.default.createElement(_appSwitcher.default, {
|
|
25
25
|
label: label
|
|
26
26
|
}));
|
|
27
|
-
};
|
|
28
|
-
exports.SkeletonSwitcherButton = SkeletonSwitcherButton;
|
|
27
|
+
};
|
|
@@ -137,7 +137,5 @@ var defaultTheme = {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
|
-
var DEFAULT_THEME_NAME = 'atlassian';
|
|
141
|
-
exports.
|
|
142
|
-
var _default = defaultTheme;
|
|
143
|
-
exports.default = _default;
|
|
140
|
+
var DEFAULT_THEME_NAME = exports.DEFAULT_THEME_NAME = 'atlassian';
|
|
141
|
+
var _default = exports.default = defaultTheme;
|
|
@@ -69,7 +69,7 @@ var generateCreateButtonColors = function generateCreateButtonColors(themeBackgr
|
|
|
69
69
|
highlightColor: themeHighlight
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
var generateTheme = function generateTheme(themeColors) {
|
|
72
|
+
var generateTheme = exports.generateTheme = function generateTheme(themeColors) {
|
|
73
73
|
var backgroundColor = themeColors.backgroundColor,
|
|
74
74
|
highlightColor = themeColors.highlightColor,
|
|
75
75
|
name = themeColors.name;
|
|
@@ -116,6 +116,4 @@ var generateTheme = function generateTheme(themeColors) {
|
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
|
-
exports.
|
|
120
|
-
var _default = generateTheme;
|
|
121
|
-
exports.default = _default;
|
|
119
|
+
var _default = exports.default = generateTheme;
|
|
@@ -10,18 +10,16 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _chromatism = _interopRequireDefault(require("chromatism"));
|
|
11
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
-
var hexToRGBA = function hexToRGBA(hex) {
|
|
13
|
+
var hexToRGBA = exports.hexToRGBA = function hexToRGBA(hex) {
|
|
14
14
|
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
15
15
|
var rgba = _objectSpread(_objectSpread({}, _chromatism.default.convert(hex).rgb), {
|
|
16
16
|
a: opacity
|
|
17
17
|
});
|
|
18
18
|
return "rgba(".concat(Object.values(rgba).join(', '), ")");
|
|
19
19
|
};
|
|
20
|
-
exports.
|
|
21
|
-
var getBoxShadow = function getBoxShadow(color) {
|
|
20
|
+
var getBoxShadow = exports.getBoxShadow = function getBoxShadow(color) {
|
|
22
21
|
return "0 0 0 2px ".concat(color);
|
|
23
22
|
};
|
|
24
|
-
exports.getBoxShadow = getBoxShadow;
|
|
25
23
|
var hex = '[a-z0-9]';
|
|
26
24
|
var shortHandHexColorPattern = new RegExp("#(".concat(hex, ")(").concat(hex, ")(").concat(hex, ")"), 'i');
|
|
27
25
|
var repeat = function repeat(str, times) {
|
|
@@ -44,7 +42,7 @@ var completeTriplet = function completeTriplet(colors) {
|
|
|
44
42
|
var isTriplet = function isTriplet(colors) {
|
|
45
43
|
return colors[0] === colors[1] && colors[1] === colors[2];
|
|
46
44
|
};
|
|
47
|
-
var convertHexShorthand = function convertHexShorthand(color) {
|
|
45
|
+
var convertHexShorthand = exports.convertHexShorthand = function convertHexShorthand(color) {
|
|
48
46
|
if (isShortHexColor(color)) {
|
|
49
47
|
// when color = '#ccc', matches is structured as ['#ccc', 'c', 'c', 'c', ...]
|
|
50
48
|
var matches = color.match(shortHandHexColorPattern);
|
|
@@ -61,13 +59,10 @@ var convertHexShorthand = function convertHexShorthand(color) {
|
|
|
61
59
|
// return the color as is when it's not hex color shorthand
|
|
62
60
|
return color;
|
|
63
61
|
};
|
|
64
|
-
exports.
|
|
65
|
-
var generateTextColor = function generateTextColor(color) {
|
|
62
|
+
var generateTextColor = exports.generateTextColor = function generateTextColor(color) {
|
|
66
63
|
var converted = convertHexShorthand(color);
|
|
67
64
|
return _chromatism.default.contrastRatio(converted).hex;
|
|
68
65
|
};
|
|
69
|
-
exports.
|
|
70
|
-
var getContrastColor = function getContrastColor(contrastValue, opacityValue, color) {
|
|
66
|
+
var getContrastColor = exports.getContrastColor = function getContrastColor(contrastValue, opacityValue, color) {
|
|
71
67
|
return hexToRGBA(_chromatism.default.contrast(contrastValue, color).hex, opacityValue);
|
|
72
|
-
};
|
|
73
|
-
exports.getContrastColor = getContrastColor;
|
|
68
|
+
};
|
|
@@ -8,13 +8,11 @@ var _react = require("react");
|
|
|
8
8
|
var _themes = require("./themes");
|
|
9
9
|
// Internal only
|
|
10
10
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
11
|
-
var ThemeContext = /*#__PURE__*/(0, _react.createContext)(_themes.defaultTheme);
|
|
11
|
+
var ThemeContext = exports.ThemeContext = /*#__PURE__*/(0, _react.createContext)(_themes.defaultTheme);
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* __Theme provider__
|
|
15
15
|
*
|
|
16
16
|
* A provider for the theme context used by all navigation components.
|
|
17
17
|
*/
|
|
18
|
-
exports.
|
|
19
|
-
var ThemeProvider = ThemeContext.Provider;
|
|
20
|
-
exports.ThemeProvider = ThemeProvider;
|
|
18
|
+
var ThemeProvider = exports.ThemeProvider = ThemeContext.Provider;
|
package/dist/cjs/theme/themes.js
CHANGED
|
@@ -7,13 +7,11 @@ exports.defaultTheme = exports.atlassianTheme = void 0;
|
|
|
7
7
|
var _colors = require("@atlaskit/theme/colors");
|
|
8
8
|
var _defaultTheme = require("./default-theme");
|
|
9
9
|
var _themeGenerator = require("./theme-generator");
|
|
10
|
-
var atlassianTheme = (0, _themeGenerator.generateTheme)({
|
|
10
|
+
var atlassianTheme = exports.atlassianTheme = (0, _themeGenerator.generateTheme)({
|
|
11
11
|
name: _defaultTheme.DEFAULT_THEME_NAME,
|
|
12
12
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
13
13
|
backgroundColor: _colors.N0,
|
|
14
14
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
15
15
|
highlightColor: _colors.B400
|
|
16
16
|
});
|
|
17
|
-
exports.
|
|
18
|
-
var defaultTheme = atlassianTheme;
|
|
19
|
-
exports.defaultTheme = defaultTheme;
|
|
17
|
+
var defaultTheme = exports.defaultTheme = atlassianTheme;
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useTheme = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _themeProvider = require("./theme-provider");
|
|
9
|
-
var useTheme = function useTheme() {
|
|
9
|
+
var useTheme = exports.useTheme = function useTheme() {
|
|
10
10
|
return (0, _react.useContext)(_themeProvider.ThemeContext);
|
|
11
|
-
};
|
|
12
|
-
exports.useTheme = useTheme;
|
|
11
|
+
};
|
|
@@ -24,13 +24,13 @@ const buttonHighlightedStyles = css({
|
|
|
24
24
|
'&:after': {
|
|
25
25
|
height: 3,
|
|
26
26
|
position: 'absolute',
|
|
27
|
-
right: "var(--ds-space-050, 4px)",
|
|
28
|
-
bottom: 0,
|
|
29
|
-
left: "var(--ds-space-050, 4px)",
|
|
30
27
|
backgroundColor: `var(${VAR_BUTTON_SELECTED_BORDER_COLOR})`,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
content: '""'
|
|
28
|
+
borderStartEndRadius: "var(--ds-border-radius-050, 1px)",
|
|
29
|
+
borderStartStartRadius: "var(--ds-border-radius-050, 1px)",
|
|
30
|
+
content: '""',
|
|
31
|
+
insetBlockEnd: 0,
|
|
32
|
+
insetInlineEnd: "var(--ds-space-050, 4px)",
|
|
33
|
+
insetInlineStart: "var(--ds-space-050, 4px)"
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -5,6 +5,7 @@ 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';
|
|
8
9
|
export { IconButton } from './components/IconButton';
|
|
9
10
|
export { CustomProductHome, ProductHome } from './components/ProductHome';
|
|
10
11
|
export { Profile } from './components/Profile';
|
|
@@ -27,13 +27,13 @@ var buttonHighlightedStyles = css({
|
|
|
27
27
|
'&:after': {
|
|
28
28
|
height: 3,
|
|
29
29
|
position: 'absolute',
|
|
30
|
-
right: "var(--ds-space-050, 4px)",
|
|
31
|
-
bottom: 0,
|
|
32
|
-
left: "var(--ds-space-050, 4px)",
|
|
33
30
|
backgroundColor: "var(".concat(VAR_BUTTON_SELECTED_BORDER_COLOR, ")"),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
content: '""'
|
|
31
|
+
borderStartEndRadius: "var(--ds-border-radius-050, 1px)",
|
|
32
|
+
borderStartStartRadius: "var(--ds-border-radius-050, 1px)",
|
|
33
|
+
content: '""',
|
|
34
|
+
insetBlockEnd: 0,
|
|
35
|
+
insetInlineEnd: "var(--ds-space-050, 4px)",
|
|
36
|
+
insetInlineStart: "var(--ds-space-050, 4px)"
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -5,6 +5,7 @@ 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';
|
|
8
9
|
export { IconButton } from './components/IconButton';
|
|
9
10
|
export { CustomProductHome, ProductHome } from './components/ProductHome';
|
|
10
11
|
export { Profile } from './components/Profile';
|
|
@@ -0,0 +1,12 @@
|
|
|
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 {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ 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';
|
|
15
16
|
export { IconButton } from './components/IconButton';
|
|
16
17
|
export type { IconButtonProps } from './components/IconButton/types';
|
|
17
18
|
export { CustomProductHome, ProductHome } from './components/ProductHome';
|
|
@@ -0,0 +1,12 @@
|
|
|
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 {};
|
|
@@ -12,6 +12,7 @@ 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';
|
|
15
16
|
export { IconButton } from './components/IconButton';
|
|
16
17
|
export type { IconButtonProps } from './components/IconButton/types';
|
|
17
18
|
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.
|
|
3
|
+
"version": "2.9.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.
|
|
36
|
+
"@atlaskit/button": "^16.11.0",
|
|
37
37
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
38
38
|
"@atlaskit/icon": "^21.12.0",
|
|
39
39
|
"@atlaskit/logo": "*",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
41
|
-
"@atlaskit/popup": "^1.
|
|
41
|
+
"@atlaskit/popup": "^1.11.0",
|
|
42
42
|
"@atlaskit/primitives": "^1.6.0",
|
|
43
43
|
"@atlaskit/theme": "^12.6.0",
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/tokens": "^1.28.0",
|
|
45
45
|
"@atlaskit/tooltip": "^17.8.0",
|
|
46
46
|
"@atlaskit/width-detector": "^4.1.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@af/accessibility-testing": "*",
|
|
57
57
|
"@af/visual-regression": "*",
|
|
58
|
+
"@atlaskit/dropdown-menu": "^12.1.0",
|
|
58
59
|
"@atlaskit/notification-indicator": "*",
|
|
59
60
|
"@atlaskit/notification-log-client": "*",
|
|
60
61
|
"@atlaskit/visual-regression": "*",
|
package/report.api.md
CHANGED
|
@@ -301,6 +301,18 @@ export type PrimaryDropdownButtonProps = Omit<
|
|
|
301
301
|
tooltip?: React.ReactNode;
|
|
302
302
|
};
|
|
303
303
|
|
|
304
|
+
// @public
|
|
305
|
+
export const PrimarySplitButton: ({
|
|
306
|
+
children,
|
|
307
|
+
isHighlighted,
|
|
308
|
+
}: PrimarySplitButtonProps) => jsx.JSX.Element;
|
|
309
|
+
|
|
310
|
+
// @public (undocumented)
|
|
311
|
+
type PrimarySplitButtonProps = {
|
|
312
|
+
children: ReactNode;
|
|
313
|
+
isHighlighted?: boolean;
|
|
314
|
+
};
|
|
315
|
+
|
|
304
316
|
// @public
|
|
305
317
|
export const ProductHome: ({
|
|
306
318
|
icon: Icon,
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -248,6 +248,15 @@ export type PrimaryDropdownButtonProps = Omit<PrimaryButtonProps, 'iconAfter'> &
|
|
|
248
248
|
tooltip?: React.ReactNode;
|
|
249
249
|
};
|
|
250
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
|
+
|
|
251
260
|
// @public
|
|
252
261
|
export const ProductHome: ({ icon: Icon, logo: Logo, siteTitle, onClick, href, onMouseDown, testId, logoMaxWidth, ...rest }: ProductHomeProps) => jsx.JSX.Element;
|
|
253
262
|
|