@hexure/ui 1.13.57 → 1.13.59
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 +31 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/cjs/types/components/Drawer/Drawer.d.ts +6 -0
- package/dist/cjs/types/components/Input/Input.d.ts +1 -0
- package/dist/cjs/types/components/Radio/Radio.d.ts +1 -0
- package/dist/cjs/types/components/Select/Select.d.ts +1 -0
- package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/esm/index.js +31 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/esm/types/components/Drawer/Drawer.d.ts +6 -0
- package/dist/esm/types/components/Input/Input.d.ts +1 -0
- package/dist/esm/types/components/Radio/Radio.d.ts +1 -0
- package/dist/esm/types/components/Select/Select.d.ts +1 -0
- package/dist/esm/types/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/index.d.ts +93 -82
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -139,11 +139,11 @@ Copy.defaultProps = {
|
|
|
139
139
|
type: 'default',
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
-
const Wrapper$h = styled.div
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
const Wrapper$h = styled.div(props => ({
|
|
143
|
+
display: 'inline-block',
|
|
144
|
+
position: 'relative',
|
|
145
|
+
height: props.$height || '16px',
|
|
146
|
+
}));
|
|
147
147
|
const StyledIcon$6 = styled(Icon) `
|
|
148
148
|
width: 16px;
|
|
149
149
|
height: 16px;
|
|
@@ -182,10 +182,10 @@ const positions = {
|
|
|
182
182
|
};
|
|
183
183
|
const Content$3 = 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: 9999 }, positions[props.$position])));
|
|
184
184
|
Content$3.defaultProps = { theme: EditableTheme };
|
|
185
|
-
const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, dataItemid, }) => {
|
|
185
|
+
const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, dataItemid, height, }) => {
|
|
186
186
|
const [show_content, toggleContent] = React.useState(false);
|
|
187
187
|
const baseId = dataItemid || 'tooltip';
|
|
188
|
-
return (React.createElement(Wrapper$h, { "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
|
|
188
|
+
return (React.createElement(Wrapper$h, { "$height": height, "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
|
|
189
189
|
trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: js.mdiInformationOutline }),
|
|
190
190
|
show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, "data-itemid": `${baseId}-content` }, children && (React.createElement(Copy, { "data-itemid": `${baseId}-copy`, type: 'small' }, children)))) : null));
|
|
191
191
|
};
|
|
@@ -953,6 +953,7 @@ const Check$1 = styled.span `
|
|
|
953
953
|
border-width: 2px;
|
|
954
954
|
border-style: solid;
|
|
955
955
|
border-color: ${props => (props.$invalid ? `${Colors.RED.Hex}` : `${Colors.GRAY.Hex}`)};
|
|
956
|
+
background-color: ${props => props.$invalid && props.$isInvalidRedBackground ? '#ffe5e5' : '#ffffff'};
|
|
956
957
|
box-sizing: border-box;
|
|
957
958
|
position: relative;
|
|
958
959
|
&:after {
|
|
@@ -981,11 +982,11 @@ const Label$3 = styled.span `
|
|
|
981
982
|
box-sizing: border-box;
|
|
982
983
|
`;
|
|
983
984
|
const Checkbox = (_a) => {
|
|
984
|
-
var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, dataItemid } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "dataItemid"]);
|
|
985
|
+
var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground"]);
|
|
985
986
|
const baseId = dataItemid || 'checkbox';
|
|
986
987
|
return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
|
|
987
988
|
React.createElement(Input$2, { checked: checked, "data-itemid": `${baseId}-input`, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
|
|
988
|
-
React.createElement(Check$1, { "$invalid": invalid, "data-itemid": `${baseId}-check` }),
|
|
989
|
+
React.createElement(Check$1, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "data-itemid": `${baseId}-check` }),
|
|
989
990
|
children ? (React.createElement(Label$3, { color: color, "data-itemid": `${baseId}-label` },
|
|
990
991
|
children,
|
|
991
992
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)) : null));
|
|
@@ -1048,6 +1049,7 @@ const Wrapper$a = styled.div `
|
|
|
1048
1049
|
border-width: 1px;
|
|
1049
1050
|
border-style: solid;
|
|
1050
1051
|
border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
|
|
1052
|
+
background-color: ${props => props.$invalid && props.$isInvalidRedBackground ? '#ffe5e5' : '#ffffff'};
|
|
1051
1053
|
border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
|
|
1052
1054
|
flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
|
|
1053
1055
|
box-sizing: border-box;
|
|
@@ -1103,7 +1105,7 @@ const SearchInput$1 = styled.input `
|
|
|
1103
1105
|
white-space: nowrap;
|
|
1104
1106
|
`;
|
|
1105
1107
|
const Select = (_a) => {
|
|
1106
|
-
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, dataItemid } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "dataItemid"]);
|
|
1108
|
+
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, dataItemid, isInvalidRedBackground = false } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "dataItemid", "isInvalidRedBackground"]);
|
|
1107
1109
|
const [searchTerm, setSearchTerm] = React.useState('');
|
|
1108
1110
|
const [value, setValue] = React.useState(propValue || '');
|
|
1109
1111
|
const baseId = dataItemid || 'select';
|
|
@@ -1126,7 +1128,7 @@ const Select = (_a) => {
|
|
|
1126
1128
|
const filteredOptionGroups = searchable
|
|
1127
1129
|
? optionGroups === null || optionGroups === void 0 ? void 0 : optionGroups.map(group => (Object.assign(Object.assign({}, group), { options: group.options.filter(option => { var _a; return (_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm.toLowerCase()); }) })))
|
|
1128
1130
|
: optionGroups;
|
|
1129
|
-
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "data-itemid": `${baseId}-wrapper` },
|
|
1131
|
+
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$readOnly": readOnly, "$style": style, "data-itemid": `${baseId}-wrapper` },
|
|
1130
1132
|
searchable && (React.createElement(SearchInput$1, Object.assign({ "data-itemid": `${baseId}-search-input`, onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
|
|
1131
1133
|
React.createElement(Trigger$1, Object.assign({ "data-itemid": `${baseId}-trigger`, disabled: readOnly, onChange: handleChange, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, value: value }, accessibleProps),
|
|
1132
1134
|
placeholder && !value && (React.createElement("option", { "data-itemid": `${baseId}-placeholder`, disabled: true, value: '' }, placeholder)),
|
|
@@ -1291,9 +1293,14 @@ const ButtonBar$1 = styled.div `
|
|
|
1291
1293
|
gap: 10px;
|
|
1292
1294
|
flex-shrink: 0;
|
|
1293
1295
|
background: #fff;
|
|
1296
|
+
flex-direction: column;
|
|
1297
|
+
`;
|
|
1298
|
+
const ButtonBarNote = styled.div `
|
|
1299
|
+
display: flex;
|
|
1300
|
+
gap: 10px;
|
|
1294
1301
|
`;
|
|
1295
1302
|
const Drawer = (_a) => {
|
|
1296
|
-
var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width, dataItemid } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width", "dataItemid"]);
|
|
1303
|
+
var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width, dataItemid, bottomNotes } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width", "dataItemid", "bottomNotes"]);
|
|
1297
1304
|
React.useEffect(() => {
|
|
1298
1305
|
document.onkeydown = e => {
|
|
1299
1306
|
if (e.key === 'Escape') {
|
|
@@ -1315,9 +1322,11 @@ const Drawer = (_a) => {
|
|
|
1315
1322
|
React.createElement(Button, { dataItemid: `${baseId}-close-button`, format: 'secondary', icon: js.mdiClose, small: true }))),
|
|
1316
1323
|
React.createElement(ContentWrapper$1, { "data-itemid": `${baseId}-content-wrapper` }, children),
|
|
1317
1324
|
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, { "data-itemid": `${baseId}-button-bar` },
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1325
|
+
React.createElement(Copy, { "data-itemid": `${baseId}-button-bar-notes`, type: 'small' }, bottomNotes),
|
|
1326
|
+
React.createElement(ButtonBarNote, null,
|
|
1327
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { "data-itemid": `${baseId}-tertiary-button`, format: tertiaryButton.format || 'secondary' }))) : null,
|
|
1328
|
+
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { "data-itemid": `${baseId}-secondary-button`, format: secondaryButton.format || 'secondary' }))) : null,
|
|
1329
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { "data-itemid": `${baseId}-primary-button`, format: primaryButton.format || 'primary' }))) : null))) : null),
|
|
1321
1330
|
scrim ? (React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, "data-itemid": `${baseId}-scrim`, onClick: onClose })) : null));
|
|
1322
1331
|
};
|
|
1323
1332
|
|
|
@@ -1817,6 +1826,7 @@ const StyledWrapper = styled.div `
|
|
|
1817
1826
|
border-width: 1px;
|
|
1818
1827
|
border-style: solid;
|
|
1819
1828
|
border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
|
|
1829
|
+
background-color: ${props => props.$invalid && props.$isInvalidRedBackground ? '#ffe5e5' : '#ffffff'};
|
|
1820
1830
|
border-radius: ${props => (props.$suggestions ? '4px 4px 0px 0px' : '4px')};
|
|
1821
1831
|
|
|
1822
1832
|
&:focus-within {
|
|
@@ -1882,7 +1892,7 @@ const Loader$1 = styled.div `
|
|
|
1882
1892
|
const Input$1 = (_a) => {
|
|
1883
1893
|
var { format, suffix, height, invalid, loading, max, maxLength, min, onBlur, onChange, onFocus, onKeyDown,
|
|
1884
1894
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1885
|
-
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '', innerRef = null, tabIndex, isAutoComplete = false, dataItemid, mask, onPaste, autoComplete } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value", "innerRef", "tabIndex", "isAutoComplete", "dataItemid", "mask", "onPaste", "autoComplete"]);
|
|
1895
|
+
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '', innerRef = null, tabIndex, isAutoComplete = false, dataItemid, mask, onPaste, autoComplete, isInvalidRedBackground = false } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value", "innerRef", "tabIndex", "isAutoComplete", "dataItemid", "mask", "onPaste", "autoComplete", "isInvalidRedBackground"]);
|
|
1886
1896
|
const [show_options, setShowOptions] = React.useState(false);
|
|
1887
1897
|
const [internalValue, setInternalValue] = React.useState(value);
|
|
1888
1898
|
const [internalSuggestedValues, setInternalSuggestedValues] = React.useState(suggestedValues || []);
|
|
@@ -1958,7 +1968,7 @@ const Input$1 = (_a) => {
|
|
|
1958
1968
|
formatted_value = formatAsMask(internalValue, mask);
|
|
1959
1969
|
}
|
|
1960
1970
|
const baseId = dataItemid || 'input';
|
|
1961
|
-
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, "data-itemid": `${baseId}-wrapper`, style: style },
|
|
1971
|
+
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, "data-itemid": `${baseId}-wrapper`, style: style },
|
|
1962
1972
|
React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, autoComplete: autoComplete, maxLength: maxLength, onBlur: readOnly
|
|
1963
1973
|
? e => e.preventDefault()
|
|
1964
1974
|
: e => {
|
|
@@ -1981,7 +1991,7 @@ const Input$1 = (_a) => {
|
|
|
1981
1991
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1982
1992
|
showCharCount ? (React.createElement(CharacterCount, { "data-itemid": `${baseId}-char-count` },
|
|
1983
1993
|
internalValue.length,
|
|
1984
|
-
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, "data-itemid": `${baseId}-wrapper`, style: style },
|
|
1994
|
+
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, "data-itemid": `${baseId}-wrapper`, style: style },
|
|
1985
1995
|
React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, autoComplete: autoComplete, max: max, maxLength: maxLength, min: min, onBlur: readOnly
|
|
1986
1996
|
? e => e.preventDefault()
|
|
1987
1997
|
: e => {
|
|
@@ -2536,6 +2546,7 @@ const Check = styled.span `
|
|
|
2536
2546
|
border-width: 2px;
|
|
2537
2547
|
border-style: solid;
|
|
2538
2548
|
border-color: ${props => (props.$invalid ? `${Colors.RED.Hex}` : `${Colors.GRAY.Hex}`)};
|
|
2549
|
+
background-color: ${props => props.$invalid && props.$isInvalidRedBackground ? '#ffe5e5' : '#ffffff'};
|
|
2539
2550
|
box-sizing: border-box;
|
|
2540
2551
|
position: relative;
|
|
2541
2552
|
&:after {
|
|
@@ -2559,11 +2570,11 @@ const Label = styled.span `
|
|
|
2559
2570
|
margin-left: 6px;
|
|
2560
2571
|
`;
|
|
2561
2572
|
const Radio = (_a) => {
|
|
2562
|
-
var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex, dataItemid } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex", "dataItemid"]);
|
|
2573
|
+
var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground"]);
|
|
2563
2574
|
const baseId = dataItemid || 'radio';
|
|
2564
2575
|
return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
|
|
2565
2576
|
React.createElement(Input, { checked: checked, "data-itemid": `${baseId}-input`, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'radio', value: value }),
|
|
2566
|
-
React.createElement(Check, { "$invalid": invalid, "data-itemid": `${baseId}-check` }),
|
|
2577
|
+
React.createElement(Check, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "data-itemid": `${baseId}-check` }),
|
|
2567
2578
|
React.createElement(Label, { "data-itemid": `${baseId}-label` },
|
|
2568
2579
|
children,
|
|
2569
2580
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)));
|