@urbanos/react-discovery-ui 2.1.57 → 2.1.59

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.
@@ -39,6 +39,9 @@ var _default = exports.default = /*#__PURE__*/function (_Component) {
39
39
  _this.state = {
40
40
  expanded: isDesktop || props.expanded
41
41
  };
42
+ var title = typeof _this.props.title === 'string' || typeof _this.props.title === 'number' ? String(_this.props.title) : '';
43
+ var normalizedTitle = title.replace(/\s+/g, '-').toLowerCase();
44
+ _this.contentId = "collapsable-box-content-".concat(normalizedTitle || 'content');
42
45
  return _this;
43
46
  }
44
47
  _inherits(_default, _Component);
@@ -58,7 +61,15 @@ var _default = exports.default = /*#__PURE__*/function (_Component) {
58
61
  key: "render",
59
62
  value: function render() {
60
63
  var _this2 = this;
61
- return /*#__PURE__*/React.createElement("collapsable-box", null, /*#__PURE__*/React.createElement("div", {
64
+ var childrenWithContentId = _react.Children.map(this.props.children, function (child) {
65
+ if (! /*#__PURE__*/(0, _react.isValidElement)(child)) return child;
66
+ return /*#__PURE__*/(0, _react.cloneElement)(child, {
67
+ contentId: _this2.contentId
68
+ });
69
+ });
70
+ return /*#__PURE__*/React.createElement("div", {
71
+ className: "collapsable-box ".concat(this.props.className || '')
72
+ }, /*#__PURE__*/React.createElement("div", {
62
73
  "data-testid": this.props.testId,
63
74
  className: "header-container ".concat(this.headerOpenClass()),
64
75
  onClick: function onClick(e) {
@@ -73,7 +84,8 @@ var _default = exports.default = /*#__PURE__*/function (_Component) {
73
84
  role: "button",
74
85
  tabIndex: "0",
75
86
  "aria-label": [this.props.title, extractText(this.props.headerHtml)].filter(Boolean).join(': ') || 'collapsable box',
76
- "aria-pressed": this.state.expanded
87
+ "aria-controls": this.contentId,
88
+ "aria-expanded": this.state.expanded
77
89
  }, /*#__PURE__*/React.createElement("div", {
78
90
  className: "header-text-items"
79
91
  }, /*#__PURE__*/React.createElement("div", {
@@ -82,7 +94,9 @@ var _default = exports.default = /*#__PURE__*/function (_Component) {
82
94
  expanded: this.state.expanded
83
95
  })), /*#__PURE__*/React.createElement(_reactCollapse.Collapse, {
84
96
  isOpened: this.state.expanded
85
- }, this.props.children));
97
+ }, /*#__PURE__*/React.createElement("div", {
98
+ id: this.contentId
99
+ }, childrenWithContentId)));
86
100
  }
87
101
  }]);
88
102
  }(_react.Component);
@@ -1,9 +1,7 @@
1
1
  @import '../../styles/mixins.scss';
2
2
  @import '../../styles/variables.scss';
3
3
 
4
- collapsable-box {
5
- @include custom-element();
6
-
4
+ .collapsable-box {
7
5
  border: 1px solid $light-grey;
8
6
  width: 100%;
9
7
  margin-top: 2.5rem;
@@ -56,6 +56,11 @@ api-example {
56
56
  white-space: nowrap;
57
57
  }
58
58
 
59
+ .example-parameters {
60
+ max-height: 50vh;
61
+ overflow: auto;
62
+ }
63
+
59
64
  .example-table {
60
65
  border-collapse: collapse;
61
66
  width: 100%
@@ -81,4 +86,4 @@ api-example {
81
86
  .required-marker {
82
87
  text-align: center;
83
88
  }
84
- }
89
+ }
@@ -31,6 +31,7 @@ var VisualizationListMenuItem = function VisualizationListMenuItem(_ref) {
31
31
  setUserNeedsLoginInfo(false);
32
32
  };
33
33
  return /*#__PURE__*/React.createElement("visualization-list-menu-item", null, /*#__PURE__*/React.createElement(_tabButton.default, {
34
+ "aria-label": "Saved workspaces",
34
35
  "data-testid": "visualization-list-menu-item",
35
36
  className: "button-".concat(isAuthenticated ? 'enabled' : 'disabled', " ").concat(userNeedsLoginInfo && 'dialog-open'),
36
37
  onClick: showLoginPrompt
@@ -49,6 +49,7 @@ var VisualizationSaveMenuItem = function VisualizationSaveMenuItem(props) {
49
49
  return !isAuthenticated || (0, _lodash.isEmpty)(title) || actionNotAllowed;
50
50
  };
51
51
  return /*#__PURE__*/React.createElement("visualization-save-menu-item", null, /*#__PURE__*/React.createElement(_tabButton.default, {
52
+ "aria-label": "Save workspace",
52
53
  "data-testid": "save-icon",
53
54
  disabled: !isSaveable,
54
55
  className: "header-item save-icon ".concat(isDialogOpen && 'saving'),
@@ -131,7 +131,7 @@ var _default = exports.default = /*#__PURE__*/function (_Component) {
131
131
  }, /*#__PURE__*/_react.default.createElement(_reactTabs.TabList, {
132
132
  className: "header"
133
133
  }, /*#__PURE__*/_react.default.createElement("span", {
134
- className: "tab-area"
134
+ className: "tab-area header-tabs"
135
135
  }, /*#__PURE__*/_react.default.createElement(_reactTabs.Tab, {
136
136
  "data-testid": "dataset-details"
137
137
  }, "Dataset Details"), /*#__PURE__*/_react.default.createElement(_reactTabs.Tab, {
@@ -105,6 +105,10 @@ dataset-view {
105
105
  justify-content: space-between;
106
106
  }
107
107
 
108
+ .header-tabs {
109
+ display: none !important;
110
+ }
111
+
108
112
  .tab-area {
109
113
  font-size: small;
110
114
  }
@@ -127,8 +131,8 @@ dataset-view {
127
131
 
128
132
  .mobile-tab-dropdown {
129
133
  position: absolute;
130
- top: calc(100% + 4px);
131
- left: 0;
134
+ top: calc(100% - 28px);
135
+ left: 34px;
132
136
  z-index: 20;
133
137
  background: white;
134
138
  border: 1px solid $light-grey;
@@ -143,5 +147,10 @@ dataset-view {
143
147
  border: 0;
144
148
  background: white;
145
149
  }
150
+
151
+ .mobile-tab-dropdown button:hover {
152
+ background: $super-light-gray;
153
+ cursor: pointer;
154
+ }
146
155
  }
147
156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urbanos/react-discovery-ui",
3
- "version": "2.1.57",
3
+ "version": "2.1.59",
4
4
  "description": "React component for dataset discovery UI",
5
5
  "main": "./lib/ReactDiscoveryUI.js",
6
6
  "repository": {