@mw-kit/mw-ui 1.6.8 → 1.6.9

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.
@@ -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,7 +15254,7 @@ 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"])));
15257
+ var RelativeContainer$5 = styled__default.div(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n position: relative;\n user-select: none;\n\n > :nth-child(1) input {\n color: transparent;\n }\n"])));
15256
15258
  var LabelContainer$3 = styled__default.div(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n ", "\n line-height: ", ";\n"])), function (_ref) {
15257
15259
  var theme = _ref.theme;
15258
15260
  return theme.useTypography('p');
@@ -17032,7 +17034,7 @@ var useContext$2 = function useContext() {
17032
17034
  return React__default.useContext(Provider$2);
17033
17035
  };
17034
17036
 
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;
17037
+ 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
17038
  var aligns = {
17037
17039
  self: {
17038
17040
  horizontal: {
@@ -17142,7 +17144,7 @@ var Col = styled__default.div(_templateObject$M || (_templateObject$M = _taggedT
17142
17144
  if (!hover) return;
17143
17145
  var h = hover === true ? ['lightGrey', 50] : hover;
17144
17146
  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);
17147
+ return styled.css(_templateObject14$3 || (_templateObject14$3 = _taggedTemplateLiteralLoose(["\n :hover {\n background-color: ", ";\n }\n "])), c);
17146
17148
  }, function (_ref9) {
17147
17149
  var pointer = _ref9.pointer;
17148
17150
  if (!pointer) return;