@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.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import _, { map, pick, keys, isUndefined, get, toNumber, isString, filter, partial, uniqueId, debounce } from 'lodash';
1
+ import _, { map, pick, keys, isUndefined, get, assign, range as range$1, isEmpty, tail, toNumber, isString, filter, partial, uniqueId, debounce } from 'lodash';
2
2
  import styled, { css, createGlobalStyle, ThemeProvider, keyframes } from 'styled-components';
3
3
  import React__default, { Fragment, useState, useEffect, useRef, useCallback, useImperativeHandle, Component, createContext, memo, forwardRef, useLayoutEffect, useMemo } from 'react';
4
4
  import { useDropzone } from 'react-dropzone';
@@ -8,7 +8,7 @@ import BaseCreatableSelect from 'react-select/creatable';
8
8
  import BaseAsyncSelect from 'react-select/async';
9
9
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
10
10
  import ReactDOM from 'react-dom';
11
- import { addDays, getWeek, subWeeks, addWeeks, getMonth, getYear, isSameDay, subMonths, addMonths, format, startOfWeek, isDate, lastDayOfWeek } from 'date-fns';
11
+ import { getWeek, addDays, subWeeks, addWeeks, getMonth, getYear, isSameDay, subMonths, addMonths, format, startOfWeek, isDate, lastDayOfWeek } from 'date-fns';
12
12
  import BaseDatePicker from 'react-datepicker';
13
13
  import { useTable, useSortBy, usePagination, useColumnOrder, useBlockLayout, useFlexLayout, useExpanded } from 'react-table';
14
14
  import { useSticky } from 'react-table-sticky';
@@ -363,7 +363,19 @@ var getUnit = function (measurement) {
363
363
  var stripUnit = function (measurement) {
364
364
  return (typeof measurement === "number") ? measurement : parseFloat(measurement);
365
365
  };
366
- var parseMeasurement = function (measurement) { return stripUnit(measurement) + getUnit(measurement); };
366
+ var parseMeasurement = function (measurement) { return stripUnit(measurement) + getUnit(measurement); };
367
+ var wait = function (time) {
368
+ var timeoutId;
369
+ var promise = new Promise(function (resolve) {
370
+ timeoutId = setTimeout(resolve, time);
371
+ });
372
+ return {
373
+ promise: promise,
374
+ cancel: function () {
375
+ clearTimeout(timeoutId);
376
+ },
377
+ };
378
+ };
367
379
 
368
380
  var SharedStyles = 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) {
369
381
  return isUndefined(v) ? '' : SHARED_STYLE_MAPS[k](v);
@@ -2832,6 +2844,75 @@ var ButtonIcon = React__default.forwardRef(function (props, ref) {
2832
2844
  });
2833
2845
  var templateObject_1$d, templateObject_2$8;
2834
2846
 
2847
+ var LOADING_IMG_SRC = '/images/gears.gif';
2848
+ var NOT_FOUND_IMG_SRC = '/images/404.png';
2849
+ var DEFAULT_MAX_ATTEMPTS = 3;
2850
+ var DEFAULT_ATTEMPT_INTERVAL = 1000;
2851
+ // fetch image src, and return intervals.length times on error. wait intervals[n] ms on nth retry
2852
+ var fetchImage = function (src, intervals, onRetry) {
2853
+ var image = new Image();
2854
+ var cancel = function () {
2855
+ image.src = '';
2856
+ };
2857
+ var promise = new Promise(function (resolve, reject) {
2858
+ image.src = src;
2859
+ image.onload = resolve;
2860
+ image.onerror = reject;
2861
+ }).catch(function (error) {
2862
+ if (isEmpty(intervals)) {
2863
+ throw error;
2864
+ }
2865
+ else if (image.src === '') {
2866
+ return error;
2867
+ }
2868
+ else {
2869
+ onRetry && onRetry(error);
2870
+ var w = wait(intervals[0]);
2871
+ cancel = w.cancel;
2872
+ return w.promise.then(function () {
2873
+ var result = fetchImage(src, tail(intervals), onRetry);
2874
+ cancel = result.cancel;
2875
+ return result.promise;
2876
+ });
2877
+ }
2878
+ });
2879
+ return {
2880
+ promise: promise,
2881
+ cancel: function () {
2882
+ // use this to cancel next fetch
2883
+ cancel();
2884
+ }
2885
+ };
2886
+ };
2887
+ var Img = React__default.forwardRef(function (_a, ref) {
2888
+ 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"]);
2889
+ var _g = useState(true), loading = _g[0], setLoading = _g[1];
2890
+ var _h = useState(null), error = _h[0], setError = _h[1];
2891
+ var effectRef = useRef({});
2892
+ assign(effectRef.current, { onRetry: onRetry, onFailed: onFailed });
2893
+ useEffect(function () {
2894
+ var _a = effectRef.current, onRetry = _a.onRetry, onFailed = _a.onFailed, cancel = _a.cancel;
2895
+ // cancel previous fetch before start new fetch
2896
+ cancel && cancel();
2897
+ var result = fetchImage(src !== null && src !== void 0 ? src : "", map(range$1(max_attempts), function (i) {
2898
+ return attempt_interval * (i + 1) * (i + 1);
2899
+ }), onRetry);
2900
+ effectRef.current.cancel = result.cancel;
2901
+ result.promise
2902
+ .then(function () {
2903
+ setError(null);
2904
+ })
2905
+ .catch(function (e) {
2906
+ onFailed && onFailed(e);
2907
+ setError(e);
2908
+ })
2909
+ .finally(function () {
2910
+ setLoading(false);
2911
+ });
2912
+ }, [src, attempt_interval, max_attempts]);
2913
+ return React__default.createElement("img", __assign({ ref: ref, alt: alt, src: loading ? LOADING_IMG_SRC : (error ? NOT_FOUND_IMG_SRC : src) }, props));
2914
+ });
2915
+
2835
2916
  var Label = styled.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);
2836
2917
  var templateObject_1$e;
2837
2918
 
@@ -2929,10 +3010,10 @@ var LabeledInput = React__default.forwardRef(function (_a, ref) {
2929
3010
  React__default.createElement(Input, __assign({ ref: ref, name: name, required: required }, props))));
2930
3011
  });
2931
3012
  var LabeledIconInput = React__default.forwardRef(function (_a, ref) {
2932
- 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"]);
3013
+ 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"]);
2933
3014
  var containerRef = useRef(null);
2934
- var _e = useState(false), isActive = _e[0], setIsActive = _e[1];
2935
- var _f = useState(false), isHovering = _f[0], setIsHovering = _f[1];
3015
+ var _g = useState(false), isActive = _g[0], setIsActive = _g[1];
3016
+ var _h = useState(false), isHovering = _h[0], setIsHovering = _h[1];
2936
3017
  var activeBorderColor = getThemeColor(props, 'input.active.border', colors.input.active.border);
2937
3018
  var activeTextColor = colors.input.active.text;
2938
3019
  var errorBorderColor = getThemeColor(props, 'input.error.border', colors.input.error.border);
@@ -2957,8 +3038,8 @@ var LabeledIconInput = React__default.forwardRef(function (_a, ref) {
2957
3038
  };
2958
3039
  var NewIcon = React__default.useMemo(function () {
2959
3040
  var iconProps = {
2960
- fill: '#fff',
2961
- color: '#fff',
3041
+ fill: iconColor,
3042
+ color: iconColor,
2962
3043
  };
2963
3044
  if (error) {
2964
3045
  iconProps['fill'] = errorBorderColor;
@@ -2977,7 +3058,7 @@ var LabeledIconInput = React__default.forwardRef(function (_a, ref) {
2977
3058
  iconProps['color'] = colors.input.icon.active.fill;
2978
3059
  }
2979
3060
  return React__default.cloneElement(Icon, iconProps);
2980
- }, [Icon, error, disabled, errorBorderColor, isActive, isHovering]);
3061
+ }, [Icon, error, disabled, errorBorderColor, isActive, isHovering, iconColor]);
2981
3062
  var onClickOutside = function (e) {
2982
3063
  if (containerRef.current && !containerRef.current.contains(e.target)) {
2983
3064
  setIsActive(false);
@@ -2989,7 +3070,7 @@ var LabeledIconInput = React__default.forwardRef(function (_a, ref) {
2989
3070
  document$1.removeEventListener('click', onClickOutside);
2990
3071
  };
2991
3072
  }, []);
2992
- return (React__default.createElement("div", null,
3073
+ return (React__default.createElement("div", { style: containerStyle },
2993
3074
  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') }) },
2994
3075
  label,
2995
3076
  " ",
@@ -3418,11 +3499,12 @@ var templateObject_1$m, templateObject_2$d, templateObject_3$6, templateObject_4
3418
3499
 
3419
3500
  var useClickOutside = function (props) {
3420
3501
  var ref = props.ref, _a = props.eventType, eventType = _a === void 0 ? 'mousedown' : _a, onClick = props.onClick, onCleanup = props.onCleanup;
3502
+ var effectRef = useRef({});
3503
+ assign(effectRef.current, { eventType: eventType, onCleanup: onCleanup, ref: ref, onClick: onClick });
3421
3504
  useEffect(function () {
3505
+ var _a = effectRef.current, eventType = _a.eventType, onCleanup = _a.onCleanup, ref = _a.ref, onClick = _a.onClick;
3422
3506
  function handleClickOutside(e) {
3423
- console.log('handleClickOutside');
3424
3507
  if (ref.current && !ref.current.contains(e.target)) {
3425
- console.log('click outside');
3426
3508
  onClick && onClick(e);
3427
3509
  }
3428
3510
  }
@@ -3434,6 +3516,21 @@ var useClickOutside = function (props) {
3434
3516
  }, []);
3435
3517
  };
3436
3518
 
3519
+ function useDelayUnmount(isMounted, delayTime) {
3520
+ var _a = React__default.useState(false), shouldRender = _a[0], setShouldRender = _a[1];
3521
+ React__default.useEffect(function () {
3522
+ var timeoutId;
3523
+ if (isMounted && !shouldRender) {
3524
+ setShouldRender(true);
3525
+ }
3526
+ else if (!isMounted && shouldRender) {
3527
+ timeoutId = setTimeout(function () { return setShouldRender(false); }, delayTime);
3528
+ }
3529
+ return function () { return clearTimeout(timeoutId); };
3530
+ }, [isMounted, delayTime, shouldRender]);
3531
+ return shouldRender;
3532
+ }
3533
+
3437
3534
  var QUERY = '(prefers-reduced-motion: no-preference)';
3438
3535
  var isRenderingOnServer = typeof window$1 === 'undefined';
3439
3536
  var getInitialState = function () {
@@ -3667,7 +3764,7 @@ var PopupContainer = function (_a) {
3667
3764
  return ReactDOM.createPortal(children, ref.current);
3668
3765
  };
3669
3766
  var Popup = React__default.forwardRef(function (_a, forwardedRef) {
3670
- 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"]);
3767
+ 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"]);
3671
3768
  var ref = useFallbackRef(forwardedRef);
3672
3769
  useClickOutside({
3673
3770
  ref: ref,
@@ -3695,14 +3792,14 @@ var Popup = React__default.forwardRef(function (_a, forwardedRef) {
3695
3792
  }, [closeOnClickOutside, closeOnEsc, onClose]);
3696
3793
  return React__default.createElement(PopupContainer, null,
3697
3794
  React__default.createElement(Overlay, { zIndex: overlayZIndex },
3698
- React__default.createElement(PopupWindow, __assign({ className: "popup" }, props, { ref: ref }),
3795
+ React__default.createElement(PopupWindow, __assign({ className: "popup" + (popupClassName ? " ".concat(popupClassName) : '') }, props, { ref: ref }),
3699
3796
  noHeader ? null :
3700
3797
  header ? header : (React__default.createElement(PopupHeader, { className: "popup-header", xsStyle: "flex-wrap: wrap-reverse;", smStyle: "flex-wrap: wrap;" },
3701
3798
  React__default.createElement(Col, { style: { textAlign: 'left', alignSelf: 'center' } },
3702
3799
  React__default.createElement("span", { className: "title" }, title)),
3703
3800
  React__default.createElement(Col, { style: { textAlign: 'right', alignSelf: 'center' } }, noCloseButton ? null :
3704
3801
  controls || React__default.createElement(Button, { onClick: onClose }, "Close")))),
3705
- React__default.createElement("div", { className: "popup-content" }, children))));
3802
+ React__default.createElement("div", { className: "popup-content" + (contentClassName ? " ".concat(contentClassName) : '') }, children))));
3706
3803
  });
3707
3804
  var ShowPopup = function (_a) {
3708
3805
  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"]);
@@ -3980,10 +4077,10 @@ var Tabs = /** @class */ (function (_super) {
3980
4077
  };
3981
4078
  Tabs.prototype.render = function () {
3982
4079
  var _this = this;
3983
- var _a = this.props, tabs = _a.tabs, size = _a.size, padded = _a.padded, props = __rest(_a, ["tabs", "size", "padded"]);
4080
+ var _a = this.props, tabs = _a.tabs, size = _a.size, padded = _a.padded, variant = _a.variant, props = __rest(_a, ["tabs", "size", "padded", "variant"]);
3984
4081
  var selectedTab = this.getTab(tabs, this.state.selectedTabIndex);
3985
4082
  return React__default.createElement("div", __assign({}, props),
3986
- 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) {
4083
+ 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) {
3987
4084
  _this.setState({ selectedTabIndex: index });
3988
4085
  var callback = tabs[index].onClick;
3989
4086
  if (callback) {
@@ -4145,227 +4242,6 @@ var Product = function (props) {
4145
4242
  };
4146
4243
  var templateObject_1$u, templateObject_2$j, templateObject_3$b, templateObject_4$8;
4147
4244
 
4148
- function _defineProperty(obj, key, value) {
4149
- if (key in obj) {
4150
- Object.defineProperty(obj, key, {
4151
- value: value,
4152
- enumerable: true,
4153
- configurable: true,
4154
- writable: true
4155
- });
4156
- } else {
4157
- obj[key] = value;
4158
- }
4159
- return obj;
4160
- }
4161
-
4162
- function ownKeys(object, enumerableOnly) {
4163
- var keys = Object.keys(object);
4164
- if (Object.getOwnPropertySymbols) {
4165
- var symbols = Object.getOwnPropertySymbols(object);
4166
- enumerableOnly && (symbols = symbols.filter(function (sym) {
4167
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
4168
- })), keys.push.apply(keys, symbols);
4169
- }
4170
- return keys;
4171
- }
4172
- function _objectSpread2(target) {
4173
- for (var i = 1; i < arguments.length; i++) {
4174
- var source = null != arguments[i] ? arguments[i] : {};
4175
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
4176
- _defineProperty(target, key, source[key]);
4177
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
4178
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4179
- });
4180
- }
4181
- return target;
4182
- }
4183
-
4184
- function _classCallCheck(instance, Constructor) {
4185
- if (!(instance instanceof Constructor)) {
4186
- throw new TypeError("Cannot call a class as a function");
4187
- }
4188
- }
4189
-
4190
- function _defineProperties(target, props) {
4191
- for (var i = 0; i < props.length; i++) {
4192
- var descriptor = props[i];
4193
- descriptor.enumerable = descriptor.enumerable || false;
4194
- descriptor.configurable = true;
4195
- if ("value" in descriptor) descriptor.writable = true;
4196
- Object.defineProperty(target, descriptor.key, descriptor);
4197
- }
4198
- }
4199
- function _createClass(Constructor, protoProps, staticProps) {
4200
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
4201
- if (staticProps) _defineProperties(Constructor, staticProps);
4202
- Object.defineProperty(Constructor, "prototype", {
4203
- writable: false
4204
- });
4205
- return Constructor;
4206
- }
4207
-
4208
- function _assertThisInitialized(self) {
4209
- if (self === void 0) {
4210
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4211
- }
4212
- return self;
4213
- }
4214
-
4215
- function _setPrototypeOf(o, p) {
4216
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
4217
- o.__proto__ = p;
4218
- return o;
4219
- };
4220
- return _setPrototypeOf(o, p);
4221
- }
4222
-
4223
- function _inherits(subClass, superClass) {
4224
- if (typeof superClass !== "function" && superClass !== null) {
4225
- throw new TypeError("Super expression must either be null or a function");
4226
- }
4227
- subClass.prototype = Object.create(superClass && superClass.prototype, {
4228
- constructor: {
4229
- value: subClass,
4230
- writable: true,
4231
- configurable: true
4232
- }
4233
- });
4234
- Object.defineProperty(subClass, "prototype", {
4235
- writable: false
4236
- });
4237
- if (superClass) _setPrototypeOf(subClass, superClass);
4238
- }
4239
-
4240
- function _getPrototypeOf(o) {
4241
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
4242
- return o.__proto__ || Object.getPrototypeOf(o);
4243
- };
4244
- return _getPrototypeOf(o);
4245
- }
4246
-
4247
- function _isNativeReflectConstruct() {
4248
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
4249
- if (Reflect.construct.sham) return false;
4250
- if (typeof Proxy === "function") return true;
4251
- try {
4252
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
4253
- return true;
4254
- } catch (e) {
4255
- return false;
4256
- }
4257
- }
4258
-
4259
- function _typeof(obj) {
4260
- "@babel/helpers - typeof";
4261
-
4262
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
4263
- return typeof obj;
4264
- } : function (obj) {
4265
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
4266
- }, _typeof(obj);
4267
- }
4268
-
4269
- function _possibleConstructorReturn(self, call) {
4270
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
4271
- return call;
4272
- } else if (call !== void 0) {
4273
- throw new TypeError("Derived constructors may only return object or undefined");
4274
- }
4275
- return _assertThisInitialized(self);
4276
- }
4277
-
4278
- function _createSuper(Derived) {
4279
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
4280
- return function _createSuperInternal() {
4281
- var Super = _getPrototypeOf(Derived),
4282
- result;
4283
- if (hasNativeReflectConstruct) {
4284
- var NewTarget = _getPrototypeOf(this).constructor;
4285
- result = Reflect.construct(Super, arguments, NewTarget);
4286
- } else {
4287
- result = Super.apply(this, arguments);
4288
- }
4289
- return _possibleConstructorReturn(this, result);
4290
- };
4291
- }
4292
-
4293
- var LOADING_IMG_SRC = '/images/gears.gif';
4294
- var NOT_FOUND_IMG_SRC = '/images/404.png';
4295
- var DEFAULT_MAX_ATTEMPTS = 3;
4296
- var DEFAULT_ATTEMPT_INTERVAL = 10000;
4297
- var Img = /*#__PURE__*/function (_Component) {
4298
- _inherits(Img, _Component);
4299
- var _super = _createSuper(Img);
4300
- function Img(props) {
4301
- var _this;
4302
- _classCallCheck(this, Img);
4303
- _this = _super.call(this, props);
4304
- _this.state = {
4305
- src: _this.props.src,
4306
- attempts: 0
4307
- };
4308
- _this.onError = _this.onError.bind(_assertThisInitialized(_this));
4309
- return _this;
4310
- }
4311
- _createClass(Img, [{
4312
- key: "UNSAFE_componentWillReceiveProps",
4313
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
4314
- if (nextProps.src !== this.props.src) {
4315
- this.setState({
4316
- src: nextProps.src,
4317
- attempts: 0
4318
- });
4319
- }
4320
- }
4321
- }, {
4322
- key: "componentWillUnmount",
4323
- value: function componentWillUnmount() {
4324
- if (this.retryId) {
4325
- clearTimeout(this.retryId);
4326
- }
4327
- }
4328
- }, {
4329
- key: "onError",
4330
- value: function onError() {
4331
- var _this2 = this;
4332
- if (NOT_FOUND_IMG_SRC === this.state.src) {
4333
- return;
4334
- }
4335
- var max_attempts = this.props.max_attempts || DEFAULT_MAX_ATTEMPTS;
4336
- var attempt_interval = this.props.attempt_interval || DEFAULT_ATTEMPT_INTERVAL;
4337
- if (this.state.attempts >= max_attempts) {
4338
- this.setState({
4339
- src: NOT_FOUND_IMG_SRC
4340
- });
4341
- return;
4342
- }
4343
- this.setState({
4344
- src: LOADING_IMG_SRC,
4345
- attempts: this.state.attempts + 1
4346
- });
4347
- this.retryId = setTimeout(function () {
4348
- _this2.setState({
4349
- src: _this2.props.src
4350
- });
4351
- }, attempt_interval * (this.state.attempts + 1) * (this.state.attempts + 1));
4352
- }
4353
- }, {
4354
- key: "render",
4355
- value: function render() {
4356
- var props = _objectSpread2(_objectSpread2({
4357
- onError: this.onError
4358
- }, this.props), {}, {
4359
- src: this.state.src
4360
- });
4361
- return /*#__PURE__*/React__default.createElement("img", Object.assign({
4362
- alt: ""
4363
- }, props));
4364
- }
4365
- }]);
4366
- return Img;
4367
- }(Component);
4368
-
4369
4245
  var ArtworkName = styled.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"])));
4370
4246
  var UpdateDate = styled.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); });
4371
4247
  var ArtworkControls = styled.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"])));
@@ -4381,12 +4257,12 @@ function extension(filename) {
4381
4257
  return filename.substring(filename.lastIndexOf('.') + 1, filename.length);
4382
4258
  }
4383
4259
  var Artwork = function (_a) {
4384
- var _b = _a.inputProps, inputProps = _b === void 0 ? {} : _b, props = __rest(_a, ["inputProps"]);
4260
+ var _b = _a.inputProps, inputProps = _b === void 0 ? {} : _b, onError = _a.onError, props = __rest(_a, ["inputProps", "onError"]);
4385
4261
  /* TODO: 20 is arbitrary; ideally a component should know its width, and that should be used to compute the max length */
4386
4262
  return React__default.createElement(ArtworkWrapper, { cssHeight: props.cssHeight ? props.cssHeight : props.picture ? 17 : 0, onClick: !props.picture && props.onClick ? props.onClick : undefined },
4387
4263
  props.picture ?
4388
4264
  React__default.createElement(ArtworkPicture, { onClick: function (e) { return props.onClick ? props.onClick(e) : null; }, cssHeight: props.cssHeight ? props.cssHeight : 17 },
4389
- React__default.createElement(Img, { src: props.picture, style: { objectFit: "contain", width: "100%", height: "100%" }, onError: props.onError }))
4265
+ React__default.createElement(Img, { src: props.picture, style: { objectFit: "contain", width: "100%", height: "100%" }, onError: onError }))
4390
4266
  :
4391
4267
  React__default.createElement(IconDoc, { ext: extension(props.name), style: { width: "3vw" } }),
4392
4268
  !props.edit ?
@@ -5189,6 +5065,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
5189
5065
  return target;
5190
5066
  }
5191
5067
 
5068
+ function _setPrototypeOf(o, p) {
5069
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
5070
+ o.__proto__ = p;
5071
+ return o;
5072
+ };
5073
+ return _setPrototypeOf(o, p);
5074
+ }
5075
+
5192
5076
  function _inheritsLoose(subClass, superClass) {
5193
5077
  subClass.prototype = Object.create(superClass.prototype);
5194
5078
  subClass.prototype.constructor = subClass;
@@ -6059,6 +5943,15 @@ var InputStepperOuterContainer = styled.div(templateObject_1$M || (templateObjec
6059
5943
  var InputStepperInnerContainer = styled.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);
6060
5944
  var InputStepperLabel = styled.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);
6061
5945
  var CurrentNumber = styled.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);
5946
+ function InputStepperStyled(props) {
5947
+ 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"]);
5948
+ return (React__default.createElement(InputStepperOuterContainer, { width: containerWidth, style: containerStyle },
5949
+ label && React__default.createElement(InputStepperLabel, { style: labelStyle }, label),
5950
+ React__default.createElement(InputStepperInnerContainer, { style: style },
5951
+ React__default.createElement(IconButton, __assign({ Icon: SubtractIcon, style: { borderRadius: "5px 0 0 5px" }, onClick: onDecrement }, decrementButtonProps)),
5952
+ React__default.createElement(Input, __assign({}, rest, { style: { width: '100%', margin: 0, borderRadius: 0, textAlign: "center" } })),
5953
+ React__default.createElement(IconButton, __assign({ Icon: AddIcon, style: { borderRadius: "0 5px 5px 0" }, onClick: onIncrement }, incrementButtonProps)))));
5954
+ }
6062
5955
  var canIncrement = function (value, max) {
6063
5956
  return (max !== undefined && value < max) || max === undefined;
6064
5957
  };
@@ -6066,21 +5959,21 @@ var canDecrement = function (value, min) {
6066
5959
  return (min !== undefined && value > min) || min === undefined;
6067
5960
  };
6068
5961
  function InputStepper(props) {
6069
- 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"]);
6070
- var _f = useNumberInput({
5962
+ 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"]);
5963
+ var _j = useNumberInput({
6071
5964
  defaultValue: initialValue,
6072
5965
  onChange: rest.onChange,
6073
5966
  onFocus: rest.onFocus,
6074
5967
  onBlur: rest.onBlur,
6075
5968
  inputMode: rest.inputMode,
6076
5969
  localeOptions: localeOptions,
6077
- }), ref = _f.ref, value = _f.value, inputMode = _f.inputMode, onChange = _f.onChange, onBlur = _f.onBlur, onFocus = _f.onFocus, updateValue = _f.updateValue;
6078
- var _g = useLongPress(function () {
5970
+ }), ref = _j.ref, value = _j.value, inputMode = _j.inputMode, onChange = _j.onChange, onBlur = _j.onBlur, onFocus = _j.onFocus, updateValue = _j.updateValue;
5971
+ var _k = useLongPress(function () {
6079
5972
  handleIncrement();
6080
- }), onIncrementMouseDown = _g.onMouseDown, onIncrementMouseLeave = _g.onMouseLeave, onIncrementMouseUp = _g.onMouseUp, onIncrementTouchEnd = _g.onTouchEnd, onIncrementTouchStart = _g.onTouchStart;
6081
- var _h = useLongPress(function () {
5973
+ }), onIncrementMouseDown = _k.onMouseDown, onIncrementMouseLeave = _k.onMouseLeave, onIncrementMouseUp = _k.onMouseUp, onIncrementTouchEnd = _k.onTouchEnd, onIncrementTouchStart = _k.onTouchStart;
5974
+ var _l = useLongPress(function () {
6082
5975
  handleDecrement();
6083
- }), onDecrementMouseDown = _h.onMouseDown, onDecrementMouseLeave = _h.onMouseLeave, onDecrementMouseUp = _h.onMouseUp, onDecrementTouchEnd = _h.onTouchEnd, onDecrementTouchStart = _h.onTouchStart;
5976
+ }), onDecrementMouseDown = _l.onMouseDown, onDecrementMouseLeave = _l.onMouseLeave, onDecrementMouseUp = _l.onMouseUp, onDecrementTouchEnd = _l.onTouchEnd, onDecrementTouchStart = _l.onTouchStart;
6084
5977
  var valueNumber = typeof value === 'string' ? parseFloat(value) : value;
6085
5978
  var decrementButtonVariant = disabled || !canDecrement(valueNumber, min)
6086
5979
  ? "disabled" : "primary";
@@ -6113,23 +6006,23 @@ function InputStepper(props) {
6113
6006
  else if (!canDecrement(parseInt(val), min) && min !== undefined) {
6114
6007
  updateValue(min);
6115
6008
  }
6116
- }, [ref, min, max, updateValue]), 1000);
6009
+ }, [ref, min, max, updateValue]), delayChangeTimeout);
6117
6010
  return (React__default.createElement(InputStepperOuterContainer, { width: width },
6118
6011
  React__default.createElement(InputStepperLabel, { style: labelStyle }, label),
6119
6012
  React__default.createElement(InputStepperInnerContainer, { style: style },
6120
6013
  React__default.createElement(IconButton, { Icon: SubtractIcon, variant: decrementButtonVariant, onClick: handleDecrement, style: { borderRadius: "5px 0 0 5px" }, onMouseDown: function (e) {
6121
- if (e.button !== 0) {
6014
+ if (e.button !== 0 || !holdDecrement) {
6122
6015
  return;
6123
6016
  }
6124
6017
  onDecrementMouseDown();
6125
- }, onMouseOut: onDecrementMouseLeave, onMouseUp: onDecrementMouseUp, onTouchEnd: onDecrementTouchEnd, onTouchStart: onDecrementTouchStart }),
6018
+ }, onMouseOut: holdDecrement ? onDecrementMouseLeave : undefined, onMouseUp: holdDecrement ? onDecrementMouseUp : undefined, onTouchEnd: holdDecrement ? onDecrementTouchEnd : undefined, onTouchStart: holdDecrement ? onDecrementTouchStart : undefined }),
6126
6019
  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 })),
6127
6020
  React__default.createElement(IconButton, { Icon: AddIcon, variant: incrementButtonVariant, onClick: handleIncrement, style: { borderRadius: "0 5px 5px 0" }, onMouseDown: function (e) {
6128
- if (e.button !== 0) {
6021
+ if (e.button !== 0 || !holdIncrement) {
6129
6022
  return;
6130
6023
  }
6131
6024
  onIncrementMouseDown();
6132
- }, onMouseOut: onIncrementMouseLeave, onMouseUp: onIncrementMouseUp, onTouchEnd: onIncrementTouchEnd, onTouchStart: onIncrementTouchStart }))));
6025
+ }, onMouseOut: holdIncrement ? onIncrementMouseLeave : undefined, onMouseUp: holdIncrement ? onIncrementMouseUp : undefined, onTouchEnd: holdIncrement ? onIncrementTouchEnd : undefined, onTouchStart: holdIncrement ? onIncrementTouchStart : undefined }))));
6133
6026
  }
6134
6027
  var templateObject_1$M, templateObject_2$y, templateObject_3$m, templateObject_4$f;
6135
6028
 
@@ -6257,6 +6150,19 @@ function sortDirection(col) {
6257
6150
  var VirtualTableStyles = styled.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 " : ''; });
6258
6151
  var templateObject_1$N;
6259
6152
 
6153
+ var psuedoSelectors = {
6154
+ __after: '&:after',
6155
+ __before: '&:before',
6156
+ __firstLetter: '&:first-letter',
6157
+ __firstLine: '&:first-line',
6158
+ __active: '&:active',
6159
+ __firstChild: '&:first-child',
6160
+ __focus: '&:focus',
6161
+ __hover: '&:hover',
6162
+ __lang: '&:lang',
6163
+ __link: '&:link',
6164
+ __visited: '&:visited',
6165
+ };
6260
6166
  var isSizeObj = function (val) { return typeof val === 'object' && (val['xs'] || val['sm'] || val['md'] || val['lg'] || val['xl']); };
6261
6167
  var parseResponsiveValue = function (value, transform) {
6262
6168
  if (typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') {
@@ -6277,7 +6183,7 @@ var parseResponsiveValue = function (value, transform) {
6277
6183
  }
6278
6184
  else if (typeof value === 'object') {
6279
6185
  if (!isSizeObj(value)) {
6280
- return value;
6186
+ return transform(value) || value;
6281
6187
  }
6282
6188
  return Object.keys(value)
6283
6189
  .filter(function (k) { return sizes.includes(k); })
@@ -6299,47 +6205,29 @@ var createMeasurementStyle = function (v, keys) {
6299
6205
  return (__assign(__assign({}, acc), (_a = {}, _a[k] = value, _a)));
6300
6206
  }, {});
6301
6207
  };
6302
- var styleKeys = [
6208
+ var styleKeys = __spreadArray([
6303
6209
  'pr', 'pl', 'pt', 'pb', 'px', 'py',
6304
6210
  'mr', 'ml', 'mt', 'mb', 'mx', 'my',
6305
6211
  'width', 'height',
6306
6212
  'color', 'bg', 'background', 'backgroundColor',
6307
6213
  'colSpan',
6308
- 'style', 'sx',
6309
- ];
6310
- var stylesTransformMap = {
6311
- mr: function (v) { return createMeasurementStyle(v, ['marginRight']); },
6312
- ml: function (v) { return createMeasurementStyle(v, ['marginLeft']); },
6313
- mt: function (v) { return createMeasurementStyle(v, ['marginTop']); },
6314
- mb: function (v) { return createMeasurementStyle(v, ['marginBottom']); },
6315
- mx: function (v) { return createMeasurementStyle(v, ['marginLeft', 'marginRight']); },
6316
- my: function (v) { return createMeasurementStyle(v, ['marginTop', 'marginBottom']); },
6317
- pr: function (v) { return createMeasurementStyle(v, ['paddingRight']); },
6318
- pl: function (v) { return createMeasurementStyle(v, ['paddingLeft']); },
6319
- pt: function (v) { return createMeasurementStyle(v, ['paddingTop']); },
6320
- pb: function (v) { return createMeasurementStyle(v, ['paddingBottom']); },
6321
- px: function (v) { return createMeasurementStyle(v, ['paddingLeft', 'paddingRight']); },
6322
- py: function (v) { return createMeasurementStyle(v, ['paddingTop', 'paddingBottom']); },
6323
- width: function (v) { return createMeasurementStyle(v, ['width']); },
6324
- height: function (v) { return createMeasurementStyle(v, ['height']); },
6325
- color: function (v) { return ({ color: v }); },
6326
- bg: function (v) { return ({ background: v }); },
6327
- background: function (v) { return ({ background: v }); },
6328
- backgroundColor: function (v) { return ({ backgroundColor: v }); },
6329
- hidden: function (v) { return (v ? { display: 'none' } : {}); },
6330
- block: function (v) { return (v ? { display: 'block' } : {}); },
6331
- inline_block: function (v) { return (v ? { display: 'inline-block' } : {}); },
6332
- flex: function (v) { return (v ? { display: 'flex' } : {}); },
6333
- inline_flex: function (v) { return (v ? { display: 'inline-flex' } : {}); },
6334
- grid: function (v) { return (v ? { display: 'grid' } : {}); },
6335
- float: function (v) { return (v === 'clearfix'
6214
+ 'style', 'sx'
6215
+ ], Object.keys(psuedoSelectors), true);
6216
+ var psuedoStylesTransformMap = Object.keys(psuedoSelectors)
6217
+ .reduce(function (acc, k) {
6218
+ var _a;
6219
+ return (__assign(__assign({}, acc), (_a = {}, _a[k] = function (v) {
6220
+ var _a;
6221
+ return (_a = {}, _a[psuedoSelectors[k]] = v, _a);
6222
+ }, _a)));
6223
+ }, {});
6224
+ 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'
6336
6225
  ? { '&::after': {
6337
6226
  content: '',
6338
6227
  display: 'table',
6339
6228
  clear: 'both',
6340
6229
  } }
6341
- : { float: v }); },
6342
- colSpan: function (v) {
6230
+ : { float: v }); }, colSpan: function (v) {
6343
6231
  if (v === 'auto' || v === true) {
6344
6232
  return { gridColumn: 'auto' };
6345
6233
  }
@@ -6348,10 +6236,7 @@ var stylesTransformMap = {
6348
6236
  }
6349
6237
  var colSpan = stripUnit(v);
6350
6238
  return { gridColumn: "span ".concat(colSpan, " / span ").concat(colSpan) };
6351
- },
6352
- style: function (v) { return v; },
6353
- sx: function (v) { return v; },
6354
- };
6239
+ }, style: function (v) { return v; }, sx: function (v) { return v; } }, psuedoStylesTransformMap);
6355
6240
  var parseCskuStyles = function (p) {
6356
6241
  var sizeStylesObj = {};
6357
6242
  var stylesObj = {};
@@ -6412,7 +6297,7 @@ var GridItem = styled.div(function (p) {
6412
6297
  });
6413
6298
 
6414
6299
  var BaseCollapsible = function (props) {
6415
- 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;
6300
+ 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;
6416
6301
  var _b = useState(isOpen ? undefined : 0), height = _b[0], setHeight = _b[1];
6417
6302
  var ref = useRef(null);
6418
6303
  useEffect(function () {
@@ -6437,10 +6322,7 @@ var BaseCollapsible = function (props) {
6437
6322
  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
6438
6323
  ? { border: "3px solid ".concat(colors.teal.main) }
6439
6324
  : {})) },
6440
- React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, onClick: handleToggle },
6441
- React__default.createElement(CollapsibleLabel, { isOpen: isOpen }, label)),
6442
- React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, smStyle: "text-align: right;", xsStyle: "text-align: center;", onClick: handleToggle },
6443
- React__default.createElement(CollapsibleControls, { isOpen: isOpen }, controls)),
6325
+ React__default.createElement(CollapsibleHeader, { isOpen: isOpen, handleToggle: handleToggle, controls: controls }, header || label),
6444
6326
  React__default.createElement(Col, { xs: true, style: {
6445
6327
  overflow: 'hidden',
6446
6328
  transition: 'height 0.2s ease-in-out',
@@ -6460,6 +6342,20 @@ var Collapsible$1 = function (props) {
6460
6342
  };
6461
6343
  return (React__default.createElement(BaseCollapsible, __assign({ isOpen: isOpen, handleToggle: handleToggle }, rest), children));
6462
6344
  };
6345
+ var CollapsibleHeader = function (props) {
6346
+ var children = props.children, controls = props.controls, isOpen = props.isOpen, handleToggle = props.handleToggle;
6347
+ if (children === undefined || children === null) {
6348
+ return null;
6349
+ }
6350
+ if (typeof children === 'string' || typeof children === 'number' || typeof children === 'boolean') {
6351
+ return React__default.createElement(React__default.Fragment, null,
6352
+ React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, onClick: handleToggle },
6353
+ React__default.createElement(CollapsibleLabel, { isOpen: isOpen }, children)),
6354
+ React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, smStyle: "text-align: right;", xsStyle: "text-align: center;", onClick: handleToggle },
6355
+ React__default.createElement(CollapsibleControls, { isOpen: isOpen }, controls)));
6356
+ }
6357
+ return React__default.cloneElement(children, { isOpen: isOpen, handleToggle: handleToggle });
6358
+ };
6463
6359
  var CollapsibleLabel = function (props) {
6464
6360
  var children = props.children, isOpen = props.isOpen;
6465
6361
  if (children === undefined || children === null) {
@@ -7124,5 +7020,5 @@ function SimpleWindowedTable(_a) {
7124
7020
  }
7125
7021
  var templateObject_1$V;
7126
7022
 
7127
- export { AddIcon, AddNoteIcon, AddTaskIcon, AlertIcon, AlertNotification, ArrowIcon, Artwork, SKUAsyncSelect as AsyncSelect, Avatar, AwaitingProofIcon, Backdrop, Background, Badge, BotIcon, Box, BulletIcon, Button, ButtonsGroup, Calendar, CalendarDayBody, CalendarDaysBody, CalendarDaysHeader, CalendarIcon, CalendarTask, CalendarWrapper, CancelButton, ChangeRequestedIcon, ChatIcon, CheckMark, CheckboxIcon, CheckboxLabel, CheckmarkIcon, ChevronIcon, CircleProgressIcon, ClientApprovedIcon, ClipboardIcon, ClockIcon, Col, CollapseStyled, CollapseWrapper, Collapsible, CollapsibleArrowIcon, CollapsibleLabel, CollapsiblePanel, CollapsiblePanelTitle, CollapsiblePanels, Collapsible$1 as CollapsibleV2, Collapsibles, Column, ColumnSelectIcon, CommentIcon, CompletedCheckmarkIcon, ConfirmPopup, CouponIcon, SKUCreatableSelect as CreatableSelect, CreditCardIcon, Csku, CustomDateInput, Datepicker, DaysBodyWrapper, DaysHeaderWrapper, DefaultCalendarFooter, DefaultCalendarHeader, DefaultStar, DollarIcon, DoneButton, Dot, DownloadIcon, DragIcon, DraggableTasksCalendar, DropArea, DropDownContent, Dropdown, DropdownItem, Dropzoned, DropzonedPreviews, EditIcon, EllipsisIcon, EpsIcon, ErrorBoundary, EstimateCircleIcon, EyeIcon, FeedPost, FilledChevronIcon, FolderIcon, GalleryIcon, GearIcon, GlobalStyle, Grid, GridCell, GridIcon, GridItem, GridRow, GridTable, GridTableContainer, H1, H2, H3, H4, H5, H6, HandleIcon, HeaderWrapper, HeadlessTable, HistoryIcon, IconButton, IconDoc, InfoIcon, Input, InputIconLabel, InputIconLabelContainer, InputStepper, IntegrationsIcon, Label, LabeledAsyncSelect, LabeledCheckbox, LabeledCreatableSelect, LabeledIconInput, LabeledInput, LabeledMultiProgress, LabeledProgress, LabeledRadio, LabeledRadioGroup, LabeledRadioInButton, LabeledRadioInButtonGroup, LabeledSelect, LabeledTextarea, LightIndicator, Link, LinkWithIcon, ListIcon, Loading, LockIcon, MailIcon, MarketingStatusIcon, MenuIcon, MultiProgress, NavConnectIcon, NavFinanceIcon, NavManagementIcon, NavProdIcon, NavResourcesIcon, NavSalesIcon, NoteIcon, Number$1 as Number, NumberInput, OpportunityCircleIcon, Overlay, Padding, Page, PanelContact, PanelTileContact, PendingApprovalIcon, PercentIcon, PinIcon, Popup, PopupHeader, PresentationCircleIcon, Product, Progress, PromostandardsIcon, ProofReceivedIcon, ProofingCompleteIcon, Publisher, Radio, RadioIcon, RadioLabel, ReceiptLongIcon, ResponsiveTable, Row, SHARED_STYLE_MAPS, SalesArrowIcon, SalesOrderCircleIcon, SearchIcon, SKUSelect as Select, SharedStyles, ShopIcon, ShowPopup, SidePanel, SimpleWindowedTable, SimpleWindowedTableStyles, SizerCss, SizerWrapper, Sparkles, Spinner, StarIcon, StarRating, StateDropdown, StatusDropdown, StyledCalendarTaskBody, StyledDayBody, StyledDayText, StyledDropArea, StyledDropdown, StyledPanel, StyledTask, SubtractIcon, SVG as SvgIcon, TBody, TD, TH, THSorted, THead, TR, Tab, TabBar, Table, TableIcon, Tabs, TargetIcon, Task, TaskBody, TaskIcon, TaskLabel, TaskName, TasksCalendar, TasksCalendarDayBody, TasksCalendarFooter, TasksCalendarHeader, TemplateIcon, Text, Textarea, Theme, Thermometer, TilesIcon, Toggle, ToggleLink, TrashIcon, UserIcon, UsersIcon, VirtualTable, VirtualTableStyles, Wrapper, XIcon, colors, createMeasurementStyle, datepickerStyles, fontFamilies, fontStyles, fonts, getColor, getFontStyle, getThemeColor, getThemeFontFamily, getThemeFontSize, getThemeFontStyle, getThemeProperty, parseCskuStyles, sizes$1 as sizes, themeOptions, toggleSizes };
7023
+ export { AddIcon, AddNoteIcon, AddTaskIcon, AlertIcon, AlertNotification, ArrowIcon, Artwork, SKUAsyncSelect as AsyncSelect, Avatar, AwaitingProofIcon, Backdrop, Background, Badge, BotIcon, Box, BulletIcon, Button, ButtonsGroup, Calendar, CalendarDayBody, CalendarDaysBody, CalendarDaysHeader, CalendarIcon, CalendarTask, CalendarWrapper, CancelButton, ChangeRequestedIcon, ChatIcon, CheckMark, CheckboxIcon, CheckboxLabel, CheckmarkIcon, ChevronIcon, CircleProgressIcon, ClientApprovedIcon, ClipboardIcon, ClockIcon, Col, CollapseStyled, CollapseWrapper, Collapsible, CollapsibleArrowIcon, CollapsibleLabel, CollapsiblePanel, CollapsiblePanelTitle, CollapsiblePanels, Collapsible$1 as CollapsibleV2, Collapsibles, Column, ColumnSelectIcon, CommentIcon, CompletedCheckmarkIcon, ConfirmPopup, CouponIcon, SKUCreatableSelect as CreatableSelect, CreditCardIcon, Csku, CustomDateInput, Datepicker, DaysBodyWrapper, DaysHeaderWrapper, DefaultCalendarFooter, DefaultCalendarHeader, DefaultStar, DollarIcon, DoneButton, Dot, DownloadIcon, DragIcon, DraggableTasksCalendar, DropArea, DropDownContent, Dropdown, DropdownItem, Dropzoned, DropzonedPreviews, EditIcon, EllipsisIcon, EpsIcon, ErrorBoundary, EstimateCircleIcon, EyeIcon, FeedPost, FilledChevronIcon, FolderIcon, GalleryIcon, GearIcon, GlobalStyle, Grid, GridCell, GridIcon, GridItem, GridRow, GridTable, GridTableContainer, H1, H2, H3, H4, H5, H6, HandleIcon, HeaderWrapper, HeadlessTable, HistoryIcon, IconButton, IconDoc, Img, InfoIcon, Input, InputIconLabel, InputIconLabelContainer, InputStepper, InputStepperStyled, IntegrationsIcon, Label, LabeledAsyncSelect, LabeledCheckbox, LabeledCreatableSelect, LabeledIconInput, LabeledInput, LabeledMultiProgress, LabeledProgress, LabeledRadio, LabeledRadioGroup, LabeledRadioInButton, LabeledRadioInButtonGroup, LabeledSelect, LabeledTextarea, LightIndicator, Link, LinkWithIcon, ListIcon, Loading, LockIcon, MailIcon, MarketingStatusIcon, MenuIcon, MultiProgress, NavConnectIcon, NavFinanceIcon, NavManagementIcon, NavProdIcon, NavResourcesIcon, NavSalesIcon, NoteIcon, Number$1 as Number, NumberInput, OpportunityCircleIcon, Overlay, Padding, Page, PanelContact, PanelTileContact, PendingApprovalIcon, PercentIcon, PinIcon, Popup, PopupHeader, PresentationCircleIcon, Product, Progress, PromostandardsIcon, ProofReceivedIcon, ProofingCompleteIcon, Publisher, Radio, RadioIcon, RadioLabel, ReceiptLongIcon, ResponsiveTable, Row, SHARED_STYLE_MAPS, SalesArrowIcon, SalesOrderCircleIcon, SearchIcon, SKUSelect as Select, SharedStyles, ShopIcon, ShowPopup, SidePanel, SimpleWindowedTable, SimpleWindowedTableStyles, SizerCss, SizerWrapper, Sparkles, Spinner, StarIcon, StarRating, StateDropdown, StatusDropdown, StyledCalendarTaskBody, StyledDayBody, StyledDayText, StyledDropArea, StyledDropdown, StyledPanel, StyledTask, SubtractIcon, SVG as SvgIcon, TBody, TD, TH, THSorted, THead, TR, Tab, TabBar, Table, TableIcon, Tabs, TargetIcon, Task, TaskBody, TaskIcon, TaskLabel, TaskName, TasksCalendar, TasksCalendarDayBody, TasksCalendarFooter, TasksCalendarHeader, TemplateIcon, Text, Textarea, Theme, Thermometer, TilesIcon, Toggle, ToggleLink, TrashIcon, UserIcon, UsersIcon, VirtualTable, VirtualTableStyles, Wrapper, XIcon, colors, createMeasurementStyle, datepickerStyles, fontFamilies, fontStyles, fonts, getColor, getFontStyle, getThemeColor, getThemeFontFamily, getThemeFontSize, getThemeFontStyle, getThemeProperty, parseCskuStyles, sizes$1 as sizes, themeOptions, toggleSizes, useCalendar, useClickOutside, useDelayUnmount, useFallbackRef, useLongPress, usePrefersReducedMotion, useRandomInterval, useWindowSize };
7128
7024
  //# sourceMappingURL=index.es.js.map