@loomhq/lens 10.32.13 → 10.33.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.
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { autoUpdate, flip, offset as floatingUiOffset, shift, useFloating, } from '@floating-ui/react-dom';
12
+ import { autoUpdate, flip, offset as floatingUiOffset, limitShift, shift, useFloating, } from '@floating-ui/react-dom';
13
13
  import React, { useEffect } from 'react';
14
14
  import ReactDOM from 'react-dom';
15
15
  import styled from '@emotion/styled';
@@ -55,13 +55,14 @@ const Popover = (_a) => {
55
55
  const { x, y, reference, floating, strategy, update, refs } = useFloating({
56
56
  placement: placements[placement],
57
57
  middleware: [
58
- flip({
59
- fallbackPlacements: ['top', 'bottom'],
60
- fallbackStrategy: 'initialPlacement',
61
- }),
62
58
  shift({
63
59
  padding: unitBoundaryOffset,
64
60
  boundary: boundaryElement ? getBoundaryElement() : undefined,
61
+ limiter: limitShift(),
62
+ }),
63
+ flip({
64
+ fallbackPlacements: ['top', 'bottom'],
65
+ fallbackStrategy: 'initialPlacement',
65
66
  }),
66
67
  floatingUiOffset(unitOffset),
67
68
  ],
@@ -9,12 +9,12 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getRadius, getShadow, getColorValue, u } from '../../utilities';
13
- import IconButton from '../icon-button/icon-button';
14
12
  import React, { useEffect } from 'react';
13
+ import { getColorValue, getRadius, getShadow, u } from '../../utilities';
14
+ import IconButton from '../icon-button/icon-button';
15
15
  import { SvgClose } from '../icon/available-icons';
16
- import styled from '@emotion/styled';
17
16
  import { keyframes } from '@emotion/core';
17
+ import styled from '@emotion/styled';
18
18
  const toastDuration = 3000;
19
19
  const enter = keyframes `
20
20
  from {
@@ -66,7 +66,7 @@ const Toast = (_a) => {
66
66
  }, toastDuration);
67
67
  return () => clearTimeout(timer);
68
68
  }, [isOpen, onCloseClick]);
69
- return (React.createElement(React.Fragment, null, isOpen && (React.createElement(ToastWrapper, Object.assign({ className: "theme-dark", onClick: e => e.stopPropagation(), zIndex: zIndex, isOpen: isOpen }, props),
69
+ return (React.createElement(React.Fragment, null, isOpen && (React.createElement(ToastWrapper, Object.assign({ "data-lens-theme": "dark", onClick: e => e.stopPropagation(), zIndex: zIndex, isOpen: isOpen }, props),
70
70
  React.createElement(ChildrenSection, { "aria-live": "polite" }, children),
71
71
  onCloseClick && (React.createElement(IconButton, { altText: "Close", icon: React.createElement(SvgClose, null), onClick: onCloseClick }))))));
72
72
  };
@@ -99,11 +99,13 @@ export const getThemeStylesString = (customRootElement = ':root') => {
99
99
  const rootElement = customRootElement || ':root';
100
100
  return `
101
101
  ${rootElement},
102
- .theme-light {
102
+ .theme-light,
103
+ [data-lens-theme="light"] {
103
104
  ${assignLightThemeColors().join('')}
104
105
  }
105
106
 
106
- .theme-dark {
107
+ .theme-dark,
108
+ [data-lens-theme="dark"] {
107
109
  ${assignDarkThemeColors().join('')}
108
110
  }
109
111
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.32.13",
3
+ "version": "10.33.1",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",
@@ -38,8 +38,8 @@
38
38
  "react-dom": "^17.0.2"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/cli": "^7.8.4",
42
- "@babel/core": "7.8.4",
41
+ "@babel/cli": "^7.16.0",
42
+ "@babel/core": "^7.14.0",
43
43
  "@babel/plugin-proposal-class-properties": "^7.8.3",
44
44
  "@babel/preset-env": "^7.8.4",
45
45
  "@babel/preset-react": "^7.8.3",