@atlaskit/spotlight 0.0.12 → 0.0.14
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 +15 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/ui/popover-content/index.js +11 -1
- package/dist/cjs/ui/step-count/index.compiled.css +1 -0
- package/dist/cjs/ui/step-count/index.js +32 -0
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/ui/popover-content/index.js +11 -1
- package/dist/es2019/ui/step-count/index.compiled.css +1 -0
- package/dist/es2019/ui/step-count/index.js +25 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/ui/popover-content/index.js +11 -1
- package/dist/esm/ui/step-count/index.compiled.css +1 -0
- package/dist/esm/ui/step-count/index.js +24 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/ui/step-count/index.d.ts +20 -0
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/step-count/index.d.ts +20 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/spotlight
|
|
2
2
|
|
|
3
|
+
## 0.0.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`85a83a17c7d56`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/85a83a17c7d56) -
|
|
8
|
+
Tweak offset of caret positioning so as not to overlap the target component.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 0.0.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`15963c2a4fb01`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/15963c2a4fb01) -
|
|
16
|
+
Create StepCount component.
|
|
17
|
+
|
|
3
18
|
## 0.0.12
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -93,6 +93,12 @@ Object.defineProperty(exports, "SpotlightShowMoreControl", {
|
|
|
93
93
|
return _showMoreControl.SpotlightShowMoreControl;
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
+
Object.defineProperty(exports, "SpotlightStepCount", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function get() {
|
|
99
|
+
return _stepCount.SpotlightStepCount;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
96
102
|
Object.defineProperty(exports, "TourContext", {
|
|
97
103
|
enumerable: true,
|
|
98
104
|
get: function get() {
|
|
@@ -111,6 +117,7 @@ var _header = require("./ui/header");
|
|
|
111
117
|
var _headline = require("./ui/headline");
|
|
112
118
|
var _footer = require("./ui/footer");
|
|
113
119
|
var _actions = require("./ui/actions");
|
|
120
|
+
var _stepCount = require("./ui/step-count");
|
|
114
121
|
var _primaryAction = require("./ui/primary-action");
|
|
115
122
|
var _secondaryAction = require("./ui/secondary-action");
|
|
116
123
|
var _controls = require("./ui/controls");
|
|
@@ -17,6 +17,16 @@ var styles = {
|
|
|
17
17
|
visible: "_lcxv1wug _3um0ewfl",
|
|
18
18
|
hidden: "_lcxvglyw _3um015vq"
|
|
19
19
|
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The `transform: rotate(45deg);` styles used to rotate the `Caret` component result in the corners of
|
|
23
|
+
* the caret extending beyond the bounding box (by roughly 2px). So, apply an offset to ensure
|
|
24
|
+
* the caret points to the very edge of the target element.
|
|
25
|
+
*
|
|
26
|
+
* Note: `@atlaskit/popper` maps the offset to to the placement, so we only need to define `[0, 2]` and
|
|
27
|
+
* the offset will get correctly rotated depending on the placement.
|
|
28
|
+
*/
|
|
29
|
+
var offset = [0, 2];
|
|
20
30
|
/**
|
|
21
31
|
* The Spotlight card can be positioned in many different configurations, but the caret should always point to
|
|
22
32
|
* the center of the target element. `@atlaskit/popper` uses `'top' | 'right' | 'bottom' | 'left'` values for
|
|
@@ -51,7 +61,7 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
|
|
|
51
61
|
setPlacement(placement);
|
|
52
62
|
}, [placement, setPlacement]);
|
|
53
63
|
return /*#__PURE__*/React.createElement(_popper.Popper, {
|
|
54
|
-
offset:
|
|
64
|
+
offset: offset,
|
|
55
65
|
placement: popperPlacementMap[placement]
|
|
56
66
|
}, function (_ref2) {
|
|
57
67
|
var ref = _ref2.ref,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._1ul91ris{min-width:max-content}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SpotlightStepCount = void 0;
|
|
9
|
+
require("./index.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
13
|
+
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); }
|
|
14
|
+
var styles = {
|
|
15
|
+
root: "_1ul91ris"
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* __Spotlight StepCount__
|
|
19
|
+
*
|
|
20
|
+
* `SpotlightStepCount` groups `SpotlightAction` components.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
var SpotlightStepCount = exports.SpotlightStepCount = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
24
|
+
var children = _ref.children,
|
|
25
|
+
testId = _ref.testId;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
27
|
+
xcss: styles.root
|
|
28
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
29
|
+
ref: ref,
|
|
30
|
+
testId: testId
|
|
31
|
+
}, children));
|
|
32
|
+
});
|
package/dist/es2019/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { SpotlightHeader } from './ui/header';
|
|
|
4
4
|
export { SpotlightHeadline } from './ui/headline';
|
|
5
5
|
export { SpotlightFooter } from './ui/footer';
|
|
6
6
|
export { SpotlightActions } from './ui/actions';
|
|
7
|
+
export { SpotlightStepCount } from './ui/step-count';
|
|
7
8
|
export { SpotlightPrimaryAction } from './ui/primary-action';
|
|
8
9
|
export { SpotlightSecondaryAction } from './ui/secondary-action';
|
|
9
10
|
export { SpotlightControls } from './ui/controls';
|
|
@@ -9,6 +9,16 @@ const styles = {
|
|
|
9
9
|
visible: "_lcxv1wug _3um0ewfl",
|
|
10
10
|
hidden: "_lcxvglyw _3um015vq"
|
|
11
11
|
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The `transform: rotate(45deg);` styles used to rotate the `Caret` component result in the corners of
|
|
15
|
+
* the caret extending beyond the bounding box (by roughly 2px). So, apply an offset to ensure
|
|
16
|
+
* the caret points to the very edge of the target element.
|
|
17
|
+
*
|
|
18
|
+
* Note: `@atlaskit/popper` maps the offset to to the placement, so we only need to define `[0, 2]` and
|
|
19
|
+
* the offset will get correctly rotated depending on the placement.
|
|
20
|
+
*/
|
|
21
|
+
const offset = [0, 2];
|
|
12
22
|
/**
|
|
13
23
|
* The Spotlight card can be positioned in many different configurations, but the caret should always point to
|
|
14
24
|
* the center of the target element. `@atlaskit/popper` uses `'top' | 'right' | 'bottom' | 'left'` values for
|
|
@@ -44,7 +54,7 @@ export const PopoverContent = ({
|
|
|
44
54
|
setPlacement(placement);
|
|
45
55
|
}, [placement, setPlacement]);
|
|
46
56
|
return /*#__PURE__*/React.createElement(Popper, {
|
|
47
|
-
offset:
|
|
57
|
+
offset: offset,
|
|
48
58
|
placement: popperPlacementMap[placement]
|
|
49
59
|
}, ({
|
|
50
60
|
ref,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._1ul91ris{min-width:max-content}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
5
|
+
import { Flex, Text } from '@atlaskit/primitives/compiled';
|
|
6
|
+
const styles = {
|
|
7
|
+
root: "_1ul91ris"
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* __Spotlight StepCount__
|
|
11
|
+
*
|
|
12
|
+
* `SpotlightStepCount` groups `SpotlightAction` components.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export const SpotlightStepCount = /*#__PURE__*/forwardRef(({
|
|
16
|
+
children,
|
|
17
|
+
testId
|
|
18
|
+
}, ref) => {
|
|
19
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
20
|
+
xcss: styles.root
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
22
|
+
ref: ref,
|
|
23
|
+
testId: testId
|
|
24
|
+
}, children));
|
|
25
|
+
});
|
package/dist/esm/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { SpotlightHeader } from './ui/header';
|
|
|
4
4
|
export { SpotlightHeadline } from './ui/headline';
|
|
5
5
|
export { SpotlightFooter } from './ui/footer';
|
|
6
6
|
export { SpotlightActions } from './ui/actions';
|
|
7
|
+
export { SpotlightStepCount } from './ui/step-count';
|
|
7
8
|
export { SpotlightPrimaryAction } from './ui/primary-action';
|
|
8
9
|
export { SpotlightSecondaryAction } from './ui/secondary-action';
|
|
9
10
|
export { SpotlightControls } from './ui/controls';
|
|
@@ -9,6 +9,16 @@ var styles = {
|
|
|
9
9
|
visible: "_lcxv1wug _3um0ewfl",
|
|
10
10
|
hidden: "_lcxvglyw _3um015vq"
|
|
11
11
|
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The `transform: rotate(45deg);` styles used to rotate the `Caret` component result in the corners of
|
|
15
|
+
* the caret extending beyond the bounding box (by roughly 2px). So, apply an offset to ensure
|
|
16
|
+
* the caret points to the very edge of the target element.
|
|
17
|
+
*
|
|
18
|
+
* Note: `@atlaskit/popper` maps the offset to to the placement, so we only need to define `[0, 2]` and
|
|
19
|
+
* the offset will get correctly rotated depending on the placement.
|
|
20
|
+
*/
|
|
21
|
+
var offset = [0, 2];
|
|
12
22
|
/**
|
|
13
23
|
* The Spotlight card can be positioned in many different configurations, but the caret should always point to
|
|
14
24
|
* the center of the target element. `@atlaskit/popper` uses `'top' | 'right' | 'bottom' | 'left'` values for
|
|
@@ -43,7 +53,7 @@ export var PopoverContent = function PopoverContent(_ref) {
|
|
|
43
53
|
setPlacement(placement);
|
|
44
54
|
}, [placement, setPlacement]);
|
|
45
55
|
return /*#__PURE__*/React.createElement(Popper, {
|
|
46
|
-
offset:
|
|
56
|
+
offset: offset,
|
|
47
57
|
placement: popperPlacementMap[placement]
|
|
48
58
|
}, function (_ref2) {
|
|
49
59
|
var ref = _ref2.ref,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._1ul91ris{min-width:max-content}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
5
|
+
import { Flex, Text } from '@atlaskit/primitives/compiled';
|
|
6
|
+
var styles = {
|
|
7
|
+
root: "_1ul91ris"
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* __Spotlight StepCount__
|
|
11
|
+
*
|
|
12
|
+
* `SpotlightStepCount` groups `SpotlightAction` components.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export var SpotlightStepCount = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
16
|
+
var children = _ref.children,
|
|
17
|
+
testId = _ref.testId;
|
|
18
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
19
|
+
xcss: styles.root
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
21
|
+
ref: ref,
|
|
22
|
+
testId: testId
|
|
23
|
+
}, children));
|
|
24
|
+
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ export { SpotlightHeader, type SpotlightHeaderProps } from './ui/header';
|
|
|
4
4
|
export { SpotlightHeadline, type SpotlightHeadlineProps } from './ui/headline';
|
|
5
5
|
export { SpotlightFooter, type SpotlightFooterProps } from './ui/footer';
|
|
6
6
|
export { SpotlightActions, type SpotlightActionsProps } from './ui/actions';
|
|
7
|
+
export { SpotlightStepCount, type SpotlightStepCountProps } from './ui/step-count';
|
|
7
8
|
export { SpotlightPrimaryAction, type SpotlightPrimaryActionProps } from './ui/primary-action';
|
|
8
9
|
export { SpotlightSecondaryAction, type SpotlightSecondaryActionProps, } from './ui/secondary-action';
|
|
9
10
|
export { SpotlightControls, type SpotlightControlsProps } from './ui/controls';
|
|
10
11
|
export { SpotlightDismissControl, type SpotlightDismissControlProps } from './ui/dismiss-control';
|
|
11
|
-
export { SpotlightShowMoreControl, type SpotlightShowMoreControlProps } from './ui/show-more-control';
|
|
12
|
+
export { SpotlightShowMoreControl, type SpotlightShowMoreControlProps, } from './ui/show-more-control';
|
|
12
13
|
export { SpotlightMedia, type SpotlightMediaProps } from './ui/media';
|
|
13
14
|
export { PopoverProvider } from './ui/popover-provider';
|
|
14
15
|
export { PopoverContent } from './ui/popover-content';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
export interface SpotlightStepCountProps {
|
|
3
|
+
/**
|
|
4
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
5
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
6
|
+
* serving as a hook for automated tests
|
|
7
|
+
*/
|
|
8
|
+
testId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Elements to be rendered inside the `SpotlightStepCount`.
|
|
11
|
+
*/
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* __Spotlight StepCount__
|
|
16
|
+
*
|
|
17
|
+
* `SpotlightStepCount` groups `SpotlightAction` components.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare const SpotlightStepCount: React.ForwardRefExoticComponent<SpotlightStepCountProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -4,11 +4,12 @@ export { SpotlightHeader, type SpotlightHeaderProps } from './ui/header';
|
|
|
4
4
|
export { SpotlightHeadline, type SpotlightHeadlineProps } from './ui/headline';
|
|
5
5
|
export { SpotlightFooter, type SpotlightFooterProps } from './ui/footer';
|
|
6
6
|
export { SpotlightActions, type SpotlightActionsProps } from './ui/actions';
|
|
7
|
+
export { SpotlightStepCount, type SpotlightStepCountProps } from './ui/step-count';
|
|
7
8
|
export { SpotlightPrimaryAction, type SpotlightPrimaryActionProps } from './ui/primary-action';
|
|
8
9
|
export { SpotlightSecondaryAction, type SpotlightSecondaryActionProps, } from './ui/secondary-action';
|
|
9
10
|
export { SpotlightControls, type SpotlightControlsProps } from './ui/controls';
|
|
10
11
|
export { SpotlightDismissControl, type SpotlightDismissControlProps } from './ui/dismiss-control';
|
|
11
|
-
export { SpotlightShowMoreControl, type SpotlightShowMoreControlProps } from './ui/show-more-control';
|
|
12
|
+
export { SpotlightShowMoreControl, type SpotlightShowMoreControlProps, } from './ui/show-more-control';
|
|
12
13
|
export { SpotlightMedia, type SpotlightMediaProps } from './ui/media';
|
|
13
14
|
export { PopoverProvider } from './ui/popover-provider';
|
|
14
15
|
export { PopoverContent } from './ui/popover-content';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
export interface SpotlightStepCountProps {
|
|
3
|
+
/**
|
|
4
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
5
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
6
|
+
* serving as a hook for automated tests
|
|
7
|
+
*/
|
|
8
|
+
testId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Elements to be rendered inside the `SpotlightStepCount`.
|
|
11
|
+
*/
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* __Spotlight StepCount__
|
|
16
|
+
*
|
|
17
|
+
* `SpotlightStepCount` groups `SpotlightAction` components.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare const SpotlightStepCount: React.ForwardRefExoticComponent<SpotlightStepCountProps & React.RefAttributes<HTMLSpanElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/spotlight",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "A spotlight introduces users to various points of interest across Atlassian through focused messages or multi-step tours.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
".": "./src/index.tsx"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/button": "^23.
|
|
32
|
+
"@atlaskit/button": "^23.4.0",
|
|
33
33
|
"@atlaskit/css": "^0.12.0",
|
|
34
34
|
"@atlaskit/heading": "^5.2.0",
|
|
35
35
|
"@atlaskit/icon": "^27.12.0",
|