@atlaskit/atlassian-navigation 4.1.4 → 4.2.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 +8 -0
- package/dist/cjs/components/SkeletonCreateButton/index.js +9 -2
- package/dist/cjs/components/SkeletonIconButton/index.js +12 -9
- package/dist/cjs/components/SkeletonPrimaryButton/index.js +9 -2
- package/dist/cjs/skeleton-switcher-button.js +52 -6
- package/dist/es2019/components/SkeletonCreateButton/index.js +9 -2
- package/dist/es2019/components/SkeletonIconButton/index.js +12 -9
- package/dist/es2019/components/SkeletonPrimaryButton/index.js +9 -2
- package/dist/es2019/skeleton-switcher-button.js +53 -6
- package/dist/esm/components/SkeletonCreateButton/index.js +9 -2
- package/dist/esm/components/SkeletonIconButton/index.js +12 -9
- package/dist/esm/components/SkeletonPrimaryButton/index.js +9 -2
- package/dist/esm/skeleton-switcher-button.js +51 -6
- package/dist/types/skeleton-switcher-button.d.ts +9 -2
- package/dist/types-ts4.5/skeleton-switcher-button.d.ts +9 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/atlassian-navigation
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#114836](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114836)
|
|
8
|
+
[`b18e778d0c7f4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b18e778d0c7f4) -
|
|
9
|
+
Accessibility changes: improving skeleton semantics for better readability for screen readers.
|
|
10
|
+
|
|
3
11
|
## 4.1.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -32,6 +32,10 @@ var skeletonCreateButtonStyles = (0, _react.css)({
|
|
|
32
32
|
marginInlineStart: "var(--ds-space-150, 12px)"
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
+
var buttonWrapperStyles = (0, _react.css)({
|
|
36
|
+
display: 'flex',
|
|
37
|
+
margin: 0
|
|
38
|
+
});
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
41
|
* __Skeleton create button__
|
|
@@ -47,11 +51,14 @@ var SkeletonCreateButton = exports.SkeletonCreateButton = function SkeletonCreat
|
|
|
47
51
|
var text = _ref.text,
|
|
48
52
|
testId = _ref.testId;
|
|
49
53
|
var theme = (0, _theme.useTheme)();
|
|
50
|
-
return (0, _react.jsx)("
|
|
54
|
+
return (0, _react.jsx)("div", {
|
|
55
|
+
role: "listitem",
|
|
56
|
+
css: buttonWrapperStyles
|
|
57
|
+
}, (0, _react.jsx)("button", {
|
|
51
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
52
59
|
style: theme.mode.create.default,
|
|
53
60
|
css: skeletonCreateButtonStyles,
|
|
54
61
|
"data-testid": testId,
|
|
55
62
|
type: "button"
|
|
56
|
-
}, text);
|
|
63
|
+
}, text));
|
|
57
64
|
};
|
|
@@ -14,8 +14,6 @@ var _theme = require("../../theme");
|
|
|
14
14
|
|
|
15
15
|
var skeletonIconButtonStyles = (0, _react.css)({
|
|
16
16
|
margin: 0,
|
|
17
|
-
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
18
|
-
marginRight: "var(--ds-space-050, 4px)",
|
|
19
17
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-075, 6px)"),
|
|
20
18
|
border: 0,
|
|
21
19
|
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
@@ -26,11 +24,6 @@ var skeletonIconButtonStyles = (0, _react.css)({
|
|
|
26
24
|
border: 0,
|
|
27
25
|
outline: 0
|
|
28
26
|
},
|
|
29
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
30
|
-
'&:only-of-type': {
|
|
31
|
-
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
32
|
-
marginRight: 0
|
|
33
|
-
},
|
|
34
27
|
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
35
28
|
'& > span': {
|
|
36
29
|
lineHeight: 'normal'
|
|
@@ -43,6 +36,13 @@ var skeletonIconButtonStyles = (0, _react.css)({
|
|
|
43
36
|
verticalAlign: 'middle'
|
|
44
37
|
}
|
|
45
38
|
});
|
|
39
|
+
var buttonWrapperStyles = (0, _react.css)({
|
|
40
|
+
marginInlineEnd: "var(--ds-space-050, 4px)",
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
42
|
+
'&:only-of-type': {
|
|
43
|
+
marginInlineEnd: 0
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* __Skeleton icon button__
|
|
@@ -58,11 +58,14 @@ var SkeletonIconButton = exports.SkeletonIconButton = function SkeletonIconButto
|
|
|
58
58
|
var children = _ref.children,
|
|
59
59
|
testId = _ref.testId;
|
|
60
60
|
var theme = (0, _theme.useTheme)();
|
|
61
|
-
return (0, _react.jsx)("
|
|
61
|
+
return (0, _react.jsx)("div", {
|
|
62
|
+
role: "listitem",
|
|
63
|
+
css: buttonWrapperStyles
|
|
64
|
+
}, (0, _react.jsx)("button", {
|
|
62
65
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
63
66
|
style: theme.mode.iconButton.default,
|
|
64
67
|
"data-testid": testId,
|
|
65
68
|
css: skeletonIconButtonStyles,
|
|
66
69
|
type: "button"
|
|
67
|
-
}, children);
|
|
70
|
+
}, children));
|
|
68
71
|
};
|
|
@@ -82,6 +82,10 @@ var isDropdownButtonStyles = (0, _react.css)({
|
|
|
82
82
|
verticalAlign: 'middle'
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
+
var buttonWrapperStyles = (0, _react.css)({
|
|
86
|
+
display: 'flex',
|
|
87
|
+
margin: 0
|
|
88
|
+
});
|
|
85
89
|
|
|
86
90
|
/**
|
|
87
91
|
* __Skeleton primary button__
|
|
@@ -107,12 +111,15 @@ var SkeletonPrimaryButton = exports.SkeletonPrimaryButton = function SkeletonPri
|
|
|
107
111
|
var dynamicStyles = (0, _utils.stripEmptyProperties)(_objectSpread(_objectSpread(_objectSpread({}, primaryButton.default), isHighlighted && {
|
|
108
112
|
color: primaryButton.selected.color
|
|
109
113
|
}), {}, (_objectSpread2 = {}, (0, _defineProperty2.default)(_objectSpread2, VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, primaryButton.selected.borderColor), (0, _defineProperty2.default)(_objectSpread2, VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color), _objectSpread2)));
|
|
110
|
-
return (0, _react.jsx)("
|
|
114
|
+
return (0, _react.jsx)("div", {
|
|
115
|
+
role: "listitem",
|
|
116
|
+
css: buttonWrapperStyles
|
|
117
|
+
}, (0, _react.jsx)("button", {
|
|
111
118
|
type: "button"
|
|
112
119
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
113
120
|
,
|
|
114
121
|
style: dynamicStyles,
|
|
115
122
|
css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
|
|
116
123
|
"data-testid": testId
|
|
117
|
-
}, text || children);
|
|
124
|
+
}, text || children));
|
|
118
125
|
};
|
|
@@ -5,9 +5,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.SkeletonSwitcherButton = void 0;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
9
|
var _appSwitcher = _interopRequireDefault(require("@atlaskit/icon/glyph/app-switcher"));
|
|
10
|
-
var
|
|
10
|
+
var _theme = require("./theme");
|
|
11
|
+
/** @jsx jsx */
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
|
+
|
|
14
|
+
var skeletonSwitcherButtonStyles = (0, _react.css)({
|
|
15
|
+
margin: 0,
|
|
16
|
+
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
17
|
+
marginRight: "var(--ds-space-050, 4px)",
|
|
18
|
+
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-075, 6px)"),
|
|
19
|
+
border: 0,
|
|
20
|
+
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
21
|
+
pointerEvents: 'none',
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
23
|
+
':focus, :active, :hover': {
|
|
24
|
+
appearance: 'none',
|
|
25
|
+
border: 0,
|
|
26
|
+
outline: 0
|
|
27
|
+
},
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
29
|
+
'&:only-of-type': {
|
|
30
|
+
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
31
|
+
marginRight: 0
|
|
32
|
+
},
|
|
33
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
34
|
+
'& > span': {
|
|
35
|
+
lineHeight: 'normal'
|
|
36
|
+
},
|
|
37
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
38
|
+
'& > img': {
|
|
39
|
+
width: 24,
|
|
40
|
+
height: 24,
|
|
41
|
+
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
42
|
+
verticalAlign: 'middle'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
11
46
|
/**
|
|
12
47
|
* __Skeleton switcher button__
|
|
13
48
|
*
|
|
@@ -20,8 +55,19 @@ var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
|
20
55
|
*/
|
|
21
56
|
var SkeletonSwitcherButton = exports.SkeletonSwitcherButton = function SkeletonSwitcherButton(_ref) {
|
|
22
57
|
var _ref$label = _ref.label,
|
|
23
|
-
label = _ref$label === void 0 ? '' : _ref$label
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
58
|
+
label = _ref$label === void 0 ? '' : _ref$label,
|
|
59
|
+
testId = _ref.testId;
|
|
60
|
+
var theme = (0, _theme.useTheme)();
|
|
61
|
+
return (
|
|
62
|
+
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
63
|
+
(0, _react.jsx)("button", {
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
65
|
+
style: theme.mode.iconButton.default,
|
|
66
|
+
"data-testid": testId,
|
|
67
|
+
css: skeletonSwitcherButtonStyles,
|
|
68
|
+
type: "button"
|
|
69
|
+
}, (0, _react.jsx)(_appSwitcher.default, {
|
|
70
|
+
label: label
|
|
71
|
+
}))
|
|
72
|
+
);
|
|
27
73
|
};
|
|
@@ -25,6 +25,10 @@ const skeletonCreateButtonStyles = css({
|
|
|
25
25
|
marginInlineStart: "var(--ds-space-150, 12px)"
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
+
const buttonWrapperStyles = css({
|
|
29
|
+
display: 'flex',
|
|
30
|
+
margin: 0
|
|
31
|
+
});
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* __Skeleton create button__
|
|
@@ -41,11 +45,14 @@ export const SkeletonCreateButton = ({
|
|
|
41
45
|
testId
|
|
42
46
|
}) => {
|
|
43
47
|
const theme = useTheme();
|
|
44
|
-
return jsx("
|
|
48
|
+
return jsx("div", {
|
|
49
|
+
role: "listitem",
|
|
50
|
+
css: buttonWrapperStyles
|
|
51
|
+
}, jsx("button", {
|
|
45
52
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
46
53
|
style: theme.mode.create.default,
|
|
47
54
|
css: skeletonCreateButtonStyles,
|
|
48
55
|
"data-testid": testId,
|
|
49
56
|
type: "button"
|
|
50
|
-
}, text);
|
|
57
|
+
}, text));
|
|
51
58
|
};
|
|
@@ -7,8 +7,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import { useTheme } from '../../theme';
|
|
8
8
|
const skeletonIconButtonStyles = css({
|
|
9
9
|
margin: 0,
|
|
10
|
-
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
11
|
-
marginRight: "var(--ds-space-050, 4px)",
|
|
12
10
|
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-075, 6px)"}`,
|
|
13
11
|
border: 0,
|
|
14
12
|
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
@@ -19,11 +17,6 @@ const skeletonIconButtonStyles = css({
|
|
|
19
17
|
border: 0,
|
|
20
18
|
outline: 0
|
|
21
19
|
},
|
|
22
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
23
|
-
'&:only-of-type': {
|
|
24
|
-
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
25
|
-
marginRight: 0
|
|
26
|
-
},
|
|
27
20
|
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
28
21
|
'& > span': {
|
|
29
22
|
lineHeight: 'normal'
|
|
@@ -36,6 +29,13 @@ const skeletonIconButtonStyles = css({
|
|
|
36
29
|
verticalAlign: 'middle'
|
|
37
30
|
}
|
|
38
31
|
});
|
|
32
|
+
const buttonWrapperStyles = css({
|
|
33
|
+
marginInlineEnd: "var(--ds-space-050, 4px)",
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
35
|
+
'&:only-of-type': {
|
|
36
|
+
marginInlineEnd: 0
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* __Skeleton icon button__
|
|
@@ -52,11 +52,14 @@ export const SkeletonIconButton = ({
|
|
|
52
52
|
testId
|
|
53
53
|
}) => {
|
|
54
54
|
const theme = useTheme();
|
|
55
|
-
return jsx("
|
|
55
|
+
return jsx("div", {
|
|
56
|
+
role: "listitem",
|
|
57
|
+
css: buttonWrapperStyles
|
|
58
|
+
}, jsx("button", {
|
|
56
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
57
60
|
style: theme.mode.iconButton.default,
|
|
58
61
|
"data-testid": testId,
|
|
59
62
|
css: skeletonIconButtonStyles,
|
|
60
63
|
type: "button"
|
|
61
|
-
}, children);
|
|
64
|
+
}, children));
|
|
62
65
|
};
|
|
@@ -75,6 +75,10 @@ const isDropdownButtonStyles = css({
|
|
|
75
75
|
verticalAlign: 'middle'
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
+
const buttonWrapperStyles = css({
|
|
79
|
+
display: 'flex',
|
|
80
|
+
margin: 0
|
|
81
|
+
});
|
|
78
82
|
|
|
79
83
|
/**
|
|
80
84
|
* __Skeleton primary button__
|
|
@@ -103,12 +107,15 @@ export const SkeletonPrimaryButton = ({
|
|
|
103
107
|
[VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR]: primaryButton.selected.borderColor,
|
|
104
108
|
[VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR]: isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color
|
|
105
109
|
});
|
|
106
|
-
return jsx("
|
|
110
|
+
return jsx("div", {
|
|
111
|
+
role: "listitem",
|
|
112
|
+
css: buttonWrapperStyles
|
|
113
|
+
}, jsx("button", {
|
|
107
114
|
type: "button"
|
|
108
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
109
116
|
,
|
|
110
117
|
style: dynamicStyles,
|
|
111
118
|
css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
|
|
112
119
|
"data-testid": testId
|
|
113
|
-
}, text || children);
|
|
120
|
+
}, text || children));
|
|
114
121
|
};
|
|
@@ -1,6 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
2
4
|
import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
|
|
3
|
-
import {
|
|
5
|
+
import { useTheme } from './theme';
|
|
6
|
+
const skeletonSwitcherButtonStyles = css({
|
|
7
|
+
margin: 0,
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
9
|
+
marginRight: "var(--ds-space-050, 4px)",
|
|
10
|
+
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-075, 6px)"}`,
|
|
11
|
+
border: 0,
|
|
12
|
+
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
13
|
+
pointerEvents: 'none',
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
15
|
+
':focus, :active, :hover': {
|
|
16
|
+
appearance: 'none',
|
|
17
|
+
border: 0,
|
|
18
|
+
outline: 0
|
|
19
|
+
},
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
21
|
+
'&:only-of-type': {
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
23
|
+
marginRight: 0
|
|
24
|
+
},
|
|
25
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
26
|
+
'& > span': {
|
|
27
|
+
lineHeight: 'normal'
|
|
28
|
+
},
|
|
29
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
30
|
+
'& > img': {
|
|
31
|
+
width: 24,
|
|
32
|
+
height: 24,
|
|
33
|
+
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
34
|
+
verticalAlign: 'middle'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
4
38
|
/**
|
|
5
39
|
* __Skeleton switcher button__
|
|
6
40
|
*
|
|
@@ -12,7 +46,20 @@ import { SkeletonIconButton } from './components/SkeletonIconButton';
|
|
|
12
46
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
13
47
|
*/
|
|
14
48
|
export const SkeletonSwitcherButton = ({
|
|
15
|
-
label = ''
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
49
|
+
label = '',
|
|
50
|
+
testId
|
|
51
|
+
}) => {
|
|
52
|
+
const theme = useTheme();
|
|
53
|
+
return (
|
|
54
|
+
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
55
|
+
jsx("button", {
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
57
|
+
style: theme.mode.iconButton.default,
|
|
58
|
+
"data-testid": testId,
|
|
59
|
+
css: skeletonSwitcherButtonStyles,
|
|
60
|
+
type: "button"
|
|
61
|
+
}, jsx(AppSwitcherIcon, {
|
|
62
|
+
label: label
|
|
63
|
+
}))
|
|
64
|
+
);
|
|
65
|
+
};
|
|
@@ -25,6 +25,10 @@ var skeletonCreateButtonStyles = css({
|
|
|
25
25
|
marginInlineStart: "var(--ds-space-150, 12px)"
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
+
var buttonWrapperStyles = css({
|
|
29
|
+
display: 'flex',
|
|
30
|
+
margin: 0
|
|
31
|
+
});
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* __Skeleton create button__
|
|
@@ -40,11 +44,14 @@ export var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
|
|
|
40
44
|
var text = _ref.text,
|
|
41
45
|
testId = _ref.testId;
|
|
42
46
|
var theme = useTheme();
|
|
43
|
-
return jsx("
|
|
47
|
+
return jsx("div", {
|
|
48
|
+
role: "listitem",
|
|
49
|
+
css: buttonWrapperStyles
|
|
50
|
+
}, jsx("button", {
|
|
44
51
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
45
52
|
style: theme.mode.create.default,
|
|
46
53
|
css: skeletonCreateButtonStyles,
|
|
47
54
|
"data-testid": testId,
|
|
48
55
|
type: "button"
|
|
49
|
-
}, text);
|
|
56
|
+
}, text));
|
|
50
57
|
};
|
|
@@ -7,8 +7,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import { useTheme } from '../../theme';
|
|
8
8
|
var skeletonIconButtonStyles = css({
|
|
9
9
|
margin: 0,
|
|
10
|
-
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
11
|
-
marginRight: "var(--ds-space-050, 4px)",
|
|
12
10
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-075, 6px)"),
|
|
13
11
|
border: 0,
|
|
14
12
|
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
@@ -19,11 +17,6 @@ var skeletonIconButtonStyles = css({
|
|
|
19
17
|
border: 0,
|
|
20
18
|
outline: 0
|
|
21
19
|
},
|
|
22
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
23
|
-
'&:only-of-type': {
|
|
24
|
-
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
25
|
-
marginRight: 0
|
|
26
|
-
},
|
|
27
20
|
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
28
21
|
'& > span': {
|
|
29
22
|
lineHeight: 'normal'
|
|
@@ -36,6 +29,13 @@ var skeletonIconButtonStyles = css({
|
|
|
36
29
|
verticalAlign: 'middle'
|
|
37
30
|
}
|
|
38
31
|
});
|
|
32
|
+
var buttonWrapperStyles = css({
|
|
33
|
+
marginInlineEnd: "var(--ds-space-050, 4px)",
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
35
|
+
'&:only-of-type': {
|
|
36
|
+
marginInlineEnd: 0
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* __Skeleton icon button__
|
|
@@ -51,11 +51,14 @@ export var SkeletonIconButton = function SkeletonIconButton(_ref) {
|
|
|
51
51
|
var children = _ref.children,
|
|
52
52
|
testId = _ref.testId;
|
|
53
53
|
var theme = useTheme();
|
|
54
|
-
return jsx("
|
|
54
|
+
return jsx("div", {
|
|
55
|
+
role: "listitem",
|
|
56
|
+
css: buttonWrapperStyles
|
|
57
|
+
}, jsx("button", {
|
|
55
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
56
59
|
style: theme.mode.iconButton.default,
|
|
57
60
|
"data-testid": testId,
|
|
58
61
|
css: skeletonIconButtonStyles,
|
|
59
62
|
type: "button"
|
|
60
|
-
}, children);
|
|
63
|
+
}, children));
|
|
61
64
|
};
|
|
@@ -78,6 +78,10 @@ var isDropdownButtonStyles = css({
|
|
|
78
78
|
verticalAlign: 'middle'
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
+
var buttonWrapperStyles = css({
|
|
82
|
+
display: 'flex',
|
|
83
|
+
margin: 0
|
|
84
|
+
});
|
|
81
85
|
|
|
82
86
|
/**
|
|
83
87
|
* __Skeleton primary button__
|
|
@@ -103,12 +107,15 @@ export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
|
|
|
103
107
|
var dynamicStyles = stripEmptyProperties(_objectSpread(_objectSpread(_objectSpread({}, primaryButton.default), isHighlighted && {
|
|
104
108
|
color: primaryButton.selected.color
|
|
105
109
|
}), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, primaryButton.selected.borderColor), _defineProperty(_objectSpread2, VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color), _objectSpread2)));
|
|
106
|
-
return jsx("
|
|
110
|
+
return jsx("div", {
|
|
111
|
+
role: "listitem",
|
|
112
|
+
css: buttonWrapperStyles
|
|
113
|
+
}, jsx("button", {
|
|
107
114
|
type: "button"
|
|
108
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
109
116
|
,
|
|
110
117
|
style: dynamicStyles,
|
|
111
118
|
css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
|
|
112
119
|
"data-testid": testId
|
|
113
|
-
}, text || children);
|
|
120
|
+
}, text || children));
|
|
114
121
|
};
|
|
@@ -1,6 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
2
4
|
import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
|
|
3
|
-
import {
|
|
5
|
+
import { useTheme } from './theme';
|
|
6
|
+
var skeletonSwitcherButtonStyles = css({
|
|
7
|
+
margin: 0,
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
9
|
+
marginRight: "var(--ds-space-050, 4px)",
|
|
10
|
+
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-075, 6px)"),
|
|
11
|
+
border: 0,
|
|
12
|
+
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
13
|
+
pointerEvents: 'none',
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
15
|
+
':focus, :active, :hover': {
|
|
16
|
+
appearance: 'none',
|
|
17
|
+
border: 0,
|
|
18
|
+
outline: 0
|
|
19
|
+
},
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
21
|
+
'&:only-of-type': {
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/no-physical-properties
|
|
23
|
+
marginRight: 0
|
|
24
|
+
},
|
|
25
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
26
|
+
'& > span': {
|
|
27
|
+
lineHeight: 'normal'
|
|
28
|
+
},
|
|
29
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
30
|
+
'& > img': {
|
|
31
|
+
width: 24,
|
|
32
|
+
height: 24,
|
|
33
|
+
borderRadius: "var(--ds-border-radius-circle, 100%)",
|
|
34
|
+
verticalAlign: 'middle'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
4
38
|
/**
|
|
5
39
|
* __Skeleton switcher button__
|
|
6
40
|
*
|
|
@@ -13,8 +47,19 @@ import { SkeletonIconButton } from './components/SkeletonIconButton';
|
|
|
13
47
|
*/
|
|
14
48
|
export var SkeletonSwitcherButton = function SkeletonSwitcherButton(_ref) {
|
|
15
49
|
var _ref$label = _ref.label,
|
|
16
|
-
label = _ref$label === void 0 ? '' : _ref$label
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
50
|
+
label = _ref$label === void 0 ? '' : _ref$label,
|
|
51
|
+
testId = _ref.testId;
|
|
52
|
+
var theme = useTheme();
|
|
53
|
+
return (
|
|
54
|
+
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
55
|
+
jsx("button", {
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
57
|
+
style: theme.mode.iconButton.default,
|
|
58
|
+
"data-testid": testId,
|
|
59
|
+
css: skeletonSwitcherButtonStyles,
|
|
60
|
+
type: "button"
|
|
61
|
+
}, jsx(AppSwitcherIcon, {
|
|
62
|
+
label: label
|
|
63
|
+
}))
|
|
64
|
+
);
|
|
20
65
|
};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
2
3
|
export type SkeletonSwitcherButtonProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Describes the specific role of this navigation component for users viewing the page with a screen
|
|
5
6
|
* reader. Use this to differentiate the buttons from other navigation buttons on a page.
|
|
6
7
|
*/
|
|
7
8
|
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* A `testId` prop is provided for specified elements,
|
|
11
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
12
|
+
* serving as a hook for automated tests.
|
|
13
|
+
*/
|
|
14
|
+
testId?: string;
|
|
8
15
|
};
|
|
9
16
|
/**
|
|
10
17
|
* __Skeleton switcher button__
|
|
@@ -16,4 +23,4 @@ export type SkeletonSwitcherButtonProps = {
|
|
|
16
23
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
17
24
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
18
25
|
*/
|
|
19
|
-
export declare const SkeletonSwitcherButton: ({ label }: SkeletonSwitcherButtonProps) => JSX.Element;
|
|
26
|
+
export declare const SkeletonSwitcherButton: ({ label, testId }: SkeletonSwitcherButtonProps) => jsx.JSX.Element;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
2
3
|
export type SkeletonSwitcherButtonProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Describes the specific role of this navigation component for users viewing the page with a screen
|
|
5
6
|
* reader. Use this to differentiate the buttons from other navigation buttons on a page.
|
|
6
7
|
*/
|
|
7
8
|
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* A `testId` prop is provided for specified elements,
|
|
11
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
12
|
+
* serving as a hook for automated tests.
|
|
13
|
+
*/
|
|
14
|
+
testId?: string;
|
|
8
15
|
};
|
|
9
16
|
/**
|
|
10
17
|
* __Skeleton switcher button__
|
|
@@ -16,4 +23,4 @@ export type SkeletonSwitcherButtonProps = {
|
|
|
16
23
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
17
24
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
18
25
|
*/
|
|
19
|
-
export declare const SkeletonSwitcherButton: ({ label }: SkeletonSwitcherButtonProps) => JSX.Element;
|
|
26
|
+
export declare const SkeletonSwitcherButton: ({ label, testId }: SkeletonSwitcherButtonProps) => jsx.JSX.Element;
|