@mw-kit/mw-ui 1.6.8 → 1.6.11

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,5 +1,8 @@
1
1
  import React from 'react';
2
- export declare const RelativeContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ interface RelativeContainerProps {
3
+ invalid: boolean;
4
+ }
5
+ export declare const RelativeContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, RelativeContainerProps, never>;
3
6
  export declare const LabelContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
7
  interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
5
8
  iconWidth: string;
@@ -29,7 +29,6 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
29
29
  inputWidth?: string;
30
30
  }
31
31
  export interface StyledLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
32
- required: 1 | 0;
33
32
  invalid: 1 | 0;
34
33
  disabled: 1 | 0;
35
34
  paddingless: 1 | 0;
@@ -46,3 +45,6 @@ export interface StyledInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
46
45
  paddingless: 1 | 0;
47
46
  width?: string;
48
47
  }
48
+ export interface StyledLabelTextProps {
49
+ required: 1 | 0;
50
+ }
@@ -1,4 +1,5 @@
1
- import { StyledInputProps, StyledLabelProps } from './interfaces';
1
+ import { StyledInputProps, StyledLabelProps, StyledLabelTextProps } from './interfaces';
2
2
  export declare const IconContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
3
3
  export declare const Input: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, StyledInputProps, never>;
4
4
  export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, StyledLabelProps, never>;
5
+ export declare const LabelText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledLabelTextProps, never>;
package/dist/index.js CHANGED
@@ -12600,7 +12600,7 @@ var getMask = function getMask(mask) {
12600
12600
  };
12601
12601
  };
12602
12602
 
12603
- var _templateObject$c, _templateObject2$a, _templateObject3$a, _templateObject4$9, _templateObject5$8, _templateObject6$6, _templateObject7$4, _templateObject8$3, _templateObject9$3, _templateObject10$2, _templateObject11$1, _templateObject12$1, _templateObject13$1;
12603
+ var _templateObject$c, _templateObject2$a, _templateObject3$a, _templateObject4$9, _templateObject5$8, _templateObject6$6, _templateObject7$4, _templateObject8$3, _templateObject9$3, _templateObject10$2, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1;
12604
12604
  var IconContainer = styled__default.button(_templateObject$c || (_templateObject$c = _taggedTemplateLiteralLoose(["\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 17px;\n\n background-color: transparent;\n border: none;\n box-shadow: none;\n padding: 0;\n\n ", "\n"])), function (_ref) {
12605
12605
  var onClick = _ref.onClick,
12606
12606
  disabled = _ref.disabled;
@@ -12658,7 +12658,7 @@ var Input = styled__default.input(_templateObject3$a || (_templateObject3$a = _t
12658
12658
  if (!readOnly) return;
12659
12659
  return styled.css(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n cursor: ", ";\n "])), !onClick || disabled ? 'unset' : 'pointer');
12660
12660
  });
12661
- var Label = styled__default.label(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n ", ";\n\n color: ", ";\n\n width: ", ";\n box-sizing: border-box;\n position: relative;\n display: block;\n\n ", "\n\n > div:first-child {\n display: inline-block;\n margin-bottom: ", ";\n\n ", "\n }\n\n > ", " {\n bottom: ", ";\n }\n\n ", "\n"])), function (_ref13) {
12661
+ var Label = styled__default.label(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n ", ";\n\n color: ", ";\n\n width: ", ";\n box-sizing: border-box;\n position: relative;\n display: block;\n\n ", "\n\n > ", " {\n bottom: ", ";\n }\n\n ", "\n"])), function (_ref13) {
12662
12662
  var theme = _ref13.theme;
12663
12663
  return theme.useTypography('p');
12664
12664
  }, function (_ref14) {
@@ -12671,31 +12671,32 @@ var Label = styled__default.label(_templateObject9$3 || (_templateObject9$3 = _t
12671
12671
  var disabled = _ref16.disabled;
12672
12672
  if (!disabled) return;
12673
12673
  return styled.css(_templateObject10$2 || (_templateObject10$2 = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n "])));
12674
- }, function (_ref17) {
12675
- var theme = _ref17.theme;
12676
- return theme.spacings.s1;
12677
- }, function (_ref18) {
12678
- var required = _ref18.required;
12679
- if (!required) return;
12680
- return styled.css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
12681
- }, IconContainer, function (_ref19) {
12682
- var theme = _ref19.theme,
12683
- paddingless = _ref19.paddingless;
12674
+ }, IconContainer, function (_ref17) {
12675
+ var theme = _ref17.theme,
12676
+ paddingless = _ref17.paddingless;
12684
12677
  return paddingless ? '2px' : "calc(" + theme.spacings.s2 + " + 1px)";
12685
- }, function (_ref20) {
12686
- var theme = _ref20.theme,
12687
- icon = _ref20.icon,
12688
- paddingless = _ref20.paddingless;
12678
+ }, function (_ref18) {
12679
+ var theme = _ref18.theme,
12680
+ icon = _ref18.icon,
12681
+ paddingless = _ref18.paddingless;
12689
12682
  if (!icon) return;
12690
12683
  var width = icon.width,
12691
12684
  position = icon.position;
12692
12685
  var padding = paddingless ? '0px' : theme.spacings.s3;
12693
12686
 
12694
12687
  if (position === 'right') {
12695
- return styled.css(_templateObject12$1 || (_templateObject12$1 = _taggedTemplateLiteralLoose(["\n > ", " {\n width: ", ";\n right: calc(", " / 2);\n }\n\n > ", " {\n padding-right: calc(", " + ", ");\n }\n "])), IconContainer, width, padding, Input, padding, width);
12688
+ return styled.css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteralLoose(["\n > ", " {\n width: ", ";\n right: calc(", " / 2);\n }\n\n > ", " {\n padding-right: calc(", " + ", ");\n }\n "])), IconContainer, width, padding, Input, padding, width);
12696
12689
  }
12697
12690
 
12698
- return styled.css(_templateObject13$1 || (_templateObject13$1 = _taggedTemplateLiteralLoose(["\n > ", " {\n width: ", ";\n left: calc(", " / 2);\n }\n\n > ", " {\n padding-left: calc(", " + ", ");\n }\n "])), IconContainer, width, padding, Input, padding, width);
12691
+ return styled.css(_templateObject12$1 || (_templateObject12$1 = _taggedTemplateLiteralLoose(["\n > ", " {\n width: ", ";\n left: calc(", " / 2);\n }\n\n > ", " {\n padding-left: calc(", " + ", ");\n }\n "])), IconContainer, width, padding, Input, padding, width);
12692
+ });
12693
+ var LabelText = styled__default.div(_templateObject13$1 || (_templateObject13$1 = _taggedTemplateLiteralLoose(["\n display: inline-block;\n margin-bottom: ", ";\n\n ", "\n"])), function (_ref19) {
12694
+ var theme = _ref19.theme;
12695
+ return theme.spacings.s1;
12696
+ }, function (_ref20) {
12697
+ var required = _ref20.required;
12698
+ if (!required) return;
12699
+ return styled.css(_templateObject14$1 || (_templateObject14$1 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
12699
12700
  });
12700
12701
 
12701
12702
  var Input$1 = React__default.forwardRef(function (props, ref) {
@@ -12835,13 +12836,14 @@ var Input$1 = React__default.forwardRef(function (props, ref) {
12835
12836
  } : undefined;
12836
12837
  if (htmlDisabled) inputProps.disabled = true;
12837
12838
  return React__default.createElement(Label, {
12838
- required: intRequired,
12839
12839
  disabled: intDisabled,
12840
12840
  invalid: intInvalid,
12841
12841
  paddingless: intPaddingless,
12842
12842
  icon: iconProps,
12843
12843
  width: width
12844
- }, React__default.createElement("div", null, label), React__default.createElement(Input, Object.assign({}, inputProps, {
12844
+ }, label && React__default.createElement(LabelText, {
12845
+ required: intRequired
12846
+ }, label), React__default.createElement(Input, Object.assign({}, inputProps, {
12845
12847
  ref: ref
12846
12848
  })), icon && React__default.createElement(IconContainer, {
12847
12849
  type: iconSubmit ? 'submit' : 'button',
@@ -14678,7 +14680,7 @@ var Switch = function Switch(props) {
14678
14680
  })), React__default.createElement("span", null), label && React__default.createElement(LabelContainer$1, null, label));
14679
14681
  };
14680
14682
 
14681
- var _templateObject$n, _templateObject2$j, _templateObject3$h, _templateObject4$e, _templateObject5$d, _templateObject6$b, _templateObject7$9, _templateObject8$6, _templateObject9$6, _templateObject10$4, _templateObject11$3, _templateObject12$3, _templateObject13$3, _templateObject14$1, _templateObject15, _templateObject16;
14683
+ var _templateObject$n, _templateObject2$j, _templateObject3$h, _templateObject4$e, _templateObject5$d, _templateObject6$b, _templateObject7$9, _templateObject8$6, _templateObject9$6, _templateObject10$4, _templateObject11$3, _templateObject12$3, _templateObject13$3, _templateObject14$2, _templateObject15, _templateObject16;
14682
14684
  var bullet = styled.css(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n appearance: none;\n width: ", ";\n height: ", ";\n border-radius: 100%;\n border-width: 1px;\n border-style: solid;\n background-color: ", ";\n box-shadow: 0px 1px 3px ", ";\n"])), function (_ref) {
14683
14685
  var theme = _ref.theme;
14684
14686
  return theme.spacings.s4;
@@ -14738,7 +14740,7 @@ var SelectedArea = styled__default.div(_templateObject13$3 || (_templateObject13
14738
14740
  var percent = _ref13.percent;
14739
14741
  return percent;
14740
14742
  });
14741
- var MarkersContainer = styled__default.div(_templateObject14$1 || (_templateObject14$1 = _taggedTemplateLiteralLoose(["\n height: 17px;\n"])));
14743
+ var MarkersContainer = styled__default.div(_templateObject14$2 || (_templateObject14$2 = _taggedTemplateLiteralLoose(["\n height: 17px;\n"])));
14742
14744
  var Marker = styled__default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n width: 40px;\n text-align: center;\n left: ", ";\n z-index: 2;\n\n :first-child {\n left: 0;\n text-align: left;\n\n :after {\n left: 0;\n }\n }\n :last-child {\n right: 0;\n left: unset;\n text-align: right;\n\n :after {\n right: 0;\n left: unset;\n }\n }\n\n ", "\n"])), function (_ref14) {
14743
14745
  var left = _ref14.left;
14744
14746
  return left;
@@ -15252,41 +15254,45 @@ var parse = function parse(value) {
15252
15254
  };
15253
15255
 
15254
15256
  var _templateObject$q, _templateObject2$l, _templateObject3$j, _templateObject4$g, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$7, _templateObject9$7, _templateObject10$5;
15255
- var RelativeContainer$5 = styled__default.div(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n position: relative;\n\n > :nth-child(1) input {\n color: transparent;\n }\n"])));
15256
- var LabelContainer$3 = styled__default.div(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n ", "\n line-height: ", ";\n"])), function (_ref) {
15257
- var theme = _ref.theme;
15258
- return theme.useTypography('p');
15259
- }, function (_ref2) {
15257
+ var RelativeContainer$5 = styled__default.div(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n position: relative;\n user-select: none;\n min-width: 220px;\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: 4px;\n\n > :nth-child(1) input {\n color: transparent;\n }\n"])), function (_ref) {
15258
+ var theme = _ref.theme,
15259
+ invalid = _ref.invalid;
15260
+ return invalid ? theme.colors.warningRed : theme.colors.lightGrey;
15261
+ });
15262
+ var LabelContainer$3 = styled__default.div(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n ", "\n line-height: ", ";\n"])), function (_ref2) {
15260
15263
  var theme = _ref2.theme;
15264
+ return theme.useTypography('p');
15265
+ }, function (_ref3) {
15266
+ var theme = _ref3.theme;
15261
15267
  return theme.spacings.s3;
15262
15268
  });
15263
- var Container$a = styled__default.div(_templateObject3$j || (_templateObject3$j = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: 1px;\n left: 1px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: 4px;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref3) {
15264
- var theme = _ref3.theme,
15265
- iconWidth = _ref3.iconWidth,
15266
- paddingless = _ref3.paddingless;
15269
+ var Container$a = styled__default.div(_templateObject3$j || (_templateObject3$j = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: 1px;\n left: 1px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: 4px;\n white-space: nowrap;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref4) {
15270
+ var theme = _ref4.theme,
15271
+ iconWidth = _ref4.iconWidth,
15272
+ paddingless = _ref4.paddingless;
15267
15273
 
15268
15274
  if (paddingless) {
15269
15275
  return styled.css(_templateObject4$g || (_templateObject4$g = _taggedTemplateLiteralLoose(["\n width: calc(100% - 2px - ", ");\n height: 19px;\n "])), iconWidth);
15270
15276
  }
15271
15277
 
15272
15278
  return styled.css(_templateObject5$f || (_templateObject5$f = _taggedTemplateLiteralLoose(["\n width: calc(100% - 2px - ", " - ", ");\n height: 33px;\n padding: ", " 0 ", " ", ";\n "])), iconWidth, theme.spacings.s3, theme.spacings.s2, theme.spacings.s2, theme.spacings.s3);
15273
- }, function (_ref4) {
15274
- var invalid = _ref4.invalid,
15275
- theme = _ref4.theme;
15276
- if (!invalid) return;
15277
- return styled.css(_templateObject6$d || (_templateObject6$d = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.colors.warningRed);
15278
15279
  }, function (_ref5) {
15279
15280
  var invalid = _ref5.invalid,
15280
15281
  theme = _ref5.theme;
15281
15282
  if (!invalid) return;
15282
- return styled.css(_templateObject7$b || (_templateObject7$b = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.colors.warningRed);
15283
+ return styled.css(_templateObject6$d || (_templateObject6$d = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.colors.warningRed);
15283
15284
  }, function (_ref6) {
15284
- var disabled = _ref6.disabled;
15285
+ var invalid = _ref6.invalid,
15286
+ theme = _ref6.theme;
15287
+ if (!invalid) return;
15288
+ return styled.css(_templateObject7$b || (_templateObject7$b = _taggedTemplateLiteralLoose(["\n color: ", ";\n "])), theme.colors.warningRed);
15289
+ }, function (_ref7) {
15290
+ var disabled = _ref7.disabled;
15285
15291
  if (!disabled) return;
15286
15292
  return styled.css(_templateObject8$7 || (_templateObject8$7 = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n "])));
15287
15293
  });
15288
- var Button$4 = styled__default.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 (_ref7) {
15289
- var onClick = _ref7.onClick;
15294
+ var Button$4 = styled__default.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 (_ref8) {
15295
+ var onClick = _ref8.onClick;
15290
15296
  if (!onClick) return;
15291
15297
  return styled.css(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n :not(:disabled) {\n cursor: pointer;\n }\n "])));
15292
15298
  });
@@ -15372,8 +15378,12 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
15372
15378
  return React__default.createElement(RelativeContainer$5, {
15373
15379
  ref: useOnClickOut(function () {
15374
15380
  return setOpen(null);
15375
- })
15381
+ }),
15382
+ invalid: invalid
15376
15383
  }, React__default.createElement(Input$1, Object.assign({}, inputProps, {
15384
+ style: {
15385
+ width: 0
15386
+ },
15377
15387
  type: 'text',
15378
15388
  ref: ref,
15379
15389
  icon: {
@@ -15389,7 +15399,7 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
15389
15399
  });
15390
15400
  }
15391
15401
  },
15392
- invalid: invalid,
15402
+ borderless: true,
15393
15403
  htmlDisabled: true
15394
15404
  })), React__default.createElement(Container$a, {
15395
15405
  iconWidth: '24px',
@@ -17032,7 +17042,7 @@ var useContext$2 = function useContext() {
17032
17042
  return React__default.useContext(Provider$2);
17033
17043
  };
17034
17044
 
17035
- var _templateObject$M, _templateObject2$C, _templateObject3$A, _templateObject4$w, _templateObject5$u, _templateObject6$q, _templateObject7$n, _templateObject8$j, _templateObject9$h, _templateObject10$c, _templateObject11$6, _templateObject12$4, _templateObject13$4, _templateObject14$2, _templateObject15$1;
17045
+ var _templateObject$M, _templateObject2$C, _templateObject3$A, _templateObject4$w, _templateObject5$u, _templateObject6$q, _templateObject7$n, _templateObject8$j, _templateObject9$h, _templateObject10$c, _templateObject11$6, _templateObject12$4, _templateObject13$4, _templateObject14$3, _templateObject15$1;
17036
17046
  var aligns = {
17037
17047
  self: {
17038
17048
  horizontal: {
@@ -17142,7 +17152,7 @@ var Col = styled__default.div(_templateObject$M || (_templateObject$M = _taggedT
17142
17152
  if (!hover) return;
17143
17153
  var h = hover === true ? ['lightGrey', 50] : hover;
17144
17154
  var c = Array.isArray(h) ? theme.getColor.apply(theme, h) : theme.colors[h];
17145
- return styled.css(_templateObject14$2 || (_templateObject14$2 = _taggedTemplateLiteralLoose(["\n :hover {\n background-color: ", ";\n }\n "])), c);
17155
+ return styled.css(_templateObject14$3 || (_templateObject14$3 = _taggedTemplateLiteralLoose(["\n :hover {\n background-color: ", ";\n }\n "])), c);
17146
17156
  }, function (_ref9) {
17147
17157
  var pointer = _ref9.pointer;
17148
17158
  if (!pointer) return;