@indico-data/design-system 3.0.0 → 3.0.1

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.
package/lib/index.js CHANGED
@@ -21069,8 +21069,9 @@ const Modal = (_a) => {
21069
21069
  return (jsxRuntime.jsx(ReactModal, Object.assign({ className: modalClasses, overlayClassName: overlayClasses, testId: testId, isOpen: isOpen, onRequestClose: onRequestClose, portalClassName: portalClassName, appElement: appElement, parentSelector: parentSelector, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, contentElement: contentElement, overlayElement: overlayElement }, rest, { children: jsxRuntime.jsxs("div", { className: "modal-content", style: { maxWidth: `${maxWidthInPixels}px` }, children: [jsxRuntime.jsx(Button$1, { className: "modal-close-button", onClick: onRequestClose, variant: "link", size: "md", iconLeft: "x-close", ariaLabel: "Close" }), hasHeader && (jsxRuntime.jsx("div", { className: "modal-header", children: jsxRuntime.jsx(Row, { justify: "between", align: "center", children: jsxRuntime.jsxs(Col, { children: [title && jsxRuntime.jsx("h2", { className: "modal-title", children: title }), subtitle && jsxRuntime.jsx("p", { className: "modal-subtitle", children: subtitle })] }) }) })), jsxRuntime.jsx("div", { className: "modal-body", children: children }), footer && jsxRuntime.jsx("div", { className: "modal-footer", children: footer })] }) })));
21070
21070
  };
21071
21071
 
21072
- const defaultFooter = ({ onCancelRequest, onConfirmRequest, confirmationButtonText, confirmationButtonVariant, cancelButtonText, }) => (jsxRuntime.jsxs(Row, { gutterWidth: 12, justify: "end", align: "center", children: [jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx(Button$1, { onClick: onCancelRequest, ariaLabel: cancelButtonText || 'Cancel', variant: "outline", children: cancelButtonText }) }), jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx(Button$1, { onClick: onConfirmRequest, ariaLabel: confirmationButtonText || 'Confirm', variant: confirmationButtonVariant, children: confirmationButtonText }) })] }));
21073
- const ConfirmationModal = ({ className, overlayClassName, testId, isOpen, onRequestClose, portalClassName, appElement, parentSelector, shouldCloseOnOverlayClick, shouldCloseOnEsc, contentElement, overlayElement, footer, children, onConfirmRequest, onCancelRequest, confirmationButtonText = 'Confirm', cancelButtonText = 'Cancel', confirmationButtonVariant = 'solid', icon, title, status = 'info', maxWidthInPixels, }) => {
21072
+ const defaultFooter = ({ onCancelRequest, onConfirmRequest, confirmationButtonText, confirmationButtonVariant, cancelButtonText, hasDontShowAgainCheckbox, isChecked, onDontShowAgainChange, }) => (jsxRuntime.jsxs(Row, { gutterWidth: 12, justify: "end", align: "center", children: [hasDontShowAgainCheckbox && (jsxRuntime.jsx(Col, { children: jsxRuntime.jsx(Checkbox, { label: "Don't display this again.", onChange: (e) => onDontShowAgainChange === null || onDontShowAgainChange === void 0 ? void 0 : onDontShowAgainChange(e.target.checked), isChecked: isChecked, id: "dont-show-again", name: "dont-show-again" }) })), jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx(Button$1, { onClick: onCancelRequest, ariaLabel: cancelButtonText || 'Cancel', variant: "outline", children: cancelButtonText }) }), jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx(Button$1, { onClick: () => onConfirmRequest === null || onConfirmRequest === void 0 ? void 0 : onConfirmRequest({ dontShowAgain: isChecked }), ariaLabel: confirmationButtonText || 'Confirm', variant: confirmationButtonVariant, children: confirmationButtonText }) })] }));
21073
+ const ConfirmationModal = ({ className, overlayClassName, testId, isOpen, onRequestClose, portalClassName, appElement, parentSelector, shouldCloseOnOverlayClick, shouldCloseOnEsc, contentElement, overlayElement, footer, children, onConfirmRequest, onCancelRequest, confirmationButtonText = 'Confirm', cancelButtonText = 'Cancel', confirmationButtonVariant = 'solid', icon, title, status = 'info', maxWidthInPixels, hasDontShowAgainCheckbox, }) => {
21074
+ const [dontShowAgain, setDontShowAgain] = React.useState(false);
21074
21075
  const modalFooter = footer ||
21075
21076
  defaultFooter({
21076
21077
  onCancelRequest,
@@ -21078,6 +21079,9 @@ const ConfirmationModal = ({ className, overlayClassName, testId, isOpen, onRequ
21078
21079
  confirmationButtonText,
21079
21080
  cancelButtonText,
21080
21081
  confirmationButtonVariant,
21082
+ hasDontShowAgainCheckbox,
21083
+ isChecked: dontShowAgain,
21084
+ onDontShowAgainChange: setDontShowAgain,
21081
21085
  });
21082
21086
  return (jsxRuntime.jsxs(Modal, { className: classNames('confirmation-modal', className), overlayClassName: overlayClassName, testId: testId, isOpen: isOpen, onRequestClose: onRequestClose, portalClassName: portalClassName, appElement: appElement, parentSelector: parentSelector, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, contentElement: contentElement, overlayElement: overlayElement, footer: modalFooter, maxWidthInPixels: maxWidthInPixels, children: [icon && (jsxRuntime.jsx(Icon, { name: icon, className: classNames('confirmation-modal-icon', `color-${status}`), size: "xl" })), title && jsxRuntime.jsx("h2", { className: "confirmation-modal-title", children: title }), children] }));
21083
21087
  };