@equinor/echo-components 3.1.0 → 4.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-components",
3
- "version": "3.1.0",
3
+ "version": "4.0.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": ">= 3.1.0 < 4.0.0",
11
+ "@equinor/echo-utils": ">= 4.0.1 < 5.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",
@@ -1,22 +1,38 @@
1
1
  import React from 'react';
2
- export interface LegendSelectorAccordionProps {
2
+ interface LegendSelectorAccordionBaseProps {
3
3
  title: string;
4
4
  children: React.ReactNode;
5
5
  visual?: JSX.Element;
6
6
  caption?: string;
7
7
  actions?: React.ReactNode;
8
- isExpanded?: boolean;
9
- setIsExpanded?: (isExpanded: boolean) => void;
10
8
  }
9
+ interface UncontrolledProps extends LegendSelectorAccordionBaseProps {
10
+ isExpanded?: never;
11
+ setIsExpanded?: never;
12
+ defaultIsExpanded?: boolean;
13
+ }
14
+ interface ControlledProps extends LegendSelectorAccordionBaseProps {
15
+ isExpanded: boolean;
16
+ setIsExpanded: (isExpanded: boolean) => void;
17
+ defaultIsExpanded?: never;
18
+ }
19
+ export type LegendSelectorAccordionProps = UncontrolledProps | ControlledProps;
11
20
  /**
12
21
  * Legend selector accordion component to display the legend selector for the data layers.
13
22
  * This component is meant to be used as a wrapper and consumes the LegendSelector, LegendSelectorMenu and/or LegendChip
14
23
  * in the combinations that might be needed.
24
+ *
25
+ * This component can be used both controlled and uncontrolled.
26
+ *
15
27
  * @param {string} title - The title of the accordion/type of legend.
16
28
  * @param {React.ReactNode} children - The children to be displayed in the accordion.
17
29
  * @param {JSX.Element} visual - The visual or icon to be displayed in the accordion header. Optional.
18
30
  * @param {string} caption - The caption to be displayed in the accordion header. Optional.
19
31
  * @param {React.ReactNode} actions - The actions to be displayed in the accordion header. Optional.
32
+ * @param {boolean} isExpanded - Controlled: whether the accordion is expanded.
33
+ * @param {function} setIsExpanded - Controlled: callback when expanded state changes.
34
+ * @param {boolean} defaultIsExpanded - Uncontrolled: default expanded state (default: false).
20
35
  * @returns {JSX.Element} - Legend selector accordion component.
21
36
  */
22
37
  export declare const LegendSelectorAccordion: React.FC<LegendSelectorAccordionProps>;
38
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export interface IconProps {
3
3
  name: string;
4
- color: string;
4
+ color?: string;
5
5
  title?: string;
6
6
  className?: string;
7
7
  size?: 16 | 24 | 32 | 40 | 48;
@@ -12,7 +12,7 @@ export interface IconProps {
12
12
  * @param {IconProps} {
13
13
  * name: The name of the icon to be displayed
14
14
  * title: The html title to use
15
- * color:The color to icon should have
15
+ * color: The color the icon should have (optional - defaults to CSS-controlled color)
16
16
  * size: The wanted size of the icon. Possible values are 16, 24, 32, 40 and 48
17
17
  * }
18
18
  * @return {*} {JSX.Element} A icon for the provided information
@@ -12,4 +12,3 @@ export * from './sap';
12
12
  export * from './sidesheet';
13
13
  export * from './subsea';
14
14
  export * from './workOrders';
15
- export * from './xld';
@@ -7,6 +7,8 @@ export declare const themeConst: {
7
7
  mediumLarge: string;
8
8
  large: string;
9
9
  xLarge: string;
10
+ xxLarge: string;
11
+ xxxLarge: string;
10
12
  breakpointXs: string;
11
13
  breakpointS: string;
12
14
  breakpointMd: string;
@@ -74,6 +76,10 @@ export declare const themeConst: {
74
76
  equiGreen2: string;
75
77
  readonly equiGreen3: string;
76
78
  equiGreen4: string;
79
+ /**
80
+ * @deprecated Use default Typography color (omit color prop) or tokens.colors.text.static_icons__default.rgba from @equinor/eds-tokens
81
+ * Default text color is automatically applied by EDS Typography components
82
+ */
77
83
  echoText: string;
78
84
  noColor: string;
79
85
  disabledBackgroundColor: string;
@@ -93,6 +99,10 @@ export declare const themeConst: {
93
99
  readonly noValvePositionInSAP: string;
94
100
  onGoing: string;
95
101
  readonly done: string;
102
+ /**
103
+ * @deprecated Use tokens.colors.interactive.primary__resting.rgba from @equinor/eds-tokens
104
+ * This is the EDS primary interactive color (Moss Green #007079)
105
+ */
96
106
  asBuilt: string;
97
107
  readonly planned: string;
98
108
  readonly future: string;
@@ -1,3 +0,0 @@
1
- import { IconData } from '@equinor/eds-icons';
2
- export declare const xld_sticky_note: IconData;
3
- export declare const add_xld_sticky_note: IconData;