@invoicebox/ui 0.1.0-alpha.270 → 0.1.0-alpha.274

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.
@@ -3,5 +3,6 @@ export type TProps = {
3
3
  children: ReactNode;
4
4
  maxHeight?: number;
5
5
  trackWidth?: number;
6
+ autoHeight?: boolean;
6
7
  };
7
8
  export declare const Scrollbar: FC<TProps>;
@@ -1,72 +1,52 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.Scrollbar = void 0;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _reactScrollbarsCustom = require("react-scrollbars-custom");
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactCustomScrollbars = require("react-custom-scrollbars-2");
10
9
  var _palette = require("../../../palette");
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); }
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 && {}.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; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13
12
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
18
  var Scrollbar = exports.Scrollbar = function Scrollbar(_ref) {
15
19
  var children = _ref.children,
16
20
  _ref$maxHeight = _ref.maxHeight,
17
21
  maxHeight = _ref$maxHeight === void 0 ? '100%' : _ref$maxHeight,
18
22
  _ref$trackWidth = _ref.trackWidth,
19
- trackWidth = _ref$trackWidth === void 0 ? 4 : _ref$trackWidth;
23
+ trackWidth = _ref$trackWidth === void 0 ? 4 : _ref$trackWidth,
24
+ _ref$autoHeight = _ref.autoHeight,
25
+ autoHeight = _ref$autoHeight === void 0 ? true : _ref$autoHeight;
20
26
  var palette = (0, _palette.useComponentPalette)('scrollbar');
21
- var props = (0, _react.useMemo)(function () {
22
- return {
23
- style: {
24
- maxHeight: maxHeight,
25
- minWidth: '100%',
26
- maxWidth: '100%'
27
- },
28
- wrapperProps: {
29
- style: {
30
- right: '0px',
31
- bottom: '0px'
32
- }
33
- },
34
- contentProps: {
35
- style: {
36
- display: 'block'
37
- }
38
- },
39
- thumbYProps: {
40
- style: {
41
- backgroundColor: palette.thumb
42
- }
43
- },
44
- trackYProps: {
45
- style: {
46
- backgroundColor: 'transparent',
47
- width: "".concat(trackWidth, "px"),
48
- height: 'calc(100% - 4px)',
49
- top: '2px',
50
- right: '2px'
51
- }
52
- },
53
- thumbXProps: {
54
- style: {
55
- backgroundColor: palette.thumb
56
- }
57
- },
58
- trackXProps: {
59
- style: {
60
- backgroundColor: 'transparent',
61
- height: '6px',
62
- width: 'calc(100% - 12px)',
63
- left: '2px',
64
- bottom: '2px'
65
- }
66
- }
67
- };
68
- }, [maxHeight, palette.thumb, trackWidth]);
69
- return /*#__PURE__*/_react["default"].createElement(_reactScrollbarsCustom.Scrollbar, _extends({
70
- translateContentSizesToHolder: true
71
- }, props), children);
27
+ var renderThumbVertical = function renderThumbVertical(thumbProps) {
28
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({}, thumbProps, {
29
+ style: _objectSpread(_objectSpread({}, thumbProps.style), {}, {
30
+ backgroundColor: palette.thumb,
31
+ width: trackWidth,
32
+ borderRadius: '4px'
33
+ })
34
+ }));
35
+ };
36
+ var renderThumbHorizontal = function renderThumbHorizontal(thumbProps) {
37
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({}, thumbProps, {
38
+ style: _objectSpread(_objectSpread({}, thumbProps.style), {}, {
39
+ backgroundColor: palette.thumb,
40
+ height: trackWidth,
41
+ borderRadius: '4px'
42
+ })
43
+ }));
44
+ };
45
+ return /*#__PURE__*/_react["default"].createElement(_reactCustomScrollbars.Scrollbars, {
46
+ autoHeight: autoHeight,
47
+ autoHeightMin: 0,
48
+ autoHeightMax: maxHeight,
49
+ renderThumbHorizontal: renderThumbHorizontal,
50
+ renderThumbVertical: renderThumbVertical
51
+ }, children);
72
52
  };
@@ -7,6 +7,7 @@ exports["default"] = exports.Horisontall = exports.Default = exports.ByContainer
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _ = require(".");
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
10
11
  var meta = {
11
12
  title: 'common/Scrollbar',
12
13
  component: _.Scrollbar,
@@ -42,6 +43,8 @@ var ByContainer = exports.ByContainer = {
42
43
  style: {
43
44
  height: 200
44
45
  }
45
- }, /*#__PURE__*/_react["default"].createElement(_.Scrollbar, args, longDummyText));
46
+ }, /*#__PURE__*/_react["default"].createElement(_.Scrollbar, _extends({
47
+ autoHeight: false
48
+ }, args), longDummyText));
46
49
  }
47
50
  };
@@ -4,6 +4,7 @@ import { TSizes } from '../../constants';
4
4
  import { CurrencyInputProps } from 'react-currency-input-field';
5
5
  export type TProps = Pick<CurrencyInputProps, 'allowNegativeValue' | 'onValueChange' | 'value' | 'defaultValue' | 'allowDecimals'> & Pick<TInputLabelProps, 'label' | 'disabled'> & {
6
6
  hasError?: boolean;
7
+ required?: boolean;
7
8
  } & {
8
9
  size?: TSizes;
9
10
  };
@@ -24,7 +24,9 @@ var CoreCurrencyInput = exports.CoreCurrencyInput = function CoreCurrencyInput(_
24
24
  defaultValue = _ref.defaultValue,
25
25
  _ref$allowDecimals = _ref.allowDecimals,
26
26
  allowDecimals = _ref$allowDecimals === void 0 ? true : _ref$allowDecimals,
27
- disabled = _ref.disabled;
27
+ disabled = _ref.disabled,
28
+ _ref$required = _ref.required,
29
+ required = _ref$required === void 0 ? false : _ref$required;
28
30
  var _useInputFocus = (0, _useInputFocus2.useInputFocus)(),
29
31
  inFocus = _useInputFocus.inFocus,
30
32
  handleFocus = _useInputFocus.handleFocus,
@@ -37,7 +39,8 @@ var CoreCurrencyInput = exports.CoreCurrencyInput = function CoreCurrencyInput(_
37
39
  return /*#__PURE__*/_react["default"].createElement(_InputLabel.InputLabel, {
38
40
  inFocus: inFocus,
39
41
  label: label,
40
- disabled: disabled
42
+ disabled: disabled,
43
+ required: required
41
44
  }, /*#__PURE__*/_react["default"].createElement(_styles.StyledCurrencyInputFromLibrary, {
42
45
  $palette: palette,
43
46
  $hasBorder: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invoicebox/ui",
3
- "version": "0.1.0-alpha.270",
3
+ "version": "0.1.0-alpha.274",
4
4
  "description": "Invoicebox UI",
5
5
  "license": "Apache License 2.0",
6
6
  "scripts": {
@@ -60,8 +60,8 @@
60
60
  "qrcode.react": "^3.1.0",
61
61
  "react-calendar": "^4.8.0",
62
62
  "react-currency-input-field": "^3.10.0",
63
+ "react-custom-scrollbars-2": "^4.5.0",
63
64
  "react-responsive": "^9.0.2",
64
- "react-scrollbars-custom": "^4.1.1",
65
65
  "react-spring-bottom-sheet": "^3.4.1",
66
66
  "react-toastify": "^9.1.3"
67
67
  },