@cloudflare/component-button 2.12.0 → 2.12.4

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,38 @@
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.12.4](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.3...@cloudflare/component-button@2.12.4) (2022-02-08)
7
+
8
+ **Note:** Version bump only for package @cloudflare/component-button
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.12.3](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.2...@cloudflare/component-button@2.12.3) (2022-02-04)
15
+
16
+ **Note:** Version bump only for package @cloudflare/component-button
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.12.2](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.1...@cloudflare/component-button@2.12.2) (2022-02-01)
23
+
24
+ **Note:** Version bump only for package @cloudflare/component-button
25
+
26
+
27
+
28
+
29
+
30
+ ## [2.12.1](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.0...@cloudflare/component-button@2.12.1) (2022-01-19)
31
+
32
+ **Note:** Version bump only for package @cloudflare/component-button
33
+
34
+
35
+
36
+
37
+
6
38
  # [2.12.0](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.11.27...@cloudflare/component-button@2.12.0) (2022-01-07)
7
39
 
8
40
 
package/es/Button.js CHANGED
@@ -7,7 +7,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7
7
  import React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { isDarkMode } from '@cloudflare/style-const';
10
- import { createStyledComponent } from '@cloudflare/style-container';
10
+ import { ariaAttributes, createStyledComponent } from '@cloudflare/style-container';
11
11
  import { Icon } from '@cloudflare/component-icon';
12
12
 
13
13
  const standardColors = theme => {
@@ -253,10 +253,10 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
253
253
  form = props.form,
254
254
  tabIndex = props.tabIndex,
255
255
  ariaLabel = props.ariaLabel;
256
- const dataAttributes = Object.keys(props).filter(propName => propName.startsWith('data-')).reduce((memo, dataPropName) => _objectSpread({}, memo, {
257
- [dataPropName]: props[dataPropName]
256
+ const ariaAndDataProps = Object.keys(props).filter(propName => propName.startsWith('data-') || ariaAttributes.includes(propName)).reduce((memo, propName) => _objectSpread({}, memo, {
257
+ [propName]: props[propName]
258
258
  }), {});
259
- return /*#__PURE__*/React.createElement("button", _extends({}, dataAttributes, {
259
+ return /*#__PURE__*/React.createElement("button", _extends({}, ariaAndDataProps, {
260
260
  type: submit ? 'submit' : 'button',
261
261
  "data-testid": testId,
262
262
  disabled: disabled || loading,
package/lib/Button.js CHANGED
@@ -269,12 +269,12 @@ var Button = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
269
269
  form = props.form,
270
270
  tabIndex = props.tabIndex,
271
271
  ariaLabel = props.ariaLabel;
272
- var dataAttributes = Object.keys(props).filter(function (propName) {
273
- return propName.startsWith('data-');
274
- }).reduce(function (memo, dataPropName) {
275
- return _objectSpread({}, memo, _defineProperty({}, dataPropName, props[dataPropName]));
272
+ var ariaAndDataProps = Object.keys(props).filter(function (propName) {
273
+ return propName.startsWith('data-') || _styleContainer.ariaAttributes.includes(propName);
274
+ }).reduce(function (memo, propName) {
275
+ return _objectSpread({}, memo, _defineProperty({}, propName, props[propName]));
276
276
  }, {});
277
- return /*#__PURE__*/_react.default.createElement("button", _extends({}, dataAttributes, {
277
+ return /*#__PURE__*/_react.default.createElement("button", _extends({}, ariaAndDataProps, {
278
278
  type: submit ? 'submit' : 'button',
279
279
  "data-testid": testId,
280
280
  disabled: disabled || loading,
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.0",
4
+ "version": "2.12.4",
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.9",
16
- "@cloudflare/style-const": "^5.2.0",
17
- "@cloudflare/style-container": "^7.6.0",
15
+ "@cloudflare/component-icon": "^6.6.13",
16
+ "@cloudflare/style-const": "^5.2.3",
17
+ "@cloudflare/style-container": "^7.6.4",
18
18
  "polished": "^1.9.3",
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": "b7c207b9d1a4a78c3412f7ad4185e92ec36c4f5e"
35
+ "gitHead": "994e89f08c4e6809252f6f49ea25de5af4dc2888"
36
36
  }