@equinor/echo-components 0.1.17 → 0.2.2

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 CHANGED
@@ -59,3 +59,5 @@ Run:
59
59
  ```sh-session
60
60
  npm run storybook
61
61
  ```
62
+
63
+ Online storybook: https://equinor.github.io/EchoComponents/
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export interface PopupHeaderProps {
3
+ monthDate: Date;
4
+ date: Date;
5
+ changeYear: (year: number) => void;
6
+ changeMonth: (month: number) => void;
7
+ customHeaderCount: number;
8
+ decreaseMonth: VoidFunction;
9
+ increaseMonth: VoidFunction;
10
+ prevMonthButtonDisabled: boolean;
11
+ nextMonthButtonDisabled: boolean;
12
+ decreaseYear: VoidFunction;
13
+ increaseYear: VoidFunction;
14
+ prevYearButtonDisabled: boolean;
15
+ nextYearButtonDisabled: boolean;
16
+ changeDate?: (date: Date) => void;
17
+ }
18
+ declare const PopupHeader: React.FC<PopupHeaderProps>;
19
+ export default PopupHeader;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import 'react-datepicker/dist/react-datepicker.css';
3
+ import './reactDatePicker.css';
4
+ export interface DatePickerProps {
5
+ id: string;
6
+ value: Date | undefined | null;
7
+ label: string;
8
+ onChanged(date: Date | null): void;
9
+ disableFuture?: boolean;
10
+ disableBeforeDate?: Date;
11
+ className?: string;
12
+ popperPlacement?: 'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
13
+ showTimeSelect?: boolean;
14
+ }
15
+ export declare const ReactDatePicker: React.FC<DatePickerProps>;
16
+ export default ReactDatePicker;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare type BodyProps = {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ bodyText?: string;
6
+ };
7
+ export declare const Body: ({ bodyText, children, className }: Partial<BodyProps>) => JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare type DateSectionProps = {
3
+ date?: Date | null;
4
+ dateSectionText?: string;
5
+ children?: React.ReactNode;
6
+ className?: string;
7
+ };
8
+ export declare const DateSection: ({ dateSectionText, date, children, className }: Partial<DateSectionProps>) => JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface EchoCardProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ style?: React.CSSProperties;
6
+ }
7
+ export declare const EchoCard: React.FC<EchoCardProps>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { CardIcons } from './Title';
3
+ export declare type LinkSectionProps = {
4
+ children?: React.ReactNode;
5
+ linkSectionIcons?: CardIcons[];
6
+ className?: string;
7
+ };
8
+ export declare const LinkSection: ({ children, className, linkSectionIcons }: Partial<LinkSectionProps>) => JSX.Element;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export interface CardIcons {
3
+ name: string;
4
+ color: string;
5
+ onClick?: () => void;
6
+ }
7
+ export declare type TitleProps = {
8
+ headerTitle?: string;
9
+ onHeaderClick?: () => void;
10
+ headerIcons?: CardIcons[];
11
+ className?: string;
12
+ };
13
+ export declare const Title: ({ headerTitle, headerIcons, className, onHeaderClick }: Partial<TitleProps>) => JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { Body, BodyProps } from './Body';
2
+ import { DateSection, DateSectionProps } from './DateSection';
3
+ import { EchoCard as BaseEchoCard } from './EchoCard';
4
+ import { LinkSection } from './LinkSection';
5
+ import { Title, TitleProps } from './Title';
6
+ declare type CardType = typeof BaseEchoCard & {
7
+ Title: typeof Title;
8
+ Body: typeof Body;
9
+ LinkSection: typeof LinkSection;
10
+ DateSection: typeof DateSection;
11
+ };
12
+ declare const EchoCard: CardType;
13
+ export { EchoCard };
14
+ export type { TitleProps, DateSectionProps, BodyProps };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface TimePickerProps {
3
+ id: string;
4
+ value?: string;
5
+ label: string;
6
+ onValueChanged?: (time: string) => void;
7
+ className?: string;
8
+ readOnly?: boolean;
9
+ timeRange?: string[];
10
+ }
11
+ export declare const TimePicker: React.FC<TimePickerProps>;
12
+ export default TimePicker;
@@ -0,0 +1,13 @@
1
+ import React, { EventHandler, ReactElement, SyntheticEvent } from 'react';
2
+ export declare enum RoundIconButtonVariants {
3
+ OpenCloseButton = "openCloseButton",
4
+ ToggleButton = "toggleButton"
5
+ }
6
+ export interface RoundIconButtonProps {
7
+ label: string;
8
+ active?: boolean;
9
+ variant?: RoundIconButtonVariants;
10
+ children?: ReactElement;
11
+ onClick?: EventHandler<SyntheticEvent>;
12
+ }
13
+ export declare const RoundIconButton: React.FC<RoundIconButtonProps>;
@@ -1,21 +1,2 @@
1
1
  /// <reference types="react" />
2
- /**
3
- * Method that returns the relevant Icon for the iconType provided
4
- * Tag icon is the default JSX.Element Icon returned
5
- * @export
6
- * @param {('electrical'
7
- * | 'main Equipment'
8
- * | 'line'
9
- * | 'manual Valve'
10
- * | 'circuit/starter'
11
- * | 'instrument'
12
- * | 'cable'
13
- * | 'function'
14
- * | 'signal'
15
- * | 'telecom'
16
- * | 'junction box'
17
- * | 'administrative'
18
- * | string)} iconType The type of icon you want returned
19
- * @return {*} {JSX.Element} Relevant icon for the provided iconType
20
- */
21
- export declare function getIcon(iconType: 'electrical' | 'main equipment' | 'line' | 'manual valve' | 'circuit/starter' | 'instrument' | 'cable' | 'function' | 'signal' | 'telecom' | 'junction box' | 'administrative' | string): JSX.Element;
2
+ export declare function getIcon(tagCategoryDescription: string): JSX.Element;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ interface ViewTagIconProps {
3
+ tagCategoryDescription: string;
4
+ }
5
+ export declare enum TagCategoryType {
6
+ Electrical = "electrical",
7
+ MainEquipment = "main equipment",
8
+ Line = "line",
9
+ ManualValve = "manual valve",
10
+ CircuitAndStarter = "circuit",
11
+ Instrument = "instrument",
12
+ Cable = "cable",
13
+ Function = "function",
14
+ Signal = "signal",
15
+ Telecom = "telecom",
16
+ JunctionBox = "junction box",
17
+ Administrative = "administrative"
18
+ }
19
+ /**
20
+ * Method that returns the relevant Icon for the tagCategoryDescription provided
21
+ * Tag icon is the default JSX.Element Icon returned
22
+ * @export
23
+ * @param {('electrical'
24
+ * | 'main equipment'
25
+ * | 'line'
26
+ * | 'manual valve'
27
+ * | 'circuit/starter'
28
+ * | 'instrument'
29
+ * | 'cable'
30
+ * | 'function'
31
+ * | 'signal'
32
+ * | 'telecom'
33
+ * | 'junction box'
34
+ * | 'administrative'
35
+ * @return {*} {JSX.Element} Relevant icon for the provided tagCategoryDescription
36
+ */
37
+ export declare const TagCategoryIcon: React.FC<ViewTagIconProps>;
38
+ export default TagCategoryIcon;
package/dist/index.d.ts CHANGED
@@ -1,15 +1,19 @@
1
1
  export { ButtonWithPopover } from './components/buttonWithPopover/ButtonWithPopover';
2
2
  export { ContextMenu } from './components/contextMenu/ContextMenu';
3
3
  export { DataInfoButton } from './components/contextMenuPopover/DataInfoButton';
4
+ export { ReactDatePicker } from './components/datePicker/ReactDatePicker';
4
5
  export { DialogGenerator } from './components/dialogGenerator/DialogGenerator';
5
6
  export { Dropdown } from './components/dropdown/Dropdown';
7
+ export { EchoCard } from './components/echoCard/index';
6
8
  export { EchoHeader } from './components/echoHeader/EchoHeader';
7
9
  export { InlineTagIconLink } from './components/inlineTagIconLink/InlineTagIconLink';
8
10
  export { ListRow } from './components/listRow/ListRow';
9
11
  export { TagContextMenu } from './components/tagContextMenu/TagContextMenu';
12
+ export { TimePicker } from './components/timePicker/TimePicker';
10
13
  export { DraggableItemsWrapper } from './elements/draggableItemsWrapper/DraggableItemsWrapper';
11
14
  export { Icon } from './elements/icon/Icon';
12
15
  export { RadioButtonGroup } from './elements/radioButtonGroup/RadioButtonGroup';
16
+ export * from './elements/roundIconButton/RoundIconButton';
13
17
  export { SliderField } from './elements/sliderField/SliderField';
14
18
  export { TagIcon } from './elements/tagIcon/TagIcon';
15
19
  export { TagIconShadowWrapper } from './elements/tagIcon/TagIconShadow';