@rolster/react-components 18.20.5 → 18.20.7

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.
@@ -124,9 +124,11 @@
124
124
  }
125
125
  .rls-breadcrumb__label__a {
126
126
  display: inline-block;
127
- cursor: pointer;
128
127
  color: var(--pvt-link-font-color);
129
128
  }
129
+ .rls-breadcrumb__label__a--actionable {
130
+ cursor: pointer;
131
+ }
130
132
  .rls-breadcrumb__label__a--actionable:hover {
131
133
  color: var(--rls-theme-color-500);
132
134
  text-decoration: underline;
@@ -906,6 +908,36 @@
906
908
  border-radius: var(--rlc-switch-bar-radius);
907
909
  }
908
910
 
911
+ .rls-alert {
912
+ position: relative;
913
+ display: flex;
914
+ align-items: center;
915
+ column-gap: var(--rls-sizing-x6);
916
+ border-radius: var(--rls-sizing-x6);
917
+ box-sizing: border-box;
918
+ background: var(--rls-theme-color-100);
919
+ padding: var(--rls-sizing-x4) var(--rls-sizing-x6);
920
+ }
921
+ .rls-alert--bordered {
922
+ border: var(--rls-theme-border-1-500);
923
+ }
924
+ .rls-alert__icon {
925
+ --rlc-icon-color: var(--rls-theme-color-100);
926
+ display: flex;
927
+ align-items: center;
928
+ justify-content: center;
929
+ width: var(--rls-sizing-x16);
930
+ height: var(--rls-sizing-x16);
931
+ border-radius: 50%;
932
+ background: var(--rls-theme-color-500);
933
+ }
934
+ .rls-alert__icon + .rls-alert__content {
935
+ max-width: calc(100% - 22rem);
936
+ }
937
+ .rls-alert__content {
938
+ width: auto;
939
+ }
940
+
909
941
  .rls-ballot {
910
942
  --rlc-avatar-width: var(--rls-sizing-x20);
911
943
  --rlc-avatar-height: var(--rls-sizing-x20);
package/dist/cjs/index.js CHANGED
@@ -1678,6 +1678,10 @@ function RlsSwitchControl({ formControl, disabled, identifier, rlsTheme }) {
1678
1678
  }, rlsTheme: rlsTheme }));
1679
1679
  }
1680
1680
 
1681
+ function RlsAlert({ bordered, children, icon, identifier, rlsTheme }) {
1682
+ return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-alert', { bordered }), "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-alert__icon", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsx("div", { className: "rls-alert__content", children: children })] }));
1683
+ }
1684
+
1681
1685
  function RlsBallot({ bordered, children, img, initials, skeleton, subtitle, rlsTheme }) {
1682
1686
  return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-ballot', { bordered, skeleton }), "rls-theme": rlsTheme, children: [(img || initials) && (jsxRuntimeExports.jsxs(RlsAvatar, { skeleton: skeleton, children: [img && jsxRuntimeExports.jsx("img", { src: img }), initials && jsxRuntimeExports.jsx("span", { children: initials })] })), jsxRuntimeExports.jsxs("div", { className: "rls-ballot__component", children: [jsxRuntimeExports.jsx("label", { className: "rls-ballot__title", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: children }) }), subtitle && (jsxRuntimeExports.jsx("label", { className: "rls-ballot__subtitle", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: jsxRuntimeExports.jsx("span", { children: subtitle }) }) }))] })] }));
1683
1687
  }
@@ -2126,11 +2130,11 @@ class ConfirmationResult extends commons.PartialSealed {
2126
2130
  function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
2127
2131
  return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-confirmation', { visible }), "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__header", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-confirmation__title", children: title }), subtitle && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__subtitle", children: subtitle }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__body", children: content && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__message", children: content })) }), (approved || reject) && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__actions", children: [approved && (jsxRuntimeExports.jsx(RlsButton, { identifier: approved.identifier, type: "raised", onClick: approved.onClick, children: approved.label })), reject && (jsxRuntimeExports.jsx(RlsButton, { identifier: reject.identifier, type: "outline", onClick: reject.onClick, children: reject.label }))] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__backdrop" })] }));
2128
2132
  }
2129
- function useConfirmationService() {
2133
+ function useConfirmation() {
2130
2134
  const [config, setConfig] = require$$0.useState({});
2131
2135
  const [visible, setVisible] = require$$0.useState(false);
2132
2136
  const rlsConfirmation = ReactDOM.createPortal(jsxRuntimeExports.jsx(RlsConfirmation, { ...config, visible: visible }), document.body);
2133
- function confirmation(options) {
2137
+ const confirmation = require$$0.useCallback((options) => {
2134
2138
  return new Promise((resolve) => {
2135
2139
  const { content, rlsTheme, subtitle, title, approved, reject } = options;
2136
2140
  setConfig({
@@ -2159,7 +2163,7 @@ function useConfirmationService() {
2159
2163
  });
2160
2164
  setVisible(true);
2161
2165
  });
2162
- }
2166
+ }, []);
2163
2167
  return {
2164
2168
  RlsConfirmation: rlsConfirmation,
2165
2169
  confirmation
@@ -2628,7 +2632,7 @@ function calculateDuration({ length }) {
2628
2632
  function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
2629
2633
  return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-snackbar', { visible }), "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 })] })] }));
2630
2634
  }
2631
- function useSnackbarService() {
2635
+ function useSnackbar() {
2632
2636
  const [config, setConfig] = require$$0.useState({});
2633
2637
  const [duration, setDuration] = require$$0.useState(4000);
2634
2638
  const [timeoutId, setTimeoutId] = require$$0.useState();
@@ -2647,12 +2651,12 @@ function useSnackbarService() {
2647
2651
  setTimeout(() => snackbar(config), DURATION_ANIMATION);
2648
2652
  }
2649
2653
  }, [visible]);
2650
- function snackbar(config) {
2654
+ const snackbar = require$$0.useCallback((config) => {
2651
2655
  const { content } = config;
2652
2656
  setConfig(config);
2653
2657
  setDuration(calculateDuration(String(content)));
2654
- setVisible(!visible);
2655
- }
2658
+ setVisible((visible) => !visible);
2659
+ }, []);
2656
2660
  return {
2657
2661
  RlsSnackbar: rlsSnackbar,
2658
2662
  snackbar
@@ -2667,8 +2671,8 @@ const RlsContext = require$$0.createContext({
2667
2671
  withNavbar: () => { }
2668
2672
  });
2669
2673
  function RlsApplication({ children }) {
2670
- const { RlsConfirmation, confirmation } = useConfirmationService();
2671
- const { RlsSnackbar, snackbar } = useSnackbarService();
2674
+ const { RlsConfirmation, confirmation } = useConfirmation();
2675
+ const { RlsSnackbar, snackbar } = useSnackbar();
2672
2676
  const [currentWithNavbar, withNavbar] = require$$0.useState(false);
2673
2677
  return (jsxRuntimeExports.jsxs(RlsContext.Provider, { value: { confirmation, snackbar, withNavbar }, children: [jsxRuntimeExports.jsxs("div", { className: renderClassStatus('rls-app__body', {
2674
2678
  snackbar: currentWithNavbar
@@ -2676,6 +2680,7 @@ function RlsApplication({ children }) {
2676
2680
  }
2677
2681
 
2678
2682
  exports.ConfirmationResult = ConfirmationResult;
2683
+ exports.RlsAlert = RlsAlert;
2679
2684
  exports.RlsAmount = RlsAmount;
2680
2685
  exports.RlsApplication = RlsApplication;
2681
2686
  exports.RlsAvatar = RlsAvatar;
@@ -2745,9 +2750,9 @@ exports.RlsTabularText = RlsTabularText;
2745
2750
  exports.RlsToolbar = RlsToolbar;
2746
2751
  exports.rangeFormatTemplate = rangeFormatTemplate;
2747
2752
  exports.renderClassStatus = renderClassStatus;
2748
- exports.useConfirmationService = useConfirmationService;
2753
+ exports.useConfirmation = useConfirmation;
2749
2754
  exports.useDatatable = useDatatable;
2750
2755
  exports.useListController = useListController;
2751
2756
  exports.useRenderClassStatus = useRenderClassStatus;
2752
- exports.useSnackbarService = useSnackbarService;
2757
+ exports.useSnackbar = useSnackbar;
2753
2758
  //# sourceMappingURL=index.js.map