react-magma-dom 4.7.0-next.5 → 4.7.0-next.7
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/ButtonGroup/ButtonGroup.stories.d.ts +6 -6
- package/dist/components/CharacterCounter/CharacterCounter.stories.d.ts +12 -12
- package/dist/components/Combobox/ComboboxInput.d.ts +3 -1
- package/dist/components/Combobox/index.d.ts +25 -12
- package/dist/components/Datagrid/Datagrid.stories.d.ts +8 -8
- package/dist/components/DatePicker/index.d.ts +4 -0
- package/dist/components/Dropdown/Dropdown.d.ts +8 -0
- package/dist/components/Dropdown/Dropdown.stories.d.ts +1 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +4 -4
- package/dist/components/Input/Input.stories.d.ts +36 -33
- package/dist/components/InputBase/index.d.ts +13 -4
- package/dist/components/Select/ItemsList.d.ts +6 -3
- package/dist/components/Select/SelectContainer.d.ts +1 -1
- package/dist/components/Select/SelectTriggerButton.d.ts +3 -1
- package/dist/components/Select/index.d.ts +22 -2
- package/dist/components/Table/Table.stories.d.ts +36 -36
- package/dist/components/Tag/Tag.stories.d.ts +68 -68
- package/dist/components/Textarea/Textarea.stories.d.ts +6 -6
- package/dist/components/ToggleButton/ToggleButton.stories.d.ts +24 -24
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts +12 -12
- package/dist/components/TreeView/useTreeView.d.ts +1 -1
- package/dist/components/TreeView/utils.d.ts +3 -0
- package/dist/esm/index.js +2440 -171
- package/dist/esm/index.js.map +1 -1
- package/dist/properties.json +148 -102
- package/dist/react-magma-dom.cjs.development.js +298 -157
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
2
2
|
export default _default;
|
|
3
3
|
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, ({} & import(".").IconTextButtonProps) | ({
|
|
4
|
-
children?: never;
|
|
5
4
|
iconPosition?: never;
|
|
5
|
+
children?: never;
|
|
6
6
|
} & import(".").IconOnlyButtonProps)>;
|
|
7
7
|
export declare const Inverse: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, ({} & import(".").IconTextButtonProps) | ({
|
|
8
|
-
children?: never;
|
|
9
8
|
iconPosition?: never;
|
|
9
|
+
children?: never;
|
|
10
10
|
} & import(".").IconOnlyButtonProps)>;
|
|
11
11
|
export declare const IconOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, ({} & import(".").IconTextButtonProps) | ({
|
|
12
|
-
children?: never;
|
|
13
12
|
iconPosition?: never;
|
|
13
|
+
children?: never;
|
|
14
14
|
} & import(".").IconOnlyButtonProps)>;
|
|
15
15
|
export declare const AnimatedIcon: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, ({} & import(".").IconTextButtonProps) | ({
|
|
16
|
-
children?: never;
|
|
17
16
|
iconPosition?: never;
|
|
17
|
+
children?: never;
|
|
18
18
|
} & import(".").IconOnlyButtonProps)>;
|
|
@@ -38,13 +38,14 @@ export declare const IconPositions: {
|
|
|
38
38
|
inputWrapperStyle?: React.CSSProperties;
|
|
39
39
|
isClearable?: boolean;
|
|
40
40
|
onClear?: () => void;
|
|
41
|
+
isPasswordInput?: boolean;
|
|
41
42
|
isPredictive?: boolean;
|
|
42
43
|
onIconClick?: () => void;
|
|
43
44
|
onIconKeyDown?: (event: any) => void;
|
|
44
45
|
onDateChange?: (event: any) => void;
|
|
46
|
+
setReference?: (node: import("@floating-ui/react-dom").ReferenceType) => void;
|
|
45
47
|
theme?: any;
|
|
46
48
|
type?: InputType;
|
|
47
|
-
isPasswordInput?: boolean;
|
|
48
49
|
width?: string;
|
|
49
50
|
accept?: string;
|
|
50
51
|
alt?: string;
|
|
@@ -60,10 +61,10 @@ export declare const IconPositions: {
|
|
|
60
61
|
formMethod?: string;
|
|
61
62
|
formNoValidate?: boolean;
|
|
62
63
|
formTarget?: string;
|
|
63
|
-
height?:
|
|
64
|
+
height?: React.ReactText;
|
|
64
65
|
list?: string;
|
|
65
|
-
max?:
|
|
66
|
-
min?:
|
|
66
|
+
max?: React.ReactText;
|
|
67
|
+
min?: React.ReactText;
|
|
67
68
|
minLength?: number;
|
|
68
69
|
multiple?: boolean;
|
|
69
70
|
name?: string;
|
|
@@ -72,7 +73,7 @@ export declare const IconPositions: {
|
|
|
72
73
|
required?: boolean;
|
|
73
74
|
size?: number;
|
|
74
75
|
src?: string;
|
|
75
|
-
step?:
|
|
76
|
+
step?: React.ReactText;
|
|
76
77
|
value?: string | number | readonly string[];
|
|
77
78
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
78
79
|
defaultChecked?: boolean;
|
|
@@ -81,7 +82,7 @@ export declare const IconPositions: {
|
|
|
81
82
|
suppressHydrationWarning?: boolean;
|
|
82
83
|
accessKey?: string;
|
|
83
84
|
className?: string;
|
|
84
|
-
contentEditable?: boolean | "
|
|
85
|
+
contentEditable?: boolean | "true" | "false" | "inherit";
|
|
85
86
|
contextMenu?: string;
|
|
86
87
|
dir?: string;
|
|
87
88
|
draggable?: boolean | "true" | "false";
|
|
@@ -116,11 +117,11 @@ export declare const IconPositions: {
|
|
|
116
117
|
results?: number;
|
|
117
118
|
security?: string;
|
|
118
119
|
unselectable?: "on" | "off";
|
|
119
|
-
inputMode?: "
|
|
120
|
+
inputMode?: "text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
120
121
|
is?: string;
|
|
121
122
|
'aria-activedescendant'?: string;
|
|
122
123
|
'aria-atomic'?: boolean | "true" | "false";
|
|
123
|
-
'aria-autocomplete'?: "
|
|
124
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both";
|
|
124
125
|
'aria-busy'?: boolean | "true" | "false";
|
|
125
126
|
'aria-checked'?: boolean | "true" | "false" | "mixed";
|
|
126
127
|
'aria-colcount'?: number;
|
|
@@ -131,12 +132,12 @@ export declare const IconPositions: {
|
|
|
131
132
|
'aria-describedby'?: string;
|
|
132
133
|
'aria-details'?: string;
|
|
133
134
|
'aria-disabled'?: boolean | "true" | "false";
|
|
134
|
-
'aria-dropeffect'?: "
|
|
135
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup";
|
|
135
136
|
'aria-errormessage'?: string;
|
|
136
137
|
'aria-expanded'?: boolean | "true" | "false";
|
|
137
138
|
'aria-flowto'?: string;
|
|
138
139
|
'aria-grabbed'?: boolean | "true" | "false";
|
|
139
|
-
'aria-haspopup'?: boolean | "
|
|
140
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree";
|
|
140
141
|
'aria-hidden'?: boolean | "true" | "false";
|
|
141
142
|
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
|
|
142
143
|
'aria-keyshortcuts'?: string;
|
|
@@ -153,7 +154,7 @@ export declare const IconPositions: {
|
|
|
153
154
|
'aria-posinset'?: number;
|
|
154
155
|
'aria-pressed'?: boolean | "true" | "false" | "mixed";
|
|
155
156
|
'aria-readonly'?: boolean | "true" | "false";
|
|
156
|
-
'aria-relevant'?: "
|
|
157
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals";
|
|
157
158
|
'aria-required'?: boolean | "true" | "false";
|
|
158
159
|
'aria-roledescription'?: string;
|
|
159
160
|
'aria-rowcount'?: number;
|
|
@@ -368,13 +369,14 @@ export declare const WithChildren: {
|
|
|
368
369
|
inputWrapperStyle?: React.CSSProperties;
|
|
369
370
|
isClearable?: boolean;
|
|
370
371
|
onClear?: () => void;
|
|
372
|
+
isPasswordInput?: boolean;
|
|
371
373
|
isPredictive?: boolean;
|
|
372
374
|
onIconClick?: () => void;
|
|
373
375
|
onIconKeyDown?: (event: any) => void;
|
|
374
376
|
onDateChange?: (event: any) => void;
|
|
377
|
+
setReference?: (node: import("@floating-ui/react-dom").ReferenceType) => void;
|
|
375
378
|
theme?: any;
|
|
376
379
|
type?: InputType;
|
|
377
|
-
isPasswordInput?: boolean;
|
|
378
380
|
width?: string;
|
|
379
381
|
accept?: string;
|
|
380
382
|
alt?: string;
|
|
@@ -390,10 +392,10 @@ export declare const WithChildren: {
|
|
|
390
392
|
formMethod?: string;
|
|
391
393
|
formNoValidate?: boolean;
|
|
392
394
|
formTarget?: string;
|
|
393
|
-
height?:
|
|
395
|
+
height?: React.ReactText;
|
|
394
396
|
list?: string;
|
|
395
|
-
max?:
|
|
396
|
-
min?:
|
|
397
|
+
max?: React.ReactText;
|
|
398
|
+
min?: React.ReactText;
|
|
397
399
|
minLength?: number;
|
|
398
400
|
multiple?: boolean;
|
|
399
401
|
name?: string;
|
|
@@ -403,7 +405,7 @@ export declare const WithChildren: {
|
|
|
403
405
|
required?: boolean;
|
|
404
406
|
size?: number;
|
|
405
407
|
src?: string;
|
|
406
|
-
step?:
|
|
408
|
+
step?: React.ReactText;
|
|
407
409
|
value?: string | number | readonly string[];
|
|
408
410
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
409
411
|
defaultChecked?: boolean;
|
|
@@ -412,7 +414,7 @@ export declare const WithChildren: {
|
|
|
412
414
|
suppressHydrationWarning?: boolean;
|
|
413
415
|
accessKey?: string;
|
|
414
416
|
className?: string;
|
|
415
|
-
contentEditable?: boolean | "
|
|
417
|
+
contentEditable?: boolean | "true" | "false" | "inherit";
|
|
416
418
|
contextMenu?: string;
|
|
417
419
|
dir?: string;
|
|
418
420
|
draggable?: boolean | "true" | "false";
|
|
@@ -447,11 +449,11 @@ export declare const WithChildren: {
|
|
|
447
449
|
results?: number;
|
|
448
450
|
security?: string;
|
|
449
451
|
unselectable?: "on" | "off";
|
|
450
|
-
inputMode?: "
|
|
452
|
+
inputMode?: "text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
451
453
|
is?: string;
|
|
452
454
|
'aria-activedescendant'?: string;
|
|
453
455
|
'aria-atomic'?: boolean | "true" | "false";
|
|
454
|
-
'aria-autocomplete'?: "
|
|
456
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both";
|
|
455
457
|
'aria-busy'?: boolean | "true" | "false";
|
|
456
458
|
'aria-checked'?: boolean | "true" | "false" | "mixed";
|
|
457
459
|
'aria-colcount'?: number;
|
|
@@ -462,12 +464,12 @@ export declare const WithChildren: {
|
|
|
462
464
|
'aria-describedby'?: string;
|
|
463
465
|
'aria-details'?: string;
|
|
464
466
|
'aria-disabled'?: boolean | "true" | "false";
|
|
465
|
-
'aria-dropeffect'?: "
|
|
467
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup";
|
|
466
468
|
'aria-errormessage'?: string;
|
|
467
469
|
'aria-expanded'?: boolean | "true" | "false";
|
|
468
470
|
'aria-flowto'?: string;
|
|
469
471
|
'aria-grabbed'?: boolean | "true" | "false";
|
|
470
|
-
'aria-haspopup'?: boolean | "
|
|
472
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree";
|
|
471
473
|
'aria-hidden'?: boolean | "true" | "false";
|
|
472
474
|
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
|
|
473
475
|
'aria-keyshortcuts'?: string;
|
|
@@ -484,7 +486,7 @@ export declare const WithChildren: {
|
|
|
484
486
|
'aria-posinset'?: number;
|
|
485
487
|
'aria-pressed'?: boolean | "true" | "false" | "mixed";
|
|
486
488
|
'aria-readonly'?: boolean | "true" | "false";
|
|
487
|
-
'aria-relevant'?: "
|
|
489
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals";
|
|
488
490
|
'aria-required'?: boolean | "true" | "false";
|
|
489
491
|
'aria-roledescription'?: string;
|
|
490
492
|
'aria-rowcount'?: number;
|
|
@@ -696,13 +698,14 @@ export declare const WithTwoIcons: {
|
|
|
696
698
|
inputWrapperStyle?: React.CSSProperties;
|
|
697
699
|
isClearable?: boolean;
|
|
698
700
|
onClear?: () => void;
|
|
701
|
+
isPasswordInput?: boolean;
|
|
699
702
|
isPredictive?: boolean;
|
|
700
703
|
onIconClick?: () => void;
|
|
701
704
|
onIconKeyDown?: (event: any) => void;
|
|
702
705
|
onDateChange?: (event: any) => void;
|
|
706
|
+
setReference?: (node: import("@floating-ui/react-dom").ReferenceType) => void;
|
|
703
707
|
theme?: any;
|
|
704
708
|
type?: InputType;
|
|
705
|
-
isPasswordInput?: boolean;
|
|
706
709
|
width?: string;
|
|
707
710
|
accept?: string;
|
|
708
711
|
alt?: string;
|
|
@@ -718,10 +721,10 @@ export declare const WithTwoIcons: {
|
|
|
718
721
|
formMethod?: string;
|
|
719
722
|
formNoValidate?: boolean;
|
|
720
723
|
formTarget?: string;
|
|
721
|
-
height?:
|
|
724
|
+
height?: React.ReactText;
|
|
722
725
|
list?: string;
|
|
723
|
-
max?:
|
|
724
|
-
min?:
|
|
726
|
+
max?: React.ReactText;
|
|
727
|
+
min?: React.ReactText;
|
|
725
728
|
minLength?: number;
|
|
726
729
|
multiple?: boolean;
|
|
727
730
|
name?: string;
|
|
@@ -731,7 +734,7 @@ export declare const WithTwoIcons: {
|
|
|
731
734
|
required?: boolean;
|
|
732
735
|
size?: number;
|
|
733
736
|
src?: string;
|
|
734
|
-
step?:
|
|
737
|
+
step?: React.ReactText;
|
|
735
738
|
value?: string | number | readonly string[];
|
|
736
739
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
737
740
|
defaultChecked?: boolean;
|
|
@@ -740,7 +743,7 @@ export declare const WithTwoIcons: {
|
|
|
740
743
|
suppressHydrationWarning?: boolean;
|
|
741
744
|
accessKey?: string;
|
|
742
745
|
className?: string;
|
|
743
|
-
contentEditable?: boolean | "
|
|
746
|
+
contentEditable?: boolean | "true" | "false" | "inherit";
|
|
744
747
|
contextMenu?: string;
|
|
745
748
|
dir?: string;
|
|
746
749
|
draggable?: boolean | "true" | "false";
|
|
@@ -775,11 +778,11 @@ export declare const WithTwoIcons: {
|
|
|
775
778
|
results?: number;
|
|
776
779
|
security?: string;
|
|
777
780
|
unselectable?: "on" | "off";
|
|
778
|
-
inputMode?: "
|
|
781
|
+
inputMode?: "text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
779
782
|
is?: string;
|
|
780
783
|
'aria-activedescendant'?: string;
|
|
781
784
|
'aria-atomic'?: boolean | "true" | "false";
|
|
782
|
-
'aria-autocomplete'?: "
|
|
785
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both";
|
|
783
786
|
'aria-busy'?: boolean | "true" | "false";
|
|
784
787
|
'aria-checked'?: boolean | "true" | "false" | "mixed";
|
|
785
788
|
'aria-colcount'?: number;
|
|
@@ -790,12 +793,12 @@ export declare const WithTwoIcons: {
|
|
|
790
793
|
'aria-describedby'?: string;
|
|
791
794
|
'aria-details'?: string;
|
|
792
795
|
'aria-disabled'?: boolean | "true" | "false";
|
|
793
|
-
'aria-dropeffect'?: "
|
|
796
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup";
|
|
794
797
|
'aria-errormessage'?: string;
|
|
795
798
|
'aria-expanded'?: boolean | "true" | "false";
|
|
796
799
|
'aria-flowto'?: string;
|
|
797
800
|
'aria-grabbed'?: boolean | "true" | "false";
|
|
798
|
-
'aria-haspopup'?: boolean | "
|
|
801
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree";
|
|
799
802
|
'aria-hidden'?: boolean | "true" | "false";
|
|
800
803
|
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
|
|
801
804
|
'aria-keyshortcuts'?: string;
|
|
@@ -812,7 +815,7 @@ export declare const WithTwoIcons: {
|
|
|
812
815
|
'aria-posinset'?: number;
|
|
813
816
|
'aria-pressed'?: boolean | "true" | "false" | "mixed";
|
|
814
817
|
'aria-readonly'?: boolean | "true" | "false";
|
|
815
|
-
'aria-relevant'?: "
|
|
818
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals";
|
|
816
819
|
'aria-required'?: boolean | "true" | "false";
|
|
817
820
|
'aria-roledescription'?: string;
|
|
818
821
|
'aria-rowcount'?: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IconProps } from 'react-magma-icons';
|
|
3
3
|
import { ThemeInterface } from '../../theme/magma';
|
|
4
|
+
import { ReferenceType } from '@floating-ui/react-dom/dist/floating-ui.react-dom';
|
|
4
5
|
export declare enum InputSize {
|
|
5
6
|
large = "large",
|
|
6
7
|
medium = "medium"
|
|
@@ -81,7 +82,15 @@ export interface InputBaseProps extends React.InputHTMLAttributes<HTMLInputEleme
|
|
|
81
82
|
* Function to be called when the contents of input are cleared by clicking a clear button
|
|
82
83
|
*/
|
|
83
84
|
onClear?: () => void;
|
|
85
|
+
/**
|
|
86
|
+
* If true, the component will have inverse styling to better appear on a dark background
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
84
89
|
isInverse?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Boolean for whether this is a Password Input or not
|
|
92
|
+
*/
|
|
93
|
+
isPasswordInput?: boolean;
|
|
85
94
|
/**
|
|
86
95
|
* For use in predictive search which moves the icon to the left
|
|
87
96
|
*/
|
|
@@ -107,6 +116,10 @@ export interface InputBaseProps extends React.InputHTMLAttributes<HTMLInputEleme
|
|
|
107
116
|
* Action that will synchronize chosenDate with input value
|
|
108
117
|
*/
|
|
109
118
|
onDateChange?: (event: any) => void;
|
|
119
|
+
/**
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
setReference?: (node: ReferenceType) => void;
|
|
110
123
|
/**
|
|
111
124
|
* @internal
|
|
112
125
|
*/
|
|
@@ -120,10 +133,6 @@ export interface InputBaseProps extends React.InputHTMLAttributes<HTMLInputEleme
|
|
|
120
133
|
* @default InputType.text
|
|
121
134
|
*/
|
|
122
135
|
type?: InputType;
|
|
123
|
-
/**
|
|
124
|
-
* Boolean for whether this is a Password Input or not
|
|
125
|
-
*/
|
|
126
|
-
isPasswordInput?: boolean;
|
|
127
136
|
/**
|
|
128
137
|
* String to determine width of input, must be suffixed with "px", "rem", or "%""
|
|
129
138
|
* @default "auto"
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { UseSelectGetItemPropsOptions, UseSelectGetMenuPropsOptions } from 'downshift';
|
|
3
3
|
import { SelectComponents } from './components';
|
|
4
|
+
import { ReferenceType } from '@floating-ui/react-dom';
|
|
4
5
|
interface ItemsListProps<T> {
|
|
5
6
|
customComponents?: SelectComponents<T>;
|
|
7
|
+
floatingElementStyles?: React.CSSProperties;
|
|
6
8
|
getItemProps: (options?: UseSelectGetItemPropsOptions<T>) => any;
|
|
7
9
|
getMenuProps: (options?: UseSelectGetMenuPropsOptions) => any;
|
|
8
10
|
highlightedIndex?: number;
|
|
9
|
-
isOpen?: boolean;
|
|
10
11
|
isInverse?: boolean;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
isOpen?: boolean;
|
|
11
14
|
items: T[];
|
|
12
15
|
itemToString: (item: T) => string;
|
|
13
16
|
maxHeight?: number | string;
|
|
14
17
|
menuStyle?: React.CSSProperties;
|
|
15
|
-
|
|
18
|
+
setFloating?: (node: ReferenceType) => void;
|
|
16
19
|
}
|
|
17
20
|
export declare function ItemsList<T>(props: ItemsListProps<T>): JSX.Element;
|
|
18
21
|
export {};
|
|
@@ -13,8 +13,8 @@ interface SelectContainerInterface<T> {
|
|
|
13
13
|
additionalContent?: React.ReactNode;
|
|
14
14
|
children: React.ReactNode[];
|
|
15
15
|
containerStyle?: React.CSSProperties;
|
|
16
|
-
errorMessage?: React.ReactNode;
|
|
17
16
|
descriptionId?: string;
|
|
17
|
+
errorMessage?: React.ReactNode;
|
|
18
18
|
getLabelProps: (options?: UseSelectGetLabelPropsOptions) => any;
|
|
19
19
|
hasError?: boolean;
|
|
20
20
|
helperMessage?: React.ReactNode;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectComponents } from '../Select/components';
|
|
3
|
+
import { ReferenceType } from '@floating-ui/react-dom';
|
|
3
4
|
interface SelectTriggerButtonInterface<T> {
|
|
4
5
|
ariaDescribedBy?: string;
|
|
5
6
|
children: React.ReactNode | React.ReactNode[];
|
|
6
7
|
customComponents?: SelectComponents<T>;
|
|
7
|
-
hasError?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
hasError?: boolean;
|
|
9
10
|
isInverse?: boolean;
|
|
11
|
+
setReference?: (node: ReferenceType) => void;
|
|
10
12
|
style?: React.CSSProperties;
|
|
11
13
|
toggleButtonProps: any;
|
|
12
14
|
tabindex?: number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { UseMultipleSelectionProps, UseSelectProps } from 'downshift';
|
|
3
|
+
import { ReferenceType } from '@floating-ui/react-dom/dist/floating-ui.react-dom';
|
|
3
4
|
import { SelectComponents } from './components';
|
|
4
|
-
import {
|
|
5
|
+
import { Omit, XOR } from '../../utils';
|
|
5
6
|
import { LabelPosition } from '../Label';
|
|
6
7
|
export declare type SelectOptions = string | {
|
|
7
8
|
value: string;
|
|
@@ -43,6 +44,10 @@ export interface InternalSelectProps<T> {
|
|
|
43
44
|
* @default false
|
|
44
45
|
*/
|
|
45
46
|
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* If true, the component will have inverse styling to better appear on a dark background
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
46
51
|
isInverse?: boolean;
|
|
47
52
|
/**
|
|
48
53
|
* If true, label text will be hidden visually, but will still be read by assistive technology
|
|
@@ -102,6 +107,10 @@ export interface SelectProps<T extends SelectOptions> extends UseSelectProps<T>,
|
|
|
102
107
|
* Id of the element that describes the select trigger button
|
|
103
108
|
*/
|
|
104
109
|
ariaDescribedBy?: string;
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
floatingElementStyles?: React.CSSProperties;
|
|
105
114
|
/**
|
|
106
115
|
* @internal
|
|
107
116
|
*/
|
|
@@ -134,12 +143,23 @@ export interface SelectProps<T extends SelectOptions> extends UseSelectProps<T>,
|
|
|
134
143
|
* Event that will fire when a keypress is released while focused on the trigger button
|
|
135
144
|
*/
|
|
136
145
|
onKeyUp?: (event: React.KeyboardEvent) => void;
|
|
146
|
+
/**
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
setFloating?: (node: ReferenceType) => void;
|
|
150
|
+
/**
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
setReference?: (node: ReferenceType) => void;
|
|
137
154
|
}
|
|
138
155
|
export interface MultiSelectProps<T extends SelectOptions> extends UseMultipleSelectionProps<T>, Omit<SelectProps<T>, 'onStateChange' | 'stateReducer' | 'isMulti'>, InternalMultiProps<T> {
|
|
139
156
|
/**
|
|
140
157
|
* @internal
|
|
141
158
|
*/
|
|
142
159
|
hasError?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
143
163
|
isInverse?: boolean;
|
|
144
164
|
/**
|
|
145
165
|
* @internal
|