@atlaskit/primitives 14.14.3 → 14.15.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,21 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 14.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`fe9321ccb4bd7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe9321ccb4bd7) -
8
+ The Focusable component now resets the `outline` style when the element matches the pseudo-class
9
+ `:focus` but not `:focus-visible`. This is to ensure the focus ring is not applied when it should
10
+ not be. Some apps have global styles targeting all buttons and anchors, adding an `outline` on
11
+ `:focus`. This will unset that style.
12
+
13
+ This change is behind a feature flag.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 14.14.3
4
20
 
5
21
  ### Patch Changes
@@ -70,7 +70,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
70
70
  action: 'clicked',
71
71
  componentName: componentName || 'Anchor',
72
72
  packageName: "@atlaskit/primitives",
73
- packageVersion: "14.14.2",
73
+ packageVersion: "14.14.3",
74
74
  analyticsData: analyticsContext,
75
75
  actionSubject: 'link'
76
76
  });
@@ -1,4 +1,7 @@
1
- ._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
1
+
2
+ ._ymio1r31:focus:not(:focus-visible){outline-color:currentColor}
3
+ ._ypr0glyw:focus:not(:focus-visible){outline-style:none}
4
+ ._zcxs1o36:focus:not(:focus-visible){outline-width:medium}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
2
5
  ._1ah31gt5:focus-visible{outline-offset:var(--_12dc40g)}
3
6
  ._1ah3dkaa:focus-visible{outline-offset:var(--ds-border-width-focused,2px)}
4
7
  ._mizu194a:focus-visible{outline-color:var(--ds-border-focused,#2684ff)}
@@ -14,6 +14,7 @@ var _runtime = require("@compiled/react/runtime");
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
18
  var _excluded = ["as", "children", "isInset", "testId", "style", "xcss"],
18
19
  _excluded2 = ["className"];
19
20
  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); }
@@ -21,6 +22,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
21
22
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
23
  var focusRingStyles = null;
23
24
  var insetFocusRingStyles = null;
25
+
26
+ // This is added to override and reset global styles that apps might be applying - for example,
27
+ // at the time of writing, Jira has global styles that targets all button and anchor elements,
28
+ // adding an outline on :focus.
29
+ var outlineResetStyles = null;
24
30
  /**
25
31
  * __Focus ring__
26
32
  *
@@ -43,7 +49,7 @@ var Focusable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
43
49
  return /*#__PURE__*/React.createElement(Component, (0, _extends2.default)({}, safeHtmlAttributes, {
44
50
  // @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
45
51
  ref: ref,
46
- className: (0, _runtime.ax)(["_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gt5 _2mwq1gt5", xcss])
52
+ className: (0, _runtime.ax)(["_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gt5 _2mwq1gt5", (0, _platformFeatureFlags.fg)('platform_dst_compiled_primitives_outline_reset') && "_ymio1r31 _ypr0glyw _zcxs1o36", xcss])
47
53
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
48
54
  ,
49
55
 
@@ -61,7 +61,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
61
61
  action: 'clicked',
62
62
  componentName: componentName || 'Pressable',
63
63
  packageName: "@atlaskit/primitives",
64
- packageVersion: "14.14.2",
64
+ packageVersion: "14.14.3",
65
65
  analyticsData: analyticsContext,
66
66
  actionSubject: 'button'
67
67
  });
@@ -105,7 +105,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
105
105
  action: 'clicked',
106
106
  componentName: componentName || 'Anchor',
107
107
  packageName: "@atlaskit/primitives",
108
- packageVersion: "14.14.2",
108
+ packageVersion: "14.14.3",
109
109
  analyticsData: analyticsContext,
110
110
  actionSubject: 'link'
111
111
  });
@@ -97,7 +97,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
97
97
  action: 'clicked',
98
98
  componentName: componentName || 'Pressable',
99
99
  packageName: "@atlaskit/primitives",
100
- packageVersion: "14.14.2",
100
+ packageVersion: "14.14.3",
101
101
  analyticsData: analyticsContext,
102
102
  actionSubject: 'button'
103
103
  });
@@ -56,7 +56,7 @@ const AnchorNoRef = ({
56
56
  action: 'clicked',
57
57
  componentName: componentName || 'Anchor',
58
58
  packageName: "@atlaskit/primitives",
59
- packageVersion: "14.14.2",
59
+ packageVersion: "14.14.3",
60
60
  analyticsData: analyticsContext,
61
61
  actionSubject: 'link'
62
62
  });
@@ -1,4 +1,7 @@
1
- ._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
1
+
2
+ ._ymio1r31:focus:not(:focus-visible){outline-color:currentColor}
3
+ ._ypr0glyw:focus:not(:focus-visible){outline-style:none}
4
+ ._zcxs1o36:focus:not(:focus-visible){outline-width:medium}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
2
5
  ._1ah31gjf:focus-visible{outline-offset:calc(0px - var(--ds-border-width-focused, 2px))}
3
6
  ._1ah3dkaa:focus-visible{outline-offset:var(--ds-border-width-focused,2px)}
4
7
  ._mizu194a:focus-visible{outline-color:var(--ds-border-focused,#2684ff)}
@@ -4,8 +4,14 @@ import "./focusable.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { forwardRef } from 'react';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  const focusRingStyles = null;
8
9
  const insetFocusRingStyles = null;
10
+
11
+ // This is added to override and reset global styles that apps might be applying - for example,
12
+ // at the time of writing, Jira has global styles that targets all button and anchor elements,
13
+ // adding an outline on :focus.
14
+ const outlineResetStyles = null;
9
15
  /**
10
16
  * __Focus ring__
11
17
  *
@@ -30,7 +36,7 @@ const Focusable = /*#__PURE__*/forwardRef(({
30
36
  return /*#__PURE__*/React.createElement(Component, _extends({}, safeHtmlAttributes, {
31
37
  // @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
32
38
  ref: ref,
33
- className: ax(["_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gjf _2mwq1gjf", xcss])
39
+ className: ax(["_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gjf _2mwq1gjf", fg('platform_dst_compiled_primitives_outline_reset') && "_ymio1r31 _ypr0glyw _zcxs1o36", xcss])
34
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
35
41
  ,
36
42
  style: style,
@@ -48,7 +48,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
48
48
  action: 'clicked',
49
49
  componentName: componentName || 'Pressable',
50
50
  packageName: "@atlaskit/primitives",
51
- packageVersion: "14.14.2",
51
+ packageVersion: "14.14.3",
52
52
  analyticsData: analyticsContext,
53
53
  actionSubject: 'button'
54
54
  });
@@ -94,7 +94,7 @@ const AnchorNoRef = ({
94
94
  action: 'clicked',
95
95
  componentName: componentName || 'Anchor',
96
96
  packageName: "@atlaskit/primitives",
97
- packageVersion: "14.14.2",
97
+ packageVersion: "14.14.3",
98
98
  analyticsData: analyticsContext,
99
99
  actionSubject: 'link'
100
100
  });
@@ -86,7 +86,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
86
86
  action: 'clicked',
87
87
  componentName: componentName || 'Pressable',
88
88
  packageName: "@atlaskit/primitives",
89
- packageVersion: "14.14.2",
89
+ packageVersion: "14.14.3",
90
90
  analyticsData: analyticsContext,
91
91
  actionSubject: 'button'
92
92
  });
@@ -61,7 +61,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
61
61
  action: 'clicked',
62
62
  componentName: componentName || 'Anchor',
63
63
  packageName: "@atlaskit/primitives",
64
- packageVersion: "14.14.2",
64
+ packageVersion: "14.14.3",
65
65
  analyticsData: analyticsContext,
66
66
  actionSubject: 'link'
67
67
  });
@@ -1,4 +1,7 @@
1
- ._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
1
+
2
+ ._ymio1r31:focus:not(:focus-visible){outline-color:currentColor}
3
+ ._ypr0glyw:focus:not(:focus-visible){outline-style:none}
4
+ ._zcxs1o36:focus:not(:focus-visible){outline-width:medium}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
2
5
  ._1ah31gt5:focus-visible{outline-offset:var(--_12dc40g)}
3
6
  ._1ah3dkaa:focus-visible{outline-offset:var(--ds-border-width-focused,2px)}
4
7
  ._mizu194a:focus-visible{outline-color:var(--ds-border-focused,#2684ff)}
@@ -10,8 +10,14 @@ import { ax, ix } from "@compiled/react/runtime";
10
10
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
11
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
12
  import { forwardRef } from 'react';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
13
14
  var focusRingStyles = null;
14
15
  var insetFocusRingStyles = null;
16
+
17
+ // This is added to override and reset global styles that apps might be applying - for example,
18
+ // at the time of writing, Jira has global styles that targets all button and anchor elements,
19
+ // adding an outline on :focus.
20
+ var outlineResetStyles = null;
15
21
  /**
16
22
  * __Focus ring__
17
23
  *
@@ -34,7 +40,7 @@ var Focusable = /*#__PURE__*/forwardRef(function (_ref, ref) {
34
40
  return /*#__PURE__*/React.createElement(Component, _extends({}, safeHtmlAttributes, {
35
41
  // @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
36
42
  ref: ref,
37
- className: ax(["_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gt5 _2mwq1gt5", xcss])
43
+ className: ax(["_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gt5 _2mwq1gt5", fg('platform_dst_compiled_primitives_outline_reset') && "_ymio1r31 _ypr0glyw _zcxs1o36", xcss])
38
44
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
39
45
  ,
40
46
 
@@ -52,7 +52,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
52
52
  action: 'clicked',
53
53
  componentName: componentName || 'Pressable',
54
54
  packageName: "@atlaskit/primitives",
55
- packageVersion: "14.14.2",
55
+ packageVersion: "14.14.3",
56
56
  analyticsData: analyticsContext,
57
57
  actionSubject: 'button'
58
58
  });
@@ -99,7 +99,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
99
99
  action: 'clicked',
100
100
  componentName: componentName || 'Anchor',
101
101
  packageName: "@atlaskit/primitives",
102
- packageVersion: "14.14.2",
102
+ packageVersion: "14.14.3",
103
103
  analyticsData: analyticsContext,
104
104
  actionSubject: 'link'
105
105
  });
@@ -91,7 +91,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
91
91
  action: 'clicked',
92
92
  componentName: componentName || 'Pressable',
93
93
  packageName: "@atlaskit/primitives",
94
- packageVersion: "14.14.2",
94
+ packageVersion: "14.14.3",
95
95
  analyticsData: analyticsContext,
96
96
  actionSubject: 'button'
97
97
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "14.14.3",
3
+ "version": "14.15.0",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -137,6 +137,7 @@
137
137
  "@atlaskit/css": "^0.14.0",
138
138
  "@atlaskit/ds-lib": "^5.0.0",
139
139
  "@atlaskit/interaction-context": "^3.0.0",
140
+ "@atlaskit/platform-feature-flags": "^1.1.0",
140
141
  "@atlaskit/tokens": "^6.3.0",
141
142
  "@atlaskit/visually-hidden": "^3.0.0",
142
143
  "@babel/runtime": "^7.0.0",
@@ -161,7 +162,7 @@
161
162
  "@atlaskit/docs": "^11.1.0",
162
163
  "@atlaskit/dropdown-menu": "^16.3.0",
163
164
  "@atlaskit/flag": "^17.4.0",
164
- "@atlaskit/form": "^12.7.0",
165
+ "@atlaskit/form": "^13.0.0",
165
166
  "@atlaskit/heading": "^5.2.0",
166
167
  "@atlaskit/icon": "^28.2.0",
167
168
  "@atlaskit/icon-object": "^7.2.0",
@@ -177,6 +178,7 @@
177
178
  "@atlaskit/tooltip": "^20.4.0",
178
179
  "@atlassian/analytics-bridge": "^0.7.0",
179
180
  "@atlassian/codegen": "^0.1.0",
181
+ "@atlassian/feature-flags-test-utils": "^0.3.0",
180
182
  "@atlassian/ssr-tests": "^0.3.0",
181
183
  "@testing-library/react": "^13.4.0",
182
184
  "@testing-library/react-hooks": "^8.0.1",
@@ -220,5 +222,10 @@
220
222
  "dist/types-ts4.5/index.d.ts"
221
223
  ]
222
224
  }
225
+ },
226
+ "platform-feature-flags": {
227
+ "platform_dst_compiled_primitives_outline_reset": {
228
+ "type": "boolean"
229
+ }
223
230
  }
224
231
  }