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