@openfin/ui-library 0.11.0 → 0.12.0-alpha.1677874224
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/elements/DropdownMenu/dropdownMenu.d.ts +14 -0
- package/dist/components/elements/DropdownMenu/dropdownOptionTitle.d.ts +15 -0
- package/dist/components/elements/DropdownMenu/dropdownOptionsMenu.d.ts +24 -0
- package/dist/components/elements/DropdownMenu/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +70 -5
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DropdownOption } from './dropdownOptionsMenu';
|
|
3
|
+
export interface DropdownMenuProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
selected?: DropdownOption;
|
|
6
|
+
options?: DropdownOption[];
|
|
7
|
+
onChange: (value: DropdownOption) => void;
|
|
8
|
+
onOptionHover?: (value?: unknown) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
renderLabel?: (option: DropdownOption, isOpen: boolean, onClick: () => void) => ReactNode;
|
|
11
|
+
fitContent?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const DropdownMenu: FC<DropdownMenuProps>;
|
|
14
|
+
export declare const ButtonImage: import("styled-components").StyledComponent<"img", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { TextProps } from '../../typography/Text';
|
|
3
|
+
interface DropdownOptionTitleProps extends Omit<TextProps, 'children'> {
|
|
4
|
+
children?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A single line of Text that will overflow with ellipsis. When overflown mousing over the text will display a tooltip with the text content.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DropdownOptionTitle: FC<DropdownOptionTitleProps>;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a element's content is overflown.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isElementOverflown(element: HTMLElement): boolean;
|
|
14
|
+
export declare const useTooltip: <R extends HTMLElement>(tooltip?: string) => React.Ref<R>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export interface DropdownOption {
|
|
3
|
+
title: string;
|
|
4
|
+
value: unknown;
|
|
5
|
+
iconUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DropdownOptionsMenuProps {
|
|
8
|
+
options: DropdownOption[];
|
|
9
|
+
selected?: DropdownOption;
|
|
10
|
+
expandMenu: {
|
|
11
|
+
show: boolean;
|
|
12
|
+
requestedByCollapse: boolean;
|
|
13
|
+
};
|
|
14
|
+
dropdownMenuId?: string;
|
|
15
|
+
setExpandMenu?: Dispatch<SetStateAction<{
|
|
16
|
+
show: boolean;
|
|
17
|
+
requestedByCollapse: boolean;
|
|
18
|
+
}>>;
|
|
19
|
+
onOptionHover?: (value?: unknown) => void;
|
|
20
|
+
onChange: (value: DropdownOption) => void;
|
|
21
|
+
onCollapseRequest: () => void;
|
|
22
|
+
fitContent?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const DropdownOptionsMenu: React.FC<DropdownOptionsMenuProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dropdownMenu';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './components/controls/Button';
|
|
|
2
2
|
export * from './components/controls/ExpandableButton';
|
|
3
3
|
export * from './components/controls/Toggle';
|
|
4
4
|
export * from './components/elements/Badge';
|
|
5
|
+
export * from './components/elements/DropdownMenu';
|
|
5
6
|
export * from './components/elements/Icon';
|
|
6
7
|
export * from './components/elements/IconWithBadge';
|
|
7
8
|
export * from './components/elements/Loader';
|