forked from react-toolbox/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
react-toolbox.d.ts
1236 lines (1208 loc) · 39 KB
/
react-toolbox.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for react-toolbox 0.14.1
// Project: http://react-toolbox.com/
// Definitions by: @xogeny (Michael M. Tiller), @hsrobflavorus (Robert Parker)
/* CHANGES
* 02/03/2016:
* Fixed for TypeScript 1.8.0 stricter var declaration requirements (move `declare var ...` inside each individual module).
* Removed triple-slash reference to React to fix npm install compatibility (you'll need to make sure you're referencing react.d.ts somewhere in your project!).
* Hopefully fixed the default exports where applicable
* 01/13/2016: Minor changes, add a few missing props, add IconButton to react-toolbox/lib/button
* 12/21/2015: Fix "import * as Input from 'react-toolbox/lib/input'" style imports, which now correctly import only the necessary component(s).
* NOTE that you must use "import * as {Component Name}" not just "import {Component Name}" for this to work.
* 12/20/2015: Should be compatible with 0.14.0. Refactor modules into 'react-toolbox/lib/*' format.
Unfortunately importing them directly in that manner doesn't seem to work
i.e. "import Input from 'react-toolbox/lib/input'" resolves to undefined, whereas "import { Input } from 'react-toolbox'" works fine!
... Any ideas welcome!
* 12/20/2015: Add AppBar, Avatar, and refactor Card and its child Components to match the documentation.
* 12/18/2015: Update to react-toolbox 0.13.1 (from 0.12.11)
* 12/18/2015: Use JSDoc-style comments to provide Intellisense where supported
*/
/*
MISSING COMPONENTS (Contributions welcome)
* Ripple HOC
*/
declare namespace __RT {
import React = __React;
// Properties that all components have
export interface Props {
/**
* Sets a CSS class on the component.
*/
className?: string,
/**
* A key used to uniquely identify the element within an Array
*/
key?: string,
/**
* Inline style
*/
style?: any,
/**
* Tooltip text
* APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip.
* @see http://react-toolbox.com/#/components/tooltip
*/
tooltip?: string,
/**
* Amount of time in miliseconds spent before the tooltip is visible.
* APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip.
* @see http://react-toolbox.com/#/components/tooltip
*/
tooltipDelay?: number,
/**
* If true, the Tooltip hides after a click in the host component.
* APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip.
* @default true
* @see http://react-toolbox.com/#/components/tooltip
*/
tooltipHideOnClick?: boolean,
}
/**
* Properties of modal components (Drawer, Dialog)
*/
export interface Modal {
/**
* If true, the dialog will be active.
*/
active: boolean,
/**
* Callback to be invoked when the dialog overlay is clicked.
*/
onOverlayClick?: Function,
}
// Interface for components with icons
export interface Iconic {
/**
* Value of the icon (See icon component).
*/
icon?: string | __React.ReactElement<any> | __React.ReactHTMLElement,
}
export interface Conditional {
/**
* If true, component will be disabled
* @default false
*/
disabled?: boolean
}
/**
* Properties of components that have values that can be changed (T is the type of the value)
*/
export interface Changeable<T> {
/**
* Callback called when the picker value is changed.
* @param v Type of the value
*/
onChange?: (v: T) => void
}
/**
* Properties of components that can be clicked
*/
export interface Clickable {
/**
* Callback called when the button is clicked.
*/
onClick?: Function
}
export interface Option<T> {
label: string,
value: T,
}
////////////////////////////////
/// Component definitions
////////////////////////////////
export interface AppBarProps extends Props {
/**
* If true, the AppBar shows a shadow.
* @default false
*/
flat?: boolean,
/**
* Determine if the bar should have position fixed (true) or relative (false)
* @default false
*/
fixed?: boolean,
}
/**
* The app bar is a special kind of toolbar that’s used for branding, navigation, search, and actions.
* Usually it contains controls on the right and left side and a title with the current section or app name.
* You should give the content with children elements.
*/
class AppBar extends React.Component<AppBarProps, {}> {
render(): React.DOMElement<any>;
}
export interface AvatarProps extends Props, Iconic {
children?: any,
image?: string | __React.ReactElement<any> | __React.ReactHTMLElement | __React.ClassicComponent<any, any>,
title?: string | boolean,
}
/**
* Avatars can be used to represent people.
* For personal avatars, offer personalization options.
* As users may choose not to personalize an avatar, provide delightful defaults.
* When used with a specific logo, avatars can also be used to represent brand.
*/
class Avatar extends React.Component<AvatarProps, {}> {
render(): React.DOMElement<any>;
}
interface AutocompleteProps extends Props, Conditional, Changeable<string | Array<any>> {
/**
* Sets the error string for the internal input element.
*/
error?: string,
/**
* The text string to use for the floating label element.
*/
label?: string,
/**
* If true, component can hold multiple values.
* @default true
*/
multiple?: boolean,
/**
* Object of key/values or array representing all items suggested.
*/
source: Object | Array<any>,
/**
* Type of the input element. It can be a valid HTML5 input type
* @default text
*/
type?: string,
/**
* Value or array of values currently selected component.Current value of the input element.
*/
value?: string | Array<any>,
}
/**
* An input field with a set of predeterminated labeled values. When it's focused it shows a list of hints that are filtered by label as the user types.
* They can be simple or multiple depending on the amount of values that can be selected.
* The opening direction is determined at opening time depending on the current position.
*/
class Autocomplete extends React.Component<AutocompleteProps, {}> {
render(): React.DOMElement<any>;
}
interface ButtonProps extends Props, Clickable, Conditional, Iconic {
/**
* Indicates if the button should have accent color.
* @default false
*/
accent?: boolean,
/**
* If true, the button will have a flat look.
* @default false
*/
flat?: boolean,
/**
* If true, the button will have a floating look.
* @default false
*/
floating?: boolean,
/**
* If specified, the button will be rendered as an <a>
*/
href?: string,
/**
* The text string to use for the name of the button.
*/
label?: string,
/**
* If true, component will be disabled and show a loading animation.
* @default false
*/
loading?: boolean,
/**
* To be used with floating button. If true the button will be smaller.
* @default false
*/
mini?: boolean,
/**
* Indicates if the button should have primary color.
* @default false
*/
primary?: boolean,
/**
* If true, the button will have a raised look.
* @default false
*/
raised?: boolean,
/**
* If true, component will have a ripple effect on click.
* @default true
*/
ripple?: boolean,
}
/**
* A button clearly communicates what action will occur when the user touches it.
* It consists of text, an image, or both, designed in accordance with your app’s color theme.
*/
class Button extends React.Component<ButtonProps, {}> {
render(): React.DOMElement<any>;
}
class IconButton extends React.Component<ButtonProps, {}> {
render(): React.DOMElement<any>;
}
interface CardProps extends Props, Clickable {
/**
* Child components, usually Card subcomponents.
*/
children?: any,
/**
* Increases the shadow depth to appear elevated.
*/
raised?: boolean,
/**
* Array of objects describing actions. These actions will be rendered as buttons and the object fields will be transferred to those.
* @default []
*/
actions?: Array<ButtonProps>,
/**
* Sets HEX or RGBA color to add a colored layer to the heading.
*/
color?: string,
/**
* URL to set as a background image in the heading.
*/
image?: string,
/**
* Type of the component to display general modifications. It can be 'wide' for a larger card, 'image' if it's an image card or 'event' which shows just a title on top.
*/
type?: string,
}
/**
* A Card is a piece of paper with unique related data that serves as an entry point to more detailed information.
* For example, a card could contain a photo, text, and a link about a single subject.
* Cards are composed of multiple subcomponents in React Toolbox.
* You can combine each of the subcomponents to create all different Material Design Cards given in the spec.
*/
export class Card extends React.Component<CardProps, {}> {
render(): React.DOMElement<any>;
}
export interface CardTitleProps extends Props {
avatar?: string | __React.ReactElement<any> | __React.ReactHTMLElement | __React.ClassicComponent<any, any>,
/**
* Children to pass through the component.
*/
children?: any,
/**
* Sets a complementary smaller text under the title.
*/
subtitle?: string,
/**
* Sets the title of the card.
*/
title?: string | boolean,
}
/**
* A versatile title block that can be used in various places on the card, including the media area.
* This component can also display an avatar next to the title content.
*/
export class CardTitle extends React.Component<CardTitleProps, {}> {
render(): React.DOMElement<any>;
}
export interface CardMediaProps extends Props {
/**
* Forces a ('wide' 16:9) or ('square' 1:1) aspect ratio respectively.
* Unset, the media area will have a flexible height.
* @default ''
*/
aspectRatio?: string,
/**
* Usually an image/video element or a <CardTitle> component.
*/
children?: any,
/**
* Sets the background color
*/
color?: string,
/**
* Creates a dark overlay underneath the child components.
*/
contentOverlay?: boolean,
/**
* Can be used instead of children. Accepts an element or a URL string.
*/
image?: string | __React.ReactElement<any> | __React.ReactHTMLElement | __React.ClassicComponent<any, any>,
}
/**
* Used for displaying media such as images or videos on a card.
* Can also be used with a solid background color instead of an image.
*/
export class CardMedia extends React.Component<CardMediaProps, {}> {
render(): React.DOMElement<any>;
}
export interface CardTextProps extends Props {
/**
* Children to pass through the component.
*/
children?: any,
}
/**
* Basic card content container.
* Good for small descriptions or other supplementary text.
*/
export class CardText extends React.Component<CardTextProps, {}> {
render(): React.DOMElement<any>;
}
export interface CardActionsProps extends Props {
/**
* Children to pass through the component.
*/
children?: any,
}
/**
* This component is used as a container for supplemental card actions.
* Supplemental actions within the card are explicitly called out using icons, text, and UI controls, typically placed at the bottom of the card.
*/
export class CardActions extends React.Component<CardActionsProps, {}> {
render(): React.DOMElement<any>;
}
export interface CheckboxProps extends Props, Changeable<boolean>, Conditional {
/**
* Value for the checkbox, can be true or false.
* @default false
*/
checked: boolean,
/**
* Text label to attach next to the checkbox element.
*/
label?: string,
/**
* The name of the field to set in the input checkbox.
*/
name?: string,
/**
* Callback called when the checkbox is blurred.
*/
onBlur?: Function,
/**
* Callback called when the checkbox is focused
*/
onFocus?: Function,
}
export class Checkbox extends React.Component<CheckboxProps, {}> {
render(): React.DOMElement<any>;
}
export interface DatePickerProps extends Props, Changeable<Date> {
/**
* Date object with the maximum selectable date.
*/
maxDate?: Date,
/**
* Date object with the minimum selectable date.
*/
minDate?: Date,
/**
* The text string to use like a input placeholder.
*/
placeholder?: string,
/**
* Date object with the currently selected date.
*/
value?: Date,
}
export class DatePicker extends React.Component<DatePickerProps, {}> {
render(): React.DOMElement<any>;
}
export interface DialogProps extends Props, Modal {
/**
* An array of objects representing the buttons for the dialog navigation area. The properties will be transferred to the buttons.
* @default []
*/
actions?: Array<ButtonProps>,
/**
* The text string to use as standar title of the dialog.
*/
title?: string | boolean,
/**
* Used to determine the size of the dialog. It can be small, normal or large.
* @default normal
*/
type?: string,
}
export class Dialog extends React.Component<DialogProps, {}> {
render(): React.DOMElement<any>;
}
export interface DrawerProps extends Props, Modal {
/**
* Type of drawer. It can be 'left' or 'right' to display the drawer on the left or right side of the screen.
* @default left
*/
type?: string
}
export class Drawer extends React.Component<DrawerProps, {}> {
render(): React.DOMElement<any>;
}
export interface DropdownProps extends Props, Changeable<any>, Conditional {
/**
* If true, the dropdown will open up or down depending on the position in the screen.
*/
auto?: boolean,
/**
* The text string to use for the floating label element.
*/
label?: string,
/**
* Array of data objects with the data to represent in the dropdown.
*/
source: Array<Option<any>>,
/**
* Callback function that returns a JSX template to represent the element.
*/
template?: Function,
/**
* Default value using JSON data.
*/
value: string,
}
class Dropdown extends React.Component<DropdownProps, {}> {
render(): React.DOMElement<any>;
}
interface FontIconProps extends Props {
value: string
}
class FontIcon extends React.Component<FontIconProps, {}> {
render(): React.DOMElement<any>;
}
interface InputProps extends Props, Conditional, Changeable<string>, Iconic {
/**
* Give an error string to display under the field.
*/
error?: string,
/**
* Indicates if the label is floating in the input field or not.
* @default true
*/
floating?: boolean,
/**
* The text string to use for the floating label element.
*/
label?: string,
/**
* Specifies the maximum number of characters allowed in the component.
*/
maxLength?: number,
/**
* If true, a textarea element will be rendered. The textarea also grows and shrinks according to the number of lines.
* @default false
*/
multiline?: boolean,
/**
* Callback function that is fired when components is blurred.
*/
onBlur?: Function,
/**
* Callback function that is fired when components is focused.
*/
onFocus?: Function,
/**
* Callback function that is fired when a key is pressed down.
*/
onKeyDown?: Function,
/**
* Callback function that is fired when a key is pressed.
*/
onKeyPress?: Function,
/**
* Callback function that is fired when a key is released.
*/
onKeyUp?: Function,
/**
* If true, the html input has a required value.
* @default false
*/
required?: boolean,
/**
* Type of the input element. It can be a valid HTML5 input type
* @default text
*/
type?: string,
/**
* Current value of the input element.
*/
value?: string,
}
class Input extends React.Component<InputProps, {}> {
render(): React.DOMElement<any>;
}
interface LinkProps extends React.Props<Link>, Iconic {
href: string,
/**
* The text string used for the text content of the link.
*/
label: string,
/**
* Sets a count number useful to display in the page how many times was visited for example.
*/
count?: number,
}
class Link extends React.Component<LinkProps, {}> {
render(): React.DOMElement<any>;
}
interface ListProps extends Props {
/**
* If true, each element in the list will have a ripple effect on click
* @default false
*/
ripple?: boolean,
/**
* If true, the elements in the list will display a hover effect and a pointer cursor.
* @default false
*/
selectable?: boolean,
}
class List extends React.Component<ListProps, {}> {
render(): React.DOMElement<any>;
}
interface ListItemProps extends Props, Conditional, Clickable {
/**
* A string URL to specify an avatar in the left side of the item.
*/
avatar?: string,
/**
* Main text of the item. Required.
*/
caption?: string,
/**
* A string key of a font icon to display an icon in the left side of the item.
*/
leftIcon?: string,
/**
* Secondary text to display under the caption.
*/
legend?: string,
/**
* The same as the leftIcon but in this case the icon is displayed in the right side.
*/
rightIcon?: string,
/**
* If true, the item displays a ripple effect on click. By default it's inherited from the parent element.
* @default false
*/
ripple?: boolean,
/**
* If true, the elements in the list will display a hover effect and a pointer cursor. Inherited from the parent
* @default false
*/
selectable?: boolean,
}
class ListItem extends React.Component<ListItemProps, {}> {
render(): React.DOMElement<any>;
}
interface ListCheckboxProps extends Props, Conditional, Changeable<boolean> {
/**
* Main text of the item. Required.
*/
caption?: string,
/**
* If true the checkbox appears checked by default.
* @default false
*/
checked: boolean,
/**
* Secondary text to display under the caption.
*/
legend?: string,
/**
* Name for the checkbox input item.
*/
name?: string,
/**
* Callback called when the input element is blurred.
*/
onBlur?: Function,
/**
* Callback called when the input element is focused.
*/
onFocus?: Function,
}
class ListCheckbox extends React.Component<ListCheckboxProps, {}> {
render(): React.DOMElement<any>;
}
export interface ListSubHeaderProps extends Props {
/**
* List header caption.
*/
caption: string;
}
class ListSubHeader extends React.Component<ListSubHeaderProps, {}> {
render(): React.DOMElement<any>;
}
interface ListDividerProps extends Props {
/**
* Indicates if the divider should be full width or should leave a space on the left side.
*/
inset: boolean;
}
class ListDivider extends React.Component<ListDividerProps, {}> {
render(): React.DOMElement<any>;
}
interface MenuProps extends Props {
/**
* If true, the menu will be displayed as opened by default.
* @default false
*/
active?: boolean,
/**
* Callback that will be called when the menu is being hidden.
*/
onHide?: Function,
/**
* Callback that will be called when the menu is being shown.
*/
onShow?: Function,
/**
* If true the menu wrapper will show an outline with a soft shadow.
* @default true
*/
outline?: boolean,
/**
* Determine the position of the menu.
* With static value the menu will be always shown, auto means that the it will decide the opening direction based on the current position.
* To force a position use top-left, top-right, bottom-left, bottom-right.
* @default static
*/
position?: string,
/**
* If true, the menu items will show a ripple effect on click.
*/
ripple?: boolean,
/**
* If true, the menu will keep a value to highlight the active child item.
*/
selectable?: boolean,
/**
* Used for selectable menus and indicates the initial value so the child item with this value can be highlighted.
*/
value?: boolean,
}
class Menu extends React.Component<MenuProps, {}> {
render(): React.DOMElement<any>;
}
interface IconMenuProps extends Props, Iconic {
/**
* If true, the icon will show a ripple when is clicked.
*/
iconRipple?: boolean,
/**
* Transferred to the Menu component.
* @default true
*/
menuRipple?: boolean,
/**
* Callback that will be called when the icon is clicked.
*/
onClick?: Function,
/**
* Callback that will be called when the menu is being hidden.
*/
onHide?: Function,
/**
* Callback that will be called when the menu is being shown.
*/
onShow?: Function,
/**
* Callback that will be called when a menu item is selected.
*/
onSelect?: Function,
/**
* Determine the position of the menu. This property is transferred to the inner Menu component.
* @default auto
*/
position?: string,
/**
* If true, the menu will keep a value to highlight the active child item. Transferred to the Menu
*/
selectable?: boolean,
}
class IconMenu extends React.Component<IconMenuProps, {}> {
render(): React.DOMElement<any>;
}
interface MenuItemProps extends Props, Conditional, Iconic {
/**
* The text to include in the menu item.
*/
caption?: string,
/**
* If true, the item will show a ripple effect when it's clicked. Inherited from the parent.
*/
ripple?: boolean,
/**
* Transferred from the Menu component for selectable menus. Indicates if it's the current active option.
*/
selected?: boolean,
}
class MenuItem extends React.Component<MenuItemProps, {}> {
render(): React.DOMElement<any>;
}
class MenuDivider extends React.Component<any, {}> {
render(): React.DOMElement<any>;
}
interface NavigationProps extends Props {
/**
* Array of objects that represent buttons so the keys will be transferred as properties to those.
*/
actions?: Array<ButtonProps>,
/**
* Array of objects similar to actions but that will be rendered as <Link/> component definition.
*/
routes?: Array<LinkProps>,
/**
* Type of the navigation, it can be 'vertical' or 'horizontal'.
*/
type?: string,
}
class Navigation extends React.Component<NavigationProps, {}> {
render(): React.DOMElement<any>;
}
interface ProgressBarProps extends Props {
/**
* Value of a secondary progress bar useful for buffering.
*/
buffer?: number,
/**
* Maximum value permitted.
*/
max?: number, //
/**
* minimum value permitted.
*/
min?: number, //
/**
* Mode of the progress bar, it can be determinate or indeterminate.
*/
mode?: string, //
/**
* If true, the circular progress bar will be changing its color.
*/
multicolor?: boolean, //
/**
* Type of the progress bar, it can be circular or linear.
* @default linear
*/
type?: string,
/**
* Value of the current progress.
*/
value?: number,
}
class ProgressBar extends React.Component<ProgressBarProps, {}> {
render(): React.DOMElement<any>;
}
interface RadioGroupProps extends Props, Conditional, Changeable<any> {
/**
* Name for the input element group.
*/
name?: string,
/**
* Default value selected in the radio group.
*/
value?: any,
}
class RadioGroup extends React.Component<RadioGroupProps, {}> {
render(): React.DOMElement<any>;
}
interface RadioButtonProps extends Props, Conditional {
/**
* If true, the input element will be selected by default. Transferred from the parent.
*/
checked: boolean,
/**
* Name for the input element.
*/
name?: string,
/**
* Callback function that will be invoked when the input is blurred.
*/
onBlur?: Function,
/**
* Callback function that will be invoked when the value changes.
*/
onChange?: Function,
/**
* Callback function that will be invoked when the input is focused.
*/
onFocus?: Function,
/**
* Value for the radio button.
*/
value: any,
}
class RadioButton extends React.Component<RadioButtonProps, {}> {
render(): React.DOMElement<any>;
}
interface SliderProps extends Props {
/**
* If true, an input is shown and the user can set the slider from keyboard value.
*/
editable?: boolean,
/**
* Maximum value permitted.
*/
max?: number,
/**
* Minimum value permitted.
*/
min?: number,
/**
* Callback function that will be invoked when the slider value changes.
*/
onChange?: Function,
/**
* If true, a pin with numeric value label is shown when the slider thumb is pressed. Use for settings for which users need to know the exact value of the setting.
*/
pinned?: boolean,
/**
* If true, the slider thumb snaps to tick marks evenly spaced based on the step property value.
*/
snaps?: boolean,
/**
* Amount to vary the value when the knob is moved or increase/decrease is called.
*/
step?: number,
/**
* Current value of the slider.
*/
value: number,
}
class Slider extends React.Component<SliderProps, {}> {
render(): React.DOMElement<any>;
}
interface SnackbarProps extends Props, Modal, Iconic {
/**
* For the action component inside the Snackbar.
*/
action?: string,
/**
* Text to display in the content.
*/
label?: string,
/**
* Callback function that will be called when the button action is clicked.
*/
onClick?: Function,
/**
* Callback function when finish the set timeout.
*/
onTimeout?: Function,
/**
* amount of time after the Snackbar will be automatically hidden.
*/
timeout?: number,
/**
* Indicates the action type. Can be 'accept', 'warning' or 'cancel'
*/
type?: string,
}
class Snackbar extends React.Component<SnackbarProps, {}> {
render(): React.DOMElement<any>;
}
interface SwitchProps extends Props, Conditional {
/**
* If true, the switch will be enabled.
*/
checked: boolean,
/**
* If true, component will be disabled.
*/
disabled: boolean,
/**
* The text string to use for the floating label element.
*/
label?: string,
/**
* The text string used as name of the input.
*/
name?: string,
/**
* Callback function that is fired when when the switch is blurred.
*/
onBlur?: Function,
/**
* Callback function that is fired when the components's value changes.
*/
onChange?: Function,
/**
* Callback function fire when the switch is focused.
*/
onFocus?: Function,
}
class Switch extends React.Component<SwitchProps, {}> {
render(): React.DOMElement<any>;
}
interface TableProps extends Props {
/**
* If true, component will show a heading using model field names.
*/
heading?: boolean,
/**
* Object describing the data model that represents each object in the source.
*/
model?: { [key: string]: string },
/**
* Callback function that is fired when an item in a row changes. If set, rows are editable.
*/
onChange?: Function,
/**
* Callback function invoked when the row selection changes.
*/
onSelect?: Function,
/**
* Array of indexes of the items in the source that should appear as selected.
*/
selected?: Array<number>,
/**
* Array of objects representing each item to show.
*/
source?: Array<{ [key: string]: any }>,
}
class Table extends React.Component<TableProps, {}> {
render(): React.DOMElement<any>;
}
interface TabsProps extends Props, Changeable<number> {
/**
* Current
*/
index: number,
}
class Tabs extends React.Component<TabsProps, {}> {
render(): React.DOMElement<any>;
}
interface TabProps extends Props, Conditional {
/**
* If true, the current component is visible.
* @default false
*/
active?: boolean,
/**
* If true, the current component is not visible.
* @default false
*/
hidden?: boolean,
/**
* Label text for navigation header
*/
label?: string,
/**
* Callback function that is fired when the tab is activated.