@commonsku/styles 1.16.5 → 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';
@@ -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,7 +3499,10 @@ 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
3507
  if (ref.current && !ref.current.contains(e.target)) {
3424
3508
  onClick && onClick(e);
@@ -3680,7 +3764,7 @@ var PopupContainer = function (_a) {
3680
3764
  return ReactDOM.createPortal(children, ref.current);
3681
3765
  };
3682
3766
  var Popup = React__default.forwardRef(function (_a, forwardedRef) {
3683
- 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"]);
3684
3768
  var ref = useFallbackRef(forwardedRef);
3685
3769
  useClickOutside({
3686
3770
  ref: ref,
@@ -3708,14 +3792,14 @@ var Popup = React__default.forwardRef(function (_a, forwardedRef) {
3708
3792
  }, [closeOnClickOutside, closeOnEsc, onClose]);
3709
3793
  return React__default.createElement(PopupContainer, null,
3710
3794
  React__default.createElement(Overlay, { zIndex: overlayZIndex },
3711
- React__default.createElement(PopupWindow, __assign({ className: "popup" }, props, { ref: ref }),
3795
+ React__default.createElement(PopupWindow, __assign({ className: "popup" + (popupClassName ? " ".concat(popupClassName) : '') }, props, { ref: ref }),
3712
3796
  noHeader ? null :
3713
3797
  header ? header : (React__default.createElement(PopupHeader, { className: "popup-header", xsStyle: "flex-wrap: wrap-reverse;", smStyle: "flex-wrap: wrap;" },
3714
3798
  React__default.createElement(Col, { style: { textAlign: 'left', alignSelf: 'center' } },
3715
3799
  React__default.createElement("span", { className: "title" }, title)),
3716
3800
  React__default.createElement(Col, { style: { textAlign: 'right', alignSelf: 'center' } }, noCloseButton ? null :
3717
3801
  controls || React__default.createElement(Button, { onClick: onClose }, "Close")))),
3718
- React__default.createElement("div", { className: "popup-content" }, children))));
3802
+ React__default.createElement("div", { className: "popup-content" + (contentClassName ? " ".concat(contentClassName) : '') }, children))));
3719
3803
  });
3720
3804
  var ShowPopup = function (_a) {
3721
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"]);
@@ -3993,10 +4077,10 @@ var Tabs = /** @class */ (function (_super) {
3993
4077
  };
3994
4078
  Tabs.prototype.render = function () {
3995
4079
  var _this = this;
3996
- 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"]);
3997
4081
  var selectedTab = this.getTab(tabs, this.state.selectedTabIndex);
3998
4082
  return React__default.createElement("div", __assign({}, props),
3999
- 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) {
4000
4084
  _this.setState({ selectedTabIndex: index });
4001
4085
  var callback = tabs[index].onClick;
4002
4086
  if (callback) {
@@ -4158,227 +4242,6 @@ var Product = function (props) {
4158
4242
  };
4159
4243
  var templateObject_1$u, templateObject_2$j, templateObject_3$b, templateObject_4$8;
4160
4244
 
4161
- function _defineProperty(obj, key, value) {
4162
- if (key in obj) {
4163
- Object.defineProperty(obj, key, {
4164
- value: value,
4165
- enumerable: true,
4166
- configurable: true,
4167
- writable: true
4168
- });
4169
- } else {
4170
- obj[key] = value;
4171
- }
4172
- return obj;
4173
- }
4174
-
4175
- function ownKeys(object, enumerableOnly) {
4176
- var keys = Object.keys(object);
4177
- if (Object.getOwnPropertySymbols) {
4178
- var symbols = Object.getOwnPropertySymbols(object);
4179
- enumerableOnly && (symbols = symbols.filter(function (sym) {
4180
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
4181
- })), keys.push.apply(keys, symbols);
4182
- }
4183
- return keys;
4184
- }
4185
- function _objectSpread2(target) {
4186
- for (var i = 1; i < arguments.length; i++) {
4187
- var source = null != arguments[i] ? arguments[i] : {};
4188
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
4189
- _defineProperty(target, key, source[key]);
4190
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
4191
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4192
- });
4193
- }
4194
- return target;
4195
- }
4196
-
4197
- function _classCallCheck(instance, Constructor) {
4198
- if (!(instance instanceof Constructor)) {
4199
- throw new TypeError("Cannot call a class as a function");
4200
- }
4201
- }
4202
-
4203
- function _defineProperties(target, props) {
4204
- for (var i = 0; i < props.length; i++) {
4205
- var descriptor = props[i];
4206
- descriptor.enumerable = descriptor.enumerable || false;
4207
- descriptor.configurable = true;
4208
- if ("value" in descriptor) descriptor.writable = true;
4209
- Object.defineProperty(target, descriptor.key, descriptor);
4210
- }
4211
- }
4212
- function _createClass(Constructor, protoProps, staticProps) {
4213
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
4214
- if (staticProps) _defineProperties(Constructor, staticProps);
4215
- Object.defineProperty(Constructor, "prototype", {
4216
- writable: false
4217
- });
4218
- return Constructor;
4219
- }
4220
-
4221
- function _assertThisInitialized(self) {
4222
- if (self === void 0) {
4223
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4224
- }
4225
- return self;
4226
- }
4227
-
4228
- function _setPrototypeOf(o, p) {
4229
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
4230
- o.__proto__ = p;
4231
- return o;
4232
- };
4233
- return _setPrototypeOf(o, p);
4234
- }
4235
-
4236
- function _inherits(subClass, superClass) {
4237
- if (typeof superClass !== "function" && superClass !== null) {
4238
- throw new TypeError("Super expression must either be null or a function");
4239
- }
4240
- subClass.prototype = Object.create(superClass && superClass.prototype, {
4241
- constructor: {
4242
- value: subClass,
4243
- writable: true,
4244
- configurable: true
4245
- }
4246
- });
4247
- Object.defineProperty(subClass, "prototype", {
4248
- writable: false
4249
- });
4250
- if (superClass) _setPrototypeOf(subClass, superClass);
4251
- }
4252
-
4253
- function _getPrototypeOf(o) {
4254
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
4255
- return o.__proto__ || Object.getPrototypeOf(o);
4256
- };
4257
- return _getPrototypeOf(o);
4258
- }
4259
-
4260
- function _isNativeReflectConstruct() {
4261
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
4262
- if (Reflect.construct.sham) return false;
4263
- if (typeof Proxy === "function") return true;
4264
- try {
4265
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
4266
- return true;
4267
- } catch (e) {
4268
- return false;
4269
- }
4270
- }
4271
-
4272
- function _typeof(obj) {
4273
- "@babel/helpers - typeof";
4274
-
4275
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
4276
- return typeof obj;
4277
- } : function (obj) {
4278
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
4279
- }, _typeof(obj);
4280
- }
4281
-
4282
- function _possibleConstructorReturn(self, call) {
4283
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
4284
- return call;
4285
- } else if (call !== void 0) {
4286
- throw new TypeError("Derived constructors may only return object or undefined");
4287
- }
4288
- return _assertThisInitialized(self);
4289
- }
4290
-
4291
- function _createSuper(Derived) {
4292
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
4293
- return function _createSuperInternal() {
4294
- var Super = _getPrototypeOf(Derived),
4295
- result;
4296
- if (hasNativeReflectConstruct) {
4297
- var NewTarget = _getPrototypeOf(this).constructor;
4298
- result = Reflect.construct(Super, arguments, NewTarget);
4299
- } else {
4300
- result = Super.apply(this, arguments);
4301
- }
4302
- return _possibleConstructorReturn(this, result);
4303
- };
4304
- }
4305
-
4306
- var LOADING_IMG_SRC = '/images/gears.gif';
4307
- var NOT_FOUND_IMG_SRC = '/images/404.png';
4308
- var DEFAULT_MAX_ATTEMPTS = 3;
4309
- var DEFAULT_ATTEMPT_INTERVAL = 10000;
4310
- var Img = /*#__PURE__*/function (_Component) {
4311
- _inherits(Img, _Component);
4312
- var _super = _createSuper(Img);
4313
- function Img(props) {
4314
- var _this;
4315
- _classCallCheck(this, Img);
4316
- _this = _super.call(this, props);
4317
- _this.state = {
4318
- src: _this.props.src,
4319
- attempts: 0
4320
- };
4321
- _this.onError = _this.onError.bind(_assertThisInitialized(_this));
4322
- return _this;
4323
- }
4324
- _createClass(Img, [{
4325
- key: "UNSAFE_componentWillReceiveProps",
4326
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
4327
- if (nextProps.src !== this.props.src) {
4328
- this.setState({
4329
- src: nextProps.src,
4330
- attempts: 0
4331
- });
4332
- }
4333
- }
4334
- }, {
4335
- key: "componentWillUnmount",
4336
- value: function componentWillUnmount() {
4337
- if (this.retryId) {
4338
- clearTimeout(this.retryId);
4339
- }
4340
- }
4341
- }, {
4342
- key: "onError",
4343
- value: function onError() {
4344
- var _this2 = this;
4345
- if (NOT_FOUND_IMG_SRC === this.state.src) {
4346
- return;
4347
- }
4348
- var max_attempts = this.props.max_attempts || DEFAULT_MAX_ATTEMPTS;
4349
- var attempt_interval = this.props.attempt_interval || DEFAULT_ATTEMPT_INTERVAL;
4350
- if (this.state.attempts >= max_attempts) {
4351
- this.setState({
4352
- src: NOT_FOUND_IMG_SRC
4353
- });
4354
- return;
4355
- }
4356
- this.setState({
4357
- src: LOADING_IMG_SRC,
4358
- attempts: this.state.attempts + 1
4359
- });
4360
- this.retryId = setTimeout(function () {
4361
- _this2.setState({
4362
- src: _this2.props.src
4363
- });
4364
- }, attempt_interval * (this.state.attempts + 1) * (this.state.attempts + 1));
4365
- }
4366
- }, {
4367
- key: "render",
4368
- value: function render() {
4369
- var props = _objectSpread2(_objectSpread2({
4370
- onError: this.onError
4371
- }, this.props), {}, {
4372
- src: this.state.src
4373
- });
4374
- return /*#__PURE__*/React__default.createElement("img", Object.assign({
4375
- alt: ""
4376
- }, props));
4377
- }
4378
- }]);
4379
- return Img;
4380
- }(Component);
4381
-
4382
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"])));
4383
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); });
4384
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"])));
@@ -4394,12 +4257,12 @@ function extension(filename) {
4394
4257
  return filename.substring(filename.lastIndexOf('.') + 1, filename.length);
4395
4258
  }
4396
4259
  var Artwork = function (_a) {
4397
- 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"]);
4398
4261
  /* TODO: 20 is arbitrary; ideally a component should know its width, and that should be used to compute the max length */
4399
4262
  return React__default.createElement(ArtworkWrapper, { cssHeight: props.cssHeight ? props.cssHeight : props.picture ? 17 : 0, onClick: !props.picture && props.onClick ? props.onClick : undefined },
4400
4263
  props.picture ?
4401
4264
  React__default.createElement(ArtworkPicture, { onClick: function (e) { return props.onClick ? props.onClick(e) : null; }, cssHeight: props.cssHeight ? props.cssHeight : 17 },
4402
- 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 }))
4403
4266
  :
4404
4267
  React__default.createElement(IconDoc, { ext: extension(props.name), style: { width: "3vw" } }),
4405
4268
  !props.edit ?
@@ -5202,6 +5065,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
5202
5065
  return target;
5203
5066
  }
5204
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
+
5205
5076
  function _inheritsLoose(subClass, superClass) {
5206
5077
  subClass.prototype = Object.create(superClass.prototype);
5207
5078
  subClass.prototype.constructor = subClass;
@@ -6072,6 +5943,15 @@ var InputStepperOuterContainer = styled.div(templateObject_1$M || (templateObjec
6072
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);
6073
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);
6074
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
+ }
6075
5955
  var canIncrement = function (value, max) {
6076
5956
  return (max !== undefined && value < max) || max === undefined;
6077
5957
  };
@@ -6079,21 +5959,21 @@ var canDecrement = function (value, min) {
6079
5959
  return (min !== undefined && value > min) || min === undefined;
6080
5960
  };
6081
5961
  function InputStepper(props) {
6082
- 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"]);
6083
- 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({
6084
5964
  defaultValue: initialValue,
6085
5965
  onChange: rest.onChange,
6086
5966
  onFocus: rest.onFocus,
6087
5967
  onBlur: rest.onBlur,
6088
5968
  inputMode: rest.inputMode,
6089
5969
  localeOptions: localeOptions,
6090
- }), ref = _f.ref, value = _f.value, inputMode = _f.inputMode, onChange = _f.onChange, onBlur = _f.onBlur, onFocus = _f.onFocus, updateValue = _f.updateValue;
6091
- 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 () {
6092
5972
  handleIncrement();
6093
- }), onIncrementMouseDown = _g.onMouseDown, onIncrementMouseLeave = _g.onMouseLeave, onIncrementMouseUp = _g.onMouseUp, onIncrementTouchEnd = _g.onTouchEnd, onIncrementTouchStart = _g.onTouchStart;
6094
- 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 () {
6095
5975
  handleDecrement();
6096
- }), 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;
6097
5977
  var valueNumber = typeof value === 'string' ? parseFloat(value) : value;
6098
5978
  var decrementButtonVariant = disabled || !canDecrement(valueNumber, min)
6099
5979
  ? "disabled" : "primary";
@@ -6126,23 +6006,23 @@ function InputStepper(props) {
6126
6006
  else if (!canDecrement(parseInt(val), min) && min !== undefined) {
6127
6007
  updateValue(min);
6128
6008
  }
6129
- }, [ref, min, max, updateValue]), 1000);
6009
+ }, [ref, min, max, updateValue]), delayChangeTimeout);
6130
6010
  return (React__default.createElement(InputStepperOuterContainer, { width: width },
6131
6011
  React__default.createElement(InputStepperLabel, { style: labelStyle }, label),
6132
6012
  React__default.createElement(InputStepperInnerContainer, { style: style },
6133
6013
  React__default.createElement(IconButton, { Icon: SubtractIcon, variant: decrementButtonVariant, onClick: handleDecrement, style: { borderRadius: "5px 0 0 5px" }, onMouseDown: function (e) {
6134
- if (e.button !== 0) {
6014
+ if (e.button !== 0 || !holdDecrement) {
6135
6015
  return;
6136
6016
  }
6137
6017
  onDecrementMouseDown();
6138
- }, 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 }),
6139
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 })),
6140
6020
  React__default.createElement(IconButton, { Icon: AddIcon, variant: incrementButtonVariant, onClick: handleIncrement, style: { borderRadius: "0 5px 5px 0" }, onMouseDown: function (e) {
6141
- if (e.button !== 0) {
6021
+ if (e.button !== 0 || !holdIncrement) {
6142
6022
  return;
6143
6023
  }
6144
6024
  onIncrementMouseDown();
6145
- }, 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 }))));
6146
6026
  }
6147
6027
  var templateObject_1$M, templateObject_2$y, templateObject_3$m, templateObject_4$f;
6148
6028
 
@@ -6270,6 +6150,19 @@ function sortDirection(col) {
6270
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 " : ''; });
6271
6151
  var templateObject_1$N;
6272
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
+ };
6273
6166
  var isSizeObj = function (val) { return typeof val === 'object' && (val['xs'] || val['sm'] || val['md'] || val['lg'] || val['xl']); };
6274
6167
  var parseResponsiveValue = function (value, transform) {
6275
6168
  if (typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') {
@@ -6290,7 +6183,7 @@ var parseResponsiveValue = function (value, transform) {
6290
6183
  }
6291
6184
  else if (typeof value === 'object') {
6292
6185
  if (!isSizeObj(value)) {
6293
- return value;
6186
+ return transform(value) || value;
6294
6187
  }
6295
6188
  return Object.keys(value)
6296
6189
  .filter(function (k) { return sizes.includes(k); })
@@ -6312,47 +6205,29 @@ var createMeasurementStyle = function (v, keys) {
6312
6205
  return (__assign(__assign({}, acc), (_a = {}, _a[k] = value, _a)));
6313
6206
  }, {});
6314
6207
  };
6315
- var styleKeys = [
6208
+ var styleKeys = __spreadArray([
6316
6209
  'pr', 'pl', 'pt', 'pb', 'px', 'py',
6317
6210
  'mr', 'ml', 'mt', 'mb', 'mx', 'my',
6318
6211
  'width', 'height',
6319
6212
  'color', 'bg', 'background', 'backgroundColor',
6320
6213
  'colSpan',
6321
- 'style', 'sx',
6322
- ];
6323
- var stylesTransformMap = {
6324
- mr: function (v) { return createMeasurementStyle(v, ['marginRight']); },
6325
- ml: function (v) { return createMeasurementStyle(v, ['marginLeft']); },
6326
- mt: function (v) { return createMeasurementStyle(v, ['marginTop']); },
6327
- mb: function (v) { return createMeasurementStyle(v, ['marginBottom']); },
6328
- mx: function (v) { return createMeasurementStyle(v, ['marginLeft', 'marginRight']); },
6329
- my: function (v) { return createMeasurementStyle(v, ['marginTop', 'marginBottom']); },
6330
- pr: function (v) { return createMeasurementStyle(v, ['paddingRight']); },
6331
- pl: function (v) { return createMeasurementStyle(v, ['paddingLeft']); },
6332
- pt: function (v) { return createMeasurementStyle(v, ['paddingTop']); },
6333
- pb: function (v) { return createMeasurementStyle(v, ['paddingBottom']); },
6334
- px: function (v) { return createMeasurementStyle(v, ['paddingLeft', 'paddingRight']); },
6335
- py: function (v) { return createMeasurementStyle(v, ['paddingTop', 'paddingBottom']); },
6336
- width: function (v) { return createMeasurementStyle(v, ['width']); },
6337
- height: function (v) { return createMeasurementStyle(v, ['height']); },
6338
- color: function (v) { return ({ color: v }); },
6339
- bg: function (v) { return ({ background: v }); },
6340
- background: function (v) { return ({ background: v }); },
6341
- backgroundColor: function (v) { return ({ backgroundColor: v }); },
6342
- hidden: function (v) { return (v ? { display: 'none' } : {}); },
6343
- block: function (v) { return (v ? { display: 'block' } : {}); },
6344
- inline_block: function (v) { return (v ? { display: 'inline-block' } : {}); },
6345
- flex: function (v) { return (v ? { display: 'flex' } : {}); },
6346
- inline_flex: function (v) { return (v ? { display: 'inline-flex' } : {}); },
6347
- grid: function (v) { return (v ? { display: 'grid' } : {}); },
6348
- 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'
6349
6225
  ? { '&::after': {
6350
6226
  content: '',
6351
6227
  display: 'table',
6352
6228
  clear: 'both',
6353
6229
  } }
6354
- : { float: v }); },
6355
- colSpan: function (v) {
6230
+ : { float: v }); }, colSpan: function (v) {
6356
6231
  if (v === 'auto' || v === true) {
6357
6232
  return { gridColumn: 'auto' };
6358
6233
  }
@@ -6361,10 +6236,7 @@ var stylesTransformMap = {
6361
6236
  }
6362
6237
  var colSpan = stripUnit(v);
6363
6238
  return { gridColumn: "span ".concat(colSpan, " / span ").concat(colSpan) };
6364
- },
6365
- style: function (v) { return v; },
6366
- sx: function (v) { return v; },
6367
- };
6239
+ }, style: function (v) { return v; }, sx: function (v) { return v; } }, psuedoStylesTransformMap);
6368
6240
  var parseCskuStyles = function (p) {
6369
6241
  var sizeStylesObj = {};
6370
6242
  var stylesObj = {};
@@ -6425,7 +6297,7 @@ var GridItem = styled.div(function (p) {
6425
6297
  });
6426
6298
 
6427
6299
  var BaseCollapsible = function (props) {
6428
- 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;
6429
6301
  var _b = useState(isOpen ? undefined : 0), height = _b[0], setHeight = _b[1];
6430
6302
  var ref = useRef(null);
6431
6303
  useEffect(function () {
@@ -6450,10 +6322,7 @@ var BaseCollapsible = function (props) {
6450
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
6451
6323
  ? { border: "3px solid ".concat(colors.teal.main) }
6452
6324
  : {})) },
6453
- React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, onClick: handleToggle },
6454
- React__default.createElement(CollapsibleLabel, { isOpen: isOpen }, label)),
6455
- React__default.createElement(Col, { xs: true, sm: 5.9, style: { cursor: 'pointer', }, smStyle: "text-align: right;", xsStyle: "text-align: center;", onClick: handleToggle },
6456
- React__default.createElement(CollapsibleControls, { isOpen: isOpen }, controls)),
6325
+ React__default.createElement(CollapsibleHeader, { isOpen: isOpen, handleToggle: handleToggle, controls: controls }, header || label),
6457
6326
  React__default.createElement(Col, { xs: true, style: {
6458
6327
  overflow: 'hidden',
6459
6328
  transition: 'height 0.2s ease-in-out',
@@ -6473,6 +6342,20 @@ var Collapsible$1 = function (props) {
6473
6342
  };
6474
6343
  return (React__default.createElement(BaseCollapsible, __assign({ isOpen: isOpen, handleToggle: handleToggle }, rest), children));
6475
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
+ };
6476
6359
  var CollapsibleLabel = function (props) {
6477
6360
  var children = props.children, isOpen = props.isOpen;
6478
6361
  if (children === undefined || children === null) {
@@ -7137,5 +7020,5 @@ function SimpleWindowedTable(_a) {
7137
7020
  }
7138
7021
  var templateObject_1$V;
7139
7022
 
7140
- 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, useCalendar, useClickOutside, useDelayUnmount, useFallbackRef, useLongPress, usePrefersReducedMotion, useRandomInterval, useWindowSize };
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 };
7141
7024
  //# sourceMappingURL=index.es.js.map