widenarrow-ui 2.3.8 → 2.4.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.
- package/lib/index.css +1 -1
- package/lib/index.d.ts +329 -85
- package/lib/index.esm.css +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, { CSSProperties, ReactElement, MouseEvent,
|
|
2
|
+
import react__default, { CSSProperties, RefObject, ReactElement, MouseEvent, ReactNode, ChangeEvent, KeyboardEvent, FocusEvent, FC, AriaAttributes } from 'react';
|
|
3
3
|
import { Placement, PositioningStrategy } from '@popperjs/core';
|
|
4
4
|
|
|
5
5
|
interface AnimatedCountProps {
|
|
@@ -118,6 +118,7 @@ declare enum IconTypes {
|
|
|
118
118
|
FOLDER_300 = "iconFolder300",
|
|
119
119
|
FOLDER_FILLED = "iconFolderFilled",
|
|
120
120
|
FORMAT_CODE = "iconFormatCode",
|
|
121
|
+
FORMAT_COLOR_RESET = "iconFormatColorReset",
|
|
121
122
|
FORMAT_FONT_SIZE = "iconFormatFontSize",
|
|
122
123
|
FORMAT_IMAGE_BOTTOM = "iconFormatImgBottom",
|
|
123
124
|
FORMAT_IMAGE_CENTER_CENTER = "iconFormatImgCenterCenter",
|
|
@@ -456,10 +457,12 @@ interface BadgeProps {
|
|
|
456
457
|
onRemoveCallback?: (badgeItem: BadgeItem) => void;
|
|
457
458
|
/** Accessible name and tooltip for the remove button. Set it whenever `onRemoveCallback` is. */
|
|
458
459
|
removeLabel?: string;
|
|
460
|
+
/** Ref to the remove button, e.g. to move focus to it. Only set while `onRemoveCallback` is. */
|
|
461
|
+
removeButtonRef?: RefObject<HTMLButtonElement>;
|
|
459
462
|
}
|
|
460
463
|
|
|
461
464
|
declare const Badge: {
|
|
462
|
-
({ badgeItem, className, displayAll, leftIcon, maxWidth, style, onClickCallback, onRemoveCallback, removeLabel }: BadgeProps): JSX.Element;
|
|
465
|
+
({ badgeItem, className, displayAll, leftIcon, maxWidth, style, onClickCallback, onRemoveCallback, removeLabel, removeButtonRef }: BadgeProps): JSX.Element;
|
|
463
466
|
displayName: string;
|
|
464
467
|
};
|
|
465
468
|
|
|
@@ -655,6 +658,251 @@ interface CheckboxProps {
|
|
|
655
658
|
|
|
656
659
|
declare const Checkbox: FC<CheckboxProps>;
|
|
657
660
|
|
|
661
|
+
interface NoDataMessageProps {
|
|
662
|
+
id?: string;
|
|
663
|
+
className?: string;
|
|
664
|
+
icon?: Partial<IconTypes>;
|
|
665
|
+
title?: string;
|
|
666
|
+
message?: string;
|
|
667
|
+
/** @default false */
|
|
668
|
+
absoluteCenter?: boolean;
|
|
669
|
+
customLink?: ReactNode;
|
|
670
|
+
button?: {
|
|
671
|
+
onClickCallback: () => void;
|
|
672
|
+
text: string;
|
|
673
|
+
icon: Partial<IconTypes>;
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
interface OptionItem {
|
|
678
|
+
/** Visible label of the option. */
|
|
679
|
+
text: string;
|
|
680
|
+
/**
|
|
681
|
+
* Value passed to `onChange` when the option is picked, as is. With `nativeHtmlComponent` it is
|
|
682
|
+
* reported as a string instead, so a numeric `value` comes back as e.g. `'2'`.
|
|
683
|
+
*/
|
|
684
|
+
value: string | number;
|
|
685
|
+
/** Renders the option but prevents it from being picked. @default false */
|
|
686
|
+
disabled?: boolean;
|
|
687
|
+
/**
|
|
688
|
+
* Second line of smaller text under `text`, e.g. a status or a location. Not shown with
|
|
689
|
+
* `nativeHtmlComponent`.
|
|
690
|
+
*/
|
|
691
|
+
description?: string;
|
|
692
|
+
}
|
|
693
|
+
interface SelectInputProps {
|
|
694
|
+
/** Options to choose from, in display order. */
|
|
695
|
+
options: Array<OptionItem>;
|
|
696
|
+
/**
|
|
697
|
+
* Value of the selected option, matched against each option's `value`. The select is controlled:
|
|
698
|
+
* hold the value yourself and update it from `onChange`.
|
|
699
|
+
*/
|
|
700
|
+
value: string | number;
|
|
701
|
+
/**
|
|
702
|
+
* Called with the picked option's `value`, rather than the change event. Not called when picking the
|
|
703
|
+
* option that is already selected. With `nativeHtmlComponent` the value is passed as a string
|
|
704
|
+
* (`'2'` for `value: 2`).
|
|
705
|
+
*/
|
|
706
|
+
onChange: (value: string | number) => void;
|
|
707
|
+
/** Visible label, associated with the select. Also its accessible name unless `ariaLabel` is set. */
|
|
708
|
+
label?: string;
|
|
709
|
+
/** Show the `label`. When false the label is hidden, but the select still uses it as its accessible name. @default true */
|
|
710
|
+
withLabel?: boolean;
|
|
711
|
+
/** Accessible name for the select. Falls back to `label`. */
|
|
712
|
+
ariaLabel?: string;
|
|
713
|
+
/**
|
|
714
|
+
* Placeholder rendered as a first, empty option with value `''`. Pass it when the select may have no
|
|
715
|
+
* value yet, e.g. `'Choose a language'`.
|
|
716
|
+
*/
|
|
717
|
+
defaultOption?: string;
|
|
718
|
+
/** Hint rendered below the select. */
|
|
719
|
+
helperText?: string;
|
|
720
|
+
/** Error message rendered below the select. Also gives the select a red border. */
|
|
721
|
+
error?: string;
|
|
722
|
+
/** Disables the select and dims the whole field. @default false */
|
|
723
|
+
disabled?: boolean;
|
|
724
|
+
/** Shows a spinner and disables the select, e.g. while its options are being fetched. @default false */
|
|
725
|
+
loading?: boolean;
|
|
726
|
+
/**
|
|
727
|
+
* Render a real `<select>` instead of the custom list, e.g. to get the platform's own option picker
|
|
728
|
+
* on touch devices, or a ref to the `<select>` through `inputRef`. The native select reports values
|
|
729
|
+
* to `onChange` as strings.
|
|
730
|
+
* @default false
|
|
731
|
+
*/
|
|
732
|
+
nativeHtmlComponent?: boolean;
|
|
733
|
+
/** Size from the smallest breakpoint up. @default SizeTypes.MEDIUM */
|
|
734
|
+
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
735
|
+
/** Size from the `$md` breakpoint up, overriding `size`. */
|
|
736
|
+
sizeMd?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
737
|
+
/** Size from the `$lg` breakpoint up, overriding `size` and `sizeMd`. */
|
|
738
|
+
sizeLg?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
739
|
+
/** Size from the `$xl` breakpoint up, overriding the smaller sizes. */
|
|
740
|
+
sizeXl?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
741
|
+
/** Adds bottom spacing, for stacking fields in a form. @default false */
|
|
742
|
+
marginBottom?: boolean;
|
|
743
|
+
/** Focus the select on mount. @default false */
|
|
744
|
+
autoFocus?: boolean;
|
|
745
|
+
/** Id of the select, used to associate the label. Generated when omitted. */
|
|
746
|
+
id?: string;
|
|
747
|
+
/** Name of the select, for native form submission. */
|
|
748
|
+
name?: string;
|
|
749
|
+
/** Ref to the underlying `<select>`. Only with `nativeHtmlComponent`. */
|
|
750
|
+
inputRef?: RefObject<HTMLSelectElement>;
|
|
751
|
+
/** Class name of the outer container. */
|
|
752
|
+
className?: string;
|
|
753
|
+
/** Class name of the button that opens the list, or of the `<select>` with `nativeHtmlComponent`. */
|
|
754
|
+
inputClassName?: string;
|
|
755
|
+
/** @deprecated Not used by the component. */
|
|
756
|
+
text?: string;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/** Why the text in the Combobox's input changed. */
|
|
760
|
+
type ComboboxInputChangeReason =
|
|
761
|
+
/** The user typed. */
|
|
762
|
+
'input'
|
|
763
|
+
/** The text was set back to the selected option's label, e.g. after picking an option or leaving the field. */
|
|
764
|
+
| 'reset'
|
|
765
|
+
/** The clear button was used. */
|
|
766
|
+
| 'clear';
|
|
767
|
+
type ComboboxValue = string | number;
|
|
768
|
+
interface ComboboxBaseProps {
|
|
769
|
+
/** Options to choose from, in display order. Filtered by the typed text, unless `filterOptions` is false. */
|
|
770
|
+
options: Array<OptionItem>;
|
|
771
|
+
/**
|
|
772
|
+
* The options of the selected values, for their labels while they are not among `options`, e.g. a
|
|
773
|
+
* saved value before its page of options is fetched, or a value picked from an earlier search.
|
|
774
|
+
*/
|
|
775
|
+
selectedOptions?: Array<OptionItem>;
|
|
776
|
+
/**
|
|
777
|
+
* Text in the input, to control it, e.g. to fetch options for it. Without it the Combobox keeps the
|
|
778
|
+
* text itself. When controlled, update it from `onInputChange`.
|
|
779
|
+
*/
|
|
780
|
+
inputValue?: string;
|
|
781
|
+
/**
|
|
782
|
+
* Called when the text in the input changes. Fetch new options for reason `'input'` only: `'reset'`
|
|
783
|
+
* and `'clear'` set the text to the selected option's label or empty it.
|
|
784
|
+
*/
|
|
785
|
+
onInputChange?: (inputValue: string, reason: ComboboxInputChangeReason) => void;
|
|
786
|
+
/**
|
|
787
|
+
* Filters the options by the typed text. By default an option is shown when its `text` contains the
|
|
788
|
+
* typed text, ignoring case. Pass `false` when the options are already filtered, e.g. fetched for the
|
|
789
|
+
* typed text from a server.
|
|
790
|
+
*/
|
|
791
|
+
filterOptions?: ((options: OptionItem[], inputValue: string) => OptionItem[]) | false;
|
|
792
|
+
/** Visible label, associated with the input. Also its accessible name unless `ariaLabel` is set. */
|
|
793
|
+
label?: string;
|
|
794
|
+
/** Show the `label`. When false the label is hidden, but the input still uses it as its accessible name. @default true */
|
|
795
|
+
withLabel?: boolean;
|
|
796
|
+
/** Accessible name for the input. Falls back to `label`. */
|
|
797
|
+
ariaLabel?: string;
|
|
798
|
+
/** Text shown in the empty input, e.g. `'Search for portals'`. */
|
|
799
|
+
placeholder?: string;
|
|
800
|
+
/** Hint rendered below the input. */
|
|
801
|
+
helperText?: string;
|
|
802
|
+
/** Error message rendered below the input. Also gives the input a red border. */
|
|
803
|
+
error?: string;
|
|
804
|
+
/** Disables the Combobox and dims the whole field. @default false */
|
|
805
|
+
disabled?: boolean;
|
|
806
|
+
/**
|
|
807
|
+
* Shows a spinner in place of the chevron, e.g. while fetching options for the typed text. Unlike in
|
|
808
|
+
* SelectInput, the input stays editable, so typing can continue. The list stays closed until there
|
|
809
|
+
* are options to show. @default false
|
|
810
|
+
*/
|
|
811
|
+
loading?: boolean;
|
|
812
|
+
/**
|
|
813
|
+
* Shown in the list when no option matches the typed text and `loading` is false, as in SortableTable.
|
|
814
|
+
* Without it, the list closes when nothing matches.
|
|
815
|
+
*/
|
|
816
|
+
noDataMessage?: Pick<NoDataMessageProps, 'title' | 'icon' | 'message'>;
|
|
817
|
+
/**
|
|
818
|
+
* There are more options than `options` holds. The Combobox then calls `onLoadMoreCallback` when the
|
|
819
|
+
* end of the list scrolls into view, or the keyboard reaches its last option. @default false
|
|
820
|
+
*/
|
|
821
|
+
hasMoreOptions?: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* Called for the next options while `hasMoreOptions` and not `loading`. Append them to `options`, set
|
|
824
|
+
* `loading` while fetching, and `hasMoreOptions` to false after the last ones or a failed fetch.
|
|
825
|
+
*/
|
|
826
|
+
onLoadMoreCallback?: () => void;
|
|
827
|
+
/**
|
|
828
|
+
* Let the value be cleared: with a button while there is one, and for a single value also by deleting
|
|
829
|
+
* all text in the input. Without it, a value can only be replaced by another. @default true
|
|
830
|
+
*/
|
|
831
|
+
withClearButton?: boolean;
|
|
832
|
+
/** Accessible name of the clear button. @default 'Clear' */
|
|
833
|
+
clearButtonAriaLabel?: string;
|
|
834
|
+
/** Accessible name of the button that opens and closes the list. @default 'Show options' */
|
|
835
|
+
toggleButtonAriaLabel?: string;
|
|
836
|
+
/**
|
|
837
|
+
* Colours the input like a Button of that type, e.g. to use the Combobox as a picker in a toolbar.
|
|
838
|
+
* The list is not affected. Without it, the input looks like the other form fields.
|
|
839
|
+
*/
|
|
840
|
+
type?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY;
|
|
841
|
+
/** Size from the smallest breakpoint up. @default SizeTypes.MEDIUM */
|
|
842
|
+
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
843
|
+
/** Size from the `$md` breakpoint up, overriding `size`. */
|
|
844
|
+
sizeMd?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
845
|
+
/** Size from the `$lg` breakpoint up, overriding `size` and `sizeMd`. */
|
|
846
|
+
sizeLg?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
847
|
+
/** Size from the `$xl` breakpoint up, overriding the smaller sizes. */
|
|
848
|
+
sizeXl?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
849
|
+
/** Adds bottom spacing, for stacking fields in a form. @default false */
|
|
850
|
+
marginBottom?: boolean;
|
|
851
|
+
/** Focus the input on mount. @default false */
|
|
852
|
+
autoFocus?: boolean;
|
|
853
|
+
/** Id of the input, used to associate the label. Generated when omitted. */
|
|
854
|
+
id?: string;
|
|
855
|
+
/** Name of the value, for native form submission. */
|
|
856
|
+
name?: string;
|
|
857
|
+
/** Ref to the `<input>`. */
|
|
858
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
859
|
+
/** Class name of the outer container. */
|
|
860
|
+
className?: string;
|
|
861
|
+
/** Class name of the `<input>`. */
|
|
862
|
+
inputClassName?: string;
|
|
863
|
+
}
|
|
864
|
+
interface ComboboxSingleProps extends ComboboxBaseProps {
|
|
865
|
+
/**
|
|
866
|
+
* Without `multiple`: one value, shown as text in the input.
|
|
867
|
+
* @default false
|
|
868
|
+
*/
|
|
869
|
+
multiple?: false;
|
|
870
|
+
/**
|
|
871
|
+
* Without `multiple`: the value of the selected option, matched against each option's `value`, or `''`
|
|
872
|
+
* for none. The Combobox is controlled: hold the value yourself and update it from `onChange`.
|
|
873
|
+
*/
|
|
874
|
+
value: ComboboxValue;
|
|
875
|
+
/**
|
|
876
|
+
* Without `multiple`: called with the picked option's `value`, or `''` when the value is cleared with the
|
|
877
|
+
* clear button or by deleting all text in the input. Not called when picking the option that is already
|
|
878
|
+
* selected.
|
|
879
|
+
*/
|
|
880
|
+
onChange: (value: ComboboxValue) => void;
|
|
881
|
+
}
|
|
882
|
+
interface ComboboxMultipleProps extends ComboboxBaseProps {
|
|
883
|
+
/**
|
|
884
|
+
* With `multiple`: several values, shown as pills in the field. It changes the types of `value` and
|
|
885
|
+
* `onChange` to arrays, so pass `value` as an array whenever it is set. It can't just be switched on for
|
|
886
|
+
* a single value. Picking an option toggles it and keeps the list open, and Backspace in the empty input
|
|
887
|
+
* removes the last value.
|
|
888
|
+
*/
|
|
889
|
+
multiple: true;
|
|
890
|
+
/** With `multiple`: the values of the selected options, in the order they were picked, or `[]` for none. */
|
|
891
|
+
value: Array<ComboboxValue>;
|
|
892
|
+
/** With `multiple`: called with all selected values after one is added or removed, or `[]` when the clear button is used. */
|
|
893
|
+
onChange: (value: Array<ComboboxValue>) => void;
|
|
894
|
+
/** Only with `multiple`: pills shown in the field. The rest are behind a "+ N" button that lists them, as in BadgeList. @default 5 */
|
|
895
|
+
maxVisiblePills?: number;
|
|
896
|
+
/** Only with `multiple`: accessible name and tooltip of a pill's remove button. @default 'Remove' */
|
|
897
|
+
removePillAriaLabel?: string;
|
|
898
|
+
}
|
|
899
|
+
type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;
|
|
900
|
+
|
|
901
|
+
declare const Combobox: {
|
|
902
|
+
(props: ComboboxProps): JSX.Element;
|
|
903
|
+
displayName: string;
|
|
904
|
+
};
|
|
905
|
+
|
|
658
906
|
interface CardProps extends PaddingInterface, MarginInterface, FlexStylingInterface {
|
|
659
907
|
id?: string;
|
|
660
908
|
onClickCallback?: () => void;
|
|
@@ -715,50 +963,89 @@ declare const RadioButton: {
|
|
|
715
963
|
};
|
|
716
964
|
|
|
717
965
|
interface DropDownProps {
|
|
718
|
-
|
|
966
|
+
/**
|
|
967
|
+
* Content of the DropDown, usually DropDownItems. A DropDownItem with an `onClickCallback` closes the
|
|
968
|
+
* DropDown when clicked, unless it sets `closeDropDownOnClick={false}`. Other children with an
|
|
969
|
+
* `onClickCallback`, such as a Button, close it only when they set `closeDropDownOnClick`.
|
|
970
|
+
*/
|
|
719
971
|
children: ReactNode[] | ReactNode;
|
|
972
|
+
/**
|
|
973
|
+
* Element that toggles the DropDown, e.g. a Button or IconButton. It is cloned with a click handler
|
|
974
|
+
* under the prop named by `buttonCallbackName`.
|
|
975
|
+
*/
|
|
720
976
|
buttonComponent?: ReactNode;
|
|
977
|
+
/**
|
|
978
|
+
* Element the DropDown is anchored to, without any click handling. Use it with `isOpen` when the
|
|
979
|
+
* opening is controlled from elsewhere, e.g. a hover card or a tour step.
|
|
980
|
+
*/
|
|
721
981
|
triggerComponent?: ReactNode;
|
|
722
|
-
/**
|
|
982
|
+
/**
|
|
983
|
+
* Name of the click prop the DropDown attaches to `buttonComponent`. Use `'onClick'` for plain
|
|
984
|
+
* elements, or e.g. `'onRightClickCallback'` to toggle from one part of a MultiActionButton.
|
|
985
|
+
* @default 'onClickCallback'
|
|
986
|
+
*/
|
|
723
987
|
buttonCallbackName?: string;
|
|
724
|
-
|
|
988
|
+
/** Dark header rendered above the children. */
|
|
725
989
|
title?: string;
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
990
|
+
/** Content rendered below the children, e.g. an action or a summary. */
|
|
991
|
+
footerComponent?: ReactNode;
|
|
992
|
+
/**
|
|
993
|
+
* Controls whether the DropDown is open. When set, the DropDown doesn't toggle itself: update it
|
|
994
|
+
* from `onOpenCallback` and `onCloseCallback`.
|
|
995
|
+
*/
|
|
996
|
+
isOpen?: boolean;
|
|
997
|
+
/** Called when the button is clicked while the DropDown is closed. */
|
|
998
|
+
onOpenCallback?: () => void;
|
|
999
|
+
/** Called when the DropDown closes from the button, an outside click, Escape or a child click. */
|
|
1000
|
+
onCloseCallback?: () => void;
|
|
1001
|
+
/** Close the DropDown when Escape is pressed. @default true */
|
|
1002
|
+
closeOnEscape?: boolean;
|
|
1003
|
+
/** Shows a spinner over the children, e.g. while they are being fetched. @default false */
|
|
732
1004
|
loading?: boolean;
|
|
733
|
-
/** @default true */
|
|
1005
|
+
/** Wrap the children in a `<ul>`. Set to false for content that is not a list of DropDownItems. @default true */
|
|
734
1006
|
childrenIsList?: boolean;
|
|
735
|
-
/** @default
|
|
736
|
-
closeOnEscape?: boolean;
|
|
737
|
-
isOpen?: boolean;
|
|
738
|
-
/** @default false */
|
|
1007
|
+
/** Let content overflow the list, e.g. for nested menus or tooltips. @default false */
|
|
739
1008
|
withVisibleOverflow?: boolean;
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
rotateMiddleIconByDegree?: number;
|
|
743
|
-
rotateRightIconByDegree?: number;
|
|
744
|
-
/** @default false */
|
|
745
|
-
withPortal?: boolean;
|
|
1009
|
+
/** Render the arrow pointing at the button. @default true */
|
|
1010
|
+
withArrow?: boolean;
|
|
746
1011
|
/** @default true */
|
|
747
1012
|
withShadow?: boolean;
|
|
748
|
-
/**
|
|
1013
|
+
/**
|
|
1014
|
+
* Render the DropDown in the `#root` element, or `document.body` when there is none, instead of next
|
|
1015
|
+
* to the button, so it escapes parents with `overflow: hidden` or their own stacking context.
|
|
1016
|
+
* @default false
|
|
1017
|
+
*/
|
|
1018
|
+
withPortal?: boolean;
|
|
1019
|
+
/** Preferred side of the button to open on. Flips when there is not enough room. @default 'auto' */
|
|
749
1020
|
placement?: Placement;
|
|
750
|
-
/** @default 'absolute' */
|
|
1021
|
+
/** Use `'fixed'` when the button is inside a fixed element, such as a sticky header. @default 'absolute' */
|
|
751
1022
|
strategy?: PositioningStrategy;
|
|
752
|
-
/** @default { horizontal: 8, vertical: 12 } */
|
|
1023
|
+
/** Distance in pixels between the button and the DropDown. @default { horizontal: 8, vertical: 12 } */
|
|
753
1024
|
offset?: {
|
|
754
1025
|
horizontal: number;
|
|
755
1026
|
vertical: number;
|
|
756
1027
|
};
|
|
1028
|
+
/** Minimum distance in pixels between the arrow and the DropDown's corners. @default 16 */
|
|
757
1029
|
arrowPadding?: number;
|
|
758
|
-
|
|
759
|
-
|
|
1030
|
+
/** Passed on to the button's `rotateIconByDegree` while the DropDown is open, e.g. `180` to flip a chevron. */
|
|
1031
|
+
rotateIconByDegree?: number;
|
|
1032
|
+
/** Passed on to the button's `rotateLeftIconByDegree` while open. For MultiActionButton. */
|
|
1033
|
+
rotateLeftIconByDegree?: number;
|
|
1034
|
+
/** Passed on to the button's `rotateMiddleIconByDegree` while open. For MultiActionButton. */
|
|
1035
|
+
rotateMiddleIconByDegree?: number;
|
|
1036
|
+
/** Passed on to the button's `rotateRightIconByDegree` while open. For MultiActionButton. */
|
|
1037
|
+
rotateRightIconByDegree?: number;
|
|
1038
|
+
/** Id of the outer container. */
|
|
1039
|
+
id?: string;
|
|
1040
|
+
/** Class name of the outer container, which holds the button. */
|
|
1041
|
+
className?: string;
|
|
1042
|
+
/** Class name of the positioned DropDown, e.g. to set its width. */
|
|
1043
|
+
dropDownClassName?: string;
|
|
1044
|
+
/** Class name of the `<ul>` around the children, when `childrenIsList` is true. */
|
|
1045
|
+
childrenClassName?: string;
|
|
760
1046
|
}
|
|
761
1047
|
interface DropDownRef {
|
|
1048
|
+
/** Recalculate the DropDown's position, e.g. after its content changed size. */
|
|
762
1049
|
forceUpdate: () => void;
|
|
763
1050
|
}
|
|
764
1051
|
|
|
@@ -812,7 +1099,17 @@ interface DropDownItemProps {
|
|
|
812
1099
|
onClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
813
1100
|
/** @default SizeTypes.MEDIUM */
|
|
814
1101
|
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1102
|
+
/**
|
|
1103
|
+
* Marks the item as selected, with purple text and a check mark. Pass it to every item of a selection,
|
|
1104
|
+
* `false` for the unselected ones, so the labels line up.
|
|
1105
|
+
*/
|
|
815
1106
|
active?: boolean;
|
|
1107
|
+
/**
|
|
1108
|
+
* Where the check mark of an `active` item goes. On the right it matches the option lists of SelectInput
|
|
1109
|
+
* and Combobox, and the left is free for `leftIcon`.
|
|
1110
|
+
* @default 'left'
|
|
1111
|
+
*/
|
|
1112
|
+
activeIconPosition?: 'left' | 'right';
|
|
816
1113
|
/** @default false */
|
|
817
1114
|
withEllipsis?: boolean;
|
|
818
1115
|
/** @default false */
|
|
@@ -844,7 +1141,7 @@ interface DropDownItemProps {
|
|
|
844
1141
|
}
|
|
845
1142
|
|
|
846
1143
|
declare const DropDownItem: {
|
|
847
|
-
({ id, text, description, onClickCallback, size, textAlign, fontSize, fontWeight, descriptionClassName, descriptionContainerClassName, textColor, active, disabled, className, iconColor, leftIcon, rightIcon, rightComponent, children, iconSize, withEllipsis, iconClassName, wrapperElement, closeDropDownOnClick }: DropDownItemProps): JSX.Element;
|
|
1144
|
+
({ id, text, description, onClickCallback, size, textAlign, fontSize, fontWeight, descriptionClassName, descriptionContainerClassName, textColor, active, activeIconPosition, disabled, className, iconColor, leftIcon, rightIcon, rightComponent, children, iconSize, withEllipsis, iconClassName, wrapperElement, closeDropDownOnClick }: DropDownItemProps): JSX.Element;
|
|
848
1145
|
defaultProps: {
|
|
849
1146
|
closeDropDownOnClick: boolean;
|
|
850
1147
|
};
|
|
@@ -1022,6 +1319,8 @@ interface IconButtonProps extends IconStyleInterface {
|
|
|
1022
1319
|
/** @default HierarchyTypes.SECONDARY */
|
|
1023
1320
|
type?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY | HierarchyTypes.TERTIARY;
|
|
1024
1321
|
onClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
1322
|
+
/** Called when the button is pressed, before it takes focus. Call `e.preventDefault()` to keep focus where it is, e.g. in an input the button belongs to. */
|
|
1323
|
+
onMouseDownCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
1025
1324
|
style?: CSSProperties;
|
|
1026
1325
|
iconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1027
1326
|
/** @default SizeTypes.MEDIUM */
|
|
@@ -1043,7 +1342,7 @@ interface IconButtonProps extends IconStyleInterface {
|
|
|
1043
1342
|
badgeColor?: BadgeTypes;
|
|
1044
1343
|
}
|
|
1045
1344
|
|
|
1046
|
-
declare const IconButton: react.MemoExoticComponent<({ className, disabled, style, icon, id, text, size, type, href, iconColor, iconSize, iconClassName, onClickCallback, rotateIcon, tabIndex, autoFocus, buttonRef, rotateIconByDegree, toolTip, toolTipComponent, ariaLabel, toggleIcon, badge, badgeColor }: IconButtonProps) => JSX.Element>;
|
|
1345
|
+
declare const IconButton: react.MemoExoticComponent<({ className, disabled, style, icon, id, text, size, type, href, iconColor, iconSize, iconClassName, onClickCallback, onMouseDownCallback, rotateIcon, tabIndex, autoFocus, buttonRef, rotateIconByDegree, toolTip, toolTipComponent, ariaLabel, toggleIcon, badge, badgeColor }: IconButtonProps) => JSX.Element>;
|
|
1047
1346
|
|
|
1048
1347
|
interface IconInterface$1 {
|
|
1049
1348
|
loading?: boolean;
|
|
@@ -1791,45 +2090,6 @@ declare const TabGroup: {
|
|
|
1791
2090
|
displayName: string;
|
|
1792
2091
|
};
|
|
1793
2092
|
|
|
1794
|
-
interface OptionItem {
|
|
1795
|
-
text: string;
|
|
1796
|
-
value: string | number;
|
|
1797
|
-
disabled?: boolean;
|
|
1798
|
-
}
|
|
1799
|
-
interface SelectInputProps {
|
|
1800
|
-
inputRef?: RefObject<HTMLSelectElement>;
|
|
1801
|
-
id?: string;
|
|
1802
|
-
className?: string;
|
|
1803
|
-
inputClassName?: string;
|
|
1804
|
-
defaultOption?: string;
|
|
1805
|
-
/** @default SizeTypes.MEDIUM */
|
|
1806
|
-
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1807
|
-
sizeMd?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1808
|
-
sizeLg?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1809
|
-
sizeXl?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1810
|
-
/** @default false */
|
|
1811
|
-
disabled?: boolean;
|
|
1812
|
-
/** @default true */
|
|
1813
|
-
withLabel?: boolean;
|
|
1814
|
-
error?: string;
|
|
1815
|
-
helperText?: string;
|
|
1816
|
-
text?: string;
|
|
1817
|
-
/** @default false */
|
|
1818
|
-
marginBottom?: boolean;
|
|
1819
|
-
/** @default false */
|
|
1820
|
-
autoFocus?: boolean;
|
|
1821
|
-
/** @default false */
|
|
1822
|
-
loading?: boolean;
|
|
1823
|
-
ariaLabel?: string;
|
|
1824
|
-
label?: string;
|
|
1825
|
-
name?: string;
|
|
1826
|
-
onChange: (value: string | number) => void;
|
|
1827
|
-
options: Array<OptionItem>;
|
|
1828
|
-
value: string | number;
|
|
1829
|
-
/** @default true */
|
|
1830
|
-
nativeHtmlComponent?: boolean;
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
2093
|
declare const SelectInput: {
|
|
1834
2094
|
({ label, withLabel, inputRef, nativeHtmlComponent, size, sizeMd, sizeLg, sizeXl, ariaLabel, id, onChange, defaultOption, value, error, autoFocus, helperText, options, disabled, loading, name, className, inputClassName, marginBottom }: SelectInputProps): JSX.Element;
|
|
1835
2095
|
displayName: string;
|
|
@@ -1921,25 +2181,9 @@ declare const SkeletonItem: {
|
|
|
1921
2181
|
displayName: string;
|
|
1922
2182
|
};
|
|
1923
2183
|
|
|
1924
|
-
interface NoDataMessageProps {
|
|
1925
|
-
id?: string;
|
|
1926
|
-
className?: string;
|
|
1927
|
-
icon?: Partial<IconTypes>;
|
|
1928
|
-
title?: string;
|
|
1929
|
-
message?: string;
|
|
1930
|
-
/** @default false */
|
|
1931
|
-
absoluteCenter?: boolean;
|
|
1932
|
-
customLink?: ReactNode;
|
|
1933
|
-
button?: {
|
|
1934
|
-
onClickCallback: () => void;
|
|
1935
|
-
text: string;
|
|
1936
|
-
icon: Partial<IconTypes>;
|
|
1937
|
-
};
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
2184
|
declare const NoDataMessage: {
|
|
1941
2185
|
({ id, icon, title, message, className, absoluteCenter, customLink, button }: NoDataMessageProps): JSX.Element;
|
|
1942
2186
|
displayName: string;
|
|
1943
2187
|
};
|
|
1944
2188
|
|
|
1945
|
-
export { AnimatedCount, AnimatedCountProps, AppColors, AspectRatioTypes, Badge, BadgeItem, BadgeList, BadgeListProps, BadgeProps, BadgeTypes, BorderInterface, Box, Button, Card, Checkbox, ColorStyleInterface, ColorTypes, DropDown, DropDownItem, DropDownRef, FacetButton, FlexStylingInterface, FontFamilyTypes, FormSkeleton, Grid, Heading, HierarchyInterface, HierarchyTypes, Icon, IconButton, IconStyleInterface, IconTypes, Image, InlineButton, Input, Label, Link, LinkTypes, ListButton, ListButtonProps, ListItem, ListSkeleton, MarginInterface, MultiActionButton, NoDataMessage, NumberBadge, NumberBadgeProps, PaddingInterface, Pagination, Paragraph, RadioButton, SelectInput, Separator, SizeStyleInterface, SizeTypes, SkeletonItem, SolidSpinner, SortableTable, SortableTableCellInterface, SortableTableProps, Span, SwitchButton, Tab, TabGroup, TabGroupProps, TabIndicatorProps, TabProps, TabValue, TableTypes, TextAreaInput, ToolTip, borderClassNames, flexClassNames, marginClassNames, paddingClassNames };
|
|
2189
|
+
export { AnimatedCount, AnimatedCountProps, AppColors, AspectRatioTypes, Badge, BadgeItem, BadgeList, BadgeListProps, BadgeProps, BadgeTypes, BorderInterface, Box, Button, Card, Checkbox, ColorStyleInterface, ColorTypes, Combobox, ComboboxInputChangeReason, ComboboxMultipleProps, ComboboxProps, ComboboxSingleProps, ComboboxValue, DropDown, DropDownItem, DropDownProps, DropDownRef, FacetButton, FlexStylingInterface, FontFamilyTypes, FormSkeleton, Grid, Heading, HierarchyInterface, HierarchyTypes, Icon, IconButton, IconStyleInterface, IconTypes, Image, InlineButton, Input, Label, Link, LinkTypes, ListButton, ListButtonProps, ListItem, ListSkeleton, MarginInterface, MultiActionButton, NoDataMessage, NumberBadge, NumberBadgeProps, PaddingInterface, Pagination, Paragraph, RadioButton, SelectInput, OptionItem as SelectInputOptionItem, SelectInputProps, Separator, SizeStyleInterface, SizeTypes, SkeletonItem, SolidSpinner, SortableTable, SortableTableCellInterface, SortableTableProps, Span, SwitchButton, Tab, TabGroup, TabGroupProps, TabIndicatorProps, TabProps, TabValue, TableTypes, TextAreaInput, ToolTip, borderClassNames, flexClassNames, marginClassNames, paddingClassNames };
|