@atlaskit/editor-toolbar 0.0.10 → 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 CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 0.0.10
4
12
 
5
13
  ### 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");
@@ -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
+ };
@@ -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';
@@ -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';
@@ -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
+ };
@@ -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 {};
@@ -0,0 +1,2 @@
1
+ import { type IconComponent } from '../../types';
2
+ export declare const ShowMoreHorizontalIcon: IconComponent;
@@ -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 {};
@@ -0,0 +1,2 @@
1
+ import { type IconComponent } from '../../types';
2
+ export declare const ShowMoreHorizontalIcon: IconComponent;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org/"
5
5
  },
6
- "version": "0.0.10",
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.9.0",
32
- "@atlaskit/icon-lab": "^5.3.0",
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';
@@ -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
+ );