@dspworkplace/ui 1.5.60 → 2.0.1

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.es.js CHANGED
@@ -1,43 +1,45 @@
1
1
  import React, { forwardRef, useState, Fragment, useCallback, useEffect, useRef, Children } from 'react';
2
2
  import styled, { keyframes } from 'styled-components';
3
+ import { supercomplete, useCombobox } from '@szhsin/react-autocomplete';
3
4
 
4
- var defaultRadius = '2px';
5
+ var defaultRadius = '4px';
5
6
  var colors = {
6
- primary: "#F7931E",
7
- secondary: "#0071BC",
8
- action: "#9DDDF4",
7
+ primary: '#F7931E',
8
+ secondary: '#0071BC',
9
+ action: '#9DDDF4',
9
10
  neutrals: {
10
- black: "#000000",
11
- gray: "#333333",
12
- medium: "#707070",
13
- silver: "#CCCCCC",
14
- white: "#FFFFFF"
11
+ black: '#000000',
12
+ gray: '#333333',
13
+ medium: '#707070',
14
+ silver: '#CCCCCC',
15
+ white: '#FFFFFF'
15
16
  },
16
17
  warnings: {
17
- border: "#F5C26B",
18
- text: "#DBAE60",
19
- shadow: "#FAE0B5",
20
- bg: "#FEF8F0"
18
+ border: '#e7a73b',
19
+ text: '#9c6505',
20
+ shadow: '#FAE0B5',
21
+ bg: '#FEF8F0'
21
22
  },
22
23
  success: {
23
- border: "#00BDA5",
24
- text: "#00A38D",
25
- shadow: "#7FDED2",
26
- bg: "#E5F8F6"
24
+ border: '#00BDA5',
25
+ text: '#007d6c',
26
+ shadow: '#7FDED2',
27
+ bg: '#E5F8F6'
27
28
  },
28
29
  error: {
29
- border: "#F2545B",
30
- text: "#D94C53",
31
- shadow: "#F8A9AD",
32
- bg: "#FDEDEE"
30
+ border: '#F2545B',
31
+ text: '#bd4248',
32
+ shadow: '#F8A9AD',
33
+ bg: '#FDEDEE'
33
34
  },
34
35
  info: {
35
- border: "#7C98B6",
36
- text: "#516F90",
37
- shadow: "#CBD6E2",
38
- bg: "#EAF0F6"
36
+ border: '#7C98B6',
37
+ text: '#11598b',
38
+ shadow: '#CBD6E2',
39
+ bg: '#EAF0F6'
39
40
  },
40
41
  extra: {
42
+ blueishWhite: '#fafbfc',
41
43
  whiteSmoke: '#F5F5F5',
42
44
  gray93: '#FAFAFA'
43
45
  }
@@ -48,27 +50,27 @@ var font = {
48
50
  lineHeight: '20px'
49
51
  },
50
52
  medium: {
51
- size: '16px',
53
+ size: '14px',
52
54
  lineHeight: '16px'
53
55
  },
54
56
  small: {
55
- size: '14px',
57
+ size: '12px',
56
58
  lineHeight: '16px'
57
59
  },
58
60
  extraSmall: {
59
- size: '12px',
61
+ size: '10px',
60
62
  lineHeight: '12px'
61
63
  },
62
64
  tiny: {
63
65
  size: '8px',
64
66
  lineHeight: '12px'
65
67
  },
66
- main: 'circe-rounded',
68
+ main: '"Huninn", sans-serif',
67
69
  body: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif"
68
70
  };
69
71
  var form = {
70
72
  input: {
71
- radius: '2px',
73
+ radius: defaultRadius,
72
74
  padding: '12px 8px'
73
75
  },
74
76
  button: {
@@ -318,7 +320,7 @@ function _templateObject9() {
318
320
  }
319
321
 
320
322
  function _templateObject8() {
321
- var data = taggedTemplateLiteral(["\n padding:0;\n margin:4px 0 0 0;\n background:white;\n border:1px solid ", ";\n box-shadow:0 0 6px ", ";\n border-radius:2px;\n list-style:none;\n width:auto;\n display:inline-block;\n position: absolute;\n top: 107%;\n left: -1px;\n z-index:10;\n\n ", "\n\n\n li {\n font-size:", ";\n color:#707070;\n height:32px;\n cursor:pointer;\n padding:0px 4px 0 8px;\n position:relative;\n display:flex;\n justify-content:space-between;\n align-items:center;\n\n >ul {\n display:none;\n }\n\n\n &:hover,\n &.selected {\n background:", ";\n\n >ul {\n display:inline-block;\n }\n }\n\n &.alone {\n border-top:1px solid ", ";\n }\n\n }\n"]);
323
+ var data = taggedTemplateLiteral(["\n padding:0;\n margin:4px 0 0 0;\n background:white;\n border:1px solid ", ";\n box-shadow:0 0 6px ", ";\n border-radius:", ";\n list-style:none;\n width:auto;\n display:inline-block;\n position: absolute;\n top: 107%;\n left: -1px;\n z-index:10;\n\n ", "\n\n\n li {\n font-size:", ";\n color:#707070;\n height:32px;\n cursor:pointer;\n padding:0px 4px 0 8px;\n position:relative;\n display:flex;\n justify-content:space-between;\n align-items:center;\n\n >ul {\n display:none;\n }\n\n\n &:hover,\n &.selected {\n background:", ";\n\n >ul {\n display:inline-block;\n }\n }\n\n &.alone {\n border-top:1px solid ", ";\n }\n\n }\n"]);
322
324
 
323
325
  _templateObject8 = function _templateObject8() {
324
326
  return data;
@@ -338,7 +340,7 @@ function _templateObject7() {
338
340
  }
339
341
 
340
342
  function _templateObject6() {
341
- var data = taggedTemplateLiteral(["\n width:", ";\n height:40px;\n background:white;\n border-radius:2px;\n border:1px solid ", ";\n cursor:pointer;\n position:relative;\n box-sizing:border-box;\n padding:12px 8px;\n display:flex;\n align-items:center;\n justify-content:space-between;\n\n &.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n\n &.error {\n border-color:", ";\n }\n\n &.error.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n\n &.valid {\n border-color:", ";\n }\n\n &.valid.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n"]);
343
+ var data = taggedTemplateLiteral(["\n width:", ";\n height:40px;\n background:white;\n border-radius:", ";\n border:1px solid ", ";\n cursor:pointer;\n position:relative;\n box-sizing:border-box;\n padding:12px 8px;\n display:flex;\n align-items:center;\n justify-content:space-between;\n\n &.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n\n &.error {\n border-color:", ";\n }\n\n &.error.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n\n &.valid {\n border-color:", ";\n }\n\n &.valid.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n"]);
342
344
 
343
345
  _templateObject6 = function _templateObject6() {
344
346
  return data;
@@ -358,7 +360,7 @@ function _templateObject5() {
358
360
  }
359
361
 
360
362
  function _templateObject4() {
361
- var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:Circe-Rounded;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
363
+ var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:\"Huninn\", sans-serif;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
362
364
 
363
365
  _templateObject4 = function _templateObject4() {
364
366
  return data;
@@ -378,7 +380,7 @@ function _templateObject3() {
378
380
  }
379
381
 
380
382
  function _templateObject2() {
381
- var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:Circe-Rounded;\n display:block;\n padding-bottom:2px;\n color:#707070;\n\n >.requiredField {\n color:", ";\n }\n\n"]);
383
+ var data = taggedTemplateLiteral(["\n font-size:", ";\n line-height: ", ";\n font-weight:normal;\n font-family:\"Huninn\", sans-serif;\n display:block;\n padding-bottom:4px;\n color: ", ";\n\n >.requiredField {\n color:", ";\n }\n\n"]);
382
384
 
383
385
  _templateObject2 = function _templateObject2() {
384
386
  return data;
@@ -414,7 +416,7 @@ var handleSize = function handleSize(sizeType) {
414
416
  };
415
417
 
416
418
  var Frag = styled.div(_templateObject$1());
417
- var Label = styled.label(_templateObject2(), theme.font.medium.size, theme.colors.error.text);
419
+ var Label = styled.label(_templateObject2(), theme.font.medium.size, theme.font.medium.lineHeight, theme.colors.neutrals.medium, theme.colors.error.text);
418
420
  var borderDefault = "\n border-width:1px;\n border-style:solid;\n";
419
421
  var InputBase = styled.input(_templateObject3(), theme.colors.neutrals.white, theme.colors.neutrals.silver, theme.form.input.radius, theme.font.small.size, theme.font.small.lineHeight, theme.form.input.padding, theme.colors.neutrals.gray, function (_ref) {
420
422
  var size = _ref.size;
@@ -432,13 +434,13 @@ var RequiredText = function RequiredText() {
432
434
  var SelectUi = styled.div(_templateObject6(), function (_ref2) {
433
435
  var size = _ref2.size;
434
436
  return handleSize(size);
435
- }, theme.colors.neutrals.silver, theme.colors.secondary, theme.colors.action, theme.colors.error.border, theme.colors.error.border, theme.colors.error.shadow, theme.colors.success.border, theme.colors.success.border, theme.colors.success.shadow);
437
+ }, theme.defaultRadius, theme.colors.neutrals.silver, theme.colors.secondary, theme.colors.action, theme.colors.error.border, theme.colors.error.border, theme.colors.error.shadow, theme.colors.success.border, theme.colors.success.border, theme.colors.success.shadow);
436
438
  var Value = styled.span(_templateObject7(), function (props) {
437
439
  return props.option ? '#707070' : theme.colors.neutrals.gray;
438
440
  }, function (props) {
439
441
  return props.option && "\n display:inline-block;\n flex:1;\n ";
440
442
  });
441
- var Options = styled.ul(_templateObject8(), theme.colors.neutrals.silver, theme.colors.neutrals.silver, function (props) {
443
+ var Options = styled.ul(_templateObject8(), theme.colors.neutrals.silver, theme.colors.neutrals.silver, theme.defaultRadius, function (props) {
442
444
  return props.isChild && "\n position:absolute;\n left:100%;\n margin-left:6px;\n top:-4px;\n\n &::before {\n content: \" \";\n height: 100%;\n width: 6px;\n background: transparent;\n display: block;\n position: absolute;\n left: -7px;\n }\n ";
443
445
  }, theme.font.small.size, theme.colors.info.bg, theme.colors.neutrals.silver);
444
446
  var OptionGroup = styled.div(_templateObject9());
@@ -458,7 +460,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
458
460
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
459
461
 
460
462
  function _templateObject4$1() {
461
- var data = taggedTemplateLiteral(["\n width:", "\n display:inline-block;\n vertical-align:top;\n"]);
463
+ var data = taggedTemplateLiteral(["\n width:", "\n display:inline-block;\n vertical-align:top;\n\n svg path {\n fill: ", ";\n }\n"]);
462
464
 
463
465
  _templateObject4$1 = function _templateObject4() {
464
466
  return data;
@@ -478,7 +480,7 @@ function _templateObject3$1() {
478
480
  }
479
481
 
480
482
  function _templateObject2$1() {
481
- var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:Circe-Rounded;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
483
+ var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:\"Huninn\", sans-serif;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
482
484
 
483
485
  _templateObject2$1 = function _templateObject2() {
484
486
  return data;
@@ -488,7 +490,7 @@ function _templateObject2$1() {
488
490
  }
489
491
 
490
492
  function _templateObject$2() {
491
- var data = taggedTemplateLiteral(["\n background:", ";\n border-color:", ";\n border-width:1px;\n border-style:solid;\n border-radius:", ";\n font-size:", ";\n line-height:", ";\n height:40px;\n padding:", ";\n color:", ";\n width:", ";\n\n &.hasChildren {\n padding-right:40px;\n }\n\n &.hasChildren.childrenLeft {\n padding-right:", ";\n padding-left:40px;\n }\n\n &:disabled {\n background: ", ";\n ", ";\n border-color: ", ";\n color: ", ";\n }\n\n &:disabled::placeholder {\n color:#eee;\n }\n\n &:hover {\n ", " ;\n border-color:", ";\n }\n\n &:active {\n ", ";\n border-color:", ";\n }\n\n &:focus {\n ", ";\n box-shadow:0px 0px 6px ", ";\n border-color:", ";\n }\n\n &::placeholder {\n color:", ";\n font-size:", ";\n }\n\n &:read-only {\n background:", ";\n border-color:", ";\n color:#707070;\n }\n"]);
493
+ var data = taggedTemplateLiteral(["\n background: ", ";\n border-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-radius: ", ";\n font-size: ", ";\n line-height: ", ";\n height: 40px;\n padding: ", ";\n color: ", ";\n width: ", ";\n\n &.hasChildren {\n padding-right: 40px;\n }\n\n &.hasChildren.childrenLeft {\n padding-right: ", ";\n padding-left: 40px;\n }\n\n &:disabled {\n background: ", ";\n ", ";\n border-color: ", ";\n color: ", ";\n }\n\n &:disabled::placeholder {\n color: #eee;\n }\n\n &:hover {\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n ", ";\n border-color: ", ";\n }\n\n &:focus {\n ", ";\n box-shadow: 0px 0px 6px ", ";\n border-color: ", ";\n }\n\n &::placeholder {\n color: ", ";\n font-size: ", ";\n }\n\n &:read-only {\n background: ", ";\n border-color: ", ";\n color: #707070;\n }\n"]);
492
494
 
493
495
  _templateObject$2 = function _templateObject() {
494
496
  return data;
@@ -510,7 +512,7 @@ var handleSize$1 = function handleSize(sizeType) {
510
512
  return '460px';
511
513
 
512
514
  default:
513
- return '300px';
515
+ return '100%';
514
516
  }
515
517
  };
516
518
 
@@ -523,7 +525,7 @@ var handlerColor = function handlerColor(typeColor) {
523
525
  return theme.colors.success.text;
524
526
 
525
527
  default:
526
- return theme.colors.neutrals.silver;
528
+ return null;
527
529
  }
528
530
  };
529
531
 
@@ -540,12 +542,10 @@ var handleMask = function handleMask(type) {
540
542
  }
541
543
  };
542
544
 
543
- var InputBase$1 = styled.input(_templateObject$2(), theme.colors.neutrals.white, function (props) {
544
- return handlerColor(props.validation);
545
- }, theme.form.input.radius, theme.font.small.size, theme.font.small.lineHeight, theme.form.input.padding, theme.colors.neutrals.gray, function (_ref) {
545
+ var InputBase$1 = styled.input(_templateObject$2(), theme.colors.neutrals.white, theme.colors.neutrals.silver, theme.form.input.radius, theme.font.medium.size, theme.font.medium.lineHeight, theme.form.input.padding, theme.colors.neutrals.gray, function (_ref) {
546
546
  var size = _ref.size;
547
547
  return handleSize$1(size);
548
- }, theme.form.input.padding, theme.colors.extra.whiteSmoke, borderDefault$1, theme.colors.neutrals.silver, theme.colors.neutrals.medium, borderDefault$1, function (props) {
548
+ }, theme.form.input.padding, theme.colors.extra.whiteSmoke, borderDefault$1, theme.colors.neutrals.silver, theme.colors.neutrals.medium, theme.colors.secondary, function (props) {
549
549
  return handlerColor(props.validation);
550
550
  }, borderDefault$1, function (props) {
551
551
  return handlerColor(props.validation);
@@ -555,7 +555,7 @@ var SpanError$1 = styled(Span)(_templateObject3$1(), theme.colors.error.text);
555
555
  var Frag$1 = styled.div(_templateObject4$1(), function (_ref2) {
556
556
  var size = _ref2.size;
557
557
  return handleSize$1(size);
558
- });
558
+ }, theme.colors.secondary);
559
559
  var Input = /*#__PURE__*/forwardRef(function (_ref3, ref) {
560
560
  var name = _ref3.name,
561
561
  label = _ref3.label,
@@ -598,14 +598,19 @@ var Input = /*#__PURE__*/forwardRef(function (_ref3, ref) {
598
598
  }
599
599
 
600
600
  var maskFunction = null;
601
- if (mask) maskFunction = handleMask(mask);
601
+
602
+ if (mask) {
603
+ maskFunction = handleMask(mask);
604
+ }
602
605
 
603
606
  var handleChange = function handleChange(e) {
604
607
  if (onChange) {
605
608
  onChange(e);
606
609
  }
607
610
 
608
- if (maskFunction) e.target.value = maskFunction(e.target.value);
611
+ if (maskFunction) {
612
+ e.target.value = maskFunction(e.target.value);
613
+ }
609
614
  };
610
615
 
611
616
  return /*#__PURE__*/React.createElement(Frag$1, {
@@ -3950,7 +3955,7 @@ var Wrapper = function Wrapper(Element) {
3950
3955
  }, function (props) {
3951
3956
  return props.onClick && "\n cursor: pointer;\n ";
3952
3957
  }, function (props) {
3953
- return props.color ? props.color + ' !important' : theme.colors.secondary;
3958
+ return props.color ? props.color + ' !important' : 'currentColor';
3954
3959
  }, function (props) {
3955
3960
  return props.strokeColor && "stroke: ".concat(props.strokeColor, " !important;");
3956
3961
  }, function (props) {
@@ -4143,7 +4148,7 @@ Items.forEach(function (key) {
4143
4148
  });
4144
4149
 
4145
4150
  function _templateObject$4() {
4146
- var data = taggedTemplateLiteral(["\n height:14px;\n width:14px;\n border-radius: 100%;\n background: ", "; \n border: 1px solid ", ";\n color:", ";\n font-family:Circe-Rounded;\n display: inline-block;\n font-size: 10px;\n text-align:center;\n font-weight:bold;\n position:relative;\n top:-2px;\n left:5px;\n \n >div {\n display:none;\n background:white;\n padding:7px;\n position:absolute;\n top:-40px;\n left:-4px;\n white-space: nowrap;\n font-weight:300;\n color:#707070; \n box-shadow:0 0 6px #ccc;\n \n &::before {\n content: \" \";\n width: 0;\n height: 0;\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n border-top: 5px solid white;\n position: absolute;\n bottom: -5px;\n }\n }\n \n &:hover {\n div {\n display:inline-block;\n } \n }\n"]);
4151
+ var data = taggedTemplateLiteral(["\n height:14px;\n width:14px;\n border-radius: 100%;\n background: ", "; \n border: 1px solid ", ";\n color:", ";\n font-family:\"Huninn\", sans-serif;\n display: inline-block;\n font-size: 10px;\n text-align:center;\n font-weight:bold;\n position:relative;\n top:-2px;\n left:5px;\n \n >div {\n display:none;\n background:white;\n padding:7px;\n position:absolute;\n top:-40px;\n left:-4px;\n white-space: nowrap;\n font-weight:300;\n color:#707070; \n box-shadow:0 0 6px #ccc;\n \n &::before {\n content: \" \";\n width: 0;\n height: 0;\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n border-top: 5px solid white;\n position: absolute;\n bottom: -5px;\n }\n }\n \n &:hover {\n div {\n display:inline-block;\n } \n }\n"]);
4147
4152
 
4148
4153
  _templateObject$4 = function _templateObject() {
4149
4154
  return data;
@@ -4171,7 +4176,7 @@ var mergeRefs = function mergeRefs(refs) {
4171
4176
  };
4172
4177
 
4173
4178
  function _templateObject4$2() {
4174
- var data = taggedTemplateLiteral(["\n font-size:14px;\n line-height:16px;\n color:", ";\n"]);
4179
+ var data = taggedTemplateLiteral(["\n font-size: 14px;\n line-height: 16px;\n color: ", ";\n\n ", "\n}\n"]);
4175
4180
 
4176
4181
  _templateObject4$2 = function _templateObject4() {
4177
4182
  return data;
@@ -4181,7 +4186,7 @@ function _templateObject4$2() {
4181
4186
  }
4182
4187
 
4183
4188
  function _templateObject3$2() {
4184
- var data = taggedTemplateLiteral(["\n font-size:16px;\n line-height:20px;\n"]);
4189
+ var data = taggedTemplateLiteral(["\n font-size: 16px;\n line-height: 20px;\n"]);
4185
4190
 
4186
4191
  _templateObject3$2 = function _templateObject3() {
4187
4192
  return data;
@@ -4191,7 +4196,7 @@ function _templateObject3$2() {
4191
4196
  }
4192
4197
 
4193
4198
  function _templateObject2$2() {
4194
- var data = taggedTemplateLiteral(["\n font-family:circe-rounded;\n font-weight:bold;\n font-size:22px;\n line-height:28px;\n color: ", ";\n"]);
4199
+ var data = taggedTemplateLiteral(["\n font-family: \"Huninn\", sans-serif;\n font-weight: bold;\n font-size: 24px;\n line-height: 28px;\n color: ", ";\n"]);
4195
4200
 
4196
4201
  _templateObject2$2 = function _templateObject2() {
4197
4202
  return data;
@@ -4201,7 +4206,7 @@ function _templateObject2$2() {
4201
4206
  }
4202
4207
 
4203
4208
  function _templateObject$5() {
4204
- var data = taggedTemplateLiteral(["\n font-family:circe-rounded;\n font-weight:bold;\n font-size:36px;\n line-height:44px;\n color: ", ";\n"]);
4209
+ var data = taggedTemplateLiteral(["\n font-family: \"Huninn\", sans-serif;\n font-weight: bold;\n font-size: 36px;\n line-height: 40px;\n color: ", ";\n"]);
4205
4210
 
4206
4211
  _templateObject$5 = function _templateObject() {
4207
4212
  return data;
@@ -4209,13 +4214,36 @@ function _templateObject$5() {
4209
4214
 
4210
4215
  return data;
4211
4216
  }
4212
- var Title = styled.h1(_templateObject$5(), theme.colors.secondary);
4217
+ var Title = styled.h1(_templateObject$5(), theme.colors.info.text);
4213
4218
  var SubTitle = styled.h3(_templateObject2$2(), theme.colors.info.text);
4214
4219
  var ThirdTitle = styled(SubTitle)(_templateObject3$2());
4215
- var Text = styled.p(_templateObject4$2(), theme.colors.neutrals.gray);
4220
+ var Text = styled.p(_templateObject4$2(), theme.colors.neutrals.gray, function (_ref) {
4221
+ var subtle = _ref.subtle;
4222
+ return subtle && "\n color:".concat(theme.colors.neutrals.medium, ";\n ");
4223
+ });
4224
+
4225
+ function _templateObject14() {
4226
+ var data = taggedTemplateLiteral(["\n border: 0;\n padding-right: 8px;\n background: transparent;\n cursor: inherit;\n display: flex;\n align-items: center;\n height: 100%;\n"]);
4227
+
4228
+ _templateObject14 = function _templateObject14() {
4229
+ return data;
4230
+ };
4231
+
4232
+ return data;
4233
+ }
4234
+
4235
+ function _templateObject13() {
4236
+ var data = taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n border: 0;\n outline: 0;\n padding: 0;\n background: transparent;\n cursor: inherit;\n font-family: inherit;\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n padding-left: 8px;\n\n\n &::placeholder {\n color: ", ";\n opacity: 1;\n }\n"]);
4237
+
4238
+ _templateObject13 = function _templateObject13() {
4239
+ return data;
4240
+ };
4241
+
4242
+ return data;
4243
+ }
4216
4244
 
4217
4245
  function _templateObject12() {
4218
- var data = taggedTemplateLiteral(["\n height:24px;\n width:24px;\n box-sizing: border-box;\n margin-right:5px;\n border-radius:100%;\n border:2px solid white;\n background:", "\n z-index: ", ";\n margin-left:", "\n margin-top: 8px;\n margin-bottom: 8px;\n display: inline-block;\n"]);
4246
+ var data = taggedTemplateLiteral(["\n height: 24px;\n width: 24px;\n box-sizing: border-box;\n margin-right: 5px;\n border-radius: 100%;\n border: 2px solid white;\n background: ", "\n z-index: ", ";\n margin-left: ", "\n margin-top: 8px;\n margin-bottom: 8px;\n display: inline-block;\n"]);
4219
4247
 
4220
4248
  _templateObject12 = function _templateObject12() {
4221
4249
  return data;
@@ -4225,7 +4253,7 @@ function _templateObject12() {
4225
4253
  }
4226
4254
 
4227
4255
  function _templateObject11() {
4228
- var data = taggedTemplateLiteral(["\n color:#707070;\n font-size:12px;\n padding:8px;\n font-weight:bold;\n cursor:default;\n white-space: nowrap;\n"]);
4256
+ var data = taggedTemplateLiteral(["\n color: #707070;\n font-size: 12px;\n padding: 8px;\n font-weight: bold;\n cursor: default;\n white-space: nowrap;\n"]);
4229
4257
 
4230
4258
  _templateObject11 = function _templateObject11() {
4231
4259
  return data;
@@ -4235,7 +4263,7 @@ function _templateObject11() {
4235
4263
  }
4236
4264
 
4237
4265
  function _templateObject10() {
4238
- var data = taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", ";\n border:1px solid ", ";\n height:16px;\n width:16px;\n border-radius:2px;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-right:9px;\n &:focus{\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n\n"]);
4266
+ var data = taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n height: 16px;\n width: 16px;\n border-radius: ", ";\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-right: 9px;\n\n &:focus {\n border-color: ", ";\n box-shadow: 0 0 6px ", ";\n }\n\n"]);
4239
4267
 
4240
4268
  _templateObject10 = function _templateObject10() {
4241
4269
  return data;
@@ -4245,7 +4273,7 @@ function _templateObject10() {
4245
4273
  }
4246
4274
 
4247
4275
  function _templateObject9$1() {
4248
- var data = taggedTemplateLiteral(["\n height:22px;\n width:22px;\n overflow:hidden;\n border-radius:100%;\n border:1px solid #516F90;\n background:#EAF0F6;\n margin-right:5px;\n display:flex;\n justify-content:center;\n align-items:center;\n\n >svg {\n margin-top:2px;\n }\n\n >img {\n width:25px;\n height:25px;\n object-fit:cover;\n object-position:center;\n }\n"]);
4276
+ var data = taggedTemplateLiteral(["\n height: 22px;\n width: 22px;\n overflow: hidden;\n border-radius: 100%;\n border: 1px solid #516F90;\n background: #EAF0F6;\n margin-right: 5px;\n display: flex;\n justify-content: center;\n align-items: center;\n\n > svg {\n margin-top: 2px;\n }\n\n > img {\n width: 25px;\n height: 25px;\n object-fit: cover;\n object-position: center;\n }\n"]);
4249
4277
 
4250
4278
  _templateObject9$1 = function _templateObject9() {
4251
4279
  return data;
@@ -4265,7 +4293,7 @@ function _templateObject8$1() {
4265
4293
  }
4266
4294
 
4267
4295
  function _templateObject7$1() {
4268
- var data = taggedTemplateLiteral(["\n color:", "\n"]);
4296
+ var data = taggedTemplateLiteral(["\n color: ", "\n"]);
4269
4297
 
4270
4298
  _templateObject7$1 = function _templateObject7() {
4271
4299
  return data;
@@ -4275,7 +4303,7 @@ function _templateObject7$1() {
4275
4303
  }
4276
4304
 
4277
4305
  function _templateObject6$1() {
4278
- var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:Circe-Rounded;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
4306
+ var data = taggedTemplateLiteral(["\n font-size: ", ";\n font-weight: normal;\n font-family: \"Huninn\", sans-serif;\n display: block;\n color: #516F90;\n margin-top: 4px;\n"]);
4279
4307
 
4280
4308
  _templateObject6$1 = function _templateObject6() {
4281
4309
  return data;
@@ -4285,7 +4313,7 @@ function _templateObject6$1() {
4285
4313
  }
4286
4314
 
4287
4315
  function _templateObject5$1() {
4288
- var data = taggedTemplateLiteral(["\n max-height: ", "px;\n overflow-y:scroll;\n\n >li {\n padding-right: 8px;\n height: auto;\n min-height: 32px;\n justify-content: flex-start;\n }\n"]);
4316
+ var data = taggedTemplateLiteral(["\n max-height: ", "px;\n overflow-y: scroll;\n\n > li {\n padding-right: 8px;\n height: auto;\n min-height: 32px;\n justify-content: flex-start;\n }\n"]);
4289
4317
 
4290
4318
  _templateObject5$1 = function _templateObject5() {
4291
4319
  return data;
@@ -4295,7 +4323,7 @@ function _templateObject5$1() {
4295
4323
  }
4296
4324
 
4297
4325
  function _templateObject4$3() {
4298
- var data = taggedTemplateLiteral(["\n padding:0;\n margin:4px 0;\n background:white;\n border:1px solid ", ";\n box-shadow:0 0 6px ", ";\n border-radius:2px;\n list-style:none;\n width:auto;\n display:inline-block;\n position: absolute;\n top: 100%;\n ", "\n left: -1px;\n z-index:10;\n ", "\n\n\n ", "\n\n\n li {\n font-size:", ";\n color:#707070;\n height:32px;\n cursor:pointer;\n padding:0px 4px 0 8px;\n position:relative;\n display:flex;\n justify-content:space-between;\n align-items:center;\n\n >ul {\n display:none;\n }\n\n &::before {\n content: \" \";\n height: 100%;\n width: 6px;\n background: transparent;\n display: block;\n position: absolute;\n right: -7px;\n }\n\n\n &:hover {\n background:", ";\n\n >ul {\n display:inline-block;\n }\n }\n\n &.alone {\n border-top:1px solid ", ";\n }\n\n }\n"]);
4326
+ var data = taggedTemplateLiteral(["\n padding: 0;\n margin: 4px 0;\n background: white;\n border: 1px solid ", ";\n box-shadow: 0 0 6px ", ";\n border-radius: ", ";\n list-style: none;\n width: auto;\n display: inline-block;\n position: absolute;\n top: 100%;\n ", "\n left: -1px;\n z-index: 10;\n\n ", "\n ", "\n li {\n font-size: ", ";\n color: #707070;\n height: 32px;\n cursor: pointer;\n padding: 0px 4px 0 8px;\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n > ul {\n display: none;\n }\n\n &::before {\n content: \" \";\n height: 100%;\n width: 6px;\n background: transparent;\n display: block;\n position: absolute;\n right: -7px;\n }\n\n\n &:hover {\n background: ", ";\n\n > ul {\n display: inline-block;\n }\n }\n\n &.alone {\n border-top: 1px solid ", ";\n }\n\n }\n"]);
4299
4327
 
4300
4328
  _templateObject4$3 = function _templateObject4() {
4301
4329
  return data;
@@ -4305,7 +4333,7 @@ function _templateObject4$3() {
4305
4333
  }
4306
4334
 
4307
4335
  function _templateObject3$3() {
4308
- var data = taggedTemplateLiteral(["\n white-space: nowrap;\n overflow:hidden;\n color: ", ";\n\n ", "\n\n >span {\n color:#707070;\n }\n"]);
4336
+ var data = taggedTemplateLiteral(["\n white-space: nowrap;\n overflow: hidden;\n color: ", ";\n\n ", "\n > span {\n color: #707070;\n }\n"]);
4309
4337
 
4310
4338
  _templateObject3$3 = function _templateObject3() {
4311
4339
  return data;
@@ -4315,7 +4343,7 @@ function _templateObject3$3() {
4315
4343
  }
4316
4344
 
4317
4345
  function _templateObject2$3() {
4318
- var data = taggedTemplateLiteral(["\n width:", ";\n height:40px;\n background:white;\n border-radius:2px;\n border:1px solid ", ";\n cursor:pointer;\n position:relative;\n box-sizing:border-box;\n padding:12px 8px;\n display:flex;\n align-items:center;\n justify-content:space-between;\n\n &.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n\n &.error {\n border-color:", ";\n }\n\n &.error.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n\n &.valid {\n border-color:", ";\n }\n\n &.valid.open {\n border-color:", ";\n box-shadow:0 0 6px ", ";\n }\n\n &[disabled] {\n cursor: not-allowed;\n background: ", ";\n border-color: ", ";\n color: ", ";\n }\n\n &[disabled] input::placeholder {\n color:#eee;\n }\n"]);
4346
+ var data = taggedTemplateLiteral(["\n width: ", ";\n height: 40px;\n background: white;\n border-radius: ", ";\n border: 1px solid ", ";\n cursor: pointer;\n position: relative;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n &:hover {\n border-color: ", ";\n }\n\n &.open {\n border-color: ", ";\n box-shadow: 0 0 6px ", ";\n }\n\n &.error {\n border-color: ", ";\n }\n\n &.error.open {\n border-color: ", ";\n box-shadow: 0 0 6px ", ";\n }\n\n &.valid {\n border-color: ", ";\n }\n\n &.valid.open {\n border-color: ", ";\n box-shadow: 0 0 6px ", ";\n }\n\n &[disabled] {\n cursor: not-allowed;\n background: ", ";\n border-color: ", ";\n color: ", ";\n }\n\n &[disabled] input::placeholder {\n color: #eee;\n }\n"]);
4319
4347
 
4320
4348
  _templateObject2$3 = function _templateObject2() {
4321
4349
  return data;
@@ -4325,7 +4353,7 @@ function _templateObject2$3() {
4325
4353
  }
4326
4354
 
4327
4355
  function _templateObject$6() {
4328
- var data = taggedTemplateLiteral(["\n display:inline-block;\n vertical-align: top;\n"]);
4356
+ var data = taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: top;\n ", "\n"]);
4329
4357
 
4330
4358
  _templateObject$6 = function _templateObject() {
4331
4359
  return data;
@@ -4333,7 +4361,10 @@ function _templateObject$6() {
4333
4361
 
4334
4362
  return data;
4335
4363
  }
4336
- var Frag$2 = styled.div(_templateObject$6());
4364
+ var Frag$2 = styled.div(_templateObject$6(), function (_ref) {
4365
+ var fullWidth = _ref.fullWidth;
4366
+ return fullWidth && 'width: 100%;';
4367
+ });
4337
4368
 
4338
4369
  var handleSize$2 = function handleSize(sizeType) {
4339
4370
  switch (sizeType) {
@@ -4347,14 +4378,14 @@ var handleSize$2 = function handleSize(sizeType) {
4347
4378
  return '460px';
4348
4379
 
4349
4380
  default:
4350
- return '300px';
4381
+ return '100%';
4351
4382
  }
4352
4383
  };
4353
4384
 
4354
- var SelectUi$1 = styled.div(_templateObject2$3(), function (_ref) {
4355
- var size = _ref.size;
4385
+ var SelectUi$1 = styled.div(_templateObject2$3(), function (_ref2) {
4386
+ var size = _ref2.size;
4356
4387
  return handleSize$2(size);
4357
- }, theme.colors.neutrals.silver, theme.colors.secondary, theme.colors.action, theme.colors.error.border, theme.colors.error.border, theme.colors.error.shadow, theme.colors.success.border, theme.colors.success.border, theme.colors.success.shadow, theme.colors.extra.whiteSmoke, theme.colors.neutrals.silver, theme.colors.neutrals.medium);
4388
+ }, theme.defaultRadius, theme.colors.neutrals.silver, theme.colors.info.border, theme.colors.secondary, theme.colors.action, theme.colors.error.border, theme.colors.error.border, theme.colors.error.shadow, theme.colors.success.border, theme.colors.success.border, theme.colors.success.shadow, theme.colors.extra.whiteSmoke, theme.colors.neutrals.silver, theme.colors.neutrals.medium);
4358
4389
  var Value$1 = styled(Text).attrs(function (props) {
4359
4390
  return {
4360
4391
  as: 'span'
@@ -4364,7 +4395,7 @@ var Value$1 = styled(Text).attrs(function (props) {
4364
4395
  });
4365
4396
  var maxOptions = 3;
4366
4397
  var optionsSize = 32;
4367
- var Options$1 = styled.ul(_templateObject4$3(), theme.colors.neutrals.silver, theme.colors.neutrals.silver, function (props) {
4398
+ var Options$1 = styled.ul(_templateObject4$3(), theme.colors.neutrals.silver, theme.colors.neutrals.silver, theme.defaultRadius, function (props) {
4368
4399
  return props.openTo === 'top' && "\n top:unset;\n bottom: 100%;\n ";
4369
4400
  }, function (props) {
4370
4401
  return !props.hasChildren && "\n max-height: ".concat(props.visibleOptionsQty ? props.visibleOptionsQty * optionsSize : maxOptions * optionsSize, "px;\n overflow-x:hidden;\n overflow-y:scroll;\n ");
@@ -4379,7 +4410,7 @@ var Span$1 = styled.span(_templateObject6$1(), theme.font.extraSmall.size);
4379
4410
  var SpanError$2 = styled(Span$1)(_templateObject7$1(), theme.colors.error.text);
4380
4411
  var SelectHidden = styled.select(_templateObject8$1());
4381
4412
  var PhotoCover = styled.div(_templateObject9$1());
4382
- var CustomCheckBox = styled.div(_templateObject10(), theme.colors.neutrals.white, theme.defaultRadius, theme.colors.neutrals.silver, theme.colors.secondary, theme.colors.action);
4413
+ var CustomCheckBox = styled.div(_templateObject10(), theme.colors.neutrals.white, theme.defaultRadius, theme.colors.neutrals.silver, theme.defaultRadius, theme.colors.secondary, theme.colors.action);
4383
4414
  var OptionGroup$1 = styled.div(_templateObject11());
4384
4415
  var ColorOption = styled.span(_templateObject12(), function (props) {
4385
4416
  return props.color ? props.color : 'black';
@@ -4397,48 +4428,465 @@ var getSelected = function getSelected(options, defaultValue) {
4397
4428
  return selected;
4398
4429
  };
4399
4430
 
4400
- var Dropdown = /*#__PURE__*/forwardRef(function (_ref2, ref) {
4401
- var name = _ref2.name,
4402
- label = _ref2.label,
4403
- help = _ref2.help,
4404
- error = _ref2.error,
4405
- valid = _ref2.valid,
4406
- options = _ref2.options,
4407
- placeholder = _ref2.placeholder,
4408
- onChange = _ref2.onChange,
4409
- defaultValue = _ref2.defaultValue,
4410
- visibleOptionsQty = _ref2.visibleOptionsQty,
4411
- openTo = _ref2.openTo,
4412
- _ref2$startOpen = _ref2.startOpen,
4413
- startOpen = _ref2$startOpen === void 0 ? false : _ref2$startOpen,
4414
- props = objectWithoutProperties(_ref2, ["name", "label", "help", "error", "valid", "options", "placeholder", "onChange", "defaultValue", "visibleOptionsQty", "openTo", "startOpen"]);
4431
+ var SearchInput = styled.input(_templateObject13(), theme.font.medium.size, theme.font.medium.lineHeight, theme.colors.neutrals.gray, function (props) {
4432
+ return props.hasSelection ? theme.colors.neutrals.gray : theme.colors.neutrals.medium;
4433
+ });
4434
+ var ToggleButton = styled.button(_templateObject14());
4415
4435
 
4416
- var defaultSelected = {
4417
- value: '',
4418
- desc: ''
4419
- };
4436
+ var isOption = function isOption(item) {
4437
+ return item.value !== undefined && item.value !== null;
4438
+ };
4439
+
4440
+ var flattenOptions = function flattenOptions(options) {
4441
+ var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
4442
+ return (options || []).reduce(function (rows, item) {
4443
+ return rows.concat({
4444
+ item: item,
4445
+ depth: depth
4446
+ }, flattenOptions(item.options, depth + 1));
4447
+ }, []);
4448
+ }; // option names can be React elements, typing and inline completion need their text
4449
+
4450
+
4451
+ var optionText = function optionText(node) {
4452
+ if (node === undefined || node === null || typeof node === 'boolean') return '';
4453
+ if (typeof node === 'string' || typeof node === 'number') return node.toString();
4454
+ if (Array.isArray(node)) return node.map(optionText).join('');
4455
+ return node.props ? optionText(node.props.children) : '';
4456
+ };
4420
4457
 
4421
- var _useState = useState(startOpen),
4458
+ var keepInViewport = function keepInViewport(node) {
4459
+ if (node && node.getBoundingClientRect().right > window.innerWidth) {
4460
+ node.style.left = 'unset';
4461
+ node.style.right = '0px';
4462
+ }
4463
+ }; // eslint-disable-next-line react/prop-types
4464
+
4465
+
4466
+ var AutocompleteSelect = function AutocompleteSelect(_ref3) {
4467
+ var options = _ref3.options,
4468
+ selectedOpt = _ref3.selectedOpt,
4469
+ setSelected = _ref3.setSelected,
4470
+ onChange = _ref3.onChange,
4471
+ onSelect = _ref3.onSelect,
4472
+ placeholder = _ref3.placeholder,
4473
+ error = _ref3.error,
4474
+ valid = _ref3.valid,
4475
+ noOptions = _ref3.noOptions,
4476
+ visibleOptionsQty = _ref3.visibleOptionsQty,
4477
+ openTo = _ref3.openTo,
4478
+ startOpen = _ref3.startOpen,
4479
+ resetCallback = _ref3.resetCallback,
4480
+ props = objectWithoutProperties(_ref3, ["options", "selectedOpt", "setSelected", "onChange", "onSelect", "placeholder", "error", "valid", "noOptions", "visibleOptionsQty", "openTo", "startOpen", "resetCallback"]);
4481
+
4482
+ var _useState = useState(),
4422
4483
  _useState2 = slicedToArray(_useState, 2),
4423
- open = _useState2[0],
4424
- setOpen = _useState2[1];
4484
+ search = _useState2[0],
4485
+ setSearch = _useState2[1];
4486
+
4487
+ var rows = flattenOptions(options);
4488
+ var selectable = rows.filter(function (row) {
4489
+ return isOption(row.item);
4490
+ }).map(function (row) {
4491
+ return row.item;
4492
+ });
4493
+
4494
+ var filterItems = function filterItems(text) {
4495
+ return text ? selectable.filter(function (item) {
4496
+ return optionText(item.name).toLowerCase().startsWith(text.toLowerCase());
4497
+ }) : selectable;
4498
+ };
4499
+
4500
+ var items = filterItems(search);
4501
+ var hasSelection = selectedOpt.value.length > 0;
4502
+ var selectedText = optionText(selectedOpt.desc);
4503
+
4504
+ var _useCombobox = useCombobox({
4505
+ items: items,
4506
+ value: search || '',
4507
+ onChange: setSearch,
4508
+ selected: selectable.find(function (item) {
4509
+ return item.value.toString() === selectedOpt.value;
4510
+ }),
4511
+ onSelectChange: function onSelectChange(item) {
4512
+ if (!item) return;
4513
+ if (onSelect) onSelect(item);
4514
+ setSelected({
4515
+ value: item.value.toString(),
4516
+ desc: item.name
4517
+ });
4518
+ if (onChange) onChange(item);
4519
+ },
4520
+ isEqual: function isEqual(a, b) {
4521
+ return a === b || !!a && !!b && a.value == b.value;
4522
+ },
4523
+ getItemValue: function getItemValue(item) {
4524
+ return optionText(item.name);
4525
+ },
4526
+ disabled: props.disabled,
4527
+ feature: supercomplete({
4528
+ onRequestItem: function onRequestItem(_ref4, res) {
4529
+ var value = _ref4.value;
4530
+ var matches = filterItems(value);
4531
+ if (matches.length > 0) res({
4532
+ index: 0,
4533
+ item: matches[0]
4534
+ });
4535
+ },
4536
+ select: true,
4537
+ deselectOnClear: false
4538
+ })
4539
+ }),
4540
+ getInputProps = _useCombobox.getInputProps,
4541
+ getToggleProps = _useCombobox.getToggleProps,
4542
+ getListProps = _useCombobox.getListProps,
4543
+ getItemProps = _useCombobox.getItemProps,
4544
+ open = _useCombobox.open,
4545
+ setOpen = _useCombobox.setOpen,
4546
+ focusIndex = _useCombobox.focusIndex;
4547
+
4548
+ useEffect(function () {
4549
+ if (startOpen) setOpen(true);
4550
+ }, []);
4551
+ var index = -1;
4552
+ return /*#__PURE__*/React.createElement(SelectUi$1, _extends_1({
4553
+ className: [open && 'open', error && 'error', valid && 'valid'].filter(Boolean).join(' ')
4554
+ }, props, {
4555
+ title: selectedText
4556
+ }), /*#__PURE__*/React.createElement(SearchInput, _extends_1({
4557
+ placeholder: hasSelection ? selectedText : placeholder,
4558
+ hasSelection: hasSelection
4559
+ }, getInputProps())), /*#__PURE__*/React.createElement(ToggleButton, getToggleProps(), open ? /*#__PURE__*/React.createElement(Icons.ArrowUp, {
4560
+ size: "15px",
4561
+ color: theme.colors.info.border
4562
+ }) : /*#__PURE__*/React.createElement(Icons.ArrowDown, {
4563
+ size: "15px",
4564
+ color: theme.colors.info.border
4565
+ })), open && /*#__PURE__*/React.createElement(Options$1, _extends_1({
4566
+ visibleOptionsQty: visibleOptionsQty,
4567
+ openTo: openTo,
4568
+ ref: keepInViewport
4569
+ }, getListProps()), items.length === 0 && /*#__PURE__*/React.createElement("li", {
4570
+ style: {
4571
+ paddingRight: '8px'
4572
+ }
4573
+ }, noOptions || 'No data found'), (search ? items.map(function (item) {
4574
+ return {
4575
+ item: item,
4576
+ depth: 0
4577
+ };
4578
+ }) : rows).map(function (_ref5, key) {
4579
+ var item = _ref5.item,
4580
+ depth = _ref5.depth;
4581
+
4582
+ if (!isOption(item)) {
4583
+ return /*#__PURE__*/React.createElement(OptionGroup$1, {
4584
+ key: key,
4585
+ style: {
4586
+ paddingLeft: 8 + depth * 16
4587
+ }
4588
+ }, item.name);
4589
+ }
4590
+
4591
+ index++;
4592
+ return /*#__PURE__*/React.createElement("li", _extends_1({
4593
+ key: key,
4594
+ className: item.divider ? 'alone' : '',
4595
+ style: {
4596
+ paddingLeft: 8 + depth * 16,
4597
+ background: focusIndex === index ? theme.colors.info.bg : undefined
4598
+ }
4599
+ }, getItemProps({
4600
+ item: item,
4601
+ index: index
4602
+ })), /*#__PURE__*/React.createElement(Value$1, {
4603
+ option: true,
4604
+ style: {
4605
+ marginRight: 4
4606
+ }
4607
+ }, item.name));
4608
+ })));
4609
+ };
4610
+
4611
+ var summarizeSelection = function summarizeSelection(names) {
4612
+ if (names.length <= 2) return names.join(', ');
4613
+ var others = names.length - 2;
4614
+ return "".concat(names[0], ", ").concat(names[1], " and ").concat(others, " other").concat(others > 1 ? 's' : '');
4615
+ }; // eslint-disable-next-line react/prop-types
4616
+
4425
4617
 
4426
- var _useState3 = useState(defaultSelected),
4618
+ var MultiAutocompleteSelect = function MultiAutocompleteSelect(_ref6) {
4619
+ var options = _ref6.options,
4620
+ selectedValues = _ref6.selectedValues,
4621
+ onToggle = _ref6.onToggle,
4622
+ placeholder = _ref6.placeholder,
4623
+ error = _ref6.error,
4624
+ valid = _ref6.valid,
4625
+ noOptions = _ref6.noOptions,
4626
+ visibleOptionsQty = _ref6.visibleOptionsQty,
4627
+ openTo = _ref6.openTo,
4628
+ startOpen = _ref6.startOpen,
4629
+ props = objectWithoutProperties(_ref6, ["options", "selectedValues", "onToggle", "placeholder", "error", "valid", "noOptions", "visibleOptionsQty", "openTo", "startOpen"]);
4630
+
4631
+ var _useState3 = useState(''),
4427
4632
  _useState4 = slicedToArray(_useState3, 2),
4428
- selectedOpt = _useState4[0],
4429
- setSelected = _useState4[1];
4633
+ search = _useState4[0],
4634
+ setSearch = _useState4[1];
4635
+
4636
+ var _useState5 = useState(startOpen),
4637
+ _useState6 = slicedToArray(_useState5, 2),
4638
+ open = _useState6[0],
4639
+ setOpen = _useState6[1];
4640
+
4641
+ var nodeRef = useRef();
4642
+ useEffect(function () {
4643
+ var closeOnOutsideClick = function closeOnOutsideClick(e) {
4644
+ if (nodeRef.current && !nodeRef.current.contains(e.target)) {
4645
+ setOpen(false);
4646
+ setSearch('');
4647
+ }
4648
+ };
4649
+
4650
+ document.addEventListener('mousedown', closeOnOutsideClick);
4651
+ return function () {
4652
+ return document.removeEventListener('mousedown', closeOnOutsideClick);
4653
+ };
4654
+ }, []);
4655
+ var rows = flattenOptions(options);
4656
+ var selectable = rows.filter(function (row) {
4657
+ return isOption(row.item);
4658
+ }).map(function (row) {
4659
+ return row.item;
4660
+ });
4661
+ var items = search ? selectable.filter(function (item) {
4662
+ return optionText(item.name).toLowerCase().startsWith(search.toLowerCase());
4663
+ }) : selectable;
4664
+ var summary = summarizeSelection(selectable.filter(function (item) {
4665
+ return selectedValues.includes(item.value.toString());
4666
+ }).map(function (item) {
4667
+ return optionText(item.name);
4668
+ }));
4669
+ return /*#__PURE__*/React.createElement(SelectUi$1, _extends_1({
4670
+ ref: nodeRef,
4671
+ className: [open && 'open', error && 'error', valid && 'valid'].filter(Boolean).join(' ')
4672
+ }, props, {
4673
+ title: summary,
4674
+ onClick: function onClick() {
4675
+ return !props.disabled && setOpen(true);
4676
+ }
4677
+ }), /*#__PURE__*/React.createElement(SearchInput, {
4678
+ value: search,
4679
+ placeholder: summary || placeholder,
4680
+ hasSelection: summary.length > 0,
4681
+ disabled: props.disabled,
4682
+ onChange: function onChange(e) {
4683
+ setSearch(e.target.value);
4684
+ setOpen(true);
4685
+ },
4686
+ onKeyDown: function onKeyDown(e) {
4687
+ if (e.key === 'Escape') {
4688
+ setOpen(false);
4689
+ setSearch('');
4690
+ }
4691
+ }
4692
+ }), /*#__PURE__*/React.createElement(ToggleButton, {
4693
+ type: "button",
4694
+ tabIndex: -1,
4695
+ onClick: function onClick(e) {
4696
+ e.stopPropagation();
4697
+ if (!props.disabled) setOpen(!open);
4698
+ }
4699
+ }, open ? /*#__PURE__*/React.createElement(Icons.ArrowUp, {
4700
+ size: "15px",
4701
+ color: theme.colors.info.border
4702
+ }) : /*#__PURE__*/React.createElement(Icons.ArrowDown, {
4703
+ size: "15px",
4704
+ color: theme.colors.info.border
4705
+ })), open && /*#__PURE__*/React.createElement(Options$1, {
4706
+ visibleOptionsQty: visibleOptionsQty,
4707
+ openTo: openTo,
4708
+ ref: keepInViewport
4709
+ }, items.length === 0 && /*#__PURE__*/React.createElement("li", {
4710
+ style: {
4711
+ paddingRight: '8px'
4712
+ }
4713
+ }, noOptions || 'No data found'), (search ? items.map(function (item) {
4714
+ return {
4715
+ item: item,
4716
+ depth: 0
4717
+ };
4718
+ }) : rows).map(function (_ref7, key) {
4719
+ var item = _ref7.item,
4720
+ depth = _ref7.depth;
4721
+
4722
+ if (!isOption(item)) {
4723
+ return /*#__PURE__*/React.createElement(OptionGroup$1, {
4724
+ key: key,
4725
+ style: {
4726
+ paddingLeft: 8 + depth * 16
4727
+ }
4728
+ }, item.name);
4729
+ }
4730
+
4731
+ return /*#__PURE__*/React.createElement("li", {
4732
+ key: key,
4733
+ style: {
4734
+ paddingLeft: 8 + depth * 16,
4735
+ justifyContent: 'flex-start'
4736
+ },
4737
+ onMouseDown: function onMouseDown(e) {
4738
+ return e.preventDefault();
4739
+ },
4740
+ onClick: function onClick(e) {
4741
+ e.stopPropagation();
4742
+ onToggle(item);
4743
+ }
4744
+ }, /*#__PURE__*/React.createElement(CustomCheckBox, null, selectedValues.includes(item.value.toString()) && /*#__PURE__*/React.createElement(Icons.Check, {
4745
+ size: "17px"
4746
+ })), /*#__PURE__*/React.createElement(Value$1, {
4747
+ option: true,
4748
+ style: {
4749
+ marginRight: 4
4750
+ }
4751
+ }, item.name));
4752
+ })));
4753
+ };
4754
+
4755
+ var MultiDropdown = /*#__PURE__*/forwardRef(function (_ref8, ref) {
4756
+ var name = _ref8.name,
4757
+ label = _ref8.label,
4758
+ help = _ref8.help,
4759
+ error = _ref8.error,
4760
+ valid = _ref8.valid,
4761
+ options = _ref8.options,
4762
+ placeholder = _ref8.placeholder,
4763
+ onChange = _ref8.onChange,
4764
+ defaultValue = _ref8.defaultValue,
4765
+ visibleOptionsQty = _ref8.visibleOptionsQty,
4766
+ openTo = _ref8.openTo,
4767
+ _ref8$startOpen = _ref8.startOpen,
4768
+ startOpen = _ref8$startOpen === void 0 ? false : _ref8$startOpen,
4769
+ resetCallback = _ref8.resetCallback,
4770
+ props = objectWithoutProperties(_ref8, ["name", "label", "help", "error", "valid", "options", "placeholder", "onChange", "defaultValue", "visibleOptionsQty", "openTo", "startOpen", "resetCallback"]);
4771
+
4772
+ var _useState7 = useState([]),
4773
+ _useState8 = slicedToArray(_useState7, 2),
4774
+ selectedValues = _useState8[0],
4775
+ setSelectedValues = _useState8[1];
4430
4776
 
4431
- var nodeSelect = useRef();
4432
4777
  var valueRef = useRef();
4778
+ var selectable = flattenOptions(options).filter(function (row) {
4779
+ return isOption(row.item);
4780
+ }).map(function (row) {
4781
+ return row.item;
4782
+ });
4433
4783
 
4434
- var handleClick = function handleClick(e) {
4435
- if (nodeSelect.current.contains(e.target)) {
4436
- return;
4784
+ if (resetCallback) {
4785
+ resetCallback(function () {
4786
+ return setSelectedValues([]);
4787
+ });
4788
+ }
4789
+
4790
+ var hasDefaultValue = defaultValue !== undefined && defaultValue !== null && defaultValue !== '';
4791
+ var defaults = (Array.isArray(defaultValue) ? defaultValue : hasDefaultValue ? [defaultValue] : selectable.filter(function (item) {
4792
+ return item.selected;
4793
+ }).map(function (item) {
4794
+ return item.value;
4795
+ })).map(String);
4796
+ var defaultsKey = defaults.join("\0");
4797
+ useEffect(function () {
4798
+ setSelectedValues(defaults);
4799
+ }, [defaultsKey]);
4800
+ useEffect(function () {
4801
+ if (!valueRef.current) return;
4802
+ Array.from(valueRef.current.options).forEach(function (opt) {
4803
+ opt.selected = selectedValues.includes(opt.value);
4804
+ });
4805
+ valueRef.current.dispatchEvent(new Event('blur'));
4806
+ }, [selectedValues, options]);
4807
+
4808
+ var toggle = function toggle(item) {
4809
+ var value = item.value.toString();
4810
+ var next = selectedValues.includes(value) ? selectedValues.filter(function (v) {
4811
+ return v !== value;
4812
+ }) : [].concat(toConsumableArray(selectedValues), [value]);
4813
+ setSelectedValues(next);
4814
+ if (onChange) onChange(selectable.filter(function (opt) {
4815
+ return next.includes(opt.value.toString());
4816
+ }));
4817
+ };
4818
+
4819
+ var useIcon = false;
4820
+ if (props.Required) useIcon = /*#__PURE__*/React.createElement(RequiredText, null);
4821
+
4822
+ if (valid) {
4823
+ useIcon = /*#__PURE__*/React.createElement("img", {
4824
+ src: Check
4825
+ });
4826
+ }
4827
+
4828
+ return /*#__PURE__*/React.createElement(Frag$2, {
4829
+ fullWidth: !props.size
4830
+ }, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
4831
+ htmlFor: name
4832
+ }, label), label && useIcon && /*#__PURE__*/React.createElement(Label, {
4833
+ htmlFor: name
4834
+ }, label, " ", useIcon), /*#__PURE__*/React.createElement(MultiAutocompleteSelect, _extends_1({
4835
+ options: options,
4836
+ selectedValues: selectedValues,
4837
+ onToggle: toggle,
4838
+ placeholder: placeholder,
4839
+ error: error,
4840
+ valid: valid,
4841
+ visibleOptionsQty: visibleOptionsQty,
4842
+ openTo: openTo,
4843
+ startOpen: startOpen
4844
+ }, props)), help && /*#__PURE__*/React.createElement(Span$1, null, help), error && /*#__PURE__*/React.createElement(SpanError$2, null, /*#__PURE__*/React.createElement("img", {
4845
+ src: Ex,
4846
+ style: {
4847
+ marginRight: '6px'
4437
4848
  }
4849
+ }), " ", error), /*#__PURE__*/React.createElement(SelectHidden, {
4850
+ name: name,
4851
+ multiple: true,
4852
+ ref: mergeRefs([valueRef, ref]),
4853
+ tabIndex: -1,
4854
+ disabled: props.disabled
4855
+ }, selectable.map(function (item, k) {
4856
+ return /*#__PURE__*/React.createElement("option", {
4857
+ value: item.value,
4858
+ key: k
4859
+ }, optionText(item.name));
4860
+ })));
4861
+ });
4862
+ var SingleDropdown = /*#__PURE__*/forwardRef(function (_ref9, ref) {
4863
+ var name = _ref9.name,
4864
+ label = _ref9.label,
4865
+ help = _ref9.help,
4866
+ error = _ref9.error,
4867
+ valid = _ref9.valid,
4868
+ options = _ref9.options,
4869
+ placeholder = _ref9.placeholder,
4870
+ onChange = _ref9.onChange,
4871
+ defaultValue = _ref9.defaultValue,
4872
+ visibleOptionsQty = _ref9.visibleOptionsQty,
4873
+ openTo = _ref9.openTo,
4874
+ _ref9$startOpen = _ref9.startOpen,
4875
+ startOpen = _ref9$startOpen === void 0 ? false : _ref9$startOpen,
4876
+ props = objectWithoutProperties(_ref9, ["name", "label", "help", "error", "valid", "options", "placeholder", "onChange", "defaultValue", "visibleOptionsQty", "openTo", "startOpen"]);
4438
4877
 
4439
- setOpen(false);
4878
+ var defaultSelected = {
4879
+ value: '',
4880
+ desc: ''
4440
4881
  };
4441
4882
 
4883
+ var _useState9 = useState(defaultSelected),
4884
+ _useState10 = slicedToArray(_useState9, 2),
4885
+ selectedOpt = _useState10[0],
4886
+ setSelected = _useState10[1];
4887
+
4888
+ var valueRef = useRef();
4889
+
4442
4890
  var reset = function reset() {
4443
4891
  setSelected(defaultSelected);
4444
4892
  };
@@ -4457,28 +4905,28 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref2, ref) {
4457
4905
  };
4458
4906
  setSelected(defaultSelected);
4459
4907
  } else {
4460
- if (!valueRef.current.value) return;
4908
+ if (!valueRef.current.value) {
4909
+ return;
4910
+ }
4911
+
4461
4912
  var selected = getSelected(options, valueRef.current.value);
4462
- if (selected && selected.value && selected.value !== selectedOpt.value) setSelected({
4463
- value: selected.value.toString(),
4464
- desc: selected.name
4465
- });
4913
+
4914
+ if (selected && selected.value && selected.value !== selectedOpt.value) {
4915
+ setSelected({
4916
+ value: selected.value.toString(),
4917
+ desc: selected.name
4918
+ });
4919
+ }
4466
4920
  }
4467
4921
  });
4468
4922
  useEffect(function () {
4469
- //if(defaultValue){
4470
- if (options) setDefaultValues(); //}
4923
+ // if(defaultValue){
4924
+ if (options) setDefaultValues(); // }
4471
4925
  }, [options, defaultValue]);
4472
4926
  useEffect(function () {
4473
4927
  valueRef.current.value = selectedOpt.value;
4474
4928
  valueRef.current.dispatchEvent(new Event('blur'));
4475
4929
  }, [selectedOpt]);
4476
- useEffect(function () {
4477
- document.addEventListener("mousedown", handleClick);
4478
- return function () {
4479
- document.removeEventListener("mousedown", handleClick);
4480
- };
4481
- }, []);
4482
4930
  var useIcon = false;
4483
4931
  if (props.Required) useIcon = /*#__PURE__*/React.createElement(RequiredText, null);
4484
4932
 
@@ -4488,36 +4936,24 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref2, ref) {
4488
4936
  });
4489
4937
  }
4490
4938
 
4491
- return /*#__PURE__*/React.createElement(Frag$2, null, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
4939
+ return /*#__PURE__*/React.createElement(Frag$2, {
4940
+ fullWidth: !props.size
4941
+ }, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
4492
4942
  htmlFor: name
4493
4943
  }, label), label && useIcon && /*#__PURE__*/React.createElement(Label, {
4494
4944
  htmlFor: name
4495
- }, label, " ", useIcon), /*#__PURE__*/React.createElement(SelectUi$1, _extends_1({
4496
- onClick: function onClick() {
4497
- if (!props.disabled) setOpen(!open);
4498
- },
4499
- ref: nodeSelect,
4500
- className: [open && 'open', error && 'error', valid && 'valid']
4501
- }, props, {
4502
- title: selectedOpt ? selectedOpt.desc : ''
4503
- }), /*#__PURE__*/React.createElement(Value$1, null, selectedOpt.value.length > 0 ? selectedOpt.desc : /*#__PURE__*/React.createElement("span", null, placeholder)), open ? /*#__PURE__*/React.createElement(Icons.ArrowUp, {
4504
- size: "15px",
4505
- color: theme.colors.info.border
4506
- }) : /*#__PURE__*/React.createElement(Icons.ArrowDown, {
4507
- size: "15px",
4508
- color: theme.colors.info.border
4509
- }), open && /*#__PURE__*/React.createElement(BoxOptions, {
4945
+ }, label, " ", useIcon), /*#__PURE__*/React.createElement(AutocompleteSelect, _extends_1({
4510
4946
  options: options,
4947
+ selectedOpt: selectedOpt,
4511
4948
  setSelected: setSelected,
4512
4949
  onChange: onChange,
4513
- reset: reset,
4514
- noOptions: props.noOptions,
4515
- selectedOpt: selectedOpt.value,
4516
- setOpen: setOpen,
4517
- onSelect: props.onSelect,
4950
+ placeholder: placeholder,
4951
+ error: error,
4952
+ valid: valid,
4518
4953
  visibleOptionsQty: visibleOptionsQty,
4519
- openTo: openTo
4520
- })), help && /*#__PURE__*/React.createElement(Span$1, null, help), error && /*#__PURE__*/React.createElement(SpanError$2, null, /*#__PURE__*/React.createElement("img", {
4954
+ openTo: openTo,
4955
+ startOpen: startOpen
4956
+ }, props)), help && /*#__PURE__*/React.createElement(Span$1, null, help), error && /*#__PURE__*/React.createElement(SpanError$2, null, /*#__PURE__*/React.createElement("img", {
4521
4957
  src: Ex,
4522
4958
  style: {
4523
4959
  marginRight: '6px'
@@ -4528,24 +4964,38 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref2, ref) {
4528
4964
  ref: mergeRefs([valueRef, ref]),
4529
4965
  disabled: props.disabled
4530
4966
  }));
4967
+ });
4968
+ var Dropdown = /*#__PURE__*/forwardRef(function (_ref10, ref) {
4969
+ var multiple = _ref10.multiple,
4970
+ props = objectWithoutProperties(_ref10, ["multiple"]);
4971
+
4972
+ return multiple ? /*#__PURE__*/React.createElement(MultiDropdown, _extends_1({
4973
+ ref: ref
4974
+ }, props)) : /*#__PURE__*/React.createElement(SingleDropdown, _extends_1({
4975
+ ref: ref
4976
+ }, props));
4531
4977
  }); // eslint-disable-next-line react/prop-types
4532
4978
 
4533
- var BoxOptions = function BoxOptions(_ref3) {
4534
- var options = _ref3.options,
4535
- isChild = _ref3.isChild,
4536
- setSelected = _ref3.setSelected,
4537
- onChange = _ref3.onChange,
4538
- noOptions = _ref3.noOptions,
4539
- selectedOpt = _ref3.selectedOpt,
4540
- setOpen = _ref3.setOpen,
4541
- onSelect = _ref3.onSelect,
4542
- visibleOptionsQty = _ref3.visibleOptionsQty,
4543
- openTo = _ref3.openTo;
4544
- if (!options) return /*#__PURE__*/React.createElement(Options$1, null, /*#__PURE__*/React.createElement("li", {
4545
- style: {
4546
- paddingRight: '8px'
4547
- }
4548
- }, noOptions ? noOptions : 'No data found'));
4979
+ var BoxOptions = function BoxOptions(_ref11) {
4980
+ var options = _ref11.options,
4981
+ isChild = _ref11.isChild,
4982
+ setSelected = _ref11.setSelected,
4983
+ onChange = _ref11.onChange,
4984
+ noOptions = _ref11.noOptions,
4985
+ selectedOpt = _ref11.selectedOpt,
4986
+ setOpen = _ref11.setOpen,
4987
+ onSelect = _ref11.onSelect,
4988
+ visibleOptionsQty = _ref11.visibleOptionsQty,
4989
+ openTo = _ref11.openTo;
4990
+
4991
+ if (!options) {
4992
+ return /*#__PURE__*/React.createElement(Options$1, null, /*#__PURE__*/React.createElement("li", {
4993
+ style: {
4994
+ paddingRight: '8px'
4995
+ }
4996
+ }, noOptions || 'No data found'));
4997
+ }
4998
+
4549
4999
  var optionsRef = useRef();
4550
5000
 
4551
5001
  var handleClick = function handleClick(item, e) {
@@ -4568,8 +5018,8 @@ var BoxOptions = function BoxOptions(_ref3) {
4568
5018
  var optionsBounds = optionsRef.current.getBoundingClientRect();
4569
5019
 
4570
5020
  if (optionsBounds.right > window.innerWidth) {
4571
- optionsRef.current.style.left = "unset";
4572
- optionsRef.current.style.right = "0px";
5021
+ optionsRef.current.style.left = 'unset';
5022
+ optionsRef.current.style.right = '0px';
4573
5023
  }
4574
5024
  }
4575
5025
  }, []);
@@ -4608,39 +5058,47 @@ var BoxOptions = function BoxOptions(_ref3) {
4608
5058
  })) : /*#__PURE__*/React.createElement(OptionGroup$1, null, item.name));
4609
5059
  }));
4610
5060
  };
4611
- var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref4, ref) {
4612
- var name = _ref4.name,
4613
- label = _ref4.label,
4614
- help = _ref4.help,
4615
- error = _ref4.error,
4616
- valid = _ref4.valid,
4617
- options = _ref4.options,
4618
- placeholder = _ref4.placeholder,
4619
- defaultValue = _ref4.defaultValue,
4620
- multiple = _ref4.multiple,
4621
- type = _ref4.type,
4622
- tooltip = _ref4.tooltip,
4623
- onChange = _ref4.onChange,
4624
- visibleOptionsQty = _ref4.visibleOptionsQty,
4625
- openTo = _ref4.openTo,
4626
- props = objectWithoutProperties(_ref4, ["name", "label", "help", "error", "valid", "options", "placeholder", "defaultValue", "multiple", "type", "tooltip", "onChange", "visibleOptionsQty", "openTo"]);
4627
-
4628
- var _useState5 = useState(false),
4629
- _useState6 = slicedToArray(_useState5, 2),
4630
- open = _useState6[0],
4631
- setOpen = _useState6[1];
4632
-
4633
- var _useState7 = useState([]),
4634
- _useState8 = slicedToArray(_useState7, 2),
4635
- selectedOpt = _useState8[0],
4636
- setSelected = _useState8[1];
5061
+ var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref12, ref) {
5062
+ var name = _ref12.name,
5063
+ label = _ref12.label,
5064
+ help = _ref12.help,
5065
+ error = _ref12.error,
5066
+ valid = _ref12.valid,
5067
+ options = _ref12.options,
5068
+ placeholder = _ref12.placeholder,
5069
+ defaultValue = _ref12.defaultValue,
5070
+ multiple = _ref12.multiple,
5071
+ type = _ref12.type,
5072
+ tooltip = _ref12.tooltip,
5073
+ onChange = _ref12.onChange,
5074
+ visibleOptionsQty = _ref12.visibleOptionsQty,
5075
+ openTo = _ref12.openTo,
5076
+ props = objectWithoutProperties(_ref12, ["name", "label", "help", "error", "valid", "options", "placeholder", "defaultValue", "multiple", "type", "tooltip", "onChange", "visibleOptionsQty", "openTo"]);
5077
+
5078
+ var _useState11 = useState(false),
5079
+ _useState12 = slicedToArray(_useState11, 2),
5080
+ open = _useState12[0],
5081
+ setOpen = _useState12[1];
5082
+
5083
+ var _useState13 = useState([]),
5084
+ _useState14 = slicedToArray(_useState13, 2),
5085
+ selectedOpt = _useState14[0],
5086
+ setSelected = _useState14[1];
4637
5087
 
4638
5088
  var nodeSelect = useRef();
4639
5089
  var valueRef = useRef();
4640
5090
 
4641
5091
  var handlOpenSelect = function handlOpenSelect(e) {
4642
- if (props.disabled) return;
4643
- if (multiple) if (e.target.classList.contains('1010list-option')) return;
5092
+ if (props.disabled) {
5093
+ return;
5094
+ }
5095
+
5096
+ if (multiple) {
5097
+ if (e.target.classList.contains('1010list-option')) {
5098
+ return;
5099
+ }
5100
+ }
5101
+
4644
5102
  setOpen(!open);
4645
5103
  };
4646
5104
 
@@ -4653,14 +5111,17 @@ var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref4, ref) {
4653
5111
  }
4654
5112
 
4655
5113
  var handleClick = function handleClick(e) {
4656
- if (nodeSelect.current.contains(e.target)) return;
5114
+ if (nodeSelect.current.contains(e.target)) {
5115
+ return;
5116
+ }
5117
+
4657
5118
  setOpen(false);
4658
5119
  };
4659
5120
 
4660
5121
  useEffect(function () {
4661
- document.addEventListener("mousedown", handleClick);
5122
+ document.addEventListener('mousedown', handleClick);
4662
5123
  return function () {
4663
- document.removeEventListener("mousedown", handleClick);
5124
+ document.removeEventListener('mousedown', handleClick);
4664
5125
  };
4665
5126
  }, []);
4666
5127
  var setDefaultValues = useCallback(function () {
@@ -4673,7 +5134,9 @@ var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref4, ref) {
4673
5134
  }).map(function (opt) {
4674
5135
  return opt.value;
4675
5136
  });
4676
- } else defaultValue = defaultValue || valueRef.current.value;
5137
+ } else {
5138
+ defaultValue = defaultValue || valueRef.current.value;
5139
+ }
4677
5140
  }
4678
5141
 
4679
5142
  if (options) {
@@ -4700,9 +5163,13 @@ var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref4, ref) {
4700
5163
  if (multiple) {
4701
5164
  if (selectedOpt.length !== defaults.length || !selectedOpt.every(function (value, index) {
4702
5165
  return value === defaults[index];
4703
- })) setSelected(defaults);
5166
+ })) {
5167
+ setSelected(defaults);
5168
+ }
4704
5169
  } else {
4705
- if (selectedOpt[0] !== defaults[0]) setSelected([defaults[0]]);
5170
+ if (selectedOpt[0] !== defaults[0]) {
5171
+ setSelected([defaults[0]]);
5172
+ }
4706
5173
  }
4707
5174
  } // const hasDefault = getSelected(options,defaultValue);
4708
5175
  //
@@ -4720,13 +5187,20 @@ var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref4, ref) {
4720
5187
 
4721
5188
  });
4722
5189
  useEffect(function () {
4723
- //if(defaultValue){
4724
- if (options) setDefaultValues(); //}
5190
+ // if(defaultValue){
5191
+ if (options) setDefaultValues(); // }
4725
5192
  }, [options, defaultValue]);
4726
5193
  useEffect(function () {
4727
- if (valueRef.current) if (multiple) Array.from(valueRef.current.children).map(function (opt, k) {
4728
- return opt.selected = selectedOpt.indexOf(k) !== -1;
4729
- });else if (options[selectedOpt]) valueRef.current.value = options[selectedOpt].value;
5194
+ if (valueRef.current) {
5195
+ if (multiple) {
5196
+ Array.from(valueRef.current.children).map(function (opt, k) {
5197
+ return opt.selected = selectedOpt.indexOf(k) !== -1;
5198
+ });
5199
+ } else if (options[selectedOpt]) {
5200
+ valueRef.current.value = options[selectedOpt].value;
5201
+ }
5202
+ }
5203
+
4730
5204
  valueRef.current.dispatchEvent(new Event('blur'));
4731
5205
  }, [selectedOpt]);
4732
5206
  var useIcon = false;
@@ -4738,7 +5212,9 @@ var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref4, ref) {
4738
5212
  });
4739
5213
  }
4740
5214
 
4741
- return /*#__PURE__*/React.createElement(Frag$2, null, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
5215
+ return /*#__PURE__*/React.createElement(Frag$2, {
5216
+ fullWidth: !props.size
5217
+ }, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
4742
5218
  htmlFor: name
4743
5219
  }, label, " ", tooltip && /*#__PURE__*/React.createElement(App, {
4744
5220
  text: tooltip
@@ -4816,27 +5292,38 @@ var HandleState = function HandleState(index, setSelected, selectedOpt, multiple
4816
5292
  }
4817
5293
  }
4818
5294
 
4819
- if (!multiple && ret.toString() === selectedOpt.toString()) return;
5295
+ if (!multiple && ret.toString() === selectedOpt.toString()) {
5296
+ return;
5297
+ }
5298
+
4820
5299
  var stateMap = options.filter(function (opt, index) {
4821
5300
  return ret.indexOf(index) !== -1;
4822
5301
  }).map(function (opt) {
4823
5302
  return opt.value;
4824
5303
  });
4825
- if (typeof onChange === 'function') onChange(multiple ? stateMap : stateMap[0]);
5304
+
5305
+ if (typeof onChange === 'function') {
5306
+ onChange(multiple ? stateMap : stateMap[0]);
5307
+ }
5308
+
4826
5309
  setSelected(ret);
4827
5310
  };
4828
5311
 
4829
- var SelectOption = function SelectOption(_ref5) {
4830
- var options = _ref5.options,
4831
- setSelected = _ref5.setSelected,
4832
- selectedOpt = _ref5.selectedOpt,
4833
- multiple = _ref5.multiple,
4834
- type = _ref5.type,
4835
- onChange = _ref5.onChange,
4836
- noOptions = _ref5.noOptions,
4837
- visibleOptionsQty = _ref5.visibleOptionsQty,
4838
- openTo = _ref5.openTo;
4839
- if (!options) return /*#__PURE__*/React.createElement(OptionsPeople, null, /*#__PURE__*/React.createElement("li", null, noOptions ? noOptions : 'No data found'));
5312
+ var SelectOption = function SelectOption(_ref13) {
5313
+ var options = _ref13.options,
5314
+ setSelected = _ref13.setSelected,
5315
+ selectedOpt = _ref13.selectedOpt,
5316
+ multiple = _ref13.multiple,
5317
+ type = _ref13.type,
5318
+ onChange = _ref13.onChange,
5319
+ noOptions = _ref13.noOptions,
5320
+ visibleOptionsQty = _ref13.visibleOptionsQty,
5321
+ openTo = _ref13.openTo;
5322
+
5323
+ if (!options) {
5324
+ return /*#__PURE__*/React.createElement(OptionsPeople, null, /*#__PURE__*/React.createElement("li", null, noOptions || 'No data found'));
5325
+ }
5326
+
4840
5327
  return /*#__PURE__*/React.createElement(OptionsPeople, {
4841
5328
  visibleOptionsQty: visibleOptionsQty,
4842
5329
  openTo: openTo
@@ -4866,9 +5353,9 @@ var SelectOption = function SelectOption(_ref5) {
4866
5353
  }));
4867
5354
  };
4868
5355
 
4869
- var PhotoComponent = function PhotoComponent(_ref6) {
4870
- var profile = _ref6.profile,
4871
- index = _ref6.index;
5356
+ var PhotoComponent = function PhotoComponent(_ref14) {
5357
+ var profile = _ref14.profile,
5358
+ index = _ref14.index;
4872
5359
  var customStyle = {
4873
5360
  position: 'relative',
4874
5361
  display: 'inline-flex',
@@ -4892,18 +5379,18 @@ var PhotoComponent = function PhotoComponent(_ref6) {
4892
5379
  }));
4893
5380
  };
4894
5381
 
4895
- var SelectValueRender = function SelectValueRender(_ref7) {
4896
- var options = _ref7.options,
4897
- selectedOpt = _ref7.selectedOpt,
4898
- type = _ref7.type,
4899
- noOptions = _ref7.noOptions;
5382
+ var SelectValueRender = function SelectValueRender(_ref15) {
5383
+ var options = _ref15.options,
5384
+ selectedOpt = _ref15.selectedOpt,
5385
+ type = _ref15.type,
5386
+ noOptions = _ref15.noOptions;
4900
5387
 
4901
5388
  if (!options) {
4902
5389
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
4903
5390
  style: {
4904
5391
  display: 'flex'
4905
5392
  }
4906
- }), /*#__PURE__*/React.createElement(Value$1, null, noOptions ? noOptions : 'No Data'));
5393
+ }), /*#__PURE__*/React.createElement(Value$1, null, noOptions || 'No Data'));
4907
5394
  }
4908
5395
 
4909
5396
  var Pictures = [];
@@ -5032,7 +5519,7 @@ function _templateObject8$2() {
5032
5519
  }
5033
5520
 
5034
5521
  function _templateObject7$2() {
5035
- var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:Circe-Rounded;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
5522
+ var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:\"Huninn\", sans-serif;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
5036
5523
 
5037
5524
  _templateObject7$2 = function _templateObject7() {
5038
5525
  return data;
@@ -5052,7 +5539,7 @@ function _templateObject6$2() {
5052
5539
  }
5053
5540
 
5054
5541
  function _templateObject5$2() {
5055
- var data = taggedTemplateLiteral(["\n font-family:circe-rounded;\n font-weight:normal;\n font-size:16px;\n color: #707070;\n\n >.requiredField {\n color:", ";\n }\n"]);
5542
+ var data = taggedTemplateLiteral(["\n font-family:\"Huninn\", sans-serif;\n font-weight:normal;\n font-size:16px;\n color: #707070;\n\n >.requiredField {\n color:", ";\n }\n"]);
5056
5543
 
5057
5544
  _templateObject5$2 = function _templateObject5() {
5058
5545
  return data;
@@ -5347,7 +5834,7 @@ function _templateObject7$3() {
5347
5834
  }
5348
5835
 
5349
5836
  function _templateObject6$3() {
5350
- var data = taggedTemplateLiteral(["\n list-style:none;\n padding:0 5px 3px;\n margin:0;\n display:flex;\n max-width: 300px;\n flex-wrap: wrap;\n\n &.small {\n max-width:140px;\n\n >li:not(.input) {\n white-space: pre-wrap;\n }\n }\n\n >li:not(.input) {\n border:1px solid #7C98B6;\n color:#516F90;\n background:#EAF0F6;\n padding:5px;\n margin-right:5px;\n border-radius:2px;\n font-size:12px;\n font-weight:500;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n white-space: nowrap;\n\n\n >svg {\n padding-left:8px;\n padding-right:3px;\n }\n\n }\n\n >li {\n margin-top:5px;\n input {\n display: inline-block;\n height: 30px;\n width:100%;\n min-width:80px;\n color:#333;\n font-size:14px;\n\n &::placeholder {\n color:#ccc;\n }\n }\n\n &.input {\n flex:1;\n }\n\n\n }\n"]);
5837
+ var data = taggedTemplateLiteral(["\n list-style:none;\n padding:0 5px 3px;\n margin:0;\n display:flex;\n max-width: 300px;\n flex-wrap: wrap;\n\n &.small {\n max-width:140px;\n\n >li:not(.input) {\n white-space: pre-wrap;\n }\n }\n\n >li:not(.input) {\n border:1px solid #7C98B6;\n color:#516F90;\n background:#EAF0F6;\n padding:5px;\n margin-right:5px;\n border-radius:", ";\n font-size:12px;\n font-weight:500;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n white-space: nowrap;\n\n\n >svg {\n padding-left:8px;\n padding-right:3px;\n }\n\n }\n\n >li {\n margin-top:5px;\n input {\n display: inline-block;\n height: 30px;\n width:100%;\n min-width:80px;\n color:#333;\n font-size:14px;\n\n &::placeholder {\n color:#ccc;\n }\n }\n\n &.input {\n flex:1;\n }\n\n\n }\n"]);
5351
5838
 
5352
5839
  _templateObject6$3 = function _templateObject6() {
5353
5840
  return data;
@@ -5357,7 +5844,7 @@ function _templateObject6$3() {
5357
5844
  }
5358
5845
 
5359
5846
  function _templateObject5$3() {
5360
- var data = taggedTemplateLiteral(["\n padding:0;\n margin:4px 0;\n background:white;\n border:1px solid ", ";\n box-shadow:0 0 6px ", ";\n border-radius:2px;\n list-style:none;\n width:auto;\n display:inline-block;\n position: absolute;\n top: 100%;\n ", "\n left: -1px;\n z-index:10;\n max-height: ", "px;\n overflow-x:hidden;\n overflow-y:scroll;\n\n li {\n font-size:", ";\n color:#707070;\n min-height:32px;\n cursor:pointer;\n padding: 8px;\n position:relative;\n box-sizing: border-box;\n\n >ul {\n display:none;\n }\n\n &.active,\n &:hover {\n background:", ";\n\n >ul {\n display:inline-block;\n }\n }\n\n }\n"]);
5847
+ var data = taggedTemplateLiteral(["\n padding:0;\n margin:4px 0;\n background:white;\n border:1px solid ", ";\n box-shadow:0 0 6px ", ";\n border-radius:", ";\n list-style:none;\n width:auto;\n display:inline-block;\n position: absolute;\n top: 100%;\n ", "\n left: -1px;\n z-index:10;\n max-height: ", "px;\n overflow-x:hidden;\n overflow-y:scroll;\n\n li {\n font-size:", ";\n color:#707070;\n min-height:32px;\n cursor:pointer;\n padding: 8px;\n position:relative;\n box-sizing: border-box;\n\n >ul {\n display:none;\n }\n\n &.active,\n &:hover {\n background:", ";\n\n >ul {\n display:inline-block;\n }\n }\n\n }\n"]);
5361
5848
 
5362
5849
  _templateObject5$3 = function _templateObject5() {
5363
5850
  return data;
@@ -5387,7 +5874,7 @@ function _templateObject3$5() {
5387
5874
  }
5388
5875
 
5389
5876
  function _templateObject2$5() {
5390
- var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:Circe-Rounded;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
5877
+ var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:\"Huninn\", sans-serif;\n display:block;\n color:#516F90;\n margin-top:4px;\n"]);
5391
5878
 
5392
5879
  _templateObject2$5 = function _templateObject2() {
5393
5880
  return data;
@@ -5411,12 +5898,12 @@ var SpanError$4 = styled(Span$3)(_templateObject3$5(), theme.colors.error.text);
5411
5898
  var Select = styled(InputBase)(_templateObject4$5(), theme.colors.neutrals.white, theme.colors.action, theme.colors.secondary, theme.colors.error.border);
5412
5899
  var maxOptions$1 = 5;
5413
5900
  var optionsSize$1 = 32;
5414
- var Options$2 = styled.ul(_templateObject5$3(), theme.colors.neutrals.silver, theme.colors.neutrals.silver, function (props) {
5901
+ var Options$2 = styled.ul(_templateObject5$3(), theme.colors.neutrals.silver, theme.colors.neutrals.silver, theme.defaultRadius, function (props) {
5415
5902
  return props.openTo === 'top' && "\n top:unset;\n bottom:100%;\n ";
5416
5903
  }, function (props) {
5417
5904
  return props.visibleOptionsQty ? props.visibleOptionsQty * optionsSize$1 : maxOptions$1 * optionsSize$1;
5418
5905
  }, theme.font.small.size, theme.colors.info.bg);
5419
- var TagsValues = styled.ul(_templateObject6$3());
5906
+ var TagsValues = styled.ul(_templateObject6$3(), theme.defaultRadius);
5420
5907
  var SelectHidden$1 = styled.select(_templateObject7$3());
5421
5908
  var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
5422
5909
  var _ref$name = _ref.name,
@@ -5846,7 +6333,7 @@ function _templateObject5$4() {
5846
6333
  }
5847
6334
 
5848
6335
  function _templateObject4$6() {
5849
- var data = taggedTemplateLiteral(["\n background:#fff;\n border-radius:2px;\n padding:5px;\n list-style:none;\n margin:0;\n display: grid;\n grid-template-columns: 24px 24px 24px 24px 24px 24px 24px 24px;\n position:absolute;\n left:48px;\n top:0;\n box-shadow: 0px 3px 6px ", "19;\n\n > li {\n width:24px;\n height:24px;\n cursor:pointer;\n position: relative;\n\n &.selected {\n z-index: 1;\n box-shadow: 0 0 0 2px ", ";\n border-radius: ", ";\n }\n\n &:hover {\n z-index: 2;\n box-shadow: 0 0 0 2px ", ";\n border-radius: ", ";\n }\n }\n"]);
6336
+ var data = taggedTemplateLiteral(["\n background:#fff;\n border-radius:", ";\n padding:5px;\n list-style:none;\n margin:0;\n display: grid;\n grid-template-columns: 24px 24px 24px 24px 24px 24px 24px 24px;\n position:absolute;\n left:48px;\n top:0;\n box-shadow: 0px 3px 6px ", "19;\n\n > li {\n width:24px;\n height:24px;\n cursor:pointer;\n position: relative;\n\n &.selected {\n z-index: 1;\n box-shadow: 0 0 0 2px ", ";\n border-radius: ", ";\n }\n\n &:hover {\n z-index: 2;\n box-shadow: 0 0 0 2px ", ";\n border-radius: ", ";\n }\n }\n"]);
5850
6337
 
5851
6338
  _templateObject4$6 = function _templateObject4() {
5852
6339
  return data;
@@ -5889,7 +6376,7 @@ var Field = styled.div(_templateObject2$6());
5889
6376
  var WraperBucket = styled.div(_templateObject3$6(), function (props) {
5890
6377
  return props.background ? props.background : theme.colors.info.shadow;
5891
6378
  }, theme.colors.action, theme.colors.secondary);
5892
- var ColorBox = styled.ul(_templateObject4$6(), theme.colors.neutrals.gray, theme.colors.secondary, theme.defaultRadius, theme.colors.neutrals.gray, theme.defaultRadius);
6379
+ var ColorBox = styled.ul(_templateObject4$6(), theme.defaultRadius, theme.colors.neutrals.gray, theme.colors.secondary, theme.defaultRadius, theme.colors.neutrals.gray, theme.defaultRadius);
5893
6380
  var SelectHidden$2 = styled.select(_templateObject5$4());
5894
6381
  var InputColor = /*#__PURE__*/forwardRef(function (_ref, ref) {
5895
6382
  var name = _ref.name,
@@ -6769,7 +7256,7 @@ function _templateObject2$7() {
6769
7256
  }
6770
7257
 
6771
7258
  function _templateObject$b() {
6772
- var data = taggedTemplateLiteral(["\n font-family:circe-rounded;\n font-weight:bold;\n border-radius:", ";\n cursor:pointer;\n display:inline-block;\n background:", "\n color:", "\n height:40px;\n line-height:40px;\n padding:0 16px;\n font-size: ", ";\n\n > * {\n border-color: ", ";\n }\n\n svg path {\n fill: ", ";\n }\n\n &:hover,\n &.hover {\n background:", ";\n }\n\n &:focus,\n &.focus {\n background:", ";\n box-shadow:", ";\n }\n\n &:active,\n &.active {\n background:", ";\n box-shadow:", ";\n }\n\n &.selected {\n border: 1px solid ", ";\n }\n\n &[disabled] {\n opacity: .5;\n cursor: not-allowed;\n }\n"]);
7259
+ var data = taggedTemplateLiteral(["\n font-family: ", ";\n font-weight:bold;\n border-radius:", ";\n cursor:pointer;\n display:inline-flex;\n background:", "\n color:", "\n height:40px;\n line-height:40px;\n padding:0 16px;\n font-size: ", ";\n align-items: center;\n gap: 4px;\n white-space: nowrap;\n justify-content: center;\n text-align: center;\n\n > * {\n border-color: ", ";\n }\n\n svg path {\n fill: currentColor;\n }\n\n &:hover,\n &.hover {\n background:", ";\n }\n\n &:focus,\n &.focus {\n background:", ";\n box-shadow:", ";\n }\n\n &:active,\n &.active {\n background:", ";\n box-shadow:", ";\n }\n\n &.selected {\n outline: 1px solid ", ";\n position: relative;\n z-index: 1;\n }\n\n &[disabled] {\n opacity: .5;\n cursor: not-allowed;\n }\n"]);
6773
7260
 
6774
7261
  _templateObject$b = function _templateObject() {
6775
7262
  return data;
@@ -6782,7 +7269,7 @@ var defaultShadow = function defaultShadow(color) {
6782
7269
  return "0px 0px 6px ".concat(color);
6783
7270
  };
6784
7271
 
6785
- var Base = styled.button(_templateObject$b(), theme.defaultRadius, theme.colors.info.bg, theme.colors.secondary, theme.font.medium.size, theme.colors.info.shadow, theme.colors.secondary, theme.colors.info.shadow, theme.colors.info.bg, defaultShadow(theme.form.button.secondary.bg), theme.colors.info.shadow, defaultShadow(theme.form.button.secondary.bg), theme.form.button.secondary.bg);
7272
+ var Base = styled.button(_templateObject$b(), theme.font.main, theme.defaultRadius, theme.colors.info.bg, theme.colors.secondary, theme.font.medium.size, theme.colors.info.shadow, theme.colors.info.shadow, theme.colors.info.bg, defaultShadow(theme.form.button.secondary.bg), theme.colors.info.shadow, defaultShadow(theme.form.button.secondary.bg), theme.colors.secondary);
6786
7273
  var Primary = "\n background:".concat(theme.form.button.primary.bg, ";\n color:").concat(theme.colors.neutrals.white, ";\n\n > * {\n border-color: ").concat(theme.colors.neutrals.white, ";\n }\n\n svg path {\n fill: ").concat(theme.colors.neutrals.white, ";\n }\n\n &:hover,\n &.hover {\n background:").concat(theme.form.button.primary.hover, "\n }\n\n &:focus,\n &.focus {\n background:").concat(theme.form.button.primary.bg, ";\n box-shadow:").concat(defaultShadow(theme.form.button.primary.bg), ";\n }\n\n &:active,\n &.active {\n background:").concat(theme.form.button.primary.hover, "\n box-shadow:").concat(defaultShadow(theme.form.button.primary.bg), ";\n }\n\n &.selected {\n border: 1px solid ").concat(theme.colors.neutrals.white, ";\n }\n");
6787
7274
  var Secondary = "\n background:".concat(theme.form.button.secondary.bg, ";\n color:").concat(theme.colors.neutrals.white, ";\n\n > * {\n border-color: ").concat(theme.colors.neutrals.white, ";\n }\n\n svg path {\n fill: ").concat(theme.colors.neutrals.white, ";\n }\n\n &:hover {\n background:").concat(theme.form.button.secondary.hover, "\n }\n\n &:focus {\n background:").concat(theme.form.button.secondary.bg, ";\n box-shadow:").concat(defaultShadow(theme.form.button.secondary.bg), ";\n }\n\n &:active,\n &.active {\n background:").concat(theme.form.button.secondary.hover, "\n box-shadow:").concat(defaultShadow(theme.form.button.secondary.bg), ";\n }\n\n &.selected {\n border: 1px solid ").concat(theme.colors.neutrals.white, ";\n }\n");
6788
7275
  var Cancel = "\n background:transparent;\n color:".concat(theme.form.button.secondary.bg, ";\n\n > * {\n border-color: ").concat(theme.colors.info.shadow, ";\n }\n\n svg path {\n fill: ").concat(theme.colors.secondary, ";\n }\n\n &:hover {\n background:transparent;\n text-decoration:underline;\n }\n\n &:focus {\n background:").concat(theme.colors.neutrals.white, ";\n box-shadow:").concat(defaultShadow(theme.form.button.secondary.bg), ";\n }\n\n &:active,\n &.active {\n background:").concat(theme.colors.neutrals.white, ";\n box-shadow:").concat(defaultShadow(theme.form.button.secondary.bg), ";\n text-decoration:underline;\n }\n\n &.selected {\n border: 1px solid ").concat(theme.form.button.secondary.bg, ";\n }\n");
@@ -6811,7 +7298,7 @@ var Exported = function Exported(_ref) {
6811
7298
  props = objectWithoutProperties(_ref, ["size", "type", "children", "Type"]);
6812
7299
 
6813
7300
  return /*#__PURE__*/React.createElement(Exportedd, _extends_1({
6814
- type: Type ? Type : type === 'cancel' ? 'button' : undefined,
7301
+ type: Type || (type === 'cancel' ? 'button' : undefined),
6815
7302
  size: size,
6816
7303
  typeStyle: type,
6817
7304
  children: children
@@ -7260,7 +7747,7 @@ var DropUploader = /*#__PURE__*/forwardRef(function (_ref3, ref) {
7260
7747
  });
7261
7748
 
7262
7749
  function _templateObject5$6() {
7263
- var data = taggedTemplateLiteral(["\n display: inline-block;\n color: ", ";\n font-size: ", ";\n vertical-align: top;\n margin-left: 8px;\n outline: none;\n"]);
7750
+ var data = taggedTemplateLiteral(["\n display: inline-block;\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n font-family: \"Huninn\", sans-serif;\n vertical-align: top;\n padding-left: 8px;\n outline: none;\n cursor: pointer;\n"]);
7264
7751
 
7265
7752
  _templateObject5$6 = function _templateObject5() {
7266
7753
  return data;
@@ -7270,7 +7757,7 @@ function _templateObject5$6() {
7270
7757
  }
7271
7758
 
7272
7759
  function _templateObject4$8() {
7273
- var data = taggedTemplateLiteral(["\n width: 0;\n height: 0;\n margin: 0;\n visibility: hidden;\n pointer-events: none;\n\n &:checked + ", " {\n background: ", ";\n border: 1px solid ", ";\n\n &::after {\n background:", ";\n margin-left: 20px;\n }\n }\n"]);
7760
+ var data = taggedTemplateLiteral(["\n width: 0;\n height: 0;\n margin: 0;\n visibility: hidden;\n pointer-events: none;\n\n &:checked + ", " {\n background: ", ";\n border: 1px solid ", ";\n\n &::after {\n background:", ";\n margin-left: 19px;\n }\n }\n"]);
7274
7761
 
7275
7762
  _templateObject4$8 = function _templateObject4() {
7276
7763
  return data;
@@ -7280,7 +7767,7 @@ function _templateObject4$8() {
7280
7767
  }
7281
7768
 
7282
7769
  function _templateObject3$8() {
7283
- var data = taggedTemplateLiteral(["\n width: 36px;\n height: 20px;\n border-radius: 100px;\n background: ", ";\n cursor: pointer;\n border: 1px solid ", ";\n box-sizing: border-box;\n\n &:focus {\n box-shadow: 0px 0px 6px ", ";\n border: 1px solid ", ";\n outline: none;\n }\n\n &::after {\n content: \"\";\n display: block;\n border-radius: 100%;\n width: 12px;\n height: 12px;\n margin: 3px;\n background: #ccc;\n transition: 0.2s;\n }\n"]);
7770
+ var data = taggedTemplateLiteral(["\n width: 36px;\n height: 20px;\n border-radius: 100px;\n background: ", ";\n cursor: pointer;\n border: 1px solid ", ";\n box-sizing: border-box;\n transition: 0.2s;\n\n &:focus {\n box-shadow: 0px 0px 6px ", ";\n border: 1px solid ", ";\n outline: none;\n }\n\n &::after {\n content: \"\";\n display: block;\n border-radius: 100%;\n width: 12px;\n height: 12px;\n margin: 3px;\n background: ", ";\n transition: 0.2s;\n }\n"]);
7284
7771
 
7285
7772
  _templateObject3$8 = function _templateObject3() {
7286
7773
  return data;
@@ -7310,9 +7797,9 @@ function _templateObject$d() {
7310
7797
  }
7311
7798
  var Frag$6 = styled.div(_templateObject$d());
7312
7799
  var CheckBoxWrapper = styled.div(_templateObject2$9());
7313
- var CheckBoxLabel = styled.label(_templateObject3$8(), theme.colors.neutrals.white, theme.colors.neutrals.silver, theme.colors.action, theme.colors.secondary);
7314
- var CheckBox$1 = styled.input(_templateObject4$8(), CheckBoxLabel, theme.colors.info.bg, theme.colors.info.border, theme.colors.info.text);
7315
- var ToggleLabel = styled.label(_templateObject5$6(), theme.colors.neutrals.medium, theme.font.small.size);
7800
+ var CheckBoxLabel = styled.label(_templateObject3$8(), theme.colors.neutrals.white, theme.colors.info.border, theme.colors.action, theme.colors.secondary, theme.colors.info.border);
7801
+ var CheckBox$1 = styled.input(_templateObject4$8(), CheckBoxLabel, theme.colors.info.text, theme.colors.info.border, theme.colors.neutrals.white);
7802
+ var ToggleLabel = styled.label(_templateObject5$6(), theme.colors.neutrals.medium, theme.font.medium.size, theme.font.medium.lineHeight);
7316
7803
  var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
7317
7804
  var name = _ref.name,
7318
7805
  label = _ref.label,
@@ -7370,7 +7857,7 @@ var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
7370
7857
  }), /*#__PURE__*/React.createElement(ToggleLabel, {
7371
7858
  htmlFor: id,
7372
7859
  tabIndex: -1
7373
- }, singleText ? singleText : value ? textOn : textOff)), help && /*#__PURE__*/React.createElement(SpanHelp, null, help));
7860
+ }, singleText || (value ? textOn : textOff))), help && /*#__PURE__*/React.createElement(SpanHelp, null, help));
7374
7861
  });
7375
7862
 
7376
7863
  function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
@@ -7896,7 +8383,7 @@ function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if
7896
8383
  function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7897
8384
 
7898
8385
  function _templateObject$g() {
7899
- var data = taggedTemplateLiteral(["\n display: inline-flex;\n flex-wrap: nowrap;\n\n > * {\n &:first-child:not(:last-child) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n &:last-child:not(:first-child) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n }\n"]);
8386
+ var data = taggedTemplateLiteral(["\n display: inline-flex;\n flex-wrap: nowrap;\n border: 1px solid ", ";\n border-radius: ", ";\n\n > *:not(.selected) {\n border-radius: 0;\n\n &:first-child {\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n }\n\n &:last-child {\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n }\n }\n"]);
7900
8387
 
7901
8388
  _templateObject$g = function _templateObject() {
7902
8389
  return data;
@@ -7904,7 +8391,7 @@ function _templateObject$g() {
7904
8391
 
7905
8392
  return data;
7906
8393
  }
7907
- var BtnGroup = styled.div(_templateObject$g());
8394
+ var BtnGroup = styled.div(_templateObject$g(), theme.colors.neutrals.silver, theme.defaultRadius, theme.defaultRadius, theme.defaultRadius, theme.defaultRadius, theme.defaultRadius);
7908
8395
 
7909
8396
  var ButtonGroup = function ButtonGroup(_ref) {
7910
8397
  var children = _ref.children,
@@ -7913,7 +8400,11 @@ var ButtonGroup = function ButtonGroup(_ref) {
7913
8400
  var generateClassName = function generateClassName(btnProps) {
7914
8401
  var cn = btnProps.className || '';
7915
8402
  var track = btnProps.track;
7916
- if (props.active === track) cn += ' selected ';
8403
+
8404
+ if (props.active === track) {
8405
+ cn += ' selected ';
8406
+ }
8407
+
7917
8408
  return cn;
7918
8409
  };
7919
8410
 
@@ -8244,7 +8735,11 @@ var Close = styled.button.attrs(function (props) {
8244
8735
 
8245
8736
  var solveContent = function solveContent(size, title, content) {
8246
8737
  var isSmall = size === 'small';
8247
- if (isSmall) return /*#__PURE__*/React.createElement(Title$2, null, /*#__PURE__*/React.createElement(SmallContent, null, title));
8738
+
8739
+ if (isSmall) {
8740
+ return /*#__PURE__*/React.createElement(Title$2, null, /*#__PURE__*/React.createElement(SmallContent, null, title));
8741
+ }
8742
+
8248
8743
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Title$2, null, title), /*#__PURE__*/React.createElement(Content, null, content));
8249
8744
  };
8250
8745