@commonsku/styles 1.17.24 → 1.17.26

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.mjs CHANGED
@@ -2,10 +2,10 @@ import _, { map, pick, keys, isUndefined, get, uniqueId, assign, range as range$
2
2
  import styled, { css, createGlobalStyle, ThemeProvider, keyframes } from 'styled-components';
3
3
  import React, { useCallback, useMemo, Fragment, useState, useEffect, useRef, useImperativeHandle, Component, useLayoutEffect, forwardRef, createContext, memo } from 'react';
4
4
  import { useDropzone } from 'react-dropzone';
5
- import BaseSelect from 'react-select';
5
+ import BaseSelect, { components } from 'react-select';
6
6
  export { components, createFilter, mergeStyles } from 'react-select';
7
- import BaseCreatableSelect from 'react-select/creatable';
8
7
  import BaseAsyncSelect from 'react-select/async';
8
+ import BaseCreatableSelect from 'react-select/creatable';
9
9
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
10
10
  import ReactDOM from 'react-dom';
11
11
  import { getWeek, addDays, subWeeks, addWeeks, getMonth, getYear, isSameDay, subMonths, addMonths, format, startOfWeek, lastDayOfWeek, isDate } from 'date-fns';
@@ -4092,20 +4092,24 @@ function skuSelectStyles(props) {
4092
4092
  valueContainer: function (provided, state) {
4093
4093
  return __assign(__assign(__assign({}, provided), { padding: '2px 8px' }), props.valueContainerStyles);
4094
4094
  },
4095
+ multiValue: function (provided, state) {
4096
+ return __assign(__assign(__assign({}, provided), { backgroundColor: getThemeColor(props, 'primary10', colors$1.primary10), color: getThemeColor(props, 'textbody', colors$1.textbody), borderRadius: 20, padding: '0.25rem' }), props.multiValueStyles);
4097
+ },
4095
4098
  };
4096
4099
  }
4097
- var skuSelectThemeByProps = function (props) { return function (theme) { return (__assign(__assign({}, theme), { borderRadius: 5, colors: __assign(__assign({}, theme.colors), { primary25: getThemeColor(props, 'primary0', colors$1.primary0), primary75: getThemeColor(props, 'primary0', colors$1.primary0), primary50: getThemeColor(props, 'primary10', colors$1.primary10), primary: getThemeColor(props, 'primary', colors$1.primary), neutral20: getThemeColor(props, 'select.border', colors$1.select.border), neutral30: getThemeColor(props, 'select.border', colors$1.select.border), neutral80: getThemeColor(props, 'textbody', colors$1.textbody), neutral90: getThemeColor(props, 'textbody', colors$1.textbody) }) })); }; };
4098
- // duplicate styles to overide .resku global styles
4099
- // : React.ForwardRefExoticComponent<SKUSelectProps & React.RefAttributes<BaseSelect>>
4100
- // React.ForwardRefExoticComponent<AdditionalSKUSelectProps & Omit<Pick<Props<unknown, boolean, GroupBase<unknown>>, "aria-errormessage" | "aria-invalid" | "aria-label" | ... 27 more ... | "form"> & InexactPartial<...> & InexactPartial<...>, StateManagedPropKeys> & Partial<...> & StateManagerAdditionalProps<...> & React.RefAttributes<...>>
4101
- var SKUSelect = React.forwardRef(function (_a, ref) {
4102
- var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
4103
- var skuSelectTheme = skuSelectThemeByProps(props);
4100
+ function skuSelectThemeByProps(props) {
4101
+ return function (theme) { return (__assign(__assign({}, theme), { borderRadius: 5, colors: __assign(__assign({}, theme.colors), { primary25: getThemeColor(props, 'primary0', colors$1.primary0), primary75: getThemeColor(props, 'primary0', colors$1.primary0), primary50: getThemeColor(props, 'primary10', colors$1.primary10), primary: getThemeColor(props, 'primary', colors$1.primary), neutral20: getThemeColor(props, 'select.border', colors$1.select.border), neutral30: getThemeColor(props, 'select.border', colors$1.select.border), neutral80: getThemeColor(props, 'textbody', colors$1.textbody), neutral90: getThemeColor(props, 'textbody', colors$1.textbody) }) })); };
4102
+ }
4103
+
4104
+ function ForwardedSKUSelect(_a, ref) {
4105
+ var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, value = _a.value, isMulti = _a.isMulti, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error", "value", "isMulti"]);
4106
+ var skuSelectTheme = skuSelectThemeByProps(__assign({ value: value, isMulti: isMulti }, props));
4104
4107
  var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
4105
- var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4106
- return React.createElement(BaseSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix }, (inPopup ? popupStyles : {}), { styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props));
4107
- });
4108
- var LabeledSelect = React.forwardRef(function (_a, ref) {
4108
+ var selectStyleProps = __assign(__assign({}, props), { value: value, isMulti: isMulti, noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4109
+ return (React.createElement(BaseSelect, __assign({ value: value, isMulti: isMulti, ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
4110
+ }
4111
+ var SKUSelect = React.forwardRef(ForwardedSKUSelect);
4112
+ function ForwardedLabeledSelect(_a, ref) {
4109
4113
  var parentStyle = _a.parentStyle, labelStyle = _a.labelStyle, props = __rest(_a, ["parentStyle", "labelStyle"]);
4110
4114
  return (React.createElement("div", { style: parentStyle },
4111
4115
  React.createElement(Label, { htmlFor: props.name, style: labelStyle },
@@ -4113,39 +4117,46 @@ var LabeledSelect = React.forwardRef(function (_a, ref) {
4113
4117
  " ",
4114
4118
  props.required && '*'),
4115
4119
  React.createElement(SKUSelect, __assign({}, props, { ref: ref }))));
4116
- });
4117
- var SKUCreatableSelect = React.forwardRef(function (_a, ref) {
4118
- var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
4119
- var skuSelectTheme = skuSelectThemeByProps(props);
4120
+ }
4121
+ var LabeledSelect = React.forwardRef(ForwardedLabeledSelect);
4122
+
4123
+ function ForwardedSKUAsyncSelect(_a, ref) {
4124
+ var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, value = _a.value, isMulti = _a.isMulti, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error", "value", "isMulti"]);
4125
+ var skuSelectTheme = skuSelectThemeByProps(__assign({ value: value, isMulti: isMulti }, props));
4120
4126
  var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
4121
- var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4122
- return (React.createElement(BaseCreatableSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
4123
- });
4124
- var LabeledCreatableSelect = React.forwardRef(function (_a, ref) {
4127
+ var selectStyleProps = __assign(__assign({}, props), { value: value, isMulti: isMulti, noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4128
+ return (React.createElement(BaseAsyncSelect, __assign({ value: value, isMulti: isMulti, ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
4129
+ }
4130
+ var SKUAsyncSelect = React.forwardRef(ForwardedSKUAsyncSelect);
4131
+ function ForwardedLabeledAsyncSelect(_a, ref) {
4125
4132
  var parentStyle = _a.parentStyle, labelStyle = _a.labelStyle, props = __rest(_a, ["parentStyle", "labelStyle"]);
4126
4133
  return (React.createElement("div", { style: parentStyle },
4127
4134
  React.createElement(Label, { htmlFor: props.name, style: labelStyle },
4128
4135
  props.label,
4129
4136
  " ",
4130
4137
  props.required && '*'),
4131
- React.createElement(SKUCreatableSelect, __assign({}, props, { ref: ref }))));
4132
- });
4133
- var SKUAsyncSelect = React.forwardRef(function (_a, ref) {
4134
- var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
4135
- var skuSelectTheme = skuSelectThemeByProps(props);
4138
+ React.createElement(SKUAsyncSelect, __assign({}, props, { ref: ref }))));
4139
+ }
4140
+ var LabeledAsyncSelect = React.forwardRef(ForwardedLabeledAsyncSelect);
4141
+
4142
+ function ForwardedSKUCreatableSelect(_a, ref) {
4143
+ var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, value = _a.value, isMulti = _a.isMulti, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error", "value", "isMulti"]);
4144
+ var skuSelectTheme = skuSelectThemeByProps(__assign({ value: value, isMulti: isMulti }, props));
4136
4145
  var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
4137
- var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4138
- return (React.createElement(BaseAsyncSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
4139
- });
4140
- var LabeledAsyncSelect = React.forwardRef(function (_a, ref) {
4146
+ var selectStyleProps = __assign(__assign({}, props), { value: value, isMulti: isMulti, noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4147
+ return (React.createElement(BaseCreatableSelect, __assign({ value: value, isMulti: isMulti, ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
4148
+ }
4149
+ var SKUCreatableSelect = React.forwardRef(ForwardedSKUCreatableSelect);
4150
+ function ForwardedLabeledCreatableSelect(_a, ref) {
4141
4151
  var parentStyle = _a.parentStyle, labelStyle = _a.labelStyle, props = __rest(_a, ["parentStyle", "labelStyle"]);
4142
4152
  return (React.createElement("div", { style: parentStyle },
4143
4153
  React.createElement(Label, { htmlFor: props.name, style: labelStyle },
4144
4154
  props.label,
4145
4155
  " ",
4146
4156
  props.required && '*'),
4147
- React.createElement(SKUAsyncSelect, __assign({}, props, { ref: ref }))));
4148
- });
4157
+ React.createElement(SKUCreatableSelect, __assign({}, props, { ref: ref }))));
4158
+ }
4159
+ var LabeledCreatableSelect = React.forwardRef(ForwardedLabeledCreatableSelect);
4149
4160
 
4150
4161
  var Backdrop = styled.div(templateObject_1$G || (templateObject_1$G = __makeTemplateObject(["\n position: fixed;\n width: 100%;\n height: 100%;\n background-color: rgba(67, 83, 91, .3);\n z-index: 100;\n transition: all ", "s ease-in-out;\n -moz-transition: all ", "s ease-in-out;\n -webkit-transition: all ", "s ease-in-out;\n opacity: 0.8;\n"], ["\n position: fixed;\n width: 100%;\n height: 100%;\n background-color: rgba(67, 83, 91, .3);\n z-index: 100;\n transition: all ", "s ease-in-out;\n -moz-transition: all ", "s ease-in-out;\n -webkit-transition: all ", "s ease-in-out;\n opacity: 0.8;\n"])), function (p) { return ((p.animationDuration || 300) / 1000); }, function (p) { return ((p.animationDuration || 300) / 1000); }, function (p) { return ((p.animationDuration || 300) / 1000); });
4151
4162
  var templateObject_1$G;
@@ -5632,6 +5643,108 @@ var Dropdown = function (_a) {
5632
5643
  };
5633
5644
  var templateObject_1$p, templateObject_2$b, templateObject_3$6;
5634
5645
 
5646
+ var menuContainerStyles = {
5647
+ position: 'absolute',
5648
+ width: '100%',
5649
+ };
5650
+ var subMenuContainerStyles = {
5651
+ position: 'absolute',
5652
+ width: 'max-content',
5653
+ };
5654
+ var menuStyles = {
5655
+ position: 'relative',
5656
+ marginBottom: '0px !important',
5657
+ };
5658
+ var subMenuStyles = {
5659
+ position: 'relative',
5660
+ borderTop: '1px solid',
5661
+ borderTopRightRadius: '5px',
5662
+ marginTop: 0,
5663
+ };
5664
+ var ParentOption = function (_a) {
5665
+ var setFocusedOption = _a.setFocusedOption, OptionComponent = _a.OptionComponent, props = __rest(_a, ["setFocusedOption", "OptionComponent"]);
5666
+ var option = props.data, isFocused = props.isFocused;
5667
+ useEffect(function () {
5668
+ if (isFocused) {
5669
+ setFocusedOption(option);
5670
+ }
5671
+ }, [option, isFocused, setFocusedOption]);
5672
+ if (OptionComponent != null) {
5673
+ return (React.createElement(OptionComponent, __assign({}, props)));
5674
+ }
5675
+ return (React.createElement(components.Option, __assign({}, props)));
5676
+ };
5677
+ var BasePanelledSelect = function (_a, ref) {
5678
+ var value = _a.value, options = _a.options, onChange = _a.onChange, subMenuProps = _a.subMenuProps, components$1 = _a.components, closeMenuOnSelect = _a.closeMenuOnSelect, _b = _a.hideSelectedOptions, hideSelectedOptions = _b === void 0 ? false : _b, props = __rest(_a, ["value", "options", "onChange", "subMenuProps", "components", "closeMenuOnSelect", "hideSelectedOptions"]);
5679
+ var error = props.error, isMulti = props.isMulti;
5680
+ var _c = useState(false), isOpen = _c[0], setOpen = _c[1];
5681
+ var _d = useState(undefined), focusedOption = _d[0], setFocusedOption = _d[1];
5682
+ var _e = useState(0), menuHeight = _e[0], setMenuHeight = _e[1];
5683
+ var _f = useState(0), controlHeight = _f[0], setControlHeight = _f[1];
5684
+ var menuRef = useRef(null);
5685
+ var controlRef = useRef(null);
5686
+ var windowSize = useWindowSize();
5687
+ useLayoutEffect(function () {
5688
+ if (menuRef.current != null) {
5689
+ setMenuHeight(menuRef.current.offsetHeight);
5690
+ }
5691
+ if (controlRef.current != null) {
5692
+ setControlHeight(controlRef.current.offsetHeight);
5693
+ }
5694
+ }, [windowSize, isOpen, value]);
5695
+ var hasSubOptions = useCallback(function (option) {
5696
+ return option != null && option.subOptions != null && option.subOptions.length > 0;
5697
+ }, []);
5698
+ var currentSubOptions = useMemo(function () {
5699
+ if (focusedOption != null && hasSubOptions(focusedOption)) {
5700
+ return focusedOption.subOptions;
5701
+ }
5702
+ return undefined;
5703
+ }, [hasSubOptions, focusedOption]);
5704
+ var onValueChange = function (newValue, actionMeta) {
5705
+ if (onChange == null)
5706
+ return;
5707
+ if (newValue == null) {
5708
+ onChange(newValue, actionMeta);
5709
+ }
5710
+ if (isMulti) {
5711
+ var multiValue = newValue;
5712
+ var singleValues = multiValue.filter(function (opt) { return !hasSubOptions(opt); });
5713
+ onChange(singleValues, actionMeta);
5714
+ return;
5715
+ }
5716
+ if (!hasSubOptions(newValue)) {
5717
+ onChange(newValue, actionMeta);
5718
+ if (closeMenuOnSelect !== null && closeMenuOnSelect !== void 0 ? closeMenuOnSelect : !isMulti) {
5719
+ setOpen(false);
5720
+ }
5721
+ }
5722
+ };
5723
+ var onSubValueChange = function (newSubValue, actionMeta) {
5724
+ if (onChange != null) {
5725
+ onChange(newSubValue, actionMeta);
5726
+ }
5727
+ if (closeMenuOnSelect !== null && closeMenuOnSelect !== void 0 ? closeMenuOnSelect : !isMulti) {
5728
+ setOpen(false);
5729
+ }
5730
+ };
5731
+ var renderParentOption = useCallback(function (props) { return (React.createElement(ParentOption, __assign({ setFocusedOption: setFocusedOption, OptionComponent: components$1 === null || components$1 === void 0 ? void 0 : components$1.Option }, props))); }, [setFocusedOption, components$1 === null || components$1 === void 0 ? void 0 : components$1.Option]);
5732
+ var renderMenu = useCallback(function (props) { return (React.createElement("div", { style: __assign(__assign({}, menuContainerStyles), { top: controlHeight }), ref: menuRef },
5733
+ React.createElement(components.Menu, __assign({}, props)))); }, [controlHeight]);
5734
+ var renderSubMenu = useCallback(function (props) { return (React.createElement("div", { style: subMenuContainerStyles },
5735
+ React.createElement(components.Menu, __assign({}, props)))); }, []);
5736
+ var renderControl = useCallback(function (props) { return (React.createElement("div", { ref: controlRef },
5737
+ React.createElement(components.Control, __assign({}, props)))); }, []);
5738
+ return (React.createElement("div", null,
5739
+ React.createElement(Row, null,
5740
+ React.createElement(SKUSelect, __assign({ value: value, options: options, onMenuOpen: function () { return setOpen(true); }, onMenuClose: function () { return setOpen(false); }, menuIsOpen: isOpen, ref: ref, components: __assign(__assign({}, components$1), { Option: renderParentOption, Menu: renderMenu, Control: renderControl }), onChange: onValueChange, menuStyles: menuStyles, hideSelectedOptions: hideSelectedOptions, closeMenuOnSelect: false }, props)),
5741
+ currentSubOptions != null &&
5742
+ React.createElement(SKUSelect, __assign({ value: value, options: currentSubOptions, menuIsOpen: isOpen, onChange: onSubValueChange, menuStyles: __assign(__assign({}, subMenuStyles), { height: menuHeight, top: controlHeight, borderTopColor: error
5743
+ ? getThemeColor(props, 'select.error.border', colors$1.select.error.border)
5744
+ : getThemeColor(props, 'select.active.border', colors$1.select.active.border) }), hideSelectedOptions: hideSelectedOptions, closeMenuOnSelect: false, isMulti: isMulti }, subMenuProps, { components: __assign(__assign({ Control: function () { return null; } }, (subMenuProps === null || subMenuProps === void 0 ? void 0 : subMenuProps.components)), { Menu: renderSubMenu }) })))));
5745
+ };
5746
+ var PanelledSelect = forwardRef(BasePanelledSelect);
5747
+
5635
5748
  var Badge = styled.span(templateObject_1$o || (templateObject_1$o = __makeTemplateObject(["\n display: inline-block;\n min-width: 10px;\n padding: 3px 7px;\n font-size: 12px;\n font-weight: 700;\n line-height: 1;\n color: #fff;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n background-color: ", ";\n color: ", ";\n border-radius: 10px;\n ", "\n"], ["\n display: inline-block;\n min-width: 10px;\n padding: 3px 7px;\n font-size: 12px;\n font-weight: 700;\n line-height: 1;\n color: #fff;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n background-color: ", ";\n color: ", ";\n border-radius: 10px;\n ", "\n"])), function (p) { return p.color === 'cta' ? colors$1.cta : p.color === 'grey' ? colors$1.primary0 : colors$1.primary; }, function (p) { return p.color === 'grey' ? colors$1.primary100 : colors$1.white; }, SharedStyles);
5636
5749
  var templateObject_1$o;
5637
5750
 
@@ -7172,7 +7285,7 @@ function InputStepper(props) {
7172
7285
  var templateObject_1$c, templateObject_2$1, templateObject_3, templateObject_4;
7173
7286
 
7174
7287
  var VirtualTable = function (props) {
7175
- var columns = props.columns, data = props.data, itemSize = props.itemSize, _a = props.height, height = _a === void 0 ? 500 : _a, _b = props.minWidth, minWidth = _b === void 0 ? 140 : _b, _c = props.maxWidth, maxWidth = _c === void 0 ? 500 : _c, defaultSort = props.defaultSort, onClickRow = props.onClickRow, onScroll = props.onScroll, onUpdateData = props.onUpdateData, _d = props.useTableProps, useTableProps = _d === void 0 ? {} : _d, _e = props.tableHeaderProps, tableHeaderProps = _e === void 0 ? {} : _e, _f = props.tableFooterProps, tableFooterProps = _f === void 0 ? {} : _f, _g = props.hideFooter, hideFooter = _g === void 0 ? true : _g, _h = props.hideHeader, hideHeader = _h === void 0 ? false : _h, _j = props.className, className = _j === void 0 ? '' : _j, NoRowsFound = props.NoRowsFound, renderRowSubComponent = props.renderRowSubComponent; props.onResize; var rowGroupStyles = props.rowGroupStyles, rowStyles = props.rowStyles, _k = props.gutterSize, gutterSize = _k === void 0 ? 0 : _k, _l = props.customTableFooterProps, customTableFooterProps = _l === void 0 ? {} : _l, TableFooter = props.TableFooter, onSortChange = props.onSortChange;
7288
+ var columns = props.columns, data = props.data, itemSize = props.itemSize, _a = props.height, height = _a === void 0 ? 500 : _a, _b = props.minWidth, minWidth = _b === void 0 ? 140 : _b, _c = props.maxWidth, maxWidth = _c === void 0 ? 500 : _c, defaultSort = props.defaultSort, onClickRow = props.onClickRow, onScroll = props.onScroll, onUpdateData = props.onUpdateData, _d = props.useTableProps, useTableProps = _d === void 0 ? {} : _d, _e = props.tableHeaderProps, tableHeaderProps = _e === void 0 ? {} : _e, _f = props.tableFooterProps, tableFooterProps = _f === void 0 ? {} : _f, _g = props.hideFooter, hideFooter = _g === void 0 ? true : _g, _h = props.hideHeader, hideHeader = _h === void 0 ? false : _h, _j = props.className, className = _j === void 0 ? "" : _j, NoRowsFound = props.NoRowsFound, renderRowSubComponent = props.renderRowSubComponent; props.onResize; var rowGroupStyles = props.rowGroupStyles, rowStyles = props.rowStyles, _k = props.gutterSize, gutterSize = _k === void 0 ? 0 : _k, _l = props.customTableFooterProps, customTableFooterProps = _l === void 0 ? {} : _l, TableFooter = props.TableFooter, onSortChange = props.onSortChange;
7176
7289
  var defaultColumn = useMemo(function () { return ({
7177
7290
  minWidth: minWidth,
7178
7291
  maxWidth: maxWidth,
@@ -7300,6 +7413,12 @@ var VirtualTable = function (props) {
7300
7413
  useEffect(function () {
7301
7414
  onSortChange && onSortChange({ sortBy: sortBy });
7302
7415
  }, [sortBy]);
7416
+ var scrollToTop = useCallback(function () {
7417
+ listRef.current && listRef.current.scrollTo(0);
7418
+ }, []);
7419
+ useEffect(function () {
7420
+ scrollToTop();
7421
+ }, [data, scrollToTop]);
7303
7422
  return (React.createElement("div", __assign({}, getTableProps(), { className: "table ".concat(className || '') }),
7304
7423
  renderTableHeader(),
7305
7424
  React.createElement("div", __assign({ className: "tbody" }, getTableBodyProps()), rows.length === 0 && NoRowsFound ? React.createElement(NoRowsFound, null) :
@@ -8563,5 +8682,5 @@ var Dropzone = React.forwardRef(function (_a, ref) {
8563
8682
  var Tooltip = styled(Tooltip$1)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: 400px;\n &.type-dark.place-top {\n background-color: ", ";\n padding: 0.3rem 1rem;\n\n &:after {\n border-top-color: ", ";\n background-color: ", ";\n }\n }\n &.type-dark.place-bottom {\n background-color: ", ";\n padding: 0.3rem 1rem;\n\n &:after {\n border-bottom-color: ", ";\n background-color: ", ";\n }\n }\n &.type-dark.place-left {\n background-color: ", ";\n padding: 0.3rem 1rem;\n\n &:after {\n border-left-color: ", ";\n background-color: ", ";\n }\n }\n &.type-dark.place-right {\n background-color: ", ";\n padding: 0.3rem 1rem;\n\n &:after {\n border-right-color: ", ";\n background-color: ", ";\n }\n }\n\n &.type-success.place-top,\n &.type-success.place-bottom,\n &.type-success.place-left,\n &.type-success.place-right {\n background-color: ", ";\n color: ", ";\n padding: 0.3rem 1rem;\n }\n &.type-success.place-top {\n &:after {\n border-top-color: ", ";\n background-color: ", ";\n }\n }\n &.type-success.place-bottom {\n &:after {\n border-bottom-color: ", ";\n background-color: ", ";\n }\n }\n &.type-success.place-left {\n &:after {\n border-left-color: ", ";\n background-color: ", ";\n }\n }\n &.type-success.place-right {\n &:after {\n border-right-color: ", ";\n background-color: ", ";\n }\n }\n"], ["\n max-width: 400px;\n &.type-dark.place-top {\n background-color: ", ";\n padding: 0.3rem 1rem;\n\n &:after {\n border-top-color: ", ";\n background-color: ", ";\n }\n }\n &.type-dark.place-bottom {\n background-color: ", ";\n padding: 0.3rem 1rem;\n\n &:after {\n border-bottom-color: ", ";\n background-color: ", ";\n }\n }\n &.type-dark.place-left {\n background-color: ", ";\n padding: 0.3rem 1rem;\n\n &:after {\n border-left-color: ", ";\n background-color: ", ";\n }\n }\n &.type-dark.place-right {\n background-color: ", ";\n padding: 0.3rem 1rem;\n\n &:after {\n border-right-color: ", ";\n background-color: ", ";\n }\n }\n\n &.type-success.place-top,\n &.type-success.place-bottom,\n &.type-success.place-left,\n &.type-success.place-right {\n background-color: ", ";\n color: ", ";\n padding: 0.3rem 1rem;\n }\n &.type-success.place-top {\n &:after {\n border-top-color: ", ";\n background-color: ", ";\n }\n }\n &.type-success.place-bottom {\n &:after {\n border-bottom-color: ", ";\n background-color: ", ";\n }\n }\n &.type-success.place-left {\n &:after {\n border-left-color: ", ";\n background-color: ", ";\n }\n }\n &.type-success.place-right {\n &:after {\n border-right-color: ", ";\n background-color: ", ";\n }\n }\n"])), function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'neutrals.100', colors$1.neutrals['100']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); }, function (p) { return getThemeColor(p, 'green.90', colors$1.green['90']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); }, function (p) { return getThemeColor(p, 'green.20', colors$1.green['20']); });
8564
8683
  var templateObject_1;
8565
8684
 
8566
- export { AddIcon, AddNoteIcon, AddShoppingCartIcon, 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, ChevronPopup, CircleProgressIcon, ClientApprovedIcon, ClipboardIcon, ClockIcon, Col, CollaborateIcon, CollapseStyled, CollapseWrapper, Collapsible$1 as Collapsible, CollapsibleArrowIcon, CollapsibleLabel, CollapsiblePanel, CollapsiblePanelTitle, CollapsiblePanels, Collapsible as CollapsibleV2, Collapsibles, Column, ColumnSelectIcon, CommentBubbleIcon, CommentIcon, CommonskuMainLogo, CommunityIcon, CompletedCheckmarkIcon, ConfirmAlertPopup, ConfirmPopup, ConnectedIcon, ConnectedPlusIcon, CouponIcon, SKUCreatableSelect as CreatableSelect, CreditCardIcon, Csku, CustomDateInput, DateRangeDropdown, DateRangeInput, DateRangePicker, Datepicker, DaysBodyWrapper, DefaultCalendarFooter, DefaultCalendarHeader, DefaultStar, DesignIcon, DollarIcon, DoneButton, Dot, DoubleArrowIcon, DownloadIcon, DragIcon, DraggableTasksCalendar, DropArea, DropDownContent$2 as DropDownContent, Dropdown, DropdownItem$2 as DropdownItem, Dropzone, Dropzoned, DropzonedPreviews, EPOIcon, EditIcon, EllipsisIcon, EmptyStateArrowIcon as EmptyStateArrow, EpsIcon, ErrorBoundary, EstimateCircleIcon, EyeIcon, FeedPost, FileUploadIcon, FilledChevronIcon, FolderIcon, GalleryIcon, GearIcon, GlobalStyle, Grid, GridCell, GridIcon, GridItem, GridRow, GridTable, GridTableContainer, H1, H2, H3, H4, H5, H6, HandleIcon, HeadlessTable, HelpIcon, HistoryIcon, IconButton, IconDoc, ImageIcon, Img, InfoIcon, Input, InputIconLabel, InputIconLabelContainer, InputStepper, InputStepperStyled, IntegrationsIcon, InventoryIcon, Label, LabeledAsyncSelect, LabeledCheckbox, LabeledCreatableSelect, LabeledIconInput, LabeledInput, LabeledMultiProgress, LabeledProgress, LabeledRadio, LabeledRadioGroup, LabeledRadioInButton, LabeledRadioInButtonGroup, LabeledSelect, LabeledTextarea, LightIndicator, Link, LinkWithIcon, ListIcon, Loading, LockIcon, MagicEraserIcon, MagicIcon, MailIcon, MarketingStatusIcon, MenuIcon, MergeIcon, MultiProgress, NavConnectIcon, NavFinanceIcon, NavManagementIcon, NavProdIcon, NavReportsIcon, NavResourcesIcon, NavSalesIcon, NoteIcon, Number$1 as Number, NumberInput, OpportunityCircleIcon, OrderStatusIcon, Overlay, Padding, Page, PanelContact, PanelTileContact, PendingApprovalIcon, PercentIcon, PinIcon, Popup, PopupHeader, PresentationCircleIcon, Product, ProductCard, ProductDetail, Progress, PromostandardsIcon, ProofReceivedIcon, ProofingCompleteIcon, Publisher, Radio, RadioIcon, RadioLabel, ReceiptLongIcon, RenderChild, ResizableIcon, ResponsiveTable, Row, SHARED_STYLE_MAPS, SalesArrowIcon, SalesOrderCircleIcon, SearchIcon, SKUSelect as Select, SelectionTable, SharedStyles, ShopIcon, ShoppingCartIcon, ShowPopup, SidePanel, SimpleWindowedTable, SimpleWindowedTableStyles, SizerCss, SizerWrapper, SkubotLogo, SkubotSpinner, SlideInIcon, Sparkles, Spinner, StarDarkIcon, StarIcon, StarLightIcon, StarRating, StateDropdown, StatusDropdown, StyledCalendarTaskBody, StyledDropArea, StyledDropdown$2 as StyledDropdown, StyledPanel, StyledTask, SubtractIcon, SVG$1 as SvgIcon, TBody, TD$1 as TD, TH, THSorted, THead, TR, Tab, TabBar, Table, TableIcon, Tabs, TagIcon, TargetIcon, Task, TaskBody, TaskIcon, TaskLabel, TaskName, TasksCalendar, TasksCalendarDayBody, TasksCalendarFooter, TemplateIcon, Text, Textarea, Theme, Thermometer, TilesIcon, Toggle, ToggleLink, ToggleSwitch, ToggleSwitchStyled, Tooltip, TrashIcon, TrendIcon, UploadIcon, UserIcon, UsersIcon, VirtualTable, VirtualTableStyles, Wrapper$4 as Wrapper, XIcon, colors$1 as colors, createMeasurementStyle, datepickerStyles, fontFamilies, fontStyles, fonts, getColor$1 as getColor, getFontStyle, getThemeColor, getThemeFontFamily, getThemeFontSize, getThemeFontStyle, getThemeProperty, parseCskuStyles, sizes, themeOptions, toggleSizes$1 as toggleSizes, useCalendar, useClickOutside, useDelayUnmount, useFallbackRef, useLongPress, usePrefersReducedMotion, useRandomInterval, useWindowSize };
8685
+ export { AddIcon, AddNoteIcon, AddShoppingCartIcon, 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, ChevronPopup, CircleProgressIcon, ClientApprovedIcon, ClipboardIcon, ClockIcon, Col, CollaborateIcon, CollapseStyled, CollapseWrapper, Collapsible$1 as Collapsible, CollapsibleArrowIcon, CollapsibleLabel, CollapsiblePanel, CollapsiblePanelTitle, CollapsiblePanels, Collapsible as CollapsibleV2, Collapsibles, Column, ColumnSelectIcon, CommentBubbleIcon, CommentIcon, CommonskuMainLogo, CommunityIcon, CompletedCheckmarkIcon, ConfirmAlertPopup, ConfirmPopup, ConnectedIcon, ConnectedPlusIcon, CouponIcon, SKUCreatableSelect as CreatableSelect, CreditCardIcon, Csku, CustomDateInput, DateRangeDropdown, DateRangeInput, DateRangePicker, Datepicker, DaysBodyWrapper, DefaultCalendarFooter, DefaultCalendarHeader, DefaultStar, DesignIcon, DollarIcon, DoneButton, Dot, DoubleArrowIcon, DownloadIcon, DragIcon, DraggableTasksCalendar, DropArea, DropDownContent$2 as DropDownContent, Dropdown, DropdownItem$2 as DropdownItem, Dropzone, Dropzoned, DropzonedPreviews, EPOIcon, EditIcon, EllipsisIcon, EmptyStateArrowIcon as EmptyStateArrow, EpsIcon, ErrorBoundary, EstimateCircleIcon, EyeIcon, FeedPost, FileUploadIcon, FilledChevronIcon, FolderIcon, GalleryIcon, GearIcon, GlobalStyle, Grid, GridCell, GridIcon, GridItem, GridRow, GridTable, GridTableContainer, H1, H2, H3, H4, H5, H6, HandleIcon, HeadlessTable, HelpIcon, HistoryIcon, IconButton, IconDoc, ImageIcon, Img, InfoIcon, Input, InputIconLabel, InputIconLabelContainer, InputStepper, InputStepperStyled, IntegrationsIcon, InventoryIcon, Label, LabeledAsyncSelect, LabeledCheckbox, LabeledCreatableSelect, LabeledIconInput, LabeledInput, LabeledMultiProgress, LabeledProgress, LabeledRadio, LabeledRadioGroup, LabeledRadioInButton, LabeledRadioInButtonGroup, LabeledSelect, LabeledTextarea, LightIndicator, Link, LinkWithIcon, ListIcon, Loading, LockIcon, MagicEraserIcon, MagicIcon, MailIcon, MarketingStatusIcon, MenuIcon, MergeIcon, MultiProgress, NavConnectIcon, NavFinanceIcon, NavManagementIcon, NavProdIcon, NavReportsIcon, NavResourcesIcon, NavSalesIcon, NoteIcon, Number$1 as Number, NumberInput, OpportunityCircleIcon, OrderStatusIcon, Overlay, Padding, Page, PanelContact, PanelTileContact, PanelledSelect, PendingApprovalIcon, PercentIcon, PinIcon, Popup, PopupHeader, PresentationCircleIcon, Product, ProductCard, ProductDetail, Progress, PromostandardsIcon, ProofReceivedIcon, ProofingCompleteIcon, Publisher, Radio, RadioIcon, RadioLabel, ReceiptLongIcon, RenderChild, ResizableIcon, ResponsiveTable, Row, SHARED_STYLE_MAPS, SalesArrowIcon, SalesOrderCircleIcon, SearchIcon, SKUSelect as Select, SelectionTable, SharedStyles, ShopIcon, ShoppingCartIcon, ShowPopup, SidePanel, SimpleWindowedTable, SimpleWindowedTableStyles, SizerCss, SizerWrapper, SkubotLogo, SkubotSpinner, SlideInIcon, Sparkles, Spinner, StarDarkIcon, StarIcon, StarLightIcon, StarRating, StateDropdown, StatusDropdown, StyledCalendarTaskBody, StyledDropArea, StyledDropdown$2 as StyledDropdown, StyledPanel, StyledTask, SubtractIcon, SVG$1 as SvgIcon, TBody, TD$1 as TD, TH, THSorted, THead, TR, Tab, TabBar, Table, TableIcon, Tabs, TagIcon, TargetIcon, Task, TaskBody, TaskIcon, TaskLabel, TaskName, TasksCalendar, TasksCalendarDayBody, TasksCalendarFooter, TemplateIcon, Text, Textarea, Theme, Thermometer, TilesIcon, Toggle, ToggleLink, ToggleSwitch, ToggleSwitchStyled, Tooltip, TrashIcon, TrendIcon, UploadIcon, UserIcon, UsersIcon, VirtualTable, VirtualTableStyles, Wrapper$4 as Wrapper, XIcon, colors$1 as colors, createMeasurementStyle, datepickerStyles, fontFamilies, fontStyles, fonts, getColor$1 as getColor, getFontStyle, getThemeColor, getThemeFontFamily, getThemeFontSize, getThemeFontStyle, getThemeProperty, parseCskuStyles, sizes, themeOptions, toggleSizes$1 as toggleSizes, useCalendar, useClickOutside, useDelayUnmount, useFallbackRef, useLongPress, usePrefersReducedMotion, useRandomInterval, useWindowSize };
8567
8686
  //# sourceMappingURL=index.mjs.map