@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/cjs/index.js CHANGED
@@ -3075,7 +3075,7 @@ function RlsFieldDateRange({ children, date: _date, disabled, formControl, ident
3075
3075
  formControl?.touch();
3076
3076
  setModalIsVisible(false);
3077
3077
  }, [formControl, onChange]);
3078
- 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 }) })] }));
3078
+ 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 }) })] }));
3079
3079
  }
3080
3080
 
3081
3081
  function useFieldSelect(props) {
@@ -3665,11 +3665,11 @@ function calculateDuration({ length }) {
3665
3665
  }
3666
3666
  return duration + DURATION_RESET;
3667
3667
  }
3668
- function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
3668
+ function RlsSnackbar({ content, onClose, icon, rlsTheme, title, visible }) {
3669
3669
  const className = require$$0.useMemo(() => {
3670
3670
  return renderClassStatus('rls-snackbar', { visible });
3671
3671
  }, [visible]);
3672
- 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 })] })] }));
3672
+ 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 })] })] }));
3673
3673
  }
3674
3674
  function useSnackbar() {
3675
3675
  const [state, setState] = require$$0.useState({
@@ -3678,14 +3678,17 @@ function useSnackbar() {
3678
3678
  timeoutId: undefined,
3679
3679
  visible: false
3680
3680
  });
3681
- const rlsSnackbar = jsxRuntimeExports.jsx(RlsSnackbar, { ...state.config, visible: state.visible });
3681
+ const onClose = require$$0.useCallback(() => {
3682
+ setState((state) => ({ ...state, timeoutId: undefined, visible: false }));
3683
+ }, []);
3684
+ const rlsSnackbar = (jsxRuntimeExports.jsx(RlsSnackbar, { ...state.config, visible: state.visible, onClose: onClose }));
3682
3685
  require$$0.useEffect(() => {
3683
3686
  if (state.visible) {
3684
3687
  const timeoutId = setTimeout(() => {
3685
3688
  setState((state) => ({
3686
3689
  ...state,
3687
- visible: false,
3688
- timeoutId: undefined
3690
+ timeoutId: undefined,
3691
+ visible: false
3689
3692
  }));
3690
3693
  }, state.duration);
3691
3694
  setState((state) => ({ ...state, timeoutId }));