@mw-kit/mw-ui 1.7.4 → 1.7.5

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.
@@ -15319,8 +15319,8 @@ var parse = function parse(value) {
15319
15319
  });
15320
15320
  };
15321
15321
 
15322
- var _templateObject$q, _templateObject2$l, _templateObject3$j, _templateObject4$g, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$7, _templateObject9$7, _templateObject10$5;
15323
- var RelativeContainer$5 = styled.div(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n position: relative;\n user-select: none;\n min-width: 220px;\n\n > :nth-child(1) input {\n color: transparent;\n }\n"])));
15322
+ var _templateObject$q, _templateObject2$l, _templateObject3$j, _templateObject4$g, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$7, _templateObject9$7, _templateObject10$5, _templateObject11$4;
15323
+ var RelativeContainer$5 = styled.div(_templateObject$q || (_templateObject$q = _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"])));
15324
15324
  var LabelContainer$3 = styled.div(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n ", "\n line-height: 17px;\n flex: 1;\n text-align: center;\n\n ", ";\n"])), function (_ref) {
15325
15325
  var theme = _ref.theme;
15326
15326
  return theme.useTypography('p');
@@ -15329,42 +15329,50 @@ var LabelContainer$3 = styled.div(_templateObject2$l || (_templateObject2$l = _t
15329
15329
  if (!onClick) return;
15330
15330
  return css(_templateObject3$j || (_templateObject3$j = _taggedTemplateLiteralLoose(["\n :not(:disabled) {\n cursor: pointer;\n }\n "])));
15331
15331
  });
15332
- var Container$a = styled.div(_templateObject4$g || (_templateObject4$g = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: 1px;\n left: 1px;\n display: flex;\n align-items: center;\n border-radius: 4px;\n white-space: nowrap;\n gap: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n\n width: 100%;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref3) {
15332
+ var Container$a = styled.div(_templateObject4$g || (_templateObject4$g = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n border-radius: 4px;\n white-space: nowrap;\n gap: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n\n width: 100%;\n\n ", ";\n\n ", "\n\n ", "\n"])), function (_ref3) {
15333
15333
  var theme = _ref3.theme;
15334
15334
  return theme.spacings.s1;
15335
15335
  }, function (_ref4) {
15336
15336
  var theme = _ref4.theme,
15337
- invalid = _ref4.invalid;
15337
+ invalid = _ref4.invalid,
15338
+ borderless = _ref4.borderless;
15339
+ if (borderless) return 'transparent';
15338
15340
  return invalid ? theme.colors.warningRed : theme.colors.lightGrey;
15339
15341
  }, function (_ref5) {
15340
15342
  var theme = _ref5.theme,
15341
- paddingless = _ref5.paddingless;
15342
- if (paddingless) return;
15343
- return css(_templateObject5$f || (_templateObject5$f = _taggedTemplateLiteralLoose(["\n padding: ", " ", " ", "\n ", ";\n "])), theme.spacings.s2, theme.spacings.s1, theme.spacings.s2, theme.spacings.s3);
15344
- }, function (_ref6) {
15345
- var invalid = _ref6.invalid,
15346
- theme = _ref6.theme;
15347
- if (!invalid) return;
15348
- return css(_templateObject6$d || (_templateObject6$d = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.colors.warningRed);
15343
+ invalid = _ref5.invalid;
15344
+
15345
+ var _ref6 = invalid ? [theme.getColor('warningRed', 5), theme.colors.warningRed] : [theme.colors.white, theme.colors.darkBlue],
15346
+ bgColor = _ref6[0],
15347
+ color = _ref6[1];
15348
+
15349
+ return css(_templateObject5$f || (_templateObject5$f = _taggedTemplateLiteralLoose(["\n color: ", ";\n background-color: ", ";\n /** google chrome blue background */\n -webkit-box-shadow: 0 0 0px 1000px ", " inset !important;\n "])), color, bgColor, bgColor);
15349
15350
  }, function (_ref7) {
15350
- var invalid = _ref7.invalid,
15351
- theme = _ref7.theme;
15352
- if (!invalid) return;
15353
- return css(_templateObject7$b || (_templateObject7$b = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.colors.warningRed);
15351
+ var theme = _ref7.theme,
15352
+ paddingless = _ref7.paddingless;
15353
+ if (paddingless) return;
15354
+ return css(_templateObject6$d || (_templateObject6$d = _taggedTemplateLiteralLoose(["\n padding: ", " ", " ", "\n ", ";\n "])), theme.spacings.s2, theme.spacings.s1, theme.spacings.s2, theme.spacings.s3);
15354
15355
  }, function (_ref8) {
15355
15356
  var disabled = _ref8.disabled;
15356
15357
  if (!disabled) return;
15357
- return css(_templateObject8$7 || (_templateObject8$7 = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n "])));
15358
+ return css(_templateObject7$b || (_templateObject7$b = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n "])));
15358
15359
  });
15359
- var Button$4 = styled.button(_templateObject9$7 || (_templateObject9$7 = _taggedTemplateLiteralLoose(["\n display: flex;\n background-color: transparent;\n border: none;\n padding: 0;\n box-shadow: none;\n\n ", ";\n"])), function (_ref9) {
15360
+ var Button$4 = styled.button(_templateObject8$7 || (_templateObject8$7 = _taggedTemplateLiteralLoose(["\n display: flex;\n background-color: transparent;\n border: none;\n padding: 0;\n box-shadow: none;\n\n ", ";\n"])), function (_ref9) {
15360
15361
  var onClick = _ref9.onClick;
15361
15362
  if (!onClick) return;
15362
- return css(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n :not(:disabled) {\n cursor: pointer;\n }\n "])));
15363
+ return css(_templateObject9$7 || (_templateObject9$7 = _taggedTemplateLiteralLoose(["\n :not(:disabled) {\n cursor: pointer;\n }\n "])));
15364
+ });
15365
+ var LabelText$1 = styled.label(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n display: inline-block;\n margin-bottom: ", ";\n\n ", "\n"])), function (_ref10) {
15366
+ var theme = _ref10.theme;
15367
+ return theme.spacings.s1;
15368
+ }, function (_ref11) {
15369
+ var required = _ref11.required;
15370
+ if (!required) return;
15371
+ return css(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
15363
15372
  });
15364
15373
 
15365
15374
  var Component$1 = React__default.forwardRef(function (props, ref) {
15366
15375
  var value = parse(props.value);
15367
- var disabled = props.disabled || props.loading;
15368
15376
 
15369
15377
  var _useState = useState(null),
15370
15378
  open = _useState[0],
@@ -15407,7 +15415,7 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
15407
15415
  var newIntervalType = identify(value);
15408
15416
  setIntervalType(newIntervalType);
15409
15417
  }, [props.value, props.min, props.max]);
15410
- var inputProps = filterObject(props, ['min', 'max']);
15418
+ var inputProps = filterObject(props, ['label', 'invalid', 'required', 'disabled', 'width', 'borderless', 'paddingless', 'type', 'value', 'setValue', 'getLabel', 'max', 'min', 'only']);
15411
15419
 
15412
15420
  var getArrowProps = function getArrowProps(key) {
15413
15421
  if (value.some(function (v) {
@@ -15444,7 +15452,7 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
15444
15452
  var invalid = props.invalid || !validate(value, min, max);
15445
15453
 
15446
15454
  var onClick = function () {
15447
- if (inputProps.disabled || !['custom', undefined].includes(props.only)) {
15455
+ if (props.disabled || !['custom', undefined].includes(props.only)) {
15448
15456
  return undefined;
15449
15457
  }
15450
15458
 
@@ -15456,23 +15464,23 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
15456
15464
  };
15457
15465
  }();
15458
15466
 
15467
+ var input = React__default.createElement("input", Object.assign({}, inputProps, {
15468
+ type: 'text',
15469
+ ref: ref,
15470
+ readOnly: true
15471
+ }));
15459
15472
  return React__default.createElement(RelativeContainer$5, {
15460
15473
  ref: useOnClickOut(function () {
15461
15474
  return setOpen(null);
15462
15475
  }),
15463
15476
  invalid: invalid
15464
- }, React__default.createElement(Input$1, Object.assign({}, inputProps, {
15465
- style: {
15466
- width: 0
15467
- },
15468
- type: 'text',
15469
- ref: ref,
15470
- borderless: true,
15471
- htmlDisabled: true
15472
- })), React__default.createElement(Container$a, {
15477
+ }, props.label ? React__default.createElement(LabelText$1, {
15478
+ required: props.required ? 1 : 0
15479
+ }, props.label, input) : input, React__default.createElement(Container$a, {
15473
15480
  invalid: props.invalid ? 1 : 0,
15474
15481
  disabled: props.disabled ? 1 : 0,
15475
- paddingless: props.paddingless ? 1 : 0
15482
+ paddingless: props.paddingless ? 1 : 0,
15483
+ borderless: props.borderless ? 1 : 0
15476
15484
  }, function () {
15477
15485
  var label = React__default.createElement(LabelContainer$3, {
15478
15486
  onClick: onClick
@@ -15485,7 +15493,7 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
15485
15493
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(Button$4, Object.assign({
15486
15494
  type: 'button'
15487
15495
  }, decrementProps, {
15488
- disabled: disabled || decrementProps.disabled
15496
+ disabled: props.disabled || decrementProps.disabled
15489
15497
  }), React__default.createElement(Icon, {
15490
15498
  type: 'feather',
15491
15499
  icon: 'chevron_left',
@@ -15494,7 +15502,7 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
15494
15502
  })), label, React__default.createElement(Button$4, Object.assign({
15495
15503
  type: 'button'
15496
15504
  }, incrementProps, {
15497
- disabled: disabled || incrementProps.disabled
15505
+ disabled: props.disabled || incrementProps.disabled
15498
15506
  }), React__default.createElement(Icon, {
15499
15507
  type: 'feather',
15500
15508
  icon: 'chevron_right',
@@ -16495,7 +16503,7 @@ var Toast = function Toast(props) {
16495
16503
  })), React__default.createElement(IconContent, null, React__default.createElement("h4", null, props.title), React__default.createElement("p", null, " ", props.description)));
16496
16504
  };
16497
16505
 
16498
- var _templateObject$C, _templateObject2$r, _templateObject3$o, _templateObject4$k, _templateObject5$j, _templateObject6$h, _templateObject7$e, _templateObject8$a, _templateObject9$a, _templateObject10$8, _templateObject11$4;
16506
+ var _templateObject$C, _templateObject2$r, _templateObject3$o, _templateObject4$k, _templateObject5$j, _templateObject6$h, _templateObject7$e, _templateObject8$a, _templateObject9$a, _templateObject10$8, _templateObject11$5;
16499
16507
  var Container$e = styled.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 300px;\n position: absolute;\n padding: 14px;\n"])));
16500
16508
  var Header$4 = styled.div(_templateObject2$r || (_templateObject2$r = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
16501
16509
  var HeaderImage = styled.div(_templateObject3$o || (_templateObject3$o = _taggedTemplateLiteralLoose(["\n width: 43px;\n height: 44px;\n background-color: #ebebeb;\n"])));
@@ -16512,7 +16520,7 @@ var HeaderLine = styled.div(_templateObject6$h || (_templateObject6$h = _taggedT
16512
16520
  }, function (props) {
16513
16521
  return props.size === 'large' && css(_templateObject10$8 || (_templateObject10$8 = _taggedTemplateLiteralLoose(["\n width: 75%;\n "])));
16514
16522
  });
16515
- var MainLine = styled(HeaderLine)(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n margin-bottom: 14px;\n margin-left: 0;\n"])));
16523
+ var MainLine = styled(HeaderLine)(_templateObject11$5 || (_templateObject11$5 = _taggedTemplateLiteralLoose(["\n margin-bottom: 14px;\n margin-left: 0;\n"])));
16516
16524
 
16517
16525
  var Template1 = function Template1(props) {
16518
16526
  if (!props.loading) return React__default.createElement(React__default.Fragment, null);
@@ -16897,7 +16905,7 @@ var Template8$1 = function Template8(props) {
16897
16905
  })), React__default.createElement(Main$2, null, React__default.createElement(Circle$2, null)));
16898
16906
  };
16899
16907
 
16900
- var _templateObject$M, _templateObject2$B, _templateObject3$y, _templateObject4$t, _templateObject5$s, _templateObject6$p, _templateObject7$m, _templateObject8$i, _templateObject9$g, _templateObject10$b, _templateObject11$5;
16908
+ var _templateObject$M, _templateObject2$B, _templateObject3$y, _templateObject4$t, _templateObject5$s, _templateObject6$p, _templateObject7$m, _templateObject8$i, _templateObject9$g, _templateObject10$b, _templateObject11$6;
16901
16909
  var Container$n = styled.div(_templateObject$M || (_templateObject$M = _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"])));
16902
16910
  var Header$a = styled.div(_templateObject2$B || (_templateObject2$B = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding: 14px;\n width: 100%;\n"])));
16903
16911
  var HeaderLine$9 = styled.div(_templateObject3$y || (_templateObject3$y = _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) {
@@ -16920,7 +16928,7 @@ var CustomLine$6 = styled(HeaderLine$9)(_templateObject8$i || (_templateObject8$
16920
16928
  });
16921
16929
  var GraphLine = styled(CustomLine$6)(_templateObject9$g || (_templateObject9$g = _taggedTemplateLiteralLoose(["\n margin: 0 7px;\n"])));
16922
16930
  var Main$3 = styled.div(_templateObject10$b || (_templateObject10$b = _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"])));
16923
- var Circle$3 = styled.div(_templateObject11$5 || (_templateObject11$5 = _taggedTemplateLiteralLoose(["\n width: 128px;\n height: 128px;\n background-color: #ebebeb;\n border-radius: 50%;\n"])));
16931
+ var Circle$3 = styled.div(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n width: 128px;\n height: 128px;\n background-color: #ebebeb;\n border-radius: 50%;\n"])));
16924
16932
 
16925
16933
  var Template10 = function Template10(props) {
16926
16934
  if (!props.loading) return React__default.createElement(React__default.Fragment, null);
@@ -17715,7 +17723,7 @@ var useContext$2 = function useContext() {
17715
17723
  return React__default.useContext(Provider$2);
17716
17724
  };
17717
17725
 
17718
- var _templateObject$S, _templateObject2$F, _templateObject3$C, _templateObject4$w, _templateObject5$u, _templateObject6$q, _templateObject7$n, _templateObject8$j, _templateObject9$h, _templateObject10$c, _templateObject11$6, _templateObject12$4, _templateObject13$4, _templateObject14$3, _templateObject15$2;
17726
+ var _templateObject$S, _templateObject2$F, _templateObject3$C, _templateObject4$w, _templateObject5$u, _templateObject6$q, _templateObject7$n, _templateObject8$j, _templateObject9$h, _templateObject10$c, _templateObject11$7, _templateObject12$4, _templateObject13$4, _templateObject14$3, _templateObject15$2;
17719
17727
  var aligns = {
17720
17728
  self: {
17721
17729
  horizontal: {
@@ -17806,7 +17814,7 @@ var Col = styled.div(_templateObject$S || (_templateObject$S = _taggedTemplateLi
17806
17814
  var bordered = _ref5.bordered,
17807
17815
  lightestGrey = _ref5.theme.colors.lightestGrey;
17808
17816
  if (!bordered) return;
17809
- return css(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n :not(:last-child) {\n border-right: 1px solid ", ";\n }\n "])), lightestGrey);
17817
+ return css(_templateObject11$7 || (_templateObject11$7 = _taggedTemplateLiteralLoose(["\n :not(:last-child) {\n border-right: 1px solid ", ";\n }\n "])), lightestGrey);
17810
17818
  }, function (_ref6) {
17811
17819
  var fontColor = _ref6.fontColor,
17812
17820
  theme = _ref6.theme;