@stackoverflow/stacks 0.71.0 → 0.74.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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/dist/css/stacks.css +963 -571
  3. package/dist/css/stacks.min.css +1 -1
  4. package/dist/js/stacks.js +190 -100
  5. package/dist/js/stacks.min.js +1 -1
  6. package/lib/css/atomic/_stacks-flex.less +2 -7
  7. package/lib/css/atomic/_stacks-grid.less +1 -0
  8. package/lib/css/atomic/_stacks-misc.less +6 -0
  9. package/lib/css/atomic/_stacks-typography.less +25 -7
  10. package/lib/css/base/_stacks-configuration-dynamic.less +4 -14
  11. package/lib/css/components/_stacks-activity-indicator.less +26 -2
  12. package/lib/css/components/_stacks-badges.less +1 -4
  13. package/lib/css/components/_stacks-buttons.less +44 -8
  14. package/lib/css/components/_stacks-cards.less +7 -11
  15. package/lib/css/components/_stacks-inputs.less +19 -0
  16. package/lib/css/components/_stacks-link-previews.less +4 -0
  17. package/lib/css/components/_stacks-links.less +25 -2
  18. package/lib/css/components/_stacks-navigation.less +8 -0
  19. package/lib/css/components/_stacks-pagination.less +2 -0
  20. package/lib/css/components/_stacks-popovers.less +4 -0
  21. package/lib/css/components/_stacks-post-summary.less +156 -10
  22. package/lib/css/components/_stacks-progress-bars.less +18 -3
  23. package/lib/css/components/_stacks-prose.less +7 -2
  24. package/lib/css/components/_stacks-tags.less +38 -15
  25. package/lib/css/components/_stacks-toggle-switches.less +8 -1
  26. package/lib/css/components/_stacks-topbar.less +440 -0
  27. package/lib/css/components/_stacks-uploader.less +2 -0
  28. package/lib/css/components/_stacks-user-cards.less +15 -39
  29. package/lib/css/exports/_stacks-constants-colors.less +50 -14
  30. package/lib/css/exports/_stacks-constants-helpers.less +1 -2
  31. package/lib/css/exports/_stacks-mixins.less +11 -0
  32. package/lib/css/stacks-dynamic.less +0 -1
  33. package/lib/css/stacks-static.less +2 -0
  34. package/package.json +15 -12
package/dist/js/stacks.js CHANGED
@@ -2296,7 +2296,7 @@ Copyright © 2020 Basecamp, LLC
2296
2296
  ;
2297
2297
 
2298
2298
  /**
2299
- * @popperjs/core v2.9.2 - MIT License
2299
+ * @popperjs/core v2.11.2 - MIT License
2300
2300
  */
2301
2301
 
2302
2302
  (function (global, factory) {
@@ -2305,20 +2305,6 @@ Copyright © 2020 Basecamp, LLC
2305
2305
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Popper = {}));
2306
2306
  }(this, (function (exports) { 'use strict';
2307
2307
 
2308
- function getBoundingClientRect(element) {
2309
- var rect = element.getBoundingClientRect();
2310
- return {
2311
- width: rect.width,
2312
- height: rect.height,
2313
- top: rect.top,
2314
- right: rect.right,
2315
- bottom: rect.bottom,
2316
- left: rect.left,
2317
- x: rect.left,
2318
- y: rect.top
2319
- };
2320
- }
2321
-
2322
2308
  function getWindow(node) {
2323
2309
  if (node == null) {
2324
2310
  return window;
@@ -2332,16 +2318,6 @@ Copyright © 2020 Basecamp, LLC
2332
2318
  return node;
2333
2319
  }
2334
2320
 
2335
- function getWindowScroll(node) {
2336
- var win = getWindow(node);
2337
- var scrollLeft = win.pageXOffset;
2338
- var scrollTop = win.pageYOffset;
2339
- return {
2340
- scrollLeft: scrollLeft,
2341
- scrollTop: scrollTop
2342
- };
2343
- }
2344
-
2345
2321
  function isElement(node) {
2346
2322
  var OwnElement = getWindow(node).Element;
2347
2323
  return node instanceof OwnElement || node instanceof Element;
@@ -2362,6 +2338,55 @@ Copyright © 2020 Basecamp, LLC
2362
2338
  return node instanceof OwnElement || node instanceof ShadowRoot;
2363
2339
  }
2364
2340
 
2341
+ var max = Math.max;
2342
+ var min = Math.min;
2343
+ var round = Math.round;
2344
+
2345
+ function getBoundingClientRect(element, includeScale) {
2346
+ if (includeScale === void 0) {
2347
+ includeScale = false;
2348
+ }
2349
+
2350
+ var rect = element.getBoundingClientRect();
2351
+ var scaleX = 1;
2352
+ var scaleY = 1;
2353
+
2354
+ if (isHTMLElement(element) && includeScale) {
2355
+ var offsetHeight = element.offsetHeight;
2356
+ var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
2357
+ // Fallback to 1 in case both values are `0`
2358
+
2359
+ if (offsetWidth > 0) {
2360
+ scaleX = round(rect.width) / offsetWidth || 1;
2361
+ }
2362
+
2363
+ if (offsetHeight > 0) {
2364
+ scaleY = round(rect.height) / offsetHeight || 1;
2365
+ }
2366
+ }
2367
+
2368
+ return {
2369
+ width: rect.width / scaleX,
2370
+ height: rect.height / scaleY,
2371
+ top: rect.top / scaleY,
2372
+ right: rect.right / scaleX,
2373
+ bottom: rect.bottom / scaleY,
2374
+ left: rect.left / scaleX,
2375
+ x: rect.left / scaleX,
2376
+ y: rect.top / scaleY
2377
+ };
2378
+ }
2379
+
2380
+ function getWindowScroll(node) {
2381
+ var win = getWindow(node);
2382
+ var scrollLeft = win.pageXOffset;
2383
+ var scrollTop = win.pageYOffset;
2384
+ return {
2385
+ scrollLeft: scrollLeft,
2386
+ scrollTop: scrollTop
2387
+ };
2388
+ }
2389
+
2365
2390
  function getHTMLElementScroll(element) {
2366
2391
  return {
2367
2392
  scrollLeft: element.scrollLeft,
@@ -2412,16 +2437,24 @@ Copyright © 2020 Basecamp, LLC
2412
2437
  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
2413
2438
  }
2414
2439
 
2440
+ function isElementScaled(element) {
2441
+ var rect = element.getBoundingClientRect();
2442
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
2443
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
2444
+ return scaleX !== 1 || scaleY !== 1;
2445
+ } // Returns the composite rect of an element relative to its offsetParent.
2415
2446
  // Composite means it takes into account transforms as well as layout.
2416
2447
 
2448
+
2417
2449
  function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2418
2450
  if (isFixed === void 0) {
2419
2451
  isFixed = false;
2420
2452
  }
2421
2453
 
2422
- var documentElement = getDocumentElement(offsetParent);
2423
- var rect = getBoundingClientRect(elementOrVirtualElement);
2424
2454
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
2455
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2456
+ var documentElement = getDocumentElement(offsetParent);
2457
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
2425
2458
  var scroll = {
2426
2459
  scrollLeft: 0,
2427
2460
  scrollTop: 0
@@ -2438,7 +2471,7 @@ Copyright © 2020 Basecamp, LLC
2438
2471
  }
2439
2472
 
2440
2473
  if (isHTMLElement(offsetParent)) {
2441
- offsets = getBoundingClientRect(offsetParent);
2474
+ offsets = getBoundingClientRect(offsetParent, true);
2442
2475
  offsets.x += offsetParent.clientLeft;
2443
2476
  offsets.y += offsetParent.clientTop;
2444
2477
  } else if (documentElement) {
@@ -2700,7 +2733,10 @@ Copyright © 2020 Basecamp, LLC
2700
2733
  var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
2701
2734
  function validateModifiers(modifiers) {
2702
2735
  modifiers.forEach(function (modifier) {
2703
- Object.keys(modifier).forEach(function (key) {
2736
+ [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
2737
+ .filter(function (value, index, self) {
2738
+ return self.indexOf(value) === index;
2739
+ }).forEach(function (key) {
2704
2740
  switch (key) {
2705
2741
  case 'name':
2706
2742
  if (typeof modifier.name !== 'string') {
@@ -2714,6 +2750,8 @@ Copyright © 2020 Basecamp, LLC
2714
2750
  console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
2715
2751
  }
2716
2752
 
2753
+ break;
2754
+
2717
2755
  case 'phase':
2718
2756
  if (modifierPhases.indexOf(modifier.phase) < 0) {
2719
2757
  console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
@@ -2729,14 +2767,14 @@ Copyright © 2020 Basecamp, LLC
2729
2767
  break;
2730
2768
 
2731
2769
  case 'effect':
2732
- if (typeof modifier.effect !== 'function') {
2770
+ if (modifier.effect != null && typeof modifier.effect !== 'function') {
2733
2771
  console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
2734
2772
  }
2735
2773
 
2736
2774
  break;
2737
2775
 
2738
2776
  case 'requires':
2739
- if (!Array.isArray(modifier.requires)) {
2777
+ if (modifier.requires != null && !Array.isArray(modifier.requires)) {
2740
2778
  console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
2741
2779
  }
2742
2780
 
@@ -2839,10 +2877,6 @@ Copyright © 2020 Basecamp, LLC
2839
2877
  };
2840
2878
  }
2841
2879
 
2842
- var max = Math.max;
2843
- var min = Math.min;
2844
- var round = Math.round;
2845
-
2846
2880
  // of the `<html>` and `<body>` rect bounds if horizontally scrollable
2847
2881
 
2848
2882
  function getDocumentRect(element) {
@@ -2914,7 +2948,7 @@ Copyright © 2020 Basecamp, LLC
2914
2948
  }
2915
2949
 
2916
2950
  function getClientRectFromMixedType(element, clippingParent) {
2917
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
2951
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
2918
2952
  } // A "clipping parent" is an overflowable container with the characteristic of
2919
2953
  // clipping (or hiding) overflowing elements with a position different from
2920
2954
  // `initial`
@@ -3069,11 +3103,10 @@ Copyright © 2020 Basecamp, LLC
3069
3103
  padding = _options$padding === void 0 ? 0 : _options$padding;
3070
3104
  var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
3071
3105
  var altContext = elementContext === popper ? reference : popper;
3072
- var referenceElement = state.elements.reference;
3073
3106
  var popperRect = state.rects.popper;
3074
3107
  var element = state.elements[altBoundary ? altContext : elementContext];
3075
3108
  var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
3076
- var referenceClientRect = getBoundingClientRect(referenceElement);
3109
+ var referenceClientRect = getBoundingClientRect(state.elements.reference);
3077
3110
  var popperOffsets = computeOffsets({
3078
3111
  reference: referenceClientRect,
3079
3112
  element: popperRect,
@@ -3153,7 +3186,8 @@ Copyright © 2020 Basecamp, LLC
3153
3186
  var isDestroyed = false;
3154
3187
  var instance = {
3155
3188
  state: state,
3156
- setOptions: function setOptions(options) {
3189
+ setOptions: function setOptions(setOptionsAction) {
3190
+ var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
3157
3191
  cleanupModifierEffects();
3158
3192
  state.options = Object.assign({}, defaultOptions, state.options, options);
3159
3193
  state.scrollParents = {
@@ -3433,8 +3467,8 @@ Copyright © 2020 Basecamp, LLC
3433
3467
  var win = window;
3434
3468
  var dpr = win.devicePixelRatio || 1;
3435
3469
  return {
3436
- x: round(round(x * dpr) / dpr) || 0,
3437
- y: round(round(y * dpr) / dpr) || 0
3470
+ x: round(x * dpr) / dpr || 0,
3471
+ y: round(y * dpr) / dpr || 0
3438
3472
  };
3439
3473
  }
3440
3474
 
@@ -3444,18 +3478,28 @@ Copyright © 2020 Basecamp, LLC
3444
3478
  var popper = _ref2.popper,
3445
3479
  popperRect = _ref2.popperRect,
3446
3480
  placement = _ref2.placement,
3481
+ variation = _ref2.variation,
3447
3482
  offsets = _ref2.offsets,
3448
3483
  position = _ref2.position,
3449
3484
  gpuAcceleration = _ref2.gpuAcceleration,
3450
3485
  adaptive = _ref2.adaptive,
3451
- roundOffsets = _ref2.roundOffsets;
3452
-
3453
- var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
3454
- _ref3$x = _ref3.x,
3455
- x = _ref3$x === void 0 ? 0 : _ref3$x,
3456
- _ref3$y = _ref3.y,
3457
- y = _ref3$y === void 0 ? 0 : _ref3$y;
3486
+ roundOffsets = _ref2.roundOffsets,
3487
+ isFixed = _ref2.isFixed;
3488
+ var _offsets$x = offsets.x,
3489
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
3490
+ _offsets$y = offsets.y,
3491
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
3492
+
3493
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
3494
+ x: x,
3495
+ y: y
3496
+ }) : {
3497
+ x: x,
3498
+ y: y
3499
+ };
3458
3500
 
3501
+ x = _ref3.x;
3502
+ y = _ref3.y;
3459
3503
  var hasX = offsets.hasOwnProperty('x');
3460
3504
  var hasY = offsets.hasOwnProperty('y');
3461
3505
  var sideX = left;
@@ -3470,7 +3514,7 @@ Copyright © 2020 Basecamp, LLC
3470
3514
  if (offsetParent === getWindow(popper)) {
3471
3515
  offsetParent = getDocumentElement(popper);
3472
3516
 
3473
- if (getComputedStyle(offsetParent).position !== 'static') {
3517
+ if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
3474
3518
  heightProp = 'scrollHeight';
3475
3519
  widthProp = 'scrollWidth';
3476
3520
  }
@@ -3479,17 +3523,19 @@ Copyright © 2020 Basecamp, LLC
3479
3523
 
3480
3524
  offsetParent = offsetParent;
3481
3525
 
3482
- if (placement === top) {
3483
- sideY = bottom; // $FlowFixMe[prop-missing]
3484
-
3485
- y -= offsetParent[heightProp] - popperRect.height;
3526
+ if (placement === top || (placement === left || placement === right) && variation === end) {
3527
+ sideY = bottom;
3528
+ var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
3529
+ offsetParent[heightProp];
3530
+ y -= offsetY - popperRect.height;
3486
3531
  y *= gpuAcceleration ? 1 : -1;
3487
3532
  }
3488
3533
 
3489
- if (placement === left) {
3490
- sideX = right; // $FlowFixMe[prop-missing]
3491
-
3492
- x -= offsetParent[widthProp] - popperRect.width;
3534
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
3535
+ sideX = right;
3536
+ var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
3537
+ offsetParent[widthProp];
3538
+ x -= offsetX - popperRect.width;
3493
3539
  x *= gpuAcceleration ? 1 : -1;
3494
3540
  }
3495
3541
  }
@@ -3498,18 +3544,29 @@ Copyright © 2020 Basecamp, LLC
3498
3544
  position: position
3499
3545
  }, adaptive && unsetSides);
3500
3546
 
3547
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
3548
+ x: x,
3549
+ y: y
3550
+ }) : {
3551
+ x: x,
3552
+ y: y
3553
+ };
3554
+
3555
+ x = _ref4.x;
3556
+ y = _ref4.y;
3557
+
3501
3558
  if (gpuAcceleration) {
3502
3559
  var _Object$assign;
3503
3560
 
3504
- return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
3561
+ return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
3505
3562
  }
3506
3563
 
3507
3564
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
3508
3565
  }
3509
3566
 
3510
- function computeStyles(_ref4) {
3511
- var state = _ref4.state,
3512
- options = _ref4.options;
3567
+ function computeStyles(_ref5) {
3568
+ var state = _ref5.state,
3569
+ options = _ref5.options;
3513
3570
  var _options$gpuAccelerat = options.gpuAcceleration,
3514
3571
  gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
3515
3572
  _options$adaptive = options.adaptive,
@@ -3529,9 +3586,11 @@ Copyright © 2020 Basecamp, LLC
3529
3586
 
3530
3587
  var commonStyles = {
3531
3588
  placement: getBasePlacement(state.placement),
3589
+ variation: getVariation(state.placement),
3532
3590
  popper: state.elements.popper,
3533
3591
  popperRect: state.rects.popper,
3534
- gpuAcceleration: gpuAcceleration
3592
+ gpuAcceleration: gpuAcceleration,
3593
+ isFixed: state.options.strategy === 'fixed'
3535
3594
  };
3536
3595
 
3537
3596
  if (state.modifiersData.popperOffsets != null) {
@@ -3914,6 +3973,10 @@ Copyright © 2020 Basecamp, LLC
3914
3973
  function within(min$1, value, max$1) {
3915
3974
  return max(min$1, min(value, max$1));
3916
3975
  }
3976
+ function withinMaxClamp(min, value, max) {
3977
+ var v = within(min, value, max);
3978
+ return v > max ? max : v;
3979
+ }
3917
3980
 
3918
3981
  function preventOverflow(_ref) {
3919
3982
  var state = _ref.state,
@@ -3948,6 +4011,14 @@ Copyright © 2020 Basecamp, LLC
3948
4011
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
3949
4012
  placement: state.placement
3950
4013
  })) : tetherOffset;
4014
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
4015
+ mainAxis: tetherOffsetValue,
4016
+ altAxis: tetherOffsetValue
4017
+ } : Object.assign({
4018
+ mainAxis: 0,
4019
+ altAxis: 0
4020
+ }, tetherOffsetValue);
4021
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
3951
4022
  var data = {
3952
4023
  x: 0,
3953
4024
  y: 0
@@ -3957,13 +4028,15 @@ Copyright © 2020 Basecamp, LLC
3957
4028
  return;
3958
4029
  }
3959
4030
 
3960
- if (checkMainAxis || checkAltAxis) {
4031
+ if (checkMainAxis) {
4032
+ var _offsetModifierState$;
4033
+
3961
4034
  var mainSide = mainAxis === 'y' ? top : left;
3962
4035
  var altSide = mainAxis === 'y' ? bottom : right;
3963
4036
  var len = mainAxis === 'y' ? 'height' : 'width';
3964
4037
  var offset = popperOffsets[mainAxis];
3965
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
3966
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
4038
+ var min$1 = offset + overflow[mainSide];
4039
+ var max$1 = offset - overflow[altSide];
3967
4040
  var additive = tether ? -popperRect[len] / 2 : 0;
3968
4041
  var minLen = variation === start ? referenceRect[len] : popperRect[len];
3969
4042
  var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
@@ -3983,36 +4056,45 @@ Copyright © 2020 Basecamp, LLC
3983
4056
  // width or height)
3984
4057
 
3985
4058
  var arrowLen = within(0, referenceRect[len], arrowRect[len]);
3986
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
3987
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
4059
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
4060
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
3988
4061
  var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
3989
4062
  var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
3990
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
3991
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
3992
- var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
4063
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
4064
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
4065
+ var tetherMax = offset + maxOffset - offsetModifierValue;
4066
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
4067
+ popperOffsets[mainAxis] = preventedOffset;
4068
+ data[mainAxis] = preventedOffset - offset;
4069
+ }
3993
4070
 
3994
- if (checkMainAxis) {
3995
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
3996
- popperOffsets[mainAxis] = preventedOffset;
3997
- data[mainAxis] = preventedOffset - offset;
3998
- }
4071
+ if (checkAltAxis) {
4072
+ var _offsetModifierState$2;
3999
4073
 
4000
- if (checkAltAxis) {
4001
- var _mainSide = mainAxis === 'x' ? top : left;
4074
+ var _mainSide = mainAxis === 'x' ? top : left;
4002
4075
 
4003
- var _altSide = mainAxis === 'x' ? bottom : right;
4076
+ var _altSide = mainAxis === 'x' ? bottom : right;
4004
4077
 
4005
- var _offset = popperOffsets[altAxis];
4078
+ var _offset = popperOffsets[altAxis];
4006
4079
 
4007
- var _min = _offset + overflow[_mainSide];
4080
+ var _len = altAxis === 'y' ? 'height' : 'width';
4008
4081
 
4009
- var _max = _offset - overflow[_altSide];
4082
+ var _min = _offset + overflow[_mainSide];
4010
4083
 
4011
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
4084
+ var _max = _offset - overflow[_altSide];
4012
4085
 
4013
- popperOffsets[altAxis] = _preventedOffset;
4014
- data[altAxis] = _preventedOffset - _offset;
4015
- }
4086
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
4087
+
4088
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
4089
+
4090
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
4091
+
4092
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
4093
+
4094
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
4095
+
4096
+ popperOffsets[altAxis] = _preventedOffset;
4097
+ data[altAxis] = _preventedOffset - _offset;
4016
4098
  }
4017
4099
 
4018
4100
  state.modifiersData[name] = data;
@@ -4226,10 +4308,14 @@ var __extends = (this && this.__extends) || (function () {
4226
4308
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4227
4309
  };
4228
4310
  })();
4229
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
4230
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4231
- to[j] = from[i];
4232
- return to;
4311
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
4312
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4313
+ if (ar || !(i in from)) {
4314
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
4315
+ ar[i] = from[i];
4316
+ }
4317
+ }
4318
+ return to.concat(ar || Array.prototype.slice.call(from));
4233
4319
  };
4234
4320
  var Stacks;
4235
4321
  (function (Stacks) {
@@ -4243,7 +4329,7 @@ var Stacks;
4243
4329
  for (var _i = 1; _i < arguments.length; _i++) {
4244
4330
  rest[_i - 1] = arguments[_i];
4245
4331
  }
4246
- var definitions = Array.isArray(head) ? head : __spreadArray([head], rest);
4332
+ var definitions = Array.isArray(head) ? head : __spreadArray([head], rest, true);
4247
4333
  for (var _a = 0, definitions_1 = definitions; _a < definitions_1.length; _a++) {
4248
4334
  var definition = definitions_1[_a];
4249
4335
  var hasPrefix = /^s-/.test(definition.identifier);
@@ -4582,10 +4668,14 @@ var __extends = (this && this.__extends) || (function () {
4582
4668
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4583
4669
  };
4584
4670
  })();
4585
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
4586
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4587
- to[j] = from[i];
4588
- return to;
4671
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
4672
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4673
+ if (ar || !(i in from)) {
4674
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
4675
+ ar[i] = from[i];
4676
+ }
4677
+ }
4678
+ return to.concat(ar || Array.prototype.slice.call(from));
4589
4679
  };
4590
4680
  var Stacks;
4591
4681
  (function (Stacks) {
@@ -4694,7 +4784,7 @@ var Stacks;
4694
4784
  return elements.find(function (el) { return el.offsetParent !== null; });
4695
4785
  };
4696
4786
  ModalController.prototype.lastVisible = function (elements) {
4697
- return this.firstVisible(__spreadArray([], elements).reverse());
4787
+ return this.firstVisible(__spreadArray([], elements, true).reverse());
4698
4788
  };
4699
4789
  ModalController.prototype.focusInsideModal = function () {
4700
4790
  var _this = this;
@@ -5089,7 +5179,7 @@ var Stacks;
5089
5179
  if (popoverId) {
5090
5180
  popoverElement = document.getElementById(popoverId);
5091
5181
  if (!popoverElement) {
5092
- throw "[" + this.popoverSelectorAttribute + "=\"{POPOVER_ID}\"] required";
5182
+ throw "[".concat(this.popoverSelectorAttribute, "=\"{POPOVER_ID}\"] required");
5093
5183
  }
5094
5184
  }
5095
5185
  else {
@@ -5209,7 +5299,7 @@ var Stacks;
5209
5299
  function attachPopover(element, popover, options) {
5210
5300
  var _a = getPopover(element), referenceElement = _a.referenceElement, existingPopover = _a.popover;
5211
5301
  if (existingPopover) {
5212
- throw "element already has popover with id=\"" + existingPopover.id + "\"";
5302
+ throw "element already has popover with id=\"".concat(existingPopover.id, "\"");
5213
5303
  }
5214
5304
  if (!referenceElement) {
5215
5305
  throw "element has invalid data-s-popover-reference-selector attribute";
@@ -5224,10 +5314,10 @@ var Stacks;
5224
5314
  var existingId = referenceElement.getAttribute("aria-controls");
5225
5315
  var popoverId = popover.id;
5226
5316
  if (!popover.classList.contains('s-popover')) {
5227
- throw "popover should have the \"s-popover\" class but had class=\"" + popover.className + "\"";
5317
+ throw "popover should have the \"s-popover\" class but had class=\"".concat(popover.className, "\"");
5228
5318
  }
5229
5319
  if (existingId && existingId !== popoverId) {
5230
- throw "element has aria-controls=\"" + existingId + "\" but popover has id=\"" + popoverId + "\"";
5320
+ throw "element has aria-controls=\"".concat(existingId, "\" but popover has id=\"").concat(popoverId, "\"");
5231
5321
  }
5232
5322
  if (!popoverId) {
5233
5323
  popoverId = "--stacks-s-popover-" + Math.random().toString(36).substring(2, 10);
@@ -5700,7 +5790,7 @@ var Stacks;
5700
5790
  var headingElement = document.createElement("div");
5701
5791
  headingElement.classList.add("s-uploader--previews-heading");
5702
5792
  headingElement.innerText = res.length < count ?
5703
- "Showing " + res.length + " of " + count + " files" : count + " items";
5793
+ "Showing ".concat(res.length, " of ").concat(count, " files") : "".concat(count, " items");
5704
5794
  _this.previewsTarget.appendChild(headingElement);
5705
5795
  _this.previewsTarget.classList.add("has-multiple");
5706
5796
  }