@sequencing/design-system 1.0.30 → 1.0.32

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.
@@ -28,13 +28,17 @@ export interface AppBarProps {
28
28
  isBeta?: boolean;
29
29
  /** Formatted date of the app's last update, it will appear after the text "Last Updated:" */
30
30
  lastUpdated?: string;
31
- /** If provided, will render question mark icon after "Last Updated" content, with provided tooltip content appearing on click */
31
+ /**
32
+ * If provided, will render question mark icon after "Last Updated" content, with provided tooltip content appearing on click
33
+ * TODO: Use Popover https://sequencing.atlassian.net/browse/ENGR-4876
34
+ * */
32
35
  lastUpdatedTooltip?: ReactNode;
33
36
  /** Custom component to render on the right side */
34
37
  rightAddornment?: ReactNode;
35
38
  /**
36
39
  * Component to be displayed when the user clicks on the question mark icon.
37
40
  * If no content is provided, the icon doesn't appear.
41
+ * TODO: Use Popover https://sequencing.atlassian.net/browse/ENGR-4876
38
42
  */
39
43
  tooltipContent?: ReactNode;
40
44
  /** Application's version displayed on the right side of the bar. It's hidden on mobile */
@@ -0,0 +1,48 @@
1
+ import React from "react";
2
+ export interface PopoverContentProps {
3
+ /** Title of the popover */
4
+ title?: string;
5
+ /** Content of the popover */
6
+ children: React.ReactNode;
7
+ }
8
+ /**
9
+ * PopoverContent is a component that is used to display the content of the Popover. Title and content styles are predefined.
10
+ */
11
+ export declare const PopoverContent: (props: PopoverContentProps) => React.JSX.Element;
12
+ export interface PopoverProps {
13
+ /** Css class applied to the Popover for custom styling */
14
+ className?: string;
15
+ /** Element that will trigger the Popover */
16
+ children: React.ReactNode;
17
+ /**
18
+ * If `true`, the Popover will not have a maximum width. Default width and minimal width is 320px.
19
+ */
20
+ noMaxWidth?: boolean;
21
+ /**
22
+ * Content of the Popover. It can be a string or a React component.
23
+ * Please note that by default content has limit of 320px width and base result will be with text.
24
+ * If you want to use a custom content which could be larger please add noMaxWidth prop and control width of yourself.
25
+ * If you want to have our default experiences you could use PopoverContent component.
26
+ */
27
+ title?: React.ReactNode;
28
+ }
29
+ /**
30
+ * The Popover component is used to display content above the current page.
31
+ * It is not ready to be used everywhere, it needs to be improved.
32
+ * Position of the popover will be set automatically based on the position of the child element. By default, below the child.
33
+ * if there will not be enough space to show the popover below the child, it will be shown above the child.
34
+ * If there will not be enough space to show the popover above the child, it will be shown below the child and user
35
+ * must scroll to see the content.
36
+ * X position will be set automatically based on the position of the child element. By default, left.
37
+ * You might have problem with click if you add Popover inside label element.
38
+ *
39
+ * Why Popover not Tooltip? Tooltip is very simple and usually showing only small peas of text.
40
+ * Popover is more complex and could show more content as we do usually.
41
+ *
42
+ * Future improvements:
43
+ * 1. Open on Hover - not implemented
44
+ * 2. Reposition during scroll - not implemented
45
+ * 3. Control from outside - not implemented
46
+ */
47
+ declare const Popover: (props: PopoverProps) => React.JSX.Element;
48
+ export default Popover;
@@ -1,6 +1,8 @@
1
1
  export { default as Modal } from "./Modal/Modal";
2
2
  export { default as AppBar } from "./AppBar/AppBar";
3
3
  export { default as DatePicker } from "./DatePicker/DatePicker";
4
+ export { default as Popover, PopoverContent } from "./Popover/Popover";
4
5
  export type { AppBarProps } from "./AppBar/AppBar";
5
6
  export type { ModalProps } from "./Modal/Modal";
6
7
  export type { DatePickerProps } from "./DatePicker/DatePicker";
8
+ export type { PopoverProps, PopoverContentProps } from "./Popover/Popover";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencing/design-system",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "Sequencing Design System",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\"",