@pingux/astro 2.95.0 → 2.96.0-alpha.1
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/EditButton/EditButton.stories.js +7 -0
- package/lib/cjs/components/IconButton/IconButton.stories.d.ts +37 -4
- package/lib/cjs/components/IconButton/IconButton.stories.js +45 -2
- package/lib/cjs/components/IconButton/IconButton.styles.d.ts +14 -0
- package/lib/cjs/components/IconButton/IconButton.styles.js +6 -3
- package/lib/cjs/components/PasswordField/PasswordField.d.ts +4 -0
- package/lib/cjs/components/PasswordField/PasswordField.js +17 -97
- package/lib/cjs/components/PasswordField/PasswordField.stories.d.ts +17 -0
- package/lib/cjs/components/PasswordField/PasswordField.stories.js +12 -0
- package/lib/cjs/components/PasswordField/PasswordField.test.d.ts +1 -0
- package/lib/cjs/components/PasswordField/PasswordField.test.js +88 -43
- package/lib/cjs/components/PasswordField/index.d.ts +1 -0
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +29 -18
- package/lib/cjs/types/passwordField.d.ts +69 -0
- package/lib/cjs/types/passwordField.js +6 -0
- package/lib/cjs/types/requirementsList.d.ts +2 -1
- package/lib/cjs/utils/designUtils/figmaLinks.d.ts +8 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +9 -1
- package/lib/components/EditButton/EditButton.stories.js +7 -0
- package/lib/components/IconButton/IconButton.stories.js +42 -0
- package/lib/components/IconButton/IconButton.styles.js +6 -3
- package/lib/components/PasswordField/PasswordField.js +20 -100
- package/lib/components/PasswordField/PasswordField.stories.js +12 -0
- package/lib/components/PasswordField/PasswordField.test.js +66 -21
- package/lib/types/index.js +1 -0
- package/lib/types/passwordField.js +1 -0
- package/lib/utils/designUtils/figmaLinks.js +9 -1
- package/package.json +1 -1
@@ -16,12 +16,12 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
17
17
|
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
18
18
|
var _react2 = require("@emotion/react");
|
19
|
-
var _react3 = require("@testing-library/react");
|
20
19
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
20
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
21
21
|
var _testWrapper = require("../../utils/testUtils/testWrapper");
|
22
22
|
var _universalComponentTest = require("../../utils/testUtils/universalComponentTest");
|
23
23
|
var _ = _interopRequireDefault(require("."));
|
24
|
-
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 _context5; _forEachInstanceProperty(_context5 = ["next", "throw", "return"]).call(_context5, 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 _context6; 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(_context6 = this.tryEntries).call(_context6, 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; } // Emotion Cache added as test fails otherwise, root cause of this failure is unknown.
|
24
|
+
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 _context6; _forEachInstanceProperty(_context6 = ["next", "throw", "return"]).call(_context6, 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 _context7; 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(_context7 = this.tryEntries).call(_context7, 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; } // Emotion Cache added as test fails otherwise, root cause of this failure is unknown.
|
25
25
|
// Failure occured with ThemeUI refactor.
|
26
26
|
// https://github.com/emotion-js/emotion/issues/1105#issuecomment-557726922
|
27
27
|
var emotionCache = (0, _cache["default"])({
|
@@ -34,45 +34,45 @@ var helperProp = 'helperText';
|
|
34
34
|
var defaultProps = {
|
35
35
|
'data-testid': testId,
|
36
36
|
label: testLabel,
|
37
|
-
|
37
|
+
helperText: helperProp,
|
38
38
|
viewHiddenIconTestId: 'view-hidden-test-id',
|
39
39
|
viewIconTestId: 'view-icon-test-id'
|
40
40
|
};
|
41
41
|
var defaultRequirements = [{
|
42
42
|
name: '6 characters',
|
43
|
-
status:
|
43
|
+
status: _statuses["default"].DEFAULT
|
44
44
|
}, {
|
45
45
|
name: '1 UPPERCASE letter',
|
46
|
-
status:
|
46
|
+
status: _statuses["default"].DEFAULT
|
47
47
|
}, {
|
48
48
|
name: '1 lowercase letter',
|
49
|
-
status:
|
49
|
+
status: _statuses["default"].DEFAULT
|
50
50
|
}, {
|
51
51
|
name: '1 number',
|
52
|
-
status:
|
52
|
+
status: _statuses["default"].DEFAULT
|
53
53
|
}, {
|
54
54
|
name: '1 special character',
|
55
|
-
status:
|
55
|
+
status: _statuses["default"].DEFAULT
|
56
56
|
}];
|
57
|
-
var
|
57
|
+
var successfulRequirements = [{
|
58
58
|
name: '6 characters',
|
59
|
-
status:
|
59
|
+
status: _statuses["default"].SUCCESS
|
60
60
|
}, {
|
61
61
|
name: '1 UPPERCASE letter',
|
62
|
-
status:
|
62
|
+
status: _statuses["default"].SUCCESS
|
63
63
|
}, {
|
64
64
|
name: '1 lowercase letter',
|
65
|
-
status:
|
65
|
+
status: _statuses["default"].SUCCESS
|
66
66
|
}, {
|
67
67
|
name: '1 number',
|
68
|
-
status:
|
68
|
+
status: _statuses["default"].SUCCESS
|
69
69
|
}, {
|
70
70
|
name: '1 special character',
|
71
|
-
status:
|
71
|
+
status: _statuses["default"].SUCCESS
|
72
72
|
}];
|
73
73
|
var getComponent = function getComponent() {
|
74
74
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
75
|
-
return (0,
|
75
|
+
return (0, _testWrapper.render)((0, _react2.jsx)(_react2.CacheProvider, {
|
76
76
|
value: emotionCache
|
77
77
|
}, (0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props))));
|
78
78
|
};
|
@@ -88,9 +88,9 @@ afterEach(function () {
|
|
88
88
|
});
|
89
89
|
test('default password field', function () {
|
90
90
|
getComponent();
|
91
|
-
var field =
|
92
|
-
var label =
|
93
|
-
var control =
|
91
|
+
var field = _testWrapper.screen.getByTestId(testId);
|
92
|
+
var label = _testWrapper.screen.getByText(testLabel);
|
93
|
+
var control = _testWrapper.screen.getByLabelText(testLabel);
|
94
94
|
expect(field).toBeInstanceOf(HTMLDivElement);
|
95
95
|
expect(label).toBeInstanceOf(HTMLLabelElement);
|
96
96
|
expect(control).toBeInstanceOf(HTMLInputElement);
|
@@ -104,7 +104,7 @@ test('renders view icon', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__
|
|
104
104
|
while (1) switch (_context.prev = _context.next) {
|
105
105
|
case 0:
|
106
106
|
getComponent();
|
107
|
-
viewIcon =
|
107
|
+
viewIcon = _testWrapper.screen.getByTestId(defaultProps.viewHiddenIconTestId);
|
108
108
|
expect(viewIcon).toBeInTheDocument();
|
109
109
|
case 3:
|
110
110
|
case "end":
|
@@ -118,12 +118,12 @@ test('renders view-hidden icon', /*#__PURE__*/(0, _asyncToGenerator2["default"])
|
|
118
118
|
while (1) switch (_context2.prev = _context2.next) {
|
119
119
|
case 0:
|
120
120
|
getComponent();
|
121
|
-
button =
|
121
|
+
button = _testWrapper.screen.getByRole('button');
|
122
122
|
_userEvent["default"].click(button);
|
123
|
-
viewHiddenIcon =
|
123
|
+
viewHiddenIcon = _testWrapper.screen.getByTestId(defaultProps.viewIconTestId);
|
124
124
|
expect(viewHiddenIcon).toBeInTheDocument();
|
125
125
|
_userEvent["default"].click(button);
|
126
|
-
viewIcon =
|
126
|
+
viewIcon = _testWrapper.screen.getByTestId(defaultProps.viewHiddenIconTestId);
|
127
127
|
expect(viewIcon).toBeInTheDocument();
|
128
128
|
case 8:
|
129
129
|
case "end":
|
@@ -137,9 +137,9 @@ test('renders view icon', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__
|
|
137
137
|
while (1) switch (_context3.prev = _context3.next) {
|
138
138
|
case 0:
|
139
139
|
getComponent();
|
140
|
-
button =
|
140
|
+
button = _testWrapper.screen.getByRole('button');
|
141
141
|
_userEvent["default"].click(button);
|
142
|
-
viewHiddenIcon =
|
142
|
+
viewHiddenIcon = _testWrapper.screen.getByTestId(defaultProps.viewIconTestId);
|
143
143
|
expect(viewHiddenIcon).toBeInTheDocument();
|
144
144
|
case 5:
|
145
145
|
case "end":
|
@@ -156,7 +156,7 @@ test('onPress callback is called when iconButton is pressed', /*#__PURE__*/(0, _
|
|
156
156
|
getComponent({
|
157
157
|
onVisibleChange: onPress
|
158
158
|
});
|
159
|
-
button =
|
159
|
+
button = _testWrapper.screen.getByRole('button');
|
160
160
|
_userEvent["default"].click(button);
|
161
161
|
expect(onPress).toHaveBeenCalled();
|
162
162
|
case 5:
|
@@ -167,37 +167,37 @@ test('onPress callback is called when iconButton is pressed', /*#__PURE__*/(0, _
|
|
167
167
|
})));
|
168
168
|
test('renders password input', function () {
|
169
169
|
getComponent();
|
170
|
-
var input =
|
170
|
+
var input = _testWrapper.screen.getByLabelText(testLabel);
|
171
171
|
expect(input.type).toBe('password');
|
172
172
|
});
|
173
173
|
test('renders helper text', function () {
|
174
174
|
getComponent();
|
175
|
-
var helperText =
|
175
|
+
var helperText = _testWrapper.screen.getByText(testLabel);
|
176
176
|
expect(helperText).toBeInTheDocument();
|
177
177
|
});
|
178
178
|
test('clicking icon changes input type', function () {
|
179
179
|
getComponent({
|
180
180
|
isVisible: true
|
181
181
|
});
|
182
|
-
var input =
|
182
|
+
var input = _testWrapper.screen.getByLabelText(testLabel);
|
183
183
|
expect(input.type).toBe('text');
|
184
184
|
});
|
185
185
|
test('passing in requirements and focusing renders the requirements popover', function () {
|
186
186
|
getComponent({
|
187
187
|
requirements: defaultRequirements
|
188
188
|
});
|
189
|
-
var input =
|
189
|
+
var input = _testWrapper.screen.getByRole('textbox');
|
190
190
|
_userEvent["default"].click(input);
|
191
|
-
var popover =
|
191
|
+
var popover = _testWrapper.screen.getByRole('presentation');
|
192
192
|
expect(popover).toBeInTheDocument();
|
193
193
|
});
|
194
194
|
test('if all requirements are successful, do not render popover', function () {
|
195
195
|
getComponent({
|
196
|
-
requirements:
|
196
|
+
requirements: successfulRequirements
|
197
197
|
});
|
198
|
-
var input =
|
198
|
+
var input = _testWrapper.screen.getByRole('textbox');
|
199
199
|
_userEvent["default"].click(input);
|
200
|
-
expect(
|
200
|
+
expect(_testWrapper.screen.queryByRole('presentation')).not.toBeInTheDocument();
|
201
201
|
});
|
202
202
|
test('passing in props to the requirements list works', function () {
|
203
203
|
var requirementsListProps = {
|
@@ -207,32 +207,77 @@ test('passing in props to the requirements list works', function () {
|
|
207
207
|
requirements: defaultRequirements,
|
208
208
|
requirementsListProps: requirementsListProps
|
209
209
|
});
|
210
|
-
expect(
|
211
|
-
_userEvent["default"].click(
|
212
|
-
expect(
|
210
|
+
expect(_testWrapper.screen.queryByTestId(requirementsListProps['data-testid'])).not.toBeInTheDocument();
|
211
|
+
_userEvent["default"].click(_testWrapper.screen.getByRole('textbox'));
|
212
|
+
expect(_testWrapper.screen.queryByTestId(requirementsListProps['data-testid'])).toBeInTheDocument();
|
213
213
|
});
|
214
214
|
test('password field with helper text', function () {
|
215
215
|
var helperText = 'helper text';
|
216
216
|
getComponent({
|
217
217
|
helperText: helperText
|
218
218
|
});
|
219
|
-
var helper =
|
219
|
+
var helper = _testWrapper.screen.getByText(helperText);
|
220
220
|
expect(helper).toBeInTheDocument();
|
221
221
|
});
|
222
222
|
test('onChange function receives right text', function () {
|
223
223
|
var inputText = '';
|
224
|
-
(0, _testWrapper.act)(function () {
|
225
|
-
global.setTimeout = jest.fn(function (cb) {
|
226
|
-
return cb();
|
227
|
-
});
|
228
|
-
});
|
229
224
|
var testOnChange = function testOnChange(e) {
|
230
225
|
inputText = e.target.value;
|
231
226
|
};
|
232
227
|
getComponent({
|
233
228
|
onChange: testOnChange
|
234
229
|
});
|
235
|
-
var input =
|
230
|
+
var input = _testWrapper.screen.getByRole('textbox');
|
236
231
|
_userEvent["default"].type(input, '12345678');
|
232
|
+
jest.useFakeTimers();
|
237
233
|
expect(inputText).toBe('12345678');
|
234
|
+
});
|
235
|
+
test('renders left slot content', function () {
|
236
|
+
var leftSlotContent = (0, _react2.jsx)("div", {
|
237
|
+
"data-testid": "in-container-slot"
|
238
|
+
}, "Slot Content");
|
239
|
+
getComponent({
|
240
|
+
slots: {
|
241
|
+
inContainer: leftSlotContent
|
242
|
+
}
|
243
|
+
});
|
244
|
+
var leftSlot = _testWrapper.screen.getByTestId('in-container-slot');
|
245
|
+
expect(leftSlot).toBeInTheDocument();
|
246
|
+
expect(leftSlot).toHaveTextContent('Slot Content');
|
247
|
+
});
|
248
|
+
test('handleInputChange sets isTyping to true and then false after 300ms', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
249
|
+
var delay, input;
|
250
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
251
|
+
while (1) switch (_context5.prev = _context5.next) {
|
252
|
+
case 0:
|
253
|
+
delay = 300;
|
254
|
+
jest.useFakeTimers();
|
255
|
+
getComponent();
|
256
|
+
input = _testWrapper.screen.getByRole('textbox');
|
257
|
+
_userEvent["default"].type(input, 'test');
|
258
|
+
expect(input).toHaveValue('test');
|
259
|
+
expect(input.type).toBe('password');
|
260
|
+
(0, _testWrapper.act)(function () {
|
261
|
+
jest.advanceTimersByTime(delay);
|
262
|
+
});
|
263
|
+
_context5.next = 10;
|
264
|
+
return (0, _testWrapper.act)(function () {
|
265
|
+
expect(input).toHaveValue('test');
|
266
|
+
}, {
|
267
|
+
timeout: delay + 1
|
268
|
+
});
|
269
|
+
case 10:
|
270
|
+
case "end":
|
271
|
+
return _context5.stop();
|
272
|
+
}
|
273
|
+
}, _callee5);
|
274
|
+
})));
|
275
|
+
test('handleInputChange calls onChange prop', function () {
|
276
|
+
var onChange = jest.fn();
|
277
|
+
getComponent({
|
278
|
+
onChange: onChange
|
279
|
+
});
|
280
|
+
var input = _testWrapper.screen.getByRole('textbox');
|
281
|
+
_userEvent["default"].type(input, 'test');
|
282
|
+
expect(onChange).toHaveBeenCalled();
|
238
283
|
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './PasswordField';
|
package/lib/cjs/types/index.d.ts
CHANGED
@@ -36,6 +36,7 @@ export * from './Modal';
|
|
36
36
|
export * from './navBar';
|
37
37
|
export * from './navSideBar';
|
38
38
|
export * from './overlayPanel';
|
39
|
+
export * from './passwordField';
|
39
40
|
export * from './popoverContainer';
|
40
41
|
export * from './popoverMenu';
|
41
42
|
export * from './progressBar';
|
package/lib/cjs/types/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32, _context33, _context34, _context35, _context36, _context37, _context38, _context39, _context40, _context41, _context42, _context43, _context44, _context45, _context46, _context47, _context48, _context49, _context50, _context51, _context52, _context53, _context54, _context55;
|
3
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32, _context33, _context34, _context35, _context36, _context37, _context38, _context39, _context40, _context41, _context42, _context43, _context44, _context45, _context46, _context47, _context48, _context49, _context50, _context51, _context52, _context53, _context54, _context55, _context56;
|
4
4
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
5
5
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
6
6
|
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
@@ -425,8 +425,19 @@ _forEachInstanceProperty(_context38 = _Object$keys(_overlayPanel)).call(_context
|
|
425
425
|
}
|
426
426
|
});
|
427
427
|
});
|
428
|
+
var _passwordField = require("./passwordField");
|
429
|
+
_forEachInstanceProperty(_context39 = _Object$keys(_passwordField)).call(_context39, function (key) {
|
430
|
+
if (key === "default" || key === "__esModule") return;
|
431
|
+
if (key in exports && exports[key] === _passwordField[key]) return;
|
432
|
+
_Object$defineProperty(exports, key, {
|
433
|
+
enumerable: true,
|
434
|
+
get: function get() {
|
435
|
+
return _passwordField[key];
|
436
|
+
}
|
437
|
+
});
|
438
|
+
});
|
428
439
|
var _popoverContainer = require("./popoverContainer");
|
429
|
-
_forEachInstanceProperty(
|
440
|
+
_forEachInstanceProperty(_context40 = _Object$keys(_popoverContainer)).call(_context40, function (key) {
|
430
441
|
if (key === "default" || key === "__esModule") return;
|
431
442
|
if (key in exports && exports[key] === _popoverContainer[key]) return;
|
432
443
|
_Object$defineProperty(exports, key, {
|
@@ -437,7 +448,7 @@ _forEachInstanceProperty(_context39 = _Object$keys(_popoverContainer)).call(_con
|
|
437
448
|
});
|
438
449
|
});
|
439
450
|
var _popoverMenu = require("./popoverMenu");
|
440
|
-
_forEachInstanceProperty(
|
451
|
+
_forEachInstanceProperty(_context41 = _Object$keys(_popoverMenu)).call(_context41, function (key) {
|
441
452
|
if (key === "default" || key === "__esModule") return;
|
442
453
|
if (key in exports && exports[key] === _popoverMenu[key]) return;
|
443
454
|
_Object$defineProperty(exports, key, {
|
@@ -448,7 +459,7 @@ _forEachInstanceProperty(_context40 = _Object$keys(_popoverMenu)).call(_context4
|
|
448
459
|
});
|
449
460
|
});
|
450
461
|
var _progressBar = require("./progressBar");
|
451
|
-
_forEachInstanceProperty(
|
462
|
+
_forEachInstanceProperty(_context42 = _Object$keys(_progressBar)).call(_context42, function (key) {
|
452
463
|
if (key === "default" || key === "__esModule") return;
|
453
464
|
if (key in exports && exports[key] === _progressBar[key]) return;
|
454
465
|
_Object$defineProperty(exports, key, {
|
@@ -459,7 +470,7 @@ _forEachInstanceProperty(_context41 = _Object$keys(_progressBar)).call(_context4
|
|
459
470
|
});
|
460
471
|
});
|
461
472
|
var _requirementsList = require("./requirementsList");
|
462
|
-
_forEachInstanceProperty(
|
473
|
+
_forEachInstanceProperty(_context43 = _Object$keys(_requirementsList)).call(_context43, function (key) {
|
463
474
|
if (key === "default" || key === "__esModule") return;
|
464
475
|
if (key in exports && exports[key] === _requirementsList[key]) return;
|
465
476
|
_Object$defineProperty(exports, key, {
|
@@ -470,7 +481,7 @@ _forEachInstanceProperty(_context42 = _Object$keys(_requirementsList)).call(_con
|
|
470
481
|
});
|
471
482
|
});
|
472
483
|
var _rockerButtonGroup = require("./rockerButtonGroup");
|
473
|
-
_forEachInstanceProperty(
|
484
|
+
_forEachInstanceProperty(_context44 = _Object$keys(_rockerButtonGroup)).call(_context44, function (key) {
|
474
485
|
if (key === "default" || key === "__esModule") return;
|
475
486
|
if (key in exports && exports[key] === _rockerButtonGroup[key]) return;
|
476
487
|
_Object$defineProperty(exports, key, {
|
@@ -481,7 +492,7 @@ _forEachInstanceProperty(_context43 = _Object$keys(_rockerButtonGroup)).call(_co
|
|
481
492
|
});
|
482
493
|
});
|
483
494
|
var _scrollBox = require("./scrollBox");
|
484
|
-
_forEachInstanceProperty(
|
495
|
+
_forEachInstanceProperty(_context45 = _Object$keys(_scrollBox)).call(_context45, function (key) {
|
485
496
|
if (key === "default" || key === "__esModule") return;
|
486
497
|
if (key in exports && exports[key] === _scrollBox[key]) return;
|
487
498
|
_Object$defineProperty(exports, key, {
|
@@ -492,7 +503,7 @@ _forEachInstanceProperty(_context44 = _Object$keys(_scrollBox)).call(_context44,
|
|
492
503
|
});
|
493
504
|
});
|
494
505
|
var _searchField = require("./searchField");
|
495
|
-
_forEachInstanceProperty(
|
506
|
+
_forEachInstanceProperty(_context46 = _Object$keys(_searchField)).call(_context46, function (key) {
|
496
507
|
if (key === "default" || key === "__esModule") return;
|
497
508
|
if (key in exports && exports[key] === _searchField[key]) return;
|
498
509
|
_Object$defineProperty(exports, key, {
|
@@ -503,7 +514,7 @@ _forEachInstanceProperty(_context45 = _Object$keys(_searchField)).call(_context4
|
|
503
514
|
});
|
504
515
|
});
|
505
516
|
var _separator = require("./separator");
|
506
|
-
_forEachInstanceProperty(
|
517
|
+
_forEachInstanceProperty(_context47 = _Object$keys(_separator)).call(_context47, function (key) {
|
507
518
|
if (key === "default" || key === "__esModule") return;
|
508
519
|
if (key in exports && exports[key] === _separator[key]) return;
|
509
520
|
_Object$defineProperty(exports, key, {
|
@@ -514,7 +525,7 @@ _forEachInstanceProperty(_context46 = _Object$keys(_separator)).call(_context46,
|
|
514
525
|
});
|
515
526
|
});
|
516
527
|
var _shared = require("./shared");
|
517
|
-
_forEachInstanceProperty(
|
528
|
+
_forEachInstanceProperty(_context48 = _Object$keys(_shared)).call(_context48, function (key) {
|
518
529
|
if (key === "default" || key === "__esModule") return;
|
519
530
|
if (key in exports && exports[key] === _shared[key]) return;
|
520
531
|
_Object$defineProperty(exports, key, {
|
@@ -525,7 +536,7 @@ _forEachInstanceProperty(_context47 = _Object$keys(_shared)).call(_context47, fu
|
|
525
536
|
});
|
526
537
|
});
|
527
538
|
var _switchField = require("./switchField");
|
528
|
-
_forEachInstanceProperty(
|
539
|
+
_forEachInstanceProperty(_context49 = _Object$keys(_switchField)).call(_context49, function (key) {
|
529
540
|
if (key === "default" || key === "__esModule") return;
|
530
541
|
if (key in exports && exports[key] === _switchField[key]) return;
|
531
542
|
_Object$defineProperty(exports, key, {
|
@@ -536,7 +547,7 @@ _forEachInstanceProperty(_context48 = _Object$keys(_switchField)).call(_context4
|
|
536
547
|
});
|
537
548
|
});
|
538
549
|
var _tab = require("./tab");
|
539
|
-
_forEachInstanceProperty(
|
550
|
+
_forEachInstanceProperty(_context50 = _Object$keys(_tab)).call(_context50, function (key) {
|
540
551
|
if (key === "default" || key === "__esModule") return;
|
541
552
|
if (key in exports && exports[key] === _tab[key]) return;
|
542
553
|
_Object$defineProperty(exports, key, {
|
@@ -547,7 +558,7 @@ _forEachInstanceProperty(_context49 = _Object$keys(_tab)).call(_context49, funct
|
|
547
558
|
});
|
548
559
|
});
|
549
560
|
var _table = require("./table");
|
550
|
-
_forEachInstanceProperty(
|
561
|
+
_forEachInstanceProperty(_context51 = _Object$keys(_table)).call(_context51, function (key) {
|
551
562
|
if (key === "default" || key === "__esModule") return;
|
552
563
|
if (key in exports && exports[key] === _table[key]) return;
|
553
564
|
_Object$defineProperty(exports, key, {
|
@@ -558,7 +569,7 @@ _forEachInstanceProperty(_context50 = _Object$keys(_table)).call(_context50, fun
|
|
558
569
|
});
|
559
570
|
});
|
560
571
|
var _tabs = require("./tabs");
|
561
|
-
_forEachInstanceProperty(
|
572
|
+
_forEachInstanceProperty(_context52 = _Object$keys(_tabs)).call(_context52, function (key) {
|
562
573
|
if (key === "default" || key === "__esModule") return;
|
563
574
|
if (key in exports && exports[key] === _tabs[key]) return;
|
564
575
|
_Object$defineProperty(exports, key, {
|
@@ -569,7 +580,7 @@ _forEachInstanceProperty(_context51 = _Object$keys(_tabs)).call(_context51, func
|
|
569
580
|
});
|
570
581
|
});
|
571
582
|
var _text = require("./text");
|
572
|
-
_forEachInstanceProperty(
|
583
|
+
_forEachInstanceProperty(_context53 = _Object$keys(_text)).call(_context53, function (key) {
|
573
584
|
if (key === "default" || key === "__esModule") return;
|
574
585
|
if (key in exports && exports[key] === _text[key]) return;
|
575
586
|
_Object$defineProperty(exports, key, {
|
@@ -580,7 +591,7 @@ _forEachInstanceProperty(_context52 = _Object$keys(_text)).call(_context52, func
|
|
580
591
|
});
|
581
592
|
});
|
582
593
|
var _textField = require("./textField");
|
583
|
-
_forEachInstanceProperty(
|
594
|
+
_forEachInstanceProperty(_context54 = _Object$keys(_textField)).call(_context54, function (key) {
|
584
595
|
if (key === "default" || key === "__esModule") return;
|
585
596
|
if (key in exports && exports[key] === _textField[key]) return;
|
586
597
|
_Object$defineProperty(exports, key, {
|
@@ -591,7 +602,7 @@ _forEachInstanceProperty(_context53 = _Object$keys(_textField)).call(_context53,
|
|
591
602
|
});
|
592
603
|
});
|
593
604
|
var _timefield = require("./timefield");
|
594
|
-
_forEachInstanceProperty(
|
605
|
+
_forEachInstanceProperty(_context55 = _Object$keys(_timefield)).call(_context55, function (key) {
|
595
606
|
if (key === "default" || key === "__esModule") return;
|
596
607
|
if (key in exports && exports[key] === _timefield[key]) return;
|
597
608
|
_Object$defineProperty(exports, key, {
|
@@ -602,7 +613,7 @@ _forEachInstanceProperty(_context54 = _Object$keys(_timefield)).call(_context54,
|
|
602
613
|
});
|
603
614
|
});
|
604
615
|
var _tooltipTrigger = require("./tooltipTrigger");
|
605
|
-
_forEachInstanceProperty(
|
616
|
+
_forEachInstanceProperty(_context56 = _Object$keys(_tooltipTrigger)).call(_context56, function (key) {
|
606
617
|
if (key === "default" || key === "__esModule") return;
|
607
618
|
if (key in exports && exports[key] === _tooltipTrigger[key]) return;
|
608
619
|
_Object$defineProperty(exports, key, {
|
@@ -0,0 +1,69 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { UseFieldProps } from '../hooks/useField/useField';
|
3
|
+
import { TestingAttributes } from './shared/test';
|
4
|
+
import { Status } from './item';
|
5
|
+
import { Requirement, RequirementsListProps } from '.';
|
6
|
+
export interface PasswordFieldProps extends UseFieldProps<HTMLInputElement>, TestingAttributes {
|
7
|
+
/** The rendered label for the field. */
|
8
|
+
label?: string | React.ReactNode;
|
9
|
+
/** Whether or not the password is visible. */
|
10
|
+
isVisible?: boolean;
|
11
|
+
/** Function that is passed into the IconButton within this component. */
|
12
|
+
onVisibleChange?: (isVisible: boolean, args: unknown) => void;
|
13
|
+
/** The unique identifier for the input element. */
|
14
|
+
id?: string;
|
15
|
+
/** The name for the input element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname). */
|
16
|
+
name?: string;
|
17
|
+
/**
|
18
|
+
* Callback fired when the value is changed on the input element.
|
19
|
+
*
|
20
|
+
* @param {object} event The event source of the callback.
|
21
|
+
* You can pull out the new value by accessing `event.target.value` (string).
|
22
|
+
*/
|
23
|
+
onChange?: (e: React.ChangeEvent) => void;
|
24
|
+
/** The value for the input element (controlled). */
|
25
|
+
value?: string;
|
26
|
+
/** How the input should handle autocompletion according to the browser. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete). The `autocomplete` prop is an alias for this. */
|
27
|
+
autoComplete?: string;
|
28
|
+
/** @ignore Alias for `autoComplete` prop. Exists for backwards-compatibility. */
|
29
|
+
autocomplete?: string;
|
30
|
+
/** The default value for the input element. */
|
31
|
+
defaultValue?: string;
|
32
|
+
/** Whether the input element is automatically focused when loaded onto the page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus). */
|
33
|
+
hasAutoFocus?: boolean;
|
34
|
+
/** Whether the field is disabled. */
|
35
|
+
isDisabled?: boolean;
|
36
|
+
/** Whether the input can be selected, but not changed by the user. */
|
37
|
+
isReadOnly?: boolean;
|
38
|
+
/** Whether the field is required. */
|
39
|
+
isRequired?: boolean;
|
40
|
+
/**
|
41
|
+
* Callback fired when focus is lost on the input element.
|
42
|
+
*/
|
43
|
+
onBlur?: () => void;
|
44
|
+
/**
|
45
|
+
* Callback fired when focus is lost on the input element.
|
46
|
+
*/
|
47
|
+
onFocus?: () => void;
|
48
|
+
/** The placeholder text to display in the input element. */
|
49
|
+
placeholder?: string;
|
50
|
+
/** Provides a way to insert markup in specified places. */
|
51
|
+
slots?: {
|
52
|
+
/** The given node will be inserted into the field container. */
|
53
|
+
inContainer: React.ReactNode;
|
54
|
+
};
|
55
|
+
/** Determines the type of input to use. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype). */
|
56
|
+
type?: string;
|
57
|
+
/** @ignore Prop that allows testing of the icon button. */
|
58
|
+
viewHiddenIconTestId?: string;
|
59
|
+
/** @ignore Prop that allows testing of the icon button. */
|
60
|
+
viewIconTestId?: string;
|
61
|
+
/** Array of Requirements and their status. */
|
62
|
+
requirements?: Requirement[];
|
63
|
+
/** Props object that is spread to the requirements list. */
|
64
|
+
requirementsListProps?: RequirementsListProps;
|
65
|
+
status?: Status;
|
66
|
+
}
|
67
|
+
export interface RequirementMessageProps {
|
68
|
+
requirement: Requirement;
|
69
|
+
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { TestingAttributes } from './shared/test';
|
1
2
|
import { BoxProps } from './box';
|
2
3
|
import { Status } from './item';
|
3
4
|
export interface Requirement {
|
@@ -5,7 +6,7 @@ export interface Requirement {
|
|
5
6
|
status?: Status;
|
6
7
|
}
|
7
8
|
export type Requirements = Array<Requirement>;
|
8
|
-
export interface RequirementsListProps extends BoxProps {
|
9
|
+
export interface RequirementsListProps extends BoxProps, TestingAttributes {
|
9
10
|
/** Requirements and their status. */
|
10
11
|
requirements?: Requirements;
|
11
12
|
label?: string;
|
@@ -94,6 +94,11 @@ export declare const FIGMA_LINKS: {
|
|
94
94
|
};
|
95
95
|
iconButton: {
|
96
96
|
default: string;
|
97
|
+
inverted: string;
|
98
|
+
withTooltip: string;
|
99
|
+
disabled: string;
|
100
|
+
sizes: string;
|
101
|
+
commonlyUsed: string;
|
97
102
|
};
|
98
103
|
inlineEditing: {
|
99
104
|
default: string;
|
@@ -176,4 +181,7 @@ export declare const FIGMA_LINKS: {
|
|
176
181
|
withoutButton: string;
|
177
182
|
withoutLink: string;
|
178
183
|
};
|
184
|
+
editButton: {
|
185
|
+
default: string;
|
186
|
+
};
|
179
187
|
};
|
@@ -100,7 +100,12 @@ var FIGMA_LINKS = {
|
|
100
100
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=17916-38366&t=rLZVlRDdR1JhehkH-0'
|
101
101
|
},
|
102
102
|
iconButton: {
|
103
|
-
"default": 'https://www.figma.com/file/
|
103
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=45365-7042&t=pXTSE3YlGbL0X49N-4',
|
104
|
+
inverted: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58623-6228&t=pXTSE3YlGbL0X49N-4',
|
105
|
+
withTooltip: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58623-6053&t=pXTSE3YlGbL0X49N-4',
|
106
|
+
disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58748-5372&t=pXTSE3YlGbL0X49N-4',
|
107
|
+
sizes: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58748-5412&t=pXTSE3YlGbL0X49N-4',
|
108
|
+
commonlyUsed: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58748-6048&t=pXTSE3YlGbL0X49N-4'
|
104
109
|
},
|
105
110
|
inlineEditing: {
|
106
111
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=5244-14864&mode=design&t=1pPbrQvGkdMYBNqk-0'
|
@@ -182,6 +187,9 @@ var FIGMA_LINKS = {
|
|
182
187
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-11051&t=OK8Fy4P3se6BKy0F-4',
|
183
188
|
withoutButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-16196&t=OK8Fy4P3se6BKy0F-4',
|
184
189
|
withoutLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-16201&t=OK8Fy4P3se6BKy0F-4'
|
190
|
+
},
|
191
|
+
editButton: {
|
192
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58623-6267&t=pXTSE3YlGbL0X49N-4'
|
185
193
|
}
|
186
194
|
};
|
187
195
|
exports.FIGMA_LINKS = FIGMA_LINKS;
|