@mw-kit/mw-ui 1.7.104 → 1.7.105

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,158 @@ 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, Object.assign({
19447
+ ref: setRef
19448
+ }, props.divProps, {
19449
+ onWheel: function onWheel(e) {
19450
+ if (!ref) return;
19451
+ var x = ref.offsetWidth * 100 / ref.scrollWidth;
19452
+ ref.scrollLeft += x * (e.deltaY > 0 ? 1 : -1) * 2;
19453
+ e.preventDefault();
19454
+ },
19455
+ onScroll: checkScrollPosition,
19456
+ "$internal": props.internal,
19457
+ children: props.children
19458
+ })), React__default.createElement(ScrollButton, {
19459
+ scrollRef: ref,
19460
+ mode: 'right',
19461
+ visible: showRightArrow
19462
+ }));
19463
+ };
19464
+
19465
+ var sortTabs = function sortTabs(tabs, sorted) {
19466
+ if (sorted === void 0) {
19467
+ sorted = [];
19468
+ }
19469
+
19470
+ if (tabs.length < 1) return sorted;
19471
+ var tab = tabs[0];
19472
+ var group = tab.group;
19473
+
19474
+ if (!group) {
19475
+ return sortTabs(tabs.slice(1), [].concat(sorted, [tab]));
19476
+ }
19477
+
19478
+ var res = tabs.reduce(function (_ref, t) {
19479
+ var tabs = _ref.tabs,
19480
+ sorted = _ref.sorted;
19481
+
19482
+ if (t.group !== group) {
19483
+ return {
19484
+ tabs: [].concat(tabs, [t]),
19485
+ sorted: sorted
19486
+ };
19487
+ }
19488
+
19489
+ return t.primary ? {
19490
+ tabs: tabs,
19491
+ sorted: [t].concat(sorted)
19492
+ } : {
19493
+ tabs: tabs,
19494
+ sorted: [].concat(sorted, [t])
19495
+ };
19496
+ }, {
19497
+ tabs: [],
19498
+ sorted: []
19499
+ });
19500
+ return sortTabs(res.tabs, [].concat(sorted, res.sorted));
19501
+ };
19502
+ var hasChildren = function hasChildren(tabs, group) {
19503
+ return group ? tabs.some(function (tab) {
19504
+ return tab.group === group && !tab.primary;
19505
+ }) : false;
19506
+ };
19507
+
19508
+ var _templateObject$19;
19509
+ 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"])));
19510
+
19362
19511
  var Close$1 = function Close$1(props) {
19363
19512
  var index = props.index,
19364
19513
  _props$active = props.active,
@@ -19403,18 +19552,108 @@ var Close$1 = function Close$1(props) {
19403
19552
  onClick: onClickClose,
19404
19553
  width: '14px',
19405
19554
  height: '14px',
19406
- strokeWidth: '3px',
19407
- color: active === index ? 'white' : 'darkBlue'
19555
+ strokeWidth: '3px'
19556
+ }));
19557
+ };
19558
+
19559
+ var _templateObject$1a, _templateObject2$R;
19560
+ 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) {
19561
+ var onClick = _ref.onClick;
19562
+ return onClick ? 'pointer' : 'default';
19563
+ }, function (_ref2) {
19564
+ var theme = _ref2.theme;
19565
+ return theme.spacings.s1 + " " + theme.spacings.s3;
19566
+ }, function (_ref3) {
19567
+ var $internal = _ref3.$internal,
19568
+ theme = _ref3.theme;
19569
+ return $internal ? 'none' : "0px 3px 6px " + theme.getColor('black', 15);
19570
+ }, function (_ref4) {
19571
+ var $internal = _ref4.$internal;
19572
+ return $internal ? '4px 4px 0 0' : 'none';
19573
+ }, function (_ref5) {
19574
+ var $primary = _ref5.$primary,
19575
+ $hasSiblings = _ref5.$hasSiblings,
19576
+ $internal = _ref5.$internal;
19577
+ 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 "])));
19578
+ });
19579
+
19580
+ var LabelItem = function LabelItem(props) {
19581
+ var children = props.children,
19582
+ onClick = props.onClick,
19583
+ primary = props.primary,
19584
+ hasSiblings = props.hasSiblings,
19585
+ internal = props.internal;
19586
+
19587
+ var _useState = useState(null),
19588
+ ref = _useState[0],
19589
+ setRef = _useState[1];
19590
+
19591
+ return React__default.createElement(StyledTab, Object.assign({
19592
+ ref: setRef,
19593
+ "$primary": primary,
19594
+ "$hasSiblings": hasSiblings,
19595
+ "$internal": internal,
19596
+ onClick: onClick
19597
+ }, useEllipsis(), ref && ref.scrollWidth > ref.offsetWidth ? {
19598
+ className: 'overflow'
19599
+ } : {}, {
19600
+ children: children
19408
19601
  }));
19409
19602
  };
19410
19603
 
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"])));
19604
+ var _templateObject$1b;
19605
+ 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"])));
19606
+
19607
+ var _excluded$3 = ["index"];
19608
+
19609
+ var VoidClose = function VoidClose() {
19610
+ return React__default.createElement(React__default.Fragment, null);
19611
+ };
19612
+
19613
+ var TabItem = function TabItem(props) {
19614
+ var _props$active = props.active,
19615
+ active = _props$active[0],
19616
+ setActive = _props$active[1],
19617
+ _props$tabs = props.tabs,
19618
+ tabs = _props$tabs[0],
19619
+ setTabs = _props$tabs[1],
19620
+ onClose = props.onClose,
19621
+ alwaysOpen = props.alwaysOpen;
19622
+ var CloseComponent = alwaysOpen || tabs.length < 2 ? VoidClose : Close$1;
19623
+ return React__default.createElement(React__default.Fragment, null, tabs.map(function (_ref) {
19624
+ var index = _ref.index,
19625
+ tab = _objectWithoutPropertiesLoose(_ref, _excluded$3);
19626
+
19627
+ var isActive = index === active;
19628
+ var hasSiblings = hasChildren(tabs, tab.group);
19629
+ var canClose = !props.internal && (!tab.primary || !hasSiblings);
19630
+ return React__default.createElement(Container$p, Object.assign({
19631
+ key: index
19632
+ }, isActive ? {
19633
+ className: 'active'
19634
+ } : {}), React__default.createElement(LabelItem, {
19635
+ children: tab.label,
19636
+ primary: tab.primary,
19637
+ hasSiblings: hasSiblings,
19638
+ onClick: isActive ? undefined : function () {
19639
+ return setActive(index, tab.data);
19640
+ },
19641
+ internal: props.internal
19642
+ }), canClose && React__default.createElement(CloseComponent, {
19643
+ index: index,
19644
+ active: [active, setActive],
19645
+ options: [tabs, setTabs],
19646
+ onClose: onClose
19647
+ }));
19648
+ }));
19649
+ };
19650
+
19651
+ var _templateObject$1c, _templateObject2$S, _templateObject3$J;
19413
19652
  var delimiters = {
19414
19653
  blue: ['blue'],
19415
19654
  grey: ['warningGray']
19416
19655
  };
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) {
19656
+ 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
19657
  var spacing = _ref.$spacing;
19419
19658
 
19420
19659
  var _getSpacings$split = getSpacings(spacing || {}, {
@@ -19428,46 +19667,15 @@ var Tabs = styled.ul(_templateObject2$Q || (_templateObject2$Q = _taggedTemplate
19428
19667
  bottom = _getSpacings$split[2],
19429
19668
  left = _getSpacings$split[3];
19430
19669
 
19431
- return css(_templateObject3$J || (_templateObject3$J = _taggedTemplateLiteralLoose(["\n margin: ", " 0 ", " 0;\n padding: 0 ", " 0 ", ";\n "])), top, bottom, right, left);
19670
+ return css(_templateObject2$S || (_templateObject2$S = _taggedTemplateLiteralLoose(["\n margin: ", " 0 ", " 0;\n padding: 0 ", " 0 ", ";\n "])), top, bottom, right, left);
19432
19671
  }, function (_ref2) {
19433
19672
  var theme = _ref2.theme,
19434
19673
  internal = _ref2.$internal,
19435
19674
  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']);
19675
+ var border = delimiter === 'none' ? 'none' : internal ? "1px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'grey']) : "2px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'blue']);
19676
+ 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
19677
  });
19466
19678
 
19467
- var VoidClose = function VoidClose() {
19468
- return React__default.createElement(React__default.Fragment, null);
19469
- };
19470
-
19471
19679
  var VoidProvider = function VoidProvider(props) {
19472
19680
  return React__default.createElement(React__default.Fragment, {
19473
19681
  children: props.children
@@ -19475,55 +19683,39 @@ var VoidProvider = function VoidProvider(props) {
19475
19683
  };
19476
19684
 
19477
19685
  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];
19686
+ var _ref = typeof props.options[1] === 'function' ? props.options : useState(props.options),
19687
+ options = _ref[0],
19688
+ setOptions = _ref[1];
19481
19689
 
19482
- var _ref2 = typeof props.options[1] === 'function' ? props.options : useState(props.options),
19483
- options = _ref2[0],
19484
- setOptions = _ref2[1];
19690
+ var _ref2 = Array.isArray(props.active) ? props.active : useState(props.active),
19691
+ active = _ref2[0],
19692
+ setActive = _ref2[1];
19485
19693
 
19694
+ var sortedTabs = sortTabs(options.map(function (tab, index) {
19695
+ return _extends({}, tab, {
19696
+ index: index
19697
+ });
19698
+ }));
19699
+ var activeTabIndex = sortedTabs.findIndex(function (tab) {
19700
+ return tab.index === active;
19701
+ });
19486
19702
  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, {
19703
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Tabs, {
19489
19704
  "$internal": props.internal,
19490
19705
  "$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) {
19706
+ "$spacing": props.spacing
19707
+ }, React__default.createElement(ScrollButtons, Object.assign({}, {
19708
+ activeTabIndex: activeTabIndex,
19709
+ divProps: divProps,
19710
+ tabsLength: options.length,
19711
+ internal: props.internal
19712
+ }), React__default.createElement(TabItem, {
19713
+ active: [active, setActive],
19714
+ tabs: [sortedTabs, setOptions],
19715
+ onClose: props.onClose,
19716
+ alwaysOpen: props.alwaysOpen,
19717
+ internal: props.internal
19718
+ }))), options.map(function (tab, index) {
19527
19719
  if (!('component' in tab)) return React__default.createElement(React__default.Fragment, {
19528
19720
  key: index
19529
19721
  });
@@ -19557,7 +19749,7 @@ var Tabs$1 = function Tabs$1(props) {
19557
19749
  data: tab.data,
19558
19750
  setTab: setTab,
19559
19751
  setLabel: setLabel
19560
- }, index === active ? {
19752
+ }, index === activeTabIndex ? {
19561
19753
  active: true,
19562
19754
  children: React__default.createElement("div", null, React__default.createElement(Component, {
19563
19755
  data: tab.data,
@@ -19569,32 +19761,32 @@ var Tabs$1 = function Tabs$1(props) {
19569
19761
  }));
19570
19762
  };
19571
19763
 
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) {
19764
+ var _templateObject$1d;
19765
+ 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
19766
  return "" + props.width;
19575
19767
  }, function (props) {
19576
19768
  return "" + props.height;
19577
19769
  });
19578
19770
 
19579
19771
  var TextArea = function TextArea(props) {
19580
- return React__default.createElement(Container$o, Object.assign({}, props));
19772
+ return React__default.createElement(Container$q, Object.assign({}, props));
19581
19773
  };
19582
19774
 
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) {
19775
+ var _templateObject$1e, _templateObject2$T, _templateObject3$K, _templateObject4$x, _templateObject5$t, _templateObject6$q;
19776
+ 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
19777
  return props.size === 'large' ? '837px' : '460px';
19586
19778
  }, 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 "])));
19779
+ 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
19780
  }, function (props) {
19589
19781
  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
19782
  }, 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 "])));
19783
+ 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
19784
  });
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"])));
19785
+ 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"])));
19786
+ 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
19787
 
19596
19788
  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, {
19789
+ return React__default.createElement(Container$r, Object.assign({}, props), React__default.createElement(IconContainer$2, null, React__default.createElement(Icon, {
19598
19790
  type: 'feather',
19599
19791
  icon: 'x',
19600
19792
  onClick: function onClick() {
@@ -19603,9 +19795,9 @@ var Toast = function Toast(props) {
19603
19795
  })), React__default.createElement(IconContent, null, React__default.createElement("h4", null, props.title), React__default.createElement("p", null, " ", props.description)));
19604
19796
  };
19605
19797
 
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) {
19798
+ var _templateObject$1f, _templateObject2$U, _templateObject3$L, _templateObject4$y, _templateObject5$u;
19799
+ var Image = styled.img(_templateObject$1f || (_templateObject$1f = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n max-height: 100%;\n"])));
19800
+ 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
19801
  var width = _ref.width;
19610
19802
 
19611
19803
  switch (typeof width) {
@@ -19636,23 +19828,23 @@ var Dimmer = styled.div(_templateObject3$L || (_templateObject3$L = _taggedTempl
19636
19828
  var theme = _ref3.theme;
19637
19829
  return theme.getColor('greyishBlue', 50);
19638
19830
  });
19639
- var Button$6 = styled(Button$1)(_templateObject4$z || (_templateObject4$z = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n"])), function (_ref4) {
19831
+ var Button$6 = styled(Button$1)(_templateObject4$y || (_templateObject4$y = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n"])), function (_ref4) {
19640
19832
  var theme = _ref4.theme;
19641
19833
  return theme.getColor('white', 50);
19642
19834
  });
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"])));
19835
+ 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
19836
 
19645
- var _excluded$3 = ["src", "defaultClickOptions"];
19837
+ var _excluded$4 = ["src", "defaultClickOptions"];
19646
19838
 
19647
19839
  var Zoom = function Zoom(props) {
19648
19840
  var src = props.src,
19649
- imgProps = _objectWithoutPropertiesLoose(props, _excluded$3);
19841
+ imgProps = _objectWithoutPropertiesLoose(props, _excluded$4);
19650
19842
 
19651
19843
  var _useState = useState(false),
19652
19844
  modalOpened = _useState[0],
19653
19845
  setModalOpened = _useState[1];
19654
19846
 
19655
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$q, Object.assign({}, imgProps, {
19847
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$s, Object.assign({}, imgProps, {
19656
19848
  onClick: function onClick() {
19657
19849
  return setModalOpened(true);
19658
19850
  }