@equinor/echo-components 0.5.8-rc2 → 0.5.10

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.
Files changed (90) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +62 -62
  3. package/dist/components/buttonWithPopover/ButtonWithPopover.d.ts +21 -21
  4. package/dist/components/contextMenu/ContextMenu.d.ts +35 -35
  5. package/dist/components/contextMenuPopover/DataInfoButton.d.ts +19 -19
  6. package/dist/components/contextMenuPopover/DataInfoPopover.d.ts +18 -18
  7. package/dist/components/datePicker/PopupHeader.d.ts +19 -19
  8. package/dist/components/datePicker/ReactDatePicker.d.ts +19 -19
  9. package/dist/components/dialogGenerator/DialogGenerator.d.ts +26 -26
  10. package/dist/components/dropdown/Dropdown.d.ts +37 -37
  11. package/dist/components/echoBottomBar/EchoBottomBar.d.ts +7 -7
  12. package/dist/components/echoCard/Body.d.ts +7 -7
  13. package/dist/components/echoCard/DateSection.d.ts +8 -8
  14. package/dist/components/echoCard/EchoCard.d.ts +7 -7
  15. package/dist/components/echoCard/LinkSection.d.ts +8 -8
  16. package/dist/components/echoCard/Title.d.ts +13 -13
  17. package/dist/components/echoCard/index.d.ts +14 -14
  18. package/dist/components/echoHeader/EchoHeader.d.ts +20 -20
  19. package/dist/components/floatingActionButton/FloatingActionButton.d.ts +29 -29
  20. package/dist/components/floatingSearchBar/FloatingSearchBar.d.ts +31 -0
  21. package/dist/components/index.d.ts +19 -17
  22. package/dist/components/inlineTagIconLink/InlineTagIconLink.d.ts +12 -12
  23. package/dist/components/listItem/ListItem.d.ts +50 -50
  24. package/dist/components/listItem/index.d.ts +1 -1
  25. package/dist/components/listRow/ListRow.d.ts +29 -29
  26. package/dist/components/sidebarButton/SidebarButton.d.ts +61 -41
  27. package/dist/components/sidesheet/enums.d.ts +5 -5
  28. package/dist/components/sidesheet/index.d.ts +11 -11
  29. package/dist/components/sidesheet/sheet/Sheet.d.ts +19 -19
  30. package/dist/components/sidesheet/sheet/index.d.ts +1 -1
  31. package/dist/components/sidesheet/sheet/utils.d.ts +2 -2
  32. package/dist/components/sidesheet/sheetTopArea/SheetTopArea.d.ts +16 -16
  33. package/dist/components/sidesheet/sheetTopArea/index.d.ts +1 -1
  34. package/dist/components/splitView/SplitView.d.ts +10 -0
  35. package/dist/components/splitView/index.d.ts +8 -0
  36. package/dist/components/splitView/left/SplitViewLeft.d.ts +7 -0
  37. package/dist/components/tagContextMenu/TagContextMenu.d.ts +30 -30
  38. package/dist/components/timePicker/TimePicker.d.ts +12 -12
  39. package/dist/elements/draggableItemsWrapper/DraggableItemsWrapper.d.ts +18 -18
  40. package/dist/elements/icon/Icon.d.ts +20 -20
  41. package/dist/elements/index.d.ts +8 -8
  42. package/dist/elements/radioButtonGroup/RadioButtonGroup.d.ts +20 -20
  43. package/dist/elements/roundIconButton/RoundIconButton.d.ts +13 -13
  44. package/dist/elements/sliderField/SliderField.d.ts +25 -25
  45. package/dist/elements/tagIcon/TagIcon.d.ts +16 -16
  46. package/dist/elements/tagIcon/TagIconShadow.d.ts +13 -13
  47. package/dist/elements/textIconButton/TextIconButton.d.ts +19 -19
  48. package/dist/helpers/classnames.d.ts +5 -5
  49. package/dist/helpers/getIcon.d.ts +2 -2
  50. package/dist/helpers/index.d.ts +3 -3
  51. package/dist/helpers/tagCategoryIcon.d.ts +38 -38
  52. package/dist/hooks/index.d.ts +2 -0
  53. package/dist/hooks/useEventListener.d.ts +3 -0
  54. package/dist/hooks/useKeyboardNavigation.d.ts +21 -0
  55. package/dist/icons/echoAssets/external.d.ts +5 -3
  56. package/dist/icons/echoAssets/index.d.ts +3 -2
  57. package/dist/icons/echoAssets/notifications.d.ts +9 -0
  58. package/dist/icons/echoAssets/workOrders.d.ts +11 -0
  59. package/dist/icons/index.d.ts +3 -1
  60. package/dist/index.d.ts +9 -8
  61. package/dist/index.js +992 -570
  62. package/dist/index.js.map +1 -1
  63. package/dist/setupTests.d.ts +1 -1
  64. package/dist/structure/iconList/IconList.d.ts +32 -32
  65. package/dist/structure/iconList/createListRow.d.ts +14 -14
  66. package/dist/structure/index.d.ts +3 -3
  67. package/dist/structure/linkCard/LinkCard.d.ts +26 -26
  68. package/dist/structure/optionsList/OptionsList.d.ts +24 -24
  69. package/dist/theme/index.d.ts +1 -1
  70. package/dist/theme/themeConst.d.ts +65 -65
  71. package/dist/types/actionButton.d.ts +6 -6
  72. package/dist/types/dataInformation.d.ts +8 -8
  73. package/dist/types/draggableItem.d.ts +5 -5
  74. package/dist/types/expandableRowProps.d.ts +6 -6
  75. package/dist/types/iconItem.d.ts +4 -4
  76. package/dist/types/iconListItem.d.ts +6 -6
  77. package/dist/types/index.d.ts +9 -10
  78. package/dist/types/linkCardItem.d.ts +5 -5
  79. package/dist/types/optionsItem.d.ts +6 -6
  80. package/dist/types/radioButtonItem.d.ts +4 -4
  81. package/package.json +121 -126
  82. package/dist/components/rightPanel/PanelContextWrapper.d.ts +0 -19
  83. package/dist/components/rightPanel/index.d.ts +0 -5
  84. package/dist/components/rightPanel/menuButton/MenuButton.d.ts +0 -26
  85. package/dist/components/rightPanel/panel/Panel.d.ts +0 -18
  86. package/dist/components/rightPanel/panelContent/PanelContent.d.ts +0 -21
  87. package/dist/components/rightPanel/panelWrapper/PanelWrapper.d.ts +0 -21
  88. package/dist/components/rightPanel/usePanelContext.d.ts +0 -8
  89. package/dist/icons/echoAssets/data.d.ts +0 -3
  90. package/dist/types/menuItem.d.ts +0 -9
@@ -1,8 +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;
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;
@@ -1,13 +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;
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;
@@ -1,14 +1,14 @@
1
- import { Body, BodyProps } from './Body';
2
- import { DateSection, DateSectionProps } from './DateSection';
3
- import { EchoCard as BaseEchoCard, EchoCardProps } 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 { EchoCardProps, TitleProps, DateSectionProps, BodyProps };
1
+ import { Body, BodyProps } from './Body';
2
+ import { DateSection, DateSectionProps } from './DateSection';
3
+ import { EchoCard as BaseEchoCard, EchoCardProps } 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 { EchoCardProps, TitleProps, DateSectionProps, BodyProps };
@@ -1,20 +1,20 @@
1
- import React from 'react';
2
- export interface EchoHeaderProps {
3
- moduleTitle: string;
4
- moduleIcon: string | React.FC;
5
- plantName?: string;
6
- customHeaderSection?: React.FC;
7
- }
8
- /**
9
- * Component that renders the Echo header
10
- *
11
- * @param {EchoHeaderProps} {
12
- * moduleTitle: the title of the module
13
- * moduleIcon: the module Icon
14
- * plantName: show the plant name next to the module title
15
- * customSection: a section in the header where there can be custom components
16
- * }
17
- * @returns {*} {JSX.Element} Echo header with custom section
18
- */
19
- export declare const EchoHeader: React.FC<EchoHeaderProps>;
20
- export default EchoHeader;
1
+ import React from 'react';
2
+ export interface EchoHeaderProps {
3
+ moduleTitle: string;
4
+ moduleIcon: string | React.FC;
5
+ plantName?: string;
6
+ customHeaderSection?: React.FC;
7
+ }
8
+ /**
9
+ * Component that renders the Echo header
10
+ *
11
+ * @param {EchoHeaderProps} {
12
+ * moduleTitle: the title of the module
13
+ * moduleIcon: the module Icon
14
+ * plantName: show the plant name next to the module title
15
+ * customSection: a section in the header where there can be custom components
16
+ * }
17
+ * @returns {*} {JSX.Element} Echo header with custom section
18
+ */
19
+ export declare const EchoHeader: React.FC<EchoHeaderProps>;
20
+ export default EchoHeader;
@@ -1,29 +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
+ 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 };
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ interface Suggestion {
3
+ label: string;
4
+ id: string;
5
+ }
6
+ export interface FloatingSearchBarProps {
7
+ ariaLabel?: string;
8
+ /**
9
+ * Placeholder text
10
+ */
11
+ placeholder?: string;
12
+ /**
13
+ * Callback for when the search query changes
14
+ */
15
+ onSearchQueryChange: (value: string) => void;
16
+ /**
17
+ * Array of suggestions that matches the search query
18
+ */
19
+ suggestions?: Suggestion[];
20
+ onSuggestionClick: (suggestion: Suggestion) => void;
21
+ }
22
+ /**
23
+ * Floating search bar
24
+ *
25
+ * @param {FloatingSearchBarProps} {
26
+ * }
27
+ * @return {*} {JSX.Element}
28
+ */
29
+ declare const FloatingSearchBar: React.FC<FloatingSearchBarProps>;
30
+ export { FloatingSearchBar };
31
+ export type { Suggestion };
@@ -1,17 +1,19 @@
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';
15
- export * from './sidesheet';
16
- export * from './tagContextMenu/TagContextMenu';
17
- export * from './timePicker/TimePicker';
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 './floatingActionButton/FloatingActionButton';
11
+ export * from './floatingSearchBar/FloatingSearchBar';
12
+ export * from './inlineTagIconLink/InlineTagIconLink';
13
+ export * from './listItem';
14
+ export * from './listRow/ListRow';
15
+ export * from './sidebarButton/SidebarButton';
16
+ export * from './sidesheet';
17
+ export * from './splitView';
18
+ export * from './tagContextMenu/TagContextMenu';
19
+ export * from './timePicker/TimePicker';
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
- export interface InlineTagIconLinkProps {
3
- onClickHandler?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
4
- tagNo: string;
5
- description: string;
6
- tagCategoryDescription?: string;
7
- icon?: string | React.ReactNode;
8
- legendColor: string;
9
- disableHover?: boolean;
10
- }
11
- export declare const InlineTagIconLink: React.FC<InlineTagIconLinkProps>;
12
- export default InlineTagIconLink;
1
+ import React from 'react';
2
+ export interface InlineTagIconLinkProps {
3
+ onClickHandler?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
4
+ tagNo: string;
5
+ description: string;
6
+ tagCategoryDescription?: string;
7
+ icon?: string | React.ReactNode;
8
+ legendColor: string;
9
+ disableHover?: boolean;
10
+ }
11
+ export declare const InlineTagIconLink: React.FC<InlineTagIconLinkProps>;
12
+ export default InlineTagIconLink;
@@ -1,50 +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 };
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 };
@@ -1 +1 @@
1
- export * from './ListItem';
1
+ export * from './ListItem';
@@ -1,29 +1,29 @@
1
- import React, { CSSProperties } from 'react';
2
- import { ExpandableRowProps, IconListItem } from '@types';
3
- export interface ListRowProps {
4
- isDraggable: boolean;
5
- item: IconListItem;
6
- expandable?: ExpandableRowProps;
7
- rowIndex: number;
8
- style?: CSSProperties;
9
- }
10
- /**
11
- * Component that renders one row in a list. The row can be marked as draggable and expandable
12
- *
13
- * @param {ListRowProps} {
14
- * isDraggable: flag to indicate that the row can be rearranged in a list
15
- * item: { The item to be rendered in the row
16
- * title: the title of the item in the row
17
- * subtitle: the subtitle of the item in the row
18
- * icons: the icons that will be displayed on the same row, and their respective actions
19
- * }
20
- * expandable: { object with properties to handle if the row is expandable. If undefined the row cannot be expanded
21
- * iconItems: the items that will be displayed if row is expanded, and their respective actions
22
- * expanded: flag to indicate if the row is expanded or not
23
- * setExpanded: method that updates the expanded flag
24
- * }
25
- * style: style element to override wrapper style
26
- * }
27
- * @return {*} {JSX.Element} a row element to be used in a list
28
- */
29
- export declare const ListRow: React.FC<ListRowProps>;
1
+ import React, { CSSProperties } from 'react';
2
+ import { ExpandableRowProps, IconListItem } from '@types';
3
+ export interface ListRowProps {
4
+ isDraggable: boolean;
5
+ item: IconListItem;
6
+ expandable?: ExpandableRowProps;
7
+ rowIndex: number;
8
+ style?: CSSProperties;
9
+ }
10
+ /**
11
+ * Component that renders one row in a list. The row can be marked as draggable and expandable
12
+ *
13
+ * @param {ListRowProps} {
14
+ * isDraggable: flag to indicate that the row can be rearranged in a list
15
+ * item: { The item to be rendered in the row
16
+ * title: the title of the item in the row
17
+ * subtitle: the subtitle of the item in the row
18
+ * icons: the icons that will be displayed on the same row, and their respective actions
19
+ * }
20
+ * expandable: { object with properties to handle if the row is expandable. If undefined the row cannot be expanded
21
+ * iconItems: the items that will be displayed if row is expanded, and their respective actions
22
+ * expanded: flag to indicate if the row is expanded or not
23
+ * setExpanded: method that updates the expanded flag
24
+ * }
25
+ * style: style element to override wrapper style
26
+ * }
27
+ * @return {*} {JSX.Element} a row element to be used in a list
28
+ */
29
+ export declare const ListRow: React.FC<ListRowProps>;
@@ -1,41 +1,61 @@
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;
1
+ import React from 'react';
2
+ export declare type ButtonPosition = 'right' | 'bottom' | 'left' | 'tab';
3
+ export interface SidebarButtonProps {
4
+ /**
5
+ * The text below the icon.
6
+ */
7
+ text: string;
8
+ /**
9
+ * Boolean describing the button's active state.
10
+ */
11
+ active: boolean;
12
+ /**
13
+ * The onClick event.
14
+ */
15
+ onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;
16
+ /**
17
+ * Will display a count on the button, and must be bigger than 0.
18
+ */
19
+ count?: number;
20
+ /**
21
+ * Decides the active border. Could be set to 'right'/'bottom'/'left', depending if the button is placed in the right bar/left bar/bottom bar, or could be set to 'tab' if it's a tab button.
22
+ */
23
+ buttonPosition: ButtonPosition;
24
+ /**
25
+ * A reference value, in case it's needed.
26
+ */
27
+ refValue?: React.RefObject<HTMLButtonElement>;
28
+ /**
29
+ * The id of the button, in case it's needed.
30
+ */
31
+ id?: string;
32
+ /**
33
+ * The icon to be displayed.
34
+ */
35
+ children: React.ReactNode;
36
+ }
37
+ /**
38
+ * The reusable button component that is used in the sidebars/bottom bar.
39
+ *
40
+ * On desktop it will have an active border on the left/right/top,
41
+ * depending if the ButtonPosition is set to: "right"/"left"/"bottom".
42
+ * The active border will be on the right if it's a tab button and ButtonPosition is set to: "tab".
43
+ *
44
+ * On mobile with the right sidebar, the active border will be on the bottom.
45
+ * In landscape mode with the bottom bar, the active border will be on the right.
46
+ *
47
+ * The button contains an icon and a descriptive text.
48
+ * @param {*} {
49
+ * text: the text below the icon.
50
+ * active: boolean describing the button's active state.
51
+ * onClick: the onClick event.
52
+ * count: will display a count on the button.
53
+ * buttonPosition: decides the active border, depending if the button is placed in the right bar/left bar/bottom bar.
54
+ * refValue: a reference value, in case it's needed.
55
+ * id: the id of the button, in case it's needed.
56
+ * children: the icon to be displayed.
57
+ * }
58
+ * @return {*} {JSX.Element}
59
+ */
60
+ export declare const SidebarButton: React.FC<SidebarButtonProps>;
61
+ export default SidebarButton;
@@ -1,5 +1,5 @@
1
- export declare enum SideSheetOrientation {
2
- Vertical = "vertical",
3
- Horizontal = "horizontal",
4
- Fullscreen = "fullscreen"
5
- }
1
+ export declare enum SideSheetOrientation {
2
+ Vertical = "vertical",
3
+ Horizontal = "horizontal",
4
+ Fullscreen = "fullscreen"
5
+ }
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
- import { SideSheetOrientation } from './enums';
3
- import { SheetProps } from './sheet';
4
- import { SheetTopAreaProps } from './sheetTopArea';
5
- interface SideSheetProps extends SheetProps, SheetTopAreaProps {
6
- open: boolean;
7
- children: React.ReactNode;
8
- }
9
- declare function SideSheet({ open, side, orientation, floating, children, className, style, ...topBarProps }: SideSheetProps): JSX.Element | null;
10
- export type { SideSheetProps };
11
- export { SideSheet, SideSheetOrientation };
1
+ import React from 'react';
2
+ import { SideSheetOrientation } from './enums';
3
+ import { SheetProps } from './sheet';
4
+ import { SheetTopAreaProps } from './sheetTopArea';
5
+ interface SideSheetProps extends SheetProps, SheetTopAreaProps {
6
+ open: boolean;
7
+ children: React.ReactNode;
8
+ }
9
+ declare function SideSheet({ open, side, orientation, floating, children, className, style, ...topBarProps }: SideSheetProps): JSX.Element | null;
10
+ export type { SideSheetProps };
11
+ export { SideSheet, SideSheetOrientation };
@@ -1,19 +1,19 @@
1
- import React, { CSSProperties } from 'react';
2
- import { SideSheetOrientation } from '../enums';
3
- interface Style {
4
- style?: CSSProperties;
5
- className?: string;
6
- }
7
- interface SheetProps extends Style {
8
- children: React.ReactNode;
9
- side?: 'left' | 'right';
10
- orientation?: SideSheetOrientation;
11
- /**
12
- * Default true. Use this to make Sheet push content to the side.
13
- * Only affects "vertical" orientation.
14
- */
15
- floating?: boolean;
16
- }
17
- declare function Sheet({ side, orientation, floating, children, className, style }: SheetProps): JSX.Element;
18
- export type { SheetProps };
19
- export { Sheet };
1
+ import React, { CSSProperties } from 'react';
2
+ import { SideSheetOrientation } from '../enums';
3
+ interface Style {
4
+ style?: CSSProperties;
5
+ className?: string;
6
+ }
7
+ interface SheetProps extends Style {
8
+ children: React.ReactNode;
9
+ side?: 'left' | 'right';
10
+ orientation?: SideSheetOrientation;
11
+ /**
12
+ * Default true. Use this to make Sheet push content to the side.
13
+ * Only affects "vertical" orientation.
14
+ */
15
+ floating?: boolean;
16
+ }
17
+ declare function Sheet({ side, orientation, floating, children, className, style }: SheetProps): JSX.Element;
18
+ export type { SheetProps };
19
+ export { Sheet };
@@ -1 +1 @@
1
- export * from './Sheet';
1
+ export * from './Sheet';
@@ -1,2 +1,2 @@
1
- import { SideSheetOrientation } from '../enums';
2
- export declare function getSheetContainerClass(side?: 'left' | 'right', orientation?: SideSheetOrientation, floating?: boolean): string;
1
+ import { SideSheetOrientation } from '../enums';
2
+ export declare function getSheetContainerClass(side?: 'left' | 'right', orientation?: SideSheetOrientation, floating?: boolean): string;