@equinor/echo-components 0.11.10 → 0.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-components",
3
- "version": "0.11.10",
3
+ "version": "0.11.11",
4
4
  "dependencies": {
5
5
  "chart.js": "4.4.3",
6
6
  "react-datepicker": "4.25.0",
@@ -12,5 +12,9 @@ type AutohiddenContentProps = {
12
12
  /** The content to autohide. */
13
13
  children: ReactElement<HTMLElement | string | number>;
14
14
  };
15
+ /** A component that autohides its children content after a specified delay.
16
+ * <p>The implementer may choose between removing the content from the DOM; which will probably shift the layout, or
17
+ * they can turn the content invisible with CSS.</p>
18
+ */
15
19
  export declare function AutohiddenContent({ delay, hideMethod, onHide, children }: AutohiddenContentProps): import("react/jsx-runtime").JSX.Element | null;
16
20
  export {};
@@ -1,5 +1,6 @@
1
1
  import { TooltipProps } from '@equinor/eds-core-react';
2
- type LinkProps = Omit<TooltipProps, 'href' | 'children'> & {
2
+ export type LinkProps = Omit<TooltipProps, 'href' | 'children'> & {
3
+ /** To override styles. */
3
4
  className?: string;
4
5
  /** The external link. */
5
6
  href: string;
@@ -7,9 +8,14 @@ type LinkProps = Omit<TooltipProps, 'href' | 'children'> & {
7
8
  linkText: string;
8
9
  /** If true, the link is opened in the same window or tab. */
9
10
  preserveTab?: boolean;
10
- /** The text to be displayed in the tooltip. */
11
+ /** The text to be displayed in the tooltip. The tooltip is not rendered on touch devices.*/
11
12
  tooltipText?: string;
13
+ /** An optional callback when the link is clicked. */
12
14
  onClick?: () => void;
13
15
  };
16
+ /** A semantic link component that features link text and icon.
17
+ *
18
+ * @example
19
+ * <BlackLink href="https://example.com" linkText="Link to somewhere" tooltipText="This links somewhere" />
20
+ */
14
21
  export declare const BlackLink: ({ className, href, linkText, preserveTab, tooltipText, onClick, enterDelay, placement, ...toolTipRest }: LinkProps) => import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1,9 +1,18 @@
1
1
  import React from 'react';
2
2
  export interface CopyToClipboardProps {
3
+ /** The text to be copied. */
3
4
  copyableText: string;
5
+ /** The EDS standard variant which alters the colours. Defaults to neutral. */
4
6
  variant?: 'neutral' | 'warning' | 'error' | 'success';
7
+ /** If the copyable text is very long, this can be optionally set. */
5
8
  multiline?: boolean;
9
+ /** To override styles. */
6
10
  className?: string;
7
11
  }
12
+ /** A component that simplifies the copying of text.
13
+ * <p>The user can select the text inside the input element to have it highlighted, or
14
+ * they can click the copy button to copy the text.</p>
15
+ * <p>The component uses Clipboard API, but is not concerned with permissions.</p>
16
+ * */
8
17
  declare const CopyToClipboard: ({ copyableText, className, multiline, variant }: CopyToClipboardProps) => React.JSX.Element;
9
18
  export { CopyToClipboard };
@@ -1,5 +1,21 @@
1
1
  import { TabListProps, TabPanelsProps, TabsProps } from '@equinor/eds-core-react';
2
- /** The topmost wrapper element for the tab view.*/
2
+ /** Allows markup to be horizontally sectioned in tabs. <br />
3
+ * The component is a drop in replacement for the regular EDS tabs.
4
+ *
5
+ * @example
6
+ * const { HorizontalTabs, Tab, TabPanels, Tabs, TabPanel } = HorizontalTabView;
7
+ *
8
+ * <HorizontalTabs onChange={setActiveTab} activeTab={activeTab}>
9
+ <Tabs>
10
+ <Tab>Tab 1</Tab>
11
+ <Tab>Tab 2</Tab>
12
+ </Tabs>
13
+ <TabPanels>
14
+ <TabPanel>Tab Content 1</TabPanel>
15
+ <TabPanel>Tab Content 2</TabPanel>
16
+ </TabPanels>
17
+ </HorizontalTabs>
18
+ */
3
19
  export declare function TabView(props: TabsProps): import("react/jsx-runtime").JSX.Element;
4
20
  /** Returns the parent element of the tabs themselves. */
5
21
  export declare function Tabs(props: TabListProps): import("react/jsx-runtime").JSX.Element;
@@ -23,7 +23,12 @@ export * from './itemMarker/ItemMarker';
23
23
  export * from './itemMarker/ItemMarkerExpanded';
24
24
  export * from './itemMarker/ItemMarkerIcon';
25
25
  export * from './itemMarker/MultipleItemMarkers';
26
+ export * from './itemMarkerAndPopoverWrapper/itemMarkerAndPopoverWrapper';
27
+ export * from './itemMarkerPopover/itemMarkerPopover';
26
28
  export * from './legend';
29
+ export * from './legendChip/legendChip';
30
+ export * from './legendSelector/legendSelector';
31
+ export * from './legendSelectorMenu/legendSelectorMenu';
27
32
  export * from './linkIcon/LinkIcon';
28
33
  export * from './listItem';
29
34
  export * from './listRow/ListRow';
@@ -32,6 +37,7 @@ export * from './multilineTabs/MultilineTabs';
32
37
  export * from './notificationListItem/NotificationListItem';
33
38
  export * from './pcMatrix/PCMatrix';
34
39
  export * from './rightPanel';
40
+ export * from './scrollableTabs/ScrollableTabs';
35
41
  export * from './searchBar';
36
42
  export * from './secondaryMarker/SecondaryMarker';
37
43
  export * from './secondaryMarker/SecondaryMarkerExpander';
@@ -0,0 +1,16 @@
1
+ type ItemMarkerAndPopoverWrapperProps = {
2
+ title: string;
3
+ items: JSX.Element[];
4
+ itemMarker: JSX.Element;
5
+ closeOnOutsideClick?: boolean;
6
+ };
7
+ /**
8
+ *
9
+ * @param {string} title - Title of the popover.
10
+ * @param {JSX.Element[]} items - List of items to be displayed in the popover.
11
+ * @param {JSX.Element} itemMarker - Item marker component. This can also be the MultipleIconMarkers component.
12
+ * @param {boolean} closeOnOutsideClick - If true, popover will close on outside click (optional).
13
+ * @returns {JSX.Element} Component
14
+ */
15
+ export declare const ItemMarkerAndPopoverWrapper: ({ title, items, itemMarker, closeOnOutsideClick }: ItemMarkerAndPopoverWrapperProps) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,7 @@
1
+ export type PaginationProps = {
2
+ itemCount: number;
3
+ currentItemIndex: number;
4
+ setCurrentItemIndex: (index: number) => void;
5
+ darkTheme?: boolean;
6
+ };
7
+ export declare const Pagination: ({ itemCount, currentItemIndex, setCurrentItemIndex, darkTheme }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export type ItemMarkerPopover = {
2
+ items: JSX.Element[] | string[];
3
+ isOpen: boolean;
4
+ handleClose: () => void;
5
+ togglePopover: () => void;
6
+ title: string;
7
+ closeOnOutsideClick?: boolean;
8
+ };
9
+ export declare const ItemMarkerPopover: ({ items, isOpen, handleClose, togglePopover, title, closeOnOutsideClick }: ItemMarkerPopover) => false | import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface LegendChipProps {
3
+ legendStatus: string;
4
+ backgroundColor: string;
5
+ onClick?: (isDisabled: boolean) => void;
6
+ }
7
+ /**
8
+ * Legend chip component to display a legend status chip.
9
+ * @param {string} legend - The legend status to be displayed.
10
+ * @param {string} backgroundColor - The background color of the chip.
11
+ * @param {(isDisabled: boolean) => void} onClick - Function to be called when the chip is clicked.
12
+ */
13
+ export declare const LegendChip: React.FC<LegendChipProps>;
14
+ export {};
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export interface LegendSelectorProps {
3
+ items: string[];
4
+ selectedItem: string;
5
+ setSelectedItem: (selectedItem: string) => void;
6
+ legends: JSX.Element[];
7
+ icon?: JSX.Element;
8
+ }
9
+ /**
10
+ * Legend selector component that will display the selected legend type and the statuses.
11
+ * @param {JSX.Element[]} items - List of items to be displayed in the menu.
12
+ * @param {string} selectedItem - The selected item.
13
+ * @param {(selectedItem: string) => void} setSelectedItem - Function to set the selected item.
14
+ * @param {JSX.Element[]} legends - List of legend chip components to be displayed.
15
+ * @param {JSX.Element} icon - Icon to be displayed before the legend selector. Optional.
16
+ */
17
+ export declare const LegendSelector: React.FC<LegendSelectorProps>;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface LegendSelectorMenuProps {
3
+ items: string[];
4
+ selectedItem: string;
5
+ setSelectedItem: (selectedItem: string) => void;
6
+ }
7
+ /**
8
+ * Legend selector component to choose which legend type to display.
9
+ * @param {JSX.Element[]} items - List of items to be displayed in the menu.
10
+ * @param {string} selectedItem - The selected item.
11
+ * @param {(selectedItem: string) => void} setSelectedItem - Function to set the selected item.
12
+ */
13
+ export declare const LegendSelectorMenu: React.FC<LegendSelectorMenuProps>;
14
+ export {};
@@ -1,9 +1,16 @@
1
1
  import { TooltipProps } from '@equinor/eds-core-react';
2
2
  type LinkIconProps = Omit<TooltipProps, 'children'> & {
3
+ /** Optionally override tooltip styles. */
3
4
  tooltipClassName?: string;
5
+ /** Optionally override link styles. */
4
6
  className?: string;
7
+ /** The link destination. */
5
8
  href: string;
6
9
  onClick?: () => void;
7
10
  };
11
+ /** A simple link component that only features an icon.
12
+ * <p>Implementers can optionally specify a tooltip to further clarify the destination.
13
+ * <br /> On touch devices, this tooltip is <u>not rendered.</u></p>
14
+ */
8
15
  export declare function LinkIcon({ href, className, tooltipClassName, onClick, ...toolTipProps }: LinkIconProps): import("react/jsx-runtime").JSX.Element;
9
16
  export {};
@@ -44,9 +44,15 @@ interface ListItemBaseProps {
44
44
  /**
45
45
  * Style Modification
46
46
  */
47
- className?: string;
48
47
  style?: CSSProperties;
48
+ className?: string;
49
+ cardClassName?: string;
50
+ /**
51
+ * Intended for displaying optional messages regarding the given list item
52
+ */
49
53
  footer?: React.ReactNode;
54
+ iconColor?: string;
55
+ hideIcon?: boolean;
50
56
  }
51
57
  export type ListItemProps = ListItemBaseProps & WithVisualOrIconOptions;
52
58
  declare function ListItem(props: ListItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { TabsProps } from '@equinor/eds-core-react';
2
+ import { ReactNode } from 'react';
3
+ interface ScrollableTabsProps extends TabsProps {
4
+ /** Unique ID for the top level element */
5
+ id: string;
6
+ /** To override styles. */
7
+ className?: string;
8
+ /** The list of tabs to be rendered. */
9
+ tabsListContent: ReactNode[];
10
+ /** The list of tab content. Rendered inside EDSTab.Panel */
11
+ tabsPanelContent: ReactNode[];
12
+ }
13
+ declare function ScrollableTabs({ id, className, tabsListContent, tabsPanelContent, variant }: ScrollableTabsProps): import("react/jsx-runtime").JSX.Element;
14
+ export { ScrollableTabs };
@@ -1,12 +1,14 @@
1
1
  export * from './badges';
2
2
  export * from './external';
3
3
  export * from './general';
4
+ export * from './legendMarker';
5
+ export * from './legendMarkerChip';
4
6
  export * from './maps';
5
7
  export * from './misc';
6
8
  export * from './notifications';
7
9
  export * from './punches';
8
10
  export * from './sap';
9
- export * from "./sidesheet";
11
+ export * from './sidesheet';
10
12
  export * from './subsea';
11
13
  export * from './workOrders';
12
14
  export * from './xld';
@@ -0,0 +1,2 @@
1
+ import { IconData } from '@equinor/eds-icons';
2
+ export declare const legend_marker: IconData;
@@ -0,0 +1,2 @@
1
+ import { IconData } from '@equinor/eds-icons';
2
+ export declare const legend_marker_chip: IconData;
@@ -121,4 +121,12 @@ export declare const themeConst: {
121
121
  readonly hoverIconWithNotification: string;
122
122
  tertiaryText: string;
123
123
  secondaryText: string;
124
+ backgroundDark: string;
125
+ backgroundDark2: string;
126
+ backgroundDark3: string;
127
+ hoverDark: string;
128
+ borderDark: string;
129
+ focusDark: string;
130
+ primaryTextForDarkBackground: string;
131
+ secondaryTextForDarkBackground: string;
124
132
  };