fis-component 0.2.3 → 0.2.5

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
@@ -64433,7 +64433,7 @@ const DivContainer$2 = styled.div `
64433
64433
  ${getTheme("com/badge/default/color-stroke/neutral")};
64434
64434
 
64435
64435
  &.solid {
64436
- border: ${getTheme("sem/dimension/stroke-width/border/md")} solid ${getTheme("com/badge/solid/background-color/neutral")};
64436
+ border: ${getTheme("com/badge/stroke-width")} solid transparent;
64437
64437
  }
64438
64438
 
64439
64439
  &.ghost {
@@ -64793,8 +64793,7 @@ const DivContainer$2 = styled.div `
64793
64793
 
64794
64794
  &.solid {
64795
64795
  background-color: ${getTheme("com/badge/solid/background-color/disable")};
64796
- border: ${getTheme("com/badge/stroke-width")} solid
64797
- ${getTheme("com/badge/disable/color-stroke")};
64796
+ border: ${getTheme("com/badge/stroke-width")} solid transparent;
64798
64797
  }
64799
64798
  `}
64800
64799
  `;
@@ -73136,6 +73135,7 @@ const FISInputDate$1 = React.forwardRef((props, ref) => {
73136
73135
  return parseDateText(text, formats);
73137
73136
  };
73138
73137
  const [open, setOpen] = React.useState(false);
73138
+ const [hovered, setHovered] = React.useState(false);
73139
73139
  const [inputValue, setInputValue] = React.useState(value ? dayjs(value).format(finalFormat) : "");
73140
73140
  const [dateValue, setDateValue] = React.useState(value ? dayjs(value) : null);
73141
73141
  const inputRef = React.useRef(null);
@@ -73223,6 +73223,14 @@ const FISInputDate$1 = React.forwardRef((props, ref) => {
73223
73223
  setInputValue("");
73224
73224
  }
73225
73225
  };
73226
+ const showClear = allowClear && !disabled && inputValue !== "" && hovered;
73227
+ const handleClear = () => {
73228
+ setInputValue("");
73229
+ setDateValue(null);
73230
+ setOpen(false);
73231
+ if (dateValue)
73232
+ onChange?.(null);
73233
+ };
73226
73234
  const handleInputKeyDown = (e) => {
73227
73235
  if (e.key === "Enter") {
73228
73236
  normalizeInput();
@@ -73230,7 +73238,7 @@ const FISInputDate$1 = React.forwardRef((props, ref) => {
73230
73238
  }
73231
73239
  originalOnKeyDown?.(e);
73232
73240
  };
73233
- return (jsxRuntime.jsxs(DivWrapperSC$2, { className: className, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel$1, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC$1, { children: [jsxRuntime.jsx(FISInputField$1, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, placeholder: restProps.placeholder, readOnly: inputReadOnly, autoFocus: autoFocus, onFocus: () => setOpen(true), onChange: handleInputChange, onBlur: handleInputBlur, onKeyDown: handleInputKeyDown, onClickSuffix: () => setOpen(true), autoComplete: "off" }), jsxRuntime.jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: finalFormat, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate, picker: picker, allowClear: allowClear, showToday: showToday, showTime: showTime, disabledDate: disabledDate, disabledTime: disabledTime })] }), message && (jsxRuntime.jsx(DivHintWrapperSC$1, { children: jsxRuntime.jsx(SpanHintSC$3, { className: classNames({
73241
+ return (jsxRuntime.jsxs(DivWrapperSC$2, { className: className, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel$1, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC$1, { onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [jsxRuntime.jsx(FISInputField$1, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: showClear ? jsxRuntime.jsx(CloseIcon, {}) : jsxRuntime.jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, placeholder: restProps.placeholder, readOnly: inputReadOnly, autoFocus: autoFocus, onFocus: () => setOpen(true), onChange: handleInputChange, onBlur: handleInputBlur, onKeyDown: handleInputKeyDown, onClickSuffix: showClear ? handleClear : () => setOpen(true), autoComplete: "off" }), jsxRuntime.jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: finalFormat, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate, picker: picker, showToday: showToday, showTime: showTime, disabledDate: disabledDate, disabledTime: disabledTime })] }), message && (jsxRuntime.jsx(DivHintWrapperSC$1, { children: jsxRuntime.jsx(SpanHintSC$3, { className: classNames({
73234
73242
  disabled,
73235
73243
  negative,
73236
73244
  positive,