@pingux/astro 2.106.0-alpha.1 → 2.106.0-alpha.3
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/AIComponents/Suggestions/Suggestion.d.ts +4 -0
- package/lib/cjs/components/AIComponents/Suggestions/Suggestion.js +46 -0
- package/lib/cjs/components/AIComponents/Suggestions/Suggestions.d.ts +4 -0
- package/lib/cjs/components/AIComponents/Suggestions/Suggestions.js +42 -0
- package/lib/cjs/components/AIComponents/Suggestions/Suggestions.stories.d.ts +8 -0
- package/lib/cjs/components/AIComponents/Suggestions/Suggestions.stories.js +49 -0
- package/lib/cjs/components/AIComponents/Suggestions/Suggestions.test.d.ts +1 -0
- package/lib/cjs/components/AIComponents/Suggestions/Suggestions.test.js +47 -0
- package/lib/cjs/components/AIComponents/Suggestions/index.d.ts +2 -0
- package/lib/cjs/components/AIComponents/Suggestions/index.js +21 -0
- package/lib/cjs/components/NavigationHeader/HeaderAccountMenu.d.ts +2 -1
- package/lib/cjs/components/NavigationHeader/HeaderAccountMenu.js +4 -3
- package/lib/cjs/components/NavigationHeader/NavigationHeader.test.js +117 -3
- package/lib/cjs/components/NavigationHeader/index.d.ts +1 -0
- package/lib/cjs/components/NavigationHeader/index.js +7 -0
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +15 -0
- package/lib/cjs/styles/themes/next-gen/colors/colors.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/colors/colors.js +2 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +55 -0
- package/lib/cjs/styles/themes/next-gen/variants/cards.d.ts +38 -0
- package/lib/cjs/styles/themes/next-gen/variants/cards.js +27 -1
- package/lib/cjs/styles/themes/next-gen/variants/suggestion.d.ts +8 -0
- package/lib/cjs/styles/themes/next-gen/variants/suggestion.js +16 -0
- package/lib/cjs/styles/themes/next-gen/variants/suggestions.d.ts +10 -0
- package/lib/cjs/styles/themes/next-gen/variants/suggestions.js +17 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +16 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +4 -0
- package/lib/cjs/types/suggestions.d.ts +13 -0
- package/lib/cjs/types/suggestions.js +6 -0
- package/lib/components/AIComponents/Suggestions/Suggestion.js +37 -0
- package/lib/components/AIComponents/Suggestions/Suggestions.js +28 -0
- package/lib/components/AIComponents/Suggestions/Suggestions.stories.js +38 -0
- package/lib/components/AIComponents/Suggestions/Suggestions.test.js +44 -0
- package/lib/components/AIComponents/Suggestions/index.js +2 -0
- package/lib/components/NavigationHeader/HeaderAccountMenu.js +4 -3
- package/lib/components/NavigationHeader/NavigationHeader.test.js +114 -4
- package/lib/components/NavigationHeader/index.js +1 -0
- package/lib/index.js +2 -0
- package/lib/styles/themes/next-gen/colors/colors.js +2 -1
- package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/styles/themes/next-gen/variants/cards.js +27 -1
- package/lib/styles/themes/next-gen/variants/suggestion.js +8 -0
- package/lib/styles/themes/next-gen/variants/suggestions.js +9 -0
- package/lib/styles/themes/next-gen/variants/variants.js +4 -0
- package/lib/types/suggestions.js +1 -0
- package/package.json +1 -1
@@ -10,22 +10,29 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
10
10
|
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
11
11
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
12
12
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
13
|
-
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; }
|
13
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
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 _context3; _forEachInstanceProperty(_context3 = ["next", "throw", "return"]).call(_context3, 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 _context4; 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(_context4 = this.tryEntries).call(_context4, 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; }
|
14
15
|
import React from 'react';
|
15
16
|
import HelpCircleOutlineIcon from '@pingux/mdi-react/HelpCircleOutlineIcon';
|
16
17
|
import MoonWaningCrescentIcon from '@pingux/mdi-react/MoonWaningCrescentIcon';
|
17
18
|
import WhiteBalanceSunnyIcon from '@pingux/mdi-react/WhiteBalanceSunnyIcon';
|
18
19
|
import userEvent from '@testing-library/user-event';
|
19
20
|
import { Box, Icon, IconButton, IconButtonToggle, Image, Item, Link, Menu, OverlayProvider, PopoverMenu, Separator, Text } from '../../index';
|
20
|
-
import { pingLogoHorizontal } from '../../utils/devUtils/constants/images';
|
21
|
+
import { pingLogoHorizontal, userImage } from '../../utils/devUtils/constants/images';
|
21
22
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
22
23
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
23
|
-
import NavigationHeader from '.';
|
24
|
+
import NavigationHeader, { HeaderAccountMenu } from '.';
|
24
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
25
26
|
var breakpointDisplaysXS = ['none', 'none', 'block', 'block', 'block', 'block'];
|
26
27
|
var breakpointDisplaySmall = ['none', 'none', 'none', 'none', 'block', 'block'];
|
27
28
|
var pingLogoAlt = 'Ping Identity Logo';
|
28
29
|
var fallbackAlt = 'Fallback Image';
|
30
|
+
var userData = {
|
31
|
+
email: 'bjensen@example.com',
|
32
|
+
firstName: 'Barbara',
|
33
|
+
lastName: 'Jensen',
|
34
|
+
image: userImage
|
35
|
+
};
|
29
36
|
var getComponent = function getComponent() {
|
30
37
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
31
38
|
return render(___EmotionJSX(NavigationHeader, _extends({}, props, {
|
@@ -150,8 +157,80 @@ var getComponent = function getComponent() {
|
|
150
157
|
'aria-label': 'theme icon',
|
151
158
|
'data-testid': 'theme-toggle-icon-button'
|
152
159
|
}
|
160
|
+
})), ___EmotionJSX(Box, {
|
161
|
+
as: "li",
|
162
|
+
display: breakpointDisplaysXS,
|
163
|
+
"data-testid": "header-account-menu"
|
164
|
+
}, ___EmotionJSX(HeaderAccountMenu, {
|
165
|
+
userData: userData,
|
166
|
+
buttonProps: {
|
167
|
+
'data-testid': 'user-dropdown-button'
|
168
|
+
},
|
169
|
+
avatarProps: {
|
170
|
+
defaultText: 'BJ',
|
171
|
+
size: 'avatar.md',
|
172
|
+
backgroundColor: 'red-100',
|
173
|
+
color: 'red-800'
|
174
|
+
}
|
153
175
|
})))));
|
154
176
|
};
|
177
|
+
var getAccountMenuComponent = function getAccountMenuComponent() {
|
178
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
179
|
+
return render(___EmotionJSX(NavigationHeader, {
|
180
|
+
isSticky: true,
|
181
|
+
"aria-labelledby": "next-gen-header"
|
182
|
+
}, ___EmotionJSX(Link, {
|
183
|
+
href: "#",
|
184
|
+
variant: "navigationHeader.logoBand",
|
185
|
+
"data-testid": "logo-band"
|
186
|
+
}, ___EmotionJSX(Box, {
|
187
|
+
isRow: true,
|
188
|
+
alignItems: "center",
|
189
|
+
justifyContent: "center",
|
190
|
+
py: "sm",
|
191
|
+
flex: "0 0 auto"
|
192
|
+
}, ___EmotionJSX(Image, {
|
193
|
+
src: pingLogoHorizontal,
|
194
|
+
alt: pingLogoAlt,
|
195
|
+
mr: "md",
|
196
|
+
sx: {
|
197
|
+
height: '24px'
|
198
|
+
},
|
199
|
+
"data-testid": "ping-logo",
|
200
|
+
fallbackAlt: fallbackAlt
|
201
|
+
}), ___EmotionJSX(Separator, {
|
202
|
+
orientation: "vertical",
|
203
|
+
style: {
|
204
|
+
height: '28px',
|
205
|
+
margin: '0'
|
206
|
+
}
|
207
|
+
}), ___EmotionJSX(Text, {
|
208
|
+
as: "h2",
|
209
|
+
variant: "navigationHeader.headerPlaceholder",
|
210
|
+
id: "next-gen-header"
|
211
|
+
}, "Marketplace"))), ___EmotionJSX(Box, {
|
212
|
+
as: "ul",
|
213
|
+
isRow: true,
|
214
|
+
alignItems: "center",
|
215
|
+
p: "0",
|
216
|
+
ml: "auto",
|
217
|
+
flex: "0 0 auto"
|
218
|
+
}, ___EmotionJSX(Box, {
|
219
|
+
as: "li",
|
220
|
+
display: breakpointDisplaysXS,
|
221
|
+
"data-testid": "header-account-menu"
|
222
|
+
}, ___EmotionJSX(HeaderAccountMenu, _extends({}, props, {
|
223
|
+
buttonProps: {
|
224
|
+
'data-testid': 'user-dropdown-button'
|
225
|
+
},
|
226
|
+
avatarProps: {
|
227
|
+
defaultText: 'BJ',
|
228
|
+
size: 'avatar.md',
|
229
|
+
backgroundColor: 'red-100',
|
230
|
+
color: 'red-800'
|
231
|
+
}
|
232
|
+
}))))));
|
233
|
+
};
|
155
234
|
|
156
235
|
// Needs to be added to each components test file
|
157
236
|
universalComponentTests({
|
@@ -278,6 +357,18 @@ universalComponentTests({
|
|
278
357
|
buttonProps: {
|
279
358
|
'aria-label': 'theme icon'
|
280
359
|
}
|
360
|
+
})), ___EmotionJSX(Box, {
|
361
|
+
as: "li",
|
362
|
+
display: breakpointDisplaysXS,
|
363
|
+
"data-testid": "header-account-menu"
|
364
|
+
}, ___EmotionJSX(HeaderAccountMenu, {
|
365
|
+
userData: userData,
|
366
|
+
avatarProps: {
|
367
|
+
defaultText: 'BJ',
|
368
|
+
size: 'avatar.md',
|
369
|
+
backgroundColor: 'red-100',
|
370
|
+
color: 'red-800'
|
371
|
+
}
|
281
372
|
}))));
|
282
373
|
}
|
283
374
|
});
|
@@ -355,4 +446,23 @@ test('should open dropdown menu when clicked', /*#__PURE__*/_asyncToGenerator( /
|
|
355
446
|
return _context.stop();
|
356
447
|
}
|
357
448
|
}, _callee);
|
358
|
-
})));
|
449
|
+
})));
|
450
|
+
test('should render HeaderAccountMenu component', function () {
|
451
|
+
getAccountMenuComponent();
|
452
|
+
var headerAccountMenuElement = screen.getByTestId('header-account-menu');
|
453
|
+
expect(headerAccountMenuElement).toBeInTheDocument();
|
454
|
+
});
|
455
|
+
test('should render HeaderAccountMenu component with user data', function () {
|
456
|
+
var _context2;
|
457
|
+
getAccountMenuComponent({
|
458
|
+
userData: userData
|
459
|
+
});
|
460
|
+
var headerAccountMenuElement = screen.getByTestId('user-dropdown-button');
|
461
|
+
userEvent.click(headerAccountMenuElement);
|
462
|
+
expect(screen.getByText(_concatInstanceProperty(_context2 = "".concat(userData.firstName, " ")).call(_context2, userData.lastName))).toBeInTheDocument();
|
463
|
+
expect(screen.getByText(userData.email)).toBeInTheDocument();
|
464
|
+
});
|
465
|
+
test('should render empty HeaderAccountMenu component when userdata is empty', function () {
|
466
|
+
getAccountMenuComponent();
|
467
|
+
expect(screen.getByText('BJ')).toBeInTheDocument();
|
468
|
+
});
|
package/lib/index.js
CHANGED
@@ -18,6 +18,8 @@ export { default as ResponseAttachment } from './components/AIComponents/Respons
|
|
18
18
|
export { default as ResponseList } from './components/AIComponents/Response/ResponseList';
|
19
19
|
export { default as ResponseText } from './components/AIComponents/Response/ResponseText';
|
20
20
|
export { default as ResponseToolbar } from './components/AIComponents/Response/ResponseToolbar';
|
21
|
+
export { default } from './components/AIComponents/Suggestions';
|
22
|
+
export { default as Suggestion } from './components/AIComponents/Suggestions/Suggestion';
|
21
23
|
export { default as ArrayField } from './components/ArrayField';
|
22
24
|
export * from './components/ArrayField';
|
23
25
|
export { default as AstroWrapper } from './components/AstroProvider';
|
@@ -98,7 +98,8 @@ var overrides = {
|
|
98
98
|
var background = {
|
99
99
|
base: 'white',
|
100
100
|
secondary: nextGenColors['gray-100'],
|
101
|
-
card: nextGenColors['blue-100']
|
101
|
+
card: nextGenColors['blue-100'],
|
102
|
+
suggestion: '#ecf0f5'
|
102
103
|
};
|
103
104
|
var card = {
|
104
105
|
blue: nextGenColors['blue-100'],
|
@@ -9,5 +9,5 @@ export var componentSpecificNextGenBlacklist = {
|
|
9
9
|
TextField: ['Success'],
|
10
10
|
OverlayPanel: ['Expandable']
|
11
11
|
};
|
12
|
-
export var nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response'];
|
12
|
+
export var nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response', 'Suggestions'];
|
13
13
|
export default nextGenConvertedComponents;
|
@@ -49,10 +49,36 @@ var activeCard = _objectSpread(_objectSpread({}, interactive), {}, {
|
|
49
49
|
bg: 'default'
|
50
50
|
}
|
51
51
|
});
|
52
|
+
var baseSuggestion = {
|
53
|
+
backgroundColor: 'light',
|
54
|
+
borderRadius: '4px',
|
55
|
+
p: 'md',
|
56
|
+
'&.is-hovered': {
|
57
|
+
cursor: 'pointer',
|
58
|
+
backgroundColor: 'background.suggestion'
|
59
|
+
},
|
60
|
+
gap: 'md',
|
61
|
+
flexGrow: 1,
|
62
|
+
transition: 'all .2s ease',
|
63
|
+
'&.is-focused': {
|
64
|
+
outline: '2px solid',
|
65
|
+
outlineColor: 'focus',
|
66
|
+
outlineOffset: '0px',
|
67
|
+
backgroundColor: 'background.suggestion'
|
68
|
+
}
|
69
|
+
};
|
70
|
+
var suggestionRow = _objectSpread(_objectSpread({}, baseSuggestion), {}, {
|
71
|
+
display: 'flex'
|
72
|
+
});
|
73
|
+
var suggestionColumn = _objectSpread(_objectSpread({}, baseSuggestion), {}, {
|
74
|
+
display: 'flex'
|
75
|
+
});
|
52
76
|
export default {
|
53
77
|
interactive: interactive,
|
54
78
|
dark: dark,
|
55
79
|
light: light,
|
56
80
|
activeCard: activeCard,
|
57
|
-
container: container
|
81
|
+
container: container,
|
82
|
+
suggestionColumn: suggestionColumn,
|
83
|
+
suggestionRow: suggestionRow
|
58
84
|
};
|
@@ -19,6 +19,8 @@ import { message } from './messages';
|
|
19
19
|
import { navBar } from './navbar';
|
20
20
|
import prompt from './prompt';
|
21
21
|
import response from './response';
|
22
|
+
import suggestion from './suggestion';
|
23
|
+
import suggestions from './suggestions';
|
22
24
|
import { menuTab, tab, tabs } from './tabs';
|
23
25
|
var fieldHelperText = {
|
24
26
|
title: {
|
@@ -319,5 +321,7 @@ export default {
|
|
319
321
|
menu: menu,
|
320
322
|
iconWrapper: iconWrapper,
|
321
323
|
overlayPanel: overlayPanel,
|
324
|
+
suggestions: suggestions,
|
325
|
+
suggestion: suggestion,
|
322
326
|
response: response
|
323
327
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|