@rolster/react-components 18.23.13 → 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);
@@ -2160,10 +2161,9 @@
2160
2161
  } /*# sourceMappingURL=FieldAutocomplete.css.map */
2161
2162
 
2162
2163
  .rls-modal {
2163
- --pvt-component-transform: translateY(80rem) scale(0.6);
2164
+ --pvt-component-transform: translateY(150px) scale(0.6);
2164
2165
  --pvt-component-height: 0rem;
2165
2166
  --pvt-component-opacity: 0;
2166
- --pvt-component-overflow: hidden;
2167
2167
  --pvt-component-visibility: hidden;
2168
2168
  --pvt-backdrop-opacity: 0;
2169
2169
  --pvt-backdrop-bottom: initial;
@@ -2197,7 +2197,6 @@
2197
2197
  opacity: var(--pvt-component-opacity);
2198
2198
  visibility: var(--pvt-component-visibility);
2199
2199
  z-index: var(--rls-z-index-2);
2200
- overflow: var(--pvt-component-overflow);
2201
2200
  border-radius: var(--rls-sizing-x4);
2202
2201
  background: var(--rls-app-color-050);
2203
2202
  transform: var(--pvt-component-transform);
@@ -2491,7 +2490,7 @@
2491
2490
  .rls-field-date-range__action .rls-icon {
2492
2491
  margin: 1rem;
2493
2492
  }
2494
- .rls-field-date-modal {
2493
+ .rls-field-date-range-modal {
2495
2494
  --rlc-modal-max-width: 150rem;
2496
2495
  } /*# sourceMappingURL=FieldDateRange.css.map */
2497
2496
 
@@ -2730,10 +2729,22 @@
2730
2729
  flex-direction: column;
2731
2730
  row-gap: var(--rls-sizing-x2);
2732
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
+ }
2733
2744
  .rls-snackbar__title {
2745
+ white-space: nowrap;
2734
2746
  overflow: hidden;
2735
2747
  text-overflow: ellipsis;
2736
- white-space: nowrap;
2737
2748
  color: var(--rls-theme-color-500);
2738
2749
  font-size: var(--rls-body-font-size);
2739
2750
  font-weight: var(--rls-font-weight-bold);
package/dist/es/index.js CHANGED
@@ -1929,14 +1929,15 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
1929
1929
  return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__text", children: children })] }));
1930
1930
  }
1931
1931
 
1932
- function RlsLabelRadioButton({ children, disabled, extended, identifier, formControl, rlsTheme, value }) {
1932
+ function RlsLabelRadioButton({ children, disabled, extended, identifier, formControl, onValue, rlsTheme, value }) {
1933
1933
  const [checked, setChecked] = useState(formControl?.value === value);
1934
1934
  useEffect(() => {
1935
1935
  setChecked(formControl?.value === value);
1936
1936
  }, [formControl?.value]);
1937
1937
  const onSelect = useCallback(() => {
1938
1938
  formControl && formControl?.setValue(value);
1939
- }, [formControl, value]);
1939
+ onValue && onValue(value);
1940
+ }, [formControl, value, onValue]);
1940
1941
  const className = useMemo(() => {
1941
1942
  return renderClassStatus('rls-label-radiobutton', { disabled, extended });
1942
1943
  }, [disabled, extended]);
@@ -3072,7 +3073,7 @@ function RlsFieldDateRange({ children, date: _date, disabled, formControl, ident
3072
3073
  formControl?.touch();
3073
3074
  setModalIsVisible(false);
3074
3075
  }, [formControl, onChange]);
3075
- 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 }) })] }));
3076
3077
  }
3077
3078
 
3078
3079
  function useFieldSelect(props) {
@@ -3662,11 +3663,11 @@ function calculateDuration({ length }) {
3662
3663
  }
3663
3664
  return duration + DURATION_RESET;
3664
3665
  }
3665
- function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
3666
+ function RlsSnackbar({ content, onClose, icon, rlsTheme, title, visible }) {
3666
3667
  const className = useMemo(() => {
3667
3668
  return renderClassStatus('rls-snackbar', { visible });
3668
3669
  }, [visible]);
3669
- 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 })] })] }));
3670
3671
  }
3671
3672
  function useSnackbar() {
3672
3673
  const [state, setState] = useState({
@@ -3675,14 +3676,17 @@ function useSnackbar() {
3675
3676
  timeoutId: undefined,
3676
3677
  visible: false
3677
3678
  });
3678
- 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 }));
3679
3683
  useEffect(() => {
3680
3684
  if (state.visible) {
3681
3685
  const timeoutId = setTimeout(() => {
3682
3686
  setState((state) => ({
3683
3687
  ...state,
3684
- visible: false,
3685
- timeoutId: undefined
3688
+ timeoutId: undefined,
3689
+ visible: false
3686
3690
  }));
3687
3691
  }, state.duration);
3688
3692
  setState((state) => ({ ...state, timeoutId }));