@commonsku/styles 1.16.4 → 1.16.6

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.
package/dist/index.js CHANGED
@@ -372,7 +372,19 @@ var getUnit = function (measurement) {
372
372
  var stripUnit = function (measurement) {
373
373
  return (typeof measurement === "number") ? measurement : parseFloat(measurement);
374
374
  };
375
- var parseMeasurement = function (measurement) { return stripUnit(measurement) + getUnit(measurement); };
375
+ var parseMeasurement = function (measurement) { return stripUnit(measurement) + getUnit(measurement); };
376
+ var wait = function (time) {
377
+ var timeoutId;
378
+ var promise = new Promise(function (resolve) {
379
+ timeoutId = setTimeout(resolve, time);
380
+ });
381
+ return {
382
+ promise: promise,
383
+ cancel: function () {
384
+ clearTimeout(timeoutId);
385
+ },
386
+ };
387
+ };
376
388
 
377
389
  var SharedStyles = styled.css(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n box-sizing: border-box;\n ", "\n"], ["\n box-sizing: border-box;\n ", "\n"])), function (p) { return _.map(_.pick(p, _.keys(SHARED_STYLE_MAPS)), function (v, k) {
378
390
  return _.isUndefined(v) ? '' : SHARED_STYLE_MAPS[k](v);
@@ -2841,6 +2853,75 @@ var ButtonIcon = React__default.forwardRef(function (props, ref) {
2841
2853
  });
2842
2854
  var templateObject_1$d, templateObject_2$8;
2843
2855
 
2856
+ var LOADING_IMG_SRC = '/images/gears.gif';
2857
+ var NOT_FOUND_IMG_SRC = '/images/404.png';
2858
+ var DEFAULT_MAX_ATTEMPTS = 3;
2859
+ var DEFAULT_ATTEMPT_INTERVAL = 1000;
2860
+ // fetch image src, and return intervals.length times on error. wait intervals[n] ms on nth retry
2861
+ var fetchImage = function (src, intervals, onRetry) {
2862
+ var image = new Image();
2863
+ var cancel = function () {
2864
+ image.src = '';
2865
+ };
2866
+ var promise = new Promise(function (resolve, reject) {
2867
+ image.src = src;
2868
+ image.onload = resolve;
2869
+ image.onerror = reject;
2870
+ }).catch(function (error) {
2871
+ if (_.isEmpty(intervals)) {
2872
+ throw error;
2873
+ }
2874
+ else if (image.src === '') {
2875
+ return error;
2876
+ }
2877
+ else {
2878
+ onRetry && onRetry(error);
2879
+ var w = wait(intervals[0]);
2880
+ cancel = w.cancel;
2881
+ return w.promise.then(function () {
2882
+ var result = fetchImage(src, _.tail(intervals), onRetry);
2883
+ cancel = result.cancel;
2884
+ return result.promise;
2885
+ });
2886
+ }
2887
+ });
2888
+ return {
2889
+ promise: promise,
2890
+ cancel: function () {
2891
+ // use this to cancel next fetch
2892
+ cancel();
2893
+ }
2894
+ };
2895
+ };
2896
+ var Img = React__default.forwardRef(function (_a, ref) {
2897
+ var src = _a.src, _b = _a.alt, alt = _b === void 0 ? "" : _b, _c = _a.max_attempts, max_attempts = _c === void 0 ? DEFAULT_MAX_ATTEMPTS : _c, _d = _a.attempt_interval, attempt_interval = _d === void 0 ? DEFAULT_ATTEMPT_INTERVAL : _d, _e = _a.onRetry, onRetry = _e === void 0 ? null : _e, _f = _a.onFailed, onFailed = _f === void 0 ? null : _f, props = __rest(_a, ["src", "alt", "max_attempts", "attempt_interval", "onRetry", "onFailed"]);
2898
+ var _g = React.useState(true), loading = _g[0], setLoading = _g[1];
2899
+ var _h = React.useState(null), error = _h[0], setError = _h[1];
2900
+ var effectRef = React.useRef({});
2901
+ _.assign(effectRef.current, { onRetry: onRetry, onFailed: onFailed });
2902
+ React.useEffect(function () {
2903
+ var _a = effectRef.current, onRetry = _a.onRetry, onFailed = _a.onFailed, cancel = _a.cancel;
2904
+ // cancel previous fetch before start new fetch
2905
+ cancel && cancel();
2906
+ var result = fetchImage(src !== null && src !== void 0 ? src : "", _.map(_.range(max_attempts), function (i) {
2907
+ return attempt_interval * (i + 1) * (i + 1);
2908
+ }), onRetry);
2909
+ effectRef.current.cancel = result.cancel;
2910
+ result.promise
2911
+ .then(function () {
2912
+ setError(null);
2913
+ })
2914
+ .catch(function (e) {
2915
+ onFailed && onFailed(e);
2916
+ setError(e);
2917
+ })
2918
+ .finally(function () {
2919
+ setLoading(false);
2920
+ });
2921
+ }, [src, attempt_interval, max_attempts]);
2922
+ return React__default.createElement("img", __assign({ ref: ref, alt: alt, src: loading ? LOADING_IMG_SRC : (error ? NOT_FOUND_IMG_SRC : src) }, props));
2923
+ });
2924
+
2844
2925
  var Label = styled__default.label(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n &&& {\n font-family: 'skufont-medium', sans-serif;\n color: ", ";\n font-size: 1rem;\n font-weight: 400;\n width: 100%;\n ", "\n }\n"], ["\n &&& {\n font-family: 'skufont-medium', sans-serif;\n color: ", ";\n font-size: 1rem;\n font-weight: 400;\n width: 100%;\n ", "\n }\n"])), function (props) { return props.error ? getThemeColor(props, 'special3') : getThemeColor(props, 'textlabel'); }, SharedStyles);
2845
2926
  var templateObject_1$e;
2846
2927
 
@@ -2938,10 +3019,10 @@ var LabeledInput = React__default.forwardRef(function (_a, ref) {
2938
3019
  React__default.createElement(Input, __assign({ ref: ref, name: name, required: required }, props))));
2939
3020
  });
2940
3021
  var LabeledIconInput = React__default.forwardRef(function (_a, ref) {
2941
- var label = _a.label, name = _a.name, value = _a.value, defaultValue = _a.defaultValue, placeholder = _a.placeholder, required = _a.required, _b = _a.labelOnTop, labelOnTop = _b === void 0 ? false : _b, Icon = _a.Icon, noMargin = _a.noMargin, error = _a.error, disabled = _a.disabled, onFocus = _a.onFocus, onChange = _a.onChange, onBlur = _a.onBlur, _c = _a.iconPosition, iconPosition = _c === void 0 ? 'left' : _c, _d = _a.iconLabelStyles, iconLabelStyles = _d === void 0 ? {} : _d, props = __rest(_a, ["label", "name", "value", "defaultValue", "placeholder", "required", "labelOnTop", "Icon", "noMargin", "error", "disabled", "onFocus", "onChange", "onBlur", "iconPosition", "iconLabelStyles"]);
3022
+ var label = _a.label, name = _a.name, value = _a.value, defaultValue = _a.defaultValue, placeholder = _a.placeholder, required = _a.required, _b = _a.labelOnTop, labelOnTop = _b === void 0 ? false : _b, Icon = _a.Icon, noMargin = _a.noMargin, error = _a.error, disabled = _a.disabled, onFocus = _a.onFocus, onChange = _a.onChange, onBlur = _a.onBlur, _c = _a.iconPosition, iconPosition = _c === void 0 ? 'left' : _c, _d = _a.iconColor, iconColor = _d === void 0 ? '#fff' : _d, _e = _a.iconLabelStyles, iconLabelStyles = _e === void 0 ? {} : _e, _f = _a.containerStyle, containerStyle = _f === void 0 ? {} : _f, props = __rest(_a, ["label", "name", "value", "defaultValue", "placeholder", "required", "labelOnTop", "Icon", "noMargin", "error", "disabled", "onFocus", "onChange", "onBlur", "iconPosition", "iconColor", "iconLabelStyles", "containerStyle"]);
2942
3023
  var containerRef = React.useRef(null);
2943
- var _e = React.useState(false), isActive = _e[0], setIsActive = _e[1];
2944
- var _f = React.useState(false), isHovering = _f[0], setIsHovering = _f[1];
3024
+ var _g = React.useState(false), isActive = _g[0], setIsActive = _g[1];
3025
+ var _h = React.useState(false), isHovering = _h[0], setIsHovering = _h[1];
2945
3026
  var activeBorderColor = getThemeColor(props, 'input.active.border', colors.input.active.border);
2946
3027
  var activeTextColor = colors.input.active.text;
2947
3028
  var errorBorderColor = getThemeColor(props, 'input.error.border', colors.input.error.border);
@@ -2966,8 +3047,8 @@ var LabeledIconInput = React__default.forwardRef(function (_a, ref) {
2966
3047
  };
2967
3048
  var NewIcon = React__default.useMemo(function () {
2968
3049
  var iconProps = {
2969
- fill: '#fff',
2970
- color: '#fff',
3050
+ fill: iconColor,
3051
+ color: iconColor,
2971
3052
  };
2972
3053
  if (error) {
2973
3054
  iconProps['fill'] = errorBorderColor;
@@ -2986,7 +3067,7 @@ var LabeledIconInput = React__default.forwardRef(function (_a, ref) {
2986
3067
  iconProps['color'] = colors.input.icon.active.fill;
2987
3068
  }
2988
3069
  return React__default.cloneElement(Icon, iconProps);
2989
- }, [Icon, error, disabled, errorBorderColor, isActive, isHovering]);
3070
+ }, [Icon, error, disabled, errorBorderColor, isActive, isHovering, iconColor]);
2990
3071
  var onClickOutside = function (e) {
2991
3072
  if (containerRef.current && !containerRef.current.contains(e.target)) {
2992
3073
  setIsActive(false);
@@ -2998,7 +3079,7 @@ var LabeledIconInput = React__default.forwardRef(function (_a, ref) {
2998
3079
  document$1.removeEventListener('click', onClickOutside);
2999
3080
  };
3000
3081
  }, []);
3001
- return (React__default.createElement("div", null,
3082
+ return (React__default.createElement("div", { style: containerStyle },
3002
3083
  label ? React__default.createElement(Label, { htmlFor: name, style: __assign(__assign({}, (!labelOnTop ? {} : { display: 'block' })), { fontFamily: "'skufont-medium', sans-serif", lineHeight: '24px', fontSize: '16px', color: getThemeColor(props, 'neutrals.100') }) },
3003
3084
  label,
3004
3085
  " ",
@@ -3427,11 +3508,12 @@ var templateObject_1$m, templateObject_2$d, templateObject_3$6, templateObject_4
3427
3508
 
3428
3509
  var useClickOutside = function (props) {
3429
3510
  var ref = props.ref, _a = props.eventType, eventType = _a === void 0 ? 'mousedown' : _a, onClick = props.onClick, onCleanup = props.onCleanup;
3511
+ var effectRef = React.useRef({});
3512
+ _.assign(effectRef.current, { eventType: eventType, onCleanup: onCleanup, ref: ref, onClick: onClick });
3430
3513
  React.useEffect(function () {
3514
+ var _a = effectRef.current, eventType = _a.eventType, onCleanup = _a.onCleanup, ref = _a.ref, onClick = _a.onClick;
3431
3515
  function handleClickOutside(e) {
3432
- console.log('handleClickOutside');
3433
3516
  if (ref.current && !ref.current.contains(e.target)) {
3434
- console.log('click outside');
3435
3517
  onClick && onClick(e);
3436
3518
  }
3437
3519
  }
@@ -3443,6 +3525,21 @@ var useClickOutside = function (props) {
3443
3525
  }, []);
3444
3526
  };
3445
3527
 
3528
+ function useDelayUnmount(isMounted, delayTime) {
3529
+ var _a = React__default.useState(false), shouldRender = _a[0], setShouldRender = _a[1];
3530
+ React__default.useEffect(function () {
3531
+ var timeoutId;
3532
+ if (isMounted && !shouldRender) {
3533
+ setShouldRender(true);
3534
+ }
3535
+ else if (!isMounted && shouldRender) {
3536
+ timeoutId = setTimeout(function () { return setShouldRender(false); }, delayTime);
3537
+ }
3538
+ return function () { return clearTimeout(timeoutId); };
3539
+ }, [isMounted, delayTime, shouldRender]);
3540
+ return shouldRender;
3541
+ }
3542
+
3446
3543
  var QUERY = '(prefers-reduced-motion: no-preference)';
3447
3544
  var isRenderingOnServer = typeof window$1 === 'undefined';
3448
3545
  var getInitialState = function () {
@@ -3676,7 +3773,7 @@ var PopupContainer = function (_a) {
3676
3773
  return ReactDOM.createPortal(children, ref.current);
3677
3774
  };
3678
3775
  var Popup = React__default.forwardRef(function (_a, forwardedRef) {
3679
- var header = _a.header, _b = _a.noHeader, noHeader = _b === void 0 ? false : _b, title = _a.title, controls = _a.controls, children = _a.children, onClose = _a.onClose, _c = _a.noCloseButton, noCloseButton = _c === void 0 ? false : _c, _d = _a.closeOnEsc, closeOnEsc = _d === void 0 ? true : _d, _e = _a.closeOnClickOutside, closeOnClickOutside = _e === void 0 ? false : _e, overlayZIndex = _a.overlayZIndex, props = __rest(_a, ["header", "noHeader", "title", "controls", "children", "onClose", "noCloseButton", "closeOnEsc", "closeOnClickOutside", "overlayZIndex"]);
3776
+ var header = _a.header, _b = _a.noHeader, noHeader = _b === void 0 ? false : _b, title = _a.title, controls = _a.controls, children = _a.children, onClose = _a.onClose, _c = _a.noCloseButton, noCloseButton = _c === void 0 ? false : _c, _d = _a.closeOnEsc, closeOnEsc = _d === void 0 ? true : _d, _e = _a.closeOnClickOutside, closeOnClickOutside = _e === void 0 ? false : _e, overlayZIndex = _a.overlayZIndex, popupClassName = _a.popupClassName, contentClassName = _a.contentClassName, props = __rest(_a, ["header", "noHeader", "title", "controls", "children", "onClose", "noCloseButton", "closeOnEsc", "closeOnClickOutside", "overlayZIndex", "popupClassName", "contentClassName"]);
3680
3777
  var ref = useFallbackRef(forwardedRef);
3681
3778
  useClickOutside({
3682
3779
  ref: ref,
@@ -3704,14 +3801,14 @@ var Popup = React__default.forwardRef(function (_a, forwardedRef) {
3704
3801
  }, [closeOnClickOutside, closeOnEsc, onClose]);
3705
3802
  return React__default.createElement(PopupContainer, null,
3706
3803
  React__default.createElement(Overlay, { zIndex: overlayZIndex },
3707
- React__default.createElement(PopupWindow, __assign({ className: "popup" }, props, { ref: ref }),
3804
+ React__default.createElement(PopupWindow, __assign({ className: "popup" + (popupClassName ? " ".concat(popupClassName) : '') }, props, { ref: ref }),
3708
3805
  noHeader ? null :
3709
3806
  header ? header : (React__default.createElement(PopupHeader, { className: "popup-header", xsStyle: "flex-wrap: wrap-reverse;", smStyle: "flex-wrap: wrap;" },
3710
3807
  React__default.createElement(Col, { style: { textAlign: 'left', alignSelf: 'center' } },
3711
3808
  React__default.createElement("span", { className: "title" }, title)),
3712
3809
  React__default.createElement(Col, { style: { textAlign: 'right', alignSelf: 'center' } }, noCloseButton ? null :
3713
3810
  controls || React__default.createElement(Button, { onClick: onClose }, "Close")))),
3714
- React__default.createElement("div", { className: "popup-content" }, children))));
3811
+ React__default.createElement("div", { className: "popup-content" + (contentClassName ? " ".concat(contentClassName) : '') }, children))));
3715
3812
  });
3716
3813
  var ShowPopup = function (_a) {
3717
3814
  var _b = _a.autoOpen, autoOpen = _b === void 0 ? false : _b, PopupComponent = _a.popup, render = _a.render, _c = _a.closeOnEsc, closeOnEsc = _c === void 0 ? true : _c, _d = _a.closeOnClickOutside, closeOnClickOutside = _d === void 0 ? false : _d, props = __rest(_a, ["autoOpen", "popup", "render", "closeOnEsc", "closeOnClickOutside"]);
@@ -3989,10 +4086,10 @@ var Tabs = /** @class */ (function (_super) {
3989
4086
  };
3990
4087
  Tabs.prototype.render = function () {
3991
4088
  var _this = this;
3992
- var _a = this.props, tabs = _a.tabs, size = _a.size, padded = _a.padded, props = __rest(_a, ["tabs", "size", "padded"]);
4089
+ var _a = this.props, tabs = _a.tabs, size = _a.size, padded = _a.padded, variant = _a.variant, props = __rest(_a, ["tabs", "size", "padded", "variant"]);
3993
4090
  var selectedTab = this.getTab(tabs, this.state.selectedTabIndex);
3994
4091
  return React__default.createElement("div", __assign({}, props),
3995
- React__default.createElement(TabBar, { padded: padded === true }, tabs.map(function (tab, index) { return React__default.createElement(Tab, { key: index, size: size, className: index === _this.state.selectedTabIndex ? 'selected' : '', selected: index === _this.state.selectedTabIndex, onClick: function (e) {
4092
+ React__default.createElement(TabBar, { padded: padded === true }, tabs.map(function (tab, index) { return React__default.createElement(Tab, { key: index, size: tab.size || size, variant: tab.variant || variant, className: index === _this.state.selectedTabIndex ? 'selected' : '', selected: index === _this.state.selectedTabIndex, onClick: function (e) {
3996
4093
  _this.setState({ selectedTabIndex: index });
3997
4094
  var callback = tabs[index].onClick;
3998
4095
  if (callback) {
@@ -4154,227 +4251,6 @@ var Product = function (props) {
4154
4251
  };
4155
4252
  var templateObject_1$u, templateObject_2$j, templateObject_3$b, templateObject_4$8;
4156
4253
 
4157
- function _defineProperty(obj, key, value) {
4158
- if (key in obj) {
4159
- Object.defineProperty(obj, key, {
4160
- value: value,
4161
- enumerable: true,
4162
- configurable: true,
4163
- writable: true
4164
- });
4165
- } else {
4166
- obj[key] = value;
4167
- }
4168
- return obj;
4169
- }
4170
-
4171
- function ownKeys(object, enumerableOnly) {
4172
- var keys = Object.keys(object);
4173
- if (Object.getOwnPropertySymbols) {
4174
- var symbols = Object.getOwnPropertySymbols(object);
4175
- enumerableOnly && (symbols = symbols.filter(function (sym) {
4176
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
4177
- })), keys.push.apply(keys, symbols);
4178
- }
4179
- return keys;
4180
- }
4181
- function _objectSpread2(target) {
4182
- for (var i = 1; i < arguments.length; i++) {
4183
- var source = null != arguments[i] ? arguments[i] : {};
4184
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
4185
- _defineProperty(target, key, source[key]);
4186
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
4187
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4188
- });
4189
- }
4190
- return target;
4191
- }
4192
-
4193
- function _classCallCheck(instance, Constructor) {
4194
- if (!(instance instanceof Constructor)) {
4195
- throw new TypeError("Cannot call a class as a function");
4196
- }
4197
- }
4198
-
4199
- function _defineProperties(target, props) {
4200
- for (var i = 0; i < props.length; i++) {
4201
- var descriptor = props[i];
4202
- descriptor.enumerable = descriptor.enumerable || false;
4203
- descriptor.configurable = true;
4204
- if ("value" in descriptor) descriptor.writable = true;
4205
- Object.defineProperty(target, descriptor.key, descriptor);
4206
- }
4207
- }
4208
- function _createClass(Constructor, protoProps, staticProps) {
4209
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
4210
- if (staticProps) _defineProperties(Constructor, staticProps);
4211
- Object.defineProperty(Constructor, "prototype", {
4212
- writable: false
4213
- });
4214
- return Constructor;
4215
- }
4216
-
4217
- function _assertThisInitialized(self) {
4218
- if (self === void 0) {
4219
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4220
- }
4221
- return self;
4222
- }
4223
-
4224
- function _setPrototypeOf(o, p) {
4225
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
4226
- o.__proto__ = p;
4227
- return o;
4228
- };
4229
- return _setPrototypeOf(o, p);
4230
- }
4231
-
4232
- function _inherits(subClass, superClass) {
4233
- if (typeof superClass !== "function" && superClass !== null) {
4234
- throw new TypeError("Super expression must either be null or a function");
4235
- }
4236
- subClass.prototype = Object.create(superClass && superClass.prototype, {
4237
- constructor: {
4238
- value: subClass,
4239
- writable: true,
4240
- configurable: true
4241
- }
4242
- });
4243
- Object.defineProperty(subClass, "prototype", {
4244
- writable: false
4245
- });
4246
- if (superClass) _setPrototypeOf(subClass, superClass);
4247
- }
4248
-
4249
- function _getPrototypeOf(o) {
4250
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
4251
- return o.__proto__ || Object.getPrototypeOf(o);
4252
- };
4253
- return _getPrototypeOf(o);
4254
- }
4255
-
4256
- function _isNativeReflectConstruct() {
4257
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
4258
- if (Reflect.construct.sham) return false;
4259
- if (typeof Proxy === "function") return true;
4260
- try {
4261
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
4262
- return true;
4263
- } catch (e) {
4264
- return false;
4265
- }
4266
- }
4267
-
4268
- function _typeof(obj) {
4269
- "@babel/helpers - typeof";
4270
-
4271
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
4272
- return typeof obj;
4273
- } : function (obj) {
4274
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
4275
- }, _typeof(obj);
4276
- }
4277
-
4278
- function _possibleConstructorReturn(self, call) {
4279
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
4280
- return call;
4281
- } else if (call !== void 0) {
4282
- throw new TypeError("Derived constructors may only return object or undefined");
4283
- }
4284
- return _assertThisInitialized(self);
4285
- }
4286
-
4287
- function _createSuper(Derived) {
4288
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
4289
- return function _createSuperInternal() {
4290
- var Super = _getPrototypeOf(Derived),
4291
- result;
4292
- if (hasNativeReflectConstruct) {
4293
- var NewTarget = _getPrototypeOf(this).constructor;
4294
- result = Reflect.construct(Super, arguments, NewTarget);
4295
- } else {
4296
- result = Super.apply(this, arguments);
4297
- }
4298
- return _possibleConstructorReturn(this, result);
4299
- };
4300
- }
4301
-
4302
- var LOADING_IMG_SRC = '/images/gears.gif';
4303
- var NOT_FOUND_IMG_SRC = '/images/404.png';
4304
- var DEFAULT_MAX_ATTEMPTS = 3;
4305
- var DEFAULT_ATTEMPT_INTERVAL = 10000;
4306
- var Img = /*#__PURE__*/function (_Component) {
4307
- _inherits(Img, _Component);
4308
- var _super = _createSuper(Img);
4309
- function Img(props) {
4310
- var _this;
4311
- _classCallCheck(this, Img);
4312
- _this = _super.call(this, props);
4313
- _this.state = {
4314
- src: _this.props.src,
4315
- attempts: 0
4316
- };
4317
- _this.onError = _this.onError.bind(_assertThisInitialized(_this));
4318
- return _this;
4319
- }
4320
- _createClass(Img, [{
4321
- key: "UNSAFE_componentWillReceiveProps",
4322
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
4323
- if (nextProps.src !== this.props.src) {
4324
- this.setState({
4325
- src: nextProps.src,
4326
- attempts: 0
4327
- });
4328
- }
4329
- }
4330
- }, {
4331
- key: "componentWillUnmount",
4332
- value: function componentWillUnmount() {
4333
- if (this.retryId) {
4334
- clearTimeout(this.retryId);
4335
- }
4336
- }
4337
- }, {
4338
- key: "onError",
4339
- value: function onError() {
4340
- var _this2 = this;
4341
- if (NOT_FOUND_IMG_SRC === this.state.src) {
4342
- return;
4343
- }
4344
- var max_attempts = this.props.max_attempts || DEFAULT_MAX_ATTEMPTS;
4345
- var attempt_interval = this.props.attempt_interval || DEFAULT_ATTEMPT_INTERVAL;
4346
- if (this.state.attempts >= max_attempts) {
4347
- this.setState({
4348
- src: NOT_FOUND_IMG_SRC
4349
- });
4350
- return;
4351
- }
4352
- this.setState({
4353
- src: LOADING_IMG_SRC,
4354
- attempts: this.state.attempts + 1
4355
- });
4356
- this.retryId = setTimeout(function () {
4357
- _this2.setState({
4358
- src: _this2.props.src
4359
- });
4360
- }, attempt_interval * (this.state.attempts + 1) * (this.state.attempts + 1));
4361
- }
4362
- }, {
4363
- key: "render",
4364
- value: function render() {
4365
- var props = _objectSpread2(_objectSpread2({
4366
- onError: this.onError
4367
- }, this.props), {}, {
4368
- src: this.state.src
4369
- });
4370
- return /*#__PURE__*/React__default.createElement("img", Object.assign({
4371
- alt: ""
4372
- }, props));
4373
- }
4374
- }]);
4375
- return Img;
4376
- }(React.Component);
4377
-
4378
4254
  var ArtworkName = styled__default.div(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n font-size: .9rem;\n font-weight: bold;\n"], ["\n font-size: .9rem;\n font-weight: bold;\n"])));
4379
4255
  var UpdateDate = styled__default.div(templateObject_2$k || (templateObject_2$k = __makeTemplateObject(["\n font-size: ", ";\n color: ", ";\n"], ["\n font-size: ", ";\n color: ", ";\n"])), function (props) { return getThemeFontSize(props, 'tiny'); }, function (props) { return getThemeColor(props, 'textbody', colors.textbody); });
4380
4256
  var ArtworkControls = styled__default.div(templateObject_3$c || (templateObject_3$c = __makeTemplateObject(["\n text-align: right;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n padding: 10px;\n width: 100%;\n box-sizing: border-box;\n opacity: 0;\n transition: .3s all;\n"], ["\n text-align: right;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n padding: 10px;\n width: 100%;\n box-sizing: border-box;\n opacity: 0;\n transition: .3s all;\n"])));
@@ -4390,12 +4266,12 @@ function extension(filename) {
4390
4266
  return filename.substring(filename.lastIndexOf('.') + 1, filename.length);
4391
4267
  }
4392
4268
  var Artwork = function (_a) {
4393
- var _b = _a.inputProps, inputProps = _b === void 0 ? {} : _b, props = __rest(_a, ["inputProps"]);
4269
+ var _b = _a.inputProps, inputProps = _b === void 0 ? {} : _b, onError = _a.onError, props = __rest(_a, ["inputProps", "onError"]);
4394
4270
  /* TODO: 20 is arbitrary; ideally a component should know its width, and that should be used to compute the max length */
4395
4271
  return React__default.createElement(ArtworkWrapper, { cssHeight: props.cssHeight ? props.cssHeight : props.picture ? 17 : 0, onClick: !props.picture && props.onClick ? props.onClick : undefined },
4396
4272
  props.picture ?
4397
4273
  React__default.createElement(ArtworkPicture, { onClick: function (e) { return props.onClick ? props.onClick(e) : null; }, cssHeight: props.cssHeight ? props.cssHeight : 17 },
4398
- React__default.createElement(Img, { src: props.picture, style: { objectFit: "contain", width: "100%", height: "100%" }, onError: props.onError }))
4274
+ React__default.createElement(Img, { src: props.picture, style: { objectFit: "contain", width: "100%", height: "100%" }, onError: onError }))
4399
4275
  :
4400
4276
  React__default.createElement(IconDoc, { ext: extension(props.name), style: { width: "3vw" } }),
4401
4277
  !props.edit ?
@@ -5198,6 +5074,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
5198
5074
  return target;
5199
5075
  }
5200
5076
 
5077
+ function _setPrototypeOf(o, p) {
5078
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
5079
+ o.__proto__ = p;
5080
+ return o;
5081
+ };
5082
+ return _setPrototypeOf(o, p);
5083
+ }
5084
+
5201
5085
  function _inheritsLoose(subClass, superClass) {
5202
5086
  subClass.prototype = Object.create(superClass.prototype);
5203
5087
  subClass.prototype.constructor = subClass;
@@ -6068,6 +5952,15 @@ var InputStepperOuterContainer = styled__default.div(templateObject_1$M || (temp
6068
5952
  var InputStepperInnerContainer = styled__default.div(templateObject_2$y || (templateObject_2$y = __makeTemplateObject(["\n &&&{\n display: flex;\n width: 100%;\n flex-direction: row;\n justify-content: space-between;\n border-radius: 5px;\n background-color: white;\n ", "\n ", "\n }\n"], ["\n &&&{\n display: flex;\n width: 100%;\n flex-direction: row;\n justify-content: space-between;\n border-radius: 5px;\n background-color: white;\n ", "\n ", "\n }\n"])), SharedStyles, SizerCss);
6069
5953
  var InputStepperLabel = styled__default.label(templateObject_3$m || (templateObject_3$m = __makeTemplateObject(["\n &&&{\n font-size: ", ";\n font-family: ", ";\n line-height: ", ";\n margin-bottom: 8px;\n color: ", "\n ", "\n ", "\n }\n"], ["\n &&&{\n font-size: ", ";\n font-family: ", ";\n line-height: ", ";\n margin-bottom: 8px;\n color: ", "\n ", "\n ", "\n }\n"])), fontStyles.label.fontSize, fontStyles.label.fontFamily, fontStyles.label.lineHeight, neutrals.bodyText, SharedStyles, SizerCss);
6070
5954
  var CurrentNumber = styled__default.div(templateObject_4$f || (templateObject_4$f = __makeTemplateObject(["\n &&&{\n display:flex;\n justify-content: center;\n align-items: center;\n height:38px;\n width:100%;\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n color: ", ";\n text-align:center;\n vertical-align:middle;\n }\n"], ["\n &&&{\n display:flex;\n justify-content: center;\n align-items: center;\n height:38px;\n width:100%;\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n color: ", ";\n text-align:center;\n vertical-align:middle;\n }\n"])), neutrals['60'], neutrals['60'], neutrals.bodyText);
5955
+ function InputStepperStyled(props) {
5956
+ var containerWidth = props.containerWidth, inputDisabled = props.inputDisabled, label = props.label, labelStyle = props.labelStyle, containerStyle = props.containerStyle, style = props.style, onIncrement = props.onIncrement, onDecrement = props.onDecrement, _a = props.decrementButtonProps, decrementButtonProps = _a === void 0 ? {} : _a, _b = props.incrementButtonProps, incrementButtonProps = _b === void 0 ? {} : _b, rest = __rest(props, ["containerWidth", "inputDisabled", "label", "labelStyle", "containerStyle", "style", "onIncrement", "onDecrement", "decrementButtonProps", "incrementButtonProps"]);
5957
+ return (React__default.createElement(InputStepperOuterContainer, { width: containerWidth, style: containerStyle },
5958
+ label && React__default.createElement(InputStepperLabel, { style: labelStyle }, label),
5959
+ React__default.createElement(InputStepperInnerContainer, { style: style },
5960
+ React__default.createElement(IconButton, __assign({ Icon: SubtractIcon, style: { borderRadius: "5px 0 0 5px" }, onClick: onDecrement }, decrementButtonProps)),
5961
+ React__default.createElement(Input, __assign({}, rest, { style: { width: '100%', margin: 0, borderRadius: 0, textAlign: "center" } })),
5962
+ React__default.createElement(IconButton, __assign({ Icon: AddIcon, style: { borderRadius: "0 5px 5px 0" }, onClick: onIncrement }, incrementButtonProps)))));
5963
+ }
6071
5964
  var canIncrement = function (value, max) {
6072
5965
  return (max !== undefined && value < max) || max === undefined;
6073
5966
  };
@@ -6075,21 +5968,21 @@ var canDecrement = function (value, min) {
6075
5968
  return (min !== undefined && value > min) || min === undefined;
6076
5969
  };
6077
5970
  function InputStepper(props) {
6078
- var _a = props.min, min = _a === void 0 ? 0 : _a, max = props.max, width = props.width, label = props.label, _b = props.labelStyle, labelStyle = _b === void 0 ? {} : _b, _c = props.style, style = _c === void 0 ? {} : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d, _e = props.inputDisabled, inputDisabled = _e === void 0 ? false : _e, localeOptions = props.localeOptions, initialValue = props.initialValue, rest = __rest(props, ["min", "max", "width", "label", "labelStyle", "style", "disabled", "inputDisabled", "localeOptions", "initialValue"]);
6079
- var _f = useNumberInput({
5971
+ var _a = props.min, min = _a === void 0 ? 0 : _a, max = props.max, width = props.width, label = props.label, _b = props.labelStyle, labelStyle = _b === void 0 ? {} : _b, _c = props.style, style = _c === void 0 ? {} : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d, _e = props.inputDisabled, inputDisabled = _e === void 0 ? false : _e, localeOptions = props.localeOptions, initialValue = props.initialValue, _f = props.delayChangeTimeout, delayChangeTimeout = _f === void 0 ? 1000 : _f, _g = props.holdIncrement, holdIncrement = _g === void 0 ? true : _g, _h = props.holdDecrement, holdDecrement = _h === void 0 ? true : _h, rest = __rest(props, ["min", "max", "width", "label", "labelStyle", "style", "disabled", "inputDisabled", "localeOptions", "initialValue", "delayChangeTimeout", "holdIncrement", "holdDecrement"]);
5972
+ var _j = useNumberInput({
6080
5973
  defaultValue: initialValue,
6081
5974
  onChange: rest.onChange,
6082
5975
  onFocus: rest.onFocus,
6083
5976
  onBlur: rest.onBlur,
6084
5977
  inputMode: rest.inputMode,
6085
5978
  localeOptions: localeOptions,
6086
- }), ref = _f.ref, value = _f.value, inputMode = _f.inputMode, onChange = _f.onChange, onBlur = _f.onBlur, onFocus = _f.onFocus, updateValue = _f.updateValue;
6087
- var _g = useLongPress(function () {
5979
+ }), ref = _j.ref, value = _j.value, inputMode = _j.inputMode, onChange = _j.onChange, onBlur = _j.onBlur, onFocus = _j.onFocus, updateValue = _j.updateValue;
5980
+ var _k = useLongPress(function () {
6088
5981
  handleIncrement();
6089
- }), onIncrementMouseDown = _g.onMouseDown, onIncrementMouseLeave = _g.onMouseLeave, onIncrementMouseUp = _g.onMouseUp, onIncrementTouchEnd = _g.onTouchEnd, onIncrementTouchStart = _g.onTouchStart;
6090
- var _h = useLongPress(function () {
5982
+ }), onIncrementMouseDown = _k.onMouseDown, onIncrementMouseLeave = _k.onMouseLeave, onIncrementMouseUp = _k.onMouseUp, onIncrementTouchEnd = _k.onTouchEnd, onIncrementTouchStart = _k.onTouchStart;
5983
+ var _l = useLongPress(function () {
6091
5984
  handleDecrement();
6092
- }), onDecrementMouseDown = _h.onMouseDown, onDecrementMouseLeave = _h.onMouseLeave, onDecrementMouseUp = _h.onMouseUp, onDecrementTouchEnd = _h.onTouchEnd, onDecrementTouchStart = _h.onTouchStart;
5985
+ }), onDecrementMouseDown = _l.onMouseDown, onDecrementMouseLeave = _l.onMouseLeave, onDecrementMouseUp = _l.onMouseUp, onDecrementTouchEnd = _l.onTouchEnd, onDecrementTouchStart = _l.onTouchStart;
6093
5986
  var valueNumber = typeof value === 'string' ? parseFloat(value) : value;
6094
5987
  var decrementButtonVariant = disabled || !canDecrement(valueNumber, min)
6095
5988
  ? "disabled" : "primary";
@@ -6122,23 +6015,23 @@ function InputStepper(props) {
6122
6015
  else if (!canDecrement(parseInt(val), min) && min !== undefined) {
6123
6016
  updateValue(min);
6124
6017
  }
6125
- }, [ref, min, max, updateValue]), 1000);
6018
+ }, [ref, min, max, updateValue]), delayChangeTimeout);
6126
6019
  return (React__default.createElement(InputStepperOuterContainer, { width: width },
6127
6020
  React__default.createElement(InputStepperLabel, { style: labelStyle }, label),
6128
6021
  React__default.createElement(InputStepperInnerContainer, { style: style },
6129
6022
  React__default.createElement(IconButton, { Icon: SubtractIcon, variant: decrementButtonVariant, onClick: handleDecrement, style: { borderRadius: "5px 0 0 5px" }, onMouseDown: function (e) {
6130
- if (e.button !== 0) {
6023
+ if (e.button !== 0 || !holdDecrement) {
6131
6024
  return;
6132
6025
  }
6133
6026
  onDecrementMouseDown();
6134
- }, onMouseOut: onDecrementMouseLeave, onMouseUp: onDecrementMouseUp, onTouchEnd: onDecrementTouchEnd, onTouchStart: onDecrementTouchStart }),
6027
+ }, onMouseOut: holdDecrement ? onDecrementMouseLeave : undefined, onMouseUp: holdDecrement ? onDecrementMouseUp : undefined, onTouchEnd: holdDecrement ? onDecrementTouchEnd : undefined, onTouchStart: holdDecrement ? onDecrementTouchStart : undefined }),
6135
6028
  React__default.createElement(Input, __assign({}, rest, { style: { width: '100%', margin: 0, borderRadius: 0, textAlign: "center" }, value: value, inputMode: inputMode, onChange: onChange, onBlur: onBlur, onFocus: onFocus, disabled: inputDisabled, ref: ref, onKeyUp: delayChange })),
6136
6029
  React__default.createElement(IconButton, { Icon: AddIcon, variant: incrementButtonVariant, onClick: handleIncrement, style: { borderRadius: "0 5px 5px 0" }, onMouseDown: function (e) {
6137
- if (e.button !== 0) {
6030
+ if (e.button !== 0 || !holdIncrement) {
6138
6031
  return;
6139
6032
  }
6140
6033
  onIncrementMouseDown();
6141
- }, onMouseOut: onIncrementMouseLeave, onMouseUp: onIncrementMouseUp, onTouchEnd: onIncrementTouchEnd, onTouchStart: onIncrementTouchStart }))));
6034
+ }, onMouseOut: holdIncrement ? onIncrementMouseLeave : undefined, onMouseUp: holdIncrement ? onIncrementMouseUp : undefined, onTouchEnd: holdIncrement ? onIncrementTouchEnd : undefined, onTouchStart: holdIncrement ? onIncrementTouchStart : undefined }))));
6142
6035
  }
6143
6036
  var templateObject_1$M, templateObject_2$y, templateObject_3$m, templateObject_4$f;
6144
6037
 
@@ -6266,6 +6159,19 @@ function sortDirection(col) {
6266
6159
  var VirtualTableStyles = styled__default.div(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\npadding: 1rem;\n\n.table-list-rows {\n ", "\n}\n\n.table {\n display: inline-flex;\n flex-direction: column;\n ", "\n width: 100% !important;\n min-width: 100% !important;\n ", "\n\n .thead {\n padding-right: 15px;\n ", "\n\n .tr {\n overflow-x: hidden;\n min-width: 100%;\n }\n }\n\n .tbody {\n flex: 1 1 auto;\n height: 80vh;\n }\n\n .tr-group {\n display: flex;\n flex-direction: column;\n\n .tr, .tr-sub {\n width: 99%;\n }\n }\n\n .tr {\n display: flex;\n\n ", "\n }\n\n .tr.header {\n position: sticky;\n }\n\n .th,\n .td {\n margin: 0;\n padding: 0.5rem;\n ", "\n }\n}"], ["\npadding: 1rem;\n\n.table-list-rows {\n ", "\n}\n\n.table {\n display: inline-flex;\n flex-direction: column;\n ", "\n width: 100% !important;\n min-width: 100% !important;\n ", "\n\n .thead {\n padding-right: 15px;\n ", "\n\n .tr {\n overflow-x: hidden;\n min-width: 100%;\n }\n }\n\n .tbody {\n flex: 1 1 auto;\n height: 80vh;\n }\n\n .tr-group {\n display: flex;\n flex-direction: column;\n\n .tr, .tr-sub {\n width: 99%;\n }\n }\n\n .tr {\n display: flex;\n\n ", "\n }\n\n .tr.header {\n position: sticky;\n }\n\n .th,\n .td {\n margin: 0;\n padding: 0.5rem;\n ", "\n }\n}"])), function (p) { return p.rowClickable ? "\n .tr {\n cursor: pointer;\n }\n " : ''; }, function (p) { return p.bordered ? "\n border-spacing: 0;\n border: 1px solid black;\n " : ''; }, function (p) { return p.tableHeight ? "height: ".concat(p.tableHeight).concat(typeof p.tableHeight === 'number' ? 'px' : '', ";") : ''; }, function (p) { return p.bordered ? 'border-bottom: 1px solid #000;' : ''; }, function (p) { return p.bordered ? "\n :last-child {\n .td {\n border-bottom: 0;\n }\n }\n " : ''; }, function (p) { return p.bordered ? "\n border-bottom: 1px solid black;\n border-right: 1px solid black;\n :last-child {\n border-right: 0;\n }\n " : ''; });
6267
6160
  var templateObject_1$N;
6268
6161
 
6162
+ var psuedoSelectors = {
6163
+ __after: '&:after',
6164
+ __before: '&:before',
6165
+ __firstLetter: '&:first-letter',
6166
+ __firstLine: '&:first-line',
6167
+ __active: '&:active',
6168
+ __firstChild: '&:first-child',
6169
+ __focus: '&:focus',
6170
+ __hover: '&:hover',
6171
+ __lang: '&:lang',
6172
+ __link: '&:link',
6173
+ __visited: '&:visited',
6174
+ };
6269
6175
  var isSizeObj = function (val) { return typeof val === 'object' && (val['xs'] || val['sm'] || val['md'] || val['lg'] || val['xl']); };
6270
6176
  var parseResponsiveValue = function (value, transform) {
6271
6177
  if (typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') {
@@ -6286,7 +6192,7 @@ var parseResponsiveValue = function (value, transform) {
6286
6192
  }
6287
6193
  else if (typeof value === 'object') {
6288
6194
  if (!isSizeObj(value)) {
6289
- return value;
6195
+ return transform(value) || value;
6290
6196
  }
6291
6197
  return Object.keys(value)
6292
6198
  .filter(function (k) { return sizes.includes(k); })
@@ -6308,47 +6214,29 @@ var createMeasurementStyle = function (v, keys) {
6308
6214
  return (__assign(__assign({}, acc), (_a = {}, _a[k] = value, _a)));
6309
6215
  }, {});
6310
6216
  };
6311
- var styleKeys = [
6217
+ var styleKeys = __spreadArray([
6312
6218
  'pr', 'pl', 'pt', 'pb', 'px', 'py',
6313
6219
  'mr', 'ml', 'mt', 'mb', 'mx', 'my',
6314
6220
  'width', 'height',
6315
6221
  'color', 'bg', 'background', 'backgroundColor',
6316
6222
  'colSpan',
6317
- 'style', 'sx',
6318
- ];
6319
- var stylesTransformMap = {
6320
- mr: function (v) { return createMeasurementStyle(v, ['marginRight']); },
6321
- ml: function (v) { return createMeasurementStyle(v, ['marginLeft']); },
6322
- mt: function (v) { return createMeasurementStyle(v, ['marginTop']); },
6323
- mb: function (v) { return createMeasurementStyle(v, ['marginBottom']); },
6324
- mx: function (v) { return createMeasurementStyle(v, ['marginLeft', 'marginRight']); },
6325
- my: function (v) { return createMeasurementStyle(v, ['marginTop', 'marginBottom']); },
6326
- pr: function (v) { return createMeasurementStyle(v, ['paddingRight']); },
6327
- pl: function (v) { return createMeasurementStyle(v, ['paddingLeft']); },
6328
- pt: function (v) { return createMeasurementStyle(v, ['paddingTop']); },
6329
- pb: function (v) { return createMeasurementStyle(v, ['paddingBottom']); },
6330
- px: function (v) { return createMeasurementStyle(v, ['paddingLeft', 'paddingRight']); },
6331
- py: function (v) { return createMeasurementStyle(v, ['paddingTop', 'paddingBottom']); },
6332
- width: function (v) { return createMeasurementStyle(v, ['width']); },
6333
- height: function (v) { return createMeasurementStyle(v, ['height']); },
6334
- color: function (v) { return ({ color: v }); },
6335
- bg: function (v) { return ({ background: v }); },
6336
- background: function (v) { return ({ background: v }); },
6337
- backgroundColor: function (v) { return ({ backgroundColor: v }); },
6338
- hidden: function (v) { return (v ? { display: 'none' } : {}); },
6339
- block: function (v) { return (v ? { display: 'block' } : {}); },
6340
- inline_block: function (v) { return (v ? { display: 'inline-block' } : {}); },
6341
- flex: function (v) { return (v ? { display: 'flex' } : {}); },
6342
- inline_flex: function (v) { return (v ? { display: 'inline-flex' } : {}); },
6343
- grid: function (v) { return (v ? { display: 'grid' } : {}); },
6344
- float: function (v) { return (v === 'clearfix'
6223
+ 'style', 'sx'
6224
+ ], Object.keys(psuedoSelectors), true);
6225
+ var psuedoStylesTransformMap = Object.keys(psuedoSelectors)
6226
+ .reduce(function (acc, k) {
6227
+ var _a;
6228
+ return (__assign(__assign({}, acc), (_a = {}, _a[k] = function (v) {
6229
+ var _a;
6230
+ return (_a = {}, _a[psuedoSelectors[k]] = v, _a);
6231
+ }, _a)));
6232
+ }, {});
6233
+ var stylesTransformMap = __assign({ mr: function (v) { return createMeasurementStyle(v, ['marginRight']); }, ml: function (v) { return createMeasurementStyle(v, ['marginLeft']); }, mt: function (v) { return createMeasurementStyle(v, ['marginTop']); }, mb: function (v) { return createMeasurementStyle(v, ['marginBottom']); }, mx: function (v) { return createMeasurementStyle(v, ['marginLeft', 'marginRight']); }, my: function (v) { return createMeasurementStyle(v, ['marginTop', 'marginBottom']); }, pr: function (v) { return createMeasurementStyle(v, ['paddingRight']); }, pl: function (v) { return createMeasurementStyle(v, ['paddingLeft']); }, pt: function (v) { return createMeasurementStyle(v, ['paddingTop']); }, pb: function (v) { return createMeasurementStyle(v, ['paddingBottom']); }, px: function (v) { return createMeasurementStyle(v, ['paddingLeft', 'paddingRight']); }, py: function (v) { return createMeasurementStyle(v, ['paddingTop', 'paddingBottom']); }, width: function (v) { return createMeasurementStyle(v, ['width']); }, height: function (v) { return createMeasurementStyle(v, ['height']); }, color: function (v) { return ({ color: v }); }, bg: function (v) { return ({ background: v }); }, background: function (v) { return ({ background: v }); }, backgroundColor: function (v) { return ({ backgroundColor: v }); }, hidden: function (v) { return (v ? { display: 'none' } : {}); }, block: function (v) { return (v ? { display: 'block' } : {}); }, inline_block: function (v) { return (v ? { display: 'inline-block' } : {}); }, flex: function (v) { return (v ? { display: 'flex' } : {}); }, inline_flex: function (v) { return (v ? { display: 'inline-flex' } : {}); }, grid: function (v) { return (v ? { display: 'grid' } : {}); }, float: function (v) { return (v === 'clearfix'
6345
6234
  ? { '&::after': {
6346
6235
  content: '',
6347
6236
  display: 'table',
6348
6237
  clear: 'both',
6349
6238
  } }
6350
- : { float: v }); },
6351
- colSpan: function (v) {
6239
+ : { float: v }); }, colSpan: function (v) {
6352
6240
  if (v === 'auto' || v === true) {
6353
6241
  return { gridColumn: 'auto' };
6354
6242
  }
@@ -6357,10 +6245,7 @@ var stylesTransformMap = {
6357
6245
  }
6358
6246
  var colSpan = stripUnit(v);
6359
6247
  return { gridColumn: "span ".concat(colSpan, " / span ").concat(colSpan) };
6360
- },
6361
- style: function (v) { return v; },
6362
- sx: function (v) { return v; },
6363
- };
6248
+ }, style: function (v) { return v; }, sx: function (v) { return v; } }, psuedoStylesTransformMap);
6364
6249
  var parseCskuStyles = function (p) {
6365
6250
  var sizeStylesObj = {};
6366
6251
  var stylesObj = {};
@@ -6421,7 +6306,7 @@ var GridItem = styled__default.div(function (p) {
6421
6306
  });
6422
6307
 
6423
6308
  var BaseCollapsible = function (props) {
6424
- var children = props.children, style = props.style, label = props.label, controls = props.controls, _a = props.isOpen, isOpen = _a === void 0 ? false : _a, handleToggle = props.handleToggle;
6309
+ var children = props.children, style = props.style, label = props.label, controls = props.controls, header = props.header, _a = props.isOpen, isOpen = _a === void 0 ? false : _a, handleToggle = props.handleToggle;
6425
6310
  var _b = React.useState(isOpen ? undefined : 0), height = _b[0], setHeight = _b[1];
6426
6311
  var ref = React.useRef(null);
6427
6312
  React.useEffect(function () {
@@ -6446,10 +6331,7 @@ var BaseCollapsible = function (props) {
6446
6331
  React__default.createElement(Row, { style: __assign({ alignItems: 'center', padding: 10, paddingTop: 12, paddingBottom: 8, background: isOpen ? colors.white : colors.teal[20], borderRadius: isOpen ? 25 : 2000, flex: 'none', order: 1, flexGrow: 0 }, (isOpen
6447
6332
  ? { border: "3px solid ".concat(colors.teal.main) }
6448
6333
  : {})) },
6449
- React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, onClick: handleToggle },
6450
- React__default.createElement(CollapsibleLabel, { isOpen: isOpen }, label)),
6451
- React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, smStyle: "text-align: right;", xsStyle: "text-align: center;", onClick: handleToggle },
6452
- React__default.createElement(CollapsibleControls, { isOpen: isOpen }, controls)),
6334
+ React__default.createElement(CollapsibleHeader, { isOpen: isOpen, handleToggle: handleToggle, controls: controls }, header || label),
6453
6335
  React__default.createElement(Col, { xs: true, style: {
6454
6336
  overflow: 'hidden',
6455
6337
  transition: 'height 0.2s ease-in-out',
@@ -6469,6 +6351,20 @@ var Collapsible$1 = function (props) {
6469
6351
  };
6470
6352
  return (React__default.createElement(BaseCollapsible, __assign({ isOpen: isOpen, handleToggle: handleToggle }, rest), children));
6471
6353
  };
6354
+ var CollapsibleHeader = function (props) {
6355
+ var children = props.children, controls = props.controls, isOpen = props.isOpen, handleToggle = props.handleToggle;
6356
+ if (children === undefined || children === null) {
6357
+ return null;
6358
+ }
6359
+ if (typeof children === 'string' || typeof children === 'number' || typeof children === 'boolean') {
6360
+ return React__default.createElement(React__default.Fragment, null,
6361
+ React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, onClick: handleToggle },
6362
+ React__default.createElement(CollapsibleLabel, { isOpen: isOpen }, children)),
6363
+ React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, smStyle: "text-align: right;", xsStyle: "text-align: center;", onClick: handleToggle },
6364
+ React__default.createElement(CollapsibleControls, { isOpen: isOpen }, controls)));
6365
+ }
6366
+ return React__default.cloneElement(children, { isOpen: isOpen, handleToggle: handleToggle });
6367
+ };
6472
6368
  var CollapsibleLabel = function (props) {
6473
6369
  var children = props.children, isOpen = props.isOpen;
6474
6370
  if (children === undefined || children === null) {
@@ -7258,11 +7154,13 @@ exports.HeadlessTable = HeadlessTable;
7258
7154
  exports.HistoryIcon = HistoryIcon;
7259
7155
  exports.IconButton = IconButton;
7260
7156
  exports.IconDoc = IconDoc;
7157
+ exports.Img = Img;
7261
7158
  exports.InfoIcon = InfoIcon;
7262
7159
  exports.Input = Input;
7263
7160
  exports.InputIconLabel = InputIconLabel;
7264
7161
  exports.InputIconLabelContainer = InputIconLabelContainer;
7265
7162
  exports.InputStepper = InputStepper;
7163
+ exports.InputStepperStyled = InputStepperStyled;
7266
7164
  exports.IntegrationsIcon = IntegrationsIcon;
7267
7165
  exports.Label = Label;
7268
7166
  exports.LabeledAsyncSelect = LabeledAsyncSelect;
@@ -7402,4 +7300,12 @@ exports.parseCskuStyles = parseCskuStyles;
7402
7300
  exports.sizes = sizes$1;
7403
7301
  exports.themeOptions = themeOptions;
7404
7302
  exports.toggleSizes = toggleSizes;
7303
+ exports.useCalendar = useCalendar;
7304
+ exports.useClickOutside = useClickOutside;
7305
+ exports.useDelayUnmount = useDelayUnmount;
7306
+ exports.useFallbackRef = useFallbackRef;
7307
+ exports.useLongPress = useLongPress;
7308
+ exports.usePrefersReducedMotion = usePrefersReducedMotion;
7309
+ exports.useRandomInterval = useRandomInterval;
7310
+ exports.useWindowSize = useWindowSize;
7405
7311
  //# sourceMappingURL=index.js.map