@stenajs-webui/modal
Advanced tools
Comparing version 21.21.1 to 21.21.2
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode("._overlay_5x3op_1{--swui-modal-animation-time: var(--swui-animation-time-fast);--swui-modal-overlay-bg-color: var(--swui-overlay-bg-color);--swui-modal-content-bg-color: var(--swui-white);--swui-modal-width: 960px;--swui-modal-max-width: 100%;--swui-modal-header-border-color: var(--lhds-color-ui-300);--swui-modal-shadow: var(--swui-shadow-modal);--swui-modal-footer-shadow: var(--swui-shadow-modal);position:fixed;z-index:10;top:0;left:0;right:0;bottom:0;background-color:var(--swui-modal-overlay-bg-color);overflow:auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;animation:_fadeIn_5x3op_1 var(--swui-modal-animation-time) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_5x3op_1{background-color:#fff}}._overlay_5x3op_1 ._modal_5x3op_31{max-width:100%;outline:none;pointer-events:none}@media (max-width: 768px){._overlay_5x3op_1 ._modal_5x3op_31{width:100%}}._overlay_5x3op_1 ._content_5x3op_41{position:relative;display:block;background:var(--swui-modal-content-bg-color);box-shadow:var(--swui-modal-shadow);pointer-events:all;top:calc(var(--swui-metrics-space) * 2);width:var(--swui-modal-width);max-width:var(--swui-modal-max-width)}@media (max-width: 768px){._overlay_5x3op_1 ._content_5x3op_41{top:0;width:100%;max-width:100%}}._overlay_5x3op_1 ._content_5x3op_41{animation:_appear_5x3op_1 var(--swui-animation-time-fast) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_5x3op_1 ._content_5x3op_41{box-shadow:none;top:0}}._overlay_5x3op_1 ._content_5x3op_41 :focus{outline:0}._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle{cursor:move}._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle .draggable-modal-cancel,._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle [role=tooltip]{cursor:initial}@keyframes _fadeIn_5x3op_1{0%{background-color:var(--swui-hidden)}to{background-color:var(--swui-modal-overlay-bg-color)}}@keyframes _appear_5x3op_1{0%{opacity:0}to{opacity:1}}._footer_5x3op_101{background-color:var(--swui-modal-content-bg-color)}._stickyFooter_5x3op_105{position:sticky;bottom:0;box-shadow:var(--swui-modal-footer-shadow)}@media print{._stickyFooter_5x3op_105{position:static;box-shadow:none}}._portal_17ze5_1{--drawer-width: 370px}._portal_17ze5_1 ._overlay_17ze5_4{position:fixed;top:0;right:0;bottom:0;left:0}._portal_17ze5_1 ._content_17ze5_9{box-shadow:var(--swui-shadow-modal);background:#fff;position:absolute;transition:transform var(--swui-animation-time-medium) ease-in-out}._portal_17ze5_1 ._content_17ze5_9._floating_17ze5_15{margin:var(--swui-metrics-space);border-radius:var(--swui-border-radius)}@media (max-width: 768px){._portal_17ze5_1 ._content_17ze5_9._floating_17ze5_15{margin:0;border-radius:0}}._portal_17ze5_1 ._content_17ze5_9:focus-visible{outline:unset}._portal_17ze5_1 ._content_17ze5_9._slideFromLeft_17ze5_29,._portal_17ze5_1 ._content_17ze5_9._slideFromRight_17ze5_30{transform:translate(var(--translate-x-outside-screen, 0));overflow-y:auto;top:0;bottom:0}._portal_17ze5_1 ._content_17ze5_9._slideFromLeft_17ze5_29._afterOpen_17ze5_36,._portal_17ze5_1 ._content_17ze5_9._slideFromRight_17ze5_30._afterOpen_17ze5_36{transform:translate(0)}._portal_17ze5_1 ._content_17ze5_9._slideFromLeft_17ze5_29._beforeClose_17ze5_40,._portal_17ze5_1 ._content_17ze5_9._slideFromRight_17ze5_30._beforeClose_17ze5_40{transform:translate(var(--translate-x-outside-screen))}._portal_17ze5_1 ._content_17ze5_9._slideFromTop_17ze5_45,._portal_17ze5_1 ._content_17ze5_9._slideFromBottom_17ze5_46{transform:translateY(var(--translate-y-outside-screen, 0));overflow-x:auto;left:0;right:0}._portal_17ze5_1 ._content_17ze5_9._slideFromTop_17ze5_45._afterOpen_17ze5_36,._portal_17ze5_1 ._content_17ze5_9._slideFromBottom_17ze5_46._afterOpen_17ze5_36{transform:translateY(0)}._portal_17ze5_1 ._content_17ze5_9._slideFromTop_17ze5_45._beforeClose_17ze5_40,._portal_17ze5_1 ._content_17ze5_9._slideFromBottom_17ze5_46._beforeClose_17ze5_40{transform:translateY(var(--translate-y-outside-screen))}._portal_17ze5_1 ._content_17ze5_9._slideFromLeft_17ze5_29{--translate-x-outside-screen: -100%;width:var(--drawer-width);left:0}._portal_17ze5_1 ._content_17ze5_9._slideFromRight_17ze5_30{--translate-x-outside-screen: 100%;width:var(--drawer-width);right:0}._portal_17ze5_1 ._content_17ze5_9._slideFromTop_17ze5_45{--translate-y-outside-screen: -100%;height:var(--drawer-width);top:0}._portal_17ze5_1 ._content_17ze5_9._slideFromBottom_17ze5_46{--translate-y-outside-screen: 100%;height:var(--drawer-width);bottom:0}._overlay_r9tkq_1{--swui-modal-animation-time: var(--swui-animation-time-fast);--swui-modal-overlay-bg-color: var(--swui-overlay-bg-color);--swui-modal-content-bg-color: var(--swui-white);--swui-modal-width: 960px;--swui-modal-max-width: 100%;--swui-modal-header-border-color: var(--lhds-color-ui-300);--swui-modal-shadow: var(--swui-shadow-modal);--swui-modal-footer-shadow: var(--swui-shadow-modal);position:fixed;z-index:10;top:0;left:0;right:0;bottom:0;background-color:var(--swui-modal-overlay-bg-color);overflow:auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;animation:_fadeIn_r9tkq_1 var(--swui-modal-animation-time) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_r9tkq_1{background-color:#fff}}._overlay_r9tkq_1 ._modal_r9tkq_31{max-width:100%;outline:none;pointer-events:none;padding:var(--swui-metrics-space)}._overlay_r9tkq_1 ._content_r9tkq_38{position:relative;display:block;background:var(--swui-modal-content-bg-color);box-shadow:var(--swui-modal-shadow);border-radius:var(--swui-border-radius-large);pointer-events:all;width:var(--swui-modal-width);max-width:var(--swui-modal-max-width);animation:_appear_r9tkq_1 var(--swui-animation-time-fast) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_r9tkq_1 ._content_r9tkq_38{box-shadow:none;top:0}}._overlay_r9tkq_1 ._content_r9tkq_38 :focus{outline:0}._overlay_r9tkq_1 ._content_r9tkq_38._isDraggable_r9tkq_61 .draggable-modal-handle{cursor:move}._overlay_r9tkq_1 ._content_r9tkq_38._isDraggable_r9tkq_61 .draggable-modal-handle .draggable-modal-cancel,._overlay_r9tkq_1 ._content_r9tkq_38._isDraggable_r9tkq_61 .draggable-modal-handle [role=tooltip]{cursor:initial}@keyframes _fadeIn_r9tkq_1{0%{background-color:var(--swui-hidden)}to{background-color:var(--swui-modal-overlay-bg-color)}}@keyframes _appear_r9tkq_1{0%{opacity:0}to{opacity:1}}._footer_r9tkq_92{background-color:var(--swui-modal-content-bg-color)}._stickyFooter_r9tkq_96{position:sticky;bottom:0;box-shadow:var(--swui-modal-footer-shadow)}@media print{._stickyFooter_r9tkq_96{position:static;box-shadow:none}}._overlay_15dqv_1{--swui-modal-animation-time: var(--swui-animation-time-medium);--swui-modal-overlay-bg-color: var(--swui-overlay-bg-color);--swui-modal-content-bg-color: var(--swui-white);--swui-modal-width: 960px;--swui-modal-max-width: 100%;--swui-modal-header-border-color: var(--lhds-color-ui-300);--swui-modal-shadow: var(--swui-shadow-modal);--swui-modal-footer-shadow: var(--swui-shadow-modal);position:fixed;z-index:10;top:0;left:0;right:0;bottom:0;background-color:var(--swui-modal-overlay-bg-color);display:flex;flex-direction:column;justify-content:flex-start;align-items:center;opacity:0}._overlay_15dqv_1._afterOpen_15dqv_24:not(._beforeClose_15dqv_24){animation:_fadeIn_15dqv_1 var(--swui-modal-animation-time) forwards}._overlay_15dqv_1._beforeClose_15dqv_24{animation:_fadeOut_15dqv_1 var(--swui-modal-animation-time) forwards}@media print{._overlay_15dqv_1{background-color:#fff}}._overlay_15dqv_1 ._modal_15dqv_36{max-width:100%;outline:none;pointer-events:none;padding:calc(var(--swui-metrics-space) * 2);box-sizing:border-box;max-height:100%;transform:translateY(-100%)}@media (max-width: 768px){._overlay_15dqv_1 ._modal_15dqv_36{padding:0;width:100%}}._overlay_15dqv_1 ._modal_15dqv_36._afterOpen_15dqv_24:not(._beforeClose_15dqv_24){animation:_slideIn_15dqv_1 var(--swui-modal-animation-time) forwards}._overlay_15dqv_1 ._modal_15dqv_36._beforeClose_15dqv_24{animation:_slideOut_15dqv_1 var(--swui-modal-animation-time) forwards}._overlay_15dqv_1 ._content_15dqv_59{position:relative;display:block;background:var(--swui-modal-content-bg-color);box-shadow:var(--swui-modal-shadow);border-radius:var(--swui-border-radius-large);pointer-events:all;width:var(--swui-modal-width);max-width:var(--swui-modal-max-width);height:100%;overflow:hidden;overflow-y:auto}@media (max-width: 768px){._overlay_15dqv_1 ._content_15dqv_59{border-radius:0;width:100%;max-width:100%;min-height:100vh}}@media (min-width: 769px){._overlay_15dqv_1 ._content_15dqv_59{border-radius:var(--swui-border-radius-large)}._overlay_15dqv_1 ._content_15dqv_59::-webkit-scrollbar-thumb{background-color:var(--lhds-color-ui-400);border:4px solid transparent;border-radius:8px;background-clip:padding-box}._overlay_15dqv_1 ._content_15dqv_59::-webkit-scrollbar{width:16px}}@media print{._overlay_15dqv_1 ._content_15dqv_59{box-shadow:none;top:0}}._overlay_15dqv_1 ._content_15dqv_59 :focus{outline:0}@keyframes _fadeIn_15dqv_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_15dqv_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_15dqv_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOut_15dqv_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}._footer_15dqv_148{background-color:var(--swui-modal-content-bg-color)}._stickyFooter_15dqv_152{position:sticky;bottom:0;box-shadow:var(--swui-modal-footer-shadow)}@media print{._stickyFooter_15dqv_152{position:static;box-shadow:none}}._modal_4fwgb_1{display:flex;justify-content:center;align-items:center;position:fixed;top:0;left:0;right:0;bottom:0;background-color:transparent}._overlay_4fwgb_13{position:fixed;top:0;left:0;right:0;bottom:0;background-color:var(--swui-overlay-bg-color)}._alertDialog_14t8t_1{border:0;outline:0;border-radius:var(--swui-border-radius-large);margin:auto;padding:0;overscroll-behavior:contain;opacity:0;pointer-events:none;box-shadow:#0003 0 0 10px 4px}._alertDialog_14t8t_1:not([open]){display:none}._alertDialog_14t8t_1[open]{opacity:1;pointer-events:auto;animation:_slideIn_14t8t_1 .25s forwards}._alertDialog_14t8t_1._closing_14t8t_22[open]{animation:_slideOut_14t8t_1 .25s forwards}._alertDialog_14t8t_1::backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0d0e1080;animation:_fadeIn_14t8t_1 .25s forwards}._alertDialog_14t8t_1._closing_14t8t_22::backdrop{animation:_fadeOut_14t8t_1 .25s forwards}@keyframes _fadeIn_14t8t_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_14t8t_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_14t8t_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOut_14t8t_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}._drawerDialog_11g6r_1{max-height:100%;max-width:100%;border:0;outline:0;margin:0;padding:0;overflow-y:auto;overscroll-behavior:contain;box-shadow:#0003 0 0 10px 4px;position:fixed}._drawerDialog_11g6r_1._left_11g6r_13,._drawerDialog_11g6r_1._right_11g6r_14{height:100%;top:0;bottom:0}._drawerDialog_11g6r_1._left_11g6r_13 ._contentWrapper_11g6r_19,._drawerDialog_11g6r_1._right_11g6r_14 ._contentWrapper_11g6r_19{height:100%}@media (max-width: 768px){._drawerDialog_11g6r_1._left_11g6r_13,._drawerDialog_11g6r_1._right_11g6r_14{width:-moz-fit-content;width:fit-content}}._drawerDialog_11g6r_1._left_11g6r_13{left:0;right:unset}._drawerDialog_11g6r_1._left_11g6r_13[open]{animation:_slideInLeft_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._left_11g6r_13._closing_11g6r_36[open]{animation:_slideOutLeft_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._right_11g6r_14{left:unset;right:0}._drawerDialog_11g6r_1._right_11g6r_14[open]{animation:_slideInRight_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._right_11g6r_14._closing_11g6r_36[open]{animation:_slideOutRight_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._top_11g6r_54,._drawerDialog_11g6r_1._bottom_11g6r_55{width:100%;left:0;right:0}@media (max-width: 768px){._drawerDialog_11g6r_1._top_11g6r_54,._drawerDialog_11g6r_1._bottom_11g6r_55{height:-moz-fit-content;height:fit-content}}._drawerDialog_11g6r_1._top_11g6r_54{top:0;bottom:unset}._drawerDialog_11g6r_1._top_11g6r_54[open]{animation:_slideInTop_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._top_11g6r_54._closing_11g6r_36[open]{animation:_slideOutTop_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._bottom_11g6r_55{top:unset;bottom:0}._drawerDialog_11g6r_1._bottom_11g6r_55[open]{animation:_slideInBottom_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._bottom_11g6r_55._closing_11g6r_36[open]{animation:_slideOutBottom_11g6r_1 .25s forwards}._drawerDialog_11g6r_1[open]{opacity:1;pointer-events:auto}@keyframes _slideInLeft_11g6r_1{0%{transform:translate(-100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes _slideOutLeft_11g6r_1{0%{transform:translate(0);opacity:0}to{transform:translate(-100%);opacity:1}}@keyframes _slideInTop_11g6r_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOutTop_11g6r_1{0%{transform:translateY(0);opacity:0}to{transform:translateY(-100%);opacity:1}}@keyframes _slideInRight_11g6r_1{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes _slideOutRight_11g6r_1{0%{transform:translate(0);opacity:0}to{transform:translate(100%);opacity:1}}@keyframes _slideInBottom_11g6r_1{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOutBottom_11g6r_1{0%{transform:translateY(0);opacity:0}to{transform:translateY(100%);opacity:1}}._modalDialog_1teni_1{border:0;outline:0;margin:auto;padding:0;overscroll-behavior:contain;opacity:0;pointer-events:none;box-shadow:#0003 0 0 10px 4px}@media (min-width: 769px){._modalDialog_1teni_1{border-radius:var(--swui-border-radius-large)}._modalDialog_1teni_1::-webkit-scrollbar-thumb{background-color:var(--lhds-color-ui-400);border:4px solid transparent;border-radius:8px;background-clip:padding-box}._modalDialog_1teni_1::-webkit-scrollbar{width:16px}}._modalDialog_1teni_1:not([open]){display:none}._modalDialog_1teni_1[open]{opacity:1;pointer-events:auto;animation:_slideIn_1teni_1 .25s forwards}._modalDialog_1teni_1._closing_1teni_36[open]{animation:_slideOut_1teni_1 .25s forwards}@media (max-width: 768px){._modalDialog_1teni_1{margin:0;width:100%;max-width:100%;height:100%;max-height:100%}}._modalDialog_1teni_1::backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0d0e1080;animation:_fadeIn_1teni_1 .25s forwards}._modalDialog_1teni_1._closing_1teni_36::backdrop{animation:_fadeOut_1teni_1 .25s forwards}@keyframes _fadeIn_1teni_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_1teni_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_1teni_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOut_1teni_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}@media (max-width: 768px){._contentWrapper_1teni_100{width:100%;height:100%}}._modalActionButtons_s27nj_1{display:flex;flex-direction:row;gap:16px;justify-content:center}@media (max-width: 768px){._modalActionButtons_s27nj_1{flex-direction:column;justify-content:stretch}}._modalFooter_112wr_1._modalFooter_112wr_1{display:flex;align-items:center;overflow:hidden;background:var(--silver-lighter);border-radius:24px 24px 0 0;padding:0 calc((var(--swui-metrics-indent) * 5));flex-shrink:0}._modalFooter_112wr_1._modalFooter_112wr_1._sticky_112wr_10{position:sticky;bottom:0}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); | ||
import A from "react-modal"; | ||
import { jsx as n, jsxs as m, Fragment as ee } from "react/jsx-runtime"; | ||
import { useRef as D, createContext as ge, useReducer as he, useState as te, useCallback as q, useMemo as ne, createElement as oe, useContext as pe } from "react"; | ||
import ye from "react-draggable"; | ||
import i from "classnames"; | ||
import { exhaustSwitchCase as Ce, Spacing as X, Row as b, Space as se, Heading as Y, Column as J, Box as B, Indent as ve, Txt as be, Text as we } from "@stenajs-webui/core"; | ||
import { Icon as ae, FlatButton as Ie, stenaTimes as Ne, Spinner as Oe, CloseButton as ce, CircledIcon as $e } from "@stenajs-webui/elements"; | ||
import { cssColor as Fe } from "@stenajs-webui/theme"; | ||
const an = (t) => { | ||
A.setAppElement(t); | ||
}, ke = "_overlay_5x3op_1", De = "_fadeIn_5x3op_1", xe = "_modal_5x3op_31", Be = "_content_5x3op_41", Ae = "_appear_5x3op_1", qe = "_isDraggable_5x3op_70", Le = "_footer_5x3op_101", ze = "_stickyFooter_5x3op_105", x = { | ||
overlay: ke, | ||
fadeIn: De, | ||
modal: xe, | ||
content: Be, | ||
appear: Ae, | ||
isDraggable: qe, | ||
footer: Le, | ||
stickyFooter: ze | ||
}, ie = "draggable-modal-handle", de = "draggable-modal-cancel", Me = ({ | ||
import B from "react-modal"; | ||
import { jsx as n, jsxs as u, Fragment as ne } from "react/jsx-runtime"; | ||
import { useRef as k, createContext as pe, useReducer as ye, useState as H, useCallback as A, useMemo as oe, createElement as se, useContext as Ce } from "react"; | ||
import ve from "react-draggable"; | ||
import d from "classnames"; | ||
import { exhaustSwitchCase as be, Spacing as Y, Row as b, Space as re, Heading as J, Column as K, Box as x, Indent as we, Txt as Ie, Text as Oe } from "@stenajs-webui/core"; | ||
import { Icon as ce, FlatButton as Ne, stenaTimes as $e, Spinner as Fe, CloseButton as ie, CircledIcon as ke } from "@stenajs-webui/elements"; | ||
import { cssColor as De } from "@stenajs-webui/theme"; | ||
const dn = (t) => { | ||
B.setAppElement(t); | ||
}, xe = "_overlay_5x3op_1", Be = "_fadeIn_5x3op_1", Ae = "_modal_5x3op_31", qe = "_content_5x3op_41", Le = "_appear_5x3op_1", ze = "_isDraggable_5x3op_70", Me = "_footer_5x3op_101", We = "_stickyFooter_5x3op_105", D = { | ||
overlay: xe, | ||
fadeIn: Be, | ||
modal: Ae, | ||
content: qe, | ||
appear: Le, | ||
isDraggable: ze, | ||
footer: Me, | ||
stickyFooter: We | ||
}, de = "draggable-modal-handle", _e = "draggable-modal-cancel", Se = ({ | ||
width: t, | ||
@@ -26,19 +26,19 @@ maxWidth: e, | ||
children: s, | ||
...a | ||
...c | ||
}) => { | ||
const u = D(null); | ||
const f = k(null); | ||
return /* @__PURE__ */ n( | ||
A, | ||
B, | ||
{ | ||
overlayClassName: x.overlay, | ||
className: x.modal, | ||
...a, | ||
overlayClassName: D.overlay, | ||
className: D.modal, | ||
...c, | ||
children: /* @__PURE__ */ n( | ||
ye, | ||
ve, | ||
{ | ||
handle: `.${ie}`, | ||
cancel: `.${de}, button, [role="tooltip"]`, | ||
handle: `.${de}`, | ||
cancel: `.${_e}, button, [role="tooltip"]`, | ||
bounds: ".ReactModal__Overlay", | ||
disabled: !o, | ||
nodeRef: u, | ||
nodeRef: f, | ||
children: /* @__PURE__ */ n( | ||
@@ -51,6 +51,6 @@ "div", | ||
}, | ||
className: i(x.content, { | ||
[x.isDraggable]: o | ||
className: d(D.content, { | ||
[D.isDraggable]: o | ||
}), | ||
ref: u, | ||
ref: f, | ||
children: s | ||
@@ -63,14 +63,14 @@ } | ||
); | ||
}, We = "_portal_17ze5_1", Se = "_overlay_17ze5_4", Ee = "_content_17ze5_9", Te = "_floating_17ze5_15", He = "_slideFromLeft_17ze5_29", Pe = "_slideFromRight_17ze5_30", Ge = "_afterOpen_17ze5_36", Ve = "_beforeClose_17ze5_40", Xe = "_slideFromTop_17ze5_45", Ye = "_slideFromBottom_17ze5_46", _ = { | ||
portal: We, | ||
overlay: Se, | ||
content: Ee, | ||
floating: Te, | ||
slideFromLeft: He, | ||
slideFromRight: Pe, | ||
afterOpen: Ge, | ||
beforeClose: Ve, | ||
slideFromTop: Xe, | ||
slideFromBottom: Ye | ||
}, cn = ({ | ||
}, Te = "_portal_17ze5_1", Ee = "_overlay_17ze5_4", He = "_content_17ze5_9", Pe = "_floating_17ze5_15", Ge = "_slideFromLeft_17ze5_29", Ve = "_slideFromRight_17ze5_30", Xe = "_afterOpen_17ze5_36", Ye = "_beforeClose_17ze5_40", Je = "_slideFromTop_17ze5_45", Ke = "_slideFromBottom_17ze5_46", m = { | ||
portal: Te, | ||
overlay: Ee, | ||
content: He, | ||
floating: Pe, | ||
slideFromLeft: Ge, | ||
slideFromRight: Ve, | ||
afterOpen: Xe, | ||
beforeClose: Ye, | ||
slideFromTop: Je, | ||
slideFromBottom: Ke | ||
}, _n = ({ | ||
background: t, | ||
@@ -80,46 +80,46 @@ zIndex: e, | ||
slideFrom: s = "left", | ||
portalTarget: a, | ||
floating: u, | ||
...f | ||
portalTarget: c, | ||
floating: f, | ||
...g | ||
}) => { | ||
const { height: g, width: w } = f; | ||
const { height: h, width: w } = g; | ||
return /* @__PURE__ */ n( | ||
A, | ||
B, | ||
{ | ||
closeTimeoutMS: 250, | ||
portalClassName: _.portal, | ||
portalClassName: m.portal, | ||
overlayClassName: { | ||
base: _.overlay, | ||
afterOpen: _.afterOpen, | ||
beforeClose: _.beforeClose | ||
base: m.overlay, | ||
afterOpen: m.afterOpen, | ||
beforeClose: m.beforeClose | ||
}, | ||
className: { | ||
base: i( | ||
_.content, | ||
Je(s), | ||
u && _.floating | ||
base: d( | ||
m.content, | ||
Qe(s), | ||
f && m.floating | ||
), | ||
afterOpen: _.afterOpen, | ||
beforeClose: _.beforeClose | ||
afterOpen: m.afterOpen, | ||
beforeClose: m.beforeClose | ||
}, | ||
style: { content: { width: w, height: g, background: t }, overlay: { zIndex: e } }, | ||
parentSelector: a ? () => a : void 0, | ||
...f, | ||
style: { content: { width: w, height: h, background: t }, overlay: { zIndex: e } }, | ||
parentSelector: c ? () => c : void 0, | ||
...g, | ||
children: o | ||
} | ||
); | ||
}, Je = (t) => { | ||
}, Qe = (t) => { | ||
switch (t) { | ||
case "left": | ||
return _.slideFromLeft; | ||
return m.slideFromLeft; | ||
case "right": | ||
return _.slideFromRight; | ||
return m.slideFromRight; | ||
case "top": | ||
return _.slideFromTop; | ||
return m.slideFromTop; | ||
case "bottom": | ||
return _.slideFromBottom; | ||
return m.slideFromBottom; | ||
default: | ||
return Ce(t, _.slideFromLeft); | ||
return be(t, m.slideFromLeft); | ||
} | ||
}, dn = ({ | ||
}, mn = ({ | ||
header: t, | ||
@@ -130,3 +130,3 @@ contentRight: e, | ||
}) => /* @__PURE__ */ n( | ||
X, | ||
Y, | ||
{ | ||
@@ -136,4 +136,4 @@ position: "sticky", | ||
zIndex: 100, | ||
background: Fe("--lhds-color-ui-50"), | ||
children: /* @__PURE__ */ m( | ||
background: De("--lhds-color-ui-50"), | ||
children: /* @__PURE__ */ u( | ||
b, | ||
@@ -145,13 +145,13 @@ { | ||
children: [ | ||
/* @__PURE__ */ m(b, { alignItems: "center", gap: 2, children: [ | ||
/* @__PURE__ */ n(se, { num: 1 }), | ||
s && /* @__PURE__ */ n(ae, { icon: s, size: 24 }), | ||
/* @__PURE__ */ n(Y, { variant: "h4", children: t }) | ||
/* @__PURE__ */ u(b, { alignItems: "center", gap: 2, children: [ | ||
/* @__PURE__ */ n(re, { num: 1 }), | ||
s && /* @__PURE__ */ n(ce, { icon: s, size: 24 }), | ||
/* @__PURE__ */ n(J, { variant: "h4", children: t }) | ||
] }), | ||
/* @__PURE__ */ m(b, { gap: 1, children: [ | ||
/* @__PURE__ */ u(b, { gap: 1, children: [ | ||
e, | ||
/* @__PURE__ */ n( | ||
Ie, | ||
Ne, | ||
{ | ||
leftIcon: Ne, | ||
leftIcon: $e, | ||
onClick: o, | ||
@@ -161,3 +161,3 @@ variant: "danger" | ||
), | ||
/* @__PURE__ */ n(se, { num: 0.5 }) | ||
/* @__PURE__ */ n(re, { num: 0.5 }) | ||
] }) | ||
@@ -168,20 +168,20 @@ ] | ||
} | ||
), Ke = "_overlay_r9tkq_1", Qe = "_fadeIn_r9tkq_1", Ue = "_modal_r9tkq_31", Ze = "_content_r9tkq_38", Re = "_appear_r9tkq_1", je = "_isDraggable_r9tkq_61", et = "_footer_r9tkq_92", tt = "_stickyFooter_r9tkq_96", H = { | ||
overlay: Ke, | ||
fadeIn: Qe, | ||
modal: Ue, | ||
content: Ze, | ||
appear: Re, | ||
isDraggable: je, | ||
footer: et, | ||
stickyFooter: tt | ||
}, nt = { overlay: { justifyContent: "center" } }, _n = ({ | ||
), Ue = "_overlay_r9tkq_1", Ze = "_fadeIn_r9tkq_1", Re = "_modal_r9tkq_31", je = "_content_r9tkq_38", et = "_appear_r9tkq_1", tt = "_isDraggable_r9tkq_61", nt = "_footer_r9tkq_92", ot = "_stickyFooter_r9tkq_96", P = { | ||
overlay: Ue, | ||
fadeIn: Ze, | ||
modal: Re, | ||
content: je, | ||
appear: et, | ||
isDraggable: tt, | ||
footer: nt, | ||
stickyFooter: ot | ||
}, st = { overlay: { justifyContent: "center" } }, un = ({ | ||
children: t, | ||
...e | ||
}) => /* @__PURE__ */ n( | ||
A, | ||
B, | ||
{ | ||
overlayClassName: H.overlay, | ||
className: H.modal, | ||
style: nt, | ||
overlayClassName: P.overlay, | ||
className: P.modal, | ||
style: st, | ||
...e, | ||
@@ -191,3 +191,3 @@ children: /* @__PURE__ */ n( | ||
{ | ||
className: H.content, | ||
className: P.content, | ||
style: { "--swui-modal-width": "fit-content" }, | ||
@@ -198,15 +198,15 @@ children: t | ||
} | ||
), ot = "_overlay_15dqv_1", st = "_afterOpen_15dqv_24", rt = "_beforeClose_15dqv_24", lt = "_fadeIn_15dqv_1", at = "_fadeOut_15dqv_1", ct = "_modal_15dqv_36", it = "_slideIn_15dqv_1", dt = "_slideOut_15dqv_1", _t = "_content_15dqv_59", mt = "_footer_15dqv_148", ut = "_stickyFooter_15dqv_152", F = { | ||
overlay: ot, | ||
afterOpen: st, | ||
beforeClose: rt, | ||
fadeIn: lt, | ||
fadeOut: at, | ||
modal: ct, | ||
slideIn: it, | ||
slideOut: dt, | ||
content: _t, | ||
footer: mt, | ||
stickyFooter: ut | ||
}, ft = ({ | ||
), rt = "_overlay_15dqv_1", lt = "_afterOpen_15dqv_24", at = "_beforeClose_15dqv_24", ct = "_fadeIn_15dqv_1", it = "_fadeOut_15dqv_1", dt = "_modal_15dqv_36", _t = "_slideIn_15dqv_1", mt = "_slideOut_15dqv_1", ut = "_content_15dqv_59", ft = "_footer_15dqv_148", gt = "_stickyFooter_15dqv_152", $ = { | ||
overlay: rt, | ||
afterOpen: lt, | ||
beforeClose: at, | ||
fadeIn: ct, | ||
fadeOut: it, | ||
modal: dt, | ||
slideIn: _t, | ||
slideOut: mt, | ||
content: ut, | ||
footer: ft, | ||
stickyFooter: gt | ||
}, ht = ({ | ||
children: t, | ||
@@ -221,13 +221,13 @@ background: e, | ||
return /* @__PURE__ */ n( | ||
A, | ||
B, | ||
{ | ||
overlayClassName: { | ||
base: F.overlay, | ||
beforeClose: F.beforeClose, | ||
afterOpen: F.afterOpen | ||
base: $.overlay, | ||
beforeClose: $.beforeClose, | ||
afterOpen: $.afterOpen | ||
}, | ||
className: { | ||
base: F.modal, | ||
beforeClose: F.beforeClose, | ||
afterOpen: F.afterOpen | ||
base: $.modal, | ||
beforeClose: $.beforeClose, | ||
afterOpen: $.afterOpen | ||
}, | ||
@@ -240,3 +240,3 @@ style: s, | ||
{ | ||
className: F.content, | ||
className: $.content, | ||
style: { "--swui-modal-width": "fit-content" }, | ||
@@ -248,6 +248,6 @@ children: t | ||
); | ||
}, gt = "_modal_4fwgb_1", ht = "_overlay_4fwgb_13", re = { | ||
modal: gt, | ||
overlay: ht | ||
}, mn = ({ | ||
}, pt = "_modal_4fwgb_1", yt = "_overlay_4fwgb_13", le = { | ||
modal: pt, | ||
overlay: yt | ||
}, fn = ({ | ||
headerIconLeft: t, | ||
@@ -257,15 +257,15 @@ headerText: e, | ||
shouldCloseOnEsc: s = !1, | ||
...a | ||
...c | ||
}) => /* @__PURE__ */ n( | ||
A, | ||
B, | ||
{ | ||
...a, | ||
...c, | ||
isOpen: !0, | ||
shouldCloseOnOverlayClick: o, | ||
shouldCloseOnEsc: s, | ||
className: re.modal, | ||
overlayClassName: re.overlay, | ||
children: /* @__PURE__ */ m(J, { spacing: 2, alignItems: "center", children: [ | ||
className: le.modal, | ||
overlayClassName: le.overlay, | ||
children: /* @__PURE__ */ u(K, { spacing: 2, alignItems: "center", children: [ | ||
/* @__PURE__ */ n( | ||
B, | ||
x, | ||
{ | ||
@@ -279,13 +279,13 @@ alignItems: "center", | ||
shadow: "modal", | ||
children: /* @__PURE__ */ n(Oe, { size: "small" }) | ||
children: /* @__PURE__ */ n(Fe, { size: "small" }) | ||
} | ||
), | ||
(t || e) && /* @__PURE__ */ m(ee, { children: [ | ||
/* @__PURE__ */ n(X, {}), | ||
/* @__PURE__ */ m(b, { indent: 2, children: [ | ||
t && /* @__PURE__ */ m(ee, { children: [ | ||
/* @__PURE__ */ n(ae, { size: 14, icon: t, color: "white" }), | ||
/* @__PURE__ */ n(ve, {}) | ||
(t || e) && /* @__PURE__ */ u(ne, { children: [ | ||
/* @__PURE__ */ n(Y, {}), | ||
/* @__PURE__ */ u(b, { indent: 2, children: [ | ||
t && /* @__PURE__ */ u(ne, { children: [ | ||
/* @__PURE__ */ n(ce, { size: 14, icon: t, color: "white" }), | ||
/* @__PURE__ */ n(we, {}) | ||
] }), | ||
e && /* @__PURE__ */ n(Y, { variant: "h4", color: "white", children: e }) | ||
e && /* @__PURE__ */ n(J, { variant: "h4", color: "white", children: e }) | ||
] }) | ||
@@ -295,3 +295,3 @@ ] }) | ||
} | ||
), pt = ({ | ||
), Ct = ({ | ||
onRequestClose: t, | ||
@@ -301,3 +301,3 @@ header: e, | ||
closeButtonClassName: s | ||
}) => /* @__PURE__ */ m( | ||
}) => /* @__PURE__ */ u( | ||
b, | ||
@@ -308,10 +308,10 @@ { | ||
borderBottom: "1px solid var(--lhds-color-ui-300)", | ||
className: ie, | ||
className: de, | ||
children: [ | ||
/* @__PURE__ */ m(b, { flex: 1, indent: !0, alignItems: "center", children: [ | ||
o && /* @__PURE__ */ n(be, { className: de, size: "large", children: o }), | ||
/* @__PURE__ */ u(b, { flex: 1, indent: !0, alignItems: "center", children: [ | ||
o && /* @__PURE__ */ n(Ie, { className: _e, size: "large", children: o }), | ||
e | ||
] }), | ||
/* @__PURE__ */ n(B, { alignSelf: "flex-start", children: /* @__PURE__ */ n( | ||
ce, | ||
/* @__PURE__ */ n(x, { alignSelf: "flex-start", children: /* @__PURE__ */ n( | ||
ie, | ||
{ | ||
@@ -324,3 +324,3 @@ className: s, | ||
} | ||
), un = ({ | ||
), gn = ({ | ||
header: t, | ||
@@ -330,31 +330,31 @@ headerText: e, | ||
spacing: s, | ||
indent: a, | ||
draggable: u = !1, | ||
onRequestClose: f, | ||
closeButtonClassName: g, | ||
indent: c, | ||
draggable: f = !1, | ||
onRequestClose: g, | ||
closeButtonClassName: h, | ||
footer: w, | ||
disableStickyFooter: p = !1, | ||
...d | ||
}) => /* @__PURE__ */ m( | ||
Me, | ||
disableStickyFooter: y = !1, | ||
..._ | ||
}) => /* @__PURE__ */ u( | ||
Se, | ||
{ | ||
...d, | ||
onRequestClose: f, | ||
draggable: u, | ||
..._, | ||
onRequestClose: g, | ||
draggable: f, | ||
children: [ | ||
/* @__PURE__ */ n( | ||
pt, | ||
Ct, | ||
{ | ||
onRequestClose: f, | ||
onRequestClose: g, | ||
header: t, | ||
headerText: e, | ||
closeButtonClassName: g | ||
closeButtonClassName: h | ||
} | ||
), | ||
/* @__PURE__ */ n(B, { spacing: typeof s == "number" ? s : 1, indent: typeof a == "number" ? a : 1, children: o }), | ||
/* @__PURE__ */ n(x, { spacing: typeof s == "number" ? s : 1, indent: typeof c == "number" ? c : 1, children: o }), | ||
w && /* @__PURE__ */ n( | ||
B, | ||
x, | ||
{ | ||
className: i(x.footer, { | ||
[x.stickyFooter]: !p | ||
className: d(D.footer, { | ||
[D.stickyFooter]: !y | ||
}), | ||
@@ -366,37 +366,40 @@ children: w | ||
} | ||
), fn = ({ children: t }) => /* @__PURE__ */ n(J, { indent: 2, spacing: 2, children: t }), V = ge( | ||
), hn = ({ children: t }) => /* @__PURE__ */ n(K, { indent: 2, spacing: 2, children: t }), X = pe( | ||
void 0 | ||
); | ||
function K(t, { | ||
function Q(t, { | ||
ref: e, | ||
modal: o, | ||
contentWrapperClassName: s, | ||
closingClassName: a, | ||
contentWrapperStyle: u, | ||
dialogStyle: f, | ||
divInsteadOfDialog: g, | ||
closingClassName: c, | ||
contentWrapperStyle: f, | ||
dialogStyle: g, | ||
divInsteadOfDialog: h, | ||
disableCloseOnClickOutside: w, | ||
onResolve: p, | ||
onReject: d, | ||
onResolve: y, | ||
onReject: _, | ||
className: M, | ||
background: L | ||
background: q | ||
}) { | ||
const me = D(null), c = e ?? me, [W, ue] = he((r) => r + 1, 0), Q = D(), I = D(), C = D(), h = D(), [S, k] = te(!1), [U, v] = te(!1), E = t, fe = q( | ||
const ue = k(null), i = e ?? ue, [W, fe] = ye((r) => r + 1, 0), U = k(), I = k(), C = k(), p = k(), [Z, L] = H(!1), [S, F] = H(!1), [R, v] = H(!1), T = t, ge = A( | ||
(r) => { | ||
var l, y; | ||
return Q.current = new Promise( | ||
(O, $) => { | ||
I.current = O, h.current = $; | ||
var l, a; | ||
return U.current = new Promise( | ||
(N, he) => { | ||
I.current = N, p.current = he; | ||
} | ||
), v(!1), k(!0), ue(), C.current = r, o ? (l = c.current) == null || l.showModal() : (y = c.current) == null || y.show(), Q.current; | ||
), v(!1), L(!0), F(!0), fe(), C.current = r, o ? (l = i.current) == null || l.showModal() : (a = i.current) == null || a.show(), U.current; | ||
}, | ||
[c, o] | ||
), Z = q( | ||
[i, o] | ||
), j = A( | ||
(r) => { | ||
var l, y; | ||
v(!0), g ? (v(!1), k(!1), (y = I.current) == null || y.call(I, r), C.current = void 0, p == null || p()) : (l = c.current) == null || l.addEventListener( | ||
var l; | ||
v(!0), L(!1), h ? setTimeout(() => { | ||
var a; | ||
v(!1), F(!1), (a = I.current) == null || a.call(I, r), C.current = void 0, y == null || y(); | ||
}, 300) : (l = i.current) == null || l.addEventListener( | ||
"animationend", | ||
() => { | ||
var O, $; | ||
v(!1), k(!1), (O = c.current) == null || O.close(), ($ = I.current) == null || $.call(I, r), C.current = void 0, p == null || p(); | ||
var a, N; | ||
v(!1), F(!1), (a = i.current) == null || a.close(), (N = I.current) == null || N.call(I, r), C.current = void 0, y == null || y(); | ||
}, | ||
@@ -406,14 +409,17 @@ { once: !0 } | ||
}, | ||
[c, p, g] | ||
), R = q(() => { | ||
[i, y, h] | ||
), ee = A(() => { | ||
var r; | ||
v(!1), k(!1), (r = h.current) == null || r.call(h), d == null || d(), C.current = void 0; | ||
}, [d]), N = q( | ||
v(!1), L(!1), F(!1), (r = p.current) == null || r.call(p), _ == null || _(), C.current = void 0; | ||
}, [_]), O = A( | ||
(r) => { | ||
var l, y; | ||
v(!0), g ? (v(!1), k(!1), (y = h.current) == null || y.call(h, r), d == null || d(), C.current = void 0) : (l = c.current) == null || l.addEventListener( | ||
var l; | ||
v(!0), L(!1), h ? setTimeout(() => { | ||
var a; | ||
v(!1), F(!1), (a = p.current) == null || a.call(p, r), _ == null || _(), C.current = void 0; | ||
}, 300) : (l = i.current) == null || l.addEventListener( | ||
"animationend", | ||
() => { | ||
var O, $; | ||
v(!1), k(!1), (O = c.current) == null || O.close(), ($ = h.current) == null || $.call(h, r), d == null || d(), C.current = void 0; | ||
var a, N; | ||
v(!1), F(!1), (a = i.current) == null || a.close(), (N = p.current) == null || N.call(p, r), _ == null || _(), C.current = void 0; | ||
}, | ||
@@ -423,144 +429,137 @@ { once: !0 } | ||
}, | ||
[c, g, d] | ||
), j = q( | ||
[i, h, _] | ||
), te = A( | ||
(r) => { | ||
if (r.target !== c.current) | ||
if (r.target !== i.current) | ||
return; | ||
const l = c.current.getBoundingClientRect(); | ||
l.top <= r.clientY && r.clientY <= l.top + l.height && l.left <= r.clientX && r.clientX <= l.left + l.width || N(); | ||
const l = i.current.getBoundingClientRect(); | ||
l.top <= r.clientY && r.clientY <= l.top + l.height && l.left <= r.clientX && r.clientX <= l.left + l.width || O(); | ||
}, | ||
[c, N] | ||
), T = ne( | ||
() => ({ resolve: Z, reject: N }), | ||
[N, Z] | ||
[i, O] | ||
), E = oe( | ||
() => ({ resolve: j, reject: O }), | ||
[O, j] | ||
); | ||
return [ne( | ||
() => g ? /* @__PURE__ */ n( | ||
ft, | ||
{ | ||
isOpen: S, | ||
onRequestClose: N, | ||
background: L, | ||
children: /* @__PURE__ */ n(V.Provider, { value: T, children: /* @__PURE__ */ oe(E, { ...C.current, key: W }) }) | ||
} | ||
) : /* @__PURE__ */ n( | ||
return [oe( | ||
() => h ? /* @__PURE__ */ n(ht, { isOpen: Z, onRequestClose: O, background: q, children: /* @__PURE__ */ n(X.Provider, { value: E, children: S && /* @__PURE__ */ se(T, { ...C.current, key: W }) }) }) : /* @__PURE__ */ n( | ||
"dialog", | ||
{ | ||
onClick: w ? void 0 : j, | ||
onClose: R, | ||
ref: c, | ||
className: i(M, U && a), | ||
style: { background: L, ...f }, | ||
children: /* @__PURE__ */ n("div", { style: u, className: s, children: S && /* @__PURE__ */ n(V.Provider, { value: T, children: /* @__PURE__ */ oe(E, { ...C.current, key: W }) }) }) | ||
onClick: w ? void 0 : te, | ||
onClose: ee, | ||
ref: i, | ||
className: d(M, R && c), | ||
style: { background: q, ...g }, | ||
children: /* @__PURE__ */ n("div", { style: f, className: s, children: S && /* @__PURE__ */ n(X.Provider, { value: E, children: /* @__PURE__ */ se(T, { ...C.current, key: W }) }) }) | ||
} | ||
), | ||
[ | ||
g, | ||
L, | ||
u, | ||
s, | ||
w, | ||
M, | ||
a, | ||
f, | ||
h, | ||
Z, | ||
O, | ||
q, | ||
E, | ||
S, | ||
N, | ||
T, | ||
E, | ||
W, | ||
j, | ||
w, | ||
te, | ||
ee, | ||
i, | ||
M, | ||
R, | ||
c, | ||
U | ||
g, | ||
f, | ||
s | ||
] | ||
), { show: fe, reject: N }]; | ||
), { show: ge, reject: O }]; | ||
} | ||
const gn = () => { | ||
const t = pe(V); | ||
const pn = () => { | ||
const t = Ce(X); | ||
if (t == null) | ||
throw new Error("useDialogPromise is being used outside of dialog."); | ||
return t; | ||
}, yt = "_alertDialog_14t8t_1", Ct = "_slideIn_14t8t_1", vt = "_closing_14t8t_22", bt = "_slideOut_14t8t_1", wt = "_fadeIn_14t8t_1", It = "_fadeOut_14t8t_1", P = { | ||
alertDialog: yt, | ||
slideIn: Ct, | ||
closing: vt, | ||
slideOut: bt, | ||
fadeIn: wt, | ||
fadeOut: It | ||
}, vt = "_alertDialog_14t8t_1", bt = "_slideIn_14t8t_1", wt = "_closing_14t8t_22", It = "_slideOut_14t8t_1", Ot = "_fadeIn_14t8t_1", Nt = "_fadeOut_14t8t_1", G = { | ||
alertDialog: vt, | ||
slideIn: bt, | ||
closing: wt, | ||
slideOut: It, | ||
fadeIn: Ot, | ||
fadeOut: Nt | ||
}; | ||
function hn(t, e) { | ||
return K(t, { | ||
function yn(t, e) { | ||
return Q(t, { | ||
...e, | ||
modal: !0, | ||
closingClassName: i(e == null ? void 0 : e.closingClassName, P.closing), | ||
contentWrapperClassName: i( | ||
closingClassName: d(e == null ? void 0 : e.closingClassName, G.closing), | ||
contentWrapperClassName: d( | ||
e == null ? void 0 : e.contentWrapperClassName, | ||
P.contentWrapper | ||
G.contentWrapper | ||
), | ||
className: i(e == null ? void 0 : e.className, P.alertDialog) | ||
className: d(e == null ? void 0 : e.className, G.alertDialog) | ||
}); | ||
} | ||
const Nt = "_drawerDialog_11g6r_1", Ot = "_left_11g6r_13", $t = "_right_11g6r_14", Ft = "_contentWrapper_11g6r_19", kt = "_slideInLeft_11g6r_1", Dt = "_closing_11g6r_36", xt = "_slideOutLeft_11g6r_1", Bt = "_slideInRight_11g6r_1", At = "_slideOutRight_11g6r_1", qt = "_top_11g6r_54", Lt = "_bottom_11g6r_55", zt = "_slideInTop_11g6r_1", Mt = "_slideOutTop_11g6r_1", Wt = "_slideInBottom_11g6r_1", St = "_slideOutBottom_11g6r_1", z = { | ||
drawerDialog: Nt, | ||
left: Ot, | ||
right: $t, | ||
contentWrapper: Ft, | ||
slideInLeft: kt, | ||
closing: Dt, | ||
slideOutLeft: xt, | ||
slideInRight: Bt, | ||
slideOutRight: At, | ||
top: qt, | ||
bottom: Lt, | ||
slideInTop: zt, | ||
slideOutTop: Mt, | ||
slideInBottom: Wt, | ||
slideOutBottom: St | ||
const $t = "_drawerDialog_11g6r_1", Ft = "_left_11g6r_13", kt = "_right_11g6r_14", Dt = "_contentWrapper_11g6r_19", xt = "_slideInLeft_11g6r_1", Bt = "_closing_11g6r_36", At = "_slideOutLeft_11g6r_1", qt = "_slideInRight_11g6r_1", Lt = "_slideOutRight_11g6r_1", zt = "_top_11g6r_54", Mt = "_bottom_11g6r_55", Wt = "_slideInTop_11g6r_1", St = "_slideOutTop_11g6r_1", Tt = "_slideInBottom_11g6r_1", Et = "_slideOutBottom_11g6r_1", z = { | ||
drawerDialog: $t, | ||
left: Ft, | ||
right: kt, | ||
contentWrapper: Dt, | ||
slideInLeft: xt, | ||
closing: Bt, | ||
slideOutLeft: At, | ||
slideInRight: qt, | ||
slideOutRight: Lt, | ||
top: zt, | ||
bottom: Mt, | ||
slideInTop: Wt, | ||
slideOutTop: St, | ||
slideInBottom: Tt, | ||
slideOutBottom: Et | ||
}; | ||
function pn(t, e = "left", o) { | ||
return K(t, { | ||
function Cn(t, e = "left", o) { | ||
return Q(t, { | ||
...o, | ||
disableCloseOnClickOutside: !0, | ||
modal: !1, | ||
closingClassName: i(o == null ? void 0 : o.closingClassName, z.closing), | ||
contentWrapperClassName: i( | ||
closingClassName: d(o == null ? void 0 : o.closingClassName, z.closing), | ||
contentWrapperClassName: d( | ||
o == null ? void 0 : o.contentWrapperClassName, | ||
z.contentWrapper | ||
), | ||
className: i(o == null ? void 0 : o.className, z.drawerDialog, z[e]) | ||
className: d(o == null ? void 0 : o.className, z.drawerDialog, z[e]) | ||
}); | ||
} | ||
const Et = "_modalDialog_1teni_1", Tt = "_slideIn_1teni_1", Ht = "_closing_1teni_36", Pt = "_slideOut_1teni_1", Gt = "_fadeIn_1teni_1", Vt = "_fadeOut_1teni_1", Xt = "_contentWrapper_1teni_100", G = { | ||
modalDialog: Et, | ||
slideIn: Tt, | ||
closing: Ht, | ||
slideOut: Pt, | ||
fadeIn: Gt, | ||
fadeOut: Vt, | ||
contentWrapper: Xt | ||
const Ht = "_modalDialog_1teni_1", Pt = "_slideIn_1teni_1", Gt = "_closing_1teni_36", Vt = "_slideOut_1teni_1", Xt = "_fadeIn_1teni_1", Yt = "_fadeOut_1teni_1", Jt = "_contentWrapper_1teni_100", V = { | ||
modalDialog: Ht, | ||
slideIn: Pt, | ||
closing: Gt, | ||
slideOut: Vt, | ||
fadeIn: Xt, | ||
fadeOut: Yt, | ||
contentWrapper: Jt | ||
}; | ||
function yn(t, e) { | ||
return K(t, { | ||
function vn(t, e) { | ||
return Q(t, { | ||
...e, | ||
modal: !0, | ||
closingClassName: i(e == null ? void 0 : e.closingClassName, G.closing), | ||
contentWrapperClassName: i( | ||
closingClassName: d(e == null ? void 0 : e.closingClassName, V.closing), | ||
contentWrapperClassName: d( | ||
e == null ? void 0 : e.contentWrapperClassName, | ||
G.contentWrapper | ||
V.contentWrapper | ||
), | ||
className: i(e == null ? void 0 : e.className, G.modalDialog) | ||
className: d(e == null ? void 0 : e.className, V.modalDialog) | ||
}); | ||
} | ||
const _e = ({ | ||
const me = ({ | ||
headingLevel: t = "h2", | ||
size: e = "medium", | ||
children: o | ||
}) => /* @__PURE__ */ n(Y, { variant: e === "medium" ? "h3" : "h1", as: t, children: o }), Yt = "_modalActionButtons_s27nj_1", Jt = { | ||
modalActionButtons: Yt | ||
}, Kt = ({ | ||
}) => /* @__PURE__ */ n(J, { variant: e === "medium" ? "h3" : "h1", as: t, children: o }), Kt = "_modalActionButtons_s27nj_1", Qt = { | ||
modalActionButtons: Kt | ||
}, Ut = ({ | ||
buttons: t | ||
}) => /* @__PURE__ */ m(B, { width: "100%", children: [ | ||
/* @__PURE__ */ n(X, {}), | ||
/* @__PURE__ */ n("div", { className: Jt.modalActionButtons, children: t }) | ||
] }), Qt = ({ gap: t = 3, ...e }) => /* @__PURE__ */ n(B, { indent: 3, spacing: 3, gap: t, ...e }), Cn = ({ | ||
}) => /* @__PURE__ */ u(x, { width: "100%", children: [ | ||
/* @__PURE__ */ n(Y, {}), | ||
/* @__PURE__ */ n("div", { className: Qt.modalActionButtons, children: t }) | ||
] }), Zt = ({ gap: t = 3, ...e }) => /* @__PURE__ */ n(x, { indent: 3, spacing: 3, gap: t, ...e }), bn = ({ | ||
icon: t, | ||
@@ -570,21 +569,21 @@ buttons: e, | ||
text: s, | ||
children: a, | ||
maxWidth: u, | ||
minWidth: f | ||
}) => /* @__PURE__ */ m( | ||
Qt, | ||
children: c, | ||
maxWidth: f, | ||
minWidth: g | ||
}) => /* @__PURE__ */ u( | ||
Zt, | ||
{ | ||
flexDirection: "column", | ||
alignItems: "center", | ||
maxWidth: u, | ||
minWidth: f, | ||
maxWidth: f, | ||
minWidth: g, | ||
children: [ | ||
t && /* @__PURE__ */ n($e, { icon: t, size: "large" }), | ||
/* @__PURE__ */ n(_e, { children: o }), | ||
s && /* @__PURE__ */ n(we, { textAlign: "center", children: s }), | ||
a, | ||
e && /* @__PURE__ */ n(Kt, { buttons: e }) | ||
t && /* @__PURE__ */ n(ke, { icon: t, size: "large" }), | ||
/* @__PURE__ */ n(me, { children: o }), | ||
s && /* @__PURE__ */ n(Oe, { textAlign: "center", children: s }), | ||
c, | ||
e && /* @__PURE__ */ n(Ut, { buttons: e }) | ||
] | ||
} | ||
), vn = ({ children: t }) => /* @__PURE__ */ n(J, { flex: 1, height: "100%", justifyContent: "space-between", children: t }), bn = ({ | ||
), wn = ({ children: t }) => /* @__PURE__ */ n(K, { flex: 1, height: "100%", justifyContent: "space-between", children: t }), In = ({ | ||
heading: t, | ||
@@ -594,9 +593,9 @@ headingLevel: e, | ||
onClickClose: s | ||
}) => /* @__PURE__ */ m(b, { justifyContent: "space-between", children: [ | ||
t && /* @__PURE__ */ n(_e, { headingLevel: e, size: o, children: t }), | ||
/* @__PURE__ */ n(ce, { onClick: s }) | ||
] }), Ut = "_modalFooter_112wr_1", Zt = "_sticky_112wr_10", le = { | ||
modalFooter: Ut, | ||
sticky: Zt | ||
}, wn = ({ | ||
}) => /* @__PURE__ */ u(b, { justifyContent: "space-between", children: [ | ||
t && /* @__PURE__ */ n(me, { headingLevel: e, size: o, children: t }), | ||
/* @__PURE__ */ n(ie, { onClick: s }) | ||
] }), Rt = "_modalFooter_112wr_1", jt = "_sticky_112wr_10", ae = { | ||
modalFooter: Rt, | ||
sticky: jt | ||
}, On = ({ | ||
children: t, | ||
@@ -608,3 +607,3 @@ sticky: e, | ||
{ | ||
className: i(le.modalFooter, e && le.sticky), | ||
className: d(ae.modalFooter, e && ae.sticky), | ||
shadow: "var(--swui-sticky-footer-shadow)", | ||
@@ -616,28 +615,28 @@ zIndex: o, | ||
export { | ||
_n as Alert, | ||
Me as BaseWindow, | ||
de as DRAGGABLE_CANCEL_CLASSNAME, | ||
ie as DRAGGABLE_HANDLE_CLASSNAME, | ||
V as DialogContext, | ||
cn as Drawer, | ||
dn as DrawerHeader, | ||
Cn as InfoAlert, | ||
mn as LoadingModal, | ||
ft as Modal, | ||
Kt as ModalActionButtons, | ||
Qt as ModalBody, | ||
vn as ModalContainer, | ||
wn as ModalFooter, | ||
bn as ModalHeader, | ||
_e as ModalHeading, | ||
un as Window, | ||
fn as WindowFooter, | ||
pt as WindowHeader, | ||
an as setupDeclarativeModals, | ||
hn as useAlertDialog, | ||
K as useDialog, | ||
gn as useDialogPromise, | ||
pn as useDrawerDialog, | ||
yn as useModalDialog | ||
un as Alert, | ||
Se as BaseWindow, | ||
_e as DRAGGABLE_CANCEL_CLASSNAME, | ||
de as DRAGGABLE_HANDLE_CLASSNAME, | ||
X as DialogContext, | ||
_n as Drawer, | ||
mn as DrawerHeader, | ||
bn as InfoAlert, | ||
fn as LoadingModal, | ||
ht as Modal, | ||
Ut as ModalActionButtons, | ||
Zt as ModalBody, | ||
wn as ModalContainer, | ||
On as ModalFooter, | ||
In as ModalHeader, | ||
me as ModalHeading, | ||
gn as Window, | ||
hn as WindowFooter, | ||
Ct as WindowHeader, | ||
dn as setupDeclarativeModals, | ||
yn as useAlertDialog, | ||
Q as useDialog, | ||
pn as useDialogPromise, | ||
Cn as useDrawerDialog, | ||
vn as useModalDialog | ||
}; | ||
//# sourceMappingURL=index.es.js.map |
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode("._overlay_5x3op_1{--swui-modal-animation-time: var(--swui-animation-time-fast);--swui-modal-overlay-bg-color: var(--swui-overlay-bg-color);--swui-modal-content-bg-color: var(--swui-white);--swui-modal-width: 960px;--swui-modal-max-width: 100%;--swui-modal-header-border-color: var(--lhds-color-ui-300);--swui-modal-shadow: var(--swui-shadow-modal);--swui-modal-footer-shadow: var(--swui-shadow-modal);position:fixed;z-index:10;top:0;left:0;right:0;bottom:0;background-color:var(--swui-modal-overlay-bg-color);overflow:auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;animation:_fadeIn_5x3op_1 var(--swui-modal-animation-time) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_5x3op_1{background-color:#fff}}._overlay_5x3op_1 ._modal_5x3op_31{max-width:100%;outline:none;pointer-events:none}@media (max-width: 768px){._overlay_5x3op_1 ._modal_5x3op_31{width:100%}}._overlay_5x3op_1 ._content_5x3op_41{position:relative;display:block;background:var(--swui-modal-content-bg-color);box-shadow:var(--swui-modal-shadow);pointer-events:all;top:calc(var(--swui-metrics-space) * 2);width:var(--swui-modal-width);max-width:var(--swui-modal-max-width)}@media (max-width: 768px){._overlay_5x3op_1 ._content_5x3op_41{top:0;width:100%;max-width:100%}}._overlay_5x3op_1 ._content_5x3op_41{animation:_appear_5x3op_1 var(--swui-animation-time-fast) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_5x3op_1 ._content_5x3op_41{box-shadow:none;top:0}}._overlay_5x3op_1 ._content_5x3op_41 :focus{outline:0}._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle{cursor:move}._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle .draggable-modal-cancel,._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle [role=tooltip]{cursor:initial}@keyframes _fadeIn_5x3op_1{0%{background-color:var(--swui-hidden)}to{background-color:var(--swui-modal-overlay-bg-color)}}@keyframes _appear_5x3op_1{0%{opacity:0}to{opacity:1}}._footer_5x3op_101{background-color:var(--swui-modal-content-bg-color)}._stickyFooter_5x3op_105{position:sticky;bottom:0;box-shadow:var(--swui-modal-footer-shadow)}@media print{._stickyFooter_5x3op_105{position:static;box-shadow:none}}._portal_17ze5_1{--drawer-width: 370px}._portal_17ze5_1 ._overlay_17ze5_4{position:fixed;top:0;right:0;bottom:0;left:0}._portal_17ze5_1 ._content_17ze5_9{box-shadow:var(--swui-shadow-modal);background:#fff;position:absolute;transition:transform var(--swui-animation-time-medium) ease-in-out}._portal_17ze5_1 ._content_17ze5_9._floating_17ze5_15{margin:var(--swui-metrics-space);border-radius:var(--swui-border-radius)}@media (max-width: 768px){._portal_17ze5_1 ._content_17ze5_9._floating_17ze5_15{margin:0;border-radius:0}}._portal_17ze5_1 ._content_17ze5_9:focus-visible{outline:unset}._portal_17ze5_1 ._content_17ze5_9._slideFromLeft_17ze5_29,._portal_17ze5_1 ._content_17ze5_9._slideFromRight_17ze5_30{transform:translate(var(--translate-x-outside-screen, 0));overflow-y:auto;top:0;bottom:0}._portal_17ze5_1 ._content_17ze5_9._slideFromLeft_17ze5_29._afterOpen_17ze5_36,._portal_17ze5_1 ._content_17ze5_9._slideFromRight_17ze5_30._afterOpen_17ze5_36{transform:translate(0)}._portal_17ze5_1 ._content_17ze5_9._slideFromLeft_17ze5_29._beforeClose_17ze5_40,._portal_17ze5_1 ._content_17ze5_9._slideFromRight_17ze5_30._beforeClose_17ze5_40{transform:translate(var(--translate-x-outside-screen))}._portal_17ze5_1 ._content_17ze5_9._slideFromTop_17ze5_45,._portal_17ze5_1 ._content_17ze5_9._slideFromBottom_17ze5_46{transform:translateY(var(--translate-y-outside-screen, 0));overflow-x:auto;left:0;right:0}._portal_17ze5_1 ._content_17ze5_9._slideFromTop_17ze5_45._afterOpen_17ze5_36,._portal_17ze5_1 ._content_17ze5_9._slideFromBottom_17ze5_46._afterOpen_17ze5_36{transform:translateY(0)}._portal_17ze5_1 ._content_17ze5_9._slideFromTop_17ze5_45._beforeClose_17ze5_40,._portal_17ze5_1 ._content_17ze5_9._slideFromBottom_17ze5_46._beforeClose_17ze5_40{transform:translateY(var(--translate-y-outside-screen))}._portal_17ze5_1 ._content_17ze5_9._slideFromLeft_17ze5_29{--translate-x-outside-screen: -100%;width:var(--drawer-width);left:0}._portal_17ze5_1 ._content_17ze5_9._slideFromRight_17ze5_30{--translate-x-outside-screen: 100%;width:var(--drawer-width);right:0}._portal_17ze5_1 ._content_17ze5_9._slideFromTop_17ze5_45{--translate-y-outside-screen: -100%;height:var(--drawer-width);top:0}._portal_17ze5_1 ._content_17ze5_9._slideFromBottom_17ze5_46{--translate-y-outside-screen: 100%;height:var(--drawer-width);bottom:0}._overlay_r9tkq_1{--swui-modal-animation-time: var(--swui-animation-time-fast);--swui-modal-overlay-bg-color: var(--swui-overlay-bg-color);--swui-modal-content-bg-color: var(--swui-white);--swui-modal-width: 960px;--swui-modal-max-width: 100%;--swui-modal-header-border-color: var(--lhds-color-ui-300);--swui-modal-shadow: var(--swui-shadow-modal);--swui-modal-footer-shadow: var(--swui-shadow-modal);position:fixed;z-index:10;top:0;left:0;right:0;bottom:0;background-color:var(--swui-modal-overlay-bg-color);overflow:auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;animation:_fadeIn_r9tkq_1 var(--swui-modal-animation-time) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_r9tkq_1{background-color:#fff}}._overlay_r9tkq_1 ._modal_r9tkq_31{max-width:100%;outline:none;pointer-events:none;padding:var(--swui-metrics-space)}._overlay_r9tkq_1 ._content_r9tkq_38{position:relative;display:block;background:var(--swui-modal-content-bg-color);box-shadow:var(--swui-modal-shadow);border-radius:var(--swui-border-radius-large);pointer-events:all;width:var(--swui-modal-width);max-width:var(--swui-modal-max-width);animation:_appear_r9tkq_1 var(--swui-animation-time-fast) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_r9tkq_1 ._content_r9tkq_38{box-shadow:none;top:0}}._overlay_r9tkq_1 ._content_r9tkq_38 :focus{outline:0}._overlay_r9tkq_1 ._content_r9tkq_38._isDraggable_r9tkq_61 .draggable-modal-handle{cursor:move}._overlay_r9tkq_1 ._content_r9tkq_38._isDraggable_r9tkq_61 .draggable-modal-handle .draggable-modal-cancel,._overlay_r9tkq_1 ._content_r9tkq_38._isDraggable_r9tkq_61 .draggable-modal-handle [role=tooltip]{cursor:initial}@keyframes _fadeIn_r9tkq_1{0%{background-color:var(--swui-hidden)}to{background-color:var(--swui-modal-overlay-bg-color)}}@keyframes _appear_r9tkq_1{0%{opacity:0}to{opacity:1}}._footer_r9tkq_92{background-color:var(--swui-modal-content-bg-color)}._stickyFooter_r9tkq_96{position:sticky;bottom:0;box-shadow:var(--swui-modal-footer-shadow)}@media print{._stickyFooter_r9tkq_96{position:static;box-shadow:none}}._overlay_15dqv_1{--swui-modal-animation-time: var(--swui-animation-time-medium);--swui-modal-overlay-bg-color: var(--swui-overlay-bg-color);--swui-modal-content-bg-color: var(--swui-white);--swui-modal-width: 960px;--swui-modal-max-width: 100%;--swui-modal-header-border-color: var(--lhds-color-ui-300);--swui-modal-shadow: var(--swui-shadow-modal);--swui-modal-footer-shadow: var(--swui-shadow-modal);position:fixed;z-index:10;top:0;left:0;right:0;bottom:0;background-color:var(--swui-modal-overlay-bg-color);display:flex;flex-direction:column;justify-content:flex-start;align-items:center;opacity:0}._overlay_15dqv_1._afterOpen_15dqv_24:not(._beforeClose_15dqv_24){animation:_fadeIn_15dqv_1 var(--swui-modal-animation-time) forwards}._overlay_15dqv_1._beforeClose_15dqv_24{animation:_fadeOut_15dqv_1 var(--swui-modal-animation-time) forwards}@media print{._overlay_15dqv_1{background-color:#fff}}._overlay_15dqv_1 ._modal_15dqv_36{max-width:100%;outline:none;pointer-events:none;padding:calc(var(--swui-metrics-space) * 2);box-sizing:border-box;max-height:100%;transform:translateY(-100%)}@media (max-width: 768px){._overlay_15dqv_1 ._modal_15dqv_36{padding:0;width:100%}}._overlay_15dqv_1 ._modal_15dqv_36._afterOpen_15dqv_24:not(._beforeClose_15dqv_24){animation:_slideIn_15dqv_1 var(--swui-modal-animation-time) forwards}._overlay_15dqv_1 ._modal_15dqv_36._beforeClose_15dqv_24{animation:_slideOut_15dqv_1 var(--swui-modal-animation-time) forwards}._overlay_15dqv_1 ._content_15dqv_59{position:relative;display:block;background:var(--swui-modal-content-bg-color);box-shadow:var(--swui-modal-shadow);border-radius:var(--swui-border-radius-large);pointer-events:all;width:var(--swui-modal-width);max-width:var(--swui-modal-max-width);height:100%;overflow:hidden;overflow-y:auto}@media (max-width: 768px){._overlay_15dqv_1 ._content_15dqv_59{border-radius:0;width:100%;max-width:100%;min-height:100vh}}@media (min-width: 769px){._overlay_15dqv_1 ._content_15dqv_59{border-radius:var(--swui-border-radius-large)}._overlay_15dqv_1 ._content_15dqv_59::-webkit-scrollbar-thumb{background-color:var(--lhds-color-ui-400);border:4px solid transparent;border-radius:8px;background-clip:padding-box}._overlay_15dqv_1 ._content_15dqv_59::-webkit-scrollbar{width:16px}}@media print{._overlay_15dqv_1 ._content_15dqv_59{box-shadow:none;top:0}}._overlay_15dqv_1 ._content_15dqv_59 :focus{outline:0}@keyframes _fadeIn_15dqv_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_15dqv_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_15dqv_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOut_15dqv_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}._footer_15dqv_148{background-color:var(--swui-modal-content-bg-color)}._stickyFooter_15dqv_152{position:sticky;bottom:0;box-shadow:var(--swui-modal-footer-shadow)}@media print{._stickyFooter_15dqv_152{position:static;box-shadow:none}}._modal_4fwgb_1{display:flex;justify-content:center;align-items:center;position:fixed;top:0;left:0;right:0;bottom:0;background-color:transparent}._overlay_4fwgb_13{position:fixed;top:0;left:0;right:0;bottom:0;background-color:var(--swui-overlay-bg-color)}._alertDialog_14t8t_1{border:0;outline:0;border-radius:var(--swui-border-radius-large);margin:auto;padding:0;overscroll-behavior:contain;opacity:0;pointer-events:none;box-shadow:#0003 0 0 10px 4px}._alertDialog_14t8t_1:not([open]){display:none}._alertDialog_14t8t_1[open]{opacity:1;pointer-events:auto;animation:_slideIn_14t8t_1 .25s forwards}._alertDialog_14t8t_1._closing_14t8t_22[open]{animation:_slideOut_14t8t_1 .25s forwards}._alertDialog_14t8t_1::backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0d0e1080;animation:_fadeIn_14t8t_1 .25s forwards}._alertDialog_14t8t_1._closing_14t8t_22::backdrop{animation:_fadeOut_14t8t_1 .25s forwards}@keyframes _fadeIn_14t8t_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_14t8t_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_14t8t_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOut_14t8t_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}._drawerDialog_11g6r_1{max-height:100%;max-width:100%;border:0;outline:0;margin:0;padding:0;overflow-y:auto;overscroll-behavior:contain;box-shadow:#0003 0 0 10px 4px;position:fixed}._drawerDialog_11g6r_1._left_11g6r_13,._drawerDialog_11g6r_1._right_11g6r_14{height:100%;top:0;bottom:0}._drawerDialog_11g6r_1._left_11g6r_13 ._contentWrapper_11g6r_19,._drawerDialog_11g6r_1._right_11g6r_14 ._contentWrapper_11g6r_19{height:100%}@media (max-width: 768px){._drawerDialog_11g6r_1._left_11g6r_13,._drawerDialog_11g6r_1._right_11g6r_14{width:-moz-fit-content;width:fit-content}}._drawerDialog_11g6r_1._left_11g6r_13{left:0;right:unset}._drawerDialog_11g6r_1._left_11g6r_13[open]{animation:_slideInLeft_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._left_11g6r_13._closing_11g6r_36[open]{animation:_slideOutLeft_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._right_11g6r_14{left:unset;right:0}._drawerDialog_11g6r_1._right_11g6r_14[open]{animation:_slideInRight_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._right_11g6r_14._closing_11g6r_36[open]{animation:_slideOutRight_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._top_11g6r_54,._drawerDialog_11g6r_1._bottom_11g6r_55{width:100%;left:0;right:0}@media (max-width: 768px){._drawerDialog_11g6r_1._top_11g6r_54,._drawerDialog_11g6r_1._bottom_11g6r_55{height:-moz-fit-content;height:fit-content}}._drawerDialog_11g6r_1._top_11g6r_54{top:0;bottom:unset}._drawerDialog_11g6r_1._top_11g6r_54[open]{animation:_slideInTop_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._top_11g6r_54._closing_11g6r_36[open]{animation:_slideOutTop_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._bottom_11g6r_55{top:unset;bottom:0}._drawerDialog_11g6r_1._bottom_11g6r_55[open]{animation:_slideInBottom_11g6r_1 .25s forwards}._drawerDialog_11g6r_1._bottom_11g6r_55._closing_11g6r_36[open]{animation:_slideOutBottom_11g6r_1 .25s forwards}._drawerDialog_11g6r_1[open]{opacity:1;pointer-events:auto}@keyframes _slideInLeft_11g6r_1{0%{transform:translate(-100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes _slideOutLeft_11g6r_1{0%{transform:translate(0);opacity:0}to{transform:translate(-100%);opacity:1}}@keyframes _slideInTop_11g6r_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOutTop_11g6r_1{0%{transform:translateY(0);opacity:0}to{transform:translateY(-100%);opacity:1}}@keyframes _slideInRight_11g6r_1{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes _slideOutRight_11g6r_1{0%{transform:translate(0);opacity:0}to{transform:translate(100%);opacity:1}}@keyframes _slideInBottom_11g6r_1{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOutBottom_11g6r_1{0%{transform:translateY(0);opacity:0}to{transform:translateY(100%);opacity:1}}._modalDialog_1teni_1{border:0;outline:0;margin:auto;padding:0;overscroll-behavior:contain;opacity:0;pointer-events:none;box-shadow:#0003 0 0 10px 4px}@media (min-width: 769px){._modalDialog_1teni_1{border-radius:var(--swui-border-radius-large)}._modalDialog_1teni_1::-webkit-scrollbar-thumb{background-color:var(--lhds-color-ui-400);border:4px solid transparent;border-radius:8px;background-clip:padding-box}._modalDialog_1teni_1::-webkit-scrollbar{width:16px}}._modalDialog_1teni_1:not([open]){display:none}._modalDialog_1teni_1[open]{opacity:1;pointer-events:auto;animation:_slideIn_1teni_1 .25s forwards}._modalDialog_1teni_1._closing_1teni_36[open]{animation:_slideOut_1teni_1 .25s forwards}@media (max-width: 768px){._modalDialog_1teni_1{margin:0;width:100%;max-width:100%;height:100%;max-height:100%}}._modalDialog_1teni_1::backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0d0e1080;animation:_fadeIn_1teni_1 .25s forwards}._modalDialog_1teni_1._closing_1teni_36::backdrop{animation:_fadeOut_1teni_1 .25s forwards}@keyframes _fadeIn_1teni_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_1teni_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_1teni_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOut_1teni_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}@media (max-width: 768px){._contentWrapper_1teni_100{width:100%;height:100%}}._modalActionButtons_s27nj_1{display:flex;flex-direction:row;gap:16px;justify-content:center}@media (max-width: 768px){._modalActionButtons_s27nj_1{flex-direction:column;justify-content:stretch}}._modalFooter_112wr_1._modalFooter_112wr_1{display:flex;align-items:center;overflow:hidden;background:var(--silver-lighter);border-radius:24px 24px 0 0;padding:0 calc((var(--swui-metrics-indent) * 5));flex-shrink:0}._modalFooter_112wr_1._modalFooter_112wr_1._sticky_112wr_10{position:sticky;bottom:0}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react-modal"),e=require("react/jsx-runtime"),l=require("react"),ce=require("react-draggable"),_=require("classnames"),n=require("@stenajs-webui/core"),b=require("@stenajs-webui/elements"),ie=require("@stenajs-webui/theme"),de=s=>{k.setAppElement(s)},_e="_overlay_5x3op_1",ue="_fadeIn_5x3op_1",me="_modal_5x3op_31",ge="_content_5x3op_41",fe="_appear_5x3op_1",xe="_isDraggable_5x3op_70",he="_footer_5x3op_101",Ce="_stickyFooter_5x3op_105",F={overlay:_e,fadeIn:ue,modal:me,content:ge,appear:fe,isDraggable:xe,footer:he,stickyFooter:Ce},P="draggable-modal-handle",R="draggable-modal-cancel",ee=({width:s,maxWidth:t,draggable:o=!1,children:r,...i})=>{const g=l.useRef(null);return e.jsx(k,{overlayClassName:F.overlay,className:F.modal,...i,children:e.jsx(ce,{handle:`.${P}`,cancel:`.${R}, button, [role="tooltip"]`,bounds:".ReactModal__Overlay",disabled:!o,nodeRef:g,children:e.jsx("div",{style:{"--swui-modal-width":s,"--swui-modal-max-width":t},className:_(F.content,{[F.isDraggable]:o}),ref:g,children:r})})})},ye="_portal_17ze5_1",pe="_overlay_17ze5_4",we="_content_17ze5_9",be="_floating_17ze5_15",ve="_slideFromLeft_17ze5_29",je="_slideFromRight_17ze5_30",Ie="_afterOpen_17ze5_36",Ne="_beforeClose_17ze5_40",De="_slideFromTop_17ze5_45",Oe="_slideFromBottom_17ze5_46",m={portal:ye,overlay:pe,content:we,floating:be,slideFromLeft:ve,slideFromRight:je,afterOpen:Ie,beforeClose:Ne,slideFromTop:De,slideFromBottom:Oe},$e=({background:s,zIndex:t,children:o,slideFrom:r="left",portalTarget:i,floating:g,...f})=>{const{height:x,width:v}=f;return e.jsx(k,{closeTimeoutMS:250,portalClassName:m.portal,overlayClassName:{base:m.overlay,afterOpen:m.afterOpen,beforeClose:m.beforeClose},className:{base:_(m.content,Fe(r),g&&m.floating),afterOpen:m.afterOpen,beforeClose:m.beforeClose},style:{content:{width:v,height:x,background:s},overlay:{zIndex:t}},parentSelector:i?()=>i:void 0,...f,children:o})},Fe=s=>{switch(s){case"left":return m.slideFromLeft;case"right":return m.slideFromRight;case"top":return m.slideFromTop;case"bottom":return m.slideFromBottom;default:return n.exhaustSwitchCase(s,m.slideFromLeft)}},ke=({header:s,contentRight:t,onRequestClose:o,icon:r})=>e.jsx(n.Spacing,{position:"sticky",top:0,zIndex:100,background:ie.cssColor("--lhds-color-ui-50"),children:e.jsxs(n.Row,{justifyContent:"space-between",alignItems:"center",height:"48px",children:[e.jsxs(n.Row,{alignItems:"center",gap:2,children:[e.jsx(n.Space,{num:1}),r&&e.jsx(b.Icon,{icon:r,size:24}),e.jsx(n.Heading,{variant:"h4",children:s})]}),e.jsxs(n.Row,{gap:1,children:[t,e.jsx(b.FlatButton,{leftIcon:b.stenaTimes,onClick:o,variant:"danger"}),e.jsx(n.Space,{num:.5})]})]})}),Be="_overlay_r9tkq_1",Ae="_fadeIn_r9tkq_1",Me="_modal_r9tkq_31",qe="_content_r9tkq_38",Le="_appear_r9tkq_1",Se="_isDraggable_r9tkq_61",We="_footer_r9tkq_92",Ee="_stickyFooter_r9tkq_96",H={overlay:Be,fadeIn:Ae,modal:Me,content:qe,appear:Le,isDraggable:Se,footer:We,stickyFooter:Ee},ze={overlay:{justifyContent:"center"}},He=({children:s,...t})=>e.jsx(k,{overlayClassName:H.overlay,className:H.modal,style:ze,...t,children:e.jsx("div",{className:H.content,style:{"--swui-modal-width":"fit-content"},children:s})}),Te="_overlay_15dqv_1",Ge="_afterOpen_15dqv_24",Pe="_beforeClose_15dqv_24",Re="_fadeIn_15dqv_1",Ve="_fadeOut_15dqv_1",Xe="_modal_15dqv_36",Ye="_slideIn_15dqv_1",Je="_slideOut_15dqv_1",Ke="_content_15dqv_59",Qe="_footer_15dqv_148",Ue="_stickyFooter_15dqv_152",O={overlay:Te,afterOpen:Ge,beforeClose:Pe,fadeIn:Re,fadeOut:Ve,modal:Xe,slideIn:Ye,slideOut:Je,content:Ke,footer:Qe,stickyFooter:Ue},te=({children:s,background:t,...o})=>{const r={overlay:{justifyContent:"center"},content:{"--swui-modal-content-bg-color":t}};return e.jsx(k,{overlayClassName:{base:O.overlay,beforeClose:O.beforeClose,afterOpen:O.afterOpen},className:{base:O.modal,beforeClose:O.beforeClose,afterOpen:O.afterOpen},style:r,closeTimeoutMS:250,...o,children:e.jsx("div",{className:O.content,style:{"--swui-modal-width":"fit-content"},children:s})})},Ze="_modal_4fwgb_1",et="_overlay_4fwgb_13",U={modal:Ze,overlay:et},tt=({headerIconLeft:s,headerText:t,shouldCloseOnOverlayClick:o=!1,shouldCloseOnEsc:r=!1,...i})=>e.jsx(k,{...i,isOpen:!0,shouldCloseOnOverlayClick:o,shouldCloseOnEsc:r,className:U.modal,overlayClassName:U.overlay,children:e.jsxs(n.Column,{spacing:2,alignItems:"center",children:[e.jsx(n.Box,{alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"50%",background:"white",shadow:"modal",children:e.jsx(b.Spinner,{size:"small"})}),(s||t)&&e.jsxs(e.Fragment,{children:[e.jsx(n.Spacing,{}),e.jsxs(n.Row,{indent:2,children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(b.Icon,{size:14,icon:s,color:"white"}),e.jsx(n.Indent,{})]}),t&&e.jsx(n.Heading,{variant:"h4",color:"white",children:t})]})]})]})}),se=({onRequestClose:s,header:t,headerText:o,closeButtonClassName:r})=>e.jsxs(n.Row,{spacing:2,indent:2,borderBottom:"1px solid var(--lhds-color-ui-300)",className:P,children:[e.jsxs(n.Row,{flex:1,indent:!0,alignItems:"center",children:[o&&e.jsx(n.Txt,{className:R,size:"large",children:o}),t]}),e.jsx(n.Box,{alignSelf:"flex-start",children:e.jsx(b.CloseButton,{className:r,onClick:s})})]}),st=({header:s,headerText:t,children:o,spacing:r,indent:i,draggable:g=!1,onRequestClose:f,closeButtonClassName:x,footer:v,disableStickyFooter:C=!1,...u})=>{const A=typeof r=="number"?r:1,B=typeof i=="number"?i:1;return e.jsxs(ee,{...u,onRequestClose:f,draggable:g,children:[e.jsx(se,{onRequestClose:f,header:s,headerText:t,closeButtonClassName:x}),e.jsx(n.Box,{spacing:A,indent:B,children:o}),v&&e.jsx(n.Box,{className:_(F.footer,{[F.stickyFooter]:!C}),children:v})]})},ot=({children:s})=>e.jsx(n.Column,{indent:2,spacing:2,children:s}),q=l.createContext(void 0);function L(s,{ref:t,modal:o,contentWrapperClassName:r,closingClassName:i,contentWrapperStyle:g,dialogStyle:f,divInsteadOfDialog:x,disableCloseOnClickOutside:v,onResolve:C,onReject:u,className:A,background:B}){const re=l.useRef(null),d=t??re,[S,le]=l.useReducer(a=>a+1,0),X=l.useRef(),j=l.useRef(),p=l.useRef(),h=l.useRef(),[W,$]=l.useState(!1),[Y,w]=l.useState(!1),E=s,ae=l.useCallback(a=>{var c,y;return X.current=new Promise((N,D)=>{j.current=N,h.current=D}),w(!1),$(!0),le(),p.current=a,o?(c=d.current)==null||c.showModal():(y=d.current)==null||y.show(),X.current},[d,o]),J=l.useCallback(a=>{var c,y;w(!0),x?(w(!1),$(!1),(y=j.current)==null||y.call(j,a),p.current=void 0,C==null||C()):(c=d.current)==null||c.addEventListener("animationend",()=>{var N,D;w(!1),$(!1),(N=d.current)==null||N.close(),(D=j.current)==null||D.call(j,a),p.current=void 0,C==null||C()},{once:!0})},[d,C,x]),K=l.useCallback(()=>{var a;w(!1),$(!1),(a=h.current)==null||a.call(h),u==null||u(),p.current=void 0},[u]),I=l.useCallback(a=>{var c,y;w(!0),x?(w(!1),$(!1),(y=h.current)==null||y.call(h,a),u==null||u(),p.current=void 0):(c=d.current)==null||c.addEventListener("animationend",()=>{var N,D;w(!1),$(!1),(N=d.current)==null||N.close(),(D=h.current)==null||D.call(h,a),u==null||u(),p.current=void 0},{once:!0})},[d,x,u]),Q=l.useCallback(a=>{if(a.target!==d.current)return;const c=d.current.getBoundingClientRect();c.top<=a.clientY&&a.clientY<=c.top+c.height&&c.left<=a.clientX&&a.clientX<=c.left+c.width||I()},[d,I]),z=l.useMemo(()=>({resolve:J,reject:I}),[I,J]);return[l.useMemo(()=>x?e.jsx(te,{isOpen:W,onRequestClose:I,background:B,children:e.jsx(q.Provider,{value:z,children:l.createElement(E,{...p.current,key:S})})}):e.jsx("dialog",{onClick:v?void 0:Q,onClose:K,ref:d,className:_(A,Y&&i),style:{background:B,...f},children:e.jsx("div",{style:g,className:r,children:W&&e.jsx(q.Provider,{value:z,children:l.createElement(E,{...p.current,key:S})})})}),[x,B,g,r,v,A,i,f,W,I,z,E,S,Q,K,d,Y]),{show:ae,reject:I}]}const nt=()=>{const s=l.useContext(q);if(s==null)throw new Error("useDialogPromise is being used outside of dialog.");return s},rt="_alertDialog_14t8t_1",lt="_slideIn_14t8t_1",at="_closing_14t8t_22",ct="_slideOut_14t8t_1",it="_fadeIn_14t8t_1",dt="_fadeOut_14t8t_1",T={alertDialog:rt,slideIn:lt,closing:at,slideOut:ct,fadeIn:it,fadeOut:dt};function _t(s,t){return L(s,{...t,modal:!0,closingClassName:_(t==null?void 0:t.closingClassName,T.closing),contentWrapperClassName:_(t==null?void 0:t.contentWrapperClassName,T.contentWrapper),className:_(t==null?void 0:t.className,T.alertDialog)})}const ut="_drawerDialog_11g6r_1",mt="_left_11g6r_13",gt="_right_11g6r_14",ft="_contentWrapper_11g6r_19",xt="_slideInLeft_11g6r_1",ht="_closing_11g6r_36",Ct="_slideOutLeft_11g6r_1",yt="_slideInRight_11g6r_1",pt="_slideOutRight_11g6r_1",wt="_top_11g6r_54",bt="_bottom_11g6r_55",vt="_slideInTop_11g6r_1",jt="_slideOutTop_11g6r_1",It="_slideInBottom_11g6r_1",Nt="_slideOutBottom_11g6r_1",M={drawerDialog:ut,left:mt,right:gt,contentWrapper:ft,slideInLeft:xt,closing:ht,slideOutLeft:Ct,slideInRight:yt,slideOutRight:pt,top:wt,bottom:bt,slideInTop:vt,slideOutTop:jt,slideInBottom:It,slideOutBottom:Nt};function Dt(s,t="left",o){return L(s,{...o,disableCloseOnClickOutside:!0,modal:!1,closingClassName:_(o==null?void 0:o.closingClassName,M.closing),contentWrapperClassName:_(o==null?void 0:o.contentWrapperClassName,M.contentWrapper),className:_(o==null?void 0:o.className,M.drawerDialog,M[t])})}const Ot="_modalDialog_1teni_1",$t="_slideIn_1teni_1",Ft="_closing_1teni_36",kt="_slideOut_1teni_1",Bt="_fadeIn_1teni_1",At="_fadeOut_1teni_1",Mt="_contentWrapper_1teni_100",G={modalDialog:Ot,slideIn:$t,closing:Ft,slideOut:kt,fadeIn:Bt,fadeOut:At,contentWrapper:Mt};function qt(s,t){return L(s,{...t,modal:!0,closingClassName:_(t==null?void 0:t.closingClassName,G.closing),contentWrapperClassName:_(t==null?void 0:t.contentWrapperClassName,G.contentWrapper),className:_(t==null?void 0:t.className,G.modalDialog)})}const V=({headingLevel:s="h2",size:t="medium",children:o})=>e.jsx(n.Heading,{variant:t==="medium"?"h3":"h1",as:s,children:o}),Lt="_modalActionButtons_s27nj_1",St={modalActionButtons:Lt},oe=({buttons:s})=>e.jsxs(n.Box,{width:"100%",children:[e.jsx(n.Spacing,{}),e.jsx("div",{className:St.modalActionButtons,children:s})]}),ne=({gap:s=3,...t})=>e.jsx(n.Box,{indent:3,spacing:3,gap:s,...t}),Wt=({icon:s,buttons:t,heading:o,text:r,children:i,maxWidth:g,minWidth:f})=>e.jsxs(ne,{flexDirection:"column",alignItems:"center",maxWidth:g,minWidth:f,children:[s&&e.jsx(b.CircledIcon,{icon:s,size:"large"}),e.jsx(V,{children:o}),r&&e.jsx(n.Text,{textAlign:"center",children:r}),i,t&&e.jsx(oe,{buttons:t})]}),Et=({children:s})=>e.jsx(n.Column,{flex:1,height:"100%",justifyContent:"space-between",children:s}),zt=({heading:s,headingLevel:t,headingSize:o,onClickClose:r})=>e.jsxs(n.Row,{justifyContent:"space-between",children:[s&&e.jsx(V,{headingLevel:t,size:o,children:s}),e.jsx(b.CloseButton,{onClick:r})]}),Ht="_modalFooter_112wr_1",Tt="_sticky_112wr_10",Z={modalFooter:Ht,sticky:Tt},Gt=({children:s,sticky:t,zIndex:o=4})=>e.jsx(n.Row,{className:_(Z.modalFooter,t&&Z.sticky),shadow:"var(--swui-sticky-footer-shadow)",zIndex:o,children:s});exports.Alert=He;exports.BaseWindow=ee;exports.DRAGGABLE_CANCEL_CLASSNAME=R;exports.DRAGGABLE_HANDLE_CLASSNAME=P;exports.DialogContext=q;exports.Drawer=$e;exports.DrawerHeader=ke;exports.InfoAlert=Wt;exports.LoadingModal=tt;exports.Modal=te;exports.ModalActionButtons=oe;exports.ModalBody=ne;exports.ModalContainer=Et;exports.ModalFooter=Gt;exports.ModalHeader=zt;exports.ModalHeading=V;exports.Window=st;exports.WindowFooter=ot;exports.WindowHeader=se;exports.setupDeclarativeModals=de;exports.useAlertDialog=_t;exports.useDialog=L;exports.useDialogPromise=nt;exports.useDrawerDialog=Dt;exports.useModalDialog=qt; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react-modal"),e=require("react/jsx-runtime"),l=require("react"),de=require("react-draggable"),u=require("classnames"),n=require("@stenajs-webui/core"),b=require("@stenajs-webui/elements"),_e=require("@stenajs-webui/theme"),ue=s=>{F.setAppElement(s)},me="_overlay_5x3op_1",fe="_fadeIn_5x3op_1",ge="_modal_5x3op_31",xe="_content_5x3op_41",he="_appear_5x3op_1",Ce="_isDraggable_5x3op_70",ye="_footer_5x3op_101",pe="_stickyFooter_5x3op_105",$={overlay:me,fadeIn:fe,modal:ge,content:xe,appear:he,isDraggable:Ce,footer:ye,stickyFooter:pe},P="draggable-modal-handle",R="draggable-modal-cancel",te=({width:s,maxWidth:t,draggable:o=!1,children:r,...d})=>{const g=l.useRef(null);return e.jsx(F,{overlayClassName:$.overlay,className:$.modal,...d,children:e.jsx(de,{handle:`.${P}`,cancel:`.${R}, button, [role="tooltip"]`,bounds:".ReactModal__Overlay",disabled:!o,nodeRef:g,children:e.jsx("div",{style:{"--swui-modal-width":s,"--swui-modal-max-width":t},className:u($.content,{[$.isDraggable]:o}),ref:g,children:r})})})},we="_portal_17ze5_1",be="_overlay_17ze5_4",ve="_content_17ze5_9",je="_floating_17ze5_15",Ie="_slideFromLeft_17ze5_29",Ne="_slideFromRight_17ze5_30",De="_afterOpen_17ze5_36",Oe="_beforeClose_17ze5_40",$e="_slideFromTop_17ze5_45",Fe="_slideFromBottom_17ze5_46",f={portal:we,overlay:be,content:ve,floating:je,slideFromLeft:Ie,slideFromRight:Ne,afterOpen:De,beforeClose:Oe,slideFromTop:$e,slideFromBottom:Fe},ke=({background:s,zIndex:t,children:o,slideFrom:r="left",portalTarget:d,floating:g,...x})=>{const{height:h,width:v}=x;return e.jsx(F,{closeTimeoutMS:250,portalClassName:f.portal,overlayClassName:{base:f.overlay,afterOpen:f.afterOpen,beforeClose:f.beforeClose},className:{base:u(f.content,Be(r),g&&f.floating),afterOpen:f.afterOpen,beforeClose:f.beforeClose},style:{content:{width:v,height:h,background:s},overlay:{zIndex:t}},parentSelector:d?()=>d:void 0,...x,children:o})},Be=s=>{switch(s){case"left":return f.slideFromLeft;case"right":return f.slideFromRight;case"top":return f.slideFromTop;case"bottom":return f.slideFromBottom;default:return n.exhaustSwitchCase(s,f.slideFromLeft)}},Ae=({header:s,contentRight:t,onRequestClose:o,icon:r})=>e.jsx(n.Spacing,{position:"sticky",top:0,zIndex:100,background:_e.cssColor("--lhds-color-ui-50"),children:e.jsxs(n.Row,{justifyContent:"space-between",alignItems:"center",height:"48px",children:[e.jsxs(n.Row,{alignItems:"center",gap:2,children:[e.jsx(n.Space,{num:1}),r&&e.jsx(b.Icon,{icon:r,size:24}),e.jsx(n.Heading,{variant:"h4",children:s})]}),e.jsxs(n.Row,{gap:1,children:[t,e.jsx(b.FlatButton,{leftIcon:b.stenaTimes,onClick:o,variant:"danger"}),e.jsx(n.Space,{num:.5})]})]})}),Me="_overlay_r9tkq_1",qe="_fadeIn_r9tkq_1",Le="_modal_r9tkq_31",Se="_content_r9tkq_38",We="_appear_r9tkq_1",Ee="_isDraggable_r9tkq_61",ze="_footer_r9tkq_92",Te="_stickyFooter_r9tkq_96",T={overlay:Me,fadeIn:qe,modal:Le,content:Se,appear:We,isDraggable:Ee,footer:ze,stickyFooter:Te},He={overlay:{justifyContent:"center"}},Ge=({children:s,...t})=>e.jsx(F,{overlayClassName:T.overlay,className:T.modal,style:He,...t,children:e.jsx("div",{className:T.content,style:{"--swui-modal-width":"fit-content"},children:s})}),Pe="_overlay_15dqv_1",Re="_afterOpen_15dqv_24",Ve="_beforeClose_15dqv_24",Xe="_fadeIn_15dqv_1",Ye="_fadeOut_15dqv_1",Je="_modal_15dqv_36",Ke="_slideIn_15dqv_1",Qe="_slideOut_15dqv_1",Ue="_content_15dqv_59",Ze="_footer_15dqv_148",et="_stickyFooter_15dqv_152",D={overlay:Pe,afterOpen:Re,beforeClose:Ve,fadeIn:Xe,fadeOut:Ye,modal:Je,slideIn:Ke,slideOut:Qe,content:Ue,footer:Ze,stickyFooter:et},se=({children:s,background:t,...o})=>{const r={overlay:{justifyContent:"center"},content:{"--swui-modal-content-bg-color":t}};return e.jsx(F,{overlayClassName:{base:D.overlay,beforeClose:D.beforeClose,afterOpen:D.afterOpen},className:{base:D.modal,beforeClose:D.beforeClose,afterOpen:D.afterOpen},style:r,closeTimeoutMS:250,...o,children:e.jsx("div",{className:D.content,style:{"--swui-modal-width":"fit-content"},children:s})})},tt="_modal_4fwgb_1",st="_overlay_4fwgb_13",Z={modal:tt,overlay:st},ot=({headerIconLeft:s,headerText:t,shouldCloseOnOverlayClick:o=!1,shouldCloseOnEsc:r=!1,...d})=>e.jsx(F,{...d,isOpen:!0,shouldCloseOnOverlayClick:o,shouldCloseOnEsc:r,className:Z.modal,overlayClassName:Z.overlay,children:e.jsxs(n.Column,{spacing:2,alignItems:"center",children:[e.jsx(n.Box,{alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"50%",background:"white",shadow:"modal",children:e.jsx(b.Spinner,{size:"small"})}),(s||t)&&e.jsxs(e.Fragment,{children:[e.jsx(n.Spacing,{}),e.jsxs(n.Row,{indent:2,children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(b.Icon,{size:14,icon:s,color:"white"}),e.jsx(n.Indent,{})]}),t&&e.jsx(n.Heading,{variant:"h4",color:"white",children:t})]})]})]})}),oe=({onRequestClose:s,header:t,headerText:o,closeButtonClassName:r})=>e.jsxs(n.Row,{spacing:2,indent:2,borderBottom:"1px solid var(--lhds-color-ui-300)",className:P,children:[e.jsxs(n.Row,{flex:1,indent:!0,alignItems:"center",children:[o&&e.jsx(n.Txt,{className:R,size:"large",children:o}),t]}),e.jsx(n.Box,{alignSelf:"flex-start",children:e.jsx(b.CloseButton,{className:r,onClick:s})})]}),nt=({header:s,headerText:t,children:o,spacing:r,indent:d,draggable:g=!1,onRequestClose:x,closeButtonClassName:h,footer:v,disableStickyFooter:y=!1,...m})=>{const B=typeof r=="number"?r:1,k=typeof d=="number"?d:1;return e.jsxs(te,{...m,onRequestClose:x,draggable:g,children:[e.jsx(oe,{onRequestClose:x,header:s,headerText:t,closeButtonClassName:h}),e.jsx(n.Box,{spacing:B,indent:k,children:o}),v&&e.jsx(n.Box,{className:u($.footer,{[$.stickyFooter]:!y}),children:v})]})},rt=({children:s})=>e.jsx(n.Column,{indent:2,spacing:2,children:s}),q=l.createContext(void 0);function L(s,{ref:t,modal:o,contentWrapperClassName:r,closingClassName:d,contentWrapperStyle:g,dialogStyle:x,divInsteadOfDialog:h,disableCloseOnClickOutside:v,onResolve:y,onReject:m,className:B,background:k}){const le=l.useRef(null),_=t??le,[S,ae]=l.useReducer(a=>a+1,0),X=l.useRef(),j=l.useRef(),p=l.useRef(),C=l.useRef(),[Y,A]=l.useState(!1),[W,O]=l.useState(!1),[J,w]=l.useState(!1),E=s,ce=l.useCallback(a=>{var c,i;return X.current=new Promise((N,ie)=>{j.current=N,C.current=ie}),w(!1),A(!0),O(!0),ae(),p.current=a,o?(c=_.current)==null||c.showModal():(i=_.current)==null||i.show(),X.current},[_,o]),K=l.useCallback(a=>{var c;w(!0),A(!1),h?setTimeout(()=>{var i;w(!1),O(!1),(i=j.current)==null||i.call(j,a),p.current=void 0,y==null||y()},300):(c=_.current)==null||c.addEventListener("animationend",()=>{var i,N;w(!1),O(!1),(i=_.current)==null||i.close(),(N=j.current)==null||N.call(j,a),p.current=void 0,y==null||y()},{once:!0})},[_,y,h]),Q=l.useCallback(()=>{var a;w(!1),A(!1),O(!1),(a=C.current)==null||a.call(C),m==null||m(),p.current=void 0},[m]),I=l.useCallback(a=>{var c;w(!0),A(!1),h?setTimeout(()=>{var i;w(!1),O(!1),(i=C.current)==null||i.call(C,a),m==null||m(),p.current=void 0},300):(c=_.current)==null||c.addEventListener("animationend",()=>{var i,N;w(!1),O(!1),(i=_.current)==null||i.close(),(N=C.current)==null||N.call(C,a),m==null||m(),p.current=void 0},{once:!0})},[_,h,m]),U=l.useCallback(a=>{if(a.target!==_.current)return;const c=_.current.getBoundingClientRect();c.top<=a.clientY&&a.clientY<=c.top+c.height&&c.left<=a.clientX&&a.clientX<=c.left+c.width||I()},[_,I]),z=l.useMemo(()=>({resolve:K,reject:I}),[I,K]);return[l.useMemo(()=>h?e.jsx(se,{isOpen:Y,onRequestClose:I,background:k,children:e.jsx(q.Provider,{value:z,children:W&&l.createElement(E,{...p.current,key:S})})}):e.jsx("dialog",{onClick:v?void 0:U,onClose:Q,ref:_,className:u(B,J&&d),style:{background:k,...x},children:e.jsx("div",{style:g,className:r,children:W&&e.jsx(q.Provider,{value:z,children:l.createElement(E,{...p.current,key:S})})})}),[h,Y,I,k,z,W,E,S,v,U,Q,_,B,J,d,x,g,r]),{show:ce,reject:I}]}const lt=()=>{const s=l.useContext(q);if(s==null)throw new Error("useDialogPromise is being used outside of dialog.");return s},at="_alertDialog_14t8t_1",ct="_slideIn_14t8t_1",it="_closing_14t8t_22",dt="_slideOut_14t8t_1",_t="_fadeIn_14t8t_1",ut="_fadeOut_14t8t_1",H={alertDialog:at,slideIn:ct,closing:it,slideOut:dt,fadeIn:_t,fadeOut:ut};function mt(s,t){return L(s,{...t,modal:!0,closingClassName:u(t==null?void 0:t.closingClassName,H.closing),contentWrapperClassName:u(t==null?void 0:t.contentWrapperClassName,H.contentWrapper),className:u(t==null?void 0:t.className,H.alertDialog)})}const ft="_drawerDialog_11g6r_1",gt="_left_11g6r_13",xt="_right_11g6r_14",ht="_contentWrapper_11g6r_19",Ct="_slideInLeft_11g6r_1",yt="_closing_11g6r_36",pt="_slideOutLeft_11g6r_1",wt="_slideInRight_11g6r_1",bt="_slideOutRight_11g6r_1",vt="_top_11g6r_54",jt="_bottom_11g6r_55",It="_slideInTop_11g6r_1",Nt="_slideOutTop_11g6r_1",Dt="_slideInBottom_11g6r_1",Ot="_slideOutBottom_11g6r_1",M={drawerDialog:ft,left:gt,right:xt,contentWrapper:ht,slideInLeft:Ct,closing:yt,slideOutLeft:pt,slideInRight:wt,slideOutRight:bt,top:vt,bottom:jt,slideInTop:It,slideOutTop:Nt,slideInBottom:Dt,slideOutBottom:Ot};function $t(s,t="left",o){return L(s,{...o,disableCloseOnClickOutside:!0,modal:!1,closingClassName:u(o==null?void 0:o.closingClassName,M.closing),contentWrapperClassName:u(o==null?void 0:o.contentWrapperClassName,M.contentWrapper),className:u(o==null?void 0:o.className,M.drawerDialog,M[t])})}const Ft="_modalDialog_1teni_1",kt="_slideIn_1teni_1",Bt="_closing_1teni_36",At="_slideOut_1teni_1",Mt="_fadeIn_1teni_1",qt="_fadeOut_1teni_1",Lt="_contentWrapper_1teni_100",G={modalDialog:Ft,slideIn:kt,closing:Bt,slideOut:At,fadeIn:Mt,fadeOut:qt,contentWrapper:Lt};function St(s,t){return L(s,{...t,modal:!0,closingClassName:u(t==null?void 0:t.closingClassName,G.closing),contentWrapperClassName:u(t==null?void 0:t.contentWrapperClassName,G.contentWrapper),className:u(t==null?void 0:t.className,G.modalDialog)})}const V=({headingLevel:s="h2",size:t="medium",children:o})=>e.jsx(n.Heading,{variant:t==="medium"?"h3":"h1",as:s,children:o}),Wt="_modalActionButtons_s27nj_1",Et={modalActionButtons:Wt},ne=({buttons:s})=>e.jsxs(n.Box,{width:"100%",children:[e.jsx(n.Spacing,{}),e.jsx("div",{className:Et.modalActionButtons,children:s})]}),re=({gap:s=3,...t})=>e.jsx(n.Box,{indent:3,spacing:3,gap:s,...t}),zt=({icon:s,buttons:t,heading:o,text:r,children:d,maxWidth:g,minWidth:x})=>e.jsxs(re,{flexDirection:"column",alignItems:"center",maxWidth:g,minWidth:x,children:[s&&e.jsx(b.CircledIcon,{icon:s,size:"large"}),e.jsx(V,{children:o}),r&&e.jsx(n.Text,{textAlign:"center",children:r}),d,t&&e.jsx(ne,{buttons:t})]}),Tt=({children:s})=>e.jsx(n.Column,{flex:1,height:"100%",justifyContent:"space-between",children:s}),Ht=({heading:s,headingLevel:t,headingSize:o,onClickClose:r})=>e.jsxs(n.Row,{justifyContent:"space-between",children:[s&&e.jsx(V,{headingLevel:t,size:o,children:s}),e.jsx(b.CloseButton,{onClick:r})]}),Gt="_modalFooter_112wr_1",Pt="_sticky_112wr_10",ee={modalFooter:Gt,sticky:Pt},Rt=({children:s,sticky:t,zIndex:o=4})=>e.jsx(n.Row,{className:u(ee.modalFooter,t&&ee.sticky),shadow:"var(--swui-sticky-footer-shadow)",zIndex:o,children:s});exports.Alert=Ge;exports.BaseWindow=te;exports.DRAGGABLE_CANCEL_CLASSNAME=R;exports.DRAGGABLE_HANDLE_CLASSNAME=P;exports.DialogContext=q;exports.Drawer=ke;exports.DrawerHeader=Ae;exports.InfoAlert=zt;exports.LoadingModal=ot;exports.Modal=se;exports.ModalActionButtons=ne;exports.ModalBody=re;exports.ModalContainer=Tt;exports.ModalFooter=Rt;exports.ModalHeader=Ht;exports.ModalHeading=V;exports.Window=nt;exports.WindowFooter=rt;exports.WindowHeader=oe;exports.setupDeclarativeModals=ue;exports.useAlertDialog=mt;exports.useDialog=L;exports.useDialogPromise=lt;exports.useDrawerDialog=$t;exports.useModalDialog=St; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@stenajs-webui/modal", | ||
"version": "21.21.1", | ||
"version": "21.21.2", | ||
"type": "module", | ||
@@ -36,5 +36,5 @@ "description": "", | ||
"dependencies": { | ||
"@stenajs-webui/core": "21.21.1", | ||
"@stenajs-webui/elements": "21.21.1", | ||
"@stenajs-webui/theme": "21.21.1", | ||
"@stenajs-webui/core": "21.21.2", | ||
"@stenajs-webui/elements": "21.21.2", | ||
"@stenajs-webui/theme": "21.21.2", | ||
"@types/react-modal": "^3.16.3", | ||
@@ -66,3 +66,3 @@ "classnames": "^2.5.1", | ||
], | ||
"gitHead": "3cea3ed187f93cd376832517e0e0f8438ae564fb" | ||
"gitHead": "3839e3df21ec81c5c0e43b10d61468474896d73b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
155953
821
1026
+ Added@stenajs-webui/core@21.21.2(transitive)
+ Added@stenajs-webui/elements@21.21.2(transitive)
+ Added@stenajs-webui/theme@21.21.2(transitive)
- Removed@stenajs-webui/core@21.21.1(transitive)
- Removed@stenajs-webui/elements@21.21.1(transitive)
- Removed@stenajs-webui/theme@21.21.1(transitive)
Updated@stenajs-webui/core@21.21.2
Updated@stenajs-webui/theme@21.21.2