@rolster/react-components 18.23.14 → 18.23.15

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.
@@ -225,6 +225,7 @@
225
225
  --pvt-gradient-border: none;
226
226
  position: relative;
227
227
  padding: 0rem;
228
+ width: var(--rlc-button-width, auto);
228
229
  overflow: hidden;
229
230
  outline: none;
230
231
  background: rgba(0, 0, 0, 0);
@@ -2489,7 +2490,7 @@
2489
2490
  .rls-field-date-range__action .rls-icon {
2490
2491
  margin: 1rem;
2491
2492
  }
2492
- .rls-field-date-modal {
2493
+ .rls-field-date-range-modal {
2493
2494
  --rlc-modal-max-width: 150rem;
2494
2495
  } /*# sourceMappingURL=FieldDateRange.css.map */
2495
2496
 
@@ -2728,10 +2729,22 @@
2728
2729
  flex-direction: column;
2729
2730
  row-gap: var(--rls-sizing-x2);
2730
2731
  }
2732
+ .rls-snackbar__header {
2733
+ display: flex;
2734
+ align-items: center;
2735
+ justify-content: space-between;
2736
+ column-gap: var(--rls-sizing-x4);
2737
+ }
2738
+ .rls-snackbar__header > button {
2739
+ background: rgba(0, 0, 0, 0);
2740
+ padding: 0rem;
2741
+ cursor: pointer;
2742
+ color: var(--rls-theme-color-700);
2743
+ }
2731
2744
  .rls-snackbar__title {
2745
+ white-space: nowrap;
2732
2746
  overflow: hidden;
2733
2747
  text-overflow: ellipsis;
2734
- white-space: nowrap;
2735
2748
  color: var(--rls-theme-color-500);
2736
2749
  font-size: var(--rls-body-font-size);
2737
2750
  font-weight: var(--rls-font-weight-bold);
package/dist/es/index.js CHANGED
@@ -3073,7 +3073,7 @@ function RlsFieldDateRange({ children, date: _date, disabled, formControl, ident
3073
3073
  formControl?.touch();
3074
3074
  setModalIsVisible(false);
3075
3075
  }, [formControl, onChange]);
3076
- return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date-range__control", type: "text", value: valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: _disabled }), jsxRuntimeExports.jsx("button", { className: "rls-field-date-range__action", onClick: onClickAction, disabled: _disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDateRange, { formControl: formControl, date: currentDate, disabled: _disabled, maxDate: maxDate, minDate: minDate, onListener: onListener }) })] }));
3076
+ return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date-range__control", type: "text", value: valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: _disabled }), jsxRuntimeExports.jsx("button", { className: "rls-field-date-range__action", onClick: onClickAction, disabled: _disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { className: "rls-field-date-range-modal", visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDateRange, { formControl: formControl, date: currentDate, disabled: _disabled, maxDate: maxDate, minDate: minDate, onListener: onListener }) })] }));
3077
3077
  }
3078
3078
 
3079
3079
  function useFieldSelect(props) {
@@ -3663,11 +3663,11 @@ function calculateDuration({ length }) {
3663
3663
  }
3664
3664
  return duration + DURATION_RESET;
3665
3665
  }
3666
- function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
3666
+ function RlsSnackbar({ content, onClose, icon, rlsTheme, title, visible }) {
3667
3667
  const className = useMemo(() => {
3668
3668
  return renderClassStatus('rls-snackbar', { visible });
3669
3669
  }, [visible]);
3670
- return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__component", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntimeExports.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
3670
+ return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntimeExports.jsx("button", { onClick: onClose, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
3671
3671
  }
3672
3672
  function useSnackbar() {
3673
3673
  const [state, setState] = useState({
@@ -3676,14 +3676,17 @@ function useSnackbar() {
3676
3676
  timeoutId: undefined,
3677
3677
  visible: false
3678
3678
  });
3679
- const rlsSnackbar = jsxRuntimeExports.jsx(RlsSnackbar, { ...state.config, visible: state.visible });
3679
+ const onClose = useCallback(() => {
3680
+ setState((state) => ({ ...state, timeoutId: undefined, visible: false }));
3681
+ }, []);
3682
+ const rlsSnackbar = (jsxRuntimeExports.jsx(RlsSnackbar, { ...state.config, visible: state.visible, onClose: onClose }));
3680
3683
  useEffect(() => {
3681
3684
  if (state.visible) {
3682
3685
  const timeoutId = setTimeout(() => {
3683
3686
  setState((state) => ({
3684
3687
  ...state,
3685
- visible: false,
3686
- timeoutId: undefined
3688
+ timeoutId: undefined,
3689
+ visible: false
3687
3690
  }));
3688
3691
  }, state.duration);
3689
3692
  setState((state) => ({ ...state, timeoutId }));