@dhis2-ui/button 8.16.0-alpha.1 → 9.0.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -183,8 +183,10 @@ DropdownButton.propTypes = {
183
183
  component: _propTypes2.default.element,
184
184
  dataTest: _propTypes2.default.string,
185
185
 
186
- /** Button variant. Mutually exclusive with `primary` and `secondary` props */
187
- destructive: _uiConstants.sharedPropTypes.buttonVariantPropType,
186
+ /**
187
+ * Applies 'destructive' button appearance, implying a dangerous action.
188
+ */
189
+ destructive: _propTypes2.default.bool,
188
190
 
189
191
  /** Make the button non-interactive */
190
192
  disabled: _propTypes2.default.bool,
@@ -200,11 +202,15 @@ DropdownButton.propTypes = {
200
202
  /** Controls popper visibility. When implementing this prop the component becomes a controlled component */
201
203
  open: _propTypes2.default.bool,
202
204
 
203
- /** Button variant. Mutually exclusive with `destructive` and `secondary` props */
204
- primary: _uiConstants.sharedPropTypes.buttonVariantPropType,
205
+ /**
206
+ * Applies 'primary' button appearance, implying the most important action.
207
+ */
208
+ primary: _propTypes2.default.bool,
205
209
 
206
- /** Button variant. Mutually exclusive with `primary` and `destructive` props */
207
- secondary: _uiConstants.sharedPropTypes.buttonVariantPropType,
210
+ /**
211
+ * Applies 'secondary' button appearance.
212
+ */
213
+ secondary: _propTypes2.default.bool,
208
214
 
209
215
  /** Button size. Mutually exclusive with `large` prop */
210
216
  small: _uiConstants.sharedPropTypes.sizePropType,
@@ -146,8 +146,10 @@ SplitButton.propTypes = {
146
146
  component: _propTypes.default.element,
147
147
  dataTest: _propTypes.default.string,
148
148
 
149
- /** Applies 'destructive' appearance to indicate purpose. Mutually exclusive with `primary` and `secondary` props */
150
- destructive: _uiConstants.sharedPropTypes.buttonVariantPropType,
149
+ /**
150
+ * Applies 'destructive' button appearance, implying a dangerous action.
151
+ */
152
+ destructive: _propTypes.default.bool,
151
153
 
152
154
  /** Disables the button and makes it uninteractive */
153
155
  disabled: _propTypes.default.bool,
@@ -162,11 +164,15 @@ SplitButton.propTypes = {
162
164
  large: _uiConstants.sharedPropTypes.sizePropType,
163
165
  name: _propTypes.default.string,
164
166
 
165
- /** Applies 'primary' appearance to indicate purpose. Mutually exclusive with `destructive` and `secondary` props */
166
- primary: _uiConstants.sharedPropTypes.buttonVariantPropType,
167
+ /**
168
+ * Applies 'primary' button appearance, implying the most important action.
169
+ */
170
+ primary: _propTypes.default.bool,
167
171
 
168
- /** Applies 'secondary' appearance to indicate purpose. Mutually exclusive with `primary` and `destructive` props */
169
- secondary: _uiConstants.sharedPropTypes.buttonVariantPropType,
172
+ /**
173
+ * Applies 'secondary' button appearance.
174
+ */
175
+ secondary: _propTypes.default.bool,
170
176
 
171
177
  /** Changes button size. Mutually exclusive with `large` prop */
172
178
  small: _uiConstants.sharedPropTypes.sizePropType,
@@ -163,8 +163,10 @@ DropdownButton.propTypes = {
163
163
  component: PropTypes.element,
164
164
  dataTest: PropTypes.string,
165
165
 
166
- /** Button variant. Mutually exclusive with `primary` and `secondary` props */
167
- destructive: sharedPropTypes.buttonVariantPropType,
166
+ /**
167
+ * Applies 'destructive' button appearance, implying a dangerous action.
168
+ */
169
+ destructive: PropTypes.bool,
168
170
 
169
171
  /** Make the button non-interactive */
170
172
  disabled: PropTypes.bool,
@@ -180,11 +182,15 @@ DropdownButton.propTypes = {
180
182
  /** Controls popper visibility. When implementing this prop the component becomes a controlled component */
181
183
  open: PropTypes.bool,
182
184
 
183
- /** Button variant. Mutually exclusive with `destructive` and `secondary` props */
184
- primary: sharedPropTypes.buttonVariantPropType,
185
+ /**
186
+ * Applies 'primary' button appearance, implying the most important action.
187
+ */
188
+ primary: PropTypes.bool,
185
189
 
186
- /** Button variant. Mutually exclusive with `primary` and `destructive` props */
187
- secondary: sharedPropTypes.buttonVariantPropType,
190
+ /**
191
+ * Applies 'secondary' button appearance.
192
+ */
193
+ secondary: PropTypes.bool,
188
194
 
189
195
  /** Button size. Mutually exclusive with `large` prop */
190
196
  small: sharedPropTypes.sizePropType,
@@ -124,8 +124,10 @@ SplitButton.propTypes = {
124
124
  component: PropTypes.element,
125
125
  dataTest: PropTypes.string,
126
126
 
127
- /** Applies 'destructive' appearance to indicate purpose. Mutually exclusive with `primary` and `secondary` props */
128
- destructive: sharedPropTypes.buttonVariantPropType,
127
+ /**
128
+ * Applies 'destructive' button appearance, implying a dangerous action.
129
+ */
130
+ destructive: PropTypes.bool,
129
131
 
130
132
  /** Disables the button and makes it uninteractive */
131
133
  disabled: PropTypes.bool,
@@ -140,11 +142,15 @@ SplitButton.propTypes = {
140
142
  large: sharedPropTypes.sizePropType,
141
143
  name: PropTypes.string,
142
144
 
143
- /** Applies 'primary' appearance to indicate purpose. Mutually exclusive with `destructive` and `secondary` props */
144
- primary: sharedPropTypes.buttonVariantPropType,
145
+ /**
146
+ * Applies 'primary' button appearance, implying the most important action.
147
+ */
148
+ primary: PropTypes.bool,
145
149
 
146
- /** Applies 'secondary' appearance to indicate purpose. Mutually exclusive with `primary` and `destructive` props */
147
- secondary: sharedPropTypes.buttonVariantPropType,
150
+ /**
151
+ * Applies 'secondary' button appearance.
152
+ */
153
+ secondary: PropTypes.bool,
148
154
 
149
155
  /** Changes button size. Mutually exclusive with `large` prop */
150
156
  small: sharedPropTypes.sizePropType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/button",
3
- "version": "8.16.0-alpha.1",
3
+ "version": "9.0.0-alpha.1",
4
4
  "description": "UI Button",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,11 +33,11 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@dhis2/prop-types": "^3.1.2",
36
- "@dhis2-ui/layer": "8.16.0-alpha.1",
37
- "@dhis2-ui/loader": "8.16.0-alpha.1",
38
- "@dhis2-ui/popper": "8.16.0-alpha.1",
39
- "@dhis2/ui-constants": "8.16.0-alpha.1",
40
- "@dhis2/ui-icons": "8.16.0-alpha.1",
36
+ "@dhis2-ui/layer": "9.0.0-alpha.1",
37
+ "@dhis2-ui/loader": "9.0.0-alpha.1",
38
+ "@dhis2-ui/popper": "9.0.0-alpha.1",
39
+ "@dhis2/ui-constants": "9.0.0-alpha.1",
40
+ "@dhis2/ui-icons": "9.0.0-alpha.1",
41
41
  "classnames": "^2.3.1",
42
42
  "prop-types": "^15.7.2"
43
43
  },
package/types/index.d.ts CHANGED
@@ -30,11 +30,7 @@ export interface ButtonProps {
30
30
  * for identification during testing
31
31
  */
32
32
  dataTest?: string
33
- /**
34
- * Indicates that the button makes potentially dangerous
35
- * deletions or data changes.
36
- * Mutually exclusive with `primary` and `secondary` props
37
- */
33
+ /** Applies 'destructive' button appearance, implying a dangerous action */
38
34
  destructive?: boolean
39
35
  /**
40
36
  * Applies a greyed-out appearance and makes the button non-interactive
@@ -61,15 +57,9 @@ export interface ButtonProps {
61
57
  * Gets passed as part of the first argument to callbacks (see `onClick`).
62
58
  */
63
59
  name?: string
64
- /**
65
- * Applies 'primary' button appearance.
66
- * Mutually exclusive with `destructive` and `secondary` props
67
- */
60
+ /** Applies 'primary' button appearance, implying the most important action */
68
61
  primary?: boolean
69
- /**
70
- * Applies 'secondary' button appearance.
71
- * Mutually exclusive with `primary` and `destructive` props
72
- */
62
+ /** Applies 'secondary' button appearance */
73
63
  secondary?: boolean
74
64
  /**
75
65
  * Makes the button small. Mutually exclusive with `large` prop
@@ -143,9 +133,7 @@ export interface DropdownButtonProps {
143
133
  */
144
134
  component?: React.ReactElement<any>
145
135
  dataTest?: string
146
- /**
147
- * Button variant. Mutually exclusive with `primary` and `secondary` props
148
- */
136
+ /** Applies 'destructive' button appearance, implying a dangerous action. */
149
137
  destructive?: boolean
150
138
  /**
151
139
  * Make the button non-interactive
@@ -165,16 +153,12 @@ export interface DropdownButtonProps {
165
153
  * Controls popper visibility. When implementing this prop the component becomes a controlled component
166
154
  */
167
155
  open?: boolean
168
- /**
169
- * Button variant. Mutually exclusive with `destructive` and `secondary` props
170
- */
156
+ /** Applies 'primary' button appearance, implying the most important action */
171
157
  primary?: boolean
172
- /**
173
- * Button variant. Mutually exclusive with `primary` and `destructive` props
174
- */
158
+ /** Applies 'secondary' button appearance */
175
159
  secondary?: boolean
176
160
  /**
177
- * Button size. Mutually exclusive with `large` prop
161
+ * Changes button size. Mutually exclusive with `large` prop
178
162
  */
179
163
  small?: boolean
180
164
  tabIndex?: string
@@ -206,9 +190,7 @@ export interface SplitButtonProps {
206
190
  */
207
191
  component?: React.ReactElement<any>
208
192
  dataTest?: string
209
- /**
210
- * Applies 'destructive' appearance to indicate purpose. Mutually exclusive with `primary` and `secondary` props
211
- */
193
+ /** Applies 'destructive' button appearance, implying a dangerous action. */
212
194
  destructive?: boolean
213
195
  /**
214
196
  * Disables the button and makes it uninteractive
@@ -227,13 +209,9 @@ export interface SplitButtonProps {
227
209
  */
228
210
  large?: boolean
229
211
  name?: string
230
- /**
231
- * Applies 'primary' appearance to indicate purpose. Mutually exclusive with `destructive` and `secondary` props
232
- */
212
+ /** Applies 'primary' button appearance, implying the most important action */
233
213
  primary?: boolean
234
- /**
235
- * Applies 'secondary' appearance to indicate purpose. Mutually exclusive with `primary` and `destructive` props
236
- */
214
+ /** Applies 'secondary' button appearance */
237
215
  secondary?: boolean
238
216
  /**
239
217
  * Changes button size. Mutually exclusive with `large` prop