@mw-kit/mw-ui 1.7.104 → 1.7.106

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.
@@ -12193,36 +12193,44 @@ var getMask = function getMask(mask) {
12193
12193
  };
12194
12194
  };
12195
12195
 
12196
- var _templateObject$4, _templateObject2$4, _templateObject3$4;
12197
- var EllipsisContainer = styled.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n\n ", "\n"])), function (_ref) {
12198
- var lines = _ref.lines;
12199
- return lines ? css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n display: -webkit-box;\n\n -webkit-box-orient: vertical;\n -moz-box-orient: vertical;\n -ms-box-orient: vertical;\n box-orient: vertical;\n\n -webkit-line-clamp: ", ";\n -moz-line-clamp: ", ";\n -ms-line-clamp: ", ";\n line-clamp: ", ";\n "])), lines, lines, lines, lines) : css(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n "])));
12200
- });
12196
+ var updateTitle = function updateTitle(event) {
12197
+ var target = event.target;
12201
12198
 
12202
- var EllipsisContainer$1 = function EllipsisContainer$1(props) {
12203
- var myProps = _extends({}, props);
12199
+ while (target && !('ellipsis' in target.dataset)) {
12200
+ target = target.parentElement;
12201
+ }
12204
12202
 
12205
- var _onMouseOver = myProps.onMouseOver || function () {};
12203
+ if (!target) return;
12206
12204
 
12207
- myProps.onMouseOver = function (event) {
12208
- _onMouseOver(event);
12205
+ if (target.scrollWidth > target.offsetWidth || target.scrollHeight > target.offsetHeight) {
12206
+ target.title = target.innerText;
12207
+ } else target.removeAttribute('title');
12208
+ };
12209
12209
 
12210
- var target = event.target;
12210
+ var voidF = function voidF() {};
12211
12211
 
12212
- while (target && !('ellipsis' in target.dataset)) {
12213
- target = target.parentElement;
12214
- }
12212
+ var useEllipsis = function useEllipsis(onMouseOver) {
12213
+ var originalHandler = onMouseOver || voidF;
12215
12214
 
12216
- if (!target) return;
12215
+ var handler = function handler(event) {
12216
+ originalHandler(event);
12217
+ updateTitle(event);
12218
+ };
12217
12219
 
12218
- if (target.scrollWidth > target.offsetWidth || target.scrollHeight > target.offsetHeight) {
12219
- target.title = target.innerText;
12220
- } else target.removeAttribute('title');
12220
+ return {
12221
+ onMouseOver: handler,
12222
+ 'data-ellipsis': ''
12221
12223
  };
12224
+ };
12222
12225
 
12223
- return React__default.createElement(EllipsisContainer, Object.assign({}, myProps, {
12224
- "data-ellipsis": ''
12225
- }));
12226
+ var _templateObject$4, _templateObject2$4, _templateObject3$4;
12227
+ var EllipsisContainer = styled.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n\n ", "\n"])), function (_ref) {
12228
+ var lines = _ref.lines;
12229
+ return lines ? css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n display: -webkit-box;\n\n -webkit-box-orient: vertical;\n -moz-box-orient: vertical;\n -ms-box-orient: vertical;\n box-orient: vertical;\n\n -webkit-line-clamp: ", ";\n -moz-line-clamp: ", ";\n -ms-line-clamp: ", ";\n line-clamp: ", ";\n "])), lines, lines, lines, lines) : css(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n "])));
12230
+ });
12231
+
12232
+ var EllipsisContainer$1 = function EllipsisContainer$1(props) {
12233
+ return React__default.createElement(EllipsisContainer, Object.assign({}, props, useEllipsis(props.onMouseOver)));
12226
12234
  };
12227
12235
 
12228
12236
  var _templateObject$5, _templateObject2$5, _templateObject3$5, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20$1, _templateObject21$1, _templateObject22$1;
@@ -19348,17 +19356,157 @@ var ProgressBar = function ProgressBar(props) {
19348
19356
  };
19349
19357
 
19350
19358
  var _templateObject$17;
19351
- var Close = styled.div(_templateObject$17 || (_templateObject$17 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: calc(50% - ", " / 2);\n right: ", ";\n\n + div {\n /** icon width + tab gap + tab right padding */\n padding-right: ", ";\n }\n\n svg > * {\n transition-property: stroke;\n transition-duration: 0.25s;\n transition-timing-function: ease-in-out;\n }\n"])), function (_ref) {
19359
+ var Container$n = styled.div(_templateObject$17 || (_templateObject$17 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n height: 100%;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-color: #ecedef;\n opacity: 0.8;\n\n cursor: pointer;\n color: ", ";\n\n transition-property: left, right;\n transition-timing-function: linear;\n transition-duration: 0.25s;\n\n z-index: 3;\n"])), function (_ref) {
19352
19360
  var theme = _ref.theme;
19353
- return theme.spacings.s3;
19354
- }, function (_ref2) {
19355
- var theme = _ref2.theme;
19356
- return theme.spacings.s3;
19357
- }, function (_ref3) {
19358
- var theme = _ref3.theme;
19359
- return "calc(" + theme.spacings.s3 + " + " + theme.spacings.s3 + " + " + theme.spacings.s3 + ")";
19361
+ return theme.colors.darkBlue;
19362
+ });
19363
+
19364
+ var ScrollButton = function ScrollButton(props) {
19365
+ var mode = props.mode,
19366
+ visible = props.visible,
19367
+ scrollRef = props.scrollRef;
19368
+ var icon = "chevron_" + mode;
19369
+ var onClick = useCallback(function () {
19370
+ if (!scrollRef) return;
19371
+ scrollRef.scrollBy({
19372
+ left: mode === 'left' ? -(scrollRef.scrollWidth + 1) : scrollRef.scrollWidth,
19373
+ behavior: 'smooth'
19374
+ });
19375
+ }, [scrollRef, mode]);
19376
+ return React__default.createElement(Container$n, {
19377
+ className: ['scroll-arrow'].concat(visible ? ['visible'] : []).join(' '),
19378
+ onClick: onClick
19379
+ }, React__default.createElement(Icon, {
19380
+ type: 'feather',
19381
+ icon: icon,
19382
+ width: 16,
19383
+ height: 16,
19384
+ color: 'black'
19385
+ }));
19386
+ };
19387
+
19388
+ var _templateObject$18, _templateObject2$Q;
19389
+ var Container$o = styled.div(_templateObject$18 || (_templateObject$18 = _taggedTemplateLiteralLoose(["\n overflow-x: auto;\n scrollbar-width: thin;\n scroll-behavior: smooth;\n display: flex;\n width: 100%;\n\n scrollbar-gutter: stable;\n\n -ms-overflow-style: none; /* IE / Edge antigos */\n scrollbar-width: none; /* Firefox */\n &::-webkit-scrollbar {\n display: none; /* Chrome, Safari, Opera */\n }\n\n ", "\n"])), function (_ref) {
19390
+ var theme = _ref.theme,
19391
+ internal = _ref.$internal;
19392
+ return internal && css(_templateObject2$Q || (_templateObject2$Q = _taggedTemplateLiteralLoose(["\n gap: ", ";\n "])), theme.spacings.s6);
19360
19393
  });
19361
19394
 
19395
+ var ScrollButtons = function ScrollButtons(props) {
19396
+ var activeTabIndex = props.activeTabIndex,
19397
+ tabsLength = props.tabsLength;
19398
+
19399
+ var _useState = useState(null),
19400
+ ref = _useState[0],
19401
+ setRef = _useState[1];
19402
+
19403
+ var _useState2 = useState(false),
19404
+ showLeftArrow = _useState2[0],
19405
+ setShowLeftArrow = _useState2[1];
19406
+
19407
+ var _useState3 = useState(false),
19408
+ showRightArrow = _useState3[0],
19409
+ setShowRightArrow = _useState3[1];
19410
+
19411
+ var checkScrollPosition = useCallback(function () {
19412
+ if (!ref) return;
19413
+
19414
+ if (ref.scrollWidth > ref.offsetWidth) {
19415
+ var scrollLeft = ref.scrollLeft,
19416
+ scrollWidth = ref.scrollWidth,
19417
+ clientWidth = ref.clientWidth;
19418
+ setShowLeftArrow(scrollLeft > 10);
19419
+ setShowRightArrow(scrollWidth - clientWidth - scrollLeft > 10);
19420
+ } else {
19421
+ setShowLeftArrow(false);
19422
+ setShowRightArrow(false);
19423
+ }
19424
+ }, [ref]);
19425
+ useEffect(function () {
19426
+ checkScrollPosition();
19427
+ window.addEventListener('resize', checkScrollPosition);
19428
+ return function () {
19429
+ return window.removeEventListener('resize', checkScrollPosition);
19430
+ };
19431
+ }, [checkScrollPosition, tabsLength]);
19432
+ useEffect(function () {
19433
+ if (!ref) return;
19434
+ if (ref.scrollWidth <= ref.offsetWidth) return;
19435
+ var element = ref.children[activeTabIndex];
19436
+ if (!element) return;
19437
+ element.scrollIntoView({
19438
+ behavior: 'smooth',
19439
+ inline: 'nearest'
19440
+ });
19441
+ }, [activeTabIndex, ref]);
19442
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(ScrollButton, {
19443
+ scrollRef: ref,
19444
+ mode: 'left',
19445
+ visible: showLeftArrow
19446
+ }), React__default.createElement(Container$o, {
19447
+ ref: setRef,
19448
+ onWheel: function onWheel(e) {
19449
+ if (!ref) return;
19450
+ var x = ref.offsetWidth * 100 / ref.scrollWidth;
19451
+ ref.scrollLeft += x * (e.deltaY > 0 ? 1 : -1) * 2;
19452
+ e.preventDefault();
19453
+ },
19454
+ onScroll: checkScrollPosition,
19455
+ "$internal": props.internal,
19456
+ children: props.children
19457
+ }), React__default.createElement(ScrollButton, {
19458
+ scrollRef: ref,
19459
+ mode: 'right',
19460
+ visible: showRightArrow
19461
+ }));
19462
+ };
19463
+
19464
+ var sortTabs = function sortTabs(tabs, sorted) {
19465
+ if (sorted === void 0) {
19466
+ sorted = [];
19467
+ }
19468
+
19469
+ if (tabs.length < 1) return sorted;
19470
+ var tab = tabs[0];
19471
+ var group = tab.group;
19472
+
19473
+ if (!group) {
19474
+ return sortTabs(tabs.slice(1), [].concat(sorted, [tab]));
19475
+ }
19476
+
19477
+ var res = tabs.reduce(function (_ref, t) {
19478
+ var tabs = _ref.tabs,
19479
+ sorted = _ref.sorted;
19480
+
19481
+ if (t.group !== group) {
19482
+ return {
19483
+ tabs: [].concat(tabs, [t]),
19484
+ sorted: sorted
19485
+ };
19486
+ }
19487
+
19488
+ return t.primary ? {
19489
+ tabs: tabs,
19490
+ sorted: [t].concat(sorted)
19491
+ } : {
19492
+ tabs: tabs,
19493
+ sorted: [].concat(sorted, [t])
19494
+ };
19495
+ }, {
19496
+ tabs: [],
19497
+ sorted: []
19498
+ });
19499
+ return sortTabs(res.tabs, [].concat(sorted, res.sorted));
19500
+ };
19501
+ var hasChildren = function hasChildren(tabs, group) {
19502
+ return group ? tabs.some(function (tab) {
19503
+ return tab.group === group && !tab.primary;
19504
+ }) : false;
19505
+ };
19506
+
19507
+ var _templateObject$19;
19508
+ var Close = styled.div(_templateObject$19 || (_templateObject$19 = _taggedTemplateLiteralLoose(["\n position: relative;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n background-color: var(--bgColor);\n color: var(--color);\n padding: 4px 8px;\n\n transition: --color 0.5s, --bgColor 0.5s;\n\n svg {\n width: 14px;\n height: 14px;\n\n * {\n transition: --color 0.5s;\n stroke: var(--color);\n }\n }\n"])));
19509
+
19362
19510
  var Close$1 = function Close$1(props) {
19363
19511
  var index = props.index,
19364
19512
  _props$active = props.active,
@@ -19403,18 +19551,108 @@ var Close$1 = function Close$1(props) {
19403
19551
  onClick: onClickClose,
19404
19552
  width: '14px',
19405
19553
  height: '14px',
19406
- strokeWidth: '3px',
19407
- color: active === index ? 'white' : 'darkBlue'
19554
+ strokeWidth: '3px'
19555
+ }));
19556
+ };
19557
+
19558
+ var _templateObject$1a, _templateObject2$R;
19559
+ var StyledTab = styled.div(_templateObject$1a || (_templateObject$1a = _taggedTemplateLiteralLoose(["\n position: relative;\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n cursor: ", ";\n\n background-color: var(--bgColor);\n color: var(--color);\n\n padding: ", ";\n box-shadow: ", ";\n transition: --color 0.5s, --bgColor 0.5s;\n\n border-radius: ", ";\n\n /* Pseudo-element para o degrad\xEA */\n &.overflow::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n width: 34px;\n height: 100%;\n\n background-image: linear-gradient(\n to right,\n transparent,\n var(--bgColor) 80%\n );\n transition: --color 0.5s, --bgColor 0.5s;\n }\n\n ", "\n"])), function (_ref) {
19560
+ var onClick = _ref.onClick;
19561
+ return onClick ? 'pointer' : 'default';
19562
+ }, function (_ref2) {
19563
+ var theme = _ref2.theme;
19564
+ return theme.spacings.s1 + " " + theme.spacings.s3;
19565
+ }, function (_ref3) {
19566
+ var $internal = _ref3.$internal,
19567
+ theme = _ref3.theme;
19568
+ return $internal ? 'none' : "0px 3px 6px " + theme.getColor('black', 15);
19569
+ }, function (_ref4) {
19570
+ var $internal = _ref4.$internal;
19571
+ return $internal ? '4px 4px 0 0' : 'none';
19572
+ }, function (_ref5) {
19573
+ var $primary = _ref5.$primary,
19574
+ $hasSiblings = _ref5.$hasSiblings,
19575
+ $internal = _ref5.$internal;
19576
+ return $primary && $hasSiblings && !$internal && css(_templateObject2$R || (_templateObject2$R = _taggedTemplateLiteralLoose(["\n &::before {\n content: '';\n position: absolute;\n left: 4px;\n top: 4px;\n bottom: 4px;\n width: 3px;\n background-color: var(--colorBefore);\n transition: --colorBefore 0.5s;\n border-radius: 2px;\n }\n "])));
19577
+ });
19578
+
19579
+ var LabelItem = function LabelItem(props) {
19580
+ var children = props.children,
19581
+ onClick = props.onClick,
19582
+ primary = props.primary,
19583
+ hasSiblings = props.hasSiblings,
19584
+ internal = props.internal;
19585
+
19586
+ var _useState = useState(null),
19587
+ ref = _useState[0],
19588
+ setRef = _useState[1];
19589
+
19590
+ return React__default.createElement(StyledTab, Object.assign({
19591
+ ref: setRef,
19592
+ "$primary": primary,
19593
+ "$hasSiblings": hasSiblings,
19594
+ "$internal": internal,
19595
+ onClick: onClick
19596
+ }, useEllipsis(), ref && ref.scrollWidth > ref.offsetWidth ? {
19597
+ className: 'overflow'
19598
+ } : {}, {
19599
+ children: children
19408
19600
  }));
19409
19601
  };
19410
19602
 
19411
- var _templateObject$18, _templateObject2$Q, _templateObject3$J, _templateObject4$x, _templateObject5$t, _templateObject6$q, _templateObject7$q, _templateObject8$n, _templateObject9$k;
19412
- var Container$n = styled.div(_templateObject$18 || (_templateObject$18 = _taggedTemplateLiteralLoose(["\n display: block;\n"])));
19603
+ var _templateObject$1b;
19604
+ var Container$p = styled.div(_templateObject$1b || (_templateObject$1b = _taggedTemplateLiteralLoose(["\n @property --bgColor {\n syntax: '<color>';\n initial-value: #ffffff;\n inherits: false;\n }\n\n @property --color {\n syntax: '<color>';\n initial-value: #000000;\n inherits: false;\n }\n\n @property --colorBefore {\n syntax: '<color>';\n initial-value: #3455ab;\n inherits: false;\n }\n\n &.active *,\n &.active ::before,\n &.active ::after {\n --bgColor: #3455ab;\n --color: #ffffff;\n --colorBefore: #ffffff;\n }\n\n display: flex;\n\n max-width: 176px;\n position: relative;\n"])));
19605
+
19606
+ var _excluded$3 = ["index"];
19607
+
19608
+ var VoidClose = function VoidClose() {
19609
+ return React__default.createElement(React__default.Fragment, null);
19610
+ };
19611
+
19612
+ var TabItem = function TabItem(props) {
19613
+ var _props$active = props.active,
19614
+ active = _props$active[0],
19615
+ setActive = _props$active[1],
19616
+ _props$tabs = props.tabs,
19617
+ tabs = _props$tabs[0],
19618
+ setTabs = _props$tabs[1],
19619
+ onClose = props.onClose,
19620
+ alwaysOpen = props.alwaysOpen;
19621
+ var CloseComponent = alwaysOpen || tabs.length < 2 ? VoidClose : Close$1;
19622
+ return React__default.createElement(React__default.Fragment, null, tabs.map(function (_ref) {
19623
+ var index = _ref.index,
19624
+ tab = _objectWithoutPropertiesLoose(_ref, _excluded$3);
19625
+
19626
+ var isActive = index === active;
19627
+ var hasSiblings = hasChildren(tabs, tab.group);
19628
+ var canClose = !props.internal && (!tab.primary || !hasSiblings);
19629
+ return React__default.createElement(Container$p, Object.assign({
19630
+ key: index
19631
+ }, isActive ? {
19632
+ className: 'active'
19633
+ } : {}), React__default.createElement(LabelItem, {
19634
+ children: tab.label,
19635
+ primary: tab.primary,
19636
+ hasSiblings: hasSiblings,
19637
+ onClick: isActive ? undefined : function () {
19638
+ return setActive(index, tab.data);
19639
+ },
19640
+ internal: props.internal
19641
+ }), canClose && React__default.createElement(CloseComponent, {
19642
+ index: index,
19643
+ active: [active, setActive],
19644
+ options: [tabs, setTabs],
19645
+ onClose: onClose
19646
+ }));
19647
+ }));
19648
+ };
19649
+
19650
+ var _templateObject$1c, _templateObject2$S, _templateObject3$J;
19413
19651
  var delimiters = {
19414
19652
  blue: ['blue'],
19415
19653
  grey: ['warningGray']
19416
19654
  };
19417
- var Tabs = styled.ul(_templateObject2$Q || (_templateObject2$Q = _taggedTemplateLiteralLoose(["\n user-select: none;\n list-style: none;\n display: inline-flex;\n width: 100%;\n\n overflow-x: auto;\n scrollbar-width: none;\n\n ", "\n\n ", ";\n\n gap: ", ";\n\n > li {\n position: relative;\n }\n"])), function (_ref) {
19655
+ var Tabs = styled.div(_templateObject$1c || (_templateObject$1c = _taggedTemplateLiteralLoose(["\n position: relative;\n overflow: hidden;\n\n display: flex;\n width: 100%;\n white-space: nowrap;\n\n ", "\n\n ", "\n\n\n /* exibe as setas de navega\xE7\xE3o vis\xEDveis ao passar o mouse sobre o container */\n &:hover .scroll-arrow.visible:nth-child(1) {\n left: 0;\n }\n & .scroll-arrow:nth-child(1) {\n left: -16px;\n }\n\n &:hover .scroll-arrow.visible:nth-last-child(1) {\n right: 0;\n }\n & .scroll-arrow:nth-last-child(1) {\n right: -16px;\n }\n"])), function (_ref) {
19418
19656
  var spacing = _ref.$spacing;
19419
19657
 
19420
19658
  var _getSpacings$split = getSpacings(spacing || {}, {
@@ -19428,46 +19666,15 @@ var Tabs = styled.ul(_templateObject2$Q || (_templateObject2$Q = _taggedTemplate
19428
19666
  bottom = _getSpacings$split[2],
19429
19667
  left = _getSpacings$split[3];
19430
19668
 
19431
- return css(_templateObject3$J || (_templateObject3$J = _taggedTemplateLiteralLoose(["\n margin: ", " 0 ", " 0;\n padding: 0 ", " 0 ", ";\n "])), top, bottom, right, left);
19669
+ return css(_templateObject2$S || (_templateObject2$S = _taggedTemplateLiteralLoose(["\n margin: ", " 0 ", " 0;\n padding: 0 ", " 0 ", ";\n "])), top, bottom, right, left);
19432
19670
  }, function (_ref2) {
19433
19671
  var theme = _ref2.theme,
19434
19672
  internal = _ref2.$internal,
19435
19673
  delimiter = _ref2.$delimiter;
19436
-
19437
- var border = function () {
19438
- if (delimiter === 'none') {
19439
- return 'none';
19440
- }
19441
-
19442
- return internal ? "1px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'grey']) : "2px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'blue']);
19443
- }();
19444
-
19445
- return css(_templateObject4$x || (_templateObject4$x = _taggedTemplateLiteralLoose(["\n border-bottom: ", ";\n\n + div {\n border: 1px solid ", ";\n border-top-width: 0px;\n border-radius: 0px 0px 2px 2px;\n padding: ", ";\n }\n "])), border, theme.getColor.apply(theme, delimiters.grey), theme.spacings.s3);
19446
- }, function (_ref3) {
19447
- var theme = _ref3.theme,
19448
- internal = _ref3.$internal;
19449
- return internal ? theme.spacings.s6 : 0;
19450
- });
19451
- var Tab = styled.div(_templateObject5$t || (_templateObject5$t = _taggedTemplateLiteralLoose(["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n white-space: nowrap;\n\n ", "\n\n transition-property: padding-right, background-color, color;\n transition-duration: 0.25s;\n transition-timing-function: ease-in-out;\n"])), function (_ref4) {
19452
- var onClick = _ref4.onClick;
19453
- return onClick && css(_templateObject6$q || (_templateObject6$q = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n "])));
19454
- }, function (_ref5) {
19455
- var theme = _ref5.theme,
19456
- active = _ref5.$active,
19457
- internal = _ref5.$internal;
19458
- return css(_templateObject7$q || (_templateObject7$q = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n padding: calc(", " * 1.5) ", ";\n gap: ", ";\n\n ", "\n\n color: ", ";\n "])), theme.colors[active ? 'blue' : 'white'], theme.spacings.s1, theme.spacings.s3, theme.spacings.s3, internal ? css(_templateObject8$n || (_templateObject8$n = _taggedTemplateLiteralLoose(["\n border-radius: 4px 4px 0 0;\n\n ", "\n line-height: 17px;\n "])), function (_ref6) {
19459
- var theme = _ref6.theme;
19460
- return theme.useTypography('h4');
19461
- }) : css(_templateObject9$k || (_templateObject9$k = _taggedTemplateLiteralLoose(["\n box-shadow: 0px 3px 6px ", ";\n\n ", "\n line-height: 19px;\n "])), theme.getColor('black', 15), function (_ref7) {
19462
- var theme = _ref7.theme;
19463
- return theme.useTypography('h2');
19464
- }), theme.colors[active ? 'white' : 'darkBlue']);
19674
+ var border = delimiter === 'none' ? 'none' : internal ? "1px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'grey']) : "2px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'blue']);
19675
+ return css(_templateObject3$J || (_templateObject3$J = _taggedTemplateLiteralLoose(["\n border-bottom: ", ";\n + div {\n border: 1px solid ", ";\n border-top-width: 0px;\n border-radius: 0px 0px 2px 2px;\n padding: ", ";\n }\n "])), border, theme.getColor.apply(theme, delimiters.grey), theme.spacings.s3);
19465
19676
  });
19466
19677
 
19467
- var VoidClose = function VoidClose() {
19468
- return React__default.createElement(React__default.Fragment, null);
19469
- };
19470
-
19471
19678
  var VoidProvider = function VoidProvider(props) {
19472
19679
  return React__default.createElement(React__default.Fragment, {
19473
19680
  children: props.children
@@ -19475,55 +19682,38 @@ var VoidProvider = function VoidProvider(props) {
19475
19682
  };
19476
19683
 
19477
19684
  var Tabs$1 = function Tabs$1(props) {
19478
- var _ref = Array.isArray(props.active) ? props.active : useState(props.active),
19479
- active = _ref[0],
19480
- setActive = _ref[1];
19685
+ var _ref = typeof props.options[1] === 'function' ? props.options : useState(props.options),
19686
+ options = _ref[0],
19687
+ setOptions = _ref[1];
19481
19688
 
19482
- var _ref2 = typeof props.options[1] === 'function' ? props.options : useState(props.options),
19483
- options = _ref2[0],
19484
- setOptions = _ref2[1];
19689
+ var _ref2 = Array.isArray(props.active) ? props.active : useState(props.active),
19690
+ active = _ref2[0],
19691
+ setActive = _ref2[1];
19485
19692
 
19693
+ var sortedTabs = sortTabs(options.map(function (tab, index) {
19694
+ return _extends({}, tab, {
19695
+ index: index
19696
+ });
19697
+ }));
19698
+ var activeTabIndex = sortedTabs.findIndex(function (tab) {
19699
+ return tab.index === active;
19700
+ });
19486
19701
  var divProps = filterObject(props, ['options', 'active', 'internal', 'maxTabs', 'onMaxTabsExceeded', 'onClose', 'alwaysOpen', 'delimiter', 'spacing']);
19487
- var CloseComponent = props.alwaysOpen || options.length < 2 ? VoidClose : Close$1;
19488
- return React__default.createElement(Container$n, Object.assign({}, divProps), React__default.createElement(Tabs, {
19702
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Tabs, Object.assign({}, divProps, {
19489
19703
  "$internal": props.internal,
19490
19704
  "$delimiter": props.delimiter,
19491
- "$spacing": props.spacing,
19492
- onWheel: function onWheel(e) {
19493
- var target = function () {
19494
- var target = e.target;
19495
-
19496
- while (target && target.tagName !== 'UL') {
19497
- target = target.parentElement;
19498
- }
19499
-
19500
- return target;
19501
- }();
19502
-
19503
- if (!target) return;
19504
- var x = target.offsetWidth * 100 / target.scrollWidth;
19505
- target.scrollLeft += x * (e.deltaY > 0 ? 1 : -1) * 2;
19506
- e.preventDefault();
19507
- }
19508
- }, options.map(function (tab, index) {
19509
- return React__default.createElement("li", {
19510
- key: index
19511
- }, React__default.createElement(CloseComponent, {
19512
- index: index,
19513
- active: [active, setActive],
19514
- options: [options, setOptions],
19515
- onClose: props.onClose
19516
- }), React__default.createElement(Tab, Object.assign({}, index === active ? {
19517
- $active: true
19518
- } : {
19519
- onClick: function onClick() {
19520
- return setActive(index, tab.data);
19521
- }
19522
- }, {
19523
- "$internal": props.internal,
19524
- children: tab.label
19525
- })));
19526
- })), options.map(function (tab, index) {
19705
+ "$spacing": props.spacing
19706
+ }), React__default.createElement(ScrollButtons, Object.assign({}, {
19707
+ activeTabIndex: activeTabIndex,
19708
+ tabsLength: options.length,
19709
+ internal: props.internal
19710
+ }), React__default.createElement(TabItem, {
19711
+ active: [active, setActive],
19712
+ tabs: [sortedTabs, setOptions],
19713
+ onClose: props.onClose,
19714
+ alwaysOpen: props.alwaysOpen,
19715
+ internal: props.internal
19716
+ }))), options.map(function (tab, index) {
19527
19717
  if (!('component' in tab)) return React__default.createElement(React__default.Fragment, {
19528
19718
  key: index
19529
19719
  });
@@ -19557,7 +19747,7 @@ var Tabs$1 = function Tabs$1(props) {
19557
19747
  data: tab.data,
19558
19748
  setTab: setTab,
19559
19749
  setLabel: setLabel
19560
- }, index === active ? {
19750
+ }, index === activeTabIndex ? {
19561
19751
  active: true,
19562
19752
  children: React__default.createElement("div", null, React__default.createElement(Component, {
19563
19753
  data: tab.data,
@@ -19569,32 +19759,32 @@ var Tabs$1 = function Tabs$1(props) {
19569
19759
  }));
19570
19760
  };
19571
19761
 
19572
- var _templateObject$19;
19573
- var Container$o = styled.textarea(_templateObject$19 || (_templateObject$19 = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: ", ";\n resize: none;\n outline: 0;\n border: 1px solid #c8c8c8;\n padding: 14px;\n border-radius: 4px;\n color: #192338;\n"])), function (props) {
19762
+ var _templateObject$1d;
19763
+ var Container$q = styled.textarea(_templateObject$1d || (_templateObject$1d = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: ", ";\n resize: none;\n outline: 0;\n border: 1px solid #c8c8c8;\n padding: 14px;\n border-radius: 4px;\n color: #192338;\n"])), function (props) {
19574
19764
  return "" + props.width;
19575
19765
  }, function (props) {
19576
19766
  return "" + props.height;
19577
19767
  });
19578
19768
 
19579
19769
  var TextArea = function TextArea(props) {
19580
- return React__default.createElement(Container$o, Object.assign({}, props));
19770
+ return React__default.createElement(Container$q, Object.assign({}, props));
19581
19771
  };
19582
19772
 
19583
- var _templateObject$1a, _templateObject2$R, _templateObject3$K, _templateObject4$y, _templateObject5$u, _templateObject6$r;
19584
- var Container$p = styled.div(_templateObject$1a || (_templateObject$1a = _taggedTemplateLiteralLoose(["\n border-radius: 4px;\n width: ", ";\n height: 88px;\n border: 1px solid transparent;\n position: relative;\n\n ", "\n\n ", "\n\n ", "\n\n svg {\n cursor: pointer;\n position: absolute;\n top: 14px;\n right: 14px;\n width: 13px;\n height: 13px;\n }\n"])), function (props) {
19773
+ var _templateObject$1e, _templateObject2$T, _templateObject3$K, _templateObject4$x, _templateObject5$t, _templateObject6$q;
19774
+ var Container$r = styled.div(_templateObject$1e || (_templateObject$1e = _taggedTemplateLiteralLoose(["\n border-radius: 4px;\n width: ", ";\n height: 88px;\n border: 1px solid transparent;\n position: relative;\n\n ", "\n\n ", "\n\n ", "\n\n svg {\n cursor: pointer;\n position: absolute;\n top: 14px;\n right: 14px;\n width: 13px;\n height: 13px;\n }\n"])), function (props) {
19585
19775
  return props.size === 'large' ? '837px' : '460px';
19586
19776
  }, function (props) {
19587
- return props.color === 'success' && css(_templateObject2$R || (_templateObject2$R = _taggedTemplateLiteralLoose(["\n background-color: #fcfff5;\n opacity: 1;\n border-color: #a8c599;\n h4 {\n color: #1e561f;\n }\n p {\n color: #1e561fcc;\n }\n "])));
19777
+ return props.color === 'success' && css(_templateObject2$T || (_templateObject2$T = _taggedTemplateLiteralLoose(["\n background-color: #fcfff5;\n opacity: 1;\n border-color: #a8c599;\n h4 {\n color: #1e561f;\n }\n p {\n color: #1e561fcc;\n }\n "])));
19588
19778
  }, function (props) {
19589
19779
  return props.color === 'error' && css(_templateObject3$K || (_templateObject3$K = _taggedTemplateLiteralLoose(["\n background-color: #fff6f6;\n opacity: 1;\n border-color: #973937;\n h4 {\n color: #973937;\n }\n p {\n color: #973937;\n }\n "])));
19590
19780
  }, function (props) {
19591
- return props.color === 'warning' && css(_templateObject4$y || (_templateObject4$y = _taggedTemplateLiteralLoose(["\n background-color: #fffaf3;\n opacity: 1;\n border-color: #ccbea0;\n h4 {\n color: #7a4d05;\n }\n p {\n color: #7a4d05cc;\n }\n "])));
19781
+ return props.color === 'warning' && css(_templateObject4$x || (_templateObject4$x = _taggedTemplateLiteralLoose(["\n background-color: #fffaf3;\n opacity: 1;\n border-color: #ccbea0;\n h4 {\n color: #7a4d05;\n }\n p {\n color: #7a4d05cc;\n }\n "])));
19592
19782
  });
19593
- var IconContainer$2 = styled.div(_templateObject5$u || (_templateObject5$u = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 14px 14px 0 0;\n margin: 0;\n"])));
19594
- var IconContent = styled.div(_templateObject6$r || (_templateObject6$r = _taggedTemplateLiteralLoose(["\n width: 100%;\n padding: 13px 0 21px 28px;\n display: flex;\n flex: 1;\n flex-direction: column;\n\n h4 {\n margin-bottom: 7px;\n font-size: 18p;\n }\n p {\n margin: 0;\n font-size: 14px;\n max-width: 380px;\n }\n"])));
19783
+ var IconContainer$2 = styled.div(_templateObject5$t || (_templateObject5$t = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 14px 14px 0 0;\n margin: 0;\n"])));
19784
+ var IconContent = styled.div(_templateObject6$q || (_templateObject6$q = _taggedTemplateLiteralLoose(["\n width: 100%;\n padding: 13px 0 21px 28px;\n display: flex;\n flex: 1;\n flex-direction: column;\n\n h4 {\n margin-bottom: 7px;\n font-size: 18p;\n }\n p {\n margin: 0;\n font-size: 14px;\n max-width: 380px;\n }\n"])));
19595
19785
 
19596
19786
  var Toast = function Toast(props) {
19597
- return React__default.createElement(Container$p, Object.assign({}, props), React__default.createElement(IconContainer$2, null, React__default.createElement(Icon, {
19787
+ return React__default.createElement(Container$r, Object.assign({}, props), React__default.createElement(IconContainer$2, null, React__default.createElement(Icon, {
19598
19788
  type: 'feather',
19599
19789
  icon: 'x',
19600
19790
  onClick: function onClick() {
@@ -19603,9 +19793,9 @@ var Toast = function Toast(props) {
19603
19793
  })), React__default.createElement(IconContent, null, React__default.createElement("h4", null, props.title), React__default.createElement("p", null, " ", props.description)));
19604
19794
  };
19605
19795
 
19606
- var _templateObject$1b, _templateObject2$S, _templateObject3$L, _templateObject4$z, _templateObject5$v;
19607
- var Image = styled.img(_templateObject$1b || (_templateObject$1b = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n max-height: 100%;\n"])));
19608
- var Container$q = styled.div(_templateObject2$S || (_templateObject2$S = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n\n &,\n ", " {\n width: ", ";\n\n height: ", ";\n }\n"])), Image, function (_ref) {
19796
+ var _templateObject$1f, _templateObject2$U, _templateObject3$L, _templateObject4$y, _templateObject5$u;
19797
+ var Image = styled.img(_templateObject$1f || (_templateObject$1f = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n max-height: 100%;\n"])));
19798
+ var Container$s = styled.div(_templateObject2$U || (_templateObject2$U = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n\n &,\n ", " {\n width: ", ";\n\n height: ", ";\n }\n"])), Image, function (_ref) {
19609
19799
  var width = _ref.width;
19610
19800
 
19611
19801
  switch (typeof width) {
@@ -19636,23 +19826,23 @@ var Dimmer = styled.div(_templateObject3$L || (_templateObject3$L = _taggedTempl
19636
19826
  var theme = _ref3.theme;
19637
19827
  return theme.getColor('greyishBlue', 50);
19638
19828
  });
19639
- var Button$6 = styled(Button$1)(_templateObject4$z || (_templateObject4$z = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n"])), function (_ref4) {
19829
+ var Button$6 = styled(Button$1)(_templateObject4$y || (_templateObject4$y = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n"])), function (_ref4) {
19640
19830
  var theme = _ref4.theme;
19641
19831
  return theme.getColor('white', 50);
19642
19832
  });
19643
- var ModalContent = styled.div(_templateObject5$v || (_templateObject5$v = _taggedTemplateLiteralLoose(["\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n\n img {\n max-height: 100%;\n max-width: 100%;\n }\n"])));
19833
+ var ModalContent = styled.div(_templateObject5$u || (_templateObject5$u = _taggedTemplateLiteralLoose(["\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n\n img {\n max-height: 100%;\n max-width: 100%;\n }\n"])));
19644
19834
 
19645
- var _excluded$3 = ["src", "defaultClickOptions"];
19835
+ var _excluded$4 = ["src", "defaultClickOptions"];
19646
19836
 
19647
19837
  var Zoom = function Zoom(props) {
19648
19838
  var src = props.src,
19649
- imgProps = _objectWithoutPropertiesLoose(props, _excluded$3);
19839
+ imgProps = _objectWithoutPropertiesLoose(props, _excluded$4);
19650
19840
 
19651
19841
  var _useState = useState(false),
19652
19842
  modalOpened = _useState[0],
19653
19843
  setModalOpened = _useState[1];
19654
19844
 
19655
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$q, Object.assign({}, imgProps, {
19845
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$s, Object.assign({}, imgProps, {
19656
19846
  onClick: function onClick() {
19657
19847
  return setModalOpened(true);
19658
19848
  }