@equinor/echo-components 2.3.0 → 2.4.1
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/index.cjs.js +1 -1
- package/package.json +6 -2
- package/src/components/echoButton/EchoButton.d.ts +2 -4
- package/src/components/echoButton/EchoToggleButton.d.ts +16 -0
- package/src/components/index.d.ts +1 -0
- package/src/components/legendChip/LegendChip.d.ts +1 -0
- package/src/components/legendSelector/LegendSelector.d.ts +1 -0
- package/src/index.d.ts +4 -3
- package/src/providers/UIPreferenceProvider.d.ts +2 -1
- package/src/theme/echoModes.generated.d.ts +1 -0
- package/src/theme/echoPrimitives.generated.d.ts +1 -0
- package/src/theme/echoUI.generated.d.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"chart.js": "4.5.1",
|
|
6
6
|
"react-datepicker": "8.7.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"react-window": "1.8.11"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@equinor/echo-utils": ">= 2.
|
|
11
|
+
"@equinor/echo-utils": ">= 2.4.1 < 3.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",
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"sortablejs": ">= 1.15.1 < 2",
|
|
21
21
|
"zustand": ">= 4.4.7 < 5"
|
|
22
22
|
},
|
|
23
|
+
"exports": {
|
|
24
|
+
"./package.json": "./package.json",
|
|
25
|
+
".": "./index.cjs.js"
|
|
26
|
+
},
|
|
23
27
|
"main": "./index.cjs.js",
|
|
24
28
|
"type": "commonjs",
|
|
25
29
|
"types": "./index.d.ts"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ButtonProps } from '@equinor/eds-core-react';
|
|
2
|
-
type ButtonType = 'neutral' | 'accent';
|
|
3
2
|
export type EchoButtonProps = ButtonProps & {
|
|
4
|
-
|
|
3
|
+
isSelected?: boolean;
|
|
5
4
|
};
|
|
6
5
|
/**
|
|
7
6
|
* Wrapper for EDS Button with UI preferences support, and dark mode support (uses new light/dark CSS variables).
|
|
@@ -16,6 +15,5 @@ export declare const EchoButton: import("react").ForwardRefExoticComponent<{
|
|
|
16
15
|
type?: string;
|
|
17
16
|
fullWidth?: boolean;
|
|
18
17
|
} & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
19
|
-
|
|
18
|
+
isSelected?: boolean;
|
|
20
19
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
21
|
-
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EchoButtonProps } from './EchoButton';
|
|
2
|
+
/**
|
|
3
|
+
* Temporary EDS toggle button, remove when EDS 1.0 is available.
|
|
4
|
+
* Visually merges multiple toggle buttons together.
|
|
5
|
+
* It uses EchoButton as a base and adds isSelected prop and aria-pressed attribute for accessibility.
|
|
6
|
+
* Note: Ghost variants are not supported for toggle buttons as they don't provide clear visual feedback for the selected state.
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
* @param {object} props - Component props
|
|
10
|
+
* @param {boolean} [props.isSelected] - Indicates if the button is in a selected state.
|
|
11
|
+
* @param {'contained' | 'contained_icon' | 'outlined'} [props.variant] - Button variant. Ghost variants are not available for toggle buttons.
|
|
12
|
+
*/
|
|
13
|
+
export declare const EchoToggleButton: import("react").ForwardRefExoticComponent<Omit<EchoButtonProps, "variant"> & {
|
|
14
|
+
isSelected?: boolean;
|
|
15
|
+
variant?: Exclude<EchoButtonProps["variant"], "ghost" | "ghost_icon">;
|
|
16
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -14,6 +14,7 @@ export * from './dropdown/Dropdown';
|
|
|
14
14
|
export * from './echoBottomBar/EchoBottomBar';
|
|
15
15
|
export * from './echoButton/EchoActionButton';
|
|
16
16
|
export * from './echoButton/EchoButton';
|
|
17
|
+
export * from './echoButton/EchoToggleButton';
|
|
17
18
|
export * from './echoCard/index';
|
|
18
19
|
export * from './echoHeader/EchoHeader';
|
|
19
20
|
export * from './echoMenu/EchoMenu';
|
|
@@ -12,6 +12,7 @@ export interface LegendSelectorProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* Legend selector component that will display the selected legend type and the statuses.
|
|
14
14
|
* Note that this component is meant to be displayed on a darker background, and should be used with the LegendSelectorAccordion as display in the LegendSelector story in the storybook.
|
|
15
|
+
* Will always render dark.
|
|
15
16
|
* @param {JSX.Element[]} options - List of options to be displayed in the selection-selector.
|
|
16
17
|
* @param {string} selectedOption - The selected option.
|
|
17
18
|
* @param {(option: string) => void} onOptionsClick - Function that is called when another option is clicked.
|
package/src/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import './style-reset.css';
|
|
2
|
-
import '@equinor/eds-tokens/tokens.css';
|
|
3
2
|
import '@equinor/eds-tokens/css/variables.css';
|
|
4
|
-
import '
|
|
3
|
+
import '@equinor/eds-tokens/tokens.css';
|
|
5
4
|
import './theme/echoModes.generated.css';
|
|
5
|
+
import './theme/echoPrimitives.generated.css';
|
|
6
|
+
import './theme/echoUI.generated.css';
|
|
6
7
|
import './theme/theme.css';
|
|
7
8
|
export * from './components';
|
|
8
9
|
export * from './elements';
|
|
@@ -11,8 +12,8 @@ export * from './hooks';
|
|
|
11
12
|
export * from './icons';
|
|
12
13
|
export * from './providers/UIPreferenceProvider';
|
|
13
14
|
export * from './structure';
|
|
14
|
-
export { echoPrimitives } from './theme/echoPrimitives.generated';
|
|
15
15
|
export { echoModes } from './theme/echoModes.generated';
|
|
16
|
+
export { echoPrimitives } from './theme/echoPrimitives.generated';
|
|
16
17
|
export { themeConst } from './theme/themeConst';
|
|
17
18
|
export * from './types';
|
|
18
19
|
export * from './utils';
|
|
@@ -9,7 +9,8 @@ interface UIPreferencesContextType {
|
|
|
9
9
|
}
|
|
10
10
|
interface UIPreferencesProviderProps {
|
|
11
11
|
children: ReactNode;
|
|
12
|
-
|
|
12
|
+
/** @deprecated - Follows the old color scheme, use new EDS tokens instead if needed */
|
|
13
|
+
mode?: Mode;
|
|
13
14
|
density?: Density;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
@@ -253,6 +253,7 @@ export declare const echoModes: {
|
|
|
253
253
|
readonly stidNotificationsSeverityTextIconDefaultSeverity: "#000000";
|
|
254
254
|
readonly stidOfpDocumentsFillOfpdark: "#ffc67a";
|
|
255
255
|
readonly stidOfpDocumentsFillOfplight: "#ffe7d6";
|
|
256
|
+
readonly stidOfpDocumentsFillNone: "rgba(255 255 255 / 0)";
|
|
256
257
|
readonly stidOfpDocumentsFillBlue: "#d5eaf4";
|
|
257
258
|
readonly stidOfpDocumentsFillGrey: "#bebebe";
|
|
258
259
|
readonly stidOfpDocumentsTextIconOfpdark: "#000000";
|
|
@@ -36,6 +36,7 @@ export declare const echoPrimitives: {
|
|
|
36
36
|
readonly edsPrimaryEdsMossGreen_100: "#007079";
|
|
37
37
|
readonly standardItemStatusMultiple: "#3d3d3d";
|
|
38
38
|
readonly standardItemStatusUnknown_1: "#bebebe";
|
|
39
|
+
readonly miscEchoCustomUiHoverOverlay: "rgba(0 0 0 / 0.9)";
|
|
39
40
|
readonly miscEchoCustomUiMarkerActive: "#00ffff";
|
|
40
41
|
readonly miscTextIconBlack: "#000000";
|
|
41
42
|
readonly miscTextIconWhite: "#ffffff";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const echoUI: {
|
|
2
|
+
readonly bgFabResting: "rgba(0 0 0 / 0.8)";
|
|
3
|
+
readonly bgFabHover: "rgba(0 0 0 / 0.9)";
|
|
4
|
+
readonly bgLightenLighten_16: "rgba(255 255 255 / 0.16)";
|
|
5
|
+
readonly bgLightenLighten_10: "rgba(255 255 255 / 0.1)";
|
|
6
|
+
readonly bgLightenLighten_30: "rgba(255 255 255 / 0.3)";
|
|
7
|
+
readonly miscMarkerActive: "#00ffff";
|
|
8
|
+
};
|