@atlaskit/spotlight 0.0.6 → 0.0.7

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/index.js +22 -1
  3. package/dist/cjs/types.js +5 -0
  4. package/dist/cjs/ui/popover-content/index.js +32 -0
  5. package/dist/cjs/ui/popover-provider/index.js +19 -0
  6. package/dist/cjs/ui/popover-target/index.js +23 -0
  7. package/dist/es2019/index.js +4 -1
  8. package/dist/es2019/types.js +1 -0
  9. package/dist/es2019/ui/controls/index.js +2 -2
  10. package/dist/es2019/ui/dismiss-control/index.js +1 -1
  11. package/dist/es2019/ui/popover-content/index.js +24 -0
  12. package/dist/es2019/ui/popover-provider/index.js +14 -0
  13. package/dist/es2019/ui/popover-target/index.js +17 -0
  14. package/dist/esm/index.js +4 -1
  15. package/dist/esm/types.js +1 -0
  16. package/dist/esm/ui/controls/index.js +2 -2
  17. package/dist/esm/ui/dismiss-control/index.js +1 -1
  18. package/dist/esm/ui/popover-content/index.js +25 -0
  19. package/dist/esm/ui/popover-provider/index.js +13 -0
  20. package/dist/esm/ui/popover-target/index.js +17 -0
  21. package/dist/types/index.d.ts +4 -1
  22. package/dist/types/types.d.ts +2 -0
  23. package/dist/types/ui/controls/index.d.ts +1 -1
  24. package/dist/types/ui/dismiss-control/index.d.ts +1 -1
  25. package/dist/types/ui/popover-content/index.d.ts +11 -0
  26. package/dist/types/ui/popover-provider/index.d.ts +10 -0
  27. package/dist/types/ui/popover-target/index.d.ts +9 -0
  28. package/dist/types-ts4.5/index.d.ts +4 -1
  29. package/dist/types-ts4.5/types.d.ts +2 -0
  30. package/dist/types-ts4.5/ui/controls/index.d.ts +1 -1
  31. package/dist/types-ts4.5/ui/dismiss-control/index.d.ts +1 -1
  32. package/dist/types-ts4.5/ui/popover-content/index.d.ts +11 -0
  33. package/dist/types-ts4.5/ui/popover-provider/index.d.ts +10 -0
  34. package/dist/types-ts4.5/ui/popover-target/index.d.ts +9 -0
  35. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/spotlight
2
2
 
3
+ ## 0.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#197821](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/197821)
8
+ [`f9dbe2c16f7e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f9dbe2c16f7e0) -
9
+ Create PopoverProvider, PopoverTarget, PopoverContent components.
10
+
3
11
  ## 0.0.6
4
12
 
5
13
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -3,6 +3,24 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "PopoverContent", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _popoverContent.PopoverContent;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "PopoverProvider", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _popoverProvider.PopoverProvider;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "PopoverTarget", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _popoverTarget.PopoverTarget;
22
+ }
23
+ });
6
24
  Object.defineProperty(exports, "Spotlight", {
7
25
  enumerable: true,
8
26
  get: function get() {
@@ -65,4 +83,7 @@ var _actions = require("./ui/actions");
65
83
  var _primaryAction = require("./ui/primary-action");
66
84
  var _secondaryAction = require("./ui/secondary-action");
67
85
  var _controls = require("./ui/controls");
68
- var _dismissControl = require("./ui/dismiss-control");
86
+ var _dismissControl = require("./ui/dismiss-control");
87
+ var _popoverProvider = require("./ui/popover-provider");
88
+ var _popoverContent = require("./ui/popover-content");
89
+ var _popoverTarget = require("./ui/popover-target");
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.PopoverContent = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _popper = require("@atlaskit/popper");
10
+ /**
11
+ * __PopoverContent__
12
+ *
13
+ * A `PopoverContent` is the element that is shown as a popover.
14
+ */
15
+ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
16
+ var children = _ref.children,
17
+ placement = _ref.placement;
18
+ return /*#__PURE__*/_react.default.createElement(_popper.Popper, {
19
+ placement: placement
20
+ }, function (_ref2) {
21
+ var ref = _ref2.ref,
22
+ style = _ref2.style;
23
+ return (
24
+ /*#__PURE__*/
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
26
+ _react.default.createElement("div", {
27
+ ref: ref,
28
+ style: style
29
+ }, children)
30
+ );
31
+ });
32
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.PopoverProvider = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _popper = require("@atlaskit/popper");
10
+ /**
11
+ * __Popover provider__
12
+ *
13
+ * A popover provider provides necesary context for the `PopoverContent` and `PopoverTarget` components.
14
+ *
15
+ */
16
+ var PopoverProvider = exports.PopoverProvider = function PopoverProvider(_ref) {
17
+ var children = _ref.children;
18
+ return /*#__PURE__*/_react.default.createElement(_popper.Manager, null, children);
19
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.PopoverTarget = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _popper = require("@atlaskit/popper");
10
+ /**
11
+ * __Target__
12
+ *
13
+ * A target is the element that the popover content will be positioned in relation to.
14
+ */
15
+ var PopoverTarget = exports.PopoverTarget = function PopoverTarget(_ref) {
16
+ var children = _ref.children;
17
+ return /*#__PURE__*/_react.default.createElement(_popper.Reference, null, function (_ref2) {
18
+ var ref = _ref2.ref;
19
+ return /*#__PURE__*/_react.default.createElement("div", {
20
+ ref: ref
21
+ }, children);
22
+ });
23
+ };
@@ -6,4 +6,7 @@ export { SpotlightActions } from './ui/actions';
6
6
  export { SpotlightPrimaryAction } from './ui/primary-action';
7
7
  export { SpotlightSecondaryAction } from './ui/secondary-action';
8
8
  export { SpotlightControls } from './ui/controls';
9
- export { SpotlightDismissControl } from './ui/dismiss-control';
9
+ export { SpotlightDismissControl } from './ui/dismiss-control';
10
+ export { PopoverProvider } from './ui/popover-provider';
11
+ export { PopoverContent } from './ui/popover-content';
12
+ export { PopoverTarget } from './ui/popover-target';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import React, { forwardRef } from "react";
2
- import { Flex } from "@atlaskit/primitives/compiled";
1
+ import React, { forwardRef } from 'react';
2
+ import { Flex } from '@atlaskit/primitives/compiled';
3
3
  /**
4
4
  * __Spotlight controls__
5
5
  *
@@ -1,4 +1,4 @@
1
- import React, { forwardRef } from "react";
1
+ import React, { forwardRef } from 'react';
2
2
  import { IconButton } from '@atlaskit/button/new';
3
3
  import CrossIcon from '@atlaskit/icon/core/cross';
4
4
  /**
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { Popper } from "@atlaskit/popper";
3
+ /**
4
+ * __PopoverContent__
5
+ *
6
+ * A `PopoverContent` is the element that is shown as a popover.
7
+ */
8
+ export const PopoverContent = ({
9
+ children,
10
+ placement
11
+ }) => {
12
+ return /*#__PURE__*/React.createElement(Popper, {
13
+ placement: placement
14
+ }, ({
15
+ ref,
16
+ style
17
+ }) =>
18
+ /*#__PURE__*/
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
20
+ React.createElement("div", {
21
+ ref: ref,
22
+ style: style
23
+ }, children));
24
+ };
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { Manager } from "@atlaskit/popper";
3
+
4
+ /**
5
+ * __Popover provider__
6
+ *
7
+ * A popover provider provides necesary context for the `PopoverContent` and `PopoverTarget` components.
8
+ *
9
+ */
10
+ export const PopoverProvider = ({
11
+ children
12
+ }) => {
13
+ return /*#__PURE__*/React.createElement(Manager, null, children);
14
+ };
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { Reference } from "@atlaskit/popper";
3
+
4
+ /**
5
+ * __Target__
6
+ *
7
+ * A target is the element that the popover content will be positioned in relation to.
8
+ */
9
+ export const PopoverTarget = ({
10
+ children
11
+ }) => {
12
+ return /*#__PURE__*/React.createElement(Reference, null, ({
13
+ ref
14
+ }) => /*#__PURE__*/React.createElement("div", {
15
+ ref: ref
16
+ }, children));
17
+ };
package/dist/esm/index.js CHANGED
@@ -6,4 +6,7 @@ export { SpotlightActions } from './ui/actions';
6
6
  export { SpotlightPrimaryAction } from './ui/primary-action';
7
7
  export { SpotlightSecondaryAction } from './ui/secondary-action';
8
8
  export { SpotlightControls } from './ui/controls';
9
- export { SpotlightDismissControl } from './ui/dismiss-control';
9
+ export { SpotlightDismissControl } from './ui/dismiss-control';
10
+ export { PopoverProvider } from './ui/popover-provider';
11
+ export { PopoverContent } from './ui/popover-content';
12
+ export { PopoverTarget } from './ui/popover-target';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import React, { forwardRef } from "react";
2
- import { Flex } from "@atlaskit/primitives/compiled";
1
+ import React, { forwardRef } from 'react';
2
+ import { Flex } from '@atlaskit/primitives/compiled';
3
3
  /**
4
4
  * __Spotlight controls__
5
5
  *
@@ -1,4 +1,4 @@
1
- import React, { forwardRef } from "react";
1
+ import React, { forwardRef } from 'react';
2
2
  import { IconButton } from '@atlaskit/button/new';
3
3
  import CrossIcon from '@atlaskit/icon/core/cross';
4
4
  /**
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { Popper } from "@atlaskit/popper";
3
+ /**
4
+ * __PopoverContent__
5
+ *
6
+ * A `PopoverContent` is the element that is shown as a popover.
7
+ */
8
+ export var PopoverContent = function PopoverContent(_ref) {
9
+ var children = _ref.children,
10
+ placement = _ref.placement;
11
+ return /*#__PURE__*/React.createElement(Popper, {
12
+ placement: placement
13
+ }, function (_ref2) {
14
+ var ref = _ref2.ref,
15
+ style = _ref2.style;
16
+ return (
17
+ /*#__PURE__*/
18
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
19
+ React.createElement("div", {
20
+ ref: ref,
21
+ style: style
22
+ }, children)
23
+ );
24
+ });
25
+ };
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { Manager } from "@atlaskit/popper";
3
+
4
+ /**
5
+ * __Popover provider__
6
+ *
7
+ * A popover provider provides necesary context for the `PopoverContent` and `PopoverTarget` components.
8
+ *
9
+ */
10
+ export var PopoverProvider = function PopoverProvider(_ref) {
11
+ var children = _ref.children;
12
+ return /*#__PURE__*/React.createElement(Manager, null, children);
13
+ };
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { Reference } from "@atlaskit/popper";
3
+
4
+ /**
5
+ * __Target__
6
+ *
7
+ * A target is the element that the popover content will be positioned in relation to.
8
+ */
9
+ export var PopoverTarget = function PopoverTarget(_ref) {
10
+ var children = _ref.children;
11
+ return /*#__PURE__*/React.createElement(Reference, null, function (_ref2) {
12
+ var ref = _ref2.ref;
13
+ return /*#__PURE__*/React.createElement("div", {
14
+ ref: ref
15
+ }, children);
16
+ });
17
+ };
@@ -4,6 +4,9 @@ export { SpotlightHeadline, type SpotlightHeadlineProps } from './ui/headline';
4
4
  export { SpotlightFooter, type SpotlightFooterProps } from './ui/footer';
5
5
  export { SpotlightActions, type SpotlightActionsProps } from './ui/actions';
6
6
  export { SpotlightPrimaryAction, type SpotlightPrimaryActionProps } from './ui/primary-action';
7
- export { SpotlightSecondaryAction, type SpotlightSecondaryActionProps } from './ui/secondary-action';
7
+ export { SpotlightSecondaryAction, type SpotlightSecondaryActionProps, } from './ui/secondary-action';
8
8
  export { SpotlightControls, type SpotlightControlsProps } from './ui/controls';
9
9
  export { SpotlightDismissControl, type SpotlightDismissControlProps } from './ui/dismiss-control';
10
+ export { PopoverProvider } from './ui/popover-provider';
11
+ export { PopoverContent } from './ui/popover-content';
12
+ export { PopoverTarget } from './ui/popover-target';
@@ -0,0 +1,2 @@
1
+ import { type Placement as ADSPopperPlacement } from "@atlaskit/popper";
2
+ export type Placement = Extract<ADSPopperPlacement, "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end">;
@@ -1,4 +1,4 @@
1
- import React, { type ReactNode } from "react";
1
+ import React, { type ReactNode } from 'react';
2
2
  export interface SpotlightControlsProps {
3
3
  /**
4
4
  * A `testId` prop is provided for specified elements, which is a unique
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export interface SpotlightDismissControlProps {
3
3
  /**
4
4
  * A `testId` prop is provided for specified elements, which is a unique
@@ -0,0 +1,11 @@
1
+ import React, { type ReactNode } from "react";
2
+ import type { Placement } from '../../types';
3
+ /**
4
+ * __PopoverContent__
5
+ *
6
+ * A `PopoverContent` is the element that is shown as a popover.
7
+ */
8
+ export declare const PopoverContent: ({ children, placement }: {
9
+ children: ReactNode;
10
+ placement: Placement;
11
+ }) => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React, { type ReactNode } from "react";
2
+ /**
3
+ * __Popover provider__
4
+ *
5
+ * A popover provider provides necesary context for the `PopoverContent` and `PopoverTarget` components.
6
+ *
7
+ */
8
+ export declare const PopoverProvider: ({ children }: {
9
+ children: ReactNode;
10
+ }) => React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React, { type ReactNode } from "react";
2
+ /**
3
+ * __Target__
4
+ *
5
+ * A target is the element that the popover content will be positioned in relation to.
6
+ */
7
+ export declare const PopoverTarget: ({ children }: {
8
+ children: ReactNode;
9
+ }) => React.JSX.Element;
@@ -4,6 +4,9 @@ export { SpotlightHeadline, type SpotlightHeadlineProps } from './ui/headline';
4
4
  export { SpotlightFooter, type SpotlightFooterProps } from './ui/footer';
5
5
  export { SpotlightActions, type SpotlightActionsProps } from './ui/actions';
6
6
  export { SpotlightPrimaryAction, type SpotlightPrimaryActionProps } from './ui/primary-action';
7
- export { SpotlightSecondaryAction, type SpotlightSecondaryActionProps } from './ui/secondary-action';
7
+ export { SpotlightSecondaryAction, type SpotlightSecondaryActionProps, } from './ui/secondary-action';
8
8
  export { SpotlightControls, type SpotlightControlsProps } from './ui/controls';
9
9
  export { SpotlightDismissControl, type SpotlightDismissControlProps } from './ui/dismiss-control';
10
+ export { PopoverProvider } from './ui/popover-provider';
11
+ export { PopoverContent } from './ui/popover-content';
12
+ export { PopoverTarget } from './ui/popover-target';
@@ -0,0 +1,2 @@
1
+ import { type Placement as ADSPopperPlacement } from "@atlaskit/popper";
2
+ export type Placement = Extract<ADSPopperPlacement, "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end">;
@@ -1,4 +1,4 @@
1
- import React, { type ReactNode } from "react";
1
+ import React, { type ReactNode } from 'react';
2
2
  export interface SpotlightControlsProps {
3
3
  /**
4
4
  * A `testId` prop is provided for specified elements, which is a unique
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export interface SpotlightDismissControlProps {
3
3
  /**
4
4
  * A `testId` prop is provided for specified elements, which is a unique
@@ -0,0 +1,11 @@
1
+ import React, { type ReactNode } from "react";
2
+ import type { Placement } from '../../types';
3
+ /**
4
+ * __PopoverContent__
5
+ *
6
+ * A `PopoverContent` is the element that is shown as a popover.
7
+ */
8
+ export declare const PopoverContent: ({ children, placement }: {
9
+ children: ReactNode;
10
+ placement: Placement;
11
+ }) => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React, { type ReactNode } from "react";
2
+ /**
3
+ * __Popover provider__
4
+ *
5
+ * A popover provider provides necesary context for the `PopoverContent` and `PopoverTarget` components.
6
+ *
7
+ */
8
+ export declare const PopoverProvider: ({ children }: {
9
+ children: ReactNode;
10
+ }) => React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React, { type ReactNode } from "react";
2
+ /**
3
+ * __Target__
4
+ *
5
+ * A target is the element that the popover content will be positioned in relation to.
6
+ */
7
+ export declare const PopoverTarget: ({ children }: {
8
+ children: ReactNode;
9
+ }) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/spotlight",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
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",
@@ -32,7 +32,8 @@
32
32
  "@atlaskit/button": "^23.3.0",
33
33
  "@atlaskit/css": "^0.12.0",
34
34
  "@atlaskit/heading": "^5.2.0",
35
- "@atlaskit/icon": "^27.9.0",
35
+ "@atlaskit/icon": "^27.10.0",
36
+ "@atlaskit/popper": "^7.1.0",
36
37
  "@atlaskit/primitives": "^14.11.0",
37
38
  "@atlaskit/tokens": "^6.0.0",
38
39
  "@babel/runtime": "^7.0.0",