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