@equinor/echo-components 0.5.8-rc1 → 0.5.8-rc2
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/dist/components/echoCard/index.d.ts +2 -2
- package/dist/components/floatingActionButton/FloatingActionButton.d.ts +29 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/listItem/ListItem.d.ts +50 -0
- package/dist/components/listItem/index.d.ts +1 -0
- package/dist/components/listRow/ListRow.d.ts +1 -2
- package/dist/components/rightPanel/PanelContextWrapper.d.ts +19 -0
- package/dist/components/rightPanel/index.d.ts +5 -0
- package/dist/components/rightPanel/menuButton/MenuButton.d.ts +26 -0
- package/dist/components/rightPanel/panel/Panel.d.ts +18 -0
- package/dist/components/rightPanel/panelContent/PanelContent.d.ts +21 -0
- package/dist/components/rightPanel/panelWrapper/PanelWrapper.d.ts +21 -0
- package/dist/components/rightPanel/usePanelContext.d.ts +8 -0
- package/dist/components/sidebarButton/SidebarButton.d.ts +41 -0
- package/dist/elements/index.d.ts +8 -0
- package/dist/helpers/classnames.d.ts +5 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/icons/echoAssets/data.d.ts +3 -0
- package/dist/icons/echoAssets/external.d.ts +3 -0
- package/dist/icons/echoAssets/index.d.ts +2 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/index.d.ts +5 -25
- package/dist/index.js +11256 -12335
- package/dist/index.js.map +1 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/structure/index.d.ts +3 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/menuItem.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Body, BodyProps } from './Body';
|
|
2
2
|
import { DateSection, DateSectionProps } from './DateSection';
|
|
3
|
-
import { EchoCard as BaseEchoCard } from './EchoCard';
|
|
3
|
+
import { EchoCard as BaseEchoCard, EchoCardProps } from './EchoCard';
|
|
4
4
|
import { LinkSection } from './LinkSection';
|
|
5
5
|
import { Title, TitleProps } from './Title';
|
|
6
6
|
declare type CardType = typeof BaseEchoCard & {
|
|
@@ -11,4 +11,4 @@ declare type CardType = typeof BaseEchoCard & {
|
|
|
11
11
|
};
|
|
12
12
|
declare const EchoCard: CardType;
|
|
13
13
|
export { EchoCard };
|
|
14
|
-
export type { TitleProps, DateSectionProps, BodyProps };
|
|
14
|
+
export type { EchoCardProps, TitleProps, DateSectionProps, BodyProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface WithLabel {
|
|
3
|
+
variant: 'square_icon_with_text';
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
interface WithoutLabel {
|
|
7
|
+
variant: 'circle_icon' | 'square_icon';
|
|
8
|
+
label?: never;
|
|
9
|
+
}
|
|
10
|
+
declare type MutuallyExclusiveVariantLabel = WithLabel | WithoutLabel;
|
|
11
|
+
export declare type FloatingActionButtonProps = MutuallyExclusiveVariantLabel & {
|
|
12
|
+
iconName: string;
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Disable button if true
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The method to be called when button is pressed
|
|
20
|
+
*/
|
|
21
|
+
onClick: () => void;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Floating actions buttons exists within the viewport, seperated from any sheet, dialog or menu
|
|
25
|
+
* and are typically used for special actions pertaining to the module they are used in.
|
|
26
|
+
* @return {*} {JSX.Element} Floating actions button
|
|
27
|
+
*/
|
|
28
|
+
declare const FloatingActionButton: React.FC<FloatingActionButtonProps>;
|
|
29
|
+
export { FloatingActionButton };
|
|
@@ -1 +1,17 @@
|
|
|
1
|
+
export * from './buttonWithPopover/ButtonWithPopover';
|
|
2
|
+
export * from './contextMenu/ContextMenu';
|
|
3
|
+
export * from './contextMenuPopover/DataInfoButton';
|
|
4
|
+
export * from './datePicker/ReactDatePicker';
|
|
5
|
+
export * from './dialogGenerator/DialogGenerator';
|
|
6
|
+
export * from './dropdown/Dropdown';
|
|
7
|
+
export * from './echoBottomBar/EchoBottomBar';
|
|
8
|
+
export * from './echoCard/index';
|
|
9
|
+
export * from './echoHeader/EchoHeader';
|
|
10
|
+
export * from './inlineTagIconLink/InlineTagIconLink';
|
|
11
|
+
export * from './listItem';
|
|
12
|
+
export * from './floatingActionButton/FloatingActionButton';
|
|
13
|
+
export * from './listRow/ListRow';
|
|
14
|
+
export * from './sidebarButton/SidebarButton';
|
|
1
15
|
export * from './sidesheet';
|
|
16
|
+
export * from './tagContextMenu/TagContextMenu';
|
|
17
|
+
export * from './timePicker/TimePicker';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
interface VisualComponent {
|
|
3
|
+
icon?: never;
|
|
4
|
+
visual?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
interface IconOptions {
|
|
7
|
+
icon?: {
|
|
8
|
+
name: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
};
|
|
12
|
+
visual?: never;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Make property "icon" and "visual" mutually exclusive
|
|
16
|
+
*/
|
|
17
|
+
declare type WithVisualOrIconOptions = VisualComponent | IconOptions;
|
|
18
|
+
interface ListItemBaseProps {
|
|
19
|
+
/**
|
|
20
|
+
* Add List Action Area
|
|
21
|
+
*/
|
|
22
|
+
listAction?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Main content Area
|
|
25
|
+
*/
|
|
26
|
+
primary: string | React.ReactNode;
|
|
27
|
+
secondary?: string | React.ReactNode;
|
|
28
|
+
tertiary?: string | React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Caption Area
|
|
31
|
+
*/
|
|
32
|
+
caption?: string | React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Add Item Action Area
|
|
35
|
+
*/
|
|
36
|
+
itemAction?: React.ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Change container element. Default is "li"
|
|
39
|
+
*/
|
|
40
|
+
as?: React.ElementType;
|
|
41
|
+
onCardClick?: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Style Modification
|
|
44
|
+
*/
|
|
45
|
+
className?: string;
|
|
46
|
+
style?: CSSProperties;
|
|
47
|
+
}
|
|
48
|
+
export declare type ListItemProps = ListItemBaseProps & WithVisualOrIconOptions;
|
|
49
|
+
declare function ListItem(props: ListItemProps): JSX.Element;
|
|
50
|
+
export { ListItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListItem';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { ExpandableRowProps } from '
|
|
3
|
-
import { IconListItem } from '../../types/iconListItem';
|
|
2
|
+
import { ExpandableRowProps, IconListItem } from '@types';
|
|
4
3
|
export interface ListRowProps {
|
|
5
4
|
isDraggable: boolean;
|
|
6
5
|
item: IconListItem;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PanelSize } from '../../types/menuItem';
|
|
3
|
+
export interface PanelContextState {
|
|
4
|
+
activePanel: string | undefined;
|
|
5
|
+
panelSize: PanelSize;
|
|
6
|
+
updateActivePanel: (newActivePanel: string | undefined) => void;
|
|
7
|
+
updatePanelSize: (newPanelSize: PanelSize) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Panel context with default initialized values
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare const PanelContext: React.Context<PanelContextState>;
|
|
14
|
+
/**
|
|
15
|
+
* The panel context wrapper that should be used within Panel component to store the state of the panel
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export declare const PanelContextWrapper: React.FC;
|
|
19
|
+
export default PanelContextWrapper;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface MenuButtonProps {
|
|
3
|
+
text: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
refValue?: React.RefObject<HTMLButtonElement>;
|
|
8
|
+
id?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The menu bottom items
|
|
12
|
+
* On desktop it will have an active border on the left,
|
|
13
|
+
* and on mobile the active border will be on the bottom
|
|
14
|
+
* Contains an icon and a descriptive text
|
|
15
|
+
* @param {*} {
|
|
16
|
+
* text, the text below the icon, also displayed on hover
|
|
17
|
+
* active, boolean describing the buttons active state
|
|
18
|
+
* children, the icon to be displayed
|
|
19
|
+
* onClick, the on click event
|
|
20
|
+
* refValue, a reference value in case its needed
|
|
21
|
+
* id: the id of the button in case its needed
|
|
22
|
+
* }
|
|
23
|
+
* @return {*} {JSX.Element}
|
|
24
|
+
*/
|
|
25
|
+
declare const MenuButton: React.FC<MenuButtonProps>;
|
|
26
|
+
export default MenuButton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuItem } from '../../../types/menuItem';
|
|
3
|
+
interface PanelProps {
|
|
4
|
+
menuItems: MenuItem[];
|
|
5
|
+
header: string | React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The actual right side panel. This component wraps the panel with a panel state
|
|
9
|
+
*
|
|
10
|
+
* @param {PanelProps} {
|
|
11
|
+
* menuItems, the items to be displayed in the menu and its belonging panels
|
|
12
|
+
* header, the header that will be displayed on mobile.
|
|
13
|
+
* If its a string then it will only display a header text. But it can also be a component with self defined html
|
|
14
|
+
* }
|
|
15
|
+
* @return {*} {JSX.Element}
|
|
16
|
+
*/
|
|
17
|
+
export declare const Panel: React.FC<PanelProps>;
|
|
18
|
+
export default Panel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PanelContentProps {
|
|
3
|
+
header: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
backToMainPanel?: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The component that wraps the panel drawer content
|
|
9
|
+
* This components displays a header with close and possible back button
|
|
10
|
+
* It also displays the content wrapped with some css
|
|
11
|
+
*
|
|
12
|
+
* @param {PanelContentProps} {
|
|
13
|
+
* header, the header text to display
|
|
14
|
+
* children, the panels content
|
|
15
|
+
* backToMainPanel: optional parameter that controls whether the panel should have a back button or not
|
|
16
|
+
* to be used in cases where there are panels within panels
|
|
17
|
+
* }
|
|
18
|
+
* @return {*} {JSX.Element}
|
|
19
|
+
*/
|
|
20
|
+
export declare const PanelContent: React.FC<PanelContentProps>;
|
|
21
|
+
export default PanelContent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuItem } from '../../../types/menuItem';
|
|
3
|
+
interface PanelWrapperProps {
|
|
4
|
+
menuItems: MenuItem[];
|
|
5
|
+
header: string | React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Component that display's the buttons in a panel. It will automatically try to calculate how many buttons to display
|
|
9
|
+
* and how many buttons to hide behind the more menu.
|
|
10
|
+
* It controls which panel to display when a button is clicked
|
|
11
|
+
* On desktop this component will render on the right side, and on the top in mobile view
|
|
12
|
+
*
|
|
13
|
+
* @param {*} {
|
|
14
|
+
* menuItems, the items to be displayed in the menu and its belonging panels
|
|
15
|
+
* header, the header that will be displayed on mobile.
|
|
16
|
+
* If its a string then it will only display a header text. But it can also be a component with self defined html
|
|
17
|
+
* }
|
|
18
|
+
* @return {*} {JSX.Element}
|
|
19
|
+
*/
|
|
20
|
+
export declare const PanelWrapper: React.FC<PanelWrapperProps>;
|
|
21
|
+
export default PanelWrapper;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PanelContextState } from './PanelContextWrapper';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that exposes panel context, if not used within a PanelContext this hook will throw an error
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @return {*} {PanelContextState} Returns the existing panel context or throws error if not used within a PanelContext
|
|
7
|
+
*/
|
|
8
|
+
export declare function usePanelContext(): PanelContextState;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type ButtonType = 'rightBarButton' | 'bottomBarButton' | 'leftBarButton' | 'tabButton';
|
|
3
|
+
export interface SidebarButtonProps {
|
|
4
|
+
text: string;
|
|
5
|
+
active: boolean;
|
|
6
|
+
onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
|
+
/**
|
|
8
|
+
* count must be bigger than 0.
|
|
9
|
+
*/
|
|
10
|
+
count?: number;
|
|
11
|
+
buttonType: ButtonType;
|
|
12
|
+
refValue?: React.RefObject<HTMLButtonElement>;
|
|
13
|
+
id?: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The reusable button component that is used in sidebars/bottom bar or as a tab button.
|
|
18
|
+
*
|
|
19
|
+
* On desktop it will have an active border on the left/right/top
|
|
20
|
+
* depending if ButtonType is set to: "rightBarButton"/"leftBarButton"/"bottomBarButton".
|
|
21
|
+
* The tabButton have the active border on the left.
|
|
22
|
+
*
|
|
23
|
+
* On mobile with the right sidebar, the active border will be on the bottom.
|
|
24
|
+
* In landscape mode with the bottom bar, the active border will be on the right.
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* The button contains an icon and a descriptive text.
|
|
28
|
+
* @param {*} {
|
|
29
|
+
* text: the text below the icon.
|
|
30
|
+
* active: boolean describing the button's active state.
|
|
31
|
+
* onClick: the onClick event.
|
|
32
|
+
* count: used for the tabButton.
|
|
33
|
+
* buttonType: decides which button type it is.
|
|
34
|
+
* refValue: a reference value, in case it's needed.
|
|
35
|
+
* id: the id of the button, in case it's needed.
|
|
36
|
+
* children: the icon to be displayed.
|
|
37
|
+
* }
|
|
38
|
+
* @return {*} {JSX.Element}
|
|
39
|
+
*/
|
|
40
|
+
export declare const SidebarButton: React.FC<SidebarButtonProps>;
|
|
41
|
+
export default SidebarButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './draggableItemsWrapper/DraggableItemsWrapper';
|
|
2
|
+
export { Icon } from './icon/Icon';
|
|
3
|
+
export { RadioButtonGroup } from './radioButtonGroup/RadioButtonGroup';
|
|
4
|
+
export * from './roundIconButton/RoundIconButton';
|
|
5
|
+
export { SliderField } from './sliderField/SliderField';
|
|
6
|
+
export { TagIcon } from './tagIcon/TagIcon';
|
|
7
|
+
export { TagIconShadowWrapper } from './tagIcon/TagIconShadow';
|
|
8
|
+
export * from './textIconButton/TextIconButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './echoAssets';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
|
+
import './theme/theme.css';
|
|
1
2
|
export * from './components';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export { DialogGenerator } from './components/dialogGenerator/DialogGenerator';
|
|
7
|
-
export { Dropdown } from './components/dropdown/Dropdown';
|
|
8
|
-
export { EchoBottomBar } from './components/echoBottomBar/EchoBottomBar';
|
|
9
|
-
export { EchoCard } from './components/echoCard/index';
|
|
10
|
-
export { EchoHeader } from './components/echoHeader/EchoHeader';
|
|
11
|
-
export { InlineTagIconLink } from './components/inlineTagIconLink/InlineTagIconLink';
|
|
12
|
-
export { ListRow } from './components/listRow/ListRow';
|
|
13
|
-
export { TagContextMenu } from './components/tagContextMenu/TagContextMenu';
|
|
14
|
-
export { TimePicker } from './components/timePicker/TimePicker';
|
|
15
|
-
export { DraggableItemsWrapper } from './elements/draggableItemsWrapper/DraggableItemsWrapper';
|
|
16
|
-
export { Icon } from './elements/icon/Icon';
|
|
17
|
-
export { RadioButtonGroup } from './elements/radioButtonGroup/RadioButtonGroup';
|
|
18
|
-
export * from './elements/roundIconButton/RoundIconButton';
|
|
19
|
-
export { SliderField } from './elements/sliderField/SliderField';
|
|
20
|
-
export { TagIcon } from './elements/tagIcon/TagIcon';
|
|
21
|
-
export { TagIconShadowWrapper } from './elements/tagIcon/TagIconShadow';
|
|
22
|
-
export { TextIconButton } from './elements/textIconButton/TextIconButton';
|
|
23
|
-
export { getIcon } from './helpers/getIcon';
|
|
24
|
-
export { IconList } from './structure/iconList/IconList';
|
|
25
|
-
export { LinkCard } from './structure/linkCard/LinkCard';
|
|
3
|
+
export * from './elements';
|
|
4
|
+
export * from './helpers';
|
|
5
|
+
export * from './icons';
|
|
6
|
+
export * from './structure';
|
|
26
7
|
export { themeConst } from './theme/themeConst';
|
|
27
8
|
export * from './types';
|
|
28
|
-
import './theme/theme.css';
|