@invoicebox/ui 0.1.0-alpha.77 → 0.1.0-alpha.78

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.
@@ -8,8 +8,6 @@ exports.Dropdown = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var S = _interopRequireWildcard(require("./styles"));
10
10
  var _palette = require("../../../palette");
11
- var _styledComponents = require("styled-components");
12
- var _excluded = ["children"];
13
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
15
13
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -18,32 +16,23 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
18
16
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
17
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
20
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
22
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
23
19
  var Dropdown = exports.Dropdown = function Dropdown(_ref) {
24
20
  var children = _ref.children,
25
- props = _objectWithoutProperties(_ref, _excluded);
26
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.StyleSheetManager, {
27
- disableCSSOMInjection: true
28
- }, /*#__PURE__*/_react["default"].createElement(DropdownInner, props, children));
29
- };
30
- var DropdownInner = function DropdownInner(_ref2) {
31
- var children = _ref2.children,
32
- isOpen = _ref2.isOpen,
33
- _ref2$isAutoPosition = _ref2.isAutoPosition,
34
- isAutoPosition = _ref2$isAutoPosition === void 0 ? false : _ref2$isAutoPosition,
35
- _ref2$positionVertica = _ref2.positionVertical,
36
- positionVertical = _ref2$positionVertica === void 0 ? 5 : _ref2$positionVertica,
37
- _ref2$positionLeft = _ref2.positionLeft,
38
- positionLeft = _ref2$positionLeft === void 0 ? '0px' : _ref2$positionLeft,
39
- _ref2$positionRight = _ref2.positionRight,
40
- positionRight = _ref2$positionRight === void 0 ? 'auto' : _ref2$positionRight,
41
- _ref2$minWidth = _ref2.minWidth,
42
- minWidth = _ref2$minWidth === void 0 ? 'auto' : _ref2$minWidth,
43
- _ref2$width = _ref2.width,
44
- width = _ref2$width === void 0 ? 'auto' : _ref2$width,
45
- zIndex = _ref2.zIndex,
46
- onCloseTransitionEnd = _ref2.onCloseTransitionEnd;
21
+ isOpen = _ref.isOpen,
22
+ _ref$isAutoPosition = _ref.isAutoPosition,
23
+ isAutoPosition = _ref$isAutoPosition === void 0 ? false : _ref$isAutoPosition,
24
+ _ref$positionVertical = _ref.positionVertical,
25
+ positionVertical = _ref$positionVertical === void 0 ? 5 : _ref$positionVertical,
26
+ _ref$positionLeft = _ref.positionLeft,
27
+ positionLeft = _ref$positionLeft === void 0 ? '0px' : _ref$positionLeft,
28
+ _ref$positionRight = _ref.positionRight,
29
+ positionRight = _ref$positionRight === void 0 ? 'auto' : _ref$positionRight,
30
+ _ref$minWidth = _ref.minWidth,
31
+ minWidth = _ref$minWidth === void 0 ? 'auto' : _ref$minWidth,
32
+ _ref$width = _ref.width,
33
+ width = _ref$width === void 0 ? 'auto' : _ref$width,
34
+ zIndex = _ref.zIndex,
35
+ onCloseTransitionEnd = _ref.onCloseTransitionEnd;
47
36
  var palette = (0, _palette.useComponentPalette)('dropdown');
48
37
  var position = (0, _react.useRef)({
49
38
  isAbove: true,
@@ -58,11 +47,11 @@ var DropdownInner = function DropdownInner(_ref2) {
58
47
  if (isOpen) return;
59
48
  if (onCloseTransitionEnd) onCloseTransitionEnd();
60
49
  }, [isOpen, onCloseTransitionEnd]);
61
- var getPosition = (0, _react.useCallback)(function (_ref3) {
62
- var dropdownHeight = _ref3.dropdownHeight,
63
- belowHeight = _ref3.belowHeight,
64
- aboveHeight = _ref3.aboveHeight,
65
- dropdownIndent = _ref3.dropdownIndent;
50
+ var getPosition = (0, _react.useCallback)(function (_ref2) {
51
+ var dropdownHeight = _ref2.dropdownHeight,
52
+ belowHeight = _ref2.belowHeight,
53
+ aboveHeight = _ref2.aboveHeight,
54
+ dropdownIndent = _ref2.dropdownIndent;
66
55
  var isEnoughSpaceBelow = belowHeight >= dropdownHeight + dropdownIndent;
67
56
  if (isEnoughSpaceBelow) return {
68
57
  isAbove: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invoicebox/ui",
3
- "version": "0.1.0-alpha.77",
3
+ "version": "0.1.0-alpha.78",
4
4
  "description": "Invoicebox UI",
5
5
  "license": "Apache License 2.0",
6
6
  "scripts": {
@@ -43,6 +43,7 @@
43
43
  "prettier": "^3.2.5",
44
44
  "prop-types": "^15.8.1",
45
45
  "storybook": "^7.6.13",
46
+ "styled-components": "^6.1.8",
46
47
  "typescript": "^4.9.5",
47
48
  "webpack": "^5.90.1"
48
49
  },
@@ -51,11 +52,11 @@
51
52
  "hex-to-rgba": "^2.0.1",
52
53
  "lottie-react": "^2.4.0",
53
54
  "react-calendar": "^4.8.0",
54
- "react-scrollbars-custom": "^4.1.1",
55
- "styled-components": "^6.1.8"
55
+ "react-scrollbars-custom": "^4.1.1"
56
56
  },
57
57
  "peerDependencies": {
58
- "react": "^18.2.0"
58
+ "react": "^18.2.0",
59
+ "styled-components": "^6.1.8"
59
60
  },
60
61
  "engines": {
61
62
  "node": "^16.17.1"