@cloudflare/component-button 2.12.15 → 2.13.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/CHANGELOG.md CHANGED
@@ -3,6 +3,37 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.13.0](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.17...@cloudflare/component-button@2.13.0) (2022-03-11)
7
+
8
+
9
+ ### Features
10
+
11
+ * **component-button:** UI-5128 add noWrapText prop to set white-space: ([0398540](http://stash.cfops.it:7999/fe/stratus/commits/0398540))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.12.17](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.16...@cloudflare/component-button@2.12.17) (2022-03-09)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **component-button:** BILL-14354 button word-wrap style should be set t ([0a60d78](http://stash.cfops.it:7999/fe/stratus/commits/0a60d78))
23
+ * **component-button:** BILL-14426 explicitly set white-space to normal ([bbd2b63](http://stash.cfops.it:7999/fe/stratus/commits/bbd2b63))
24
+
25
+
26
+
27
+
28
+
29
+ ## [2.12.16](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.15...@cloudflare/component-button@2.12.16) (2022-03-09)
30
+
31
+ **Note:** Version bump only for package @cloudflare/component-button
32
+
33
+
34
+
35
+
36
+
6
37
  ## [2.12.15](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.14...@cloudflare/component-button@2.12.15) (2022-03-08)
7
38
 
8
39
  **Note:** Version bump only for package @cloudflare/component-button
package/dist/Button.d.ts CHANGED
@@ -90,7 +90,7 @@ export declare const buttonStyles: (props: PropsWithTheme) => {
90
90
  readonly userSelect: "none";
91
91
  readonly maxWidth: "initial";
92
92
  readonly float: "none";
93
- readonly whiteSpace: "nowrap";
93
+ readonly whiteSpace: "normal" | "nowrap";
94
94
  readonly width: "auto" | "100%";
95
95
  };
96
96
  declare type Props = {
@@ -108,6 +108,7 @@ declare type Props = {
108
108
  iconSize?: number;
109
109
  ariaLabel?: string;
110
110
  stretch?: boolean;
111
+ noWrapText?: boolean;
111
112
  } & Pick<JSX.IntrinsicElements['button'], 'onClick' | 'disabled' | 'form' | 'tabIndex' | 'className'>;
112
113
  declare type PropsWithTheme = Props & ThemeProp;
113
114
  declare const _default: React.ComponentType<{
@@ -131,6 +132,7 @@ declare const _default: React.ComponentType<{
131
132
  iconLabel?: string | undefined;
132
133
  iconSize?: number | undefined;
133
134
  ariaLabel?: string | undefined;
135
+ noWrapText?: boolean | undefined;
134
136
  p?: import("csstype").PaddingProperty<string | number> | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | undefined;
135
137
  color?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
136
138
  height?: import("csstype").HeightProperty<string | number> | [import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined] | [import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined] | undefined;
package/es/Button.js CHANGED
@@ -153,7 +153,8 @@ export const buttonStyles = props => {
153
153
  space = _props$space === void 0 ? 2 : _props$space,
154
154
  _props$type = props.type,
155
155
  type = _props$type === void 0 ? 'default' : _props$type,
156
- stretch = props.stretch;
156
+ stretch = props.stretch,
157
+ noWrapText = props.noWrapText;
157
158
  const normalStyles = buttonColors(theme).normal;
158
159
  const hoverStyles = interactionStyleAccessor('hover', props);
159
160
  const activeStyles = interactionStyleAccessor('active', props);
@@ -232,7 +233,7 @@ export const buttonStyles = props => {
232
233
  userSelect: 'none',
233
234
  maxWidth: 'initial',
234
235
  float: 'none',
235
- whiteSpace: 'nowrap',
236
+ whiteSpace: noWrapText ? 'nowrap' : 'normal',
236
237
  width: direction === 'column' ? '100%' : 'auto'
237
238
  };
238
239
  };
@@ -290,7 +291,8 @@ Button.propTypes = {
290
291
  form: PropTypes.string,
291
292
  tabIndex: PropTypes.number,
292
293
  ariaLabel: PropTypes.string,
293
- stretch: PropTypes.bool
294
+ stretch: PropTypes.bool,
295
+ noWrapText: PropTypes.bool
294
296
  };
295
297
  Button.displayName = 'Button';
296
298
  export default createStyledComponent(buttonStyles, Button);
package/lib/Button.js CHANGED
@@ -169,7 +169,8 @@ var buttonStyles = function buttonStyles(props) {
169
169
  space = _props$space === void 0 ? 2 : _props$space,
170
170
  _props$type = props.type,
171
171
  type = _props$type === void 0 ? 'default' : _props$type,
172
- stretch = props.stretch;
172
+ stretch = props.stretch,
173
+ noWrapText = props.noWrapText;
173
174
  var normalStyles = buttonColors(theme).normal;
174
175
  var hoverStyles = interactionStyleAccessor('hover', props);
175
176
  var activeStyles = interactionStyleAccessor('active', props);
@@ -248,7 +249,7 @@ var buttonStyles = function buttonStyles(props) {
248
249
  userSelect: 'none',
249
250
  maxWidth: 'initial',
250
251
  float: 'none',
251
- whiteSpace: 'nowrap',
252
+ whiteSpace: noWrapText ? 'nowrap' : 'normal',
252
253
  width: direction === 'column' ? '100%' : 'auto'
253
254
  };
254
255
  };
@@ -312,7 +313,8 @@ Button.propTypes = {
312
313
  form: _propTypes.default.string,
313
314
  tabIndex: _propTypes.default.number,
314
315
  ariaLabel: _propTypes.default.string,
315
- stretch: _propTypes.default.bool
316
+ stretch: _propTypes.default.bool,
317
+ noWrapText: _propTypes.default.bool
316
318
  };
317
319
  Button.displayName = 'Button';
318
320
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudflare/component-button",
3
3
  "description": "Cloudflare Button Component",
4
- "version": "2.12.15",
4
+ "version": "2.13.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
7
7
  "author": "James Kyle <jkyle@cloudflare.com>",
@@ -12,9 +12,9 @@
12
12
  "access": "public"
13
13
  },
14
14
  "dependencies": {
15
- "@cloudflare/component-icon": "^6.6.23",
16
- "@cloudflare/style-const": "^5.2.10",
17
- "@cloudflare/style-container": "^7.7.1",
15
+ "@cloudflare/component-icon": "^6.6.25",
16
+ "@cloudflare/style-const": "^5.2.12",
17
+ "@cloudflare/style-container": "^7.7.3",
18
18
  "polished": "^4.1.4",
19
19
  "prop-types": "^15.6.0"
20
20
  },
@@ -32,5 +32,5 @@
32
32
  "test-coverage": "stratus test --coverage",
33
33
  "test-watch": "stratus test --watch"
34
34
  },
35
- "gitHead": "5ba383d6a266b5f7f108c44d542704d98ff165eb"
35
+ "gitHead": "47e7f66ce88de7857a3565c6a7cbeba09e5ef6d3"
36
36
  }