@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-components",
3
- "version": "2.2.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.2.2 < 3.0.0",
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": "0.10.0",
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
- export type EchoButtonProps = ButtonProps;
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
- * If EDS implements mode and density in the future (as in figma), this can be removed.
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> & import("react").RefAttributes<HTMLButtonElement>>;
18
+ } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
19
+ buttonType?: ButtonType;
20
+ } & import("react").RefAttributes<HTMLButtonElement>>;
21
+ export {};
@@ -19,6 +19,7 @@ export interface ItemMarkerProps {
19
19
  maxNumberOfChips?: number;
20
20
  zIndex?: number | string;
21
21
  highlightColor?: string;
22
+ isGhosted?: boolean;
22
23
  }
23
24
  /**
24
25
  * Renders an item marker with optional chips.
@@ -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, darkTheme }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
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
@@ -1,5 +1,6 @@
1
1
  import './style-reset.css';
2
2
  import '@equinor/eds-tokens/tokens.css';
3
+ import '@equinor/eds-tokens/css/variables.css';
3
4
  import './theme/echoPrimitives.generated.css';
4
5
  import './theme/echoModes.generated.css';
5
6
  import './theme/theme.css';
@@ -161,5 +161,6 @@ export declare const themeConst: {
161
161
  edsDarkInteractivePrimaryHover: string;
162
162
  edsDarkInteractiveDisabledFill: string;
163
163
  edsDarkInteractiveDisabledText: string;
164
+ edsDarkTextStaticIconsSecondary: string;
164
165
  selectionIndicator: string;
165
166
  };