@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/cjs/index.js CHANGED
@@ -2423,11 +2423,11 @@ class ConfirmationResult extends commons.PartialSealed {
2423
2423
  return new ConfirmationResult('reject');
2424
2424
  }
2425
2425
  }
2426
- function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
2427
- const className = require$$0.useMemo(() => {
2428
- return renderClassStatus('rls-confirmation', { visible });
2429
- }, [visible]);
2430
- 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" })] }));
2426
+ function RlsConfirmation({ approved, className, content, reject, rlsTheme, subtitle, title, visible }) {
2427
+ const classConfirmation = require$$0.useMemo(() => {
2428
+ return renderClassStatus('rls-confirmation', { visible }, className);
2429
+ }, [visible, className]);
2430
+ 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" })] }));
2431
2431
  }
2432
2432
  function useConfirmation() {
2433
2433
  const [config, setConfig] = require$$0.useState({});
@@ -2435,29 +2435,30 @@ function useConfirmation() {
2435
2435
  const component = ReactDOM.createPortal(jsxRuntimeExports.jsx(RlsConfirmation, { ...config, visible: visible }), document.body);
2436
2436
  const confirmation = require$$0.useCallback((options) => {
2437
2437
  return new Promise((resolve) => {
2438
- const { approved, reject } = options;
2439
2438
  setConfig({
2440
2439
  ...options,
2441
2440
  approved: {
2442
- label: approved?.label ?? reactI18n('confirmationActionApproved'),
2441
+ label: options.approved?.label ?? reactI18n('confirmationActionApproved'),
2443
2442
  onClick: () => {
2444
2443
  setVisible(false);
2445
2444
  resolve(ConfirmationResult.approved());
2446
2445
  },
2447
- identifier: approved?.identifier,
2448
- rlsTheme: approved?.rlsTheme,
2449
- type: approved?.type ?? 'raised'
2446
+ type: options.approved?.type ?? 'raised',
2447
+ disabled: options.approved?.disabled,
2448
+ identifier: options.approved?.identifier,
2449
+ rlsTheme: options.approved?.rlsTheme
2450
2450
  },
2451
- reject: reject
2451
+ reject: options.reject
2452
2452
  ? {
2453
- label: reject.label,
2453
+ label: options.reject.label,
2454
2454
  onClick: () => {
2455
2455
  setVisible(false);
2456
2456
  resolve(ConfirmationResult.reject());
2457
2457
  },
2458
- identifier: reject.identifier,
2459
- rlsTheme: reject.rlsTheme,
2460
- type: reject?.type ?? 'classic'
2458
+ type: options.reject.type ?? 'outline',
2459
+ disabled: options.reject.disabled,
2460
+ identifier: options.reject.identifier,
2461
+ rlsTheme: options.reject.rlsTheme
2461
2462
  }
2462
2463
  : undefined
2463
2464
  });