@mw-kit/mw-ui 1.7.57 → 1.7.59

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,2 +1,4 @@
1
- declare const Input: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {}, never>;
1
+ declare const Input: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
2
+ $activeBullet: boolean;
3
+ }, never>;
2
4
  export default Input;
package/dist/index.js CHANGED
@@ -62,6 +62,7 @@ var colors = {
62
62
  darkGrey: '#949494',
63
63
  darkSilver: '#525A6A',
64
64
  floralWhite: '#FFFAF3',
65
+ ghostWhite: '#F9FAFB',
65
66
  green: '#76B100',
66
67
  grey: '#ADADAD',
67
68
  greyishBlue: '#263046',
@@ -73,6 +74,7 @@ var colors = {
73
74
  milkWhite: '#FCFFF5',
74
75
  orange: '#FB8702',
75
76
  pink: '#E23851',
77
+ platinum: '#E2E2E3',
76
78
  purple: '#8E66BB',
77
79
  red: '#C31717',
78
80
  silver: '#B2B2B2',
@@ -200,20 +202,9 @@ var keys = function keys(value) {
200
202
  var notEmptyString = function notEmptyString(value) {
201
203
  return typeof value === 'string' && value.trim() !== '';
202
204
  };
203
- var isNumber = function isNumber(value) {
204
- return typeof value === 'number' && isFinite(value);
205
- };
206
- var isNumeric = function isNumeric(value) {
207
- if (isNumber(value)) return true;
208
- if (!isString(value)) return false;
209
- return !isNaN(parseFloat(value));
210
- };
211
205
  var isBoolean = function isBoolean(value) {
212
206
  return typeof value === 'boolean';
213
207
  };
214
- var isNumericString = function isNumericString(value) {
215
- return notEmptyString(value) && isNumeric(value);
216
- };
217
208
  var isString = function isString(value) {
218
209
  return typeof value === 'string';
219
210
  };
@@ -335,11 +326,6 @@ var filterObject = function filterObject(object, remove, inital) {
335
326
  }, inital);
336
327
  return r;
337
328
  };
338
- var numberOrDefault = function numberOrDefault(value, defaultValue) {
339
- if (isNumber(value)) return value;
340
- if (isNumericString(value)) return parseFloat(value);
341
- return defaultValue;
342
- };
343
329
  var isoStringToDate = function isoStringToDate(value) {
344
330
  var _value$split = value.split(' '),
345
331
  d = _value$split[0],
@@ -13745,8 +13731,8 @@ var getTimeProps = function getTimeProps(time, value) {
13745
13731
  });
13746
13732
  };
13747
13733
 
13748
- 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;
13749
- 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) {
13734
+ var _templateObject$e, _templateObject2$c, _templateObject3$b, _templateObject4$9, _templateObject5$8, _templateObject6$7, _templateObject7$7, _templateObject8$6, _templateObject9$6, _templateObject10$6;
13735
+ 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 opacity: 0.5;\n pointer-events: none;\n }\n\n :hover {\n cursor: ", ";\n\n ", "\n }\n\n :active {\n ", ";\n }\n\n ", "\n"])), function (_ref) {
13750
13736
  var theme = _ref.theme,
13751
13737
  appearance = _ref.appearance;
13752
13738
  return appearance === 'link' ? 0 : theme.spacings.s3;
@@ -13782,49 +13768,39 @@ var Button = styled__default.button(_templateObject$e || (_templateObject$e = _t
13782
13768
 
13783
13769
  return theme.getColor('white');
13784
13770
  }, function (_ref6) {
13785
- var appearance = _ref6.appearance,
13786
- loading = _ref6.loading,
13787
- theme = _ref6.theme;
13771
+ var loading = _ref6.loading,
13772
+ disabled = _ref6.disabled;
13773
+ return loading || disabled ? 'default' : 'pointer';
13774
+ }, function (_ref7) {
13775
+ var appearance = _ref7.appearance,
13776
+ color = _ref7.color,
13777
+ theme = _ref7.theme;
13788
13778
 
13789
- if (['bordered', 'link', 'borderless'].includes(appearance)) {
13790
- return styled.css(_templateObject4$9 || (_templateObject4$9 = _taggedTemplateLiteralLoose(["\n opacity: 0.3;\n pointer-events: none;\n "])));
13779
+ if (appearance === 'bordered') {
13780
+ return styled.css(_templateObject4$9 || (_templateObject4$9 = _taggedTemplateLiteralLoose(["\n color: ", ";\n border: 1px solid ", ";\n "])), theme.getColor(color || 'blue', 70), theme.getColor(color || 'blue', 70));
13781
+ } else if (['link', 'borderless'].includes(appearance)) {
13782
+ return styled.css(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.colors.blue);
13791
13783
  }
13792
13784
 
13793
- return styled.css(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n pointer-events: none;\n "])), theme.getColor('greyishBlue', 10), theme.getColor('greyishBlue', 10), loading ? 'transparent' : theme.getColor('greyishBlue', 30));
13794
- }, function (_ref7) {
13795
- var loading = _ref7.loading,
13796
- disabled = _ref7.disabled;
13797
- return loading || disabled ? 'default' : 'pointer';
13785
+ return styled.css(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n border-color: ", ";\n "])), theme.getColor(color || 'blue', 70), theme.getColor(color || 'blue', 70));
13798
13786
  }, function (_ref8) {
13799
13787
  var appearance = _ref8.appearance,
13800
13788
  color = _ref8.color,
13801
13789
  theme = _ref8.theme;
13802
13790
 
13803
13791
  if (appearance === 'bordered') {
13804
- return styled.css(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteralLoose(["\n color: ", ";\n border: 1px solid ", ";\n "])), theme.getColor(color || 'blue', 70), theme.getColor(color || 'blue', 70));
13805
- } else if (['link', 'borderless'].includes(appearance)) {
13806
- return styled.css(_templateObject7$7 || (_templateObject7$7 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.colors.blue);
13807
- }
13808
-
13809
- return styled.css(_templateObject8$6 || (_templateObject8$6 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n border-color: ", ";\n "])), theme.getColor(color || 'blue', 70), theme.getColor(color || 'blue', 70));
13810
- }, function (_ref9) {
13811
- var appearance = _ref9.appearance,
13812
- color = _ref9.color,
13813
- theme = _ref9.theme;
13814
-
13815
- if (appearance === 'bordered') {
13816
- return styled.css(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), theme.getColor('iceWhite'));
13792
+ return styled.css(_templateObject7$7 || (_templateObject7$7 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), theme.getColor('iceWhite'));
13817
13793
  }
13818
13794
 
13819
13795
  if (['link', 'borderless'].includes(appearance)) {
13820
- return styled.css(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.getColor('blue', 50));
13796
+ return styled.css(_templateObject8$6 || (_templateObject8$6 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.getColor('blue', 50));
13821
13797
  }
13822
13798
 
13823
- return styled.css(_templateObject11$3 || (_templateObject11$3 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.getColor(color || 'blue'));
13824
- }, function (_ref10) {
13825
- var loading = _ref10.loading;
13799
+ return styled.css(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.getColor(color || 'blue'));
13800
+ }, function (_ref9) {
13801
+ var loading = _ref9.loading;
13826
13802
  if (!loading) return;
13827
- return styled.css(_templateObject12$2 || (_templateObject12$2 = _taggedTemplateLiteralLoose(["\n pointer-events: none;\n "])));
13803
+ return styled.css(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose(["\n pointer-events: none;\n "])));
13828
13804
  });
13829
13805
 
13830
13806
  var _excluded = ["children", "content"];
@@ -15640,11 +15616,10 @@ var bullet = styled.css(_templateObject$q || (_templateObject$q = _taggedTemplat
15640
15616
  }, function (_ref3) {
15641
15617
  var theme = _ref3.theme;
15642
15618
  return theme.getColor('black', 10);
15643
- }, function (props) {
15644
- var theme = props.theme;
15645
- var min = numberOrDefault(props.min, 0);
15646
- var value = numberOrDefault(props.value, 0);
15647
- return theme.colors[min > 0 || value > min ? 'blue' : 'white'];
15619
+ }, function (_ref4) {
15620
+ var theme = _ref4.theme,
15621
+ activeBullet = _ref4.$activeBullet;
15622
+ return theme.colors[activeBullet ? 'blue' : 'white'];
15648
15623
  });
15649
15624
  var Input$2 = styled__default.input(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteralLoose(["\n appearance: none;\n width: 100%;\n height: 10px;\n background-color: transparent;\n outline: none;\n position: relative;\n z-index: 3;\n margin: 0;\n\n :not(:disabled) {\n cursor: pointer;\n }\n\n /** firefox */\n ::-moz-range-thumb {\n ", "\n }\n /** ie */\n ::-ms-thumb {\n ", "\n }\n /** chrome */\n ::-webkit-slider-thumb {\n ", "\n }\n"])), bullet, bullet, bullet);
15650
15625
 
@@ -15887,6 +15862,7 @@ var Range = React__default.forwardRef(function (props, ref) {
15887
15862
  var value = typeof v === 'number' ? v : parseFloat(v);
15888
15863
  return value;
15889
15864
  };
15865
+ var currentValue = getValue(value);
15890
15866
 
15891
15867
  var _onChange = props.onChange || function (_event, value) {
15892
15868
  return setValue(value);
@@ -15961,15 +15937,17 @@ var Range = React__default.forwardRef(function (props, ref) {
15961
15937
  invalid: invalid ? 1 : 0
15962
15938
  }, markers.length > 0 && React__default.createElement(MarkersContainer, null, markers.map(function (marker, index) {
15963
15939
  var left = getMarkerLeft(markers.length, range, index, marker.value, min, strict);
15964
- var bullet = marker.value > value ? 1 : 0;
15940
+ var bullet = marker.value > currentValue ? 1 : 0;
15965
15941
  return React__default.createElement(Marker, {
15966
- key: marker.value,
15942
+ key: index,
15967
15943
  left: left,
15968
15944
  bullet: bullet
15969
15945
  }, marker.label);
15970
15946
  })), React__default.createElement("div", null, React__default.createElement(Input$2, Object.assign({
15971
15947
  ref: ref
15972
- }, inputProps)), React__default.createElement(NavBar, {
15948
+ }, inputProps, {
15949
+ "$activeBullet": (strict === true ? markers[value].value : value) !== 0
15950
+ })), React__default.createElement(NavBar, {
15973
15951
  position: position
15974
15952
  }, React__default.createElement("div", {
15975
15953
  style: {
@@ -15980,7 +15958,7 @@ var Range = React__default.forwardRef(function (props, ref) {
15980
15958
  icon: 'minus_circle',
15981
15959
  color: 'white',
15982
15960
  onClick: canDecrement ? decrement : undefined
15983
- }), getValue(value), React__default.createElement(Icon, {
15961
+ }), currentValue, React__default.createElement(Icon, {
15984
15962
  type: 'feather',
15985
15963
  icon: 'plus_circle',
15986
15964
  color: 'white',
@@ -16242,7 +16220,7 @@ var parse = function parse(value) {
16242
16220
  });
16243
16221
  };
16244
16222
 
16245
- var _templateObject$B, _templateObject2$t, _templateObject3$n, _templateObject4$e, _templateObject5$c, _templateObject6$b, _templateObject7$b, _templateObject8$8, _templateObject9$8, _templateObject10$7, _templateObject11$4, _templateObject12$3;
16223
+ var _templateObject$B, _templateObject2$t, _templateObject3$n, _templateObject4$e, _templateObject5$c, _templateObject6$b, _templateObject7$b, _templateObject8$8, _templateObject9$8, _templateObject10$7, _templateObject11$3, _templateObject12$2;
16246
16224
  var RelativeContainer$5 = styled__default.div(_templateObject$B || (_templateObject$B = _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"])));
16247
16225
  var LabelContainer$6 = styled__default.div(_templateObject2$t || (_templateObject2$t = _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) {
16248
16226
  var theme = _ref.theme;
@@ -16292,13 +16270,13 @@ var Button$4 = styled__default.button(_templateObject9$8 || (_templateObject9$8
16292
16270
  if (!onClick) return;
16293
16271
  return styled.css(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n :not(:disabled) {\n cursor: pointer;\n }\n "])));
16294
16272
  });
16295
- var LabelText$1 = styled__default.label(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n display: inline-block;\n margin-bottom: ", ";\n\n ", "\n"])), function (_ref12) {
16273
+ var LabelText$1 = styled__default.label(_templateObject11$3 || (_templateObject11$3 = _taggedTemplateLiteralLoose(["\n display: inline-block;\n margin-bottom: ", ";\n\n ", "\n"])), function (_ref12) {
16296
16274
  var theme = _ref12.theme;
16297
16275
  return theme.spacings.s1;
16298
16276
  }, function (_ref13) {
16299
16277
  var required = _ref13.required;
16300
16278
  if (!required) return;
16301
- return styled.css(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
16279
+ return styled.css(_templateObject12$2 || (_templateObject12$2 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
16302
16280
  });
16303
16281
 
16304
16282
  var Component$1 = React__default.forwardRef(function (props, ref) {
@@ -17787,7 +17765,7 @@ var useContext$2 = function useContext() {
17787
17765
  return React__default.useContext(Provider$2);
17788
17766
  };
17789
17767
 
17790
- var _templateObject$M, _templateObject2$z, _templateObject3$s, _templateObject4$h, _templateObject5$e, _templateObject6$d, _templateObject7$d, _templateObject8$a, _templateObject9$a, _templateObject10$9, _templateObject11$5, _templateObject12$4, _templateObject13$2, _templateObject14$2, _templateObject15$2;
17768
+ var _templateObject$M, _templateObject2$z, _templateObject3$s, _templateObject4$h, _templateObject5$e, _templateObject6$d, _templateObject7$d, _templateObject8$a, _templateObject9$a, _templateObject10$9, _templateObject11$4, _templateObject12$3, _templateObject13$2, _templateObject14$2, _templateObject15$2;
17791
17769
  var aligns = {
17792
17770
  self: {
17793
17771
  horizontal: {
@@ -17878,13 +17856,13 @@ var Col = styled__default.div(_templateObject$M || (_templateObject$M = _taggedT
17878
17856
  var bordered = _ref5.bordered,
17879
17857
  lightestGrey = _ref5.theme.colors.lightestGrey;
17880
17858
  if (!bordered) return;
17881
- return styled.css(_templateObject11$5 || (_templateObject11$5 = _taggedTemplateLiteralLoose(["\n :not(:last-child) {\n border-right: 1px solid ", ";\n }\n "])), lightestGrey);
17859
+ return styled.css(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n :not(:last-child) {\n border-right: 1px solid ", ";\n }\n "])), lightestGrey);
17882
17860
  }, function (_ref6) {
17883
17861
  var fontColor = _ref6.fontColor,
17884
17862
  theme = _ref6.theme;
17885
17863
  if (fontColor === undefined) return;
17886
17864
  var c = Array.isArray(fontColor) ? theme.getColor.apply(theme, fontColor) : theme.colors[fontColor];
17887
- return styled.css(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), c);
17865
+ return styled.css(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), c);
17888
17866
  }, function (_ref7) {
17889
17867
  var backgroundColor = _ref7.backgroundColor,
17890
17868
  theme = _ref7.theme;
@@ -18304,7 +18282,7 @@ var Modal$1 = Object.assign(Modal, {
18304
18282
  Audit: Audit
18305
18283
  });
18306
18284
 
18307
- var _templateObject$T, _templateObject2$D, _templateObject3$w, _templateObject4$k, _templateObject5$h, _templateObject6$g, _templateObject7$g, _templateObject8$d, _templateObject9$d, _templateObject10$c, _templateObject11$6;
18285
+ var _templateObject$T, _templateObject2$D, _templateObject3$w, _templateObject4$k, _templateObject5$h, _templateObject6$g, _templateObject7$g, _templateObject8$d, _templateObject9$d, _templateObject10$c, _templateObject11$5;
18308
18286
  var Container$c = styled__default.div(_templateObject$T || (_templateObject$T = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 300px;\n position: absolute;\n padding: 14px;\n"])));
18309
18287
  var Header$6 = styled__default.div(_templateObject2$D || (_templateObject2$D = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
18310
18288
  var HeaderImage = styled__default.div(_templateObject3$w || (_templateObject3$w = _taggedTemplateLiteralLoose(["\n width: 43px;\n height: 44px;\n background-color: #ebebeb;\n"])));
@@ -18321,7 +18299,7 @@ var HeaderLine = styled__default.div(_templateObject6$g || (_templateObject6$g =
18321
18299
  }, function (props) {
18322
18300
  return props.size === 'large' && styled.css(_templateObject10$c || (_templateObject10$c = _taggedTemplateLiteralLoose(["\n width: 75%;\n "])));
18323
18301
  });
18324
- var MainLine = styled__default(HeaderLine)(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n margin-bottom: 14px;\n margin-left: 0;\n"])));
18302
+ var MainLine = styled__default(HeaderLine)(_templateObject11$5 || (_templateObject11$5 = _taggedTemplateLiteralLoose(["\n margin-bottom: 14px;\n margin-left: 0;\n"])));
18325
18303
 
18326
18304
  var Template1 = function Template1(props) {
18327
18305
  if (!props.loading) return React__default.createElement(React__default.Fragment, null);
@@ -18706,7 +18684,7 @@ var Template8$1 = function Template8(props) {
18706
18684
  })), React__default.createElement(Main$4, null, React__default.createElement(Circle$2, null)));
18707
18685
  };
18708
18686
 
18709
- var _templateObject$11, _templateObject2$N, _templateObject3$G, _templateObject4$t, _templateObject5$q, _templateObject6$o, _templateObject7$o, _templateObject8$l, _templateObject9$j, _templateObject10$f, _templateObject11$7;
18687
+ var _templateObject$11, _templateObject2$N, _templateObject3$G, _templateObject4$t, _templateObject5$q, _templateObject6$o, _templateObject7$o, _templateObject8$l, _templateObject9$j, _templateObject10$f, _templateObject11$6;
18710
18688
  var Container$l = styled__default.div(_templateObject$11 || (_templateObject$11 = _taggedTemplateLiteralLoose(["\n width: 395px;\n height: 245px;\n display: flex;\n flex-direction: column;\n align-items: center;\n background: #f5f5f5 0% 0% no-repeat padding-box;\n"])));
18711
18689
  var Header$c = styled__default.div(_templateObject2$N || (_templateObject2$N = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding: 14px;\n width: 100%;\n"])));
18712
18690
  var HeaderLine$9 = styled__default.div(_templateObject3$G || (_templateObject3$G = _taggedTemplateLiteralLoose(["\n height: ", ";\n background-color: #ebebeb;\n margin-left: 7px;\n\n & + div {\n margin-top: 7px;\n }\n\n ", "\n ", "\n\n ", "\n\n ", "\n"])), function (props) {
@@ -18729,7 +18707,7 @@ var CustomLine$6 = styled__default(HeaderLine$9)(_templateObject8$l || (_templat
18729
18707
  });
18730
18708
  var GraphLine = styled__default(CustomLine$6)(_templateObject9$j || (_templateObject9$j = _taggedTemplateLiteralLoose(["\n margin: 0 7px;\n"])));
18731
18709
  var Main$5 = styled__default.div(_templateObject10$f || (_templateObject10$f = _taggedTemplateLiteralLoose(["\n flex: 1;\n padding: 0 7px 72px 7px;\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n justify-content: center;\n"])));
18732
- var Circle$3 = styled__default.div(_templateObject11$7 || (_templateObject11$7 = _taggedTemplateLiteralLoose(["\n width: 128px;\n height: 128px;\n background-color: #ebebeb;\n border-radius: 50%;\n"])));
18710
+ var Circle$3 = styled__default.div(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n width: 128px;\n height: 128px;\n background-color: #ebebeb;\n border-radius: 50%;\n"])));
18733
18711
 
18734
18712
  var Template10 = function Template10(props) {
18735
18713
  if (!props.loading) return React__default.createElement(React__default.Fragment, null);