@moda/om 15.7.0 → 15.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts +4 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +7 -0
- package/dist/components/PasswordInput/PasswordInput.stories.d.ts +6 -0
- package/dist/components/PasswordInput/index.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.cjs.js +263 -187
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +105 -28
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -6
- package/src/components/Badge/Badge.scss +3 -3
- package/src/components/Badge/Badge.stories.tsx +3 -3
- package/src/components/Badge/Badge.test.tsx +4 -2
- package/src/components/Badge/Badge.tsx +1 -1
- package/src/components/Divider/Divider.scss +0 -5
- package/src/components/Divider/Divider.test.tsx +3 -3
- package/src/components/Divider/Divider.tsx +31 -5
- package/src/components/PasswordInput/PasswordInput.scss +15 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +11 -0
- package/src/components/PasswordInput/PasswordInput.tsx +37 -0
- package/src/components/PasswordInput/index.ts +1 -0
- package/src/components/index.ts +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -3086,6 +3086,7 @@ FocusLock.defaultProps = {
|
|
|
3086
3086
|
onActivation: undefined,
|
|
3087
3087
|
onDeactivation: undefined
|
|
3088
3088
|
};
|
|
3089
|
+
var FocusLockUI = FocusLock;
|
|
3089
3090
|
|
|
3090
3091
|
function deferAction(action) {
|
|
3091
3092
|
// Hidding setImmediate from Webpack to avoid inserting polyfill
|
|
@@ -3133,7 +3134,7 @@ var FocusOn$1 = /*#__PURE__*/React$2.forwardRef(function (props, parentRef) {
|
|
|
3133
3134
|
onDeactivation = lockProps.onDeactivation,
|
|
3134
3135
|
restProps = __rest$a(lockProps, ["onActivation", "onDeactivation"]);
|
|
3135
3136
|
|
|
3136
|
-
return /*#__PURE__*/React$2.createElement(React$2.Fragment, null, /*#__PURE__*/React$2.createElement(
|
|
3137
|
+
return /*#__PURE__*/React$2.createElement(React$2.Fragment, null, /*#__PURE__*/React$2.createElement(FocusLockUI, {
|
|
3137
3138
|
ref: parentRef,
|
|
3138
3139
|
sideCar: sideCar,
|
|
3139
3140
|
disabled: !(lockProps && enabled && focusLock),
|
|
@@ -3722,6 +3723,8 @@ var setFocus = function setFocus(topNode, lastNode) {
|
|
|
3722
3723
|
}
|
|
3723
3724
|
};
|
|
3724
3725
|
|
|
3726
|
+
var moveFocusInside = setFocus;
|
|
3727
|
+
|
|
3725
3728
|
var focusOnBody = function focusOnBody() {
|
|
3726
3729
|
return document && document.activeElement === document.body;
|
|
3727
3730
|
};
|
|
@@ -3823,7 +3826,7 @@ var activateTrap = function activateTrap() {
|
|
|
3823
3826
|
|
|
3824
3827
|
document.body.focus();
|
|
3825
3828
|
} else {
|
|
3826
|
-
result =
|
|
3829
|
+
result = moveFocusInside(workingArea, lastActiveFocus);
|
|
3827
3830
|
lastPortaledElement = {};
|
|
3828
3831
|
}
|
|
3829
3832
|
}
|
|
@@ -3961,7 +3964,7 @@ mediumFocus.assignSyncMedium(onFocus);
|
|
|
3961
3964
|
mediumBlur.assignMedium(onBlur);
|
|
3962
3965
|
mediumEffect.assignMedium(function (cb) {
|
|
3963
3966
|
return cb({
|
|
3964
|
-
moveFocusInside:
|
|
3967
|
+
moveFocusInside: moveFocusInside,
|
|
3965
3968
|
focusInside: focusInside
|
|
3966
3969
|
});
|
|
3967
3970
|
});
|
|
@@ -4214,7 +4217,8 @@ var handleScroll = function handleScroll(axis, endTarget, event, sourceDelta, no
|
|
|
4214
4217
|
|
|
4215
4218
|
target = target.parentNode;
|
|
4216
4219
|
} while ( // portaled content
|
|
4217
|
-
!targetInLock && target !== document.body ||
|
|
4220
|
+
!targetInLock && target !== document.body || // self content
|
|
4221
|
+
targetInLock && (endTarget.contains(target) || endTarget === target));
|
|
4218
4222
|
|
|
4219
4223
|
if (isDeltaPositive && (noOverscroll && availableScroll === 0 || !noOverscroll && delta > availableScroll)) {
|
|
4220
4224
|
shouldCancelScroll = true;
|
|
@@ -8808,6 +8812,8 @@ var T = function T() {
|
|
|
8808
8812
|
return true;
|
|
8809
8813
|
};
|
|
8810
8814
|
|
|
8815
|
+
var otherwise = T;
|
|
8816
|
+
|
|
8811
8817
|
function _isPlaceholder(a) {
|
|
8812
8818
|
return a != null && _typeof(a) === 'object' && a['@@functional/placeholder'] === true;
|
|
8813
8819
|
}
|
|
@@ -9016,6 +9022,8 @@ var curryN = /*#__PURE__*/_curry2(function curryN(length, fn) {
|
|
|
9016
9022
|
return _arity(length, _curryN(length, [], fn));
|
|
9017
9023
|
});
|
|
9018
9024
|
|
|
9025
|
+
var curryN$1 = curryN;
|
|
9026
|
+
|
|
9019
9027
|
/**
|
|
9020
9028
|
* Optimized internal three-arity curry function.
|
|
9021
9029
|
*
|
|
@@ -9159,6 +9167,8 @@ var max = /*#__PURE__*/_curry2(function max(a, b) {
|
|
|
9159
9167
|
return b > a ? b : a;
|
|
9160
9168
|
});
|
|
9161
9169
|
|
|
9170
|
+
var max$1 = max;
|
|
9171
|
+
|
|
9162
9172
|
function _map(fn, functor) {
|
|
9163
9173
|
var idx = 0;
|
|
9164
9174
|
var len = functor.length;
|
|
@@ -9226,6 +9236,8 @@ var _isArrayLike = /*#__PURE__*/_curry1(function isArrayLike(x) {
|
|
|
9226
9236
|
return false;
|
|
9227
9237
|
});
|
|
9228
9238
|
|
|
9239
|
+
var _isArrayLike$1 = _isArrayLike;
|
|
9240
|
+
|
|
9229
9241
|
var XWrap = /*#__PURE__*/function () {
|
|
9230
9242
|
function XWrap(fn) {
|
|
9231
9243
|
this.f = fn;
|
|
@@ -9279,6 +9291,8 @@ var bind = /*#__PURE__*/_curry2(function bind(fn, thisObj) {
|
|
|
9279
9291
|
});
|
|
9280
9292
|
});
|
|
9281
9293
|
|
|
9294
|
+
var bind$1 = bind;
|
|
9295
|
+
|
|
9282
9296
|
function _arrayReduce(xf, acc, list) {
|
|
9283
9297
|
var idx = 0;
|
|
9284
9298
|
var len = list.length;
|
|
@@ -9315,7 +9329,7 @@ function _iterableReduce(xf, acc, iter) {
|
|
|
9315
9329
|
}
|
|
9316
9330
|
|
|
9317
9331
|
function _methodReduce(xf, acc, obj, methodName) {
|
|
9318
|
-
return xf['@@transducer/result'](obj[methodName](bind(xf['@@transducer/step'], xf), acc));
|
|
9332
|
+
return xf['@@transducer/result'](obj[methodName](bind$1(xf['@@transducer/step'], xf), acc));
|
|
9319
9333
|
}
|
|
9320
9334
|
|
|
9321
9335
|
var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
|
|
@@ -9324,7 +9338,7 @@ function _reduce(fn, acc, list) {
|
|
|
9324
9338
|
fn = _xwrap(fn);
|
|
9325
9339
|
}
|
|
9326
9340
|
|
|
9327
|
-
if (_isArrayLike(list)) {
|
|
9341
|
+
if (_isArrayLike$1(list)) {
|
|
9328
9342
|
return _arrayReduce(fn, acc, list);
|
|
9329
9343
|
}
|
|
9330
9344
|
|
|
@@ -9367,6 +9381,8 @@ var _xmap = /*#__PURE__*/_curry2(function _xmap(f, xf) {
|
|
|
9367
9381
|
return new XMap(f, xf);
|
|
9368
9382
|
});
|
|
9369
9383
|
|
|
9384
|
+
var _xmap$1 = _xmap;
|
|
9385
|
+
|
|
9370
9386
|
function _has(prop, obj) {
|
|
9371
9387
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
9372
9388
|
}
|
|
@@ -9381,6 +9397,8 @@ var _isArguments = /*#__PURE__*/function () {
|
|
|
9381
9397
|
};
|
|
9382
9398
|
}();
|
|
9383
9399
|
|
|
9400
|
+
var _isArguments$1 = _isArguments;
|
|
9401
|
+
|
|
9384
9402
|
var hasEnumBug = ! /*#__PURE__*/{
|
|
9385
9403
|
toString: null
|
|
9386
9404
|
}.propertyIsEnumerable('toString');
|
|
@@ -9434,7 +9452,7 @@ var keys = typeof Object.keys === 'function' && !hasArgsEnumBug ? /*#__PURE__*/_
|
|
|
9434
9452
|
var prop, nIdx;
|
|
9435
9453
|
var ks = [];
|
|
9436
9454
|
|
|
9437
|
-
var checkArgsLength = hasArgsEnumBug && _isArguments(obj);
|
|
9455
|
+
var checkArgsLength = hasArgsEnumBug && _isArguments$1(obj);
|
|
9438
9456
|
|
|
9439
9457
|
for (prop in obj) {
|
|
9440
9458
|
if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {
|
|
@@ -9458,6 +9476,7 @@ var keys = typeof Object.keys === 'function' && !hasArgsEnumBug ? /*#__PURE__*/_
|
|
|
9458
9476
|
|
|
9459
9477
|
return ks;
|
|
9460
9478
|
});
|
|
9479
|
+
var keys$1 = keys;
|
|
9461
9480
|
|
|
9462
9481
|
/**
|
|
9463
9482
|
* Takes a function and
|
|
@@ -9495,10 +9514,10 @@ var keys = typeof Object.keys === 'function' && !hasArgsEnumBug ? /*#__PURE__*/_
|
|
|
9495
9514
|
* @symb R.map(f, functor_o) = functor_o.map(f)
|
|
9496
9515
|
*/
|
|
9497
9516
|
|
|
9498
|
-
var map = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
|
|
9517
|
+
var map = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable(['fantasy-land/map', 'map'], _xmap$1, function map(fn, functor) {
|
|
9499
9518
|
switch (Object.prototype.toString.call(functor)) {
|
|
9500
9519
|
case '[object Function]':
|
|
9501
|
-
return curryN(functor.length, function () {
|
|
9520
|
+
return curryN$1(functor.length, function () {
|
|
9502
9521
|
return fn.call(this, functor.apply(this, arguments));
|
|
9503
9522
|
});
|
|
9504
9523
|
|
|
@@ -9506,13 +9525,15 @@ var map = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable(['fantasy-land/map',
|
|
|
9506
9525
|
return _reduce(function (acc, key) {
|
|
9507
9526
|
acc[key] = fn(functor[key]);
|
|
9508
9527
|
return acc;
|
|
9509
|
-
}, {}, keys(functor));
|
|
9528
|
+
}, {}, keys$1(functor));
|
|
9510
9529
|
|
|
9511
9530
|
default:
|
|
9512
9531
|
return _map(fn, functor);
|
|
9513
9532
|
}
|
|
9514
9533
|
}));
|
|
9515
9534
|
|
|
9535
|
+
var map$1 = map;
|
|
9536
|
+
|
|
9516
9537
|
/**
|
|
9517
9538
|
* Returns a single item by iterating through the list, successively calling
|
|
9518
9539
|
* the iterator function and passing it an accumulator value and the current
|
|
@@ -9562,6 +9583,8 @@ var map = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable(['fantasy-land/map',
|
|
|
9562
9583
|
|
|
9563
9584
|
var reduce = /*#__PURE__*/_curry3(_reduce);
|
|
9564
9585
|
|
|
9586
|
+
var reduce$1 = reduce;
|
|
9587
|
+
|
|
9565
9588
|
/**
|
|
9566
9589
|
* Gives a single-word string description of the (native) type of a value,
|
|
9567
9590
|
* returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not
|
|
@@ -9592,6 +9615,8 @@ var type = /*#__PURE__*/_curry1(function type(val) {
|
|
|
9592
9615
|
return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);
|
|
9593
9616
|
});
|
|
9594
9617
|
|
|
9618
|
+
var type$1 = type;
|
|
9619
|
+
|
|
9595
9620
|
function _identity(x) {
|
|
9596
9621
|
return x;
|
|
9597
9622
|
}
|
|
@@ -9618,6 +9643,8 @@ function _identity(x) {
|
|
|
9618
9643
|
|
|
9619
9644
|
var identity = /*#__PURE__*/_curry1(_identity);
|
|
9620
9645
|
|
|
9646
|
+
var identity$1 = identity;
|
|
9647
|
+
|
|
9621
9648
|
function _arrayFromIterator(iter) {
|
|
9622
9649
|
var list = [];
|
|
9623
9650
|
var next;
|
|
@@ -9696,9 +9723,9 @@ function _equals(a, b, stackA, stackB) {
|
|
|
9696
9723
|
return true;
|
|
9697
9724
|
}
|
|
9698
9725
|
|
|
9699
|
-
var typeA = type(a);
|
|
9726
|
+
var typeA = type$1(a);
|
|
9700
9727
|
|
|
9701
|
-
if (typeA !== type(b)) {
|
|
9728
|
+
if (typeA !== type$1(b)) {
|
|
9702
9729
|
return false;
|
|
9703
9730
|
}
|
|
9704
9731
|
|
|
@@ -9802,9 +9829,9 @@ function _equals(a, b, stackA, stackB) {
|
|
|
9802
9829
|
return false;
|
|
9803
9830
|
}
|
|
9804
9831
|
|
|
9805
|
-
var keysA = keys(a);
|
|
9832
|
+
var keysA = keys$1(a);
|
|
9806
9833
|
|
|
9807
|
-
if (keysA.length !== keys(b).length) {
|
|
9834
|
+
if (keysA.length !== keys$1(b).length) {
|
|
9808
9835
|
return false;
|
|
9809
9836
|
}
|
|
9810
9837
|
|
|
@@ -9855,6 +9882,8 @@ var equals = /*#__PURE__*/_curry2(function equals(a, b) {
|
|
|
9855
9882
|
return _equals(a, b, [], []);
|
|
9856
9883
|
});
|
|
9857
9884
|
|
|
9885
|
+
var equals$1 = equals;
|
|
9886
|
+
|
|
9858
9887
|
function _indexOf(list, a, idx) {
|
|
9859
9888
|
var inf, item; // Array.prototype.indexOf doesn't exist below IE9
|
|
9860
9889
|
|
|
@@ -9912,7 +9941,7 @@ function _indexOf(list, a, idx) {
|
|
|
9912
9941
|
|
|
9913
9942
|
|
|
9914
9943
|
while (idx < list.length) {
|
|
9915
|
-
if (equals(list[idx], a)) {
|
|
9944
|
+
if (equals$1(list[idx], a)) {
|
|
9916
9945
|
return idx;
|
|
9917
9946
|
}
|
|
9918
9947
|
|
|
@@ -9955,7 +9984,7 @@ function _includes(a, list) {
|
|
|
9955
9984
|
*/
|
|
9956
9985
|
|
|
9957
9986
|
var cond = /*#__PURE__*/_curry1(function cond(pairs) {
|
|
9958
|
-
var arity = reduce(max, 0, map(function (pair) {
|
|
9987
|
+
var arity = reduce$1(max$1, 0, map$1(function (pair) {
|
|
9959
9988
|
return pair[0].length;
|
|
9960
9989
|
}, pairs));
|
|
9961
9990
|
return _arity(arity, function () {
|
|
@@ -9971,6 +10000,8 @@ var cond = /*#__PURE__*/_curry1(function cond(pairs) {
|
|
|
9971
10000
|
});
|
|
9972
10001
|
});
|
|
9973
10002
|
|
|
10003
|
+
var cond$1 = cond;
|
|
10004
|
+
|
|
9974
10005
|
var _Set = /*#__PURE__*/function () {
|
|
9975
10006
|
function _Set() {
|
|
9976
10007
|
/* globals Set */
|
|
@@ -10167,6 +10198,9 @@ function hasOrAdd(item, shouldAdd, set) {
|
|
|
10167
10198
|
}
|
|
10168
10199
|
} // A simple Set type that honours R.equals semantics
|
|
10169
10200
|
|
|
10201
|
+
|
|
10202
|
+
var _Set$1 = _Set;
|
|
10203
|
+
|
|
10170
10204
|
/**
|
|
10171
10205
|
* Returns a new list containing only one copy of each element in the original
|
|
10172
10206
|
* list, based upon the value returned by applying the supplied function to
|
|
@@ -10187,7 +10221,7 @@ function hasOrAdd(item, shouldAdd, set) {
|
|
|
10187
10221
|
*/
|
|
10188
10222
|
|
|
10189
10223
|
var uniqBy = /*#__PURE__*/_curry2(function uniqBy(fn, list) {
|
|
10190
|
-
var set = new _Set();
|
|
10224
|
+
var set = new _Set$1();
|
|
10191
10225
|
var result = [];
|
|
10192
10226
|
var idx = 0;
|
|
10193
10227
|
var appliedItem, item;
|
|
@@ -10206,6 +10240,8 @@ var uniqBy = /*#__PURE__*/_curry2(function uniqBy(fn, list) {
|
|
|
10206
10240
|
return result;
|
|
10207
10241
|
});
|
|
10208
10242
|
|
|
10243
|
+
var uniqBy$1 = uniqBy;
|
|
10244
|
+
|
|
10209
10245
|
/**
|
|
10210
10246
|
* Returns a new list containing only one copy of each element in the original
|
|
10211
10247
|
* list. [`R.equals`](#equals) is used to determine equality.
|
|
@@ -10224,7 +10260,8 @@ var uniqBy = /*#__PURE__*/_curry2(function uniqBy(fn, list) {
|
|
|
10224
10260
|
* R.uniq([[42], [42]]); //=> [[42]]
|
|
10225
10261
|
*/
|
|
10226
10262
|
|
|
10227
|
-
var uniq = /*#__PURE__*/uniqBy(identity);
|
|
10263
|
+
var uniq = /*#__PURE__*/uniqBy$1(identity$1);
|
|
10264
|
+
var uniq$1 = uniq;
|
|
10228
10265
|
|
|
10229
10266
|
function _isNumber(x) {
|
|
10230
10267
|
return Object.prototype.toString.call(x) === '[object Number]';
|
|
@@ -10263,6 +10300,8 @@ var range = /*#__PURE__*/_curry2(function range(from, to) {
|
|
|
10263
10300
|
return result;
|
|
10264
10301
|
});
|
|
10265
10302
|
|
|
10303
|
+
var range$1 = range;
|
|
10304
|
+
|
|
10266
10305
|
var __assign$2 = undefined && undefined.__assign || function () {
|
|
10267
10306
|
__assign$2 = Object.assign || function (t) {
|
|
10268
10307
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10363,7 +10402,7 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
10363
10402
|
dispatch({
|
|
10364
10403
|
type: 'SELECT',
|
|
10365
10404
|
payload: {
|
|
10366
|
-
value: uniq([].concat(_toConsumableArray(values), [option.value]))
|
|
10405
|
+
value: uniq$1([].concat(_toConsumableArray(values), [option.value]))
|
|
10367
10406
|
}
|
|
10368
10407
|
});
|
|
10369
10408
|
}, [dispatch, values]);
|
|
@@ -10601,17 +10640,25 @@ var Expandable = function Expandable(_ref) {
|
|
|
10601
10640
|
}, expanded || !virtual ? children : null));
|
|
10602
10641
|
};
|
|
10603
10642
|
|
|
10604
|
-
var _excluded$h = ["text", "type", "className"];
|
|
10643
|
+
var _excluded$h = ["text", "treatment", "color", "family", "type", "className"];
|
|
10605
10644
|
var Divider = function Divider(_ref) {
|
|
10606
10645
|
var text = _ref.text,
|
|
10646
|
+
treatment = _ref.treatment,
|
|
10647
|
+
color = _ref.color,
|
|
10648
|
+
family = _ref.family,
|
|
10607
10649
|
type = _ref.type,
|
|
10608
10650
|
className = _ref.className,
|
|
10609
10651
|
rest = _objectWithoutProperties(_ref, _excluded$h);
|
|
10610
10652
|
|
|
10653
|
+
var defaultTreatment = type === 'two-line' ? 'eyebrow' : 'h5';
|
|
10654
|
+
var defaultFamily = type === 'two-line' ? undefined : 'serif';
|
|
10611
10655
|
return /*#__PURE__*/React__default.createElement("div", _extends$3({
|
|
10612
10656
|
className: classNames('Divider', type ? "Divider--".concat(type) : '', className)
|
|
10613
|
-
}, rest), text && /*#__PURE__*/React__default.createElement(
|
|
10614
|
-
className: "Divider__text"
|
|
10657
|
+
}, rest), text && /*#__PURE__*/React__default.createElement(Text, {
|
|
10658
|
+
className: "Divider__text",
|
|
10659
|
+
treatment: treatment !== null && treatment !== void 0 ? treatment : defaultTreatment,
|
|
10660
|
+
color: color,
|
|
10661
|
+
family: family !== null && family !== void 0 ? family : defaultFamily
|
|
10615
10662
|
}, text));
|
|
10616
10663
|
};
|
|
10617
10664
|
|
|
@@ -11107,23 +11154,23 @@ var whenCurrentPageIsGreaterThanHalfTheTotal = function whenCurrentPageIsGreater
|
|
|
11107
11154
|
};
|
|
11108
11155
|
|
|
11109
11156
|
var showAllPages = function showAllPages(_, totalPages) {
|
|
11110
|
-
return range(1, totalPages + 1);
|
|
11157
|
+
return range$1(1, totalPages + 1);
|
|
11111
11158
|
};
|
|
11112
11159
|
|
|
11113
11160
|
var showFirstNPagesAndLastPage = function showFirstNPagesAndLastPage(_, totalPages, maxPages) {
|
|
11114
|
-
return [].concat(_toConsumableArray(range(1, maxPages)), [totalPages]);
|
|
11161
|
+
return [].concat(_toConsumableArray(range$1(1, maxPages)), [totalPages]);
|
|
11115
11162
|
};
|
|
11116
11163
|
|
|
11117
11164
|
var showTheLastNPages = function showTheLastNPages(_, totalPages, maxPages) {
|
|
11118
|
-
return [1].concat(_toConsumableArray(range(totalPages - maxPages + 2, totalPages + 1)));
|
|
11165
|
+
return [1].concat(_toConsumableArray(range$1(totalPages - maxPages + 2, totalPages + 1)));
|
|
11119
11166
|
};
|
|
11120
11167
|
|
|
11121
11168
|
var showAGroupOfPagesCenteredOnTheCurrentPage = function showAGroupOfPagesCenteredOnTheCurrentPage(page, totalPages, maxPages) {
|
|
11122
11169
|
var diff = Math.floor((maxPages - 2) / 2);
|
|
11123
|
-
return [1].concat(_toConsumableArray(range(page - diff, page + diff + 1)), [totalPages]);
|
|
11170
|
+
return [1].concat(_toConsumableArray(range$1(page - diff, page + diff + 1)), [totalPages]);
|
|
11124
11171
|
};
|
|
11125
11172
|
|
|
11126
|
-
var determinePagesToShow = cond([[whenThereAreFewerPagesThanWeDisplay, showAllPages], [whenCurrentPageIsLessThanHalfTheTotal, showFirstNPagesAndLastPage], [whenCurrentPageIsGreaterThanHalfTheTotal, showTheLastNPages], [
|
|
11173
|
+
var determinePagesToShow = cond$1([[whenThereAreFewerPagesThanWeDisplay, showAllPages], [whenCurrentPageIsLessThanHalfTheTotal, showFirstNPagesAndLastPage], [whenCurrentPageIsGreaterThanHalfTheTotal, showTheLastNPages], [otherwise, showAGroupOfPagesCenteredOnTheCurrentPage]]);
|
|
11127
11174
|
var Paginator = function Paginator(_ref) {
|
|
11128
11175
|
var selectedPage = _ref.selectedPage,
|
|
11129
11176
|
totalPages = _ref.totalPages,
|
|
@@ -11509,6 +11556,36 @@ var VerticalDivider = function VerticalDivider(_ref) {
|
|
|
11509
11556
|
}, rest));
|
|
11510
11557
|
};
|
|
11511
11558
|
|
|
11559
|
+
var PasswordInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
11560
|
+
var rest = _extends$3({}, _ref);
|
|
11561
|
+
|
|
11562
|
+
var _useState = useState(false),
|
|
11563
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11564
|
+
passwordShown = _useState2[0],
|
|
11565
|
+
setPasswordShown = _useState2[1];
|
|
11566
|
+
|
|
11567
|
+
var togglePasswordVisiblity = function togglePasswordVisiblity() {
|
|
11568
|
+
setPasswordShown(passwordShown ? false : true);
|
|
11569
|
+
};
|
|
11570
|
+
|
|
11571
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
11572
|
+
className: "PasswordInput"
|
|
11573
|
+
}, /*#__PURE__*/React__default.createElement(Field, _extends$3({
|
|
11574
|
+
type: passwordShown ? 'text' : 'password'
|
|
11575
|
+
}, rest, {
|
|
11576
|
+
ref: ref
|
|
11577
|
+
})), /*#__PURE__*/React__default.createElement(Clickable, {
|
|
11578
|
+
className: "PasswordInput__password-action",
|
|
11579
|
+
onClick: togglePasswordVisiblity,
|
|
11580
|
+
type: "button"
|
|
11581
|
+
}, passwordShown ? /*#__PURE__*/React__default.createElement(Text, {
|
|
11582
|
+
treatment: "eyebrow"
|
|
11583
|
+
}, "HIDE") : /*#__PURE__*/React__default.createElement(Text, {
|
|
11584
|
+
treatment: "eyebrow"
|
|
11585
|
+
}, "SHOW")));
|
|
11586
|
+
});
|
|
11587
|
+
PasswordInput.displayName = 'PasswordInput';
|
|
11588
|
+
|
|
11512
11589
|
var isRenderProps = function isRenderProps(children) {
|
|
11513
11590
|
return typeof children === 'function';
|
|
11514
11591
|
};
|
|
@@ -11615,4 +11692,4 @@ var Utilities = {
|
|
|
11615
11692
|
States: States
|
|
11616
11693
|
};
|
|
11617
11694
|
|
|
11618
|
-
export { AspectRatioBox, Badge, Breadcrumb, Breadcrumbs, Breakpoint, BreakpointContext, BreakpointProvider, Button, Checkbox, Clickable, ColorSwatch, Constrain, ControlLink, CreditCardNumberInput, DEFAULT_PRODUCT_ASPECT_HEIGHT, DEFAULT_PRODUCT_ASPECT_RATIO, DEFAULT_PRODUCT_ASPECT_WIDTH, DefinitionList, Divider, ExceedConstrain, Expandable, Field, FocusOn, Field as Input, Label, Loading, LoadingBalls, Modal, ModalOverlay, MultiSelect, NoLineDivider, Overlay, POPOVER_MOUSEOUT_DELAY_MS, Paginator, Popover, PromoBanner, RadioButton, SKU_COLORS, SearchInput, Select, SelectableButton, Stack, Tab, TabList, TabPanel, TabPanels, Tabs, Tag, Text, TextInput, Textarea, Toast, TwoLineDivider, UNMOUNT_DELAY_MS, Utilities, VerticalDivider, discriminate, tokens, useBreakpoint, useClickOutside, useKeyboardListNavigation, useUpdateEffect };
|
|
11695
|
+
export { AspectRatioBox, Badge, Breadcrumb, Breadcrumbs, Breakpoint, BreakpointContext, BreakpointProvider, Button, Checkbox, Clickable, ColorSwatch, Constrain, ControlLink, CreditCardNumberInput, DEFAULT_PRODUCT_ASPECT_HEIGHT, DEFAULT_PRODUCT_ASPECT_RATIO, DEFAULT_PRODUCT_ASPECT_WIDTH, DefinitionList, Divider, ExceedConstrain, Expandable, Field, FocusOn, Field as Input, Label, Loading, LoadingBalls, Modal, ModalOverlay, MultiSelect, NoLineDivider, Overlay, POPOVER_MOUSEOUT_DELAY_MS, Paginator, PasswordInput, Popover, PromoBanner, RadioButton, SKU_COLORS, SearchInput, Select, SelectableButton, Stack, Tab, TabList, TabPanel, TabPanels, Tabs, Tag, Text, TextInput, Textarea, Toast, TwoLineDivider, UNMOUNT_DELAY_MS, Utilities, VerticalDivider, discriminate, tokens, useBreakpoint, useClickOutside, useKeyboardListNavigation, useUpdateEffect };
|