@hexure/ui 1.13.57 → 1.13.58

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 CHANGED
@@ -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)),
@@ -1817,6 +1819,7 @@ const StyledWrapper = styled.div `
1817
1819
  border-width: 1px;
1818
1820
  border-style: solid;
1819
1821
  border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
1822
+ background-color: ${props => props.$invalid && props.$isInvalidRedBackground ? '#ffe5e5' : '#ffffff'};
1820
1823
  border-radius: ${props => (props.$suggestions ? '4px 4px 0px 0px' : '4px')};
1821
1824
 
1822
1825
  &:focus-within {
@@ -1882,7 +1885,7 @@ const Loader$1 = styled.div `
1882
1885
  const Input$1 = (_a) => {
1883
1886
  var { format, suffix, height, invalid, loading, max, maxLength, min, onBlur, onChange, onFocus, onKeyDown,
1884
1887
  // 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"]);
1888
+ 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
1889
  const [show_options, setShowOptions] = React.useState(false);
1887
1890
  const [internalValue, setInternalValue] = React.useState(value);
1888
1891
  const [internalSuggestedValues, setInternalSuggestedValues] = React.useState(suggestedValues || []);
@@ -1958,7 +1961,7 @@ const Input$1 = (_a) => {
1958
1961
  formatted_value = formatAsMask(internalValue, mask);
1959
1962
  }
1960
1963
  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 },
1964
+ 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
1965
  React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, autoComplete: autoComplete, maxLength: maxLength, onBlur: readOnly
1963
1966
  ? e => e.preventDefault()
1964
1967
  : e => {
@@ -1981,7 +1984,7 @@ const Input$1 = (_a) => {
1981
1984
  React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
1982
1985
  showCharCount ? (React.createElement(CharacterCount, { "data-itemid": `${baseId}-char-count` },
1983
1986
  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 },
1987
+ 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
1988
  React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, autoComplete: autoComplete, max: max, maxLength: maxLength, min: min, onBlur: readOnly
1986
1989
  ? e => e.preventDefault()
1987
1990
  : e => {
@@ -2536,6 +2539,7 @@ const Check = styled.span `
2536
2539
  border-width: 2px;
2537
2540
  border-style: solid;
2538
2541
  border-color: ${props => (props.$invalid ? `${Colors.RED.Hex}` : `${Colors.GRAY.Hex}`)};
2542
+ background-color: ${props => props.$invalid && props.$isInvalidRedBackground ? '#ffe5e5' : '#ffffff'};
2539
2543
  box-sizing: border-box;
2540
2544
  position: relative;
2541
2545
  &:after {
@@ -2559,11 +2563,11 @@ const Label = styled.span `
2559
2563
  margin-left: 6px;
2560
2564
  `;
2561
2565
  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"]);
2566
+ 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
2567
  const baseId = dataItemid || 'radio';
2564
2568
  return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
2565
2569
  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` }),
2570
+ React.createElement(Check, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "data-itemid": `${baseId}-check` }),
2567
2571
  React.createElement(Label, { "data-itemid": `${baseId}-label` },
2568
2572
  children,
2569
2573
  tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)));