@atlaskit/editor-toolbar 0.0.9 → 0.1.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 +17 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/ui/Toolbar.compiled.css +1 -0
- package/dist/cjs/ui/Toolbar.js +1 -1
- package/dist/cjs/ui/ToolbarButton.js +3 -1
- package/dist/cjs/ui/ToolbarDropdownMenu.js +4 -2
- package/dist/cjs/ui/icons/ShowMoreHorizontal.js +24 -0
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/ui/Toolbar.compiled.css +1 -0
- package/dist/es2019/ui/Toolbar.js +1 -1
- package/dist/es2019/ui/ToolbarButton.js +3 -1
- package/dist/es2019/ui/ToolbarDropdownMenu.js +4 -2
- package/dist/es2019/ui/icons/ShowMoreHorizontal.js +16 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/ui/Toolbar.compiled.css +1 -0
- package/dist/esm/ui/Toolbar.js +1 -1
- package/dist/esm/ui/ToolbarButton.js +3 -1
- package/dist/esm/ui/ToolbarDropdownMenu.js +4 -2
- package/dist/esm/ui/icons/ShowMoreHorizontal.js +17 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/ui/ToolbarButton.d.ts +1 -0
- package/dist/types/ui/ToolbarDropdownMenu.d.ts +2 -1
- package/dist/types/ui/icons/ShowMoreHorizontal.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarButton.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarDropdownMenu.d.ts +2 -1
- package/dist/types-ts4.5/ui/icons/ShowMoreHorizontal.d.ts +2 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/ui/Toolbar.tsx +1 -0
- package/src/ui/ToolbarButton.tsx +3 -0
- package/src/ui/ToolbarDropdownMenu.tsx +3 -0
- package/src/ui/icons/ShowMoreHorizontal.tsx +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#196043](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/196043)
|
|
8
|
+
[`c6cb0ed855827`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c6cb0ed855827) -
|
|
9
|
+
Add new ShowMoreHorizontal Icon, add new ranks to support overflow menu, add pin as a menu item
|
|
10
|
+
|
|
11
|
+
## 0.0.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#197019](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/197019)
|
|
16
|
+
[`96717455eea97`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/96717455eea97) -
|
|
17
|
+
Add background colour to Toolbar component in editor-toolbar, add EditorToolbarProvider to the
|
|
18
|
+
selection Toolbar
|
|
19
|
+
|
|
3
20
|
## 0.0.9
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -201,6 +201,12 @@ Object.defineProperty(exports, "QuoteIcon", {
|
|
|
201
201
|
return _QuoteIcon.QuoteIcon;
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
|
+
Object.defineProperty(exports, "ShowMoreHorizontalIcon", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function get() {
|
|
207
|
+
return _ShowMoreHorizontal.ShowMoreHorizontalIcon;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
204
210
|
Object.defineProperty(exports, "StrikeThroughIcon", {
|
|
205
211
|
enumerable: true,
|
|
206
212
|
get: function get() {
|
|
@@ -352,4 +358,5 @@ var _UnderlineIcon = require("./ui/icons/UnderlineIcon");
|
|
|
352
358
|
var _StrikeThroughIcon = require("./ui/icons/StrikeThroughIcon");
|
|
353
359
|
var _CodeIcon = require("./ui/icons/CodeIcon");
|
|
354
360
|
var _SubscriptIcon = require("./ui/icons/SubscriptIcon");
|
|
355
|
-
var _SuperscriptIcon = require("./ui/icons/SuperscriptIcon");
|
|
361
|
+
var _SuperscriptIcon = require("./ui/icons/SuperscriptIcon");
|
|
362
|
+
var _ShowMoreHorizontal = require("./ui/icons/ShowMoreHorizontal");
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -11,7 +11,7 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
13
13
|
var styles = {
|
|
14
|
-
toolbar: "_2rkoi2wt _u5f31b66 _19bv1b66 _16qs1cd0 _4t3i14no _1bsb184x _1e0c1txw _4cvr1h6o"
|
|
14
|
+
toolbar: "_2rkoi2wt _bfhkvuon _u5f31b66 _19bv1b66 _16qs1cd0 _4t3i14no _1bsb184x _1e0c1txw _4cvr1h6o"
|
|
15
15
|
};
|
|
16
16
|
var Toolbar = exports.Toolbar = function Toolbar(_ref) {
|
|
17
17
|
var children = _ref.children,
|
|
@@ -35,7 +35,8 @@ var ToolbarButton = exports.ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
35
35
|
testId = _ref.testId,
|
|
36
36
|
groupLocation = _ref.groupLocation,
|
|
37
37
|
isDisabled = _ref.isDisabled,
|
|
38
|
-
ariaKeyshortcuts = _ref.ariaKeyshortcuts
|
|
38
|
+
ariaKeyshortcuts = _ref.ariaKeyshortcuts,
|
|
39
|
+
label = _ref.label;
|
|
39
40
|
return /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
40
41
|
ref: ref,
|
|
41
42
|
xcss: (0, _css.cx)(styles.button, isDisabled ? styles.disabled : isSelected ? styles.selected : styles.enabled, groupLocation === 'start' && styles.groupStart, groupLocation === 'middle' && styles.groupMiddle, groupLocation === 'end' && styles.groupEnd),
|
|
@@ -44,6 +45,7 @@ var ToolbarButton = exports.ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
44
45
|
"aria-haspopup": ariaHasPopup,
|
|
45
46
|
"aria-controls": ariaControls,
|
|
46
47
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
48
|
+
"aria-label": label,
|
|
47
49
|
"data-ds--level": dataDsLevel,
|
|
48
50
|
onClick: onClick,
|
|
49
51
|
onBlur: onBlur,
|
|
@@ -13,7 +13,8 @@ var ToolbarDropdownMenu = exports.ToolbarDropdownMenu = function ToolbarDropdown
|
|
|
13
13
|
groupLocation = _ref.groupLocation,
|
|
14
14
|
children = _ref.children,
|
|
15
15
|
isDisabled = _ref.isDisabled,
|
|
16
|
-
testId = _ref.testId
|
|
16
|
+
testId = _ref.testId,
|
|
17
|
+
label = _ref.label;
|
|
17
18
|
return /*#__PURE__*/_react.default.createElement(_dropdownMenu.default, {
|
|
18
19
|
trigger: function trigger(triggerProps) {
|
|
19
20
|
return /*#__PURE__*/_react.default.createElement(_ToolbarButton.ToolbarButton, {
|
|
@@ -28,7 +29,8 @@ var ToolbarDropdownMenu = exports.ToolbarDropdownMenu = function ToolbarDropdown
|
|
|
28
29
|
testId: testId,
|
|
29
30
|
iconBefore: iconBefore,
|
|
30
31
|
groupLocation: groupLocation,
|
|
31
|
-
isDisabled: isDisabled
|
|
32
|
+
isDisabled: isDisabled,
|
|
33
|
+
label: label
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
}, children);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ShowMoreHorizontalIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
10
|
+
var ShowMoreHorizontalIcon = exports.ShowMoreHorizontalIcon = function ShowMoreHorizontalIcon(_ref) {
|
|
11
|
+
var label = _ref.label,
|
|
12
|
+
testId = _ref.testId,
|
|
13
|
+
color = _ref.color,
|
|
14
|
+
shouldRecommendSmallIcon = _ref.shouldRecommendSmallIcon,
|
|
15
|
+
spacing = _ref.spacing;
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement(_showMoreHorizontal.default, {
|
|
17
|
+
label: label,
|
|
18
|
+
testId: testId,
|
|
19
|
+
color: color,
|
|
20
|
+
shouldRecommendSmallIcon: shouldRecommendSmallIcon,
|
|
21
|
+
spacing: spacing,
|
|
22
|
+
size: "small"
|
|
23
|
+
});
|
|
24
|
+
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -48,4 +48,5 @@ export { UnderlineIcon } from './ui/icons/UnderlineIcon';
|
|
|
48
48
|
export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
49
49
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
50
50
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
51
|
-
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
51
|
+
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
52
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
6
6
|
const styles = {
|
|
7
|
-
toolbar: "_2rkoi2wt _u5f31b66 _19bv1b66 _16qs1cd0 _4t3i14no _1bsb184x _1e0c1txw _4cvr1h6o"
|
|
7
|
+
toolbar: "_2rkoi2wt _bfhkvuon _u5f31b66 _19bv1b66 _16qs1cd0 _4t3i14no _1bsb184x _1e0c1txw _4cvr1h6o"
|
|
8
8
|
};
|
|
9
9
|
export const Toolbar = ({
|
|
10
10
|
children,
|
|
@@ -27,7 +27,8 @@ export const ToolbarButton = /*#__PURE__*/forwardRef(({
|
|
|
27
27
|
testId,
|
|
28
28
|
groupLocation,
|
|
29
29
|
isDisabled,
|
|
30
|
-
ariaKeyshortcuts
|
|
30
|
+
ariaKeyshortcuts,
|
|
31
|
+
label
|
|
31
32
|
}, ref) => {
|
|
32
33
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
33
34
|
ref: ref,
|
|
@@ -37,6 +38,7 @@ export const ToolbarButton = /*#__PURE__*/forwardRef(({
|
|
|
37
38
|
"aria-haspopup": ariaHasPopup,
|
|
38
39
|
"aria-controls": ariaControls,
|
|
39
40
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
41
|
+
"aria-label": label,
|
|
40
42
|
"data-ds--level": dataDsLevel,
|
|
41
43
|
onClick: onClick,
|
|
42
44
|
onBlur: onBlur,
|
|
@@ -6,7 +6,8 @@ export const ToolbarDropdownMenu = ({
|
|
|
6
6
|
groupLocation,
|
|
7
7
|
children,
|
|
8
8
|
isDisabled,
|
|
9
|
-
testId
|
|
9
|
+
testId,
|
|
10
|
+
label
|
|
10
11
|
}) => {
|
|
11
12
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
12
13
|
trigger: triggerProps => /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
@@ -21,7 +22,8 @@ export const ToolbarDropdownMenu = ({
|
|
|
21
22
|
testId: testId,
|
|
22
23
|
iconBefore: iconBefore,
|
|
23
24
|
groupLocation: groupLocation,
|
|
24
|
-
isDisabled: isDisabled
|
|
25
|
+
isDisabled: isDisabled,
|
|
26
|
+
label: label
|
|
25
27
|
})
|
|
26
28
|
}, children);
|
|
27
29
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Icon from '@atlaskit/icon/core/show-more-horizontal';
|
|
3
|
+
export const ShowMoreHorizontalIcon = ({
|
|
4
|
+
label,
|
|
5
|
+
testId,
|
|
6
|
+
color,
|
|
7
|
+
shouldRecommendSmallIcon,
|
|
8
|
+
spacing
|
|
9
|
+
}) => /*#__PURE__*/React.createElement(Icon, {
|
|
10
|
+
label: label,
|
|
11
|
+
testId: testId,
|
|
12
|
+
color: color,
|
|
13
|
+
shouldRecommendSmallIcon: shouldRecommendSmallIcon,
|
|
14
|
+
spacing: spacing,
|
|
15
|
+
size: "small"
|
|
16
|
+
});
|
package/dist/esm/index.js
CHANGED
|
@@ -48,4 +48,5 @@ export { UnderlineIcon } from './ui/icons/UnderlineIcon';
|
|
|
48
48
|
export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
49
49
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
50
50
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
51
|
-
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
51
|
+
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
52
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
6
6
|
var styles = {
|
|
7
|
-
toolbar: "_2rkoi2wt _u5f31b66 _19bv1b66 _16qs1cd0 _4t3i14no _1bsb184x _1e0c1txw _4cvr1h6o"
|
|
7
|
+
toolbar: "_2rkoi2wt _bfhkvuon _u5f31b66 _19bv1b66 _16qs1cd0 _4t3i14no _1bsb184x _1e0c1txw _4cvr1h6o"
|
|
8
8
|
};
|
|
9
9
|
export var Toolbar = function Toolbar(_ref) {
|
|
10
10
|
var children = _ref.children,
|
|
@@ -27,7 +27,8 @@ export var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
27
27
|
testId = _ref.testId,
|
|
28
28
|
groupLocation = _ref.groupLocation,
|
|
29
29
|
isDisabled = _ref.isDisabled,
|
|
30
|
-
ariaKeyshortcuts = _ref.ariaKeyshortcuts
|
|
30
|
+
ariaKeyshortcuts = _ref.ariaKeyshortcuts,
|
|
31
|
+
label = _ref.label;
|
|
31
32
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
32
33
|
ref: ref,
|
|
33
34
|
xcss: cx(styles.button, isDisabled ? styles.disabled : isSelected ? styles.selected : styles.enabled, groupLocation === 'start' && styles.groupStart, groupLocation === 'middle' && styles.groupMiddle, groupLocation === 'end' && styles.groupEnd),
|
|
@@ -36,6 +37,7 @@ export var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
36
37
|
"aria-haspopup": ariaHasPopup,
|
|
37
38
|
"aria-controls": ariaControls,
|
|
38
39
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
40
|
+
"aria-label": label,
|
|
39
41
|
"data-ds--level": dataDsLevel,
|
|
40
42
|
onClick: onClick,
|
|
41
43
|
onBlur: onBlur,
|
|
@@ -6,7 +6,8 @@ export var ToolbarDropdownMenu = function ToolbarDropdownMenu(_ref) {
|
|
|
6
6
|
groupLocation = _ref.groupLocation,
|
|
7
7
|
children = _ref.children,
|
|
8
8
|
isDisabled = _ref.isDisabled,
|
|
9
|
-
testId = _ref.testId
|
|
9
|
+
testId = _ref.testId,
|
|
10
|
+
label = _ref.label;
|
|
10
11
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
11
12
|
trigger: function trigger(triggerProps) {
|
|
12
13
|
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
@@ -21,7 +22,8 @@ export var ToolbarDropdownMenu = function ToolbarDropdownMenu(_ref) {
|
|
|
21
22
|
testId: testId,
|
|
22
23
|
iconBefore: iconBefore,
|
|
23
24
|
groupLocation: groupLocation,
|
|
24
|
-
isDisabled: isDisabled
|
|
25
|
+
isDisabled: isDisabled,
|
|
26
|
+
label: label
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
}, children);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Icon from '@atlaskit/icon/core/show-more-horizontal';
|
|
3
|
+
export var ShowMoreHorizontalIcon = function ShowMoreHorizontalIcon(_ref) {
|
|
4
|
+
var label = _ref.label,
|
|
5
|
+
testId = _ref.testId,
|
|
6
|
+
color = _ref.color,
|
|
7
|
+
shouldRecommendSmallIcon = _ref.shouldRecommendSmallIcon,
|
|
8
|
+
spacing = _ref.spacing;
|
|
9
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
10
|
+
label: label,
|
|
11
|
+
testId: testId,
|
|
12
|
+
color: color,
|
|
13
|
+
shouldRecommendSmallIcon: shouldRecommendSmallIcon,
|
|
14
|
+
spacing: spacing,
|
|
15
|
+
size: "small"
|
|
16
|
+
});
|
|
17
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -48,4 +48,5 @@ export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
|
48
48
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
49
49
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
50
50
|
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
51
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
51
52
|
export type { IconComponent, ToolbarButtonGroupLocation } from './types';
|
|
@@ -12,6 +12,7 @@ type ToolbarButtonProps = Partial<TriggerProps> & {
|
|
|
12
12
|
groupLocation?: ToolbarButtonGroupLocation;
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
ariaKeyshortcuts?: string;
|
|
15
|
+
label?: string;
|
|
15
16
|
};
|
|
16
17
|
export declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<ToolbarButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
18
|
export {};
|
|
@@ -6,6 +6,7 @@ type ToolbarDropdownMenuProps = {
|
|
|
6
6
|
groupLocation?: ToolbarButtonGroupLocation;
|
|
7
7
|
isDisabled?: boolean;
|
|
8
8
|
testId?: string;
|
|
9
|
+
label?: string;
|
|
9
10
|
};
|
|
10
|
-
export declare const ToolbarDropdownMenu: ({ iconBefore, groupLocation, children, isDisabled, testId, }: ToolbarDropdownMenuProps) => React.JSX.Element;
|
|
11
|
+
export declare const ToolbarDropdownMenu: ({ iconBefore, groupLocation, children, isDisabled, testId, label, }: ToolbarDropdownMenuProps) => React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -48,4 +48,5 @@ export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
|
48
48
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
49
49
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
50
50
|
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
51
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
51
52
|
export type { IconComponent, ToolbarButtonGroupLocation } from './types';
|
|
@@ -12,6 +12,7 @@ type ToolbarButtonProps = Partial<TriggerProps> & {
|
|
|
12
12
|
groupLocation?: ToolbarButtonGroupLocation;
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
ariaKeyshortcuts?: string;
|
|
15
|
+
label?: string;
|
|
15
16
|
};
|
|
16
17
|
export declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<ToolbarButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
18
|
export {};
|
|
@@ -6,6 +6,7 @@ type ToolbarDropdownMenuProps = {
|
|
|
6
6
|
groupLocation?: ToolbarButtonGroupLocation;
|
|
7
7
|
isDisabled?: boolean;
|
|
8
8
|
testId?: string;
|
|
9
|
+
label?: string;
|
|
9
10
|
};
|
|
10
|
-
export declare const ToolbarDropdownMenu: ({ iconBefore, groupLocation, children, isDisabled, testId, }: ToolbarDropdownMenuProps) => React.JSX.Element;
|
|
11
|
+
export declare const ToolbarDropdownMenu: ({ iconBefore, groupLocation, children, isDisabled, testId, label, }: ToolbarDropdownMenuProps) => React.JSX.Element;
|
|
11
12
|
export {};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0
|
|
6
|
+
"version": "0.1.0",
|
|
7
7
|
"description": "Common UI for Toolbars across the platform",
|
|
8
8
|
"atlassian": {
|
|
9
9
|
"team": "Editor: Jenga",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@atlaskit/button": "^23.3.0",
|
|
29
29
|
"@atlaskit/css": "^0.12.0",
|
|
30
30
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
31
|
-
"@atlaskit/icon": "^27.
|
|
32
|
-
"@atlaskit/icon-lab": "^5.
|
|
31
|
+
"@atlaskit/icon": "^27.10.0",
|
|
32
|
+
"@atlaskit/icon-lab": "^5.4.0",
|
|
33
33
|
"@atlaskit/logo": "^19.6.0",
|
|
34
34
|
"@atlaskit/popup": "^4.3.0",
|
|
35
35
|
"@atlaskit/primitives": "^14.11.0",
|
package/src/index.ts
CHANGED
|
@@ -50,5 +50,6 @@ export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
|
50
50
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
51
51
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
52
52
|
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
53
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
53
54
|
|
|
54
55
|
export type { IconComponent, ToolbarButtonGroupLocation } from './types';
|
package/src/ui/Toolbar.tsx
CHANGED
package/src/ui/ToolbarButton.tsx
CHANGED
|
@@ -84,6 +84,7 @@ type ToolbarButtonProps = Partial<TriggerProps> & {
|
|
|
84
84
|
groupLocation?: ToolbarButtonGroupLocation;
|
|
85
85
|
isDisabled?: boolean;
|
|
86
86
|
ariaKeyshortcuts?: string;
|
|
87
|
+
label?: string;
|
|
87
88
|
};
|
|
88
89
|
|
|
89
90
|
export const ToolbarButton = forwardRef(
|
|
@@ -103,6 +104,7 @@ export const ToolbarButton = forwardRef(
|
|
|
103
104
|
groupLocation,
|
|
104
105
|
isDisabled,
|
|
105
106
|
ariaKeyshortcuts,
|
|
107
|
+
label,
|
|
106
108
|
}: ToolbarButtonProps,
|
|
107
109
|
ref: Ref<HTMLButtonElement>,
|
|
108
110
|
) => {
|
|
@@ -121,6 +123,7 @@ export const ToolbarButton = forwardRef(
|
|
|
121
123
|
aria-haspopup={ariaHasPopup}
|
|
122
124
|
aria-controls={ariaControls}
|
|
123
125
|
aria-keyshortcuts={ariaKeyshortcuts}
|
|
126
|
+
aria-label={label}
|
|
124
127
|
data-ds--level={dataDsLevel}
|
|
125
128
|
onClick={onClick}
|
|
126
129
|
onBlur={onBlur}
|
|
@@ -12,6 +12,7 @@ type ToolbarDropdownMenuProps = {
|
|
|
12
12
|
groupLocation?: ToolbarButtonGroupLocation;
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
testId?: string;
|
|
15
|
+
label?: string;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export const ToolbarDropdownMenu = ({
|
|
@@ -20,6 +21,7 @@ export const ToolbarDropdownMenu = ({
|
|
|
20
21
|
children,
|
|
21
22
|
isDisabled,
|
|
22
23
|
testId,
|
|
24
|
+
label,
|
|
23
25
|
}: ToolbarDropdownMenuProps) => {
|
|
24
26
|
return (
|
|
25
27
|
<DropdownMenu<HTMLButtonElement>
|
|
@@ -37,6 +39,7 @@ export const ToolbarDropdownMenu = ({
|
|
|
37
39
|
iconBefore={iconBefore}
|
|
38
40
|
groupLocation={groupLocation}
|
|
39
41
|
isDisabled={isDisabled}
|
|
42
|
+
label={label}
|
|
40
43
|
/>
|
|
41
44
|
)}
|
|
42
45
|
>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Icon from '@atlaskit/icon/core/show-more-horizontal';
|
|
4
|
+
|
|
5
|
+
import { type IconComponent } from '../../types';
|
|
6
|
+
|
|
7
|
+
export const ShowMoreHorizontalIcon: IconComponent = ({
|
|
8
|
+
label,
|
|
9
|
+
testId,
|
|
10
|
+
color,
|
|
11
|
+
shouldRecommendSmallIcon,
|
|
12
|
+
spacing,
|
|
13
|
+
}) => (
|
|
14
|
+
<Icon
|
|
15
|
+
label={label}
|
|
16
|
+
testId={testId}
|
|
17
|
+
color={color}
|
|
18
|
+
shouldRecommendSmallIcon={shouldRecommendSmallIcon}
|
|
19
|
+
spacing={spacing}
|
|
20
|
+
size="small"
|
|
21
|
+
/>
|
|
22
|
+
);
|