@mw-kit/mw-ui 1.7.46 → 1.7.48

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.
@@ -1,11 +1,14 @@
1
1
  /// <reference types="react" />
2
+ import { ColorOptions } from '../../../../../../theme/interfaces';
3
+ import { DayAppearance } from '../../interfaces';
2
4
  export * from '../../styles';
3
5
  export declare const Footer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
6
  export declare const WeekContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
7
  export declare const Header: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
8
  interface DayContainerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
7
9
  today: 1 | 0;
8
- appearance?: 'active' | 'highlight' | 'disabled';
10
+ appearance?: DayAppearance;
11
+ activeColor: ColorOptions;
9
12
  }
10
13
  export declare const DayContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, DayContainerProps, never>;
11
14
  export declare const DayIndicator: import("styled-components").StyledComponent<(props: Partial<import("../../../../../Indicator/interfaces").IndicatorProps>) => JSX.Element, import("styled-components").DefaultTheme, {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ReactNode } from '../../../../interfaces';
3
+ import { ColorOptions } from '../../../../theme/interfaces';
3
4
  import { AbsoluteContainerProps } from '../../../AbsoluteContainer/interfaces';
4
5
  import { IndicatorProps } from '../../../Indicator/interfaces';
5
6
  export interface CalendarInterface {
@@ -7,13 +8,15 @@ export interface CalendarInterface {
7
8
  year: number;
8
9
  weeks: Date[][];
9
10
  }
11
+ export declare type DayAppearance = 'active' | 'highlight' | 'disabled';
10
12
  export interface Common extends React.HTMLAttributes<HTMLDivElement> {
11
13
  label?: ReactNode;
12
14
  initialMonth?: Date;
13
15
  max?: Date;
14
16
  min?: Date;
15
17
  getDay: (date: Date) => {
16
- appearance?: 'active' | 'highlight' | 'disabled';
18
+ appearance?: DayAppearance;
19
+ activeColor?: ColorOptions;
17
20
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
18
21
  onMouseOver?: React.MouseEventHandler<HTMLButtonElement>;
19
22
  onMouseOut?: React.MouseEventHandler<HTMLButtonElement>;
package/dist/index.js CHANGED
@@ -12585,7 +12585,15 @@ var Checkbox = React__default.forwardRef(function (props, ref) {
12585
12585
  bordered = props.bordered;
12586
12586
  var htmlProps = filterObject(props, ['label', 'invalid', 'required', 'padding', 'bordered']);
12587
12587
 
12588
- var _ref = typeof props.label === 'function' ? [props.label] : [LabelContent, props.label],
12588
+ var _ref = function () {
12589
+ if (!props.label) {
12590
+ return [function () {
12591
+ return null;
12592
+ }];
12593
+ }
12594
+
12595
+ return typeof props.label === 'function' ? [props.label] : [LabelContent, props.label];
12596
+ }(),
12589
12597
  LabelComponent = _ref[0],
12590
12598
  children = _ref[1];
12591
12599
 
@@ -12858,9 +12866,14 @@ var MenuComponent = function MenuComponent(props, ref) {
12858
12866
  var children = _ref2.children;
12859
12867
  return React__default.createElement(semanticUiReact.Popup, Object.assign({
12860
12868
  on: 'click',
12861
- position: 'top left',
12869
+ position: 'left center',
12862
12870
  inverted: true,
12863
- wide: true
12871
+ wide: true,
12872
+ popperModifiers: {
12873
+ preventOverflow: {
12874
+ boundariesElement: 'window'
12875
+ }
12876
+ }
12864
12877
  }, rule, {
12865
12878
  trigger: React__default.createElement("div", null, children)
12866
12879
  }));
@@ -13053,7 +13066,7 @@ var Indicator = function Indicator(props) {
13053
13066
  }, props)));
13054
13067
  };
13055
13068
 
13056
- var _templateObject$b, _templateObject2$b, _templateObject3$a, _templateObject4$8, _templateObject5$7, _templateObject6$6, _templateObject7$6, _templateObject8$5, _templateObject9$5, _templateObject10$5, _templateObject11$2, _templateObject12$2, _templateObject13$2;
13069
+ var _templateObject$b, _templateObject2$b, _templateObject3$a, _templateObject4$8, _templateObject5$7, _templateObject6$6, _templateObject7$6, _templateObject8$5, _templateObject9$5, _templateObject10$5, _templateObject11$2;
13057
13070
  var Footer = styled__default.div(_templateObject$b || (_templateObject$b = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n > button:last-child {\n margin-left: auto;\n }\n"])));
13058
13071
  var WeekContainer = styled__default.div(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n\n :not(:first-child) {\n border-top: 1px solid ", ";\n }\n\n > * {\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n width: 32px;\n height: 32px;\n\n color: ", ";\n box-shadow: none;\n\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n border: 1px solid transparent;\n :not(:last-child) {\n border-right-color: ", ";\n }\n }\n"])), function (_ref) {
13059
13072
  var theme = _ref.theme;
@@ -13078,52 +13091,46 @@ var Header = styled__default.div(_templateObject3$a || (_templateObject3$a = _ta
13078
13091
  var theme = _ref7.theme;
13079
13092
  return theme.getColor('lightestGrey', 40);
13080
13093
  }, WeekContainer);
13081
- var DayContainer = styled__default.button(_templateObject4$8 || (_templateObject4$8 = _taggedTemplateLiteralLoose(["\n position: relative;\n overflow: hidden;\n\n ", ";\n\n ", "\n\n :disabled {\n color: ", ";\n }\n\n &,\n :after {\n transition-property: background-color, color, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.25s;\n }\n\n ", "\n"])), function (_ref8) {
13094
+ var DayContainer = styled__default.button(_templateObject4$8 || (_templateObject4$8 = _taggedTemplateLiteralLoose(["\n position: relative;\n overflow: hidden;\n\n ", ";\n\n :disabled {\n color: ", ";\n }\n\n &,\n :after {\n transition-property: background-color, color, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.25s;\n }\n\n ", "\n"])), function (_ref8) {
13082
13095
  var theme = _ref8.theme,
13083
13096
  appearance = _ref8.appearance,
13097
+ activeColor = _ref8.activeColor,
13084
13098
  onClick = _ref8.onClick;
13085
-
13086
- if (!onClick) {
13087
- return styled.css(_templateObject5$7 || (_templateObject5$7 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), theme.colors.white);
13088
- }
13089
-
13090
- var hover = function hover(color) {
13091
- return styled.css(_templateObject6$6 || (_templateObject6$6 = _taggedTemplateLiteralLoose(["\n :not(:disabled):hover {\n border-color: ", ";\n color: ", ";\n }\n "])), theme.colors[color], theme.colors[color]);
13099
+ var hover = onClick ? function (color) {
13100
+ return styled.css(_templateObject5$7 || (_templateObject5$7 = _taggedTemplateLiteralLoose(["\n :not(:disabled):hover {\n border-color: ", ";\n color: ", ";\n cursor: pointer;\n }\n "])), theme.colors[color], theme.colors[color]);
13101
+ } : function () {
13102
+ return null;
13092
13103
  };
13093
13104
 
13094
13105
  if (appearance === 'disabled') {
13095
- return styled.css(_templateObject7$6 || (_templateObject7$6 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), theme.getColor('greyishBlue', 10));
13106
+ return styled.css(_templateObject6$6 || (_templateObject6$6 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), theme.getColor('greyishBlue', 10));
13096
13107
  } else if (appearance === 'highlight') {
13097
- return styled.css(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n ", "\n "])), theme.getColor('blue', 30), hover('blue'));
13108
+ return styled.css(_templateObject7$6 || (_templateObject7$6 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n ", "\n "])), theme.getColor('blue', 30), hover('blue'));
13098
13109
  } else if (appearance === 'active') {
13099
- return styled.css(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n color: ", ";\n :not(:last-child) {\n border-right-color: ", ";\n }\n ", "\n "])), theme.colors.blue, theme.colors.white, function (_ref9) {
13110
+ return styled.css(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n color: ", ";\n :not(:last-child) {\n border-right-color: ", ";\n }\n ", "\n "])), theme.colors[activeColor], theme.colors.white, function (_ref9) {
13100
13111
  var theme = _ref9.theme;
13101
- return theme.colors.blue;
13112
+ return theme.colors[activeColor];
13102
13113
  }, hover('white'));
13103
13114
  }
13104
13115
 
13105
- return styled.css(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n ", "\n "])), theme.colors.white, hover('blue'));
13116
+ return styled.css(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n ", "\n "])), theme.colors.white, hover('blue'));
13106
13117
  }, function (_ref10) {
13107
- var onClick = _ref10.onClick;
13108
- if (!onClick) return;
13109
- return styled.css(_templateObject11$2 || (_templateObject11$2 = _taggedTemplateLiteralLoose(["\n :not(:disabled) {\n cursor: pointer;\n }\n "])));
13110
- }, function (_ref11) {
13111
- var theme = _ref11.theme;
13118
+ var theme = _ref10.theme;
13112
13119
  return theme.colors.silver;
13113
- }, function (_ref12) {
13114
- var appearance = _ref12.appearance,
13115
- today = _ref12.today,
13116
- theme = _ref12.theme;
13120
+ }, function (_ref11) {
13121
+ var appearance = _ref11.appearance,
13122
+ today = _ref11.today,
13123
+ theme = _ref11.theme;
13117
13124
 
13118
13125
  if (today !== 1) {
13119
13126
  return;
13120
13127
  }
13121
13128
 
13122
- return styled.css(_templateObject12$2 || (_templateObject12$2 = _taggedTemplateLiteralLoose(["\n :after {\n content: '';\n position: absolute;\n top: -60%;\n right: -60%;\n width: 100%;\n height: 100%;\n background-color: ", ";\n transform: rotate(45deg);\n }\n "])), theme.colors[appearance === 'active' ? 'white' : 'blue']);
13129
+ return styled.css(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n :after {\n content: '';\n position: absolute;\n top: -60%;\n right: -60%;\n width: 100%;\n height: 100%;\n background-color: ", ";\n transform: rotate(45deg);\n }\n "])), theme.colors[appearance === 'active' ? 'white' : 'blue']);
13123
13130
  });
13124
13131
  var DayIndicator = styled__default(Indicator).attrs({
13125
13132
  size: 'mini'
13126
- })(_templateObject13$2 || (_templateObject13$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: calc(", " - 1px);\n left: calc(50% - (", " / 2) + 1px);\n"])), sizes.mini, sizes.mini);
13133
+ })(_templateObject11$2 || (_templateObject11$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: calc(", " - 1px);\n left: calc(50% - (", " / 2) + 1px);\n"])), sizes.mini, sizes.mini);
13127
13134
 
13128
13135
  var getCalendar = function getCalendar(d) {
13129
13136
  var date = new Date(d.getTime());
@@ -13542,6 +13549,7 @@ var Main = React__default.forwardRef(function (props, ref) {
13542
13549
  onMouseOut: onMouseOut,
13543
13550
  disabled: disabled,
13544
13551
  appearance: appearance,
13552
+ activeColor: details.activeColor || 'blue',
13545
13553
  today: dateCompare(new Date(), date, 'eq', false) ? 1 : 0
13546
13554
  }, day, details.indicator && React__default.createElement(DayIndicator, {
13547
13555
  type: details.indicator
@@ -13704,7 +13712,7 @@ var getTimeProps = function getTimeProps(time, value) {
13704
13712
  });
13705
13713
  };
13706
13714
 
13707
- var _templateObject$e, _templateObject2$c, _templateObject3$b, _templateObject4$9, _templateObject5$8, _templateObject6$7, _templateObject7$7, _templateObject8$6, _templateObject9$6, _templateObject10$6, _templateObject11$3, _templateObject12$3;
13715
+ var _templateObject$e, _templateObject2$c, _templateObject3$b, _templateObject4$9, _templateObject5$8, _templateObject6$7, _templateObject7$7, _templateObject8$6, _templateObject9$6, _templateObject10$6, _templateObject11$3, _templateObject12$2;
13708
13716
  var Button = styled__default.button(_templateObject$e || (_templateObject$e = _taggedTemplateLiteralLoose(["\n padding: 0\n ", ";\n font-family: 'Lato', sans-serif;\n font-weight: ", ";\n border-radius: 4px;\n position: relative;\n user-select: none;\n\n ", ";\n\n ", ";\n\n color: ", ";\n\n :disabled {\n ", "\n }\n\n :hover {\n cursor: ", ";\n\n ", "\n }\n\n :active {\n ", ";\n }\n\n ", "\n"])), function (_ref) {
13709
13717
  var theme = _ref.theme,
13710
13718
  appearance = _ref.appearance;
@@ -13783,7 +13791,7 @@ var Button = styled__default.button(_templateObject$e || (_templateObject$e = _t
13783
13791
  }, function (_ref10) {
13784
13792
  var loading = _ref10.loading;
13785
13793
  if (!loading) return;
13786
- return styled.css(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n pointer-events: none;\n "])));
13794
+ return styled.css(_templateObject12$2 || (_templateObject12$2 = _taggedTemplateLiteralLoose(["\n pointer-events: none;\n "])));
13787
13795
  });
13788
13796
 
13789
13797
  var _excluded = ["children", "content"];
@@ -15572,7 +15580,7 @@ var Switch = function Switch(props) {
15572
15580
  })), React__default.createElement("span", null), label.after && React__default.createElement(LabelContainer$3, null, label.after));
15573
15581
  };
15574
15582
 
15575
- var _templateObject$q, _templateObject2$m, _templateObject3$i, _templateObject4$d, _templateObject5$b, _templateObject6$a, _templateObject7$a, _templateObject8$8, _templateObject9$8, _templateObject10$7, _templateObject11$4, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$1, _templateObject20$1;
15583
+ var _templateObject$q, _templateObject2$m, _templateObject3$i, _templateObject4$d, _templateObject5$b, _templateObject6$a, _templateObject7$a, _templateObject8$8, _templateObject9$8, _templateObject10$7, _templateObject11$4, _templateObject12$3, _templateObject13$2, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$1, _templateObject20$1;
15576
15584
  var bullet = styled.css(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n appearance: none;\n width: ", ";\n height: ", ";\n border-radius: 100%;\n border-width: 1px;\n border-style: solid;\n background-color: ", ";\n box-shadow: 0px 1px 3px ", ";\n"])), function (_ref) {
15577
15585
  var theme = _ref.theme;
15578
15586
  return theme.spacings.s4;
@@ -15640,9 +15648,9 @@ var InputContainer$1 = styled__default.div(_templateObject10$7 || (_templateObje
15640
15648
  return styled.css(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n ", " > span {\n background-color: ", ";\n }\n\n ", " {\n /** firefox */\n ::-moz-range-thumb {\n border-color: ", ";\n }\n /** ie */\n ::-ms-thumb {\n border-color: ", ";\n }\n /** chrome */\n ::-webkit-slider-thumb {\n border-color: ", ";\n }\n }\n "])), SelectedArea, theme.colors.blue, Input$2, theme.colors.lightestGrey, theme.colors.lightestGrey, theme.colors.lightestGrey);
15641
15649
  }
15642
15650
 
15643
- return styled.css(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n ", " > span {\n background-color: ", ";\n }\n\n ", " {\n /** firefox */\n ::-moz-range-thumb {\n border-color: ", ";\n }\n /** ie */\n ::-ms-thumb {\n border-color: ", ";\n }\n /** chrome */\n ::-webkit-slider-thumb {\n border-color: ", ";\n }\n }\n "])), SelectedArea, theme.colors.warningRed, Input$2, theme.colors.warningRed, theme.colors.warningRed, theme.colors.warningRed);
15651
+ return styled.css(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n ", " > span {\n background-color: ", ";\n }\n\n ", " {\n /** firefox */\n ::-moz-range-thumb {\n border-color: ", ";\n }\n /** ie */\n ::-ms-thumb {\n border-color: ", ";\n }\n /** chrome */\n ::-webkit-slider-thumb {\n border-color: ", ";\n }\n }\n "])), SelectedArea, theme.colors.warningRed, Input$2, theme.colors.warningRed, theme.colors.warningRed, theme.colors.warningRed);
15644
15652
  });
15645
- var MinMaxLabelContainer = styled__default.div(_templateObject13$3 || (_templateObject13$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n padding-bottom: 2px;\n"])));
15653
+ var MinMaxLabelContainer = styled__default.div(_templateObject13$2 || (_templateObject13$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n padding-bottom: 2px;\n"])));
15646
15654
  var LabelsContainer = styled__default.div(_templateObject14$2 || (_templateObject14$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n gap: 7px;\n\n ", "\n"])), function (_ref19) {
15647
15655
  var position = _ref19.position;
15648
15656
 
@@ -15895,7 +15903,7 @@ var LabelContainer$5 = styled__default.div(_templateObject$r || (_templateObject
15895
15903
  var theme = _ref.theme;
15896
15904
  return theme.useTypography('p');
15897
15905
  });
15898
- var Label$6 = styled__default.label(_templateObject2$n || (_templateObject2$n = _taggedTemplateLiteralLoose(["\n display: flex;\n gap: ", ";\n\n ", "\n\n ", "\n\n", "\n\n > input {\n height: 0;\n width: 0;\n /* Chrome, Safari, Edge, Opera */\n :-webkit-outer-spin-button,\n :-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n -moz-appearance: none;\n }\n\n > span {\n height: 17px;\n width: 17px;\n border-radius: 100%;\n border-width: 1px;\n border-style: solid;\n background-color: ", ";\n position: relative;\n transition-property: border-color;\n transition-duration: 0.5s;\n transition-timing-function: ease-in-out;\n :before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n height: 0;\n width: 0;\n border-radius: 100%;\n transition-property: top, left, width, height, background-color;\n transition-duration: 0.5s;\n transition-timing-function: cubic-bezier(0.68, -0.55, 0.27, 1.55);\n }\n }\n > input:checked + span {\n :before {\n top: calc(50% - 4.5px);\n left: calc(50% - 4.5px);\n height: 9px;\n width: 9px;\n }\n }\n"])), function (_ref2) {
15906
+ var Label$6 = styled__default.label(_templateObject2$n || (_templateObject2$n = _taggedTemplateLiteralLoose(["\n display: flex;\n gap: ", ";\n\n ", "\n\n ", "\n\n", "\n\n > input {\n position: absolute;\n top: 0;\n left: 0;\n height: 0;\n width: 0;\n /* Chrome, Safari, Edge, Opera */\n :-webkit-outer-spin-button,\n :-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n -moz-appearance: none;\n }\n\n > span {\n height: 17px;\n width: 17px;\n min-height: 17px;\n min-width: 17px;\n max-height: 17px;\n max-width: 17px;\n border-radius: 100%;\n border-width: 1px;\n border-style: solid;\n background-color: ", ";\n position: relative;\n transition-property: border-color;\n transition-duration: 0.5s;\n transition-timing-function: ease-in-out;\n :before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n height: 0;\n width: 0;\n border-radius: 100%;\n transition-property: top, left, width, height, background-color;\n transition-duration: 0.5s;\n transition-timing-function: cubic-bezier(0.68, -0.55, 0.27, 1.55);\n }\n }\n > input:checked + span {\n :before {\n top: calc(50% - 4.5px);\n left: calc(50% - 4.5px);\n height: 9px;\n width: 9px;\n }\n }\n"])), function (_ref2) {
15899
15907
  var theme = _ref2.theme;
15900
15908
  return theme.spacings.s1;
15901
15909
  }, function (_ref3) {
@@ -16133,7 +16141,7 @@ var parse = function parse(value) {
16133
16141
  });
16134
16142
  };
16135
16143
 
16136
- var _templateObject$s, _templateObject2$o, _templateObject3$k, _templateObject4$f, _templateObject5$d, _templateObject6$c, _templateObject7$c, _templateObject8$9, _templateObject9$9, _templateObject10$8, _templateObject11$5, _templateObject12$5;
16144
+ var _templateObject$s, _templateObject2$o, _templateObject3$k, _templateObject4$f, _templateObject5$d, _templateObject6$c, _templateObject7$c, _templateObject8$9, _templateObject9$9, _templateObject10$8, _templateObject11$5, _templateObject12$4;
16137
16145
  var RelativeContainer$5 = styled__default.div(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n position: relative;\n user-select: none;\n min-width: 220px;\n\n > input,\n > label > input {\n color: transparent;\n background-color: transparent;\n width: 1px;\n height: 1px;\n position: absolute;\n left: 0;\n bottom: 0;\n border: 0;\n padding: 0;\n overflow: hidden;\n outline: none;\n box-shadow: none;\n }\n"])));
16138
16146
  var LabelContainer$6 = styled__default.div(_templateObject2$o || (_templateObject2$o = _taggedTemplateLiteralLoose(["\n ", "\n line-height: 17px;\n flex: 1;\n\n :first-child {\n text-align: left;\n }\n :not(:first-child) {\n text-align: center;\n }\n\n ", "\n\n ", ";\n"])), function (_ref) {
16139
16147
  var theme = _ref.theme;
@@ -16189,7 +16197,7 @@ var LabelText$1 = styled__default.label(_templateObject11$5 || (_templateObject1
16189
16197
  }, function (_ref13) {
16190
16198
  var required = _ref13.required;
16191
16199
  if (!required) return;
16192
- return styled.css(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
16200
+ return styled.css(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
16193
16201
  });
16194
16202
 
16195
16203
  var Component$1 = React__default.forwardRef(function (props, ref) {
@@ -17672,7 +17680,7 @@ var useContext$2 = function useContext() {
17672
17680
  return React__default.useContext(Provider$2);
17673
17681
  };
17674
17682
 
17675
- var _templateObject$D, _templateObject2$u, _templateObject3$p, _templateObject4$i, _templateObject5$f, _templateObject6$e, _templateObject7$e, _templateObject8$b, _templateObject9$b, _templateObject10$a, _templateObject11$6, _templateObject12$6, _templateObject13$4, _templateObject14$3, _templateObject15$3;
17683
+ var _templateObject$D, _templateObject2$u, _templateObject3$p, _templateObject4$i, _templateObject5$f, _templateObject6$e, _templateObject7$e, _templateObject8$b, _templateObject9$b, _templateObject10$a, _templateObject11$6, _templateObject12$5, _templateObject13$3, _templateObject14$3, _templateObject15$3;
17676
17684
  var aligns = {
17677
17685
  self: {
17678
17686
  horizontal: {
@@ -17769,13 +17777,13 @@ var Col = styled__default.div(_templateObject$D || (_templateObject$D = _taggedT
17769
17777
  theme = _ref6.theme;
17770
17778
  if (fontColor === undefined) return;
17771
17779
  var c = Array.isArray(fontColor) ? theme.getColor.apply(theme, fontColor) : theme.colors[fontColor];
17772
- return styled.css(_templateObject12$6 || (_templateObject12$6 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), c);
17780
+ return styled.css(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), c);
17773
17781
  }, function (_ref7) {
17774
17782
  var backgroundColor = _ref7.backgroundColor,
17775
17783
  theme = _ref7.theme;
17776
17784
  if (backgroundColor === undefined) return;
17777
17785
  var c = Array.isArray(backgroundColor) ? theme.getColor.apply(theme, backgroundColor) : theme.colors[backgroundColor];
17778
- return styled.css(_templateObject13$4 || (_templateObject13$4 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), c);
17786
+ return styled.css(_templateObject13$3 || (_templateObject13$3 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), c);
17779
17787
  }, function (_ref8) {
17780
17788
  var hover = _ref8.hover,
17781
17789
  theme = _ref8.theme;
@@ -18822,57 +18830,120 @@ var Tab = styled__default.li(_templateObject5$t || (_templateObject5$t = _tagged
18822
18830
  return styled.css(_templateObject6$r || (_templateObject6$r = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n padding: 0 ", ";\n gap: ", ";\n\n span {\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n\n color: ", ";\n }\n\n svg {\n stroke: ", ";\n\n &:hover {\n stroke: ", ";\n }\n }\n "])), theme.colors[active ? 'blue' : 'white'], theme.spacings.s2, theme.spacings.s2, theme.typographies.h2.fontFamily, theme.typographies.h2.fontSize, theme.typographies.h2.fontWeight, theme.colors[active ? 'white' : 'darkBlue'], theme.colors[active ? 'white' : 'darkBlue'], theme.colors.red);
18823
18831
  });
18824
18832
 
18833
+ var initialStatus = function initialStatus(active, length) {
18834
+ var status = Array(length).fill('open');
18835
+ status[active] = 'active';
18836
+ return status;
18837
+ };
18838
+
18825
18839
  var Tabs$1 = function Tabs$1(props) {
18826
18840
  var options = props.options,
18827
18841
  activeState = props.activeState,
18828
18842
  internal = props.internal;
18829
-
18830
- var _useState = React.useState(options),
18831
- tabs = _useState[0],
18832
- setTabs = _useState[1];
18833
-
18834
18843
  var active = activeState[0],
18835
18844
  setActive = activeState[1];
18836
18845
 
18837
- var updateActiveTab = function updateActiveTab(index, event) {
18838
- var element = event.target;
18839
- if (element.tagName === 'svg') return;
18840
- setActive(index);
18841
- };
18846
+ var _useState = React.useState(initialStatus(active, options.length)),
18847
+ status = _useState[0],
18848
+ setStatus = _useState[1];
18842
18849
 
18843
- var removeTab = function removeTab(index) {
18844
- setTabs(function (prevState) {
18845
- var aux = [].concat(prevState);
18850
+ var activate = function activate(active, length) {
18851
+ setStatus(function (prev) {
18852
+ if (length !== undefined && length !== prev.length) {
18853
+ return initialStatus(active, length);
18854
+ }
18855
+
18856
+ var current = prev.findIndex(function (e) {
18857
+ return e === 'active';
18858
+ });
18846
18859
 
18847
- if (index === active) {
18848
- setActive(index > 0 ? index - 1 : 1);
18860
+ if (current !== active && current > -1 && active > -1 && active < prev.length) {
18861
+ var _status = [].concat(prev);
18862
+
18863
+ _status[current] = 'open';
18864
+ _status[active] = 'active';
18865
+ return [].concat(_status);
18849
18866
  }
18850
18867
 
18851
- aux.splice(index, 1);
18852
- return aux;
18868
+ return prev;
18853
18869
  });
18854
18870
  };
18855
18871
 
18856
- var getClose = props.alwaysOpen ? function () {
18857
- return undefined;
18858
- } : function (index) {
18859
- return React__default.createElement(SvgClose, {
18860
- onClick: function onClick() {
18861
- return removeTab(index);
18872
+ React.useEffect(function () {
18873
+ activate(active, options.length);
18874
+ }, [active, options.length]);
18875
+ React.useEffect(function () {
18876
+ var current = status.findIndex(function (e) {
18877
+ return e === 'active';
18878
+ });
18879
+ setActive(current);
18880
+ }, [status]);
18881
+
18882
+ var onClickActivate = function onClickActivate(index, event) {
18883
+ var element = event.target;
18884
+
18885
+ while (element) {
18886
+ if (element.tagName === 'svg') return;
18887
+ element = element.parentElement;
18888
+ }
18889
+
18890
+ activate(index);
18891
+ };
18892
+
18893
+ var onClickClose = function onClickClose(index) {
18894
+ var getActive = function getActive(removed, prev) {
18895
+ for (var i = index - 1; i > -1; i--) {
18896
+ if (removed[i] !== 'closed') {
18897
+ return i;
18898
+ }
18899
+ }
18900
+
18901
+ for (var _i = index + 1; _i < removed.length; _i++) {
18902
+ if (removed[_i] !== 'closed') {
18903
+ return _i;
18904
+ }
18862
18905
  }
18906
+
18907
+ return prev;
18908
+ };
18909
+
18910
+ setStatus(function (prev) {
18911
+ if (prev[index] === 'closed') return prev;
18912
+ var active = prev.findIndex(function (e) {
18913
+ return e === 'active';
18914
+ });
18915
+ var status = [].concat(prev);
18916
+ status[index] = 'closed';
18917
+
18918
+ if (active === index) {
18919
+ var _active = getActive(status, index);
18920
+
18921
+ status[_active] = 'active';
18922
+ }
18923
+
18924
+ return status;
18863
18925
  });
18864
18926
  };
18927
+
18928
+ var Close = props.alwaysOpen ? function () {
18929
+ return null;
18930
+ } : SvgClose;
18865
18931
  return React__default.createElement(Container$n, null, React__default.createElement(Tabs, {
18866
18932
  internal: +(internal || false)
18867
- }, tabs.map(function (tab, index) {
18868
- return React__default.createElement(Tab, {
18933
+ }, options.reduce(function (elements, tab, index) {
18934
+ if (status[index] === 'closed') return elements;
18935
+ return [].concat(elements, [React__default.createElement(Tab, {
18869
18936
  key: index,
18870
- active: +(active === index),
18937
+ active: +(status[index] === 'active'),
18871
18938
  onClick: function onClick(event) {
18872
- return updateActiveTab(index, event);
18939
+ return onClickActivate(index, event);
18873
18940
  }
18874
- }, React__default.createElement("span", null, tab.label), getClose(index));
18875
- })));
18941
+ }, React__default.createElement("span", null, tab.label), React__default.createElement(Close, {
18942
+ onClick: function onClick() {
18943
+ return onClickClose(index);
18944
+ }
18945
+ }))]);
18946
+ }, [])));
18876
18947
  };
18877
18948
 
18878
18949
  var _templateObject$X;