@atlaskit/editor-toolbar 0.0.10 → 0.1.1
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 +19 -0
- package/dist/cjs/index.js +15 -1
- package/dist/cjs/ui/ToolbarButton.js +3 -1
- package/dist/cjs/ui/ToolbarDropdownItem.compiled.css +0 -7
- package/dist/cjs/ui/ToolbarDropdownItem.js +2 -13
- package/dist/cjs/ui/ToolbarDropdownMenu.js +4 -2
- package/dist/cjs/ui/icons/ShowMoreHorizontal.js +24 -0
- package/dist/es2019/index.js +3 -1
- package/dist/es2019/ui/ToolbarButton.js +3 -1
- package/dist/es2019/ui/ToolbarDropdownItem.compiled.css +0 -7
- package/dist/es2019/ui/ToolbarDropdownItem.js +3 -13
- package/dist/es2019/ui/ToolbarDropdownMenu.js +4 -2
- package/dist/es2019/ui/icons/ShowMoreHorizontal.js +16 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/ui/ToolbarButton.js +3 -1
- package/dist/esm/ui/ToolbarDropdownItem.compiled.css +0 -7
- package/dist/esm/ui/ToolbarDropdownItem.js +3 -14
- package/dist/esm/ui/ToolbarDropdownMenu.js +4 -2
- package/dist/esm/ui/icons/ShowMoreHorizontal.js +17 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/ui/ToolbarButton.d.ts +1 -0
- package/dist/types/ui/ToolbarDropdownItem.d.ts +1 -1
- 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 +2 -0
- package/dist/types-ts4.5/ui/ToolbarButton.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarDropdownItem.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarDropdownMenu.d.ts +2 -1
- package/dist/types-ts4.5/ui/icons/ShowMoreHorizontal.d.ts +2 -0
- package/examples/toolbar/examples/ExampleManuallyComposedToolbar.tsx +28 -13
- package/package.json +3 -3
- package/src/index.ts +2 -0
- package/src/ui/ToolbarButton.tsx +3 -0
- package/src/ui/ToolbarDropdownItem.tsx +2 -24
- package/src/ui/ToolbarDropdownMenu.tsx +3 -0
- package/src/ui/icons/ShowMoreHorizontal.tsx +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`428e4e6ff8ac9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/428e4e6ff8ac9) -
|
|
8
|
+
ED-28683 remove textStyle option from ToolbarDropdownItem, apply this style from the children
|
|
9
|
+
instead
|
|
10
|
+
- [#197017](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/197017)
|
|
11
|
+
[`5ef01d09bada1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5ef01d09bada1) -
|
|
12
|
+
[ux] ED-28687 [Register] Text colour + highlight
|
|
13
|
+
|
|
14
|
+
## 0.1.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [#196043](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/196043)
|
|
19
|
+
[`c6cb0ed855827`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c6cb0ed855827) -
|
|
20
|
+
Add new ShowMoreHorizontal Icon, add new ranks to support overflow menu, add pin as a menu item
|
|
21
|
+
|
|
3
22
|
## 0.0.10
|
|
4
23
|
|
|
5
24
|
### 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() {
|
|
@@ -249,6 +255,12 @@ Object.defineProperty(exports, "ToolbarButtonGroup", {
|
|
|
249
255
|
return _ToolbarButtonGroup.ToolbarButtonGroup;
|
|
250
256
|
}
|
|
251
257
|
});
|
|
258
|
+
Object.defineProperty(exports, "ToolbarColorSwatch", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function get() {
|
|
261
|
+
return _ToolbarColorSwatch.ToolbarColorSwatch;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
252
264
|
Object.defineProperty(exports, "ToolbarDropdownDivider", {
|
|
253
265
|
enumerable: true,
|
|
254
266
|
get: function get() {
|
|
@@ -314,6 +326,7 @@ var _ToolbarSection = require("./ui/ToolbarSection");
|
|
|
314
326
|
var _ToolbarTooltip = require("./ui/ToolbarTooltip");
|
|
315
327
|
var _ToolbarNestedDropdownMenu = require("./ui/ToolbarNestedDropdownMenu");
|
|
316
328
|
var _ToolbarDropdownDivider = require("./ui/ToolbarDropdownDivider");
|
|
329
|
+
var _ToolbarColorSwatch = require("./ui/ToolbarColorSwatch");
|
|
317
330
|
var _AIAdjustLengthIcon = require("./ui/icons/AIAdjustLengthIcon");
|
|
318
331
|
var _AIChatIcon = require("./ui/icons/AIChatIcon");
|
|
319
332
|
var _AIProfessionalIcon = require("./ui/icons/AIProfessionalIcon");
|
|
@@ -352,4 +365,5 @@ var _UnderlineIcon = require("./ui/icons/UnderlineIcon");
|
|
|
352
365
|
var _StrikeThroughIcon = require("./ui/icons/StrikeThroughIcon");
|
|
353
366
|
var _CodeIcon = require("./ui/icons/CodeIcon");
|
|
354
367
|
var _SubscriptIcon = require("./ui/icons/SubscriptIcon");
|
|
355
|
-
var _SuperscriptIcon = require("./ui/icons/SuperscriptIcon");
|
|
368
|
+
var _SuperscriptIcon = require("./ui/icons/SuperscriptIcon");
|
|
369
|
+
var _ShowMoreHorizontal = require("./ui/icons/ShowMoreHorizontal");
|
|
@@ -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,
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
._11c8140y{font:var(--ds-font-heading-xsmall,normal 600 14px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
._11c81c04{font:var(--ds-font-heading-xlarge,normal 600 29px/2pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
|
-
._11c81vhk{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
4
|
-
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
5
|
-
._11c8lodh{font:var(--ds-font-heading-medium,normal 500 20px/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
6
|
-
._11c8nbxd{font:var(--ds-font-heading-small,normal 600 1pc/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
7
|
-
._11c8nf1z{font:var(--ds-font-heading-large,normal 500 24px/28px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
8
1
|
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
9
2
|
._1bsb1osq{width:100%}
|
|
10
3
|
._1tke14no{min-height:36px}
|
|
@@ -17,14 +17,7 @@ var styles = {
|
|
|
17
17
|
toolbarDropdownItem: "_kqswh2mm _bfhksm61 _1bsb1osq _1tke14no _19bvutpp _u5f3utpp _1basglpi _1ah31i6y",
|
|
18
18
|
enabled: "_irr3166n _1di61dty",
|
|
19
19
|
disabled: "_syaz1lh4 _80om13gf",
|
|
20
|
-
selected: "_bfhkfg4m _syazaqb7 _irr3i1yw _1di619ru"
|
|
21
|
-
normal: "_11c82smr",
|
|
22
|
-
heading1: "_11c81c04",
|
|
23
|
-
heading2: "_11c8nf1z",
|
|
24
|
-
heading3: "_11c8lodh",
|
|
25
|
-
heading4: "_11c8nbxd",
|
|
26
|
-
heading5: "_11c8140y",
|
|
27
|
-
heading6: "_11c81vhk"
|
|
20
|
+
selected: "_bfhkfg4m _syazaqb7 _irr3i1yw _1di619ru"
|
|
28
21
|
};
|
|
29
22
|
var CustomDropdownMenuItemButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
30
23
|
var children = _ref.children,
|
|
@@ -54,8 +47,6 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
|
|
|
54
47
|
elemAfter = _ref2.elemAfter,
|
|
55
48
|
isSelected = _ref2.isSelected,
|
|
56
49
|
children = _ref2.children,
|
|
57
|
-
_ref2$textStyle = _ref2.textStyle,
|
|
58
|
-
textStyle = _ref2$textStyle === void 0 ? 'normal' : _ref2$textStyle,
|
|
59
50
|
isDisabled = _ref2.isDisabled,
|
|
60
51
|
hasNestedDropdownMenu = _ref2.hasNestedDropdownMenu,
|
|
61
52
|
triggerRef = _ref2.triggerRef,
|
|
@@ -73,7 +64,5 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
|
|
|
73
64
|
ref: triggerRef,
|
|
74
65
|
component: CustomDropdownMenuItemButton,
|
|
75
66
|
testId: testId
|
|
76
|
-
},
|
|
77
|
-
xcss: styles[textStyle]
|
|
78
|
-
}, children));
|
|
67
|
+
}, children);
|
|
79
68
|
};
|
|
@@ -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
|
@@ -10,6 +10,7 @@ export { ToolbarSection } from './ui/ToolbarSection';
|
|
|
10
10
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
11
11
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
12
12
|
export { ToolbarDropdownDivider } from './ui/ToolbarDropdownDivider';
|
|
13
|
+
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
13
14
|
export { AIAdjustLengthIcon } from './ui/icons/AIAdjustLengthIcon';
|
|
14
15
|
export { AIChatIcon } from './ui/icons/AIChatIcon';
|
|
15
16
|
export { AIBriefcaseIcon } from './ui/icons/AIProfessionalIcon';
|
|
@@ -48,4 +49,5 @@ export { UnderlineIcon } from './ui/icons/UnderlineIcon';
|
|
|
48
49
|
export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
49
50
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
50
51
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
51
|
-
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
52
|
+
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
53
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
@@ -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,
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
._11c8140y{font:var(--ds-font-heading-xsmall,normal 600 14px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
._11c81c04{font:var(--ds-font-heading-xlarge,normal 600 29px/2pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
|
-
._11c81vhk{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
4
|
-
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
5
|
-
._11c8lodh{font:var(--ds-font-heading-medium,normal 500 20px/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
6
|
-
._11c8nbxd{font:var(--ds-font-heading-small,normal 600 1pc/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
7
|
-
._11c8nf1z{font:var(--ds-font-heading-large,normal 500 24px/28px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
8
1
|
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
9
2
|
._1bsb1osq{width:100%}
|
|
10
3
|
._1tke14no{min-height:36px}
|
|
@@ -4,19 +4,12 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import { cx } from '@atlaskit/css';
|
|
6
6
|
import { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
7
|
-
import {
|
|
7
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
8
8
|
const styles = {
|
|
9
9
|
toolbarDropdownItem: "_kqswh2mm _bfhksm61 _1bsb1osq _1tke14no _19bvutpp _u5f3utpp _1basglpi _1ah31i6y",
|
|
10
10
|
enabled: "_irr3166n _1di61dty",
|
|
11
11
|
disabled: "_syaz1lh4 _80om13gf",
|
|
12
|
-
selected: "_bfhkfg4m _syazaqb7 _irr3i1yw _1di619ru"
|
|
13
|
-
normal: "_11c82smr",
|
|
14
|
-
heading1: "_11c81c04",
|
|
15
|
-
heading2: "_11c8nf1z",
|
|
16
|
-
heading3: "_11c8lodh",
|
|
17
|
-
heading4: "_11c8nbxd",
|
|
18
|
-
heading5: "_11c8140y",
|
|
19
|
-
heading6: "_11c81vhk"
|
|
12
|
+
selected: "_bfhkfg4m _syazaqb7 _irr3i1yw _1di619ru"
|
|
20
13
|
};
|
|
21
14
|
const CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(({
|
|
22
15
|
children,
|
|
@@ -45,7 +38,6 @@ export const ToolbarDropdownItem = ({
|
|
|
45
38
|
elemAfter,
|
|
46
39
|
isSelected,
|
|
47
40
|
children,
|
|
48
|
-
textStyle = 'normal',
|
|
49
41
|
isDisabled,
|
|
50
42
|
hasNestedDropdownMenu,
|
|
51
43
|
triggerRef,
|
|
@@ -63,6 +55,4 @@ export const ToolbarDropdownItem = ({
|
|
|
63
55
|
ref: triggerRef,
|
|
64
56
|
component: CustomDropdownMenuItemButton,
|
|
65
57
|
testId: testId
|
|
66
|
-
},
|
|
67
|
-
xcss: styles[textStyle]
|
|
68
|
-
}, children));
|
|
58
|
+
}, children);
|
|
@@ -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
|
@@ -10,6 +10,7 @@ export { ToolbarSection } from './ui/ToolbarSection';
|
|
|
10
10
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
11
11
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
12
12
|
export { ToolbarDropdownDivider } from './ui/ToolbarDropdownDivider';
|
|
13
|
+
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
13
14
|
export { AIAdjustLengthIcon } from './ui/icons/AIAdjustLengthIcon';
|
|
14
15
|
export { AIChatIcon } from './ui/icons/AIChatIcon';
|
|
15
16
|
export { AIBriefcaseIcon } from './ui/icons/AIProfessionalIcon';
|
|
@@ -48,4 +49,5 @@ export { UnderlineIcon } from './ui/icons/UnderlineIcon';
|
|
|
48
49
|
export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
49
50
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
50
51
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
51
|
-
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
52
|
+
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
53
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
@@ -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,
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
._11c8140y{font:var(--ds-font-heading-xsmall,normal 600 14px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
._11c81c04{font:var(--ds-font-heading-xlarge,normal 600 29px/2pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
|
-
._11c81vhk{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
4
|
-
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
5
|
-
._11c8lodh{font:var(--ds-font-heading-medium,normal 500 20px/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
6
|
-
._11c8nbxd{font:var(--ds-font-heading-small,normal 600 1pc/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
7
|
-
._11c8nf1z{font:var(--ds-font-heading-large,normal 500 24px/28px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
8
1
|
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
9
2
|
._1bsb1osq{width:100%}
|
|
10
3
|
._1tke14no{min-height:36px}
|
|
@@ -4,19 +4,12 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import { cx } from '@atlaskit/css';
|
|
6
6
|
import { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
7
|
-
import {
|
|
7
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
8
8
|
var styles = {
|
|
9
9
|
toolbarDropdownItem: "_kqswh2mm _bfhksm61 _1bsb1osq _1tke14no _19bvutpp _u5f3utpp _1basglpi _1ah31i6y",
|
|
10
10
|
enabled: "_irr3166n _1di61dty",
|
|
11
11
|
disabled: "_syaz1lh4 _80om13gf",
|
|
12
|
-
selected: "_bfhkfg4m _syazaqb7 _irr3i1yw _1di619ru"
|
|
13
|
-
normal: "_11c82smr",
|
|
14
|
-
heading1: "_11c81c04",
|
|
15
|
-
heading2: "_11c8nf1z",
|
|
16
|
-
heading3: "_11c8lodh",
|
|
17
|
-
heading4: "_11c8nbxd",
|
|
18
|
-
heading5: "_11c8140y",
|
|
19
|
-
heading6: "_11c81vhk"
|
|
12
|
+
selected: "_bfhkfg4m _syazaqb7 _irr3i1yw _1di619ru"
|
|
20
13
|
};
|
|
21
14
|
var CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
22
15
|
var children = _ref.children,
|
|
@@ -46,8 +39,6 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
|
|
|
46
39
|
elemAfter = _ref2.elemAfter,
|
|
47
40
|
isSelected = _ref2.isSelected,
|
|
48
41
|
children = _ref2.children,
|
|
49
|
-
_ref2$textStyle = _ref2.textStyle,
|
|
50
|
-
textStyle = _ref2$textStyle === void 0 ? 'normal' : _ref2$textStyle,
|
|
51
42
|
isDisabled = _ref2.isDisabled,
|
|
52
43
|
hasNestedDropdownMenu = _ref2.hasNestedDropdownMenu,
|
|
53
44
|
triggerRef = _ref2.triggerRef,
|
|
@@ -65,7 +56,5 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
|
|
|
65
56
|
ref: triggerRef,
|
|
66
57
|
component: CustomDropdownMenuItemButton,
|
|
67
58
|
testId: testId
|
|
68
|
-
},
|
|
69
|
-
xcss: styles[textStyle]
|
|
70
|
-
}, children));
|
|
59
|
+
}, children);
|
|
71
60
|
};
|
|
@@ -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
|
@@ -9,6 +9,7 @@ export { ToolbarSection } from './ui/ToolbarSection';
|
|
|
9
9
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
10
10
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
11
11
|
export { ToolbarDropdownDivider } from './ui/ToolbarDropdownDivider';
|
|
12
|
+
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
12
13
|
export { AIAdjustLengthIcon } from './ui/icons/AIAdjustLengthIcon';
|
|
13
14
|
export { AIChatIcon } from './ui/icons/AIChatIcon';
|
|
14
15
|
export { AIBriefcaseIcon } from './ui/icons/AIProfessionalIcon';
|
|
@@ -48,4 +49,5 @@ export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
|
48
49
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
49
50
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
50
51
|
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
52
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
51
53
|
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 {};
|
|
@@ -20,5 +20,5 @@ type ToolbarDropdownItemProps = {
|
|
|
20
20
|
testId?: string;
|
|
21
21
|
ariaKeyshortcuts?: string;
|
|
22
22
|
};
|
|
23
|
-
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children,
|
|
23
|
+
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, testId, ariaKeyshortcuts, }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
24
24
|
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 {};
|
|
@@ -9,6 +9,7 @@ export { ToolbarSection } from './ui/ToolbarSection';
|
|
|
9
9
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
10
10
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
11
11
|
export { ToolbarDropdownDivider } from './ui/ToolbarDropdownDivider';
|
|
12
|
+
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
12
13
|
export { AIAdjustLengthIcon } from './ui/icons/AIAdjustLengthIcon';
|
|
13
14
|
export { AIChatIcon } from './ui/icons/AIChatIcon';
|
|
14
15
|
export { AIBriefcaseIcon } from './ui/icons/AIProfessionalIcon';
|
|
@@ -48,4 +49,5 @@ export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
|
48
49
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
49
50
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
50
51
|
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
52
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
51
53
|
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 {};
|
|
@@ -20,5 +20,5 @@ type ToolbarDropdownItemProps = {
|
|
|
20
20
|
testId?: string;
|
|
21
21
|
ariaKeyshortcuts?: string;
|
|
22
22
|
};
|
|
23
|
-
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children,
|
|
23
|
+
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, testId, ariaKeyshortcuts, }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
24
24
|
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 {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import { cssMap } from '@atlaskit/css';
|
|
3
4
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
4
5
|
import Toggle from '@atlaskit/toggle';
|
|
5
6
|
import { token } from '@atlaskit/tokens';
|
|
@@ -52,6 +53,27 @@ import { ToolbarTooltip } from '../../../src/ui/ToolbarTooltip';
|
|
|
52
53
|
|
|
53
54
|
import { useExampleToolbarState } from './useExampleToolbarState';
|
|
54
55
|
|
|
56
|
+
const headingSizeStylesMap = cssMap({
|
|
57
|
+
xlarge: {
|
|
58
|
+
font: token('font.heading.xlarge'),
|
|
59
|
+
},
|
|
60
|
+
large: {
|
|
61
|
+
font: token('font.heading.large')
|
|
62
|
+
},
|
|
63
|
+
medium: {
|
|
64
|
+
font: token('font.heading.medium')
|
|
65
|
+
},
|
|
66
|
+
small: {
|
|
67
|
+
font: token('font.heading.small')
|
|
68
|
+
},
|
|
69
|
+
xsmall: {
|
|
70
|
+
font: token('font.heading.xsmall')
|
|
71
|
+
},
|
|
72
|
+
xxsmall: {
|
|
73
|
+
font: token('font.heading.xxsmall')
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
55
77
|
export const ExampleManuallyComposedToolbar = () => {
|
|
56
78
|
const {
|
|
57
79
|
textStyle,
|
|
@@ -271,7 +293,6 @@ export const ExampleManuallyComposedToolbar = () => {
|
|
|
271
293
|
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥0" />}
|
|
272
294
|
onClick={onClick('Normal text', onSetTextStyle('normal'))}
|
|
273
295
|
isSelected={textStyle === 'normal'}
|
|
274
|
-
textStyle="normal"
|
|
275
296
|
ariaKeyshortcuts="⌘⌥0"
|
|
276
297
|
>
|
|
277
298
|
Normal text
|
|
@@ -281,20 +302,18 @@ export const ExampleManuallyComposedToolbar = () => {
|
|
|
281
302
|
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥1" />}
|
|
282
303
|
onClick={onClick('Heading one', onSetTextStyle('heading1'))}
|
|
283
304
|
isSelected={textStyle === 'heading1'}
|
|
284
|
-
textStyle="heading1"
|
|
285
305
|
ariaKeyshortcuts="⌘⌥1"
|
|
286
306
|
>
|
|
287
|
-
Heading 1
|
|
307
|
+
<Box xcss={headingSizeStylesMap.xlarge}>Heading 1</Box>
|
|
288
308
|
</ToolbarDropdownItem>
|
|
289
309
|
<ToolbarDropdownItem
|
|
290
310
|
elemBefore={<HeadingTwoIcon label="Heading Two" />}
|
|
291
311
|
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥2" />}
|
|
292
312
|
onClick={onClick('Heading two', onSetTextStyle('heading2'))}
|
|
293
313
|
isSelected={textStyle === 'heading2'}
|
|
294
|
-
textStyle="heading2"
|
|
295
314
|
ariaKeyshortcuts="⌘⌥2"
|
|
296
315
|
>
|
|
297
|
-
Heading 2
|
|
316
|
+
<Box xcss={headingSizeStylesMap.large}>Heading 2</Box>
|
|
298
317
|
</ToolbarDropdownItem>
|
|
299
318
|
<ToolbarDropdownItem
|
|
300
319
|
elemBefore={<HeadingThreeIcon label="Heading Three" />}
|
|
@@ -304,44 +323,40 @@ export const ExampleManuallyComposedToolbar = () => {
|
|
|
304
323
|
textStyle="heading3"
|
|
305
324
|
ariaKeyshortcuts="⌘⌥3"
|
|
306
325
|
>
|
|
307
|
-
Heading 3
|
|
326
|
+
<Box xcss={headingSizeStylesMap.medium}>Heading 3</Box>
|
|
308
327
|
</ToolbarDropdownItem>
|
|
309
328
|
<ToolbarDropdownItem
|
|
310
329
|
elemBefore={<HeadingFourIcon label="Heading Four" />}
|
|
311
330
|
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥4" />}
|
|
312
331
|
onClick={onClick('Heading four', onSetTextStyle('heading4'))}
|
|
313
332
|
isSelected={textStyle === 'heading4'}
|
|
314
|
-
textStyle="heading4"
|
|
315
333
|
ariaKeyshortcuts="⌘⌥4"
|
|
316
334
|
>
|
|
317
|
-
Heading 4
|
|
335
|
+
<Box xcss={headingSizeStylesMap.small}>Heading 4</Box>
|
|
318
336
|
</ToolbarDropdownItem>
|
|
319
337
|
<ToolbarDropdownItem
|
|
320
338
|
elemBefore={<HeadingFiveIcon label="Heading Five" />}
|
|
321
339
|
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥5" />}
|
|
322
340
|
onClick={onClick('Heading five', onSetTextStyle('heading5'))}
|
|
323
341
|
isSelected={textStyle === 'heading5'}
|
|
324
|
-
textStyle="heading5"
|
|
325
342
|
ariaKeyshortcuts="⌘⌥5"
|
|
326
343
|
>
|
|
327
|
-
Heading 5
|
|
344
|
+
<Box xcss={headingSizeStylesMap.xsmall}>Heading 5</Box>
|
|
328
345
|
</ToolbarDropdownItem>
|
|
329
346
|
<ToolbarDropdownItem
|
|
330
347
|
elemBefore={<HeadingSixIcon label="Heading Six" />}
|
|
331
348
|
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥6" />}
|
|
332
349
|
onClick={onClick('Heading six', onSetTextStyle('heading6'))}
|
|
333
350
|
isSelected={textStyle === 'heading6'}
|
|
334
|
-
textStyle="heading6"
|
|
335
351
|
ariaKeyshortcuts="⌘⌥6"
|
|
336
352
|
>
|
|
337
|
-
Heading 6
|
|
353
|
+
<Box xcss={headingSizeStylesMap.xxsmall}>Heading 6</Box>
|
|
338
354
|
</ToolbarDropdownItem>
|
|
339
355
|
<ToolbarDropdownItem
|
|
340
356
|
elemBefore={<QuoteIcon label="Quote" />}
|
|
341
357
|
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥9" />}
|
|
342
358
|
onClick={onClick('Quote', onSetTextStyle('quote'))}
|
|
343
359
|
isSelected={textStyle === 'quote'}
|
|
344
|
-
textStyle="normal"
|
|
345
360
|
ariaKeyshortcuts="⌘⌥9"
|
|
346
361
|
>
|
|
347
362
|
Quote
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.1.1",
|
|
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
|
@@ -10,6 +10,7 @@ export { ToolbarSection } from './ui/ToolbarSection';
|
|
|
10
10
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
11
11
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
12
12
|
export { ToolbarDropdownDivider } from './ui/ToolbarDropdownDivider';
|
|
13
|
+
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
13
14
|
|
|
14
15
|
export { AIAdjustLengthIcon } from './ui/icons/AIAdjustLengthIcon';
|
|
15
16
|
export { AIChatIcon } from './ui/icons/AIChatIcon';
|
|
@@ -50,5 +51,6 @@ export { StrikeThroughIcon } from './ui/icons/StrikeThroughIcon';
|
|
|
50
51
|
export { CodeIcon } from './ui/icons/CodeIcon';
|
|
51
52
|
export { SubscriptIcon } from './ui/icons/SubscriptIcon';
|
|
52
53
|
export { SuperscriptIcon } from './ui/icons/SuperscriptIcon';
|
|
54
|
+
export { ShowMoreHorizontalIcon } from './ui/icons/ShowMoreHorizontal';
|
|
53
55
|
|
|
54
56
|
export type { IconComponent, ToolbarButtonGroupLocation } from './types';
|
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}
|
|
@@ -3,7 +3,7 @@ import React, { type ReactNode, forwardRef, type Ref } from 'react';
|
|
|
3
3
|
import { cssMap, cx } from '@atlaskit/css';
|
|
4
4
|
import { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
5
5
|
import type { CustomItemComponentProps } from '@atlaskit/menu/types';
|
|
6
|
-
import {
|
|
6
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
7
7
|
import { token } from '@atlaskit/tokens';
|
|
8
8
|
|
|
9
9
|
type TextStyle =
|
|
@@ -50,27 +50,6 @@ const styles = cssMap({
|
|
|
50
50
|
backgroundColor: token('color.background.selected.pressed'),
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
|
-
normal: {
|
|
54
|
-
font: token('font.body'),
|
|
55
|
-
},
|
|
56
|
-
heading1: {
|
|
57
|
-
font: token('font.heading.xlarge'),
|
|
58
|
-
},
|
|
59
|
-
heading2: {
|
|
60
|
-
font: token('font.heading.large'),
|
|
61
|
-
},
|
|
62
|
-
heading3: {
|
|
63
|
-
font: token('font.heading.medium'),
|
|
64
|
-
},
|
|
65
|
-
heading4: {
|
|
66
|
-
font: token('font.heading.small'),
|
|
67
|
-
},
|
|
68
|
-
heading5: {
|
|
69
|
-
font: token('font.heading.xsmall'),
|
|
70
|
-
},
|
|
71
|
-
heading6: {
|
|
72
|
-
font: token('font.heading.xxsmall'),
|
|
73
|
-
},
|
|
74
53
|
});
|
|
75
54
|
|
|
76
55
|
export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
|
|
@@ -137,7 +116,6 @@ export const ToolbarDropdownItem = ({
|
|
|
137
116
|
elemAfter,
|
|
138
117
|
isSelected,
|
|
139
118
|
children,
|
|
140
|
-
textStyle = 'normal',
|
|
141
119
|
isDisabled,
|
|
142
120
|
hasNestedDropdownMenu,
|
|
143
121
|
triggerRef,
|
|
@@ -157,6 +135,6 @@ export const ToolbarDropdownItem = ({
|
|
|
157
135
|
component={CustomDropdownMenuItemButton}
|
|
158
136
|
testId={testId}
|
|
159
137
|
>
|
|
160
|
-
|
|
138
|
+
{children}
|
|
161
139
|
</DropdownItem>
|
|
162
140
|
);
|
|
@@ -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
|
+
);
|