@stackoverflow/stacks 0.70.0 → 0.73.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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/dist/css/stacks.css +1742 -681
  3. package/dist/css/stacks.min.css +1 -1
  4. package/dist/js/stacks.js +167 -92
  5. package/dist/js/stacks.min.js +1 -1
  6. package/lib/css/atomic/_stacks-borders.less +18 -0
  7. package/lib/css/atomic/_stacks-flex.less +2 -7
  8. package/lib/css/atomic/_stacks-grid.less +2 -0
  9. package/lib/css/atomic/_stacks-misc.less +6 -2
  10. package/lib/css/atomic/_stacks-typography.less +23 -8
  11. package/lib/css/base/_stacks-configuration-dynamic.less +5 -15
  12. package/lib/css/components/_stacks-activity-indicator.less +26 -2
  13. package/lib/css/components/_stacks-avatars.less +9 -0
  14. package/lib/css/components/_stacks-badges.less +18 -6
  15. package/lib/css/components/_stacks-breadcrumbs.less +2 -0
  16. package/lib/css/components/_stacks-button-groups.less +11 -0
  17. package/lib/css/components/_stacks-buttons.less +111 -10
  18. package/lib/css/components/_stacks-cards.less +9 -13
  19. package/lib/css/components/_stacks-code-blocks.less +1 -1
  20. package/lib/css/components/_stacks-inputs.less +78 -9
  21. package/lib/css/components/_stacks-link-previews.less +7 -3
  22. package/lib/css/components/_stacks-links.less +25 -2
  23. package/lib/css/components/_stacks-menu.less +4 -4
  24. package/lib/css/components/_stacks-modals.less +1 -1
  25. package/lib/css/components/_stacks-navigation.less +18 -0
  26. package/lib/css/components/_stacks-notices.less +40 -3
  27. package/lib/css/components/_stacks-page-titles.less +1 -1
  28. package/lib/css/components/_stacks-pagination.less +4 -2
  29. package/lib/css/components/_stacks-popovers.less +22 -2
  30. package/lib/css/components/_stacks-post-summary.less +134 -3
  31. package/lib/css/components/_stacks-progress-bars.less +29 -6
  32. package/lib/css/components/_stacks-prose.less +16 -2
  33. package/lib/css/components/_stacks-tables.less +10 -6
  34. package/lib/css/components/_stacks-tags.less +22 -19
  35. package/lib/css/components/_stacks-toggle-switches.less +12 -0
  36. package/lib/css/components/_stacks-topbar.less +440 -0
  37. package/lib/css/components/_stacks-uploader.less +22 -0
  38. package/lib/css/components/_stacks-widget-static.less +15 -3
  39. package/lib/css/exports/_stacks-constants-colors.less +443 -35
  40. package/lib/css/exports/_stacks-constants-helpers.less +1 -2
  41. package/lib/css/exports/_stacks-mixins.less +26 -0
  42. package/lib/css/stacks-dynamic.less +0 -1
  43. package/lib/css/stacks-static.less +15 -0
  44. package/lib/ts/controllers/s-tooltip.ts +4 -0
  45. 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.0 - 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`
@@ -2931,7 +2965,7 @@ Copyright © 2020 Basecamp, LLC
2931
2965
 
2932
2966
 
2933
2967
  return clippingParents.filter(function (clippingParent) {
2934
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
2968
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true);
2935
2969
  });
2936
2970
  } // Gets the maximum area that the element is visible in due to any number of
2937
2971
  // clipping parents
@@ -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,11 +3478,13 @@ 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;
3486
+ roundOffsets = _ref2.roundOffsets,
3487
+ isFixed = _ref2.isFixed;
3452
3488
 
3453
3489
  var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
3454
3490
  _ref3$x = _ref3.x,
@@ -3470,7 +3506,7 @@ Copyright © 2020 Basecamp, LLC
3470
3506
  if (offsetParent === getWindow(popper)) {
3471
3507
  offsetParent = getDocumentElement(popper);
3472
3508
 
3473
- if (getComputedStyle(offsetParent).position !== 'static') {
3509
+ if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
3474
3510
  heightProp = 'scrollHeight';
3475
3511
  widthProp = 'scrollWidth';
3476
3512
  }
@@ -3479,17 +3515,19 @@ Copyright © 2020 Basecamp, LLC
3479
3515
 
3480
3516
  offsetParent = offsetParent;
3481
3517
 
3482
- if (placement === top) {
3483
- sideY = bottom; // $FlowFixMe[prop-missing]
3484
-
3485
- y -= offsetParent[heightProp] - popperRect.height;
3518
+ if (placement === top || (placement === left || placement === right) && variation === end) {
3519
+ sideY = bottom;
3520
+ var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
3521
+ offsetParent[heightProp];
3522
+ y -= offsetY - popperRect.height;
3486
3523
  y *= gpuAcceleration ? 1 : -1;
3487
3524
  }
3488
3525
 
3489
- if (placement === left) {
3490
- sideX = right; // $FlowFixMe[prop-missing]
3491
-
3492
- x -= offsetParent[widthProp] - popperRect.width;
3526
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
3527
+ sideX = right;
3528
+ var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
3529
+ offsetParent[widthProp];
3530
+ x -= offsetX - popperRect.width;
3493
3531
  x *= gpuAcceleration ? 1 : -1;
3494
3532
  }
3495
3533
  }
@@ -3501,7 +3539,7 @@ Copyright © 2020 Basecamp, LLC
3501
3539
  if (gpuAcceleration) {
3502
3540
  var _Object$assign;
3503
3541
 
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));
3542
+ 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
3543
  }
3506
3544
 
3507
3545
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
@@ -3529,9 +3567,11 @@ Copyright © 2020 Basecamp, LLC
3529
3567
 
3530
3568
  var commonStyles = {
3531
3569
  placement: getBasePlacement(state.placement),
3570
+ variation: getVariation(state.placement),
3532
3571
  popper: state.elements.popper,
3533
3572
  popperRect: state.rects.popper,
3534
- gpuAcceleration: gpuAcceleration
3573
+ gpuAcceleration: gpuAcceleration,
3574
+ isFixed: state.options.strategy === 'fixed'
3535
3575
  };
3536
3576
 
3537
3577
  if (state.modifiersData.popperOffsets != null) {
@@ -3914,6 +3954,10 @@ Copyright © 2020 Basecamp, LLC
3914
3954
  function within(min$1, value, max$1) {
3915
3955
  return max(min$1, min(value, max$1));
3916
3956
  }
3957
+ function withinMaxClamp(min, value, max) {
3958
+ var v = within(min, value, max);
3959
+ return v > max ? max : v;
3960
+ }
3917
3961
 
3918
3962
  function preventOverflow(_ref) {
3919
3963
  var state = _ref.state,
@@ -3948,6 +3992,14 @@ Copyright © 2020 Basecamp, LLC
3948
3992
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
3949
3993
  placement: state.placement
3950
3994
  })) : tetherOffset;
3995
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
3996
+ mainAxis: tetherOffsetValue,
3997
+ altAxis: tetherOffsetValue
3998
+ } : Object.assign({
3999
+ mainAxis: 0,
4000
+ altAxis: 0
4001
+ }, tetherOffsetValue);
4002
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
3951
4003
  var data = {
3952
4004
  x: 0,
3953
4005
  y: 0
@@ -3957,13 +4009,15 @@ Copyright © 2020 Basecamp, LLC
3957
4009
  return;
3958
4010
  }
3959
4011
 
3960
- if (checkMainAxis || checkAltAxis) {
4012
+ if (checkMainAxis) {
4013
+ var _offsetModifierState$;
4014
+
3961
4015
  var mainSide = mainAxis === 'y' ? top : left;
3962
4016
  var altSide = mainAxis === 'y' ? bottom : right;
3963
4017
  var len = mainAxis === 'y' ? 'height' : 'width';
3964
4018
  var offset = popperOffsets[mainAxis];
3965
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
3966
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
4019
+ var min$1 = offset + overflow[mainSide];
4020
+ var max$1 = offset - overflow[altSide];
3967
4021
  var additive = tether ? -popperRect[len] / 2 : 0;
3968
4022
  var minLen = variation === start ? referenceRect[len] : popperRect[len];
3969
4023
  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 +4037,45 @@ Copyright © 2020 Basecamp, LLC
3983
4037
  // width or height)
3984
4038
 
3985
4039
  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;
4040
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
4041
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
3988
4042
  var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
3989
4043
  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;
4044
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
4045
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
4046
+ var tetherMax = offset + maxOffset - offsetModifierValue;
4047
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
4048
+ popperOffsets[mainAxis] = preventedOffset;
4049
+ data[mainAxis] = preventedOffset - offset;
4050
+ }
3993
4051
 
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
- }
4052
+ if (checkAltAxis) {
4053
+ var _offsetModifierState$2;
3999
4054
 
4000
- if (checkAltAxis) {
4001
- var _mainSide = mainAxis === 'x' ? top : left;
4055
+ var _mainSide = mainAxis === 'x' ? top : left;
4002
4056
 
4003
- var _altSide = mainAxis === 'x' ? bottom : right;
4057
+ var _altSide = mainAxis === 'x' ? bottom : right;
4004
4058
 
4005
- var _offset = popperOffsets[altAxis];
4059
+ var _offset = popperOffsets[altAxis];
4006
4060
 
4007
- var _min = _offset + overflow[_mainSide];
4061
+ var _len = altAxis === 'y' ? 'height' : 'width';
4008
4062
 
4009
- var _max = _offset - overflow[_altSide];
4063
+ var _min = _offset + overflow[_mainSide];
4010
4064
 
4011
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
4065
+ var _max = _offset - overflow[_altSide];
4012
4066
 
4013
- popperOffsets[altAxis] = _preventedOffset;
4014
- data[altAxis] = _preventedOffset - _offset;
4015
- }
4067
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
4068
+
4069
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
4070
+
4071
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
4072
+
4073
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
4074
+
4075
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
4076
+
4077
+ popperOffsets[altAxis] = _preventedOffset;
4078
+ data[altAxis] = _preventedOffset - _offset;
4016
4079
  }
4017
4080
 
4018
4081
  state.modifiersData[name] = data;
@@ -4226,10 +4289,14 @@ var __extends = (this && this.__extends) || (function () {
4226
4289
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4227
4290
  };
4228
4291
  })();
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;
4292
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
4293
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4294
+ if (ar || !(i in from)) {
4295
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
4296
+ ar[i] = from[i];
4297
+ }
4298
+ }
4299
+ return to.concat(ar || Array.prototype.slice.call(from));
4233
4300
  };
4234
4301
  var Stacks;
4235
4302
  (function (Stacks) {
@@ -4243,7 +4310,7 @@ var Stacks;
4243
4310
  for (var _i = 1; _i < arguments.length; _i++) {
4244
4311
  rest[_i - 1] = arguments[_i];
4245
4312
  }
4246
- var definitions = Array.isArray(head) ? head : __spreadArray([head], rest);
4313
+ var definitions = Array.isArray(head) ? head : __spreadArray([head], rest, true);
4247
4314
  for (var _a = 0, definitions_1 = definitions; _a < definitions_1.length; _a++) {
4248
4315
  var definition = definitions_1[_a];
4249
4316
  var hasPrefix = /^s-/.test(definition.identifier);
@@ -4582,10 +4649,14 @@ var __extends = (this && this.__extends) || (function () {
4582
4649
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4583
4650
  };
4584
4651
  })();
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;
4652
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
4653
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4654
+ if (ar || !(i in from)) {
4655
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
4656
+ ar[i] = from[i];
4657
+ }
4658
+ }
4659
+ return to.concat(ar || Array.prototype.slice.call(from));
4589
4660
  };
4590
4661
  var Stacks;
4591
4662
  (function (Stacks) {
@@ -4694,7 +4765,7 @@ var Stacks;
4694
4765
  return elements.find(function (el) { return el.offsetParent !== null; });
4695
4766
  };
4696
4767
  ModalController.prototype.lastVisible = function (elements) {
4697
- return this.firstVisible(__spreadArray([], elements).reverse());
4768
+ return this.firstVisible(__spreadArray([], elements, true).reverse());
4698
4769
  };
4699
4770
  ModalController.prototype.focusInsideModal = function () {
4700
4771
  var _this = this;
@@ -5089,7 +5160,7 @@ var Stacks;
5089
5160
  if (popoverId) {
5090
5161
  popoverElement = document.getElementById(popoverId);
5091
5162
  if (!popoverElement) {
5092
- throw "[" + this.popoverSelectorAttribute + "=\"{POPOVER_ID}\"] required";
5163
+ throw "[".concat(this.popoverSelectorAttribute, "=\"{POPOVER_ID}\"] required");
5093
5164
  }
5094
5165
  }
5095
5166
  else {
@@ -5209,7 +5280,7 @@ var Stacks;
5209
5280
  function attachPopover(element, popover, options) {
5210
5281
  var _a = getPopover(element), referenceElement = _a.referenceElement, existingPopover = _a.popover;
5211
5282
  if (existingPopover) {
5212
- throw "element already has popover with id=\"" + existingPopover.id + "\"";
5283
+ throw "element already has popover with id=\"".concat(existingPopover.id, "\"");
5213
5284
  }
5214
5285
  if (!referenceElement) {
5215
5286
  throw "element has invalid data-s-popover-reference-selector attribute";
@@ -5224,10 +5295,10 @@ var Stacks;
5224
5295
  var existingId = referenceElement.getAttribute("aria-controls");
5225
5296
  var popoverId = popover.id;
5226
5297
  if (!popover.classList.contains('s-popover')) {
5227
- throw "popover should have the \"s-popover\" class but had class=\"" + popover.className + "\"";
5298
+ throw "popover should have the \"s-popover\" class but had class=\"".concat(popover.className, "\"");
5228
5299
  }
5229
5300
  if (existingId && existingId !== popoverId) {
5230
- throw "element has aria-controls=\"" + existingId + "\" but popover has id=\"" + popoverId + "\"";
5301
+ throw "element has aria-controls=\"".concat(existingId, "\" but popover has id=\"").concat(popoverId, "\"");
5231
5302
  }
5232
5303
  if (!popoverId) {
5233
5304
  popoverId = "--stacks-s-popover-" + Math.random().toString(36).substring(2, 10);
@@ -5603,10 +5674,14 @@ var Stacks;
5603
5674
  this.boundHide = this.boundHide || this.hide.bind(this);
5604
5675
  this.referenceElement.addEventListener("mouseover", this.boundScheduleShow);
5605
5676
  this.referenceElement.addEventListener("mouseout", this.boundHide);
5677
+ this.referenceElement.addEventListener("focus", this.boundScheduleShow);
5678
+ this.referenceElement.addEventListener("blur", this.boundHide);
5606
5679
  };
5607
5680
  TooltipController.prototype.unbindMouseEvents = function () {
5608
5681
  this.referenceElement.removeEventListener("mouseover", this.boundScheduleShow);
5609
5682
  this.referenceElement.removeEventListener("mouseout", this.boundHide);
5683
+ this.referenceElement.removeEventListener("focus", this.boundScheduleShow);
5684
+ this.referenceElement.removeEventListener("blur", this.boundHide);
5610
5685
  };
5611
5686
  TooltipController.generateId = function () {
5612
5687
  return "--stacks-s-tooltip-" + Math.random().toString(36).substring(2, 10);
@@ -5696,7 +5771,7 @@ var Stacks;
5696
5771
  var headingElement = document.createElement("div");
5697
5772
  headingElement.classList.add("s-uploader--previews-heading");
5698
5773
  headingElement.innerText = res.length < count ?
5699
- "Showing " + res.length + " of " + count + " files" : count + " items";
5774
+ "Showing ".concat(res.length, " of ").concat(count, " files") : "".concat(count, " items");
5700
5775
  _this.previewsTarget.appendChild(headingElement);
5701
5776
  _this.previewsTarget.classList.add("has-multiple");
5702
5777
  }