@cloudflare/component-card 4.0.16 → 4.0.20

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,44 @@
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
+ ## [4.0.20](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-card@4.0.19...@cloudflare/component-card@4.0.20) (2021-12-03)
7
+
8
+ **Note:** Version bump only for package @cloudflare/component-card
9
+
10
+
11
+
12
+
13
+
14
+ ## [4.0.19](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-card@4.0.18...@cloudflare/component-card@4.0.19) (2021-11-25)
15
+
16
+ **Note:** Version bump only for package @cloudflare/component-card
17
+
18
+
19
+
20
+
21
+
22
+ ## [4.0.18](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-card@4.0.17...@cloudflare/component-card@4.0.18) (2021-11-25)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **component-card:** A11Y-86 Fix missing package ([548b6d4](http://stash.cfops.it:7999/fe/stratus/commits/548b6d4))
28
+ * **component-card:** A11Y-86 Replace H3 tag with Heading ([b3c2372](http://stash.cfops.it:7999/fe/stratus/commits/b3c2372))
29
+ * **component-card:** A11Y-90 Fix package version ([b0dfc79](http://stash.cfops.it:7999/fe/stratus/commits/b0dfc79))
30
+ * **component-page:** A11Y-86 Bug fix ([9ab1079](http://stash.cfops.it:7999/fe/stratus/commits/9ab1079))
31
+
32
+
33
+
34
+
35
+
36
+ ## [4.0.17](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-card@4.0.16...@cloudflare/component-card@4.0.17) (2021-11-23)
37
+
38
+ **Note:** Version bump only for package @cloudflare/component-card
39
+
40
+
41
+
42
+
43
+
6
44
  ## [4.0.16](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-card@4.0.15...@cloudflare/component-card@4.0.16) (2021-11-23)
7
45
 
8
46
  **Note:** Version bump only for package @cloudflare/component-card
package/es/CardDrawers.js CHANGED
@@ -62,7 +62,8 @@ class CardDrawers extends React.Component {
62
62
  drawerComponent = _ref.drawerComponent,
63
63
  onClick = _ref.onClick,
64
64
  href = _ref.href,
65
- rest = _objectWithoutProperties(_ref, ["id", "name", "content", "drawerComponent", "onClick", "href"]);
65
+ ariaLabel = _ref.ariaLabel,
66
+ rest = _objectWithoutProperties(_ref, ["id", "name", "content", "drawerComponent", "onClick", "href", "ariaLabel"]);
66
67
 
67
68
  // The component used for the drawer can be overridden
68
69
  const Drawer = drawerComponent || CardDrawer;
@@ -82,7 +83,8 @@ class CardDrawers extends React.Component {
82
83
  isActive: isActive,
83
84
  onClick: () => this.handleLinkClick(drawerId),
84
85
  ariaControls: drawerId,
85
- ariaExpanded: isActive
86
+ ariaExpanded: isActive,
87
+ ariaLabel: ariaLabel
86
88
  }, name) : /*#__PURE__*/React.createElement(CardToolbarLink, {
87
89
  id: triggerId,
88
90
  href: href
package/es/CardTitle.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { createStyledComponent } from '@cloudflare/style-container';
2
+ import { Heading } from '@cloudflare/component-page';
2
3
  export default createStyledComponent(() => ({
3
4
  fontWeight: 600,
4
5
  mb: 2
5
- }), 'h3');
6
+ }), Heading);
@@ -20,7 +20,8 @@ class CardToolbarDrawerTrigger extends React.Component {
20
20
  children = _this$props.children,
21
21
  isActive = _this$props.isActive,
22
22
  ariaControls = _this$props.ariaControls,
23
- ariaExpanded = _this$props.ariaExpanded;
23
+ ariaExpanded = _this$props.ariaExpanded,
24
+ ariaLabel = _this$props.ariaLabel;
24
25
  return /*#__PURE__*/React.createElement(TextButton, {
25
26
  id: id,
26
27
  onClick: this.handleClick,
@@ -29,7 +30,8 @@ class CardToolbarDrawerTrigger extends React.Component {
29
30
  py: 2,
30
31
  fontSize: 3,
31
32
  "aria-controls": ariaControls,
32
- "aria-expanded": ariaExpanded
33
+ "aria-expanded": ariaExpanded,
34
+ "aria-label": ariaLabel
33
35
  }, children, /*#__PURE__*/React.createElement(ArrowSwivel, {
34
36
  isActive: isActive,
35
37
  duration: 50
@@ -44,7 +46,8 @@ CardToolbarDrawerTrigger.propTypes = {
44
46
  id: PropTypes.string.isRequired,
45
47
  children: PropTypes.node,
46
48
  ariaControls: PropTypes.string.isRequired,
47
- ariaExpanded: PropTypes.bool.isRequired
49
+ ariaExpanded: PropTypes.bool.isRequired,
50
+ ariaLabel: PropTypes.string
48
51
  };
49
52
  CardToolbarDrawerTrigger.defaultProps = {
50
53
  isActive: false
@@ -118,7 +118,8 @@ var CardDrawers = /*#__PURE__*/function (_React$Component) {
118
118
  drawerComponent = _ref2.drawerComponent,
119
119
  onClick = _ref2.onClick,
120
120
  href = _ref2.href,
121
- rest = _objectWithoutProperties(_ref2, ["id", "name", "content", "drawerComponent", "onClick", "href"]);
121
+ ariaLabel = _ref2.ariaLabel,
122
+ rest = _objectWithoutProperties(_ref2, ["id", "name", "content", "drawerComponent", "onClick", "href", "ariaLabel"]);
122
123
 
123
124
  // The component used for the drawer can be overridden
124
125
  var Drawer = drawerComponent || _CardDrawer.default;
@@ -140,7 +141,8 @@ var CardDrawers = /*#__PURE__*/function (_React$Component) {
140
141
  return _this3.handleLinkClick(drawerId);
141
142
  },
142
143
  ariaControls: drawerId,
143
- ariaExpanded: isActive
144
+ ariaExpanded: isActive,
145
+ ariaLabel: ariaLabel
144
146
  }, name) : /*#__PURE__*/_react.default.createElement(_CardToolbarLink.default, {
145
147
  id: triggerId,
146
148
  href: href
package/lib/CardTitle.js CHANGED
@@ -7,11 +7,13 @@ exports.default = void 0;
7
7
 
8
8
  var _styleContainer = require("@cloudflare/style-container");
9
9
 
10
+ var _componentPage = require("@cloudflare/component-page");
11
+
10
12
  var _default = (0, _styleContainer.createStyledComponent)(function () {
11
13
  return {
12
14
  fontWeight: 600,
13
15
  mb: 2
14
16
  };
15
- }, 'h3');
17
+ }, _componentPage.Heading);
16
18
 
17
19
  exports.default = _default;
@@ -60,7 +60,8 @@ var CardToolbarDrawerTrigger = /*#__PURE__*/function (_React$Component) {
60
60
  children = _this$props.children,
61
61
  isActive = _this$props.isActive,
62
62
  ariaControls = _this$props.ariaControls,
63
- ariaExpanded = _this$props.ariaExpanded;
63
+ ariaExpanded = _this$props.ariaExpanded,
64
+ ariaLabel = _this$props.ariaLabel;
64
65
  return /*#__PURE__*/_react.default.createElement(_componentButton.TextButton, {
65
66
  id: id,
66
67
  onClick: this.handleClick,
@@ -69,7 +70,8 @@ var CardToolbarDrawerTrigger = /*#__PURE__*/function (_React$Component) {
69
70
  py: 2,
70
71
  fontSize: 3,
71
72
  "aria-controls": ariaControls,
72
- "aria-expanded": ariaExpanded
73
+ "aria-expanded": ariaExpanded,
74
+ "aria-label": ariaLabel
73
75
  }, children, /*#__PURE__*/_react.default.createElement(_componentArrowSwivel.ArrowSwivel, {
74
76
  isActive: isActive,
75
77
  duration: 50
@@ -86,7 +88,8 @@ CardToolbarDrawerTrigger.propTypes = {
86
88
  id: _propTypes.default.string.isRequired,
87
89
  children: _propTypes.default.node,
88
90
  ariaControls: _propTypes.default.string.isRequired,
89
- ariaExpanded: _propTypes.default.bool.isRequired
91
+ ariaExpanded: _propTypes.default.bool.isRequired,
92
+ ariaLabel: _propTypes.default.string
90
93
  };
91
94
  CardToolbarDrawerTrigger.defaultProps = {
92
95
  isActive: false
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudflare/component-card",
3
3
  "description": "Cloudflare Card Component",
4
- "version": "4.0.16",
4
+ "version": "4.0.20",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
7
7
  "author": "James Kyle <jkyle@cloudflare.com>",
@@ -11,10 +11,11 @@
11
11
  "access": "public"
12
12
  },
13
13
  "dependencies": {
14
- "@cloudflare/component-arrow-swivel": "^2.4.93",
15
- "@cloudflare/component-button": "^2.11.14",
16
- "@cloudflare/component-link": "^4.0.15",
17
- "@cloudflare/style-container": "^7.5.20",
14
+ "@cloudflare/component-arrow-swivel": "^2.4.94",
15
+ "@cloudflare/component-button": "^2.11.15",
16
+ "@cloudflare/component-link": "^4.0.16",
17
+ "@cloudflare/component-page": "^5.2.1",
18
+ "@cloudflare/style-container": "^7.5.21",
18
19
  "prop-types": "^15.6.0"
19
20
  },
20
21
  "peerDependencies": {
@@ -31,5 +32,5 @@
31
32
  "test-coverage": "stratus test --coverage",
32
33
  "test-watch": "stratus test --watch"
33
34
  },
34
- "gitHead": "33e724b3b47f1a0afbbf27e0e868959b34e04945"
35
+ "gitHead": "ceaeb1a7b750bec5b0dfc6edbba94bf2ddac31bf"
35
36
  }
@@ -66,6 +66,7 @@ class CardDrawers extends React.Component {
66
66
  drawerComponent,
67
67
  onClick,
68
68
  href,
69
+ ariaLabel,
69
70
  ...rest
70
71
  }) => {
71
72
  // The component used for the drawer can be overridden
@@ -93,6 +94,7 @@ class CardDrawers extends React.Component {
93
94
  onClick={() => this.handleLinkClick(drawerId)}
94
95
  ariaControls={drawerId}
95
96
  ariaExpanded={isActive}
97
+ ariaLabel={ariaLabel}
96
98
  >
97
99
  {name}
98
100
  </CardToolbarDrawerTrigger>
package/src/CardTitle.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { createStyledComponent } from '@cloudflare/style-container';
2
+ import { Heading } from '@cloudflare/component-page';
2
3
 
3
4
  export default createStyledComponent(
4
5
  () => ({
5
6
  fontWeight: 600,
6
7
  mb: 2
7
8
  }),
8
- 'h3'
9
+ Heading
9
10
  );
@@ -15,7 +15,14 @@ class CardToolbarDrawerTrigger extends React.Component {
15
15
  }
16
16
 
17
17
  render() {
18
- const { id, children, isActive, ariaControls, ariaExpanded } = this.props;
18
+ const {
19
+ id,
20
+ children,
21
+ isActive,
22
+ ariaControls,
23
+ ariaExpanded,
24
+ ariaLabel
25
+ } = this.props;
19
26
 
20
27
  return (
21
28
  <TextButton
@@ -27,6 +34,7 @@ class CardToolbarDrawerTrigger extends React.Component {
27
34
  fontSize={3}
28
35
  aria-controls={ariaControls}
29
36
  aria-expanded={ariaExpanded}
37
+ aria-label={ariaLabel}
30
38
  >
31
39
  {children}
32
40
  <ArrowSwivel isActive={isActive} duration={50} />
@@ -41,7 +49,8 @@ CardToolbarDrawerTrigger.propTypes = {
41
49
  id: PropTypes.string.isRequired,
42
50
  children: PropTypes.node,
43
51
  ariaControls: PropTypes.string.isRequired,
44
- ariaExpanded: PropTypes.bool.isRequired
52
+ ariaExpanded: PropTypes.bool.isRequired,
53
+ ariaLabel: PropTypes.string
45
54
  };
46
55
 
47
56
  CardToolbarDrawerTrigger.defaultProps = {