@openfin/ui-library 0.12.0 → 0.13.0-alpha.1678975108
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/controls/Button/button.d.ts +3 -3
- package/dist/components/controls/Button/button.variants.d.ts +4 -4
- package/dist/components/controls/ExpandableButton/expandableButton.d.ts +2 -2
- package/dist/components/controls/ExpandableButton/expandablePanel.d.ts +1 -1
- package/dist/components/controls/Toggle/toggle.d.ts +2 -2
- package/dist/components/elements/Badge/badge.d.ts +1 -1
- package/dist/components/elements/Calendar/calendar.d.ts +7 -0
- package/dist/components/elements/Calendar/index.d.ts +1 -0
- package/dist/components/elements/DropdownMenu/dropdownMenu.d.ts +5 -6
- package/dist/components/elements/DropdownMenu/index.d.ts +1 -0
- package/dist/components/elements/DropdownMenu/menu.d.ts +62 -0
- package/dist/components/elements/DropdownMenu/{dropdownOptionTitle.d.ts → optionTitle.d.ts} +2 -2
- package/dist/components/elements/Icon/icon.d.ts +4 -4
- package/dist/components/elements/IconWithBadge/iconWithBadge.d.ts +1 -1
- package/dist/components/elements/Loader/loader.d.ts +1 -1
- package/dist/components/elements/Loader/openfinLoader.d.ts +1 -1
- package/dist/components/input/BaseInput/baseInput.d.ts +1 -1
- package/dist/components/input/Checkbox/checkbox.d.ts +1 -1
- package/dist/components/input/DateInput/dateInput.d.ts +12 -0
- package/dist/components/input/DateInput/index.d.ts +1 -0
- package/dist/components/input/RadioGroup/radioGroup.d.ts +2 -2
- package/dist/components/input/RadioInput/radioInput.d.ts +2 -2
- package/dist/components/input/TextInput/textInput.d.ts +1 -1
- package/dist/components/layout/Box/box.d.ts +1 -1
- package/dist/components/layout/Box/types.d.ts +7 -7
- package/dist/components/system/HOC/index.d.ts +2 -2
- package/dist/components/system/ThemeProvider/lib/config.d.ts +3 -3
- package/dist/components/system/ThemeProvider/lib/constants.d.ts +1 -0
- package/dist/components/system/ThemeProvider/lib/helpers.d.ts +1 -1
- package/dist/components/system/ThemeProvider/lib/palette.d.ts +1 -0
- package/dist/components/system/ThemeProvider/lib/types.d.ts +20 -20
- package/dist/components/system/ThemeProvider/themeProvider.d.ts +1 -1
- package/dist/components/typography/Heading/heading.d.ts +111 -105
- package/dist/components/typography/Text/text.d.ts +1 -1
- package/dist/hooks/useColorScheme.d.ts +2 -2
- package/dist/hooks/useDropdownKeyboardNavigation.d.ts +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +229 -89
- package/dist/index.js.LICENSE.txt +2 -2
- package/package.json +11 -4
- package/dist/components/elements/DropdownMenu/dropdownOptionsMenu.d.ts +0 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { FontSizeType, FontWeightType } from '../../system/ThemeProvider/lib/types';
|
|
3
|
-
export
|
|
3
|
+
export type TextProps = HTMLAttributes<HTMLElement> & {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
size?: FontSizeType;
|
|
6
6
|
weight?: FontWeightType;
|
|
@@ -3,8 +3,8 @@ export declare const ColorScheme: {
|
|
|
3
3
|
readonly light: "light";
|
|
4
4
|
readonly system: "system";
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
|
|
6
|
+
export type ColorSchemeType = keyof typeof ColorScheme;
|
|
7
|
+
type UseColorSchemeProps = {
|
|
8
8
|
requestedScheme?: ColorSchemeType;
|
|
9
9
|
fallbackScheme?: Exclude<ColorSchemeType, 'system'>;
|
|
10
10
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
import { MenuOption } from '../components/elements/DropdownMenu';
|
|
3
|
+
/**
|
|
4
|
+
* Hook that handles keyboard navigation and type-to-select functionality of a dropdown menu and returns the focused option.
|
|
5
|
+
*
|
|
6
|
+
* @param {MenuOption[][]} options - An array of dropdown options, with each nested array representing a row of options.
|
|
7
|
+
* @param {MenuOption} selected - The currently selected dropdown option.
|
|
8
|
+
* @param {boolean} expandMenu - Whether the dropdown menu is expanded or not.
|
|
9
|
+
* @param {(toggle?: boolean) => void} handleExpandMenu - Function to handle toggling the dropdown menu.
|
|
10
|
+
* @param {(value: MenuOption) => void} onChange - Function to handle changing the selected option.
|
|
11
|
+
* @returns {{ focusedOption: MenuOption, handleKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void }} - The currently focused option and a function to handle keydown events.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useDropdownKeyboardNavigation: (options: MenuOption[][], selected: MenuOption | undefined, expandMenu: boolean, handleExpandMenu: (toggle?: boolean) => void, onChange: (value: MenuOption) => void) => {
|
|
14
|
+
focusedOption: MenuOption;
|
|
15
|
+
handleKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
16
|
+
};
|
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/Calendar';
|
|
5
6
|
export * from './components/elements/DropdownMenu';
|
|
6
7
|
export * from './components/elements/Icon';
|
|
7
8
|
export * from './components/elements/IconWithBadge';
|
|
@@ -13,6 +14,7 @@ export * from './components/input/NumberInput';
|
|
|
13
14
|
export * from './components/input/Checkbox';
|
|
14
15
|
export * from './components/input/RadioInput';
|
|
15
16
|
export * from './components/input/RadioGroup';
|
|
17
|
+
export * from './components/input/DateInput';
|
|
16
18
|
export * from './components/layout/Box';
|
|
17
19
|
export * from './components/layout/DefinitionList';
|
|
18
20
|
export * from './components/system/GlobalStyles';
|
|
@@ -23,5 +25,6 @@ export * from './components/typography/Text';
|
|
|
23
25
|
export * from './hooks/useColorScheme';
|
|
24
26
|
export * from './hooks/useMediaQuery';
|
|
25
27
|
export * from './hooks/usePrevious';
|
|
28
|
+
export * from './hooks/useDropdownKeyboardNavigation';
|
|
26
29
|
export * as StoryHelpers from './storybookHelpers';
|
|
27
30
|
export * from './lib/whenFin';
|