@@ -13,7 +13,9 @@ import {
13
13
useValueAndKey ,
14
14
} from '../../lib'
15
15
import { createIcon , createLabel } from '../../factories'
16
+ import ButtonContent from './ButtonContent'
16
17
import ButtonGroup from './ButtonGroup'
18
+ import ButtonOr from './ButtonOr'
17
19
18
20
const debug = makeDebugger ( 'button' )
19
21
@@ -37,7 +39,7 @@ function Button(props) {
37
39
color ,
38
40
size ,
39
41
useKeyOnly ( active , 'active' ) ,
40
- useKeyOnly ( animated , 'animated' ) ,
42
+ useKeyOrValueAndKey ( animated , 'animated' ) ,
41
43
useKeyOrValueAndKey ( attached , 'attached' ) ,
42
44
useKeyOnly ( basic , 'basic' ) ,
43
45
useKeyOnly ( circular , 'circular' ) ,
@@ -110,12 +112,15 @@ function Button(props) {
110
112
)
111
113
}
112
114
115
+ Button . Content = ButtonContent
113
116
Button . Group = ButtonGroup
117
+ Button . Or = ButtonOr
114
118
115
119
Button . _meta = {
116
120
name : 'Button' ,
117
121
type : META . TYPES . ELEMENT ,
118
122
props : {
123
+ animated : [ 'fade' , 'vertical' ] ,
119
124
attached : [ 'left' , 'right' , 'top' , 'bottom' ] ,
120
125
color : [
121
126
...SUI . COLORS ,
@@ -144,7 +149,10 @@ Button.propTypes = {
144
149
active : PropTypes . bool ,
145
150
146
151
/** A button can animate to show hidden content */
147
- animated : PropTypes . bool ,
152
+ animated : PropTypes . oneOfType ( [
153
+ PropTypes . bool ,
154
+ PropTypes . oneOf ( Button . _meta . props . animated ) ,
155
+ ] ) ,
148
156
149
157
/** A button can be attached to the top or bottom of other content */
150
158
attached : PropTypes . oneOf ( Button . _meta . props . attached ) ,
@@ -157,7 +165,13 @@ Button.propTypes = {
157
165
PropTypes . node ,
158
166
customPropTypes . disallow ( [ 'label' ] ) ,
159
167
customPropTypes . givenProps (
160
- { icon : PropTypes . bool . isRequired } ,
168
+ {
169
+ icon : PropTypes . oneOfType ( [
170
+ PropTypes . string . isRequired ,
171
+ PropTypes . object . isRequired ,
172
+ PropTypes . element . isRequired ,
173
+ ] ) ,
174
+ } ,
161
175
customPropTypes . disallow ( [ 'icon' ] ) ,
162
176
) ,
163
177
] ) ,
0 commit comments