@commonsku/styles 1.17.23 → 1.17.25

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
@@ -1,11 +1,11 @@
1
1
  import _, { map, pick, keys, isUndefined, get, uniqueId, assign, range as range$1, isEmpty, tail, toNumber, isString, filter, round, partial, debounce } from 'lodash';
2
2
  import styled, { css, createGlobalStyle, ThemeProvider, keyframes } from 'styled-components';
3
- import React, { useMemo, Fragment, useState, useEffect, useRef, useCallback, useImperativeHandle, Component, useLayoutEffect, forwardRef, createContext, memo } from 'react';
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';
@@ -1421,58 +1421,86 @@ var Theme = function (_a) {
1421
1421
  children));
1422
1422
  };
1423
1423
 
1424
+ var iconSizes$9 = {
1425
+ tiny: {
1426
+ width: 32,
1427
+ height: 32,
1428
+ viewBox: "0 0 32 32",
1429
+ fontSize: ".6em",
1430
+ defaultStrokeWidth: 3,
1431
+ },
1432
+ small: {
1433
+ width: 40,
1434
+ height: 40,
1435
+ viewBox: "0 0 40 40",
1436
+ fontSize: ".6em",
1437
+ defaultStrokeWidth: 3,
1438
+ },
1439
+ medium: {
1440
+ width: 48,
1441
+ height: 48,
1442
+ viewBox: "0 0 48 48",
1443
+ fontSize: ".8em",
1444
+ defaultStrokeWidth: 5,
1445
+ },
1446
+ large: {
1447
+ width: 72,
1448
+ height: 72,
1449
+ viewBox: "0 0 72 72",
1450
+ fontSize: "1em",
1451
+ defaultStrokeWidth: 5,
1452
+ },
1453
+ huge: {
1454
+ width: 96,
1455
+ height: 96,
1456
+ viewBox: "0 0 96 96",
1457
+ fontSize: "1em",
1458
+ defaultStrokeWidth: 5,
1459
+ },
1460
+ default: {
1461
+ height: 48,
1462
+ width: 48,
1463
+ viewBox: "0 0 48 48",
1464
+ fontSize: ".8em",
1465
+ defaultStrokeWidth: 5,
1466
+ },
1467
+ };
1424
1468
  function CircleProgressIcon(_a) {
1425
- var sqSize = _a.sqSize, strokeWidth = _a.strokeWidth, _b = _a.percentage, percentage = _b === void 0 ? 0 : _b, _c = _a.strokeColor, strokeColor = _c === void 0 ? teal.main : _c, _d = _a.textColor, textColor = _d === void 0 ? teal.main : _d, _e = _a.text, text = _e === void 0 ? '' : _e, _f = _a.textStyle, textStyle = _f === void 0 ? {} : _f, _g = _a.color; _g === void 0 ? teal.main : _g; var _h = _a.size, size = _h === void 0 ? "medium" : _h, _j = _a.altText, altText = _j === void 0 ? "Progress level" : _j, props = __rest(_a, ["sqSize", "strokeWidth", "percentage", "strokeColor", "textColor", "text", "textStyle", "color", "size", "altText"]);
1426
- var iconSizes = {
1427
- tiny: {
1428
- width: 32,
1429
- height: 32,
1430
- viewBox: "0 0 32 32",
1431
- },
1432
- small: {
1433
- width: 40,
1434
- height: 40,
1435
- viewBox: "0 0 40 40",
1436
- },
1437
- medium: {
1438
- width: 48,
1439
- height: 48,
1440
- viewBox: "0 0 48 48",
1441
- },
1442
- large: {
1443
- width: 72,
1444
- height: 72,
1445
- viewBox: "0 0 72 72",
1446
- },
1447
- huge: {
1448
- width: 96,
1449
- height: 96,
1450
- viewBox: "0 0 96 96",
1451
- },
1452
- default: {
1453
- height: 48,
1454
- width: 48,
1455
- viewBox: "0 0 48 48",
1456
- },
1457
- };
1458
- sqSize = iconSizes[size]["width"];
1459
- strokeWidth = size === "tiny" || size === "small" ? 3 : 5;
1460
- var radius = (sqSize - strokeWidth) / 2;
1461
- // const viewBox = `0 0 ${sqSize} ${sqSize}`;
1469
+ var strokeWidth = _a.strokeWidth, _b = _a.percentage, percentage = _b === void 0 ? 0 : _b, _c = _a.strokeColor, strokeColor = _c === void 0 ? teal.main : _c, _d = _a.textColor, textColor = _d === void 0 ? teal.main : _d, _e = _a.text, text = _e === void 0 ? "" : _e, _f = _a.textStyle, textStyle = _f === void 0 ? {} : _f, _g = _a.showCheckMarkOnComplete, showCheckMarkOnComplete = _g === void 0 ? false : _g, _h = _a.size, size = _h === void 0 ? "medium" : _h, _j = _a.altText, altText = _j === void 0 ? "Progress level" : _j, props = __rest(_a, ["strokeWidth", "percentage", "strokeColor", "textColor", "text", "textStyle", "showCheckMarkOnComplete", "size", "altText"]);
1470
+ var _k = iconSizes$9[size], width = _k.width, defaultStrokeWidth = _k.defaultStrokeWidth, fontSize = _k.fontSize; _k.viewBox;
1471
+ strokeWidth = strokeWidth || defaultStrokeWidth;
1472
+ var squareSize = width;
1473
+ var radius = (squareSize - strokeWidth) / 2;
1462
1474
  var dashArray = radius * Math.PI * 2;
1463
- var dashOffset = dashArray - dashArray * percentage / 100;
1464
- return React.createElement(SVG$1, __assign({ size: size, iconSizes: iconSizes, "aria-labelledby": "CircleProgressIcon" }, props),
1465
- React.createElement("title", { id: "CircleProgressIcon" }, text !== '' ? "".concat(text, " stage") : percentage ? "".concat(percentage, "% completed") : altText),
1466
- React.createElement("circle", { className: "circle-background", cx: sqSize / 2, cy: sqSize / 2, r: radius, strokeWidth: "".concat(strokeWidth, "px"), style: { fill: 'none', stroke: colors$1.disabledButtonBorder, } }),
1467
- React.createElement("circle", { className: "circle-progress", cx: sqSize / 2, cy: sqSize / 2, r: radius, strokeWidth: "".concat(strokeWidth, "px"), transform: "rotate(-90 ".concat(sqSize / 2, " ").concat(sqSize / 2, ")"), style: {
1475
+ var dashOffset = dashArray - (dashArray * percentage) / 100;
1476
+ var isComplete = percentage === 100;
1477
+ var renderInnerText = useCallback(function () { return (React.createElement("text", { className: "circle-text", x: "50%", y: "50%", dy: ".3em", textAnchor: "middle", style: __assign({ fontSize: fontSize, fontWeight: "bold", fill: textColor }, textStyle) }, text || "".concat(percentage, "%"))); }, [fontSize, textColor, textStyle, text, percentage]);
1478
+ var renderCheckMark = useCallback(function () {
1479
+ var preferredViewBox = 40;
1480
+ var scale = squareSize / preferredViewBox;
1481
+ var scaledPath = [
1482
+ { x: 12.0006 * scale, y: 21.599 * scale },
1483
+ { x: 17.5629 * scale, y: 27.1617 * scale },
1484
+ { x: 29.1621 * scale, y: 15.5625 * scale },
1485
+ ]
1486
+ .map(function (p) { return "".concat(p.x, ",").concat(p.y); })
1487
+ .join(" L");
1488
+ return (React.createElement("path", { d: "M".concat(scaledPath), stroke: strokeColor, strokeWidth: "".concat(strokeWidth, "px"), fill: "none" }));
1489
+ }, [squareSize, strokeColor, strokeWidth]);
1490
+ return (React.createElement(SVG$1, __assign({ size: size, iconSizes: iconSizes$9, "aria-labelledby": "CircleProgressIcon" }, props),
1491
+ React.createElement("title", { id: "CircleProgressIcon" }, altText || (text ? "".concat(text, " stage") : "".concat(percentage, "% completed"))),
1492
+ React.createElement("circle", { className: "circle-background", cx: squareSize / 2, cy: squareSize / 2, r: radius, strokeWidth: "".concat(strokeWidth, "px"), style: { fill: "none", stroke: colors$1.disabledButtonBorder } }),
1493
+ React.createElement("circle", { className: "circle-progress", cx: squareSize / 2, cy: squareSize / 2, r: radius, strokeWidth: "".concat(strokeWidth, "px"), transform: "rotate(-90 ".concat(squareSize / 2, " ").concat(squareSize / 2, ")"), style: {
1468
1494
  strokeDasharray: dashArray,
1469
1495
  strokeDashoffset: dashOffset,
1470
- fill: 'none',
1496
+ fill: "none",
1471
1497
  stroke: strokeColor,
1472
- strokeLinecap: 'round',
1473
- strokeLinejoin: 'round',
1498
+ strokeLinecap: "round",
1499
+ strokeLinejoin: "round",
1474
1500
  } }),
1475
- React.createElement("text", { className: "circle-text", x: "50%", y: "50%", dy: ".3em", textAnchor: "middle", style: __assign({ fontSize: size === "small" || size === "tiny" ? ".6em" : size === "medium" ? ".8em" : "1em", fontWeight: 'bold', fill: textColor }, textStyle) }, text || "".concat(percentage, "%")));
1501
+ showCheckMarkOnComplete && isComplete
1502
+ ? renderCheckMark()
1503
+ : renderInnerText()));
1476
1504
  }
1477
1505
 
1478
1506
  var SVG = styled.svg(templateObject_1$Y || (templateObject_1$Y = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), SharedStyles);
@@ -4064,20 +4092,24 @@ function skuSelectStyles(props) {
4064
4092
  valueContainer: function (provided, state) {
4065
4093
  return __assign(__assign(__assign({}, provided), { padding: '2px 8px' }), props.valueContainerStyles);
4066
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
+ },
4067
4098
  };
4068
4099
  }
4069
- 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) }) })); }; };
4070
- // duplicate styles to overide .resku global styles
4071
- // : React.ForwardRefExoticComponent<SKUSelectProps & React.RefAttributes<BaseSelect>>
4072
- // 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<...>>
4073
- var SKUSelect = React.forwardRef(function (_a, ref) {
4074
- var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
4075
- 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));
4076
4107
  var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
4077
- var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4078
- return React.createElement(BaseSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix }, (inPopup ? popupStyles : {}), { styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props));
4079
- });
4080
- 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) {
4081
4113
  var parentStyle = _a.parentStyle, labelStyle = _a.labelStyle, props = __rest(_a, ["parentStyle", "labelStyle"]);
4082
4114
  return (React.createElement("div", { style: parentStyle },
4083
4115
  React.createElement(Label, { htmlFor: props.name, style: labelStyle },
@@ -4085,39 +4117,46 @@ var LabeledSelect = React.forwardRef(function (_a, ref) {
4085
4117
  " ",
4086
4118
  props.required && '*'),
4087
4119
  React.createElement(SKUSelect, __assign({}, props, { ref: ref }))));
4088
- });
4089
- var SKUCreatableSelect = React.forwardRef(function (_a, ref) {
4090
- var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
4091
- 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));
4092
4126
  var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
4093
- var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4094
- return (React.createElement(BaseCreatableSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
4095
- });
4096
- 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) {
4097
4132
  var parentStyle = _a.parentStyle, labelStyle = _a.labelStyle, props = __rest(_a, ["parentStyle", "labelStyle"]);
4098
4133
  return (React.createElement("div", { style: parentStyle },
4099
4134
  React.createElement(Label, { htmlFor: props.name, style: labelStyle },
4100
4135
  props.label,
4101
4136
  " ",
4102
4137
  props.required && '*'),
4103
- React.createElement(SKUCreatableSelect, __assign({}, props, { ref: ref }))));
4104
- });
4105
- var SKUAsyncSelect = React.forwardRef(function (_a, ref) {
4106
- var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
4107
- 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));
4108
4145
  var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
4109
- var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
4110
- return (React.createElement(BaseAsyncSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
4111
- });
4112
- 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) {
4113
4151
  var parentStyle = _a.parentStyle, labelStyle = _a.labelStyle, props = __rest(_a, ["parentStyle", "labelStyle"]);
4114
4152
  return (React.createElement("div", { style: parentStyle },
4115
4153
  React.createElement(Label, { htmlFor: props.name, style: labelStyle },
4116
4154
  props.label,
4117
4155
  " ",
4118
4156
  props.required && '*'),
4119
- React.createElement(SKUAsyncSelect, __assign({}, props, { ref: ref }))));
4120
- });
4157
+ React.createElement(SKUCreatableSelect, __assign({}, props, { ref: ref }))));
4158
+ }
4159
+ var LabeledCreatableSelect = React.forwardRef(ForwardedLabeledCreatableSelect);
4121
4160
 
4122
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); });
4123
4162
  var templateObject_1$G;
@@ -5604,6 +5643,108 @@ var Dropdown = function (_a) {
5604
5643
  };
5605
5644
  var templateObject_1$p, templateObject_2$b, templateObject_3$6;
5606
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
+
5607
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);
5608
5749
  var templateObject_1$o;
5609
5750
 
@@ -8535,5 +8676,5 @@ var Dropzone = React.forwardRef(function (_a, ref) {
8535
8676
  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']); });
8536
8677
  var templateObject_1;
8537
8678
 
8538
- 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 };
8679
+ 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 };
8539
8680
  //# sourceMappingURL=index.mjs.map