@hexure/ui 1.11.11 → 1.11.13

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/esm/index.js CHANGED
@@ -756,7 +756,57 @@ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = '
756
756
  show_menu ? (React.createElement(StyledMoreMenu, { "$menuWidth": menuWidth, "$position": position, "$small": small, maxHeight: maxHeight, menuItems: menuItems })) : null));
757
757
  };
758
758
 
759
- const Wrapper$c = styled.label `
759
+ const Wrapper$c = styled.div `
760
+ display: inline-block;
761
+ position: relative;
762
+ height: 16px;
763
+ `;
764
+ const StyledIcon$4 = styled(Icon) `
765
+ width: 16px;
766
+ height: 16px;
767
+ margin: 0px 6px;
768
+ color: ${props => props.theme.PRIMARY_COLOR.Hex};
769
+ cursor: pointer;
770
+ `;
771
+ StyledIcon$4.defaultProps = { theme: EditableTheme };
772
+ const positions = {
773
+ 'right-top': {
774
+ top: '0px',
775
+ left: '28px',
776
+ },
777
+ 'right-bottom': {
778
+ bottom: '0px',
779
+ left: '28px',
780
+ },
781
+ 'right-center': {
782
+ top: '50%',
783
+ left: '28px',
784
+ transform: 'translateY(-50%)',
785
+ },
786
+ 'left-top': {
787
+ top: '0px',
788
+ right: '28px',
789
+ },
790
+ 'left-bottom': {
791
+ bottom: '0px',
792
+ right: '28px',
793
+ },
794
+ 'left-center': {
795
+ top: '50%',
796
+ right: '28px',
797
+ transform: 'translateY(-50%)',
798
+ },
799
+ };
800
+ const Content$2 = styled.div(props => (Object.assign({ position: 'absolute', borderRadius: '4px', borderWidth: '1px', borderStyle: 'solid', borderColor: props.theme.PRIMARY_COLOR.Hex, background: '#ffffff', boxShadow: '0px 5px 30px -10px rgba(0, 0, 0, 0.5)', width: props.$width || '240px', padding: '10px 12px', zIndex: 10 }, positions[props.$position])));
801
+ Content$2.defaultProps = { theme: EditableTheme };
802
+ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, }) => {
803
+ const [show_content, toggleContent] = useState(false);
804
+ return (React.createElement(Wrapper$c, { onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
805
+ trigger || React.createElement(StyledIcon$4, { path: mdiInformationOutline }),
806
+ show_content ? (React.createElement(Content$2, { "$position": position, "$width": width }, children && React.createElement(Copy, { type: 'small' }, children))) : null));
807
+ };
808
+
809
+ const Wrapper$b = styled.label `
760
810
  border-radius: 4px;
761
811
  padding: 4px 0px 4px 6px;
762
812
  margin-left: -6px;
@@ -772,7 +822,7 @@ const Wrapper$c = styled.label `
772
822
  background: ${props => `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)`};
773
823
  }
774
824
  `;
775
- Wrapper$c.defaultProps = { theme: EditableTheme };
825
+ Wrapper$b.defaultProps = { theme: EditableTheme };
776
826
  const Input$2 = styled.input `
777
827
  font-size: 20px;
778
828
  margin: 0px;
@@ -789,10 +839,12 @@ const Label$3 = styled.span `
789
839
  box-sizing: border-box;
790
840
  `;
791
841
  const Checkbox = (_a) => {
792
- var { children, disabled, checked, onChange, invalid } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "invalid"]);
793
- return (React.createElement(Wrapper$c, Object.assign({ "$disabled": disabled, "$invalid": invalid }, accessibleProps),
842
+ var { children, disabled, checked, onChange, invalid, tooltip } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "invalid", "tooltip"]);
843
+ return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled, "$invalid": invalid }, accessibleProps),
794
844
  React.createElement(Input$2, { checked: checked, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, type: 'checkbox' }),
795
- children ? React.createElement(Label$3, null, children) : null));
845
+ children ? (React.createElement(Label$3, null,
846
+ children,
847
+ tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)) : null));
796
848
  };
797
849
 
798
850
  const SelectAll = styled.div `
@@ -841,12 +893,12 @@ const Checklist = (_a) => {
841
893
  }))));
842
894
  };
843
895
 
844
- const Wrapper$b = styled.div `
896
+ const Wrapper$a = styled.div `
845
897
  border-radius: 4px;
846
898
  height: 40px;
847
899
  background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
848
900
  position: relative;
849
- cursor: pointer;
901
+ cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
850
902
  border-width: 1px;
851
903
  border-style: solid;
852
904
  border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
@@ -862,7 +914,7 @@ const Wrapper$b = styled.div `
862
914
  border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
863
915
  }
864
916
  `;
865
- Wrapper$b.defaultProps = { theme: EditableTheme };
917
+ Wrapper$a.defaultProps = { theme: EditableTheme };
866
918
  const Trigger$1 = styled.select `
867
919
  appearance: none;
868
920
  box-shadow: none;
@@ -875,7 +927,6 @@ const Trigger$1 = styled.select `
875
927
  line-height: 2.9em;
876
928
  background-color: transparent;
877
929
  background-image: none;
878
- cursor: pointer;
879
930
  width: 100%;
880
931
  box-sizing: border-box;
881
932
  padding: 0px 30px 0px 10px;
@@ -890,7 +941,7 @@ const IconWrapper$2 = styled(Icon) `
890
941
  `;
891
942
  const Select = (_a) => {
892
943
  var { options, optionGroups, placeholder, readOnly, invalid, value, onChange, style } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "value", "onChange", "style"]);
893
- return (React.createElement(Wrapper$b, { "$invalid": invalid, "$readOnly": readOnly, "$style": style },
944
+ return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style },
894
945
  React.createElement(Trigger$1, Object.assign({ disabled: readOnly, onChange: onChange, placeholder: placeholder, value: value }, accessibleProps),
895
946
  placeholder ? (React.createElement("option", { disabled: true, value: '' }, placeholder)) : null,
896
947
  optionGroups &&
@@ -1063,56 +1114,6 @@ const Drawer = (_a) => {
1063
1114
  scrim ? React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, onClick: onClose }) : null));
1064
1115
  };
1065
1116
 
1066
- const Wrapper$a = styled.div `
1067
- display: inline-block;
1068
- position: relative;
1069
- height: 16px;
1070
- `;
1071
- const StyledIcon$4 = styled(Icon) `
1072
- width: 16px;
1073
- height: 16px;
1074
- margin: 0px 6px;
1075
- color: ${props => props.theme.PRIMARY_COLOR.Hex};
1076
- cursor: pointer;
1077
- `;
1078
- StyledIcon$4.defaultProps = { theme: EditableTheme };
1079
- const positions = {
1080
- 'right-top': {
1081
- top: '0px',
1082
- left: '28px',
1083
- },
1084
- 'right-bottom': {
1085
- bottom: '0px',
1086
- left: '28px',
1087
- },
1088
- 'right-center': {
1089
- top: '50%',
1090
- left: '28px',
1091
- transform: 'translateY(-50%)',
1092
- },
1093
- 'left-top': {
1094
- top: '0px',
1095
- right: '28px',
1096
- },
1097
- 'left-bottom': {
1098
- bottom: '0px',
1099
- right: '28px',
1100
- },
1101
- 'left-center': {
1102
- top: '50%',
1103
- right: '28px',
1104
- transform: 'translateY(-50%)',
1105
- },
1106
- };
1107
- const Content$2 = styled.div(props => (Object.assign({ position: 'absolute', borderRadius: '4px', borderWidth: '1px', borderStyle: 'solid', borderColor: props.theme.PRIMARY_COLOR.Hex, background: '#ffffff', boxShadow: '0px 5px 30px -10px rgba(0, 0, 0, 0.5)', width: props.$width || '240px', padding: '10px 12px', zIndex: 10 }, positions[props.$position])));
1108
- Content$2.defaultProps = { theme: EditableTheme };
1109
- const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, }) => {
1110
- const [show_content, toggleContent] = useState(false);
1111
- return (React.createElement(Wrapper$a, { onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
1112
- trigger || React.createElement(StyledIcon$4, { path: mdiInformationOutline }),
1113
- show_content ? (React.createElement(Content$2, { "$position": position, "$width": width }, children && React.createElement(Copy, { type: 'small' }, children))) : null));
1114
- };
1115
-
1116
1117
  const Wrapper$9 = styled.div(props => (Object.assign({ margin: '0px 0px 18px 0px' }, props.style)));
1117
1118
  const LabelRow = styled.div `
1118
1119
  display: flex;
@@ -1124,7 +1125,7 @@ const LabelRow = styled.div `
1124
1125
  const Label$2 = styled.label `
1125
1126
  font-size: ${FontSizes.DEFAULT};
1126
1127
  font-weight: 500;
1127
- line-height: 1em;
1128
+ line-height: 1.3em;
1128
1129
  font-family: ${FontStyles.DEFAULT};
1129
1130
  color: ${Colors.BLACK.Hex};
1130
1131
  display: flex;
@@ -1470,10 +1471,7 @@ const StyledInput = styled.input `
1470
1471
  color: ${props => (props.$invalid && !props.$readOnly ? Colors.RED.Hex : Colors.BLACK.Hex)};
1471
1472
  position: relative;
1472
1473
  height: ${props => props.$height || 'auto'};
1473
- padding-top: 10px;
1474
- padding-bottom: 10px;
1475
- padding-left: 10px;
1476
- padding-right: ${({ $showCharCount }) => ($showCharCount ? '60px' : '10px')};
1474
+ padding: 10px;
1477
1475
  opacity: ${props => (props.$readOnly ? 0.6 : 1)};
1478
1476
  box-shadow: none;
1479
1477
  outline: none;
@@ -1562,15 +1560,18 @@ const SuggestedValue = styled.div `
1562
1560
  `;
1563
1561
  SuggestedValue.defaultProps = { theme: EditableTheme };
1564
1562
  const CharacterCount = styled.div `
1565
- position: absolute;
1566
- right: 10px;
1567
- top: 11px;
1568
1563
  font-family: ${FontStyles.DEFAULT};
1569
1564
  font-size: ${FontSizes.SMALL};
1570
1565
  color: ${Colors.MEDIUM_GRAY.Hex};
1566
+ padding: 10px;
1567
+ `;
1568
+ const Loader$1 = styled.div `
1569
+ padding: 0px 10px;
1570
+ display: flex;
1571
+ align-items: center;
1571
1572
  `;
1572
1573
  const Input$1 = (_a) => {
1573
- var { format, suffix, height, invalid, max, maxLength, min, onBlur, onChange, onFocus, onKeyDown, onSuggestedSelect, placeholder, readOnly, showCharCount, step, style, suggestedValues, type = 'text', value = '' } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "type", "value"]);
1574
+ var { format, suffix, height, invalid, loading, max, maxLength, min, onBlur, onChange, onFocus, onKeyDown, onSuggestedSelect, placeholder, readOnly, showCharCount, step, style, suggestedValues, type = 'text', value = '' } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "type", "value"]);
1574
1575
  const [show_options, setShowOptions] = useState(false);
1575
1576
  const handleInputChange = (e) => {
1576
1577
  if (format === 'currency' || format === 'currency_decimal') {
@@ -1607,7 +1608,7 @@ const Input$1 = (_a) => {
1607
1608
  formatted_value = formatAsSsn(value);
1608
1609
  }
1609
1610
  return (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!(suggestedValues === null || suggestedValues === void 0 ? void 0 : suggestedValues.length) },
1610
- React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showCharCount": showCharCount, max: max, maxLength: maxLength, min: min, onBlur: readOnly
1611
+ React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, max: max, maxLength: maxLength, min: min, onBlur: readOnly
1611
1612
  ? undefined
1612
1613
  : e => {
1613
1614
  if (onBlur)
@@ -1624,6 +1625,8 @@ const Input$1 = (_a) => {
1624
1625
  if (onFocus)
1625
1626
  onFocus(e);
1626
1627
  }, onKeyDown: readOnly ? undefined : onKeyDown, placeholder: placeholder, step: step, type: type, value: formatted_value }, accessibleProps)),
1628
+ loading ? (React.createElement(Loader$1, null,
1629
+ React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: mdiLoading, size: '20px', spin: true }))) : null,
1627
1630
  showCharCount ? (React.createElement(CharacterCount, null,
1628
1631
  value.length,
1629
1632
  maxLength ? ` / ${maxLength}` : null)) : null,
@@ -2050,10 +2053,12 @@ const Label = styled.span `
2050
2053
  margin-left: 6px;
2051
2054
  `;
2052
2055
  const Radio = (_a) => {
2053
- var { children, disabled, checked, onChange, value, invalid } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid"]);
2056
+ var { children, disabled, checked, onChange, value, invalid, tooltip } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip"]);
2054
2057
  return (React.createElement(Wrapper$2, Object.assign({ "$disabled": disabled, "$invalid": invalid }, accessibleProps),
2055
2058
  React.createElement(Input, { checked: checked, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, type: 'radio', value: value }),
2056
- React.createElement(Label, null, children)));
2059
+ React.createElement(Label, null,
2060
+ children,
2061
+ tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)));
2057
2062
  };
2058
2063
 
2059
2064
  const RadioList = (_a) => {