@rolster/react-components 18.23.11 → 18.23.12

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.
@@ -2033,15 +2033,18 @@
2033
2033
  padding: 0rem var(--rls-sizing-x8);
2034
2034
  box-sizing: border-box;
2035
2035
  }
2036
- .rls-confirmation__message {
2037
- color: var(--rls-app-color-600);
2038
- text-align: center;
2036
+ .rls-confirmation__content {
2037
+ display: flex;
2038
+ flex-direction: column;
2039
+ row-gap: var(--rls-sizing-x8);
2039
2040
  }
2040
- .rls-confirmation__message p {
2041
+ .rls-confirmation__content > p {
2041
2042
  font-weight: var(--rls-font-weight-medium);
2042
2043
  font-size: var(--pvt-content-font-size);
2043
2044
  line-height: var(--pvt-content-line-height);
2044
2045
  letter-spacing: var(--pvt-content-letter-spacing);
2046
+ text-align: center;
2047
+ color: var(--rls-app-color-600);
2045
2048
  }
2046
2049
  .rls-confirmation__footer {
2047
2050
  position: relative;
package/dist/es/index.js CHANGED
@@ -2421,11 +2421,11 @@ class ConfirmationResult extends PartialSealed {
2421
2421
  return new ConfirmationResult('reject');
2422
2422
  }
2423
2423
  }
2424
- function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
2425
- const className = useMemo(() => {
2426
- return renderClassStatus('rls-confirmation', { visible });
2427
- }, [visible]);
2428
- return (jsxRuntimeExports.jsxs("div", { className: className, "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: approved.type, onClick: approved.onClick, rlsTheme: approved.rlsTheme, children: approved.label })), reject && (jsxRuntimeExports.jsx(RlsButton, { identifier: reject.identifier, type: reject.type, onClick: reject.onClick, rlsTheme: reject.rlsTheme, children: reject.label }))] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__backdrop" })] }));
2424
+ function RlsConfirmation({ approved, className, content, reject, rlsTheme, subtitle, title, visible }) {
2425
+ const classConfirmation = useMemo(() => {
2426
+ return renderClassStatus('rls-confirmation', { visible }, className);
2427
+ }, [visible, className]);
2428
+ return (jsxRuntimeExports.jsxs("div", { className: classConfirmation, "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__content", 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: approved.type, onClick: approved.onClick, disabled: approved.disabled, rlsTheme: approved.rlsTheme, children: approved.label })), reject && (jsxRuntimeExports.jsx(RlsButton, { identifier: reject.identifier, type: reject.type, onClick: reject.onClick, disabled: reject.disabled, rlsTheme: reject.rlsTheme, children: reject.label }))] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__backdrop" })] }));
2429
2429
  }
2430
2430
  function useConfirmation() {
2431
2431
  const [config, setConfig] = useState({});
@@ -2433,29 +2433,30 @@ function useConfirmation() {
2433
2433
  const component = ReactDOM.createPortal(jsxRuntimeExports.jsx(RlsConfirmation, { ...config, visible: visible }), document.body);
2434
2434
  const confirmation = useCallback((options) => {
2435
2435
  return new Promise((resolve) => {
2436
- const { approved, reject } = options;
2437
2436
  setConfig({
2438
2437
  ...options,
2439
2438
  approved: {
2440
- label: approved?.label ?? reactI18n('confirmationActionApproved'),
2439
+ label: options.approved?.label ?? reactI18n('confirmationActionApproved'),
2441
2440
  onClick: () => {
2442
2441
  setVisible(false);
2443
2442
  resolve(ConfirmationResult.approved());
2444
2443
  },
2445
- identifier: approved?.identifier,
2446
- rlsTheme: approved?.rlsTheme,
2447
- type: approved?.type ?? 'raised'
2444
+ type: options.approved?.type ?? 'raised',
2445
+ disabled: options.approved?.disabled,
2446
+ identifier: options.approved?.identifier,
2447
+ rlsTheme: options.approved?.rlsTheme
2448
2448
  },
2449
- reject: reject
2449
+ reject: options.reject
2450
2450
  ? {
2451
- label: reject.label,
2451
+ label: options.reject.label,
2452
2452
  onClick: () => {
2453
2453
  setVisible(false);
2454
2454
  resolve(ConfirmationResult.reject());
2455
2455
  },
2456
- identifier: reject.identifier,
2457
- rlsTheme: reject.rlsTheme,
2458
- type: reject?.type ?? 'classic'
2456
+ type: options.reject.type ?? 'outline',
2457
+ disabled: options.reject.disabled,
2458
+ identifier: options.reject.identifier,
2459
+ rlsTheme: options.reject.rlsTheme
2459
2460
  }
2460
2461
  : undefined
2461
2462
  });