@equinor/echo-components 0.7.9 → 0.7.11

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 (31) hide show
  1. package/dist/components/blackLink/BlackLink.d.ts +3 -2
  2. package/dist/components/charts/index.d.ts +1 -0
  3. package/dist/components/charts/lineChart/LineChart.d.ts +21 -0
  4. package/dist/components/charts/lineChart/dummy/lineChartConfig.d.ts +16 -0
  5. package/dist/components/charts/lineChart/dummy/rawData.d.ts +26 -0
  6. package/dist/components/charts/lineChart/utils.d.ts +10 -0
  7. package/dist/components/copyToClipboard/CopyToClipboard.d.ts +3 -0
  8. package/dist/components/echoTooltip/Tooltip/Tooltip.d.ts +1 -1
  9. package/dist/components/echoTooltip/Tooltip/useTooltip.d.ts +38 -26
  10. package/dist/components/floatingActionButton/FloatingActionButton.d.ts +1 -1
  11. package/dist/components/floatingSearchBar/FloatingSearchBar.d.ts +2 -2
  12. package/dist/components/index.d.ts +1 -0
  13. package/dist/components/legend/MainLegend.d.ts +11 -3
  14. package/dist/components/legend/layerLegend/LayerLegend.d.ts +6 -2
  15. package/dist/components/listItem/ListItem.d.ts +3 -1
  16. package/dist/components/listRow/ListRow.d.ts +1 -1
  17. package/dist/components/sidesheet/sheet/Sheet.d.ts +1 -1
  18. package/dist/components/splitView/SplitView.d.ts +2 -2
  19. package/dist/components/splitView/left/SplitViewLeft.d.ts +1 -1
  20. package/dist/components/workOrderListItem/WorkOrderListItem.d.ts +2 -2
  21. package/dist/components/workOrderListItem/WorkOrderStatusLabel.d.ts +2 -2
  22. package/dist/hooks/useKeyboardNavigation.d.ts +5 -8
  23. package/dist/icons/echoAssets/external.d.ts +2 -0
  24. package/dist/icons/echoAssets/index.d.ts +2 -0
  25. package/dist/icons/echoAssets/maps.d.ts +6 -0
  26. package/dist/icons/echoAssets/misc.d.ts +2 -0
  27. package/dist/index.js +38092 -23026
  28. package/dist/index.js.map +1 -1
  29. package/dist/setupTests.d.ts +1 -1
  30. package/dist/types/charts.d.ts +77 -0
  31. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  interface LinkProps {
3
+ className?: string;
3
4
  /** The external link. */
4
5
  href: string;
5
6
  /** The link label. */
@@ -7,5 +8,5 @@ interface LinkProps {
7
8
  /** If true, the link is opened in the same window or tab. */
8
9
  preserveTab?: boolean;
9
10
  }
10
- declare const BlackLink: ({ href, linkText, preserveTab }: LinkProps) => JSX.Element;
11
+ declare const BlackLink: ({ className, href, linkText, preserveTab }: LinkProps) => React.JSX.Element;
11
12
  export { BlackLink };
@@ -0,0 +1 @@
1
+ export { LineChart } from './lineChart/LineChart';
@@ -0,0 +1,21 @@
1
+ /// <reference types="chart.js" />
2
+ import Chart, { ChartData, Defaults } from 'chart.js/auto';
3
+ import React from 'react';
4
+ import { ChartCallbacks, LineChartConfig } from '../../../types/charts';
5
+ interface Props {
6
+ initialSize: Chart.ChartSize;
7
+ chartDataSet?: ChartData;
8
+ chartTitle?: string;
9
+ xAxisTitle?: string;
10
+ yAxisTitle?: string;
11
+ id?: string;
12
+ testId?: string;
13
+ chartConfigs?: {
14
+ defaults?: Defaults;
15
+ callbacks?: ChartCallbacks;
16
+ };
17
+ lineChartConfig?: LineChartConfig;
18
+ onChartInstance?: (chartInstance: Chart | undefined) => void;
19
+ }
20
+ declare function LineChart({ initialSize, chartDataSet, chartTitle, xAxisTitle, yAxisTitle, id, testId, chartConfigs, lineChartConfig, onChartInstance }: Props): React.JSX.Element;
21
+ export { LineChart };
@@ -0,0 +1,16 @@
1
+ export declare const chartDataSet: {
2
+ labels: string[];
3
+ datasets: {
4
+ label: string;
5
+ data: number[];
6
+ borderColor: string;
7
+ pointBackgroundColor: string;
8
+ backgroundColor: string;
9
+ fill: boolean;
10
+ }[];
11
+ };
12
+ export declare const tooltip: {
13
+ callbacks: {
14
+ title: (tooltipItems: [Chart.ChartTooltipItem]) => string | undefined;
15
+ };
16
+ };
@@ -0,0 +1,26 @@
1
+ export declare const raw: {
2
+ DATA1: {
3
+ id: string;
4
+ value: number;
5
+ timestamp: string;
6
+ status: number;
7
+ }[];
8
+ DATA2: {
9
+ id: string;
10
+ value: number;
11
+ timestamp: string;
12
+ status: number;
13
+ }[];
14
+ DATA3: {
15
+ id: string;
16
+ value: number;
17
+ timestamp: string;
18
+ status: number;
19
+ }[];
20
+ DATA4: {
21
+ id: string;
22
+ value: number;
23
+ timestamp: string;
24
+ status: number;
25
+ }[];
26
+ };
@@ -0,0 +1,10 @@
1
+ import { ChartData } from 'chart.js/auto';
2
+ import { ChartCallbacks, LineChartConfig } from '../../../types/charts';
3
+ export type ChartConfigOptions = {
4
+ dataConfig: ChartData;
5
+ chartTitle: string;
6
+ xAxisTitle: string;
7
+ yAxisTitle: string;
8
+ chartCallbacks?: ChartCallbacks;
9
+ };
10
+ export declare const generateChartConfig: ({ dataConfig, chartTitle, xAxisTitle, yAxisTitle, chartCallbacks }: ChartConfigOptions) => LineChartConfig;
@@ -1,6 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  export interface CopyToClipboardProps {
3
3
  copyableText: string;
4
+ variant?: 'neutral' | 'warning' | 'error' | 'success';
5
+ multiline?: boolean;
6
+ className?: string;
4
7
  }
5
8
  declare const CopyToClipboard: (props: CopyToClipboardProps) => JSX.Element;
6
9
  export { CopyToClipboard };
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  import { TooltipOptions } from './useTooltip';
3
3
  declare function Tooltip({ children, ...options }: {
4
4
  children: ReactNode;
5
- } & TooltipOptions): JSX.Element;
5
+ } & TooltipOptions): React.JSX.Element;
6
6
  declare const TooltipAnchor: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & {
7
7
  asChild?: boolean | undefined;
8
8
  }, "ref"> & React.RefAttributes<HTMLElement>>;
@@ -11,33 +11,39 @@ declare function useTooltip({ initialOpen, placement, open: controlledOpen, onOp
11
11
  placement: Placement;
12
12
  strategy: import("@floating-ui/react").Strategy;
13
13
  middlewareData: import("@floating-ui/react").MiddlewareData;
14
- x: number | null;
15
- y: number | null;
14
+ x: number;
15
+ y: number;
16
+ isPositioned: boolean;
16
17
  update: () => void;
17
- reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
18
- floating: (node: HTMLElement | null) => void;
19
- positionReference: (node: import("@floating-ui/react").ReferenceType | null) => void;
18
+ floatingStyles: import("react").CSSProperties;
19
+ refs: {
20
+ reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
21
+ floating: import("react").MutableRefObject<HTMLElement | null>;
22
+ setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
23
+ setFloating: (node: HTMLElement | null) => void;
24
+ } & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
25
+ elements: {
26
+ reference: import("@floating-ui/react-dom").ReferenceType | null;
27
+ floating: HTMLElement | null;
28
+ } & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
20
29
  context: {
21
- x: number | null;
22
- y: number | null;
30
+ x: number;
31
+ y: number;
23
32
  update: () => void;
24
33
  placement: Placement;
25
34
  strategy: import("@floating-ui/react").Strategy;
26
35
  middlewareData: import("@floating-ui/react").MiddlewareData;
27
- reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
28
- floating: (node: HTMLElement | null) => void;
29
36
  isPositioned: boolean;
37
+ floatingStyles: import("react").CSSProperties;
30
38
  open: boolean;
31
- onOpenChange: (open: boolean) => void;
39
+ onOpenChange: (open: boolean, event?: Event | undefined) => void;
32
40
  events: import("@floating-ui/react").FloatingEvents;
33
41
  dataRef: import("react").MutableRefObject<import("@floating-ui/react").ContextData>;
34
42
  nodeId: string | undefined;
43
+ floatingId: string;
35
44
  refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
36
45
  elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
37
46
  };
38
- refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
39
- elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
40
- isPositioned: boolean;
41
47
  getReferenceProps: (userProps?: import("react").HTMLProps<Element> | undefined) => Record<string, unknown>;
42
48
  getFloatingProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
43
49
  getItemProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
@@ -49,33 +55,39 @@ declare const useTooltipContext: () => {
49
55
  placement: Placement;
50
56
  strategy: import("@floating-ui/react").Strategy;
51
57
  middlewareData: import("@floating-ui/react").MiddlewareData;
52
- x: number | null;
53
- y: number | null;
58
+ x: number;
59
+ y: number;
60
+ isPositioned: boolean;
54
61
  update: () => void;
55
- reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
56
- floating: (node: HTMLElement | null) => void;
57
- positionReference: (node: import("@floating-ui/react").ReferenceType | null) => void;
62
+ floatingStyles: import("react").CSSProperties;
63
+ refs: {
64
+ reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
65
+ floating: import("react").MutableRefObject<HTMLElement | null>;
66
+ setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
67
+ setFloating: (node: HTMLElement | null) => void;
68
+ } & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
69
+ elements: {
70
+ reference: import("@floating-ui/react-dom").ReferenceType | null;
71
+ floating: HTMLElement | null;
72
+ } & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
58
73
  context: {
59
- x: number | null;
60
- y: number | null;
74
+ x: number;
75
+ y: number;
61
76
  update: () => void;
62
77
  placement: Placement;
63
78
  strategy: import("@floating-ui/react").Strategy;
64
79
  middlewareData: import("@floating-ui/react").MiddlewareData;
65
- reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
66
- floating: (node: HTMLElement | null) => void;
67
80
  isPositioned: boolean;
81
+ floatingStyles: import("react").CSSProperties;
68
82
  open: boolean;
69
- onOpenChange: (open: boolean) => void;
83
+ onOpenChange: (open: boolean, event?: Event | undefined) => void;
70
84
  events: import("@floating-ui/react").FloatingEvents;
71
85
  dataRef: import("react").MutableRefObject<import("@floating-ui/react").ContextData>;
72
86
  nodeId: string | undefined;
87
+ floatingId: string;
73
88
  refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
74
89
  elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
75
90
  };
76
- refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
77
- elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
78
- isPositioned: boolean;
79
91
  getReferenceProps: (userProps?: import("react").HTMLProps<Element> | undefined) => Record<string, unknown>;
80
92
  getFloatingProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
81
93
  getItemProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  interface WithLabel {
3
- variant: 'square_icon_with_text';
3
+ variant: 'square_icon_with_text' | 'square_icon_with_text_below';
4
4
  label: string;
5
5
  }
6
6
  interface WithoutLabel {
@@ -39,6 +39,6 @@ interface SuggestionGroupProps {
39
39
  onClick: (suggestion: Suggestion) => void;
40
40
  focusedOption: number;
41
41
  }
42
- declare function SuggestionGroup({ suggestionGroup, onClick, focusedOption }: SuggestionGroupProps): JSX.Element;
43
- export { FloatingSearchBar };
42
+ declare function SuggestionGroup({ suggestionGroup, onClick, focusedOption }: SuggestionGroupProps): React.JSX.Element;
43
+ export { FloatingSearchBar, SuggestionGroup };
44
44
  export type { Suggestion };
@@ -1,5 +1,6 @@
1
1
  export * from './blackLink/BlackLink';
2
2
  export * from './buttonWithPopover/ButtonWithPopover';
3
+ export * from './charts';
3
4
  export * from './contextMenu/ContextMenu';
4
5
  export * from './contextMenuPopover/DataInfoButton';
5
6
  export * from './copyToClipboard/CopyToClipboard';
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { LayerInfo } from '@types';
1
+ import React, { CSSProperties } from 'react';
2
+ import { LayerInfo } from '../../types';
3
3
  interface MainLegendProps {
4
4
  /**
5
5
  * Layer legends appearing above the main legend
@@ -9,6 +9,14 @@ interface MainLegendProps {
9
9
  * Layer information
10
10
  */
11
11
  layers: LayerInfo[];
12
+ /**
13
+ * Styling for the main legend
14
+ */
15
+ legendStyle?: CSSProperties;
16
+ /**
17
+ * Styling for the content of the legend
18
+ */
19
+ legendContentStyle?: CSSProperties;
12
20
  }
13
- declare function MainLegend({ legends, layers }: MainLegendProps): JSX.Element;
21
+ declare function MainLegend({ legends, layers, legendStyle, legendContentStyle }: MainLegendProps): React.JSX.Element;
14
22
  export { MainLegend };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { CSSProperties } from 'react';
2
2
  interface LayerLegendProps {
3
3
  /**
4
4
  * Layer title
@@ -24,6 +24,10 @@ interface LayerLegendProps {
24
24
  * Used to disable layer legend usage
25
25
  */
26
26
  disabled?: boolean;
27
+ /**
28
+ * Styling for the content of the legend
29
+ */
30
+ style?: CSSProperties;
27
31
  }
28
- declare function LayerLegend({ title, iconName, itemsCount, itemsTitle, children, disabled }: LayerLegendProps): JSX.Element;
32
+ declare function LayerLegend({ title, iconName, itemsCount, itemsTitle, children, disabled, style }: LayerLegendProps): React.JSX.Element;
29
33
  export { LayerLegend };
@@ -39,6 +39,8 @@ interface ListItemBaseProps {
39
39
  */
40
40
  as?: React.ElementType;
41
41
  onCardClick?: () => void;
42
+ /** A url. The presence of this prop will automatically make the enclosing element an a-element. */
43
+ href?: string;
42
44
  /**
43
45
  * Style Modification
44
46
  */
@@ -46,5 +48,5 @@ interface ListItemBaseProps {
46
48
  style?: CSSProperties;
47
49
  }
48
50
  export type ListItemProps = ListItemBaseProps & WithVisualOrIconOptions;
49
- declare function ListItem(props: ListItemProps): JSX.Element;
51
+ declare function ListItem(props: ListItemProps): React.JSX.Element;
50
52
  export { ListItem };
@@ -1,5 +1,5 @@
1
1
  import React, { CSSProperties } from 'react';
2
- import { ExpandableRowProps, IconListItem } from '@types';
2
+ import { ExpandableRowProps, IconListItem } from '../../types';
3
3
  export interface ListRowProps {
4
4
  isDraggable: boolean;
5
5
  item: IconListItem;
@@ -14,6 +14,6 @@ interface SheetProps extends Style {
14
14
  */
15
15
  floating?: boolean;
16
16
  }
17
- declare function Sheet({ side, orientation, floating, children, className, style }: SheetProps): JSX.Element;
17
+ declare function Sheet({ side, orientation, floating, children, className, style }: SheetProps): React.JSX.Element;
18
18
  export type { SheetProps };
19
19
  export { Sheet };
@@ -6,9 +6,9 @@ interface BaseProps {
6
6
  interface SplitViewProps extends BaseProps {
7
7
  children: [React.ReactChild, React.ReactChild | undefined];
8
8
  }
9
- declare function SplitView({ className, style, children }: SplitViewProps): JSX.Element;
9
+ declare function SplitView({ className, style, children }: SplitViewProps): React.JSX.Element;
10
10
  interface RightProps extends BaseProps {
11
11
  children: React.ReactChild;
12
12
  }
13
- declare function Right({ className, style, children }: RightProps): JSX.Element;
13
+ declare function Right({ className, style, children }: RightProps): React.JSX.Element;
14
14
  export { SplitView, Right };
@@ -5,5 +5,5 @@ interface LeftProps {
5
5
  children: React.ReactChild;
6
6
  isMinimizable?: boolean;
7
7
  }
8
- declare function Left({ className, style, isMinimizable, children }: LeftProps): JSX.Element;
8
+ declare function Left({ className, style, isMinimizable, children }: LeftProps): React.JSX.Element;
9
9
  export { Left };
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { WorkOrderItem } from '@types';
2
+ import { WorkOrderItem } from '../../types';
3
3
  export interface WorkOrderListItemProps {
4
4
  workOrder: WorkOrderItem;
5
5
  onCardClick?: () => void;
6
6
  itemAction?: React.ReactNode;
7
7
  isHeader?: boolean;
8
8
  }
9
- declare function WorkOrderListItem(props: WorkOrderListItemProps): JSX.Element;
9
+ declare function WorkOrderListItem(props: WorkOrderListItemProps): React.JSX.Element;
10
10
  export { WorkOrderListItem };
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  interface WorkOrderStatusLabelProps {
3
3
  isActive: boolean;
4
4
  }
5
- export declare function WorkOrderStatusLabel({ isActive }: WorkOrderStatusLabelProps): JSX.Element;
5
+ export declare function WorkOrderStatusLabel({ isActive }: WorkOrderStatusLabelProps): React.JSX.Element;
6
6
  export {};
@@ -1,3 +1,4 @@
1
+ import { SuggestionGroup } from '../components';
1
2
  export type KeyboardEvents = {
2
3
  up?: Function;
3
4
  right?: Function;
@@ -6,16 +7,12 @@ export type KeyboardEvents = {
6
7
  enter?: Function;
7
8
  escape?: Function;
8
9
  };
9
- declare const useListNavigator: (listLength: number, initialIndex?: number, keyboardEvents?: KeyboardEvents, listenerTarget?: Document | HTMLElement) => number;
10
+ declare const useKeyboardNavigation: (keyboardEvents: KeyboardEvents, listenerTarget?: HTMLElement | Document) => void;
10
11
  /**
11
- * 1. On open: focus should be undefined/inactive. (list should scroll/show selected item if any).
12
- * 2. user presses a key (usually down) - scroll list to focused element, which should be first item
13
- * in the first section. Also set focused section.
14
- * 3. Potentially jump to last in list if user goes up?
12
+ * Handles keyboard navigation and key events in the floating search bar suggestions.
15
13
  */
16
- declare const useSectionNavigator: (sections: any[], initialSelected: number, keyboardEvents: KeyboardEvents, listenerTarget?: HTMLElement | Document) => {
14
+ declare const useSearchBarSectionNavigator: (sections: SuggestionGroup[], initialSelected: number, keyboardEvents: KeyboardEvents, listenerTarget?: HTMLElement | Document) => {
17
15
  focusedSection: number;
18
16
  focusedOption: number;
19
17
  };
20
- declare const useKeyboardNavigation: (keyboardEvents: KeyboardEvents, listenerTarget?: HTMLElement | Document) => void;
21
- export { useListNavigator, useSectionNavigator, useKeyboardNavigation };
18
+ export { useSearchBarSectionNavigator, useKeyboardNavigation };
@@ -3,3 +3,5 @@ export declare const robim_external_ald: IconData;
3
3
  export declare const robim_external_timp: IconData;
4
4
  export declare const robim_external_timp_text: IconData;
5
5
  export declare const robim_external_iwit: IconData;
6
+ export declare const robim_external_methane_sensor: IconData;
7
+ export declare const robim_external_satellite: IconData;
@@ -3,3 +3,5 @@ export * from './general';
3
3
  export * from './notifications';
4
4
  export * from './punches';
5
5
  export * from './workOrders';
6
+ export * from './misc';
7
+ export * from './maps';
@@ -0,0 +1,6 @@
1
+ import { IconData } from '@equinor/eds-icons';
2
+ export declare const polygon: IconData;
3
+ export declare const polyrectangle: IconData;
4
+ export declare const polyline: IconData;
5
+ export declare const polygon_symbol: IconData;
6
+ export declare const distance_circle: IconData;
@@ -0,0 +1,2 @@
1
+ import { IconData } from '@equinor/eds-icons';
2
+ export declare const measuring_point: IconData;