@atlaskit/spotlight 0.9.4 → 0.9.6

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,19 @@
1
1
  # @atlaskit/spotlight
2
2
 
3
+ ## 0.9.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.9.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`e0d5103c4e6cd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e0d5103c4e6cd) -
14
+ Expose `strategy` prop on `PopoverContent` which is passed through to the underlying
15
+ `react-popper`.
16
+
3
17
  ## 0.9.4
4
18
 
5
19
  ### Patch Changes
@@ -70,7 +70,8 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(props) {
70
70
  back = props.back,
71
71
  testId = props.testId,
72
72
  _props$offset = props.offset,
73
- offset = _props$offset === void 0 ? defaultOffset : _props$offset;
73
+ offset = _props$offset === void 0 ? defaultOffset : _props$offset,
74
+ strategy = props.strategy;
74
75
 
75
76
  /**
76
77
  * A user should only be able to pass a `done` or a `next`. Not both.
@@ -140,6 +141,7 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(props) {
140
141
  });
141
142
  return /*#__PURE__*/React.createElement(_popper.Popper, {
142
143
  offset: offset,
144
+ strategy: strategy,
143
145
  placement: popperPlacementMap[placement]
144
146
  }, function (_ref) {
145
147
  var localRef = _ref.ref,
@@ -59,7 +59,8 @@ export const PopoverContent = props => {
59
59
  dismiss,
60
60
  back,
61
61
  testId,
62
- offset = defaultOffset
62
+ offset = defaultOffset,
63
+ strategy
63
64
  } = props;
64
65
 
65
66
  /**
@@ -125,6 +126,7 @@ export const PopoverContent = props => {
125
126
  });
126
127
  return /*#__PURE__*/React.createElement(Popper, {
127
128
  offset: offset,
129
+ strategy: strategy,
128
130
  placement: popperPlacementMap[placement]
129
131
  }, ({
130
132
  ref: localRef,
@@ -61,7 +61,8 @@ export var PopoverContent = function PopoverContent(props) {
61
61
  back = props.back,
62
62
  testId = props.testId,
63
63
  _props$offset = props.offset,
64
- offset = _props$offset === void 0 ? defaultOffset : _props$offset;
64
+ offset = _props$offset === void 0 ? defaultOffset : _props$offset,
65
+ strategy = props.strategy;
65
66
 
66
67
  /**
67
68
  * A user should only be able to pass a `done` or a `next`. Not both.
@@ -131,6 +132,7 @@ export var PopoverContent = function PopoverContent(props) {
131
132
  });
132
133
  return /*#__PURE__*/React.createElement(Popper, {
133
134
  offset: offset,
135
+ strategy: strategy,
134
136
  placement: popperPlacementMap[placement]
135
137
  }, function (_ref) {
136
138
  var localRef = _ref.ref,
@@ -8,6 +8,7 @@ import type { BackEvent, DismissEvent, DoneEvent, NextEvent, Placement } from '.
8
8
  * Taken from `@atlaskit/popper`
9
9
  */
10
10
  type Offset = [number | null | undefined, number | null | undefined];
11
+ type Strategy = 'absolute' | 'fixed';
11
12
  interface BasePopoverContentProps {
12
13
  /**
13
14
  * A `testId` prop is provided for specified elements, which is a unique
@@ -48,6 +49,13 @@ interface BasePopoverContentProps {
48
49
  * by the `placement` prop.
49
50
  */
50
51
  offset?: Offset;
52
+ /**
53
+ * Describes the positioning strategy to use. By default, it is `absolute`, which in the simplest cases does not require
54
+ * repositioning of the popper. If your reference element is in a fixed container, use the `fixed` strategy
55
+ *
56
+ * For more details see: https://popper.js.org/docs/v2/constructors/#strategy
57
+ */
58
+ strategy?: Strategy;
51
59
  /**
52
60
  * The content to be rendered in `PopoverContent`. This is intended to be a `SpotlightCard`.
53
61
  */
@@ -11,6 +11,7 @@ type Offset = [
11
11
  number | null | undefined,
12
12
  number | null | undefined
13
13
  ];
14
+ type Strategy = 'absolute' | 'fixed';
14
15
  interface BasePopoverContentProps {
15
16
  /**
16
17
  * A `testId` prop is provided for specified elements, which is a unique
@@ -51,6 +52,13 @@ interface BasePopoverContentProps {
51
52
  * by the `placement` prop.
52
53
  */
53
54
  offset?: Offset;
55
+ /**
56
+ * Describes the positioning strategy to use. By default, it is `absolute`, which in the simplest cases does not require
57
+ * repositioning of the popper. If your reference element is in a fixed container, use the `fixed` strategy
58
+ *
59
+ * For more details see: https://popper.js.org/docs/v2/constructors/#strategy
60
+ */
61
+ strategy?: Strategy;
54
62
  /**
55
63
  * The content to be rendered in `PopoverContent`. This is intended to be a `SpotlightCard`.
56
64
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/spotlight",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "description": "A spotlight introduces users to points of interest, from focused messages to multi-step tours.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,14 +34,14 @@
34
34
  "dependencies": {
35
35
  "@atlaskit/browser-apis": "^0.0.1",
36
36
  "@atlaskit/button": "^23.6.0",
37
- "@atlaskit/css": "^0.15.0",
37
+ "@atlaskit/css": "^0.16.0",
38
38
  "@atlaskit/ds-lib": "^5.2.0",
39
39
  "@atlaskit/heading": "^5.2.0",
40
40
  "@atlaskit/icon": "^29.0.0",
41
41
  "@atlaskit/image": "^3.0.0",
42
42
  "@atlaskit/popper": "^7.1.0",
43
- "@atlaskit/primitives": "^16.1.0",
44
- "@atlaskit/tokens": "^8.0.0",
43
+ "@atlaskit/primitives": "^16.2.0",
44
+ "@atlaskit/tokens": "^8.1.0",
45
45
  "@atlaskit/visually-hidden": "^3.0.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@compiled/react": "^0.18.6",