react-magma-dom 4.7.0 → 4.8.0-next.1

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.
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ import { ReferenceType } from '@floating-ui/react-dom';
2
2
  import { UseSelectGetItemPropsOptions, UseSelectGetMenuPropsOptions } from 'downshift';
3
+ import React from 'react';
3
4
  import { SelectComponents } from './components';
4
- import { ReferenceType } from '@floating-ui/react-dom';
5
5
  interface ItemsListProps<T> {
6
6
  customComponents?: SelectComponents<T>;
7
7
  floatingElementStyles?: React.CSSProperties;
@@ -16,6 +16,7 @@ interface ItemsListProps<T> {
16
16
  maxHeight?: number | string;
17
17
  menuStyle?: React.CSSProperties;
18
18
  setFloating?: (node: ReferenceType) => void;
19
+ setHighlightedIndex?: (index: number) => void;
19
20
  }
20
21
  export declare function ItemsList<T>(props: ItemsListProps<T>): JSX.Element;
21
22
  export {};
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { IconButtonProps } from '../IconButton';
3
- import { SpinnerProps } from '../Spinner';
4
2
  import { IconProps } from 'react-magma-icons';
5
3
  import { ThemeInterface } from '../../theme/magma';
4
+ import { IconButtonProps } from '../IconButton';
5
+ import { SpinnerProps } from '../Spinner';
6
6
  export declare type ItemRenderOptions<T> = {
7
7
  key: string;
8
8
  isFocused?: boolean;
@@ -22,7 +22,7 @@ export declare type SelectComponents<T> = {
22
22
  export declare const DefaultClearIndicator: (props: any) => JSX.Element;
23
23
  export declare const DefaultDropdownIndicator: (props: any) => JSX.Element;
24
24
  export declare const DefaultLoadingIndicator: (props: any) => JSX.Element;
25
- export declare function DefaultItem<T>({ itemRef, itemString, isInverse, ...props }: ItemRenderOptions<T>): JSX.Element;
25
+ export declare function DefaultItem<T>({ itemRef, itemString, isInverse, isDisabled, ...props }: ItemRenderOptions<T>): JSX.Element;
26
26
  export declare function defaultComponents<T>(props: SelectComponents<T>): {
27
27
  ClearIndicator: React.FunctionComponent<({} & import("../IconButton").IconTextButtonProps) | ({
28
28
  children?: never;
@@ -1,13 +1,14 @@
1
- import * as React from 'react';
2
- import { UseMultipleSelectionProps, UseSelectProps } from 'downshift';
3
1
  import { ReferenceType } from '@floating-ui/react-dom/dist/floating-ui.react-dom';
4
- import { SelectComponents } from './components';
2
+ import { UseMultipleSelectionProps, UseSelectProps } from 'downshift';
3
+ import * as React from 'react';
5
4
  import { Omit, XOR } from '../../utils';
6
5
  import { LabelPosition } from '../Label';
6
+ import { SelectComponents } from './components';
7
7
  export declare type SelectOptions = string | {
8
8
  value: string;
9
9
  label: string;
10
10
  [key: string]: any;
11
+ disabled?: boolean;
11
12
  } | any;
12
13
  export interface InternalSelectProps<T> {
13
14
  /**
@@ -123,6 +124,10 @@ export interface SelectProps<T extends SelectOptions> extends UseSelectProps<T>,
123
124
  * @internal
124
125
  */
125
126
  isMulti?: false;
127
+ /**
128
+ * Index of the item that should be highlighted by default. Use this prop when you want to set a specific item on the list to be highlighted when the component is first rendered.
129
+ */
130
+ initialHighlightedIndex?: number;
126
131
  /**
127
132
  * Event that fires when the trigger button loses focus
128
133
  */
@@ -177,6 +182,11 @@ export declare function instanceOfToBeCreatedItemObject(object: any): object is
177
182
  value: string;
178
183
  react_magma__created_item: boolean;
179
184
  };
185
+ export declare function instanceOfItemWithOptionalDisabled(object: any): object is {
186
+ label: string;
187
+ value: string;
188
+ disabled?: boolean;
189
+ };
180
190
  export declare type XORSelectProps<T> = XOR<SelectProps<T>, MultiSelectProps<T>>;
181
191
  export declare const SelectStateChangeTypes: {
182
192
  MenuKeyDownArrowDown: import("downshift").UseSelectStateChangeTypes.MenuKeyDownArrowDown;
@@ -37,6 +37,7 @@ export declare const StyledItem: import("@emotion/styled").StyledComponent<{
37
37
  } & {
38
38
  isInverse?: boolean;
39
39
  isFocused?: boolean;
40
+ isDisabled?: boolean;
40
41
  }, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
41
42
  export declare const SelectedItemsWrapper: import("@emotion/styled").StyledComponent<{
42
43
  theme?: import("@emotion/react").Theme;
@@ -0,0 +1 @@
1
+ export declare function isItemDisabled(item: any): boolean;