@equinor/echo-components 2.2.2 → 2.3.0
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/README.md +59 -18
- package/index.cjs.js +1 -1
- package/package.json +3 -3
- package/src/components/echoButton/EchoButton.d.ts +11 -4
- package/src/components/itemMarker/ItemMarker.d.ts +1 -0
- package/src/components/itemMarkerPopover/Pagination.d.ts +1 -2
- package/src/components/itemMarkerPopover/itemMarkerPopover.d.ts +15 -0
- package/src/index.d.ts +1 -0
- package/src/theme/themeConst.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"chart.js": "4.5.1",
|
|
6
6
|
"react-datepicker": "8.7.0",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"react-window": "1.8.11"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@equinor/echo-utils": ">= 2.
|
|
11
|
+
"@equinor/echo-utils": ">= 2.3.0 < 3.0.0",
|
|
12
12
|
"@equinor/eds-core-react": "0.49.0",
|
|
13
13
|
"@equinor/eds-icons": "0.22.0",
|
|
14
|
-
"@equinor/eds-tokens": "
|
|
14
|
+
"@equinor/eds-tokens": "2.1.0",
|
|
15
15
|
"classnames": "2.5.1",
|
|
16
16
|
"lodash": ">= 4.17.21 < 5",
|
|
17
17
|
"react": ">= 17.0.2",
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { ButtonProps } from '@equinor/eds-core-react';
|
|
2
|
-
|
|
2
|
+
type ButtonType = 'neutral' | 'accent';
|
|
3
|
+
export type EchoButtonProps = ButtonProps & {
|
|
4
|
+
buttonType?: ButtonType;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
|
-
* Wrapper for EDS Button with UI preferences support.
|
|
5
|
-
*
|
|
7
|
+
* Wrapper for EDS Button with UI preferences support, and dark mode support (uses new light/dark CSS variables).
|
|
8
|
+
* This button component should be removed when EDS 1.0 is fully adopted, then we would use the button component from there.
|
|
9
|
+
* For now we need this to be able to implement temporary styles with dark support.
|
|
6
10
|
*/
|
|
7
11
|
export declare const EchoButton: import("react").ForwardRefExoticComponent<{
|
|
8
12
|
color?: "primary" | "secondary" | "danger";
|
|
@@ -11,4 +15,7 @@ export declare const EchoButton: import("react").ForwardRefExoticComponent<{
|
|
|
11
15
|
disabled?: boolean;
|
|
12
16
|
type?: string;
|
|
13
17
|
fullWidth?: boolean;
|
|
14
|
-
} & import("react").ButtonHTMLAttributes<HTMLButtonElement> &
|
|
18
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
19
|
+
buttonType?: ButtonType;
|
|
20
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
export {};
|
|
@@ -2,6 +2,5 @@ export type PaginationProps = {
|
|
|
2
2
|
itemCount: number;
|
|
3
3
|
currentItemIndex: number;
|
|
4
4
|
setCurrentItemIndex: (index: number) => void;
|
|
5
|
-
darkTheme?: boolean;
|
|
6
5
|
};
|
|
7
|
-
export declare const Pagination: ({ itemCount, currentItemIndex, setCurrentItemIndex
|
|
6
|
+
export declare const Pagination: ({ itemCount, currentItemIndex, setCurrentItemIndex }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,4 +9,19 @@ export type ItemMarkerPopover = {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Popover component that can display a single item, or a pagination of multiple items.
|
|
14
|
+
* NB:
|
|
15
|
+
* The content that is being passed in needs to be styled accordingly to the dark theme.
|
|
16
|
+
* When using ListItem for the content, using the css parameter -webkit-text-fill-color is recommended for overriding the text color.
|
|
17
|
+
* To override the hover effect for ListItem, override the elements in the ListItem like this: > li:hover
|
|
18
|
+
* This component will always render in dark mode.
|
|
19
|
+
* @param {JSX.Element[] | string[]} items - List of items to be displayed in the popover.
|
|
20
|
+
* @param {boolean} isOpen - If true, popover is open.
|
|
21
|
+
* @param {() => void} handleClose - Function to close the popover (this is used to handle closing only, not toggling it).
|
|
22
|
+
* @param {string} title - Title of the popover.
|
|
23
|
+
* @param {number} zIndex - Z-index of the popover.
|
|
24
|
+
* @param {string} className - ClassName of the popover.
|
|
25
|
+
* @param {CSSProperties} style - style of the popover.
|
|
26
|
+
*/
|
|
12
27
|
export declare const ItemMarkerPopover: ({ items, isOpen, handleClose, title, zIndex, className, style }: ItemMarkerPopover) => false | import("react/jsx-runtime").JSX.Element;
|
package/src/index.d.ts
CHANGED