@pingux/astro 2.99.0-alpha.0 → 2.99.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/lib/cjs/components/ListView/ListView.stories.d.ts +45 -12
- package/lib/cjs/components/ListView/ListView.stories.js +70 -111
- package/lib/cjs/utils/designUtils/figmaLinks.d.ts +6 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +6 -0
- package/lib/components/ListView/ListView.stories.js +70 -110
- package/lib/utils/designUtils/figmaLinks.js +6 -0
- package/package.json +1 -1
@@ -140,12 +140,28 @@ export interface ExampleItemProps {
|
|
140
140
|
id: string | number;
|
141
141
|
hasSeparator?: boolean;
|
142
142
|
}
|
143
|
-
export declare const Default:
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
143
|
+
export declare const Default: {
|
144
|
+
({ ...args }: {
|
145
|
+
[x: string]: any;
|
146
|
+
}): React.JSX.Element;
|
147
|
+
parameters: {
|
148
|
+
design: {
|
149
|
+
type: string;
|
150
|
+
url: string;
|
151
|
+
};
|
152
|
+
};
|
153
|
+
};
|
154
|
+
export declare const WithExpandableItems: {
|
155
|
+
({ ...args }: {
|
156
|
+
[x: string]: any;
|
157
|
+
}): React.JSX.Element;
|
158
|
+
parameters: {
|
159
|
+
design: {
|
160
|
+
type: string;
|
161
|
+
url: string;
|
162
|
+
};
|
163
|
+
};
|
164
|
+
};
|
149
165
|
export declare const ControlledExpandableItems: ({ ...args }: {
|
150
166
|
[x: string]: any;
|
151
167
|
}) => React.JSX.Element;
|
@@ -160,12 +176,29 @@ export declare const InfiniteLoadingList: {
|
|
160
176
|
story: string;
|
161
177
|
};
|
162
178
|
};
|
179
|
+
design: {
|
180
|
+
type: string;
|
181
|
+
url: string;
|
182
|
+
};
|
183
|
+
};
|
184
|
+
};
|
185
|
+
export declare const WithCharts: {
|
186
|
+
({ ...args }: {
|
187
|
+
[x: string]: any;
|
188
|
+
}): React.JSX.Element;
|
189
|
+
parameters: {
|
190
|
+
design: {
|
191
|
+
type: string;
|
192
|
+
url: string;
|
193
|
+
};
|
194
|
+
a11y: {
|
195
|
+
config: {
|
196
|
+
rules: {
|
197
|
+
id: string;
|
198
|
+
enabled: boolean;
|
199
|
+
}[];
|
200
|
+
};
|
201
|
+
};
|
163
202
|
};
|
164
203
|
};
|
165
|
-
export declare const MultipleSelection: ({ ...args }: {
|
166
|
-
[x: string]: any;
|
167
|
-
}) => React.JSX.Element;
|
168
|
-
export declare const WithCharts: ({ ...args }: {
|
169
|
-
[x: string]: any;
|
170
|
-
}) => React.JSX.Element;
|
171
204
|
export declare const OnLoadPrev: () => React.JSX.Element;
|
@@ -21,9 +21,9 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
21
21
|
_Object$defineProperty(exports, "__esModule", {
|
22
22
|
value: true
|
23
23
|
});
|
24
|
-
exports["default"] = exports.WithExpandableItems = exports.WithCharts = exports.OnLoadPrev = exports.
|
25
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
24
|
+
exports["default"] = exports.WithExpandableItems = exports.WithCharts = exports.OnLoadPrev = exports.InfiniteLoadingList = exports.Default = exports.ControlledExpandableItems = void 0;
|
26
25
|
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
26
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
27
27
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
28
28
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
29
29
|
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
@@ -35,22 +35,20 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/
|
|
35
35
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
36
36
|
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectDestructuringEmpty"));
|
37
37
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
38
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
39
38
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
40
39
|
var _react = _interopRequireWildcard(require("react"));
|
41
40
|
var _reactStately = require("react-stately");
|
42
41
|
var _FormSelectIcon = _interopRequireDefault(require("@pingux/mdi-react/FormSelectIcon"));
|
43
|
-
var _InformationIcon = _interopRequireDefault(require("@pingux/mdi-react/InformationIcon"));
|
44
42
|
var _addonActions = require("@storybook/addon-actions");
|
45
43
|
var _isChromatic = _interopRequireDefault(require("chromatic/isChromatic"));
|
46
44
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
47
45
|
var _2 = require("../..");
|
46
|
+
var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
48
47
|
var _loadingStates = _interopRequireDefault(require("../../utils/devUtils/constants/loadingStates"));
|
49
48
|
var _chartData = require("../ListViewItem/controls/chart/chartData");
|
50
49
|
var _ListView = _interopRequireDefault(require("./ListView.mdx"));
|
51
50
|
var _listViewAttributes = require("./listViewAttributes");
|
52
51
|
var _react2 = require("@emotion/react");
|
53
|
-
var _excluded = ["string", "secondString"];
|
54
52
|
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); }
|
55
53
|
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; }
|
56
54
|
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 _context16; _forEachInstanceProperty(_context16 = ["next", "throw", "return"]).call(_context16, 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 = _Promise2); 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 _context17; 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(_context17 = this.tryEntries).call(_context17, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty2(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; }
|
@@ -91,20 +89,6 @@ var items = [{
|
|
91
89
|
name: 'Snake',
|
92
90
|
id: '3'
|
93
91
|
}];
|
94
|
-
var environments = [{
|
95
|
-
title: 'Ping'
|
96
|
-
}, {
|
97
|
-
title: 'PingOne'
|
98
|
-
}, {
|
99
|
-
title: 'Montana'
|
100
|
-
}, {
|
101
|
-
title: 'Europe',
|
102
|
-
populations: ['Spain', 'Switzerland', 'Germany']
|
103
|
-
}, {
|
104
|
-
title: 'Asia',
|
105
|
-
populations: ['Hong Kong'],
|
106
|
-
isLimitedAccess: true
|
107
|
-
}];
|
108
92
|
var animals = [{
|
109
93
|
name: 'Aardvark'
|
110
94
|
}, {
|
@@ -562,60 +546,21 @@ var actions = {
|
|
562
546
|
onFocus: (0, _addonActions.action)('onFocus'),
|
563
547
|
onLoadMore: (0, _addonActions.action)('onLoadMore')
|
564
548
|
};
|
565
|
-
var CustomText = function CustomText(_ref) {
|
566
|
-
var string = _ref.string,
|
567
|
-
secondString = _ref.secondString,
|
568
|
-
others = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
569
|
-
return (0, _react2.jsx)(_2.Text, others, string, ' ', (0, _react2.jsx)("i", null, secondString));
|
570
|
-
};
|
571
549
|
var ExpandableChildren = function ExpandableChildren() {
|
572
550
|
return (0, _react2.jsx)(_2.Box, {
|
573
551
|
sx: {
|
574
|
-
my: '
|
552
|
+
my: 'lg'
|
575
553
|
}
|
576
|
-
}, (0, _react2.jsx)(_2.
|
577
|
-
maxWidth: "
|
578
|
-
"aria-label": "Search
|
579
|
-
|
554
|
+
}, (0, _react2.jsx)(_2.SearchField, {
|
555
|
+
maxWidth: "400px",
|
556
|
+
"aria-label": "Search",
|
557
|
+
placeholder: "Search"
|
558
|
+
}), (0, _react2.jsx)(_2.Text, {
|
580
559
|
sx: {
|
581
560
|
mt: 'md',
|
582
|
-
|
561
|
+
fontWeight: '1'
|
583
562
|
}
|
584
|
-
},
|
585
|
-
var _env$populations;
|
586
|
-
return (0, _react2.jsx)(_2.Box, {
|
587
|
-
key: env.title
|
588
|
-
}, (0, _react2.jsx)(_2.Box, {
|
589
|
-
isRow: true
|
590
|
-
}, (0, _react2.jsx)(CustomText, {
|
591
|
-
key: "".concat(env.title, " title"),
|
592
|
-
string: env.title,
|
593
|
-
secondString: "Environment"
|
594
|
-
}), env.isLimitedAccess && (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_2.Badge, {
|
595
|
-
label: "Limited Access",
|
596
|
-
bg: "white",
|
597
|
-
textColor: "text.primary",
|
598
|
-
sx: {
|
599
|
-
ml: 'xs',
|
600
|
-
border: '1px solid',
|
601
|
-
borderColor: 'neutral.80'
|
602
|
-
}
|
603
|
-
}), (0, _react2.jsx)(_2.HelpHint, null, "Text of the popover right here..."))), (_env$populations = env.populations) === null || _env$populations === void 0 ? void 0 : (0, _map["default"])(_env$populations).call(_env$populations, function (pop) {
|
604
|
-
return (0, _react2.jsx)(CustomText, {
|
605
|
-
key: pop,
|
606
|
-
sx: {
|
607
|
-
ml: 'sm'
|
608
|
-
},
|
609
|
-
string: pop,
|
610
|
-
secondString: "Population"
|
611
|
-
});
|
612
|
-
}));
|
613
|
-
}), (0, _react2.jsx)(_2.Button, {
|
614
|
-
sx: {
|
615
|
-
alignSelf: 'start'
|
616
|
-
},
|
617
|
-
variant: "link"
|
618
|
-
}, "More Environments")));
|
563
|
+
}, "Lorem ipsum dolor sit amet consectetur. Viverra nulla nec velit sollicitudin sed nisi mi gravida. Maecenas vestibulum pretium dictum dictum tempus. Sit et rutrum hendrerit facilisi turpis tellus elementum. Egestas consectetur in ac id. Sit aliquam et ut pellentesque in at blandit sed. Sapien morbi cras eleifend lectus."));
|
619
564
|
};
|
620
565
|
var ExampleContent = function ExampleContent(contentProps) {
|
621
566
|
var text = contentProps.text;
|
@@ -626,14 +571,7 @@ var ExampleContent = function ExampleContent(contentProps) {
|
|
626
571
|
}
|
627
572
|
}, (0, _react2.jsx)(_2.Text, {
|
628
573
|
variant: "itemTitle"
|
629
|
-
}, text)
|
630
|
-
"aria-label": "".concat(text, " information icon")
|
631
|
-
}, (0, _react2.jsx)(_2.Icon, {
|
632
|
-
icon: _InformationIcon["default"],
|
633
|
-
title: {
|
634
|
-
name: 'Information Icon'
|
635
|
-
}
|
636
|
-
})));
|
574
|
+
}, text));
|
637
575
|
};
|
638
576
|
var Controls = function Controls() {
|
639
577
|
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_2.ListViewItemSwitchField, null), (0, _react2.jsx)(_2.ListViewItemMenu, null, (0, _react2.jsx)(_reactStately.Item, {
|
@@ -644,8 +582,8 @@ var Controls = function Controls() {
|
|
644
582
|
key: "delete"
|
645
583
|
}, "Delete user")));
|
646
584
|
};
|
647
|
-
var Default = function Default(
|
648
|
-
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
585
|
+
var Default = function Default(_ref) {
|
586
|
+
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref), _ref));
|
649
587
|
return (0, _react2.jsx)(_2.ListView, (0, _extends2["default"])({}, props, args, {
|
650
588
|
items: items
|
651
589
|
}), function (item) {
|
@@ -655,13 +593,22 @@ var Default = function Default(_ref2) {
|
|
655
593
|
data: {
|
656
594
|
text: item.name,
|
657
595
|
icon: _FormSelectIcon["default"]
|
596
|
+
},
|
597
|
+
iconProps: {
|
598
|
+
color: 'text.secondary'
|
658
599
|
}
|
659
600
|
}, (0, _react2.jsx)(Controls, null)));
|
660
601
|
});
|
661
602
|
};
|
662
603
|
exports.Default = Default;
|
663
|
-
|
664
|
-
|
604
|
+
Default.parameters = {
|
605
|
+
design: {
|
606
|
+
type: 'figma',
|
607
|
+
url: _figmaLinks.FIGMA_LINKS.listView["default"]
|
608
|
+
}
|
609
|
+
};
|
610
|
+
var WithExpandableItems = function WithExpandableItems(_ref2) {
|
611
|
+
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref2), _ref2));
|
665
612
|
return (0, _react2.jsx)(_2.ListView, (0, _extends2["default"])({}, props, args, {
|
666
613
|
items: items,
|
667
614
|
selectionMode: "expansion"
|
@@ -675,8 +622,14 @@ var WithExpandableItems = function WithExpandableItems(_ref3) {
|
|
675
622
|
});
|
676
623
|
};
|
677
624
|
exports.WithExpandableItems = WithExpandableItems;
|
678
|
-
|
679
|
-
|
625
|
+
WithExpandableItems.parameters = {
|
626
|
+
design: {
|
627
|
+
type: 'figma',
|
628
|
+
url: _figmaLinks.FIGMA_LINKS.listView.withExpandableItems
|
629
|
+
}
|
630
|
+
};
|
631
|
+
var ControlledExpandableItems = function ControlledExpandableItems(_ref3) {
|
632
|
+
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref3), _ref3));
|
680
633
|
var _useState = (0, _react.useState)(['Kangaroo']),
|
681
634
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
682
635
|
expandedKeys = _useState2[0],
|
@@ -710,7 +663,7 @@ var ControlledExpandableItems = function ControlledExpandableItems(_ref4) {
|
|
710
663
|
exports.ControlledExpandableItems = ControlledExpandableItems;
|
711
664
|
var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
712
665
|
var getMockData = /*#__PURE__*/function () {
|
713
|
-
var
|
666
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(signal, cursor) {
|
714
667
|
var pageNumber;
|
715
668
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
716
669
|
while (1) switch (_context.prev = _context.next) {
|
@@ -740,11 +693,11 @@ var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
740
693
|
}, _callee);
|
741
694
|
}));
|
742
695
|
return function getMockData(_x, _x2) {
|
743
|
-
return
|
696
|
+
return _ref4.apply(this, arguments);
|
744
697
|
};
|
745
698
|
}();
|
746
699
|
var fetchApiData = /*#__PURE__*/function () {
|
747
|
-
var
|
700
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(signal, cursor, filterText) {
|
748
701
|
var res, json;
|
749
702
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
750
703
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -796,17 +749,17 @@ var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
796
749
|
}, _callee2, null, [[2, 14]]);
|
797
750
|
}));
|
798
751
|
return function fetchApiData(_x3, _x4, _x5) {
|
799
|
-
return
|
752
|
+
return _ref5.apply(this, arguments);
|
800
753
|
};
|
801
754
|
}();
|
802
755
|
var list = (0, _reactStately.useAsyncList)({
|
803
|
-
load: function load(
|
756
|
+
load: function load(_ref6) {
|
804
757
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
805
758
|
var signal, cursor, filterText;
|
806
759
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
807
760
|
while (1) switch (_context3.prev = _context3.next) {
|
808
761
|
case 0:
|
809
|
-
signal =
|
762
|
+
signal = _ref6.signal, cursor = _ref6.cursor, filterText = _ref6.filterText;
|
810
763
|
if (cursor) {
|
811
764
|
// eslint-disable-next-line
|
812
765
|
cursor = cursor.replace(/^http:\/\//i, "https://");
|
@@ -843,6 +796,9 @@ var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
843
796
|
data: {
|
844
797
|
text: item.name,
|
845
798
|
icon: _FormSelectIcon["default"]
|
799
|
+
},
|
800
|
+
iconProps: {
|
801
|
+
color: 'text.secondary'
|
846
802
|
}
|
847
803
|
}, (0, _react2.jsx)(Controls, null)));
|
848
804
|
}));
|
@@ -856,31 +812,17 @@ InfiniteLoadingList.parameters = {
|
|
856
812
|
description: {
|
857
813
|
story: 'Note: Keep in mind the maxHeight may impact when the scroll callback is triggered. If you notice it\'s being called too often, try adjusting that value or loading more objects to prevent this behavior.'
|
858
814
|
}
|
815
|
+
},
|
816
|
+
design: {
|
817
|
+
type: 'figma',
|
818
|
+
url: _figmaLinks.FIGMA_LINKS.listView.infiniteLoadingList
|
859
819
|
}
|
860
820
|
};
|
861
|
-
var
|
862
|
-
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
863
|
-
return (0, _react2.jsx)(_2.ListView, (0, _extends2["default"])({}, props, args, {
|
864
|
-
items: items,
|
865
|
-
selectionMode: "multiple"
|
866
|
-
}), function (item) {
|
867
|
-
return (0, _react2.jsx)(_reactStately.Item, {
|
868
|
-
key: item.name
|
869
|
-
}, (0, _react2.jsx)(_2.ListViewItem, {
|
870
|
-
data: {
|
871
|
-
text: item.name,
|
872
|
-
icon: _FormSelectIcon["default"]
|
873
|
-
}
|
874
|
-
}, (0, _react2.jsx)(Controls, null)));
|
875
|
-
});
|
876
|
-
};
|
877
|
-
exports.MultipleSelection = MultipleSelection;
|
878
|
-
var WithCharts = function WithCharts(_ref9) {
|
879
|
-
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref9), _ref9));
|
821
|
+
var WithCharts = function WithCharts(_ref7) {
|
822
|
+
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref7), _ref7));
|
880
823
|
var chartContainerRef = (0, _react.useRef)();
|
881
824
|
return (0, _react2.jsx)(_2.ListView, (0, _extends2["default"])({}, args, {
|
882
|
-
items: items
|
883
|
-
selectionMode: "multiple"
|
825
|
+
items: items
|
884
826
|
}), function (item) {
|
885
827
|
return (0, _react2.jsx)(_reactStately.Item, {
|
886
828
|
key: item.name
|
@@ -890,6 +832,9 @@ var WithCharts = function WithCharts(_ref9) {
|
|
890
832
|
text: item.name,
|
891
833
|
subtext: item.subtext,
|
892
834
|
icon: _FormSelectIcon["default"]
|
835
|
+
},
|
836
|
+
iconProps: {
|
837
|
+
color: 'text.secondary'
|
893
838
|
}
|
894
839
|
}, (0, _react2.jsx)(_2.ListViewItemChart, {
|
895
840
|
containerRef: chartContainerRef,
|
@@ -906,6 +851,20 @@ var WithCharts = function WithCharts(_ref9) {
|
|
906
851
|
});
|
907
852
|
};
|
908
853
|
exports.WithCharts = WithCharts;
|
854
|
+
WithCharts.parameters = {
|
855
|
+
design: {
|
856
|
+
type: 'figma',
|
857
|
+
url: _figmaLinks.FIGMA_LINKS.listView.withCharts
|
858
|
+
},
|
859
|
+
a11y: {
|
860
|
+
config: {
|
861
|
+
rules: [{
|
862
|
+
id: 'landmark-unique',
|
863
|
+
enabled: false
|
864
|
+
}]
|
865
|
+
}
|
866
|
+
}
|
867
|
+
};
|
909
868
|
var OnLoadPrev = function OnLoadPrev() {
|
910
869
|
var _context4, _context5;
|
911
870
|
var initialItems = (0, _map["default"])(_context4 = (0, _fill["default"])(_context5 = new Array(10)).call(_context5, {
|
@@ -935,7 +894,7 @@ var OnLoadPrev = function OnLoadPrev() {
|
|
935
894
|
loadingState = _useState10[0],
|
936
895
|
setLoadingState = _useState10[1];
|
937
896
|
var onLoadMore = /*#__PURE__*/function () {
|
938
|
-
var
|
897
|
+
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
939
898
|
var _context6, _context7, _context8;
|
940
899
|
var newItems;
|
941
900
|
return _regeneratorRuntime().wrap(function _callee4$(_context9) {
|
@@ -967,11 +926,11 @@ var OnLoadPrev = function OnLoadPrev() {
|
|
967
926
|
}, _callee4);
|
968
927
|
}));
|
969
928
|
return function onLoadMore() {
|
970
|
-
return
|
929
|
+
return _ref8.apply(this, arguments);
|
971
930
|
};
|
972
931
|
}();
|
973
932
|
var onLoadPrev = /*#__PURE__*/function () {
|
974
|
-
var
|
933
|
+
var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
975
934
|
var _context10, _context11, _context12;
|
976
935
|
var newItems;
|
977
936
|
return _regeneratorRuntime().wrap(function _callee5$(_context13) {
|
@@ -1003,7 +962,7 @@ var OnLoadPrev = function OnLoadPrev() {
|
|
1003
962
|
}, _callee5);
|
1004
963
|
}));
|
1005
964
|
return function onLoadPrev() {
|
1006
|
-
return
|
965
|
+
return _ref9.apply(this, arguments);
|
1007
966
|
};
|
1008
967
|
}();
|
1009
968
|
return (0, _react2.jsx)(_2.Box, {
|
@@ -184,6 +184,12 @@ export declare const FIGMA_LINKS: {
|
|
184
184
|
withoutButton: string;
|
185
185
|
withoutLink: string;
|
186
186
|
};
|
187
|
+
listView: {
|
188
|
+
default: string;
|
189
|
+
withExpandableItems: string;
|
190
|
+
withCharts: string;
|
191
|
+
infiniteLoadingList: string;
|
192
|
+
};
|
187
193
|
tooltipTrigger: {
|
188
194
|
badgeWithTooltip: string;
|
189
195
|
};
|
@@ -191,6 +191,12 @@ var FIGMA_LINKS = {
|
|
191
191
|
withoutButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-16196&t=OK8Fy4P3se6BKy0F-4',
|
192
192
|
withoutLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-16201&t=OK8Fy4P3se6BKy0F-4'
|
193
193
|
},
|
194
|
+
listView: {
|
195
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=57056-5258&t=aeLMWPtVqU6aIeNs-4',
|
196
|
+
withExpandableItems: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58432-5601&t=aeLMWPtVqU6aIeNs-4',
|
197
|
+
withCharts: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=57056-5709&t=aeLMWPtVqU6aIeNs-4',
|
198
|
+
infiniteLoadingList: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58597-316&t=aeLMWPtVqU6aIeNs-4'
|
199
|
+
},
|
194
200
|
tooltipTrigger: {
|
195
201
|
badgeWithTooltip: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=59201-5404&t=wsQsGpX0SmOiAweL-4'
|
196
202
|
},
|
@@ -16,12 +16,10 @@ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerat
|
|
16
16
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
17
17
|
import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty";
|
18
18
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
19
|
-
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
20
19
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
21
|
-
var _excluded = ["string", "secondString"];
|
22
20
|
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 _context16; _forEachInstanceProperty(_context16 = ["next", "throw", "return"]).call(_context16, 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 _context17; 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(_context17 = this.tryEntries).call(_context17, 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
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
24
21
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
22
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
25
23
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
26
24
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
27
25
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
@@ -34,11 +32,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
34
32
|
import React, { useRef, useState } from 'react';
|
35
33
|
import { Item, useAsyncList } from 'react-stately';
|
36
34
|
import FormSelectIcon from '@pingux/mdi-react/FormSelectIcon';
|
37
|
-
import InformationIcon from '@pingux/mdi-react/InformationIcon';
|
38
35
|
import { action } from '@storybook/addon-actions';
|
39
36
|
import isChromatic from 'chromatic/isChromatic';
|
40
37
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
41
|
-
import {
|
38
|
+
import { Box, Button, ListView, ListViewItem, ListViewItemChart, ListViewItemMenu, ListViewItemSwitchField, SearchField, Text } from '../..';
|
39
|
+
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
42
40
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
43
41
|
import { chartData } from '../ListViewItem/controls/chart/chartData';
|
44
42
|
import ListViewReadme from './ListView.mdx';
|
@@ -78,20 +76,6 @@ var items = [{
|
|
78
76
|
name: 'Snake',
|
79
77
|
id: '3'
|
80
78
|
}];
|
81
|
-
var environments = [{
|
82
|
-
title: 'Ping'
|
83
|
-
}, {
|
84
|
-
title: 'PingOne'
|
85
|
-
}, {
|
86
|
-
title: 'Montana'
|
87
|
-
}, {
|
88
|
-
title: 'Europe',
|
89
|
-
populations: ['Spain', 'Switzerland', 'Germany']
|
90
|
-
}, {
|
91
|
-
title: 'Asia',
|
92
|
-
populations: ['Hong Kong'],
|
93
|
-
isLimitedAccess: true
|
94
|
-
}];
|
95
79
|
var animals = [{
|
96
80
|
name: 'Aardvark'
|
97
81
|
}, {
|
@@ -549,60 +533,21 @@ var actions = {
|
|
549
533
|
onFocus: action('onFocus'),
|
550
534
|
onLoadMore: action('onLoadMore')
|
551
535
|
};
|
552
|
-
var CustomText = function CustomText(_ref) {
|
553
|
-
var string = _ref.string,
|
554
|
-
secondString = _ref.secondString,
|
555
|
-
others = _objectWithoutProperties(_ref, _excluded);
|
556
|
-
return ___EmotionJSX(Text, others, string, ' ', ___EmotionJSX("i", null, secondString));
|
557
|
-
};
|
558
536
|
var ExpandableChildren = function ExpandableChildren() {
|
559
537
|
return ___EmotionJSX(Box, {
|
560
538
|
sx: {
|
561
|
-
my: '
|
539
|
+
my: 'lg'
|
562
540
|
}
|
563
|
-
}, ___EmotionJSX(
|
564
|
-
maxWidth: "
|
565
|
-
"aria-label": "Search
|
566
|
-
|
541
|
+
}, ___EmotionJSX(SearchField, {
|
542
|
+
maxWidth: "400px",
|
543
|
+
"aria-label": "Search",
|
544
|
+
placeholder: "Search"
|
545
|
+
}), ___EmotionJSX(Text, {
|
567
546
|
sx: {
|
568
547
|
mt: 'md',
|
569
|
-
|
548
|
+
fontWeight: '1'
|
570
549
|
}
|
571
|
-
},
|
572
|
-
var _env$populations;
|
573
|
-
return ___EmotionJSX(Box, {
|
574
|
-
key: env.title
|
575
|
-
}, ___EmotionJSX(Box, {
|
576
|
-
isRow: true
|
577
|
-
}, ___EmotionJSX(CustomText, {
|
578
|
-
key: "".concat(env.title, " title"),
|
579
|
-
string: env.title,
|
580
|
-
secondString: "Environment"
|
581
|
-
}), env.isLimitedAccess && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Badge, {
|
582
|
-
label: "Limited Access",
|
583
|
-
bg: "white",
|
584
|
-
textColor: "text.primary",
|
585
|
-
sx: {
|
586
|
-
ml: 'xs',
|
587
|
-
border: '1px solid',
|
588
|
-
borderColor: 'neutral.80'
|
589
|
-
}
|
590
|
-
}), ___EmotionJSX(HelpHint, null, "Text of the popover right here..."))), (_env$populations = env.populations) === null || _env$populations === void 0 ? void 0 : _mapInstanceProperty(_env$populations).call(_env$populations, function (pop) {
|
591
|
-
return ___EmotionJSX(CustomText, {
|
592
|
-
key: pop,
|
593
|
-
sx: {
|
594
|
-
ml: 'sm'
|
595
|
-
},
|
596
|
-
string: pop,
|
597
|
-
secondString: "Population"
|
598
|
-
});
|
599
|
-
}));
|
600
|
-
}), ___EmotionJSX(Button, {
|
601
|
-
sx: {
|
602
|
-
alignSelf: 'start'
|
603
|
-
},
|
604
|
-
variant: "link"
|
605
|
-
}, "More Environments")));
|
550
|
+
}, "Lorem ipsum dolor sit amet consectetur. Viverra nulla nec velit sollicitudin sed nisi mi gravida. Maecenas vestibulum pretium dictum dictum tempus. Sit et rutrum hendrerit facilisi turpis tellus elementum. Egestas consectetur in ac id. Sit aliquam et ut pellentesque in at blandit sed. Sapien morbi cras eleifend lectus."));
|
606
551
|
};
|
607
552
|
var ExampleContent = function ExampleContent(contentProps) {
|
608
553
|
var text = contentProps.text;
|
@@ -613,14 +558,7 @@ var ExampleContent = function ExampleContent(contentProps) {
|
|
613
558
|
}
|
614
559
|
}, ___EmotionJSX(Text, {
|
615
560
|
variant: "itemTitle"
|
616
|
-
}, text)
|
617
|
-
"aria-label": "".concat(text, " information icon")
|
618
|
-
}, ___EmotionJSX(Icon, {
|
619
|
-
icon: InformationIcon,
|
620
|
-
title: {
|
621
|
-
name: 'Information Icon'
|
622
|
-
}
|
623
|
-
})));
|
561
|
+
}, text));
|
624
562
|
};
|
625
563
|
var Controls = function Controls() {
|
626
564
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(ListViewItemSwitchField, null), ___EmotionJSX(ListViewItemMenu, null, ___EmotionJSX(Item, {
|
@@ -631,8 +569,8 @@ var Controls = function Controls() {
|
|
631
569
|
key: "delete"
|
632
570
|
}, "Delete user")));
|
633
571
|
};
|
634
|
-
export var Default = function Default(
|
635
|
-
var args = _extends({}, (_objectDestructuringEmpty(
|
572
|
+
export var Default = function Default(_ref) {
|
573
|
+
var args = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
636
574
|
return ___EmotionJSX(ListView, _extends({}, props, args, {
|
637
575
|
items: items
|
638
576
|
}), function (item) {
|
@@ -642,12 +580,21 @@ export var Default = function Default(_ref2) {
|
|
642
580
|
data: {
|
643
581
|
text: item.name,
|
644
582
|
icon: FormSelectIcon
|
583
|
+
},
|
584
|
+
iconProps: {
|
585
|
+
color: 'text.secondary'
|
645
586
|
}
|
646
587
|
}, ___EmotionJSX(Controls, null)));
|
647
588
|
});
|
648
589
|
};
|
649
|
-
|
650
|
-
|
590
|
+
Default.parameters = {
|
591
|
+
design: {
|
592
|
+
type: 'figma',
|
593
|
+
url: FIGMA_LINKS.listView["default"]
|
594
|
+
}
|
595
|
+
};
|
596
|
+
export var WithExpandableItems = function WithExpandableItems(_ref2) {
|
597
|
+
var args = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
651
598
|
return ___EmotionJSX(ListView, _extends({}, props, args, {
|
652
599
|
items: items,
|
653
600
|
selectionMode: "expansion"
|
@@ -660,8 +607,14 @@ export var WithExpandableItems = function WithExpandableItems(_ref3) {
|
|
660
607
|
}), ___EmotionJSX(ExpandableChildren, null));
|
661
608
|
});
|
662
609
|
};
|
663
|
-
|
664
|
-
|
610
|
+
WithExpandableItems.parameters = {
|
611
|
+
design: {
|
612
|
+
type: 'figma',
|
613
|
+
url: FIGMA_LINKS.listView.withExpandableItems
|
614
|
+
}
|
615
|
+
};
|
616
|
+
export var ControlledExpandableItems = function ControlledExpandableItems(_ref3) {
|
617
|
+
var args = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));
|
665
618
|
var _useState = useState(['Kangaroo']),
|
666
619
|
_useState2 = _slicedToArray(_useState, 2),
|
667
620
|
expandedKeys = _useState2[0],
|
@@ -694,7 +647,7 @@ export var ControlledExpandableItems = function ControlledExpandableItems(_ref4)
|
|
694
647
|
};
|
695
648
|
export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
696
649
|
var getMockData = /*#__PURE__*/function () {
|
697
|
-
var
|
650
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(signal, cursor) {
|
698
651
|
var pageNumber;
|
699
652
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
700
653
|
while (1) switch (_context.prev = _context.next) {
|
@@ -724,11 +677,11 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
724
677
|
}, _callee);
|
725
678
|
}));
|
726
679
|
return function getMockData(_x, _x2) {
|
727
|
-
return
|
680
|
+
return _ref4.apply(this, arguments);
|
728
681
|
};
|
729
682
|
}();
|
730
683
|
var fetchApiData = /*#__PURE__*/function () {
|
731
|
-
var
|
684
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(signal, cursor, filterText) {
|
732
685
|
var res, json;
|
733
686
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
734
687
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -780,17 +733,17 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
780
733
|
}, _callee2, null, [[2, 14]]);
|
781
734
|
}));
|
782
735
|
return function fetchApiData(_x3, _x4, _x5) {
|
783
|
-
return
|
736
|
+
return _ref5.apply(this, arguments);
|
784
737
|
};
|
785
738
|
}();
|
786
739
|
var list = useAsyncList({
|
787
|
-
load: function load(
|
740
|
+
load: function load(_ref6) {
|
788
741
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
789
742
|
var signal, cursor, filterText;
|
790
743
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
791
744
|
while (1) switch (_context3.prev = _context3.next) {
|
792
745
|
case 0:
|
793
|
-
signal =
|
746
|
+
signal = _ref6.signal, cursor = _ref6.cursor, filterText = _ref6.filterText;
|
794
747
|
if (cursor) {
|
795
748
|
// eslint-disable-next-line
|
796
749
|
cursor = cursor.replace(/^http:\/\//i, "https://");
|
@@ -827,6 +780,9 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
827
780
|
data: {
|
828
781
|
text: item.name,
|
829
782
|
icon: FormSelectIcon
|
783
|
+
},
|
784
|
+
iconProps: {
|
785
|
+
color: 'text.secondary'
|
830
786
|
}
|
831
787
|
}, ___EmotionJSX(Controls, null)));
|
832
788
|
}));
|
@@ -839,30 +795,17 @@ InfiniteLoadingList.parameters = {
|
|
839
795
|
description: {
|
840
796
|
story: 'Note: Keep in mind the maxHeight may impact when the scroll callback is triggered. If you notice it\'s being called too often, try adjusting that value or loading more objects to prevent this behavior.'
|
841
797
|
}
|
798
|
+
},
|
799
|
+
design: {
|
800
|
+
type: 'figma',
|
801
|
+
url: FIGMA_LINKS.listView.infiniteLoadingList
|
842
802
|
}
|
843
803
|
};
|
844
|
-
export var
|
845
|
-
var args = _extends({}, (_objectDestructuringEmpty(
|
846
|
-
return ___EmotionJSX(ListView, _extends({}, props, args, {
|
847
|
-
items: items,
|
848
|
-
selectionMode: "multiple"
|
849
|
-
}), function (item) {
|
850
|
-
return ___EmotionJSX(Item, {
|
851
|
-
key: item.name
|
852
|
-
}, ___EmotionJSX(ListViewItem, {
|
853
|
-
data: {
|
854
|
-
text: item.name,
|
855
|
-
icon: FormSelectIcon
|
856
|
-
}
|
857
|
-
}, ___EmotionJSX(Controls, null)));
|
858
|
-
});
|
859
|
-
};
|
860
|
-
export var WithCharts = function WithCharts(_ref9) {
|
861
|
-
var args = _extends({}, (_objectDestructuringEmpty(_ref9), _ref9));
|
804
|
+
export var WithCharts = function WithCharts(_ref7) {
|
805
|
+
var args = _extends({}, (_objectDestructuringEmpty(_ref7), _ref7));
|
862
806
|
var chartContainerRef = useRef();
|
863
807
|
return ___EmotionJSX(ListView, _extends({}, args, {
|
864
|
-
items: items
|
865
|
-
selectionMode: "multiple"
|
808
|
+
items: items
|
866
809
|
}), function (item) {
|
867
810
|
return ___EmotionJSX(Item, {
|
868
811
|
key: item.name
|
@@ -872,6 +815,9 @@ export var WithCharts = function WithCharts(_ref9) {
|
|
872
815
|
text: item.name,
|
873
816
|
subtext: item.subtext,
|
874
817
|
icon: FormSelectIcon
|
818
|
+
},
|
819
|
+
iconProps: {
|
820
|
+
color: 'text.secondary'
|
875
821
|
}
|
876
822
|
}, ___EmotionJSX(ListViewItemChart, {
|
877
823
|
containerRef: chartContainerRef,
|
@@ -887,6 +833,20 @@ export var WithCharts = function WithCharts(_ref9) {
|
|
887
833
|
}), ___EmotionJSX(Controls, null)));
|
888
834
|
});
|
889
835
|
};
|
836
|
+
WithCharts.parameters = {
|
837
|
+
design: {
|
838
|
+
type: 'figma',
|
839
|
+
url: FIGMA_LINKS.listView.withCharts
|
840
|
+
},
|
841
|
+
a11y: {
|
842
|
+
config: {
|
843
|
+
rules: [{
|
844
|
+
id: 'landmark-unique',
|
845
|
+
enabled: false
|
846
|
+
}]
|
847
|
+
}
|
848
|
+
}
|
849
|
+
};
|
890
850
|
export var OnLoadPrev = function OnLoadPrev() {
|
891
851
|
var _context4, _context5;
|
892
852
|
var initialItems = _mapInstanceProperty(_context4 = _fillInstanceProperty(_context5 = new Array(10)).call(_context5, {
|
@@ -916,7 +876,7 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
916
876
|
loadingState = _useState10[0],
|
917
877
|
setLoadingState = _useState10[1];
|
918
878
|
var onLoadMore = /*#__PURE__*/function () {
|
919
|
-
var
|
879
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
920
880
|
var _context6, _context7, _context8;
|
921
881
|
var newItems;
|
922
882
|
return _regeneratorRuntime().wrap(function _callee4$(_context9) {
|
@@ -948,11 +908,11 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
948
908
|
}, _callee4);
|
949
909
|
}));
|
950
910
|
return function onLoadMore() {
|
951
|
-
return
|
911
|
+
return _ref8.apply(this, arguments);
|
952
912
|
};
|
953
913
|
}();
|
954
914
|
var onLoadPrev = /*#__PURE__*/function () {
|
955
|
-
var
|
915
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
956
916
|
var _context10, _context11, _context12;
|
957
917
|
var newItems;
|
958
918
|
return _regeneratorRuntime().wrap(function _callee5$(_context13) {
|
@@ -984,7 +944,7 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
984
944
|
}, _callee5);
|
985
945
|
}));
|
986
946
|
return function onLoadPrev() {
|
987
|
-
return
|
947
|
+
return _ref9.apply(this, arguments);
|
988
948
|
};
|
989
949
|
}();
|
990
950
|
return ___EmotionJSX(Box, {
|
@@ -184,6 +184,12 @@ export var FIGMA_LINKS = {
|
|
184
184
|
withoutButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-16196&t=OK8Fy4P3se6BKy0F-4',
|
185
185
|
withoutLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-16201&t=OK8Fy4P3se6BKy0F-4'
|
186
186
|
},
|
187
|
+
listView: {
|
188
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=57056-5258&t=aeLMWPtVqU6aIeNs-4',
|
189
|
+
withExpandableItems: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58432-5601&t=aeLMWPtVqU6aIeNs-4',
|
190
|
+
withCharts: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=57056-5709&t=aeLMWPtVqU6aIeNs-4',
|
191
|
+
infiniteLoadingList: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58597-316&t=aeLMWPtVqU6aIeNs-4'
|
192
|
+
},
|
187
193
|
tooltipTrigger: {
|
188
194
|
badgeWithTooltip: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=59201-5404&t=wsQsGpX0SmOiAweL-4'
|
189
195
|
},
|