@atlaskit/editor-toolbar 0.1.0 → 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 +11 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/ui/ToolbarDropdownItem.compiled.css +0 -7
- package/dist/cjs/ui/ToolbarDropdownItem.js +2 -13
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/ui/ToolbarDropdownItem.compiled.css +0 -7
- package/dist/es2019/ui/ToolbarDropdownItem.js +3 -13
- package/dist/esm/index.js +1 -0
- package/dist/esm/ui/ToolbarDropdownItem.compiled.css +0 -7
- package/dist/esm/ui/ToolbarDropdownItem.js +3 -14
- package/dist/types/index.d.ts +1 -0
- package/dist/types/ui/ToolbarDropdownItem.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarDropdownItem.d.ts +1 -1
- package/examples/toolbar/examples/ExampleManuallyComposedToolbar.tsx +28 -13
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/ui/ToolbarDropdownItem.tsx +2 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
|
|
3
14
|
## 0.1.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -255,6 +255,12 @@ Object.defineProperty(exports, "ToolbarButtonGroup", {
|
|
|
255
255
|
return _ToolbarButtonGroup.ToolbarButtonGroup;
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
|
+
Object.defineProperty(exports, "ToolbarColorSwatch", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function get() {
|
|
261
|
+
return _ToolbarColorSwatch.ToolbarColorSwatch;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
258
264
|
Object.defineProperty(exports, "ToolbarDropdownDivider", {
|
|
259
265
|
enumerable: true,
|
|
260
266
|
get: function get() {
|
|
@@ -320,6 +326,7 @@ var _ToolbarSection = require("./ui/ToolbarSection");
|
|
|
320
326
|
var _ToolbarTooltip = require("./ui/ToolbarTooltip");
|
|
321
327
|
var _ToolbarNestedDropdownMenu = require("./ui/ToolbarNestedDropdownMenu");
|
|
322
328
|
var _ToolbarDropdownDivider = require("./ui/ToolbarDropdownDivider");
|
|
329
|
+
var _ToolbarColorSwatch = require("./ui/ToolbarColorSwatch");
|
|
323
330
|
var _AIAdjustLengthIcon = require("./ui/icons/AIAdjustLengthIcon");
|
|
324
331
|
var _AIChatIcon = require("./ui/icons/AIChatIcon");
|
|
325
332
|
var _AIProfessionalIcon = require("./ui/icons/AIProfessionalIcon");
|
|
@@ -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
|
};
|
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';
|
|
@@ -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);
|
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';
|
|
@@ -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
|
};
|
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';
|
|
@@ -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 {};
|
|
@@ -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';
|
|
@@ -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 {};
|
|
@@ -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
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';
|
|
@@ -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
|
);
|