widenarrow-ui 2.3.7 → 2.4.0
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 +346 -85
- package/lib/index.esm.css +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +9 -9
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 {
|
|
@@ -17,9 +17,17 @@ declare enum IconTypes {
|
|
|
17
17
|
ALL_SOURCES = "iconAllSources",
|
|
18
18
|
ADD_CHART = "iconAddChart",
|
|
19
19
|
ADD_CIRCLE = "iconAddCircle",
|
|
20
|
+
ADD_COLUMN_LEFT = "iconAddColumnLeft",
|
|
21
|
+
ADD_COLUMN_LEFT_FILLED = "iconAddColumnLeftFilled",
|
|
22
|
+
ADD_COLUMN_RIGHT = "iconAddColumnRight",
|
|
23
|
+
ADD_COLUMN_RIGHT_FILLED = "iconAddColumnRightFilled",
|
|
20
24
|
ADD_COMMENT = "iconAddComment",
|
|
21
25
|
ADD_FOLDER = "iconAddFolder",
|
|
22
26
|
ADD_PAGE_BREAK = "iconAddPageBreak",
|
|
27
|
+
ADD_ROW_ABOVE = "iconAddRowAbove",
|
|
28
|
+
ADD_ROW_ABOVE_FILLED = "iconAddRowAboveFilled",
|
|
29
|
+
ADD_ROW_BELOW = "iconAddRowBelow",
|
|
30
|
+
ADD_ROW_BELOW_FILLED = "iconAddRowBelowFilled",
|
|
23
31
|
ADD_SECTION_ABOVE = "iconAddSectionAbove",
|
|
24
32
|
ADD_SECTION_BELOW = "iconAddSectionBelow",
|
|
25
33
|
ADD_SECTION_LEFT = "iconAddSectionLeft",
|
|
@@ -41,6 +49,7 @@ declare enum IconTypes {
|
|
|
41
49
|
BENCHMARKS_300 = "iconBenchMarks300",
|
|
42
50
|
BENCHMARKS_FILLED = "iconBenchMarksFilled",
|
|
43
51
|
BLOCK = "iconBlock",
|
|
52
|
+
BOLD_FORMAT = "iconBoldFormat",
|
|
44
53
|
BOOK = "iconBook",
|
|
45
54
|
BOOKMARK = "iconBookmark",
|
|
46
55
|
BIO_TECH = "iconBioTech",
|
|
@@ -68,6 +77,7 @@ declare enum IconTypes {
|
|
|
68
77
|
CLASSIFICATION_SPARKLE = "iconClassificationSparkle",
|
|
69
78
|
CLIP_BOARD = "iconClipBoard",
|
|
70
79
|
CO_PILOT = "iconCoPilot",
|
|
80
|
+
COLOR_FORMAT = "iconColorFormat",
|
|
71
81
|
COMMENT = "iconComment",
|
|
72
82
|
COMMENT_SPARKLE = "iconCommentSparkle",
|
|
73
83
|
COMMENT_SPARKLE_GRADIENT = "iconCommentSparkleGradient",
|
|
@@ -136,6 +146,7 @@ declare enum IconTypes {
|
|
|
136
146
|
INFO_LAB = "iconInfoLab",
|
|
137
147
|
INFO_LAB_FILLED = "iconInfoLabFilled",
|
|
138
148
|
INTEGRATIONS = "iconIntegrations",
|
|
149
|
+
ITALIC_FORMAT = "iconItalicFormat",
|
|
139
150
|
KEYWORDS = "iconKeywords",
|
|
140
151
|
LAB_RESEARCH = "iconLabResearch",
|
|
141
152
|
LIGHT_BULB = "iconLightBulb",
|
|
@@ -148,6 +159,7 @@ declare enum IconTypes {
|
|
|
148
159
|
LOCK = "iconLock",
|
|
149
160
|
MASONRY = "iconMasonry",
|
|
150
161
|
MENU = "iconMenu",
|
|
162
|
+
MERGE_CELLS = "iconMergeCells",
|
|
151
163
|
MINIMIZE_ARROWS = "iconMinimizeArrows",
|
|
152
164
|
MINUS = "iconMinus",
|
|
153
165
|
MONITORING_LOGO = "iconMonitoringLogo",
|
|
@@ -203,6 +215,9 @@ declare enum IconTypes {
|
|
|
203
215
|
REDO = "iconRedo",
|
|
204
216
|
REFRESH = "iconRefresh",
|
|
205
217
|
REGULATIONS = "iconRegulations",
|
|
218
|
+
REMOVE_COLUMN = "iconRemoveColumn",
|
|
219
|
+
REMOVE_FORMAT = "iconRemoveFormat",
|
|
220
|
+
REMOVE_ROW = "iconRemoveRow",
|
|
206
221
|
RENEW = "iconRenew",
|
|
207
222
|
REPORT_200 = "iconReport200",
|
|
208
223
|
REPORT_300 = "iconReport300",
|
|
@@ -236,6 +251,7 @@ declare enum IconTypes {
|
|
|
236
251
|
SPARKLE_FILLED = "iconSparkleFilled",
|
|
237
252
|
SPARKLE_GRADIENT = "iconSparkleGradient",
|
|
238
253
|
SPARKLE_GRADIENT_FILLED = "iconSparkleGradientFilled",
|
|
254
|
+
SPLIT_CELL = "iconSplitCell",
|
|
239
255
|
SSO = "iconSSO",
|
|
240
256
|
SSO_CONFIG = "iconSSOConfig",
|
|
241
257
|
STATISTICS_200 = "iconStatistics200",
|
|
@@ -247,6 +263,7 @@ declare enum IconTypes {
|
|
|
247
263
|
STRATEGY_FILLED = "iconStrategyFilled",
|
|
248
264
|
SUGGESTION = "iconSuggestion",
|
|
249
265
|
SUMMARIZE = "iconSummarize",
|
|
266
|
+
TABLE = "iconTable",
|
|
250
267
|
TASK = "iconTask",
|
|
251
268
|
TAXONOMY_200 = "iconTaxonomy200",
|
|
252
269
|
TAXONOMY_300 = "iconTaxonomy300",
|
|
@@ -259,6 +276,7 @@ declare enum IconTypes {
|
|
|
259
276
|
TRUSTED_DOMAINS_200 = "iconTrustedDomains200",
|
|
260
277
|
TRUSTED_DOMAINS_300 = "iconTrustedDomains300",
|
|
261
278
|
TRUSTED_DOMAINS_FILLED = "iconTrustedDomainsFilled",
|
|
279
|
+
UNDERLINE_FORMAT = "iconUnderlineFormat",
|
|
262
280
|
UNDO = "iconUndo",
|
|
263
281
|
UNDO_200 = "iconUndo200",
|
|
264
282
|
UNDO_300 = "iconUndo300",
|
|
@@ -438,10 +456,12 @@ interface BadgeProps {
|
|
|
438
456
|
onRemoveCallback?: (badgeItem: BadgeItem) => void;
|
|
439
457
|
/** Accessible name and tooltip for the remove button. Set it whenever `onRemoveCallback` is. */
|
|
440
458
|
removeLabel?: string;
|
|
459
|
+
/** Ref to the remove button, e.g. to move focus to it. Only set while `onRemoveCallback` is. */
|
|
460
|
+
removeButtonRef?: RefObject<HTMLButtonElement>;
|
|
441
461
|
}
|
|
442
462
|
|
|
443
463
|
declare const Badge: {
|
|
444
|
-
({ badgeItem, className, displayAll, leftIcon, maxWidth, style, onClickCallback, onRemoveCallback, removeLabel }: BadgeProps): JSX.Element;
|
|
464
|
+
({ badgeItem, className, displayAll, leftIcon, maxWidth, style, onClickCallback, onRemoveCallback, removeLabel, removeButtonRef }: BadgeProps): JSX.Element;
|
|
445
465
|
displayName: string;
|
|
446
466
|
};
|
|
447
467
|
|
|
@@ -637,6 +657,251 @@ interface CheckboxProps {
|
|
|
637
657
|
|
|
638
658
|
declare const Checkbox: FC<CheckboxProps>;
|
|
639
659
|
|
|
660
|
+
interface NoDataMessageProps {
|
|
661
|
+
id?: string;
|
|
662
|
+
className?: string;
|
|
663
|
+
icon?: Partial<IconTypes>;
|
|
664
|
+
title?: string;
|
|
665
|
+
message?: string;
|
|
666
|
+
/** @default false */
|
|
667
|
+
absoluteCenter?: boolean;
|
|
668
|
+
customLink?: ReactNode;
|
|
669
|
+
button?: {
|
|
670
|
+
onClickCallback: () => void;
|
|
671
|
+
text: string;
|
|
672
|
+
icon: Partial<IconTypes>;
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
interface OptionItem {
|
|
677
|
+
/** Visible label of the option. */
|
|
678
|
+
text: string;
|
|
679
|
+
/**
|
|
680
|
+
* Value passed to `onChange` when the option is picked, as is. With `nativeHtmlComponent` it is
|
|
681
|
+
* reported as a string instead, so a numeric `value` comes back as e.g. `'2'`.
|
|
682
|
+
*/
|
|
683
|
+
value: string | number;
|
|
684
|
+
/** Renders the option but prevents it from being picked. @default false */
|
|
685
|
+
disabled?: boolean;
|
|
686
|
+
/**
|
|
687
|
+
* Second line of smaller text under `text`, e.g. a status or a location. Not shown with
|
|
688
|
+
* `nativeHtmlComponent`.
|
|
689
|
+
*/
|
|
690
|
+
description?: string;
|
|
691
|
+
}
|
|
692
|
+
interface SelectInputProps {
|
|
693
|
+
/** Options to choose from, in display order. */
|
|
694
|
+
options: Array<OptionItem>;
|
|
695
|
+
/**
|
|
696
|
+
* Value of the selected option, matched against each option's `value`. The select is controlled:
|
|
697
|
+
* hold the value yourself and update it from `onChange`.
|
|
698
|
+
*/
|
|
699
|
+
value: string | number;
|
|
700
|
+
/**
|
|
701
|
+
* Called with the picked option's `value`, rather than the change event. Not called when picking the
|
|
702
|
+
* option that is already selected. With `nativeHtmlComponent` the value is passed as a string
|
|
703
|
+
* (`'2'` for `value: 2`).
|
|
704
|
+
*/
|
|
705
|
+
onChange: (value: string | number) => void;
|
|
706
|
+
/** Visible label, associated with the select. Also its accessible name unless `ariaLabel` is set. */
|
|
707
|
+
label?: string;
|
|
708
|
+
/** Show the `label`. When false the label is hidden, but the select still uses it as its accessible name. @default true */
|
|
709
|
+
withLabel?: boolean;
|
|
710
|
+
/** Accessible name for the select. Falls back to `label`. */
|
|
711
|
+
ariaLabel?: string;
|
|
712
|
+
/**
|
|
713
|
+
* Placeholder rendered as a first, empty option with value `''`. Pass it when the select may have no
|
|
714
|
+
* value yet, e.g. `'Choose a language'`.
|
|
715
|
+
*/
|
|
716
|
+
defaultOption?: string;
|
|
717
|
+
/** Hint rendered below the select. */
|
|
718
|
+
helperText?: string;
|
|
719
|
+
/** Error message rendered below the select. Also gives the select a red border. */
|
|
720
|
+
error?: string;
|
|
721
|
+
/** Disables the select and dims the whole field. @default false */
|
|
722
|
+
disabled?: boolean;
|
|
723
|
+
/** Shows a spinner and disables the select, e.g. while its options are being fetched. @default false */
|
|
724
|
+
loading?: boolean;
|
|
725
|
+
/**
|
|
726
|
+
* Render a real `<select>` instead of the custom list, e.g. to get the platform's own option picker
|
|
727
|
+
* on touch devices, or a ref to the `<select>` through `inputRef`. The native select reports values
|
|
728
|
+
* to `onChange` as strings.
|
|
729
|
+
* @default false
|
|
730
|
+
*/
|
|
731
|
+
nativeHtmlComponent?: boolean;
|
|
732
|
+
/** Size from the smallest breakpoint up. @default SizeTypes.MEDIUM */
|
|
733
|
+
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
734
|
+
/** Size from the `$md` breakpoint up, overriding `size`. */
|
|
735
|
+
sizeMd?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
736
|
+
/** Size from the `$lg` breakpoint up, overriding `size` and `sizeMd`. */
|
|
737
|
+
sizeLg?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
738
|
+
/** Size from the `$xl` breakpoint up, overriding the smaller sizes. */
|
|
739
|
+
sizeXl?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
740
|
+
/** Adds bottom spacing, for stacking fields in a form. @default false */
|
|
741
|
+
marginBottom?: boolean;
|
|
742
|
+
/** Focus the select on mount. @default false */
|
|
743
|
+
autoFocus?: boolean;
|
|
744
|
+
/** Id of the select, used to associate the label. Generated when omitted. */
|
|
745
|
+
id?: string;
|
|
746
|
+
/** Name of the select, for native form submission. */
|
|
747
|
+
name?: string;
|
|
748
|
+
/** Ref to the underlying `<select>`. Only with `nativeHtmlComponent`. */
|
|
749
|
+
inputRef?: RefObject<HTMLSelectElement>;
|
|
750
|
+
/** Class name of the outer container. */
|
|
751
|
+
className?: string;
|
|
752
|
+
/** Class name of the button that opens the list, or of the `<select>` with `nativeHtmlComponent`. */
|
|
753
|
+
inputClassName?: string;
|
|
754
|
+
/** @deprecated Not used by the component. */
|
|
755
|
+
text?: string;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/** Why the text in the Combobox's input changed. */
|
|
759
|
+
type ComboboxInputChangeReason =
|
|
760
|
+
/** The user typed. */
|
|
761
|
+
'input'
|
|
762
|
+
/** The text was set back to the selected option's label, e.g. after picking an option or leaving the field. */
|
|
763
|
+
| 'reset'
|
|
764
|
+
/** The clear button was used. */
|
|
765
|
+
| 'clear';
|
|
766
|
+
type ComboboxValue = string | number;
|
|
767
|
+
interface ComboboxBaseProps {
|
|
768
|
+
/** Options to choose from, in display order. Filtered by the typed text, unless `filterOptions` is false. */
|
|
769
|
+
options: Array<OptionItem>;
|
|
770
|
+
/**
|
|
771
|
+
* The options of the selected values, for their labels while they are not among `options`, e.g. a
|
|
772
|
+
* saved value before its page of options is fetched, or a value picked from an earlier search.
|
|
773
|
+
*/
|
|
774
|
+
selectedOptions?: Array<OptionItem>;
|
|
775
|
+
/**
|
|
776
|
+
* Text in the input, to control it, e.g. to fetch options for it. Without it the Combobox keeps the
|
|
777
|
+
* text itself. When controlled, update it from `onInputChange`.
|
|
778
|
+
*/
|
|
779
|
+
inputValue?: string;
|
|
780
|
+
/**
|
|
781
|
+
* Called when the text in the input changes. Fetch new options for reason `'input'` only: `'reset'`
|
|
782
|
+
* and `'clear'` set the text to the selected option's label or empty it.
|
|
783
|
+
*/
|
|
784
|
+
onInputChange?: (inputValue: string, reason: ComboboxInputChangeReason) => void;
|
|
785
|
+
/**
|
|
786
|
+
* Filters the options by the typed text. By default an option is shown when its `text` contains the
|
|
787
|
+
* typed text, ignoring case. Pass `false` when the options are already filtered, e.g. fetched for the
|
|
788
|
+
* typed text from a server.
|
|
789
|
+
*/
|
|
790
|
+
filterOptions?: ((options: OptionItem[], inputValue: string) => OptionItem[]) | false;
|
|
791
|
+
/** Visible label, associated with the input. Also its accessible name unless `ariaLabel` is set. */
|
|
792
|
+
label?: string;
|
|
793
|
+
/** Show the `label`. When false the label is hidden, but the input still uses it as its accessible name. @default true */
|
|
794
|
+
withLabel?: boolean;
|
|
795
|
+
/** Accessible name for the input. Falls back to `label`. */
|
|
796
|
+
ariaLabel?: string;
|
|
797
|
+
/** Text shown in the empty input, e.g. `'Search for portals'`. */
|
|
798
|
+
placeholder?: string;
|
|
799
|
+
/** Hint rendered below the input. */
|
|
800
|
+
helperText?: string;
|
|
801
|
+
/** Error message rendered below the input. Also gives the input a red border. */
|
|
802
|
+
error?: string;
|
|
803
|
+
/** Disables the Combobox and dims the whole field. @default false */
|
|
804
|
+
disabled?: boolean;
|
|
805
|
+
/**
|
|
806
|
+
* Shows a spinner in place of the chevron, e.g. while fetching options for the typed text. Unlike in
|
|
807
|
+
* SelectInput, the input stays editable, so typing can continue. The list stays closed until there
|
|
808
|
+
* are options to show. @default false
|
|
809
|
+
*/
|
|
810
|
+
loading?: boolean;
|
|
811
|
+
/**
|
|
812
|
+
* Shown in the list when no option matches the typed text and `loading` is false, as in SortableTable.
|
|
813
|
+
* Without it, the list closes when nothing matches.
|
|
814
|
+
*/
|
|
815
|
+
noDataMessage?: Pick<NoDataMessageProps, 'title' | 'icon' | 'message'>;
|
|
816
|
+
/**
|
|
817
|
+
* There are more options than `options` holds. The Combobox then calls `onLoadMoreCallback` when the
|
|
818
|
+
* end of the list scrolls into view, or the keyboard reaches its last option. @default false
|
|
819
|
+
*/
|
|
820
|
+
hasMoreOptions?: boolean;
|
|
821
|
+
/**
|
|
822
|
+
* Called for the next options while `hasMoreOptions` and not `loading`. Append them to `options`, set
|
|
823
|
+
* `loading` while fetching, and `hasMoreOptions` to false after the last ones or a failed fetch.
|
|
824
|
+
*/
|
|
825
|
+
onLoadMoreCallback?: () => void;
|
|
826
|
+
/**
|
|
827
|
+
* Let the value be cleared: with a button while there is one, and for a single value also by deleting
|
|
828
|
+
* all text in the input. Without it, a value can only be replaced by another. @default true
|
|
829
|
+
*/
|
|
830
|
+
withClearButton?: boolean;
|
|
831
|
+
/** Accessible name of the clear button. @default 'Clear' */
|
|
832
|
+
clearButtonAriaLabel?: string;
|
|
833
|
+
/** Accessible name of the button that opens and closes the list. @default 'Show options' */
|
|
834
|
+
toggleButtonAriaLabel?: string;
|
|
835
|
+
/**
|
|
836
|
+
* Colours the input like a Button of that type, e.g. to use the Combobox as a picker in a toolbar.
|
|
837
|
+
* The list is not affected. Without it, the input looks like the other form fields.
|
|
838
|
+
*/
|
|
839
|
+
type?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY;
|
|
840
|
+
/** Size from the smallest breakpoint up. @default SizeTypes.MEDIUM */
|
|
841
|
+
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
842
|
+
/** Size from the `$md` breakpoint up, overriding `size`. */
|
|
843
|
+
sizeMd?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
844
|
+
/** Size from the `$lg` breakpoint up, overriding `size` and `sizeMd`. */
|
|
845
|
+
sizeLg?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
846
|
+
/** Size from the `$xl` breakpoint up, overriding the smaller sizes. */
|
|
847
|
+
sizeXl?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
848
|
+
/** Adds bottom spacing, for stacking fields in a form. @default false */
|
|
849
|
+
marginBottom?: boolean;
|
|
850
|
+
/** Focus the input on mount. @default false */
|
|
851
|
+
autoFocus?: boolean;
|
|
852
|
+
/** Id of the input, used to associate the label. Generated when omitted. */
|
|
853
|
+
id?: string;
|
|
854
|
+
/** Name of the value, for native form submission. */
|
|
855
|
+
name?: string;
|
|
856
|
+
/** Ref to the `<input>`. */
|
|
857
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
858
|
+
/** Class name of the outer container. */
|
|
859
|
+
className?: string;
|
|
860
|
+
/** Class name of the `<input>`. */
|
|
861
|
+
inputClassName?: string;
|
|
862
|
+
}
|
|
863
|
+
interface ComboboxSingleProps extends ComboboxBaseProps {
|
|
864
|
+
/**
|
|
865
|
+
* Without `multiple`: one value, shown as text in the input.
|
|
866
|
+
* @default false
|
|
867
|
+
*/
|
|
868
|
+
multiple?: false;
|
|
869
|
+
/**
|
|
870
|
+
* Without `multiple`: the value of the selected option, matched against each option's `value`, or `''`
|
|
871
|
+
* for none. The Combobox is controlled: hold the value yourself and update it from `onChange`.
|
|
872
|
+
*/
|
|
873
|
+
value: ComboboxValue;
|
|
874
|
+
/**
|
|
875
|
+
* Without `multiple`: called with the picked option's `value`, or `''` when the value is cleared with the
|
|
876
|
+
* clear button or by deleting all text in the input. Not called when picking the option that is already
|
|
877
|
+
* selected.
|
|
878
|
+
*/
|
|
879
|
+
onChange: (value: ComboboxValue) => void;
|
|
880
|
+
}
|
|
881
|
+
interface ComboboxMultipleProps extends ComboboxBaseProps {
|
|
882
|
+
/**
|
|
883
|
+
* With `multiple`: several values, shown as pills in the field. It changes the types of `value` and
|
|
884
|
+
* `onChange` to arrays, so pass `value` as an array whenever it is set. It can't just be switched on for
|
|
885
|
+
* a single value. Picking an option toggles it and keeps the list open, and Backspace in the empty input
|
|
886
|
+
* removes the last value.
|
|
887
|
+
*/
|
|
888
|
+
multiple: true;
|
|
889
|
+
/** With `multiple`: the values of the selected options, in the order they were picked, or `[]` for none. */
|
|
890
|
+
value: Array<ComboboxValue>;
|
|
891
|
+
/** With `multiple`: called with all selected values after one is added or removed, or `[]` when the clear button is used. */
|
|
892
|
+
onChange: (value: Array<ComboboxValue>) => void;
|
|
893
|
+
/** Only with `multiple`: pills shown in the field. The rest are behind a "+ N" button that lists them, as in BadgeList. @default 5 */
|
|
894
|
+
maxVisiblePills?: number;
|
|
895
|
+
/** Only with `multiple`: accessible name and tooltip of a pill's remove button. @default 'Remove' */
|
|
896
|
+
removePillAriaLabel?: string;
|
|
897
|
+
}
|
|
898
|
+
type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;
|
|
899
|
+
|
|
900
|
+
declare const Combobox: {
|
|
901
|
+
(props: ComboboxProps): JSX.Element;
|
|
902
|
+
displayName: string;
|
|
903
|
+
};
|
|
904
|
+
|
|
640
905
|
interface CardProps extends PaddingInterface, MarginInterface, FlexStylingInterface {
|
|
641
906
|
id?: string;
|
|
642
907
|
onClickCallback?: () => void;
|
|
@@ -697,50 +962,89 @@ declare const RadioButton: {
|
|
|
697
962
|
};
|
|
698
963
|
|
|
699
964
|
interface DropDownProps {
|
|
700
|
-
|
|
965
|
+
/**
|
|
966
|
+
* Content of the DropDown, usually DropDownItems. A DropDownItem with an `onClickCallback` closes the
|
|
967
|
+
* DropDown when clicked, unless it sets `closeDropDownOnClick={false}`. Other children with an
|
|
968
|
+
* `onClickCallback`, such as a Button, close it only when they set `closeDropDownOnClick`.
|
|
969
|
+
*/
|
|
701
970
|
children: ReactNode[] | ReactNode;
|
|
971
|
+
/**
|
|
972
|
+
* Element that toggles the DropDown, e.g. a Button or IconButton. It is cloned with a click handler
|
|
973
|
+
* under the prop named by `buttonCallbackName`.
|
|
974
|
+
*/
|
|
702
975
|
buttonComponent?: ReactNode;
|
|
976
|
+
/**
|
|
977
|
+
* Element the DropDown is anchored to, without any click handling. Use it with `isOpen` when the
|
|
978
|
+
* opening is controlled from elsewhere, e.g. a hover card or a tour step.
|
|
979
|
+
*/
|
|
703
980
|
triggerComponent?: ReactNode;
|
|
704
|
-
/**
|
|
981
|
+
/**
|
|
982
|
+
* Name of the click prop the DropDown attaches to `buttonComponent`. Use `'onClick'` for plain
|
|
983
|
+
* elements, or e.g. `'onRightClickCallback'` to toggle from one part of a MultiActionButton.
|
|
984
|
+
* @default 'onClickCallback'
|
|
985
|
+
*/
|
|
705
986
|
buttonCallbackName?: string;
|
|
706
|
-
|
|
987
|
+
/** Dark header rendered above the children. */
|
|
707
988
|
title?: string;
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
989
|
+
/** Content rendered below the children, e.g. an action or a summary. */
|
|
990
|
+
footerComponent?: ReactNode;
|
|
991
|
+
/**
|
|
992
|
+
* Controls whether the DropDown is open. When set, the DropDown doesn't toggle itself: update it
|
|
993
|
+
* from `onOpenCallback` and `onCloseCallback`.
|
|
994
|
+
*/
|
|
995
|
+
isOpen?: boolean;
|
|
996
|
+
/** Called when the button is clicked while the DropDown is closed. */
|
|
997
|
+
onOpenCallback?: () => void;
|
|
998
|
+
/** Called when the DropDown closes from the button, an outside click, Escape or a child click. */
|
|
999
|
+
onCloseCallback?: () => void;
|
|
1000
|
+
/** Close the DropDown when Escape is pressed. @default true */
|
|
1001
|
+
closeOnEscape?: boolean;
|
|
1002
|
+
/** Shows a spinner over the children, e.g. while they are being fetched. @default false */
|
|
714
1003
|
loading?: boolean;
|
|
715
|
-
/** @default true */
|
|
1004
|
+
/** Wrap the children in a `<ul>`. Set to false for content that is not a list of DropDownItems. @default true */
|
|
716
1005
|
childrenIsList?: boolean;
|
|
717
|
-
/** @default
|
|
718
|
-
closeOnEscape?: boolean;
|
|
719
|
-
isOpen?: boolean;
|
|
720
|
-
/** @default false */
|
|
1006
|
+
/** Let content overflow the list, e.g. for nested menus or tooltips. @default false */
|
|
721
1007
|
withVisibleOverflow?: boolean;
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
rotateMiddleIconByDegree?: number;
|
|
725
|
-
rotateRightIconByDegree?: number;
|
|
726
|
-
/** @default false */
|
|
727
|
-
withPortal?: boolean;
|
|
1008
|
+
/** Render the arrow pointing at the button. @default true */
|
|
1009
|
+
withArrow?: boolean;
|
|
728
1010
|
/** @default true */
|
|
729
1011
|
withShadow?: boolean;
|
|
730
|
-
/**
|
|
1012
|
+
/**
|
|
1013
|
+
* Render the DropDown in the `#root` element, or `document.body` when there is none, instead of next
|
|
1014
|
+
* to the button, so it escapes parents with `overflow: hidden` or their own stacking context.
|
|
1015
|
+
* @default false
|
|
1016
|
+
*/
|
|
1017
|
+
withPortal?: boolean;
|
|
1018
|
+
/** Preferred side of the button to open on. Flips when there is not enough room. @default 'auto' */
|
|
731
1019
|
placement?: Placement;
|
|
732
|
-
/** @default 'absolute' */
|
|
1020
|
+
/** Use `'fixed'` when the button is inside a fixed element, such as a sticky header. @default 'absolute' */
|
|
733
1021
|
strategy?: PositioningStrategy;
|
|
734
|
-
/** @default { horizontal: 8, vertical: 12 } */
|
|
1022
|
+
/** Distance in pixels between the button and the DropDown. @default { horizontal: 8, vertical: 12 } */
|
|
735
1023
|
offset?: {
|
|
736
1024
|
horizontal: number;
|
|
737
1025
|
vertical: number;
|
|
738
1026
|
};
|
|
1027
|
+
/** Minimum distance in pixels between the arrow and the DropDown's corners. @default 16 */
|
|
739
1028
|
arrowPadding?: number;
|
|
740
|
-
|
|
741
|
-
|
|
1029
|
+
/** Passed on to the button's `rotateIconByDegree` while the DropDown is open, e.g. `180` to flip a chevron. */
|
|
1030
|
+
rotateIconByDegree?: number;
|
|
1031
|
+
/** Passed on to the button's `rotateLeftIconByDegree` while open. For MultiActionButton. */
|
|
1032
|
+
rotateLeftIconByDegree?: number;
|
|
1033
|
+
/** Passed on to the button's `rotateMiddleIconByDegree` while open. For MultiActionButton. */
|
|
1034
|
+
rotateMiddleIconByDegree?: number;
|
|
1035
|
+
/** Passed on to the button's `rotateRightIconByDegree` while open. For MultiActionButton. */
|
|
1036
|
+
rotateRightIconByDegree?: number;
|
|
1037
|
+
/** Id of the outer container. */
|
|
1038
|
+
id?: string;
|
|
1039
|
+
/** Class name of the outer container, which holds the button. */
|
|
1040
|
+
className?: string;
|
|
1041
|
+
/** Class name of the positioned DropDown, e.g. to set its width. */
|
|
1042
|
+
dropDownClassName?: string;
|
|
1043
|
+
/** Class name of the `<ul>` around the children, when `childrenIsList` is true. */
|
|
1044
|
+
childrenClassName?: string;
|
|
742
1045
|
}
|
|
743
1046
|
interface DropDownRef {
|
|
1047
|
+
/** Recalculate the DropDown's position, e.g. after its content changed size. */
|
|
744
1048
|
forceUpdate: () => void;
|
|
745
1049
|
}
|
|
746
1050
|
|
|
@@ -794,7 +1098,17 @@ interface DropDownItemProps {
|
|
|
794
1098
|
onClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
795
1099
|
/** @default SizeTypes.MEDIUM */
|
|
796
1100
|
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1101
|
+
/**
|
|
1102
|
+
* Marks the item as selected, with purple text and a check mark. Pass it to every item of a selection,
|
|
1103
|
+
* `false` for the unselected ones, so the labels line up.
|
|
1104
|
+
*/
|
|
797
1105
|
active?: boolean;
|
|
1106
|
+
/**
|
|
1107
|
+
* Where the check mark of an `active` item goes. On the right it matches the option lists of SelectInput
|
|
1108
|
+
* and Combobox, and the left is free for `leftIcon`.
|
|
1109
|
+
* @default 'left'
|
|
1110
|
+
*/
|
|
1111
|
+
activeIconPosition?: 'left' | 'right';
|
|
798
1112
|
/** @default false */
|
|
799
1113
|
withEllipsis?: boolean;
|
|
800
1114
|
/** @default false */
|
|
@@ -826,7 +1140,7 @@ interface DropDownItemProps {
|
|
|
826
1140
|
}
|
|
827
1141
|
|
|
828
1142
|
declare const DropDownItem: {
|
|
829
|
-
({ 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;
|
|
1143
|
+
({ 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;
|
|
830
1144
|
defaultProps: {
|
|
831
1145
|
closeDropDownOnClick: boolean;
|
|
832
1146
|
};
|
|
@@ -1004,6 +1318,8 @@ interface IconButtonProps extends IconStyleInterface {
|
|
|
1004
1318
|
/** @default HierarchyTypes.SECONDARY */
|
|
1005
1319
|
type?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY | HierarchyTypes.TERTIARY;
|
|
1006
1320
|
onClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
1321
|
+
/** 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. */
|
|
1322
|
+
onMouseDownCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
1007
1323
|
style?: CSSProperties;
|
|
1008
1324
|
iconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1009
1325
|
/** @default SizeTypes.MEDIUM */
|
|
@@ -1025,7 +1341,7 @@ interface IconButtonProps extends IconStyleInterface {
|
|
|
1025
1341
|
badgeColor?: BadgeTypes;
|
|
1026
1342
|
}
|
|
1027
1343
|
|
|
1028
|
-
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>;
|
|
1344
|
+
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>;
|
|
1029
1345
|
|
|
1030
1346
|
interface IconInterface$1 {
|
|
1031
1347
|
loading?: boolean;
|
|
@@ -1773,45 +2089,6 @@ declare const TabGroup: {
|
|
|
1773
2089
|
displayName: string;
|
|
1774
2090
|
};
|
|
1775
2091
|
|
|
1776
|
-
interface OptionItem {
|
|
1777
|
-
text: string;
|
|
1778
|
-
value: string | number;
|
|
1779
|
-
disabled?: boolean;
|
|
1780
|
-
}
|
|
1781
|
-
interface SelectInputProps {
|
|
1782
|
-
inputRef?: RefObject<HTMLSelectElement>;
|
|
1783
|
-
id?: string;
|
|
1784
|
-
className?: string;
|
|
1785
|
-
inputClassName?: string;
|
|
1786
|
-
defaultOption?: string;
|
|
1787
|
-
/** @default SizeTypes.MEDIUM */
|
|
1788
|
-
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1789
|
-
sizeMd?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1790
|
-
sizeLg?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1791
|
-
sizeXl?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1792
|
-
/** @default false */
|
|
1793
|
-
disabled?: boolean;
|
|
1794
|
-
/** @default true */
|
|
1795
|
-
withLabel?: boolean;
|
|
1796
|
-
error?: string;
|
|
1797
|
-
helperText?: string;
|
|
1798
|
-
text?: string;
|
|
1799
|
-
/** @default false */
|
|
1800
|
-
marginBottom?: boolean;
|
|
1801
|
-
/** @default false */
|
|
1802
|
-
autoFocus?: boolean;
|
|
1803
|
-
/** @default false */
|
|
1804
|
-
loading?: boolean;
|
|
1805
|
-
ariaLabel?: string;
|
|
1806
|
-
label?: string;
|
|
1807
|
-
name?: string;
|
|
1808
|
-
onChange: (value: string | number) => void;
|
|
1809
|
-
options: Array<OptionItem>;
|
|
1810
|
-
value: string | number;
|
|
1811
|
-
/** @default true */
|
|
1812
|
-
nativeHtmlComponent?: boolean;
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
2092
|
declare const SelectInput: {
|
|
1816
2093
|
({ 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;
|
|
1817
2094
|
displayName: string;
|
|
@@ -1903,25 +2180,9 @@ declare const SkeletonItem: {
|
|
|
1903
2180
|
displayName: string;
|
|
1904
2181
|
};
|
|
1905
2182
|
|
|
1906
|
-
interface NoDataMessageProps {
|
|
1907
|
-
id?: string;
|
|
1908
|
-
className?: string;
|
|
1909
|
-
icon?: Partial<IconTypes>;
|
|
1910
|
-
title?: string;
|
|
1911
|
-
message?: string;
|
|
1912
|
-
/** @default false */
|
|
1913
|
-
absoluteCenter?: boolean;
|
|
1914
|
-
customLink?: ReactNode;
|
|
1915
|
-
button?: {
|
|
1916
|
-
onClickCallback: () => void;
|
|
1917
|
-
text: string;
|
|
1918
|
-
icon: Partial<IconTypes>;
|
|
1919
|
-
};
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
2183
|
declare const NoDataMessage: {
|
|
1923
2184
|
({ id, icon, title, message, className, absoluteCenter, customLink, button }: NoDataMessageProps): JSX.Element;
|
|
1924
2185
|
displayName: string;
|
|
1925
2186
|
};
|
|
1926
2187
|
|
|
1927
|
-
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 };
|
|
2188
|
+
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 };
|