@linzjs/lui 17.15.1 → 17.16.1

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 (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -1
  3. package/dist/components/LuiBearingInput/LuiBearingInput.d.ts +2 -2
  4. package/dist/components/LuiErrorPage/LuiErrorPage.d.ts +2 -2
  5. package/dist/components/LuiExpandableBanner/LuiExpandableBanner.d.ts +1 -1
  6. package/dist/components/LuiFooter/LuiFooter.d.ts +1 -1
  7. package/dist/components/LuiFormikForms/LuiFormikFormLabel/LuiFormikFormLabel.d.ts +2 -2
  8. package/dist/components/LuiFormikForms/LuiFormikRadioButton/LuiFormikRadioButton.d.ts +2 -2
  9. package/dist/components/LuiFormikForms/LuiFormikRadioGroup/LuiFormikRadioGroup.d.ts +2 -2
  10. package/dist/components/LuiForms/LuiFormSection/LuiHelpInfo/LuiHelpInfo.d.ts +1 -1
  11. package/dist/components/LuiHeader/LuiHeader.d.ts +3 -3
  12. package/dist/components/LuiHeaderMenu/LuiHeaderMenus.d.ts +4 -4
  13. package/dist/components/LuiLoadingSpinner/LuiLoadingSpinner.d.ts +1 -1
  14. package/dist/components/LuiModal/LuiModal.d.ts +5 -5
  15. package/dist/components/LuiSearchInput/LuiSearchInput.d.ts +1 -1
  16. package/dist/components/LuiSearchInput/ResultsDisplay.d.ts +1 -1
  17. package/dist/components/LuiSidePanel/LuiSidePanel.d.ts +4 -3
  18. package/dist/components/LuiTabs/LuiTab/LuiTab.d.ts +1 -1
  19. package/dist/components/LuiTabs/LuiTabs.d.ts +2 -2
  20. package/dist/components/LuiTabs/LuiTabsGroup/LuiTabsGroup.d.ts +2 -2
  21. package/dist/components/LuiTabs/LuiTabsPanel/LuiTabsPanel.d.ts +1 -1
  22. package/dist/components/LuiTabs/LuiTabsPanelSwitch/LuiTabsPanelSwitch.d.ts +1 -1
  23. package/dist/components/LuiToastMessage/LuiToastMessage.d.ts +1 -1
  24. package/dist/components/LuiTooltip/LuiTooltip.d.ts +3 -1
  25. package/dist/components/LuiUpdateSplashModal/LuiUpdatesSplashModal.d.ts +2 -2
  26. package/dist/components/lol/LOLDrawerMenuFirmSwitcher.d.ts +1 -1
  27. package/dist/components/lol/LOLFirmSwitcher.d.ts +3 -3
  28. package/dist/components/lol/LOLUserLastLogin.d.ts +1 -1
  29. package/dist/contexts/LuiMessagingContextProvider.d.ts +1 -1
  30. package/dist/index.js +194 -15
  31. package/dist/index.js.map +1 -1
  32. package/dist/lui.css +24 -51
  33. package/dist/lui.css.map +1 -1
  34. package/dist/lui.esm.js +194 -15
  35. package/dist/lui.esm.js.map +1 -1
  36. package/dist/scss/Elements/Forms/FormComponents/Inputs.scss +1 -0
  37. package/dist/scss/Elements/Tooltips/tippy.scss +21 -70
  38. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [17.16.1](https://github.com/linz/lui/compare/v17.16.0...v17.16.1) (2022-10-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **Chromatic:** Increasing diff threshold to prevent false positives on the tooltip stories ([#774](https://github.com/linz/lui/issues/774)) ([771e180](https://github.com/linz/lui/commit/771e180933808be07f4547f0eb6db54bc51e4abb))
7
+
8
+ # [17.16.0](https://github.com/linz/lui/compare/v17.15.1...v17.16.0) (2022-09-29)
9
+
10
+
11
+ ### Features
12
+
13
+ * update the tooltip UX and add the following cursor support ([#772](https://github.com/linz/lui/issues/772)) ([9a812de](https://github.com/linz/lui/commit/9a812de282e2c9266ae9d75be0d4bfbe0ac69870))
14
+
1
15
  ## [17.15.1](https://github.com/linz/lui/compare/v17.15.0...v17.15.1) (2022-09-22)
2
16
 
3
17
  # [17.15.0](https://github.com/linz/lui/compare/v17.14.1...v17.15.0) (2022-09-20)
package/README.md CHANGED
@@ -45,7 +45,7 @@ over the CSS is part of this project.
45
45
  There is lots to do in this project, often things will be left until there is demand. Please join the Slack channel
46
46
  #cop-lui.
47
47
 
48
- ## Documentation
48
+ ## Documentation
49
49
 
50
50
  Storybook is the main source of documentation.
51
51
 
@@ -12,12 +12,12 @@ interface LuiBearingInputProps {
12
12
  /** If true, validationError prop takes precedence over the internalError value. */
13
13
  preferValidationError?: boolean;
14
14
  }
15
- export declare const LuiBearingInput: React.FC<LuiBearingInputProps & LuiCommonInputProps>;
15
+ export declare const LuiBearingInput: React.FC<React.PropsWithChildren<LuiBearingInputProps & LuiCommonInputProps>>;
16
16
  interface LuiBearingFormikInputProps {
17
17
  name: string;
18
18
  label: string;
19
19
  /** If true, validationError prop takes precedence over the LuiBearingInput internalError value. */
20
20
  preferValidationError?: boolean;
21
21
  }
22
- export declare const LuiBearingFormikInput: React.FC<LuiBearingFormikInputProps & LuiCommonInputProps>;
22
+ export declare const LuiBearingFormikInput: React.FC<React.PropsWithChildren<LuiBearingFormikInputProps & LuiCommonInputProps>>;
23
23
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- export declare const LuiErrorPage: React.FC<{
2
+ export declare const LuiErrorPage: React.FC<React.PropsWithChildren<{
3
3
  header?: React.ReactElement;
4
4
  footer?: React.ReactElement;
5
5
  content?: React.ReactElement;
6
- }>;
6
+ }>>;
@@ -4,4 +4,4 @@ export interface Expandable {
4
4
  label: ReactNode;
5
5
  labelPrefix?: ReactNode;
6
6
  }
7
- export declare const LuiExpandableBanner: React.FC<Expandable>;
7
+ export declare const LuiExpandableBanner: React.FC<React.PropsWithChildren<Expandable>>;
@@ -6,5 +6,5 @@ interface FooterProps {
6
6
  contactEmail?: string;
7
7
  feedbackFormUrl?: string;
8
8
  }
9
- export declare const LuiFooter: React.FC<FooterProps>;
9
+ export declare const LuiFooter: React.FC<React.PropsWithChildren<FooterProps>>;
10
10
  export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- export declare const LuiFormikFormLabel: React.FC<{
2
+ export declare const LuiFormikFormLabel: React.FC<React.PropsWithChildren<{
3
3
  for: string;
4
4
  label: string;
5
5
  className?: string;
6
6
  required?: boolean;
7
7
  tooltip?: string;
8
- }>;
8
+ }>>;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { LuiCommonInputProps } from '../LuiFormikForm';
3
- export declare const LuiFormikRadioButton: React.FC<{
3
+ export declare const LuiFormikRadioButton: React.FC<React.PropsWithChildren<{
4
4
  label: string;
5
5
  className?: string;
6
6
  value: string;
7
7
  name: string;
8
- } & LuiCommonInputProps>;
8
+ } & LuiCommonInputProps>>;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- export declare const LuiFormikRadioGroup: React.FC<{
2
+ export declare const LuiFormikRadioGroup: React.FC<React.PropsWithChildren<{
3
3
  hint?: string;
4
4
  legend: string;
5
5
  name: string;
6
6
  required?: boolean;
7
- }>;
7
+ }>>;
@@ -2,5 +2,5 @@ import React, { ReactNode } from 'react';
2
2
  interface IHelpInfoProps {
3
3
  info: string | ReactNode;
4
4
  }
5
- export declare const HelpInfo: React.FC<IHelpInfoProps>;
5
+ export declare const HelpInfo: React.FC<React.PropsWithChildren<IHelpInfoProps>>;
6
6
  export {};
@@ -9,7 +9,7 @@ interface HeaderProps {
9
9
  transparent?: boolean;
10
10
  sticky?: boolean;
11
11
  }
12
- declare const LuiHeader: React.FC<HeaderProps>;
12
+ declare const LuiHeader: React.FC<React.PropsWithChildren<HeaderProps>>;
13
13
  interface ILuiIcon {
14
14
  /**
15
15
  * The material-ui icon name (see https://material.io/resources/icons/?search=account_c&style=round)
@@ -56,9 +56,9 @@ interface ILuiCloseableHeaderMenuItem extends Omit<ILuiHeaderMenuItem, 'onClick'
56
56
  open: boolean;
57
57
  setOpen: (value: boolean) => void;
58
58
  }
59
- declare const LuiCloseableHeaderMenuItem: React.FC<ILuiCloseableHeaderMenuItem>;
59
+ declare const LuiCloseableHeaderMenuItem: React.FC<React.PropsWithChildren<ILuiCloseableHeaderMenuItem>>;
60
60
  interface ILuiMenuCloseButton extends ILuiIcon {
61
61
  'data-testid'?: string;
62
62
  }
63
- declare const LuiMenuCloseButton: React.FC<ILuiMenuCloseButton>;
63
+ declare const LuiMenuCloseButton: React.FC<React.PropsWithChildren<ILuiMenuCloseButton>>;
64
64
  export { HeaderSize, HeaderProps, LuiHeader, ILuiIcon, ILuiHeaderMenuItem, LuiHeaderMenuItem, ILuiMenuCloseButton, LuiMenuCloseButton, ILuiCloseableHeaderMenuItem, LuiCloseableHeaderMenuItem, LuiCloseableHeaderMenuContext, };
@@ -18,14 +18,14 @@ interface ILuiDrawerMenuOption {
18
18
  */
19
19
  onClick?: () => void;
20
20
  }
21
- declare const LuiDrawerMenuOptions: React.FC<ILuiIcon>;
22
- declare const LuiDrawerMenuOption: React.FC<ILuiDrawerMenuOption>;
21
+ declare const LuiDrawerMenuOptions: React.FC<React.PropsWithChildren<ILuiIcon>>;
22
+ declare const LuiDrawerMenuOption: React.FC<React.PropsWithChildren<ILuiDrawerMenuOption>>;
23
23
  declare type ILuiDrawerMenu = Omit<ILuiHeaderMenuItem, 'onClick'> & {
24
24
  hasStickyHeader?: boolean;
25
25
  };
26
- declare const LuiDrawerMenu: React.FC<ILuiDrawerMenu>;
26
+ declare const LuiDrawerMenu: React.FC<React.PropsWithChildren<ILuiDrawerMenu>>;
27
27
  declare type ILuiDropdownMenu = Omit<ILuiHeaderMenuItem, 'onClick'>;
28
- declare const LuiDropdownMenu: React.FC<ILuiDropdownMenu>;
28
+ declare const LuiDropdownMenu: React.FC<React.PropsWithChildren<ILuiDropdownMenu>>;
29
29
  interface ILuiDrawerMenuSection {
30
30
  /**
31
31
  * Optional tile, displays a header if set
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  /**
3
3
  * A LuiSpinner with a status message beneath it.
4
4
  */
5
- export declare const LuiStatusSpinner: React.FC;
5
+ export declare const LuiStatusSpinner: React.FC<React.PropsWithChildren<unknown>>;
6
6
  interface LuiMiniSpinnerProps {
7
7
  size: number;
8
8
  divProps?: any;
@@ -9,14 +9,14 @@ interface ILuiModal {
9
9
  lowContrast?: boolean;
10
10
  appendToElement?: () => HTMLElement;
11
11
  }
12
- export declare const LuiModal: React.FC<ILuiModal>;
13
- export declare const LuiAlertModal: React.FC<{
12
+ export declare const LuiModal: React.FC<React.PropsWithChildren<ILuiModal>>;
13
+ export declare const LuiAlertModal: React.FC<React.PropsWithChildren<{
14
14
  level: 'success' | 'info' | 'warning' | 'error';
15
- } & ILuiModal>;
16
- export declare const LuiAlertModalButtons: React.FC;
15
+ } & ILuiModal>>;
16
+ export declare const LuiAlertModalButtons: React.FC<React.PropsWithChildren<unknown>>;
17
17
  interface IModalHeader {
18
18
  headingText?: string;
19
19
  onClose?: () => void;
20
20
  }
21
- export declare const LuiModalHeader: React.FC<IModalHeader>;
21
+ export declare const LuiModalHeader: React.FC<React.PropsWithChildren<IModalHeader>>;
22
22
  export {};
@@ -23,4 +23,4 @@ export interface ISearchInputProps {
23
23
  focusUpdate?: boolean;
24
24
  }
25
25
  export declare function isGroupedResult(result: ISearchResult[] | ISearchGroupedResult[]): result is ISearchGroupedResult[];
26
- export declare const LuiSearchInput: React.FC<ISearchInputProps>;
26
+ export declare const LuiSearchInput: React.FC<React.PropsWithChildren<ISearchInputProps>>;
@@ -9,5 +9,5 @@ export interface IResultsProps {
9
9
  results: ISearchResult[] | ISearchGroupedResult[];
10
10
  selectedRef: RefObject<HTMLDivElement>;
11
11
  }
12
- declare const ResultsDisplay: React.FC<IResultsProps>;
12
+ declare const ResultsDisplay: React.FC<React.PropsWithChildren<IResultsProps>>;
13
13
  export default ResultsDisplay;
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- export declare const LuiSidePanel: React.FC<{
2
+ export declare const LuiSidePanel: React.FC<React.PropsWithChildren<{
3
3
  onClose: () => void;
4
4
  width?: string;
5
+ closeBtnTitleAttr?: string;
5
6
  top?: number;
6
- }>;
7
- export declare const LuiSidePanelProvider: React.FC;
7
+ }>>;
8
+ export declare const LuiSidePanelProvider: React.FC<React.PropsWithChildren<unknown>>;
@@ -7,5 +7,5 @@ interface LuiTabProps {
7
7
  titleAttribute?: string;
8
8
  children: React.ReactNode;
9
9
  }
10
- export declare const LuiTab: React.FC<LuiTabProps>;
10
+ export declare const LuiTab: React.FC<React.PropsWithChildren<LuiTabProps>>;
11
11
  export {};
@@ -4,7 +4,7 @@ interface ILuiTabsContext {
4
4
  setActivePanel: (activePanel: string) => void;
5
5
  }
6
6
  export declare const LuiTabsContext: React.Context<ILuiTabsContext>;
7
- export declare const LuiTabs: React.FC<{
7
+ export declare const LuiTabs: React.FC<React.PropsWithChildren<{
8
8
  defaultPanel: string;
9
- }>;
9
+ }>>;
10
10
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare const LuiTabsGroup: React.FC<{
2
+ export declare const LuiTabsGroup: React.FC<React.PropsWithChildren<{
3
3
  ariaLabel: string;
4
4
  justify?: boolean;
5
- }>;
5
+ }>>;
@@ -4,5 +4,5 @@ interface LuiTabsPanelProps {
4
4
  panel: string;
5
5
  mode?: LuiTabsPanelMode;
6
6
  }
7
- export declare const LuiTabsPanel: React.FC<LuiTabsPanelProps>;
7
+ export declare const LuiTabsPanel: React.FC<React.PropsWithChildren<LuiTabsPanelProps>>;
8
8
  export {};
@@ -3,5 +3,5 @@ interface LuiTabsPanelSwitch {
3
3
  targetPanel: string;
4
4
  setActivePanel?: (targetPanel: string) => {};
5
5
  }
6
- export declare const LuiTabsPanelSwitch: React.FC<LuiTabsPanelSwitch>;
6
+ export declare const LuiTabsPanelSwitch: React.FC<React.PropsWithChildren<LuiTabsPanelSwitch>>;
7
7
  export {};
@@ -14,5 +14,5 @@ interface ILuiToastMessageProps {
14
14
  children?: React.ReactNode;
15
15
  type?: 'button' | 'submit' | 'reset';
16
16
  }
17
- export declare const LuiToastMessage: React.FC<ILuiToastMessageProps>;
17
+ export declare const LuiToastMessage: React.FC<React.PropsWithChildren<ILuiToastMessageProps>>;
18
18
  export {};
@@ -1,12 +1,14 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Placement } from 'tippy.js';
3
- import 'tippy.js/dist/tippy.css';
4
3
  import 'tippy.js/dist/border.css';
4
+ import 'tippy.js/dist/tippy.css';
5
5
  export interface ILuiTooltipProperties {
6
6
  message: string;
7
7
  placement?: Placement;
8
8
  trigger?: string;
9
9
  children: ReactNode;
10
10
  animation?: boolean;
11
+ followCursor?: boolean;
12
+ mode?: 'default' | 'info' | 'error';
11
13
  }
12
14
  export declare const LuiTooltip: (props: ILuiTooltipProperties) => JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- export declare const LuiUpdatesSplashModal: React.FC<{
2
+ export declare const LuiUpdatesSplashModal: React.FC<React.PropsWithChildren<{
3
3
  bigImage: string;
4
4
  smallImage: string;
5
5
  header: string;
6
6
  wrapperClass: string;
7
7
  onClose: () => void;
8
8
  id: string;
9
- }>;
9
+ }>>;
@@ -5,4 +5,4 @@ export interface ILOLDrawerMenuFirmSwitcherProperties {
5
5
  /**
6
6
  * Deprecated: this is LandOnline specific and has been moved to https://github.com/linz/landonline-common-js
7
7
  */
8
- export declare const LOLDrawerMenuFirmSwitcher: React.FC<ILOLDrawerMenuFirmSwitcherProperties>;
8
+ export declare const LOLDrawerMenuFirmSwitcher: React.FC<React.PropsWithChildren<ILOLDrawerMenuFirmSwitcherProperties>>;
@@ -7,7 +7,7 @@ export declare type ILOLFirmSwitcherMenu = Omit<ILuiDropdownMenu, 'icon' | 'labe
7
7
  /**
8
8
  * Deprecated: this is LandOnline specific and has been moved to https://github.com/linz/landonline-common-js
9
9
  */
10
- export declare const LOLFirmSwitcherMenu: React.FC<ILOLFirmSwitcherMenu>;
10
+ export declare const LOLFirmSwitcherMenu: React.FC<React.PropsWithChildren<ILOLFirmSwitcherMenu>>;
11
11
  interface ILOLFirmSwitcherMenuContent {
12
12
  firms: IFirm[];
13
13
  selectedFirm: IFirm | undefined;
@@ -15,12 +15,12 @@ interface ILOLFirmSwitcherMenuContent {
15
15
  collapsible?: boolean;
16
16
  minimumFilterCount?: number;
17
17
  }
18
- export declare const LOLFirmSwitcherMenuContent: React.FC<ILOLFirmSwitcherMenuContent>;
18
+ export declare const LOLFirmSwitcherMenuContent: React.FC<React.PropsWithChildren<ILOLFirmSwitcherMenuContent>>;
19
19
  interface IFirmOption {
20
20
  value: IFirm;
21
21
  selected: boolean;
22
22
  onSelect: (optionId: string) => void;
23
23
  disabled: boolean;
24
24
  }
25
- export declare const FirmOption: React.FC<IFirmOption>;
25
+ export declare const FirmOption: React.FC<React.PropsWithChildren<IFirmOption>>;
26
26
  export {};
@@ -2,4 +2,4 @@ import React from 'react';
2
2
  /**
3
3
  * Deprecated: this is LandOnline specific and has been moved to https://github.com/linz/landonline-common-js
4
4
  */
5
- export declare const LOLUserLastLogin: React.FC;
5
+ export declare const LOLUserLastLogin: React.FC<React.PropsWithChildren<unknown>>;
@@ -11,4 +11,4 @@ export interface ShowMessageProps {
11
11
  messageLevel: MessageLevel;
12
12
  requireDismiss?: boolean;
13
13
  }
14
- export declare const LuiMessagingContextProvider: React.FC;
14
+ export declare const LuiMessagingContextProvider: React.FC<React.PropsWithChildren<unknown>>;
package/dist/index.js CHANGED
@@ -25426,7 +25426,7 @@ var LuiMenuCloseButton = function (_a) {
25426
25426
 
25427
25427
  var LuiDrawerMenuOptions = function (_a) {
25428
25428
  var children = _a.children;
25429
- return (React__default["default"].createElement("div", { className: "lui-menu-drawer-options" }, children));
25429
+ return React__default["default"].createElement("div", { className: "lui-menu-drawer-options" }, children);
25430
25430
  };
25431
25431
  var LuiDrawerMenuOption = function (_a) {
25432
25432
  var icon = _a.icon, label = _a.label, badge = _a.badge, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b;
@@ -32830,20 +32830,198 @@ Object.assign({}, applyStyles$1, {
32830
32830
  }
32831
32831
  });
32832
32832
 
32833
+ var mouseCoords = {
32834
+ clientX: 0,
32835
+ clientY: 0
32836
+ };
32837
+ var activeInstances = [];
32838
+
32839
+ function storeMouseCoords(_ref) {
32840
+ var clientX = _ref.clientX,
32841
+ clientY = _ref.clientY;
32842
+ mouseCoords = {
32843
+ clientX: clientX,
32844
+ clientY: clientY
32845
+ };
32846
+ }
32847
+
32848
+ function addMouseCoordsListener(doc) {
32849
+ doc.addEventListener('mousemove', storeMouseCoords);
32850
+ }
32851
+
32852
+ function removeMouseCoordsListener(doc) {
32853
+ doc.removeEventListener('mousemove', storeMouseCoords);
32854
+ }
32855
+
32856
+ var followCursor = {
32857
+ name: 'followCursor',
32858
+ defaultValue: false,
32859
+ fn: function fn(instance) {
32860
+ var reference = instance.reference;
32861
+ var doc = getOwnerDocument(instance.props.triggerTarget || reference);
32862
+ var isInternalUpdate = false;
32863
+ var wasFocusEvent = false;
32864
+ var isUnmounted = true;
32865
+ var prevProps = instance.props;
32866
+
32867
+ function getIsInitialBehavior() {
32868
+ return instance.props.followCursor === 'initial' && instance.state.isVisible;
32869
+ }
32870
+
32871
+ function addListener() {
32872
+ doc.addEventListener('mousemove', onMouseMove);
32873
+ }
32874
+
32875
+ function removeListener() {
32876
+ doc.removeEventListener('mousemove', onMouseMove);
32877
+ }
32878
+
32879
+ function unsetGetReferenceClientRect() {
32880
+ isInternalUpdate = true;
32881
+ instance.setProps({
32882
+ getReferenceClientRect: null
32883
+ });
32884
+ isInternalUpdate = false;
32885
+ }
32886
+
32887
+ function onMouseMove(event) {
32888
+ // If the instance is interactive, avoid updating the position unless it's
32889
+ // over the reference element
32890
+ var isCursorOverReference = event.target ? reference.contains(event.target) : true;
32891
+ var followCursor = instance.props.followCursor;
32892
+ var clientX = event.clientX,
32893
+ clientY = event.clientY;
32894
+ var rect = reference.getBoundingClientRect();
32895
+ var relativeX = clientX - rect.left;
32896
+ var relativeY = clientY - rect.top;
32897
+
32898
+ if (isCursorOverReference || !instance.props.interactive) {
32899
+ instance.setProps({
32900
+ // @ts-ignore - unneeded DOMRect properties
32901
+ getReferenceClientRect: function getReferenceClientRect() {
32902
+ var rect = reference.getBoundingClientRect();
32903
+ var x = clientX;
32904
+ var y = clientY;
32905
+
32906
+ if (followCursor === 'initial') {
32907
+ x = rect.left + relativeX;
32908
+ y = rect.top + relativeY;
32909
+ }
32910
+
32911
+ var top = followCursor === 'horizontal' ? rect.top : y;
32912
+ var right = followCursor === 'vertical' ? rect.right : x;
32913
+ var bottom = followCursor === 'horizontal' ? rect.bottom : y;
32914
+ var left = followCursor === 'vertical' ? rect.left : x;
32915
+ return {
32916
+ width: right - left,
32917
+ height: bottom - top,
32918
+ top: top,
32919
+ right: right,
32920
+ bottom: bottom,
32921
+ left: left
32922
+ };
32923
+ }
32924
+ });
32925
+ }
32926
+ }
32927
+
32928
+ function create() {
32929
+ if (instance.props.followCursor) {
32930
+ activeInstances.push({
32931
+ instance: instance,
32932
+ doc: doc
32933
+ });
32934
+ addMouseCoordsListener(doc);
32935
+ }
32936
+ }
32937
+
32938
+ function destroy() {
32939
+ activeInstances = activeInstances.filter(function (data) {
32940
+ return data.instance !== instance;
32941
+ });
32942
+
32943
+ if (activeInstances.filter(function (data) {
32944
+ return data.doc === doc;
32945
+ }).length === 0) {
32946
+ removeMouseCoordsListener(doc);
32947
+ }
32948
+ }
32949
+
32950
+ return {
32951
+ onCreate: create,
32952
+ onDestroy: destroy,
32953
+ onBeforeUpdate: function onBeforeUpdate() {
32954
+ prevProps = instance.props;
32955
+ },
32956
+ onAfterUpdate: function onAfterUpdate(_, _ref2) {
32957
+ var followCursor = _ref2.followCursor;
32958
+
32959
+ if (isInternalUpdate) {
32960
+ return;
32961
+ }
32962
+
32963
+ if (followCursor !== undefined && prevProps.followCursor !== followCursor) {
32964
+ destroy();
32965
+
32966
+ if (followCursor) {
32967
+ create();
32968
+
32969
+ if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) {
32970
+ addListener();
32971
+ }
32972
+ } else {
32973
+ removeListener();
32974
+ unsetGetReferenceClientRect();
32975
+ }
32976
+ }
32977
+ },
32978
+ onMount: function onMount() {
32979
+ if (instance.props.followCursor && !wasFocusEvent) {
32980
+ if (isUnmounted) {
32981
+ onMouseMove(mouseCoords);
32982
+ isUnmounted = false;
32983
+ }
32984
+
32985
+ if (!getIsInitialBehavior()) {
32986
+ addListener();
32987
+ }
32988
+ }
32989
+ },
32990
+ onTrigger: function onTrigger(_, event) {
32991
+ if (isMouseEvent$1(event)) {
32992
+ mouseCoords = {
32993
+ clientX: event.clientX,
32994
+ clientY: event.clientY
32995
+ };
32996
+ }
32997
+
32998
+ wasFocusEvent = event.type === 'focus';
32999
+ },
33000
+ onHidden: function onHidden() {
33001
+ if (instance.props.followCursor) {
33002
+ unsetGetReferenceClientRect();
33003
+ removeListener();
33004
+ isUnmounted = true;
33005
+ }
33006
+ }
33007
+ };
33008
+ }
33009
+ };
33010
+
32833
33011
  tippy.setDefaultProps({
32834
33012
  render: render
32835
33013
  });
32836
33014
 
32837
- var css_248z$5 = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
33015
+ var css_248z$5 = ".tippy-box{border:1px transparent}.tippy-box[data-placement^=top]>.tippy-arrow:after{border-top-color:inherit;border-width:8px 8px 0;bottom:-8px;left:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:inherit;border-width:0 8px 8px;top:-8px;left:0}.tippy-box[data-placement^=left]>.tippy-arrow:after{border-left-color:inherit;border-width:8px 0 8px 8px;right:-8px;top:0}.tippy-box[data-placement^=right]>.tippy-arrow:after{border-width:8px 8px 8px 0;left:-8px;top:0;border-right-color:inherit}.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg:first-child:not(:last-child){top:17px}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg:first-child:not(:last-child){bottom:17px}.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg:first-child:not(:last-child){left:12px}.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg:first-child:not(:last-child){right:12px}.tippy-arrow{border-color:inherit}.tippy-arrow:after{content:\"\";z-index:-1;position:absolute;border-color:transparent;border-style:solid}";
32838
33016
  styleInject(css_248z$5);
32839
33017
 
32840
- var css_248z$4 = ".tippy-box{border:1px transparent}.tippy-box[data-placement^=top]>.tippy-arrow:after{border-top-color:inherit;border-width:8px 8px 0;bottom:-8px;left:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:inherit;border-width:0 8px 8px;top:-8px;left:0}.tippy-box[data-placement^=left]>.tippy-arrow:after{border-left-color:inherit;border-width:8px 0 8px 8px;right:-8px;top:0}.tippy-box[data-placement^=right]>.tippy-arrow:after{border-width:8px 8px 8px 0;left:-8px;top:0;border-right-color:inherit}.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg:first-child:not(:last-child){top:17px}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg:first-child:not(:last-child){bottom:17px}.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg:first-child:not(:last-child){left:12px}.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg:first-child:not(:last-child){right:12px}.tippy-arrow{border-color:inherit}.tippy-arrow:after{content:\"\";z-index:-1;position:absolute;border-color:transparent;border-style:solid}";
33018
+ var css_248z$4 = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
32841
33019
  styleInject(css_248z$4);
32842
33020
 
32843
33021
  var id = 0;
32844
33022
  var getKey = function () { return id++; };
32845
33023
  var LuiTooltip = function (props) {
32846
- var children = props.children, message = props.message, placement = props.placement, trigger = props.trigger, _a = props.animation, animation = _a === void 0 ? true : _a;
33024
+ var children = props.children, message = props.message, placement = props.placement, trigger = props.trigger, _a = props.animation, animation = _a === void 0 ? true : _a, _b = props.followCursor, followCursor$1 = _b === void 0 ? false : _b, _c = props.mode, mode = _c === void 0 ? 'default' : _c;
32847
33025
  var id = "LuiToolTip_".concat(React.useMemo(getKey, []));
32848
33026
  if (typeof message !== 'string') {
32849
33027
  throw new Error('LuiTooltip message must be a string!');
@@ -32851,18 +33029,20 @@ var LuiTooltip = function (props) {
32851
33029
  React.useEffect(function () {
32852
33030
  tippy("#".concat(id), {
32853
33031
  content: message,
32854
- arrow: true,
33032
+ arrow: false,
32855
33033
  trigger: trigger,
32856
- theme: 'LUI',
33034
+ theme: mode,
32857
33035
  placement: placement,
32858
- offset: [0, 24],
32859
- animation: animation
33036
+ offset: [0, 18],
33037
+ animation: animation,
33038
+ followCursor: followCursor$1,
33039
+ plugins: [followCursor]
32860
33040
  });
32861
33041
  return function () {
32862
33042
  var _a, _b;
32863
33043
  (_b = (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a._tippy) === null || _b === void 0 ? void 0 : _b.destroy();
32864
33044
  };
32865
- }, [id, message, placement, trigger, animation]);
33045
+ }, [id, message, placement, trigger, animation, followCursor$1]);
32866
33046
  return React__default["default"].createElement("span", { id: id }, children);
32867
33047
  };
32868
33048
 
@@ -32897,20 +33077,19 @@ function useClickedOutsideElement(refElement, handleClickOutside) {
32897
33077
  var LuiBadge = function (props) { return (React__default["default"].createElement("p", { className: clsx('LuiBadge', props.size === 'sm' && 'LuiBadge--sm', props.size === 'lg' && 'LuiBadge--lg', props.backgroundFill && 'LuiBadge--fill', props.variation === 'warning' && 'LuiBadge--warning'), "aria-roledescription": props.ariaRoleDescription }, props.children)); };
32898
33078
 
32899
33079
  var LuiSidePanelContext = React__default["default"].createContext({ setProps: function () { return undefined; } });
32900
- /* eslint-disable react/prop-types */
32901
33080
  var LuiSidePanel = function (_a) {
32902
- var children = _a.children, onClose = _a.onClose, width = _a.width, top = _a.top;
33081
+ var children = _a.children, onClose = _a.onClose, width = _a.width, top = _a.top, closeBtnTitleAttr = _a.closeBtnTitleAttr;
32903
33082
  var setProps = React__default["default"].useContext(LuiSidePanelContext).setProps;
32904
33083
  React__default["default"].useEffect(function () {
32905
- setProps({ children: children, onClose: onClose, width: width, top: top });
33084
+ setProps({ children: children, onClose: onClose, width: width, top: top, closeBtnTitleAttr: closeBtnTitleAttr });
32906
33085
  return function () {
32907
33086
  setProps(undefined);
32908
33087
  };
32909
- }, [setProps, children, onClose, width, top]);
33088
+ }, [setProps, children, onClose, width, top, closeBtnTitleAttr]);
32910
33089
  return React__default["default"].createElement(React__default["default"].Fragment, null);
32911
33090
  };
32912
33091
  var LuiSidePanelContainer = function (props) {
32913
- var _a = props !== null && props !== void 0 ? props : {}, children = _a.children, onClose = _a.onClose, _b = _a.width, width = _b === void 0 ? '50%' : _b, _c = _a.top, top = _c === void 0 ? 60 : _c;
33092
+ var _a = props !== null && props !== void 0 ? props : {}, children = _a.children, onClose = _a.onClose, _b = _a.width, width = _b === void 0 ? '50%' : _b, _c = _a.top, top = _c === void 0 ? 60 : _c, _d = _a.closeBtnTitleAttr, closeBtnTitleAttr = _d === void 0 ? 'Close panel' : _d;
32914
33093
  return (React__default["default"].createElement("section", { style: {
32915
33094
  position: 'fixed',
32916
33095
  right: 0,
@@ -32923,7 +33102,7 @@ var LuiSidePanelContainer = function (props) {
32923
33102
  padding: 0,
32924
33103
  zIndex: 3
32925
33104
  } },
32926
- children && (React__default["default"].createElement("button", { type: "button", "data-testid": "close", onClick: onClose, style: {
33105
+ children && (React__default["default"].createElement("button", { type: "button", "data-testid": "close", title: closeBtnTitleAttr, onClick: onClose, style: {
32927
33106
  color: '#5e5e61',
32928
33107
  position: 'absolute',
32929
33108
  right: 15,