@atlaskit/editor-toolbar 2.1.0 → 2.1.2

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,22 @@
1
1
  # @atlaskit/editor-toolbar
2
2
 
3
+ ## 2.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7ebb725ea5629`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7ebb725ea5629) -
8
+ Remove pressed semantics from toolbar popup triggers, gated behind jira_editor_a11y_toolbar_fixes
9
+ - Updated dependencies
10
+
11
+ ## 2.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`cc7e55c918e23`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc7e55c918e23) -
16
+ [ux] Adds info icon next to visually disabled table column sort buttons with a tooltip explaining
17
+ that sort won't work when merged cells present.
18
+ - Updated dependencies
19
+
3
20
  ## 2.1.0
4
21
 
5
22
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -232,6 +232,12 @@ Object.defineProperty(exports, "IndentIcon", {
232
232
  return _IndentIcon.IndentIcon;
233
233
  }
234
234
  });
235
+ Object.defineProperty(exports, "InformationCircleIcon", {
236
+ enumerable: true,
237
+ get: function get() {
238
+ return _InformationCircleIcon.InformationCircleIcon;
239
+ }
240
+ });
235
241
  Object.defineProperty(exports, "ItalicIcon", {
236
242
  enumerable: true,
237
243
  get: function get() {
@@ -650,6 +656,7 @@ var _HeadingOneIcon = require("./ui/icons/HeadingOneIcon");
650
656
  var _HeadingSixIcon = require("./ui/icons/HeadingSixIcon");
651
657
  var _HeadingThreeIcon = require("./ui/icons/HeadingThreeIcon");
652
658
  var _HeadingTwoIcon = require("./ui/icons/HeadingTwoIcon");
659
+ var _InformationCircleIcon = require("./ui/icons/InformationCircleIcon");
653
660
  var _ItalicIcon = require("./ui/icons/ItalicIcon");
654
661
  var _LinkIcon = require("./ui/icons/LinkIcon");
655
662
  var _ListBulletedIcon = require("./ui/icons/ListBulletedIcon");
@@ -11,6 +11,7 @@ var _runtime = require("@compiled/react/runtime");
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var _css = require("@atlaskit/css");
13
13
  var _compiled = require("@atlaskit/primitives/compiled");
14
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
15
  var _uiContext = require("../hooks/ui-context");
15
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
16
17
  var styles = {
@@ -46,7 +47,8 @@ var ToolbarButton = exports.ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(
46
47
  return /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
47
48
  ref: ref,
48
49
  xcss: (0, _css.cx)(styles.button, disabled ? styles.disabled : isSelected ? styles.selected : styles.enabled),
49
- "aria-pressed": isSelected,
50
+ "aria-pressed": (0, _expValEquals.expValEquals)('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? Boolean(ariaHasPopup) ? undefined // No aria-pressed for dropdown buttons
51
+ : isSelected : isSelected,
50
52
  "aria-expanded": ariaExpanded,
51
53
  "aria-haspopup": ariaHasPopup,
52
54
  "aria-controls": ariaControls,
@@ -67,6 +69,7 @@ var ToolbarButton = exports.ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(
67
69
  }
68
70
  },
69
71
  "data-toolbar-component": "button",
72
+ "data-selected": (0, _expValEquals.expValEquals)('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? isSelected : undefined,
70
73
  interactionName: interactionName
71
74
  }, iconBefore, children);
72
75
  });
@@ -3,6 +3,7 @@
3
3
  ._19pe12x7 [data-toolbar-component=button]{padding-inline:var(--ds-space-075,6px)}._14jy1dpa:has([data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):hover) [data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
4
4
  ._15rdidpf [data-toolbar-component=button]{border-top-left-radius:0}
5
5
  ._1e0c1txw{display:flex}
6
+ ._1gt41dpa:has([data-toolbar-component=button]:not([data-selected=true]):not([disabled]):hover) [data-toolbar-component=button]:not([data-selected=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
6
7
  ._1qq0idpf [data-toolbar-component=button]{border-top-right-radius:0}
7
8
  ._3nesidpf [data-toolbar-component=button]{border-bottom-right-radius:0}
8
9
  ._i84vidpf [data-toolbar-component=button]{border-bottom-left-radius:0}
@@ -12,9 +12,11 @@ var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
14
  var _compiled = require("@atlaskit/primitives/compiled");
15
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
16
17
  var styles = {
17
18
  container: "_zulpv77o _1e0c1txw _14jy1dpa",
19
+ containerWithA11yToolbarFixes: "_zulpv77o _1e0c1txw _1gt41dpa",
18
20
  firstChild: "_19pe12x7 _1qq0idpf _3nesidpf",
19
21
  lastChild: "_19pe12x7 _15rdidpf _i84vidpf"
20
22
  };
@@ -27,7 +29,7 @@ var ToolbarButtonGroup = exports.ToolbarButtonGroup = function ToolbarButtonGrou
27
29
  var LastChild = (0, _platformFeatureFlags.fg)('platform_editor_fix_t_at_is_not_a_function') ? items[items.length - 1] : items.at(-1);
28
30
  var middleChildren = items.slice(1, -1);
29
31
  return /*#__PURE__*/React.createElement(_compiled.Box, {
30
- xcss: styles.container,
32
+ xcss: (0, _expValEquals.expValEquals)('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? styles.containerWithA11yToolbarFixes : styles.container,
31
33
  "data-toolbar-component": "button-group"
32
34
  }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("div", {
33
35
  className: (0, _runtime.ax)([styles.firstChild])
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "InformationCircleIcon", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _informationCircle.default;
11
+ }
12
+ });
13
+ var _informationCircle = _interopRequireDefault(require("@atlaskit/icon/core/information-circle"));
@@ -39,6 +39,7 @@ export { HeadingOneIcon } from './ui/icons/HeadingOneIcon';
39
39
  export { HeadingSixIcon } from './ui/icons/HeadingSixIcon';
40
40
  export { HeadingThreeIcon } from './ui/icons/HeadingThreeIcon';
41
41
  export { HeadingTwoIcon } from './ui/icons/HeadingTwoIcon';
42
+ export { InformationCircleIcon } from './ui/icons/InformationCircleIcon';
42
43
  export { ItalicIcon } from './ui/icons/ItalicIcon';
43
44
  export { LinkIcon } from './ui/icons/LinkIcon';
44
45
  export { ListBulletedIcon } from './ui/icons/ListBulletedIcon';
@@ -4,6 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { forwardRef } from 'react';
5
5
  import { cx } from '@atlaskit/css';
6
6
  import { Pressable } from '@atlaskit/primitives/compiled';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  import { useToolbarUI } from '../hooks/ui-context';
8
9
  const styles = {
9
10
  button: "_zulp12x7 _2rko12b0 _11c8fhey _1e0c1txw _bfhksm61 _o5721q9c _4cvr1h6o _1bah1h6o _1tke1f4h _syazazsu _19bvu2gc _u5f3u2gc _1ah3idpf _g0pbkb7n _oh03h2mm",
@@ -40,7 +41,8 @@ export const ToolbarButton = /*#__PURE__*/forwardRef(({
40
41
  return /*#__PURE__*/React.createElement(Pressable, {
41
42
  ref: ref,
42
43
  xcss: cx(styles.button, disabled ? styles.disabled : isSelected ? styles.selected : styles.enabled),
43
- "aria-pressed": isSelected,
44
+ "aria-pressed": expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? Boolean(ariaHasPopup) ? undefined // No aria-pressed for dropdown buttons
45
+ : isSelected : isSelected,
44
46
  "aria-expanded": ariaExpanded,
45
47
  "aria-haspopup": ariaHasPopup,
46
48
  "aria-controls": ariaControls,
@@ -61,6 +63,7 @@ export const ToolbarButton = /*#__PURE__*/forwardRef(({
61
63
  }
62
64
  },
63
65
  "data-toolbar-component": "button",
66
+ "data-selected": expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? isSelected : undefined,
64
67
  interactionName: interactionName
65
68
  }, iconBefore, children);
66
69
  });
@@ -3,6 +3,7 @@
3
3
  ._19pe12x7 [data-toolbar-component=button]{padding-inline:var(--ds-space-075,6px)}._14jy1dpa:has([data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):hover) [data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
4
4
  ._15rdidpf [data-toolbar-component=button]{border-top-left-radius:0}
5
5
  ._1e0c1txw{display:flex}
6
+ ._1gt41dpa:has([data-toolbar-component=button]:not([data-selected=true]):not([disabled]):hover) [data-toolbar-component=button]:not([data-selected=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
6
7
  ._1qq0idpf [data-toolbar-component=button]{border-top-right-radius:0}
7
8
  ._3nesidpf [data-toolbar-component=button]{border-bottom-right-radius:0}
8
9
  ._i84vidpf [data-toolbar-component=button]{border-bottom-left-radius:0}
@@ -5,8 +5,10 @@ import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Children, Fragment } from 'react';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import { Box } from '@atlaskit/primitives/compiled';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  const styles = {
9
10
  container: "_zulpv77o _1e0c1txw _14jy1dpa",
11
+ containerWithA11yToolbarFixes: "_zulpv77o _1e0c1txw _1gt41dpa",
10
12
  firstChild: "_19pe12x7 _1qq0idpf _3nesidpf",
11
13
  lastChild: "_19pe12x7 _15rdidpf _i84vidpf"
12
14
  };
@@ -20,7 +22,7 @@ export const ToolbarButtonGroup = ({
20
22
  const LastChild = fg('platform_editor_fix_t_at_is_not_a_function') ? items[items.length - 1] : items.at(-1);
21
23
  const middleChildren = items.slice(1, -1);
22
24
  return /*#__PURE__*/React.createElement(Box, {
23
- xcss: styles.container,
25
+ xcss: expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? styles.containerWithA11yToolbarFixes : styles.container,
24
26
  "data-toolbar-component": "button-group"
25
27
  }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
26
28
  className: ax([styles.firstChild])
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { default as InformationCircleIcon } from '@atlaskit/icon/core/information-circle';
package/dist/esm/index.js CHANGED
@@ -39,6 +39,7 @@ export { HeadingOneIcon } from './ui/icons/HeadingOneIcon';
39
39
  export { HeadingSixIcon } from './ui/icons/HeadingSixIcon';
40
40
  export { HeadingThreeIcon } from './ui/icons/HeadingThreeIcon';
41
41
  export { HeadingTwoIcon } from './ui/icons/HeadingTwoIcon';
42
+ export { InformationCircleIcon } from './ui/icons/InformationCircleIcon';
42
43
  export { ItalicIcon } from './ui/icons/ItalicIcon';
43
44
  export { LinkIcon } from './ui/icons/LinkIcon';
44
45
  export { ListBulletedIcon } from './ui/icons/ListBulletedIcon';
@@ -4,6 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { forwardRef } from 'react';
5
5
  import { cx } from '@atlaskit/css';
6
6
  import { Pressable } from '@atlaskit/primitives/compiled';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  import { useToolbarUI } from '../hooks/ui-context';
8
9
  var styles = {
9
10
  button: "_zulp12x7 _2rko12b0 _11c8fhey _1e0c1txw _bfhksm61 _o5721q9c _4cvr1h6o _1bah1h6o _1tke1f4h _syazazsu _19bvu2gc _u5f3u2gc _1ah3idpf _g0pbkb7n _oh03h2mm",
@@ -38,7 +39,8 @@ export var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
38
39
  return /*#__PURE__*/React.createElement(Pressable, {
39
40
  ref: ref,
40
41
  xcss: cx(styles.button, disabled ? styles.disabled : isSelected ? styles.selected : styles.enabled),
41
- "aria-pressed": isSelected,
42
+ "aria-pressed": expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? Boolean(ariaHasPopup) ? undefined // No aria-pressed for dropdown buttons
43
+ : isSelected : isSelected,
42
44
  "aria-expanded": ariaExpanded,
43
45
  "aria-haspopup": ariaHasPopup,
44
46
  "aria-controls": ariaControls,
@@ -59,6 +61,7 @@ export var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
59
61
  }
60
62
  },
61
63
  "data-toolbar-component": "button",
64
+ "data-selected": expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? isSelected : undefined,
62
65
  interactionName: interactionName
63
66
  }, iconBefore, children);
64
67
  });
@@ -3,6 +3,7 @@
3
3
  ._19pe12x7 [data-toolbar-component=button]{padding-inline:var(--ds-space-075,6px)}._14jy1dpa:has([data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):hover) [data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
4
4
  ._15rdidpf [data-toolbar-component=button]{border-top-left-radius:0}
5
5
  ._1e0c1txw{display:flex}
6
+ ._1gt41dpa:has([data-toolbar-component=button]:not([data-selected=true]):not([disabled]):hover) [data-toolbar-component=button]:not([data-selected=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
6
7
  ._1qq0idpf [data-toolbar-component=button]{border-top-right-radius:0}
7
8
  ._3nesidpf [data-toolbar-component=button]{border-bottom-right-radius:0}
8
9
  ._i84vidpf [data-toolbar-component=button]{border-bottom-left-radius:0}
@@ -5,8 +5,10 @@ import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Children, Fragment } from 'react';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import { Box } from '@atlaskit/primitives/compiled';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  var styles = {
9
10
  container: "_zulpv77o _1e0c1txw _14jy1dpa",
11
+ containerWithA11yToolbarFixes: "_zulpv77o _1e0c1txw _1gt41dpa",
10
12
  firstChild: "_19pe12x7 _1qq0idpf _3nesidpf",
11
13
  lastChild: "_19pe12x7 _15rdidpf _i84vidpf"
12
14
  };
@@ -19,7 +21,7 @@ export var ToolbarButtonGroup = function ToolbarButtonGroup(_ref) {
19
21
  var LastChild = fg('platform_editor_fix_t_at_is_not_a_function') ? items[items.length - 1] : items.at(-1);
20
22
  var middleChildren = items.slice(1, -1);
21
23
  return /*#__PURE__*/React.createElement(Box, {
22
- xcss: styles.container,
24
+ xcss: expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? styles.containerWithA11yToolbarFixes : styles.container,
23
25
  "data-toolbar-component": "button-group"
24
26
  }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
25
27
  className: ax([styles.firstChild])
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { default as InformationCircleIcon } from '@atlaskit/icon/core/information-circle';
@@ -38,6 +38,7 @@ export { HeadingOneIcon } from './ui/icons/HeadingOneIcon';
38
38
  export { HeadingSixIcon } from './ui/icons/HeadingSixIcon';
39
39
  export { HeadingThreeIcon } from './ui/icons/HeadingThreeIcon';
40
40
  export { HeadingTwoIcon } from './ui/icons/HeadingTwoIcon';
41
+ export { InformationCircleIcon } from './ui/icons/InformationCircleIcon';
41
42
  export { ItalicIcon } from './ui/icons/ItalicIcon';
42
43
  export { LinkIcon } from './ui/icons/LinkIcon';
43
44
  export { ListBulletedIcon } from './ui/icons/ListBulletedIcon';
@@ -0,0 +1 @@
1
+ export { default as InformationCircleIcon } from '@atlaskit/icon/core/information-circle';
@@ -0,0 +1,41 @@
1
+ import path from 'path';
2
+
3
+ import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
4
+
5
+ import packageJson from './package.json';
6
+
7
+ const packagePath = path.resolve(__dirname);
8
+
9
+ const documentation: StructuredContentSource = {
10
+ components: [
11
+ {
12
+ name: 'Toolbar',
13
+ description:
14
+ 'A common toolbar component for editor-like interfaces, providing a container for buttons, dropdowns, and other controls.',
15
+ status: 'general-availability',
16
+ import: {
17
+ name: 'Toolbar',
18
+ package: '@atlaskit/editor-toolbar',
19
+ type: 'named',
20
+ packagePath,
21
+ packageJson,
22
+ },
23
+ usageGuidelines: [
24
+ 'Use Toolbar to organize actions and controls for content editing.',
25
+ 'Supports grouping buttons and responsive behavior.',
26
+ 'Can be used as a primary toolbar or within specific sections of an interface.',
27
+ ],
28
+ examples: [
29
+ {
30
+ name: 'Basic',
31
+ description: 'Standard toolbar with basic buttons and groups.',
32
+ source: path.resolve(packagePath, './examples/basic.tsx'),
33
+ },
34
+ ],
35
+ keywords: ['toolbar', 'editor', 'actions', 'controls', 'buttons'],
36
+ categories: ['interaction', 'layout'],
37
+ },
38
+ ],
39
+ };
40
+
41
+ export default documentation;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org/"
5
5
  },
6
- "version": "2.1.0",
6
+ "version": "2.1.2",
7
7
  "description": "Common UI for Toolbars across the platform",
8
8
  "atlassian": {
9
9
  "react-compiler": {
@@ -36,10 +36,10 @@
36
36
  "@atlaskit/icon-lab": "^7.2.0",
37
37
  "@atlaskit/platform-feature-flags": "^2.0.0",
38
38
  "@atlaskit/popup": "^5.1.0",
39
- "@atlaskit/primitives": "^20.1.0",
39
+ "@atlaskit/primitives": "^20.2.0",
40
40
  "@atlaskit/react-compiler-gating": "^0.2.0",
41
- "@atlaskit/tmp-editor-statsig": "^114.0.0",
42
- "@atlaskit/tokens": "^15.1.0",
41
+ "@atlaskit/tmp-editor-statsig": "^114.6.0",
42
+ "@atlaskit/tokens": "^15.2.0",
43
43
  "@atlaskit/tooltip": "^23.1.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@compiled/react": "^0.20.0",