@pingux/astro 2.78.0-alpha.3 → 2.78.0-alpha.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/lib/cjs/components/ListView/ListView.stories.js +4 -2
- package/lib/cjs/components/ListViewItem/ListViewItem.stories.js +2 -1
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.js +47 -3
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.stories.js +2 -1
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.test.js +2 -1
- package/lib/components/ListView/ListView.stories.js +4 -2
- package/lib/components/ListViewItem/ListViewItem.stories.js +2 -1
- package/lib/components/ListViewItem/controls/chart/ListViewItemChart.js +49 -3
- package/lib/components/ListViewItem/controls/chart/ListViewItemChart.stories.js +2 -1
- package/lib/components/ListViewItem/controls/chart/ListViewItemChart.test.js +2 -1
- package/package.json +1 -1
@@ -571,7 +571,8 @@ var ExpandableChildren = function ExpandableChildren() {
|
|
571
571
|
my: 'md'
|
572
572
|
}
|
573
573
|
}, (0, _react2.jsx)(_.TextField, {
|
574
|
-
maxWidth: "300px"
|
574
|
+
maxWidth: "300px",
|
575
|
+
"aria-label": "Search Environment"
|
575
576
|
}), (0, _react2.jsx)(_.Box, {
|
576
577
|
sx: {
|
577
578
|
mt: 'md',
|
@@ -896,7 +897,8 @@ var WithCharts = function WithCharts(_ref9) {
|
|
896
897
|
contentCountLabel: "Past 7 days",
|
897
898
|
chartLabel: "12 wk trend",
|
898
899
|
trend: "+115.0%",
|
899
|
-
tooltipText: "See Contributing Data"
|
900
|
+
tooltipText: "See Contributing Data",
|
901
|
+
ariaLabel: item.name
|
900
902
|
}), (0, _react2.jsx)(Controls, null)));
|
901
903
|
});
|
902
904
|
};
|
@@ -179,7 +179,8 @@ var WithCharts = function WithCharts() {
|
|
179
179
|
contentCountLabel: "Past 7 days",
|
180
180
|
chartLabel: "12 wk trend",
|
181
181
|
trend: "+115.0%",
|
182
|
-
tooltipText: "See Contributing Data"
|
182
|
+
tooltipText: "See Contributing Data",
|
183
|
+
ariaLabel: "Kangaroo"
|
183
184
|
}), (0, _react2.jsx)(_.ListViewItemSwitchField, null), (0, _react2.jsx)(_.ListViewItemMenu, null, (0, _react2.jsx)(_reactStately.Item, {
|
184
185
|
key: "enable"
|
185
186
|
}, "Enable user"), (0, _react2.jsx)(_reactStately.Item, {
|
@@ -1,8 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
4
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
5
4
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
5
|
+
var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
|
6
|
+
var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
|
7
|
+
var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
|
8
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
9
|
+
var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
|
10
|
+
var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise");
|
11
|
+
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
12
|
+
var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
13
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
6
14
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
7
15
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
8
16
|
_Object$defineProperty(exports, "__esModule", {
|
@@ -10,6 +18,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
10
18
|
});
|
11
19
|
exports["default"] = void 0;
|
12
20
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
21
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
22
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
13
23
|
var _react = _interopRequireWildcard(require("react"));
|
14
24
|
var _reactAria = require("react-aria");
|
15
25
|
var _recharts = require("recharts");
|
@@ -20,6 +30,7 @@ var _ListViewItemChartAttributes = require("./ListViewItemChartAttributes");
|
|
20
30
|
var _react2 = require("@emotion/react");
|
21
31
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
22
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
33
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context2; _forEachInstanceProperty(_context2 = ["next", "throw", "return"]).call(_context2, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context3; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
23
34
|
var ListViewItemChart = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
24
35
|
var buttonProps = props.buttonProps,
|
25
36
|
chartData = props.chartData,
|
@@ -34,7 +45,8 @@ var ListViewItemChart = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref
|
|
34
45
|
_props$tabletBreakPoi = props.tabletBreakPoint,
|
35
46
|
tabletBreakPoint = _props$tabletBreakPoi === void 0 ? 605 : _props$tabletBreakPoi,
|
36
47
|
_props$mobileBreakPoi = props.mobileBreakPoint,
|
37
|
-
mobileBreakPoint = _props$mobileBreakPoi === void 0 ? 350 : _props$mobileBreakPoi
|
48
|
+
mobileBreakPoint = _props$mobileBreakPoi === void 0 ? 350 : _props$mobileBreakPoi,
|
49
|
+
ariaLabel = props.ariaLabel;
|
38
50
|
var _useResizeObserver = (0, _useResizeObserver2["default"])({
|
39
51
|
ref: containerRef
|
40
52
|
}),
|
@@ -53,6 +65,37 @@ var ListViewItemChart = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref
|
|
53
65
|
var hideIfMobile = (0, _react.useCallback)(function () {
|
54
66
|
return isMobile && visuallyHiddenProps;
|
55
67
|
}, [isMobile, visuallyHiddenProps]);
|
68
|
+
(0, _react.useEffect)(function () {
|
69
|
+
function setAriaLabel() {
|
70
|
+
return _setAriaLabel.apply(this, arguments);
|
71
|
+
}
|
72
|
+
function _setAriaLabel() {
|
73
|
+
_setAriaLabel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
74
|
+
var _yield$containerRef$c, _yield$containerRef$c2, rechartsWrapper;
|
75
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
76
|
+
while (1) switch (_context.prev = _context.next) {
|
77
|
+
case 0:
|
78
|
+
if (!(containerRef && containerRef.current)) {
|
79
|
+
_context.next = 7;
|
80
|
+
break;
|
81
|
+
}
|
82
|
+
_context.next = 3;
|
83
|
+
return containerRef.current.getElementsByClassName('recharts-wrapper');
|
84
|
+
case 3:
|
85
|
+
_yield$containerRef$c = _context.sent;
|
86
|
+
_yield$containerRef$c2 = (0, _slicedToArray2["default"])(_yield$containerRef$c, 1);
|
87
|
+
rechartsWrapper = _yield$containerRef$c2[0];
|
88
|
+
rechartsWrapper.setAttribute('aria-label', ariaLabel);
|
89
|
+
case 7:
|
90
|
+
case "end":
|
91
|
+
return _context.stop();
|
92
|
+
}
|
93
|
+
}, _callee);
|
94
|
+
}));
|
95
|
+
return _setAriaLabel.apply(this, arguments);
|
96
|
+
}
|
97
|
+
setAriaLabel();
|
98
|
+
}, [ariaLabel, containerRef]);
|
56
99
|
return (0, _react2.jsx)(_index.Box, {
|
57
100
|
isRow: true,
|
58
101
|
alignItems: "center",
|
@@ -77,7 +120,8 @@ var ListViewItemChart = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref
|
|
77
120
|
}), (0, _react2.jsx)(_index.Box, {
|
78
121
|
ml: "md"
|
79
122
|
}, (0, _react2.jsx)(_index.Box, {
|
80
|
-
variant: "lisViewItemChart.chartContainer"
|
123
|
+
variant: "lisViewItemChart.chartContainer",
|
124
|
+
id: ariaLabel
|
81
125
|
}, (0, _react2.jsx)(_recharts.ResponsiveContainer, {
|
82
126
|
variant: "lisViewItemChart.responsiveContainer"
|
83
127
|
}, (0, _react2.jsx)(_recharts.LineChart, {
|
@@ -44,7 +44,8 @@ var Default = function Default() {
|
|
44
44
|
contentCountLabel: "Past 7 days",
|
45
45
|
chartLabel: "12 wk trend",
|
46
46
|
trend: "+115.0%",
|
47
|
-
tooltipText: "See Contributing Data"
|
47
|
+
tooltipText: "See Contributing Data",
|
48
|
+
ariaLabel: "LoremIpsum"
|
48
49
|
}));
|
49
50
|
};
|
50
51
|
exports.Default = Default;
|
@@ -24,7 +24,8 @@ var Chart = function Chart(props) {
|
|
24
24
|
contentCountLabel: "Past 7 days",
|
25
25
|
chartLabel: "12 wk trend",
|
26
26
|
trend: "+ 8.6%",
|
27
|
-
tooltipText: "See Contributing Data"
|
27
|
+
tooltipText: "See Contributing Data",
|
28
|
+
ariaLabel: "LoremIpsum"
|
28
29
|
}, props)));
|
29
30
|
};
|
30
31
|
var getComponent = function getComponent() {
|
@@ -558,7 +558,8 @@ var ExpandableChildren = function ExpandableChildren() {
|
|
558
558
|
my: 'md'
|
559
559
|
}
|
560
560
|
}, ___EmotionJSX(TextField, {
|
561
|
-
maxWidth: "300px"
|
561
|
+
maxWidth: "300px",
|
562
|
+
"aria-label": "Search Environment"
|
562
563
|
}), ___EmotionJSX(Box, {
|
563
564
|
sx: {
|
564
565
|
mt: 'md',
|
@@ -878,7 +879,8 @@ export var WithCharts = function WithCharts(_ref9) {
|
|
878
879
|
contentCountLabel: "Past 7 days",
|
879
880
|
chartLabel: "12 wk trend",
|
880
881
|
trend: "+115.0%",
|
881
|
-
tooltipText: "See Contributing Data"
|
882
|
+
tooltipText: "See Contributing Data",
|
883
|
+
ariaLabel: item.name
|
882
884
|
}), ___EmotionJSX(Controls, null)));
|
883
885
|
});
|
884
886
|
};
|
@@ -159,7 +159,8 @@ export var WithCharts = function WithCharts() {
|
|
159
159
|
contentCountLabel: "Past 7 days",
|
160
160
|
chartLabel: "12 wk trend",
|
161
161
|
trend: "+115.0%",
|
162
|
-
tooltipText: "See Contributing Data"
|
162
|
+
tooltipText: "See Contributing Data",
|
163
|
+
ariaLabel: "Kangaroo"
|
163
164
|
}), ___EmotionJSX(ListViewItemSwitchField, null), ___EmotionJSX(ListViewItemMenu, null, ___EmotionJSX(Item, {
|
164
165
|
key: "enable"
|
165
166
|
}, "Enable user"), ___EmotionJSX(Item, {
|
@@ -1,5 +1,18 @@
|
|
1
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
2
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
3
|
+
import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
|
4
|
+
import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
|
7
|
+
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
8
|
+
import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
9
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
10
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
1
11
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
-
import
|
12
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
13
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
14
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context2; _forEachInstanceProperty(_context2 = ["next", "throw", "return"]).call(_context2, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context3; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
15
|
+
import React, { forwardRef, useCallback, useEffect, useMemo } from 'react';
|
3
16
|
import { useVisuallyHidden } from 'react-aria';
|
4
17
|
import { Line, LineChart, ResponsiveContainer } from 'recharts';
|
5
18
|
import useResizeObserver from 'use-resize-observer';
|
@@ -21,7 +34,8 @@ var ListViewItemChart = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
34
|
_props$tabletBreakPoi = props.tabletBreakPoint,
|
22
35
|
tabletBreakPoint = _props$tabletBreakPoi === void 0 ? 605 : _props$tabletBreakPoi,
|
23
36
|
_props$mobileBreakPoi = props.mobileBreakPoint,
|
24
|
-
mobileBreakPoint = _props$mobileBreakPoi === void 0 ? 350 : _props$mobileBreakPoi
|
37
|
+
mobileBreakPoint = _props$mobileBreakPoi === void 0 ? 350 : _props$mobileBreakPoi,
|
38
|
+
ariaLabel = props.ariaLabel;
|
25
39
|
var _useResizeObserver = useResizeObserver({
|
26
40
|
ref: containerRef
|
27
41
|
}),
|
@@ -40,6 +54,37 @@ var ListViewItemChart = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
40
54
|
var hideIfMobile = useCallback(function () {
|
41
55
|
return isMobile && visuallyHiddenProps;
|
42
56
|
}, [isMobile, visuallyHiddenProps]);
|
57
|
+
useEffect(function () {
|
58
|
+
function setAriaLabel() {
|
59
|
+
return _setAriaLabel.apply(this, arguments);
|
60
|
+
}
|
61
|
+
function _setAriaLabel() {
|
62
|
+
_setAriaLabel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
63
|
+
var _yield$containerRef$c, _yield$containerRef$c2, rechartsWrapper;
|
64
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
65
|
+
while (1) switch (_context.prev = _context.next) {
|
66
|
+
case 0:
|
67
|
+
if (!(containerRef && containerRef.current)) {
|
68
|
+
_context.next = 7;
|
69
|
+
break;
|
70
|
+
}
|
71
|
+
_context.next = 3;
|
72
|
+
return containerRef.current.getElementsByClassName('recharts-wrapper');
|
73
|
+
case 3:
|
74
|
+
_yield$containerRef$c = _context.sent;
|
75
|
+
_yield$containerRef$c2 = _slicedToArray(_yield$containerRef$c, 1);
|
76
|
+
rechartsWrapper = _yield$containerRef$c2[0];
|
77
|
+
rechartsWrapper.setAttribute('aria-label', ariaLabel);
|
78
|
+
case 7:
|
79
|
+
case "end":
|
80
|
+
return _context.stop();
|
81
|
+
}
|
82
|
+
}, _callee);
|
83
|
+
}));
|
84
|
+
return _setAriaLabel.apply(this, arguments);
|
85
|
+
}
|
86
|
+
setAriaLabel();
|
87
|
+
}, [ariaLabel, containerRef]);
|
43
88
|
return ___EmotionJSX(Box, {
|
44
89
|
isRow: true,
|
45
90
|
alignItems: "center",
|
@@ -64,7 +109,8 @@ var ListViewItemChart = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
64
109
|
}), ___EmotionJSX(Box, {
|
65
110
|
ml: "md"
|
66
111
|
}, ___EmotionJSX(Box, {
|
67
|
-
variant: "lisViewItemChart.chartContainer"
|
112
|
+
variant: "lisViewItemChart.chartContainer",
|
113
|
+
id: ariaLabel
|
68
114
|
}, ___EmotionJSX(ResponsiveContainer, {
|
69
115
|
variant: "lisViewItemChart.responsiveContainer"
|
70
116
|
}, ___EmotionJSX(LineChart, {
|
@@ -21,7 +21,8 @@ var Chart = function Chart(props) {
|
|
21
21
|
contentCountLabel: "Past 7 days",
|
22
22
|
chartLabel: "12 wk trend",
|
23
23
|
trend: "+ 8.6%",
|
24
|
-
tooltipText: "See Contributing Data"
|
24
|
+
tooltipText: "See Contributing Data",
|
25
|
+
ariaLabel: "LoremIpsum"
|
25
26
|
}, props)));
|
26
27
|
};
|
27
28
|
var getComponent = function getComponent() {
|