@equinor/echo-components 6.2.1 → 6.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-components",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "dependencies": {
5
5
  "chart.js": "4.5.1",
6
6
  "react-datepicker": "9.1.0",
@@ -8,7 +8,7 @@
8
8
  "react-window": "1.8.11"
9
9
  },
10
10
  "peerDependencies": {
11
- "@equinor/echo-utils": ">= 6.2.1 < 7.0.0",
11
+ "@equinor/echo-utils": ">= 6.2.2 < 7.0.0",
12
12
  "@equinor/eds-core-react": "0.49.0",
13
13
  "@equinor/eds-icons": "0.22.0",
14
14
  "@equinor/eds-tokens": "2.1.0",
@@ -41,6 +41,7 @@ export * from './legendSelector/LegendSelector';
41
41
  export * from './legendSelectorAccordion/LegendSelectorAccordion';
42
42
  export * from './legendSelectorMenu/LegendSelectorMenu';
43
43
  export * from './linkIcon/LinkIcon';
44
+ export * from './linkText/LinkText';
44
45
  export * from './listItem';
45
46
  export * from './listRow/ListRow';
46
47
  export * from './lozenge/LabelledLozenge';
@@ -4,27 +4,27 @@ interface MainLegendProps {
4
4
  /**
5
5
  * Layer legends appearing above the main legend
6
6
  */
7
- legends: React.ReactNode[];
7
+ readonly legends: readonly React.ReactNode[];
8
8
  /**
9
9
  * Layer information
10
10
  */
11
- layers: LayerInfo[];
11
+ readonly layers: readonly LayerInfo[];
12
12
  /**
13
13
  * Styling for the main legend
14
14
  */
15
- legendStyle?: CSSProperties;
15
+ readonly legendStyle?: CSSProperties;
16
16
  /**
17
17
  * Styling for the content of the legend
18
18
  */
19
- legendContentStyle?: CSSProperties;
19
+ readonly legendContentStyle?: CSSProperties;
20
20
  /**
21
21
  * Custom styling for the legend.
22
22
  */
23
- legendClassName?: string;
23
+ readonly legendClassName?: string;
24
24
  /**
25
25
  * Custom styling for the legend content.
26
26
  */
27
- legendContentClassName?: string;
27
+ readonly legendContentClassName?: string;
28
28
  }
29
29
  declare const MainLegend: ({ legends, layers, legendStyle, legendContentStyle, legendContentClassName, legendClassName }: MainLegendProps) => import("react/jsx-runtime").JSX.Element;
30
30
  export { MainLegend };
@@ -0,0 +1,9 @@
1
+ import type { LayerInfo } from '../../types';
2
+ export declare const DEFAULT_MAX_ICONS_ON_LEGEND = 5;
3
+ export declare const DEFAULT_REM_SIZE_PX = 16;
4
+ export declare const LEGEND_ICON_WIDTH_REM = 1.125;
5
+ export declare const LEGEND_ICON_MARGIN_REM = 0.625;
6
+ export declare const LEGEND_ICON_WIDTH_PX = 18;
7
+ export declare const LEGEND_ICON_WIDTH_WITH_MARGIN_REM: number;
8
+ export declare function calculateMaxIconsOnLegend(containerWidthPx: number, remSizePx: number): number;
9
+ export declare function separateLayers(layers: readonly LayerInfo[], maxIconsOnLegend: number): readonly [readonly LayerInfo[], readonly LayerInfo[]];
@@ -0,0 +1,10 @@
1
+ import { RefObject } from 'react';
2
+ interface UseMaxIconsOnLegendConfig {
3
+ readonly iconContainer: RefObject<HTMLDivElement | null>;
4
+ readonly isMobile: boolean;
5
+ }
6
+ interface MaxIconsOnLegendState {
7
+ readonly maxIconsOnLegend: number;
8
+ }
9
+ export declare function useMaxIconsOnLegend({ iconContainer, isMobile }: UseMaxIconsOnLegendConfig): MaxIconsOnLegendState;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import React, { AnchorHTMLAttributes } from 'react';
2
+ type LinkTextProps = {
3
+ label: string;
4
+ } & AnchorHTMLAttributes<HTMLAnchorElement>;
5
+ export declare const LinkText: React.FC<LinkTextProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { FC } from 'react';
2
+ interface OverflowPanelComponentProps {
3
+ readonly component: FC<Record<string, unknown>>;
4
+ }
5
+ export declare const OverflowPanelComponent: FC<OverflowPanelComponentProps>;
6
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { Dispatch, SetStateAction } from 'react';
2
+ import type { MenuItem } from '../../../types/menuItem';
3
+ export declare function areMenuItemsEqual(firstMenuItems: readonly MenuItem[], secondMenuItems: readonly MenuItem[]): boolean;
4
+ export declare function setMenuItemsWhenChanged(setMenuItems: Dispatch<SetStateAction<MenuItem[]>>, nextMenuItems: MenuItem[]): void;