@startlibs/components 1.0.0-alpha-8d3 → 1.0.0-alpha-8d4

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 (2) hide show
  1. package/lib/index.js +29 -17
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -113,7 +113,9 @@ var Icon = styled__default(styled.withTheme(IconComponent)).withConfig({
113
113
  displayName: "Icon",
114
114
  componentId: "wsq54u-0"
115
115
  })(["font-family:'", "' !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;user-select:none;", ""], function (props) {
116
- return props.theme.iconFont;
116
+ var _props$theme;
117
+
118
+ return (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.iconFont;
117
119
  }, function (props) {
118
120
  return props.clickable && "\n cursor: pointer;\n &:hover {\n opacity: 0.85;\n }\n ";
119
121
  });
@@ -2275,7 +2277,9 @@ var Notification$1 = styled__default.div.withConfig({
2275
2277
  var NotificationWrapper = styled__default.div.withConfig({
2276
2278
  displayName: "PersistentNotifications__NotificationWrapper",
2277
2279
  componentId: "sc-1t7i0dh-2"
2278
- })(["background:white;margin-top:4rem;margin-right:0.75rem;margin-left:0.75rem;padding:5px;border-radius:10px;box-shadow:0 0 10px 0 rgba(0,0,0,0.1),0 1px 2px 1px rgba(0,0,0,0.15);max-width:360px;"]);
2280
+ })(["background:white;margin-top:", ";margin-right:0.75rem;margin-left:0.75rem;padding:5px;border-radius:10px;box-shadow:0 0 10px 0 rgba(0,0,0,0.1),0 1px 2px 1px rgba(0,0,0,0.15);max-width:360px;"], function (props) {
2281
+ return props.marginTop || "4rem";
2282
+ });
2279
2283
  var PersistentNotifications = function PersistentNotifications() {
2280
2284
  var _useNotifications = useNotifications(),
2281
2285
  _useNotifications2 = _slicedToArray(_useNotifications, 2),
@@ -2294,11 +2298,13 @@ var PersistentNotifications = function PersistentNotifications() {
2294
2298
 
2295
2299
  var _notifications$ = notifications[0],
2296
2300
  content = _notifications$.content,
2297
- type = _notifications$.type;
2301
+ type = _notifications$.type,
2302
+ marginTop = _notifications$.marginTop;
2298
2303
  return React__default.createElement(core.Fill, {
2299
2304
  name: "PersistentNotifications"
2300
2305
  }, React__default.createElement(FlipNotification$1, {
2301
- type: type
2306
+ type: type,
2307
+ marginTop: marginTop
2302
2308
  }, utils.callIfFunction(content, closeMessage)));
2303
2309
  };
2304
2310
 
@@ -2308,7 +2314,9 @@ var FlipNotification$1 = function FlipNotification(props) {
2308
2314
  return React__default.createElement(NotificationContainer$1, {
2309
2315
  className: "JS-fix-dialog-scroll",
2310
2316
  ref: ref
2311
- }, React__default.createElement(NotificationWrapper, null, React__default.createElement(Notification$1, _extends({
2317
+ }, React__default.createElement(NotificationWrapper, {
2318
+ marginTop: props.marginTop
2319
+ }, React__default.createElement(Notification$1, _extends({
2312
2320
  id: "js-share-notification"
2313
2321
  }, props))));
2314
2322
  };
@@ -2418,7 +2426,8 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2418
2426
  keepWidth = _ref$keepWidth === void 0 ? true : _ref$keepWidth,
2419
2427
  _ref$boundMargin = _ref.boundMargin,
2420
2428
  boundMargin = _ref$boundMargin === void 0 ? 6 : _ref$boundMargin,
2421
- respectBounds = _ref.respectBounds;
2429
+ respectBounds = _ref.respectBounds,
2430
+ respectOffsetScroll = _ref.respectOffsetScroll;
2422
2431
  var placeholder = React.useRef();
2423
2432
  var arrowRef = core.useEnsureRef(arrowRefOpt);
2424
2433
 
@@ -2443,7 +2452,7 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2443
2452
  return;
2444
2453
  }
2445
2454
 
2446
- var usingLayer = useLayers && getDialogLayersSize() > 0;
2455
+ var usingLayer = respectOffsetScroll || useLayers && getDialogLayersSize() > 0;
2447
2456
  var scrollOwner = usingLayer ? utils.getClosestOffsetScroll(element.current.offsetParent) : {
2448
2457
  scrollTop: window.pageYOffset,
2449
2458
  scrollLeft: window.pageXOffset // console.log({scrollOwner,scrollTop:scrollOwner.scrollTop,pageYOffset:window.pageYOffset})
@@ -2452,9 +2461,12 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2452
2461
  var scrollY = !isNaN(scrollOwner.scrollTop) ? scrollOwner.scrollTop : window.pageYOffset;
2453
2462
  var scrollX = !isNaN(scrollOwner.scrollLeft) ? scrollOwner.scrollLeft : window.pageXOffset;
2454
2463
 
2455
- var _placeholder$current$ = placeholder.current.getBoundingClientRect(),
2456
- leftPlusBorder = _placeholder$current$.left,
2457
- topPlusBorder = _placeholder$current$.top;
2464
+ var _ref2 = respectOffsetScroll ? {
2465
+ top: placeholder.current.offsetParent.offsetTop,
2466
+ left: placeholder.current.offsetParent.offsetLeft
2467
+ } : placeholder.current.getBoundingClientRect(),
2468
+ leftPlusBorder = _ref2.left,
2469
+ topPlusBorder = _ref2.top;
2458
2470
 
2459
2471
  var _window$getComputedSt = window.getComputedStyle(placeholder.current.offsetParent),
2460
2472
  borderLeftWidth = _window$getComputedSt.borderLeftWidth,
@@ -2462,9 +2474,9 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2462
2474
 
2463
2475
  var left = leftPlusBorder - parseInt(borderLeftWidth, 10);
2464
2476
  var top = topPlusBorder - parseInt(borderTopWidth, 10);
2465
- var _placeholder$current$2 = placeholder.current.offsetParent,
2466
- parentOffsetWidth = _placeholder$current$2.offsetWidth,
2467
- parentOffsetHeight = _placeholder$current$2.offsetHeight;
2477
+ var _placeholder$current$ = placeholder.current.offsetParent,
2478
+ parentOffsetWidth = _placeholder$current$.offsetWidth,
2479
+ parentOffsetHeight = _placeholder$current$.offsetHeight;
2468
2480
  var _element$current = element.current,
2469
2481
  popupOffsetWidth = _element$current.offsetWidth,
2470
2482
  popupOffsetHeight = _element$current.offsetHeight;
@@ -2521,10 +2533,10 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2521
2533
  var arrowOnVerticalSide = arrowSide === 'left' || arrowSide === 'right';
2522
2534
  var arrowSize = arrowElement ? arrowElement.getBoundingClientRect()[arrowOnVerticalSide ? 'height' : 'width'] : ARROW_DEFAULT_SIZE * Math.sqrt(2);
2523
2535
 
2524
- var _ref2 = arrowOnVerticalSide ? processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetHeight, popupOffsetHeight, processedTop - top, flippedV) : processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetWidth, popupOffsetWidth, processedLeft - left, flippedV),
2525
- _ref3 = _slicedToArray(_ref2, 2),
2526
- arrowOffset = _ref3[0],
2527
- popupArrowOffset = _ref3[1];
2536
+ var _ref3 = arrowOnVerticalSide ? processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetHeight, popupOffsetHeight, processedTop - top, flippedV) : processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetWidth, popupOffsetWidth, processedLeft - left, flippedV),
2537
+ _ref4 = _slicedToArray(_ref3, 2),
2538
+ arrowOffset = _ref4[0],
2539
+ popupArrowOffset = _ref4[1];
2528
2540
 
2529
2541
  var maxHeight = window.innerHeight - (POSITIONING_BOUNDS.top + POSITIONING_BOUNDS.bottom) - (respectBounds ? boundMargin * 2 : 0);
2530
2542
  var maxWidth = window.innerWidth - (POSITIONING_BOUNDS.left + POSITIONING_BOUNDS.right) - (respectBounds ? boundMargin * 2 : 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startlibs/components",
3
- "version": "1.0.0-alpha-8d3",
3
+ "version": "1.0.0-alpha-8d4",
4
4
  "description": "Startlibs Components",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": false,