react-luminus-components 1.0.0

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.
Files changed (122) hide show
  1. package/README.md +3 -0
  2. package/dist/.vite/manifest.json +133 -0
  3. package/dist/Modal-JLnYbEat.js +1 -0
  4. package/dist/Modal-_FnSEPRk.mjs +623 -0
  5. package/dist/SimpleTooltip-BjlbHsKC.mjs +1767 -0
  6. package/dist/SimpleTooltip-D9shMl1R.js +1 -0
  7. package/dist/components/EmployeePicker/EmployeeSearch/EmployeeSearch.d.ts +7 -0
  8. package/dist/components/EmployeePicker/EmployeeSearchModal/EmployeeSearchModal.d.ts +9 -0
  9. package/dist/components/EmployeePicker/comps/EmployeeSearchItem/EmployeeSearchItem.d.ts +7 -0
  10. package/dist/components/EmployeePicker/comps/index.d.ts +1 -0
  11. package/dist/components/EmployeePicker/index.d.ts +2 -0
  12. package/dist/components/Form/CheckInput/CheckInput.d.ts +11 -0
  13. package/dist/components/Form/Container/InputContainer.d.ts +8 -0
  14. package/dist/components/Form/EmployeePicker/EmployeePicker.d.ts +12 -0
  15. package/dist/components/Form/SelectInput/SelectInput.d.ts +17 -0
  16. package/dist/components/Form/TextInput/TextInput.d.ts +16 -0
  17. package/dist/components/Form/index.d.ts +4 -0
  18. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +9 -0
  19. package/dist/components/HookForm/EmployeePicker/HookFormEmployeePicker.d.ts +9 -0
  20. package/dist/components/HookForm/FloatingSubmit/FloatingFormSubmit.d.ts +6 -0
  21. package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +9 -0
  22. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +9 -0
  23. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +9 -0
  24. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +9 -0
  25. package/dist/components/HookForm/index.d.ts +7 -0
  26. package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +10 -0
  27. package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +8 -0
  28. package/dist/components/Tooltip/index.d.ts +2 -0
  29. package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +8 -0
  30. package/dist/components/UserAvatar/UserAvatarDropdown/UserAvatarDropdown.d.ts +7 -0
  31. package/dist/components/UserAvatar/UserAvatarToggle/UserAvatarToggle.d.ts +8 -0
  32. package/dist/components/UserAvatar/index.d.ts +2 -0
  33. package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +9 -0
  34. package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +3 -0
  35. package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +9 -0
  36. package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +6 -0
  37. package/dist/components/common/HomeDashboard/comps/index.d.ts +1 -0
  38. package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +6 -0
  39. package/dist/components/common/Loading/Loading.d.ts +3 -0
  40. package/dist/components/common/MonthPicker/MonthPicker.d.ts +9 -0
  41. package/dist/components/common/Typography/Typography.d.ts +9 -0
  42. package/dist/components/common/index.d.ts +6 -0
  43. package/dist/constants-CT2hnPeO.js +1 -0
  44. package/dist/constants-CzNy5yO3.mjs +7 -0
  45. package/dist/contexts/confirm/ConfirmContext.d.ts +9 -0
  46. package/dist/contexts/confirm/ConfirmProvider.d.ts +6 -0
  47. package/dist/contexts/index.d.ts +6 -0
  48. package/dist/contexts/loading/LoadingContext.d.ts +8 -0
  49. package/dist/contexts/loading/LoadingProvider.d.ts +6 -0
  50. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +15 -0
  51. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +16 -0
  52. package/dist/contexts/user/UserContext.d.ts +9 -0
  53. package/dist/contexts/user/UserProvider.d.ts +6 -0
  54. package/dist/contexts.cjs.js +1 -0
  55. package/dist/contexts.d.ts +1 -0
  56. package/dist/contexts.es.js +86 -0
  57. package/dist/hasClass-3JW9Qluf.mjs +1482 -0
  58. package/dist/hasClass-6m1Qq_DA.js +20 -0
  59. package/dist/hooks/index.d.ts +5 -0
  60. package/dist/hooks/useAuth/useAuth.d.ts +7 -0
  61. package/dist/hooks/useAxios/useAxios.d.ts +3 -0
  62. package/dist/hooks/useConfirm/useConfirm.d.ts +8 -0
  63. package/dist/hooks/useNotifications/useNotifications.d.ts +4 -0
  64. package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +44 -0
  65. package/dist/hooks.cjs.js +1 -0
  66. package/dist/hooks.d.ts +1 -0
  67. package/dist/hooks.es.js +2781 -0
  68. package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +4 -0
  69. package/dist/layout/MainContainer/MainContainer.d.ts +4 -0
  70. package/dist/layout/SideContentBar/SideContentBar.d.ts +7 -0
  71. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +10 -0
  72. package/dist/layout/SideMenu/SideMenu.d.ts +10 -0
  73. package/dist/layout/TopBar/TopBar.d.ts +7 -0
  74. package/dist/layout/index.d.ts +5 -0
  75. package/dist/layout.cjs.js +1 -0
  76. package/dist/layout.d.ts +1 -0
  77. package/dist/layout.es.js +164 -0
  78. package/dist/main.cjs.js +1 -0
  79. package/dist/main.d.ts +11 -0
  80. package/dist/main.es.js +2788 -0
  81. package/dist/models/index.d.ts +23 -0
  82. package/dist/models/prop-types/ContainerProps.d.ts +6 -0
  83. package/dist/models/prop-types/HookFormCheckInputProps.d.ts +7 -0
  84. package/dist/models/prop-types/HookFormEmployeePickerProps.d.ts +9 -0
  85. package/dist/models/prop-types/HookFormInputProps.d.ts +9 -0
  86. package/dist/models/prop-types/HookFormRadioInputProps.d.ts +7 -0
  87. package/dist/models/prop-types/HookFormSelectInputProps.d.ts +12 -0
  88. package/dist/models/prop-types/HookFormTextAreaInputProps.d.ts +9 -0
  89. package/dist/models/prop-types/HookFormTextInputProps.d.ts +11 -0
  90. package/dist/models/texts/AxiosTexts.d.ts +6 -0
  91. package/dist/models/texts/ConfirmTexts.d.ts +5 -0
  92. package/dist/models/texts/EmployeeSearchModalTexts.d.ts +6 -0
  93. package/dist/models/texts/FormValidationTexts.d.ts +5 -0
  94. package/dist/models/texts/HomeDashboardTexts.d.ts +5 -0
  95. package/dist/models/types/ApiErrorResult.d.ts +7 -0
  96. package/dist/models/types/DashboardConfig.d.ts +5 -0
  97. package/dist/models/types/DashboardWidget.d.ts +7 -0
  98. package/dist/models/types/DashboardWidgetConfig.d.ts +5 -0
  99. package/dist/models/types/EmployeeIndexModel.d.ts +14 -0
  100. package/dist/models/types/ErrorField.d.ts +5 -0
  101. package/dist/models/types/FormSelectOption.d.ts +5 -0
  102. package/dist/models/types/HookFormInputProps.d.ts +9 -0
  103. package/dist/models/types/MenuItemType.d.ts +9 -0
  104. package/dist/models/types/NameIdIntModel.d.ts +5 -0
  105. package/dist/models/types/NameIdStringModel.d.ts +5 -0
  106. package/dist/models/types/UserModel.d.ts +13 -0
  107. package/dist/style.css +1 -0
  108. package/dist/textUtils-9KFqOvA8.mjs +27 -0
  109. package/dist/textUtils-C0nqWp3S.js +1 -0
  110. package/dist/useAxios-BU-BqYrK.mjs +2663 -0
  111. package/dist/useAxios-ZEhq7C_H.js +212 -0
  112. package/dist/useConfirm-BazFQNRI.js +1 -0
  113. package/dist/useConfirm-DH9Pmz_w.mjs +18 -0
  114. package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +4 -0
  115. package/dist/utils/date/dateUtils.d.ts +1 -0
  116. package/dist/utils/index.d.ts +4 -0
  117. package/dist/utils/object/objectUtils.d.ts +2 -0
  118. package/dist/utils/text/textUtils.d.ts +1 -0
  119. package/dist/utils.cjs.js +1 -0
  120. package/dist/utils.d.ts +1 -0
  121. package/dist/utils.es.js +137 -0
  122. package/package.json +94 -0
@@ -0,0 +1,623 @@
1
+ import { j as a, e as d, f as S, g as x } from "./useAxios-BU-BqYrK.mjs";
2
+ import { P as me, e as Te, o as Se, s as U, u as Fe, f as Pe, g as et, h as y, l as Re, i as Ce, j as Le, k as tt, r as je, m as nt, n as D, p as ot, q as st, v as at, w as ke, F as De, x as rt, y as it } from "./hasClass-3JW9Qluf.mjs";
3
+ import * as u from "react";
4
+ import { useRef as v, useEffect as ve, forwardRef as lt, useState as Ee, useImperativeHandle as dt, useCallback as Me, useContext as ct, useMemo as ut } from "react";
5
+ import ft from "react-dom";
6
+ const zt = () => /* @__PURE__ */ a.jsxs("div", { className: d("luminus-loading", S.loading), children: [
7
+ /* @__PURE__ */ a.jsx("div", { className: d("spinner-grow", S.spinnerGrow, "text-primary"), role: "status" }),
8
+ /* @__PURE__ */ a.jsx("div", { className: d("spinner-grow", S.spinnerGrow, "text-primary", S.second), role: "status" }),
9
+ /* @__PURE__ */ a.jsx("div", { className: d("spinner-grow", S.spinnerGrow, "text-primary", S.third), role: "status" })
10
+ ] }), ht = ({ variant: t, className: e, children: n }) => {
11
+ switch (t) {
12
+ case "h1":
13
+ return /* @__PURE__ */ a.jsx("h1", { className: d("luminus-text-primary", x.h1, e), children: n });
14
+ case "h3":
15
+ return /* @__PURE__ */ a.jsx("h3", { className: d("luminus-text", x.h3, e), children: n });
16
+ case "h6":
17
+ return /* @__PURE__ */ a.jsx("h6", { className: d("luminus-text", x.h6, e), children: n });
18
+ case "subtitle":
19
+ return /* @__PURE__ */ a.jsx("div", { className: d("luminus-text", x.subtitle, e), children: n });
20
+ case "body":
21
+ return /* @__PURE__ */ a.jsx("div", { className: d("luminus-text", x.body, e), children: n });
22
+ case "body2":
23
+ return /* @__PURE__ */ a.jsx("div", { className: d("luminus-text", x.body2, e), children: n });
24
+ case "caption":
25
+ return /* @__PURE__ */ a.jsx("div", { className: d("luminus-text-muted", x.caption, e), children: n });
26
+ default:
27
+ return /* @__PURE__ */ a.jsx(a.Fragment, { children: n });
28
+ }
29
+ }, qt = ({ variant: t, className: e, children: n }) => /* @__PURE__ */ a.jsx(ht, { variant: t, className: e, children: n }), mt = (t) => /* @__PURE__ */ u.forwardRef((e, n) => /* @__PURE__ */ a.jsx("div", {
30
+ ...e,
31
+ ref: n,
32
+ className: d(e.className, t)
33
+ }));
34
+ function gt(t) {
35
+ const e = v(null);
36
+ return ve(() => {
37
+ e.current = t;
38
+ }), e.current;
39
+ }
40
+ const pt = {
41
+ /** An accessible label indicating the relevant information about the Close Button. */
42
+ "aria-label": me.string,
43
+ /** A callback fired after the Close Button is clicked. */
44
+ onClick: me.func,
45
+ /**
46
+ * Render different color variant for the button.
47
+ *
48
+ * Omitting this will render the default dark color.
49
+ */
50
+ variant: me.oneOf(["white"])
51
+ }, we = /* @__PURE__ */ u.forwardRef(({
52
+ className: t,
53
+ variant: e,
54
+ "aria-label": n = "Close",
55
+ ...o
56
+ }, s) => /* @__PURE__ */ a.jsx("button", {
57
+ ref: s,
58
+ type: "button",
59
+ className: d("btn-close", e && `btn-close-${e}`, t),
60
+ "aria-label": n,
61
+ ...o
62
+ }));
63
+ we.displayName = "CloseButton";
64
+ we.propTypes = pt;
65
+ const yt = we;
66
+ var vt = Function.prototype.bind.call(Function.prototype.call, [].slice);
67
+ function F(t, e) {
68
+ return vt(t.querySelectorAll(e));
69
+ }
70
+ const Et = "data-rr-ui-";
71
+ function Mt(t) {
72
+ return `${Et}${t}`;
73
+ }
74
+ var ne;
75
+ function Oe(t) {
76
+ if ((!ne && ne !== 0 || t) && Te) {
77
+ var e = document.createElement("div");
78
+ e.style.position = "absolute", e.style.top = "-9999px", e.style.width = "50px", e.style.height = "50px", e.style.overflow = "scroll", document.body.appendChild(e), ne = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
79
+ }
80
+ return ne;
81
+ }
82
+ function ge(t) {
83
+ t === void 0 && (t = Se());
84
+ try {
85
+ var e = t.activeElement;
86
+ return !e || !e.nodeName ? null : e;
87
+ } catch {
88
+ return t.body;
89
+ }
90
+ }
91
+ function Tt(t = document) {
92
+ const e = t.defaultView;
93
+ return Math.abs(e.innerWidth - t.documentElement.clientWidth);
94
+ }
95
+ const Ae = Mt("modal-open");
96
+ class wt {
97
+ constructor({
98
+ ownerDocument: e,
99
+ handleContainerOverflow: n = !0,
100
+ isRTL: o = !1
101
+ } = {}) {
102
+ this.handleContainerOverflow = n, this.isRTL = o, this.modals = [], this.ownerDocument = e;
103
+ }
104
+ getScrollbarWidth() {
105
+ return Tt(this.ownerDocument);
106
+ }
107
+ getElement() {
108
+ return (this.ownerDocument || document).body;
109
+ }
110
+ setModalAttributes(e) {
111
+ }
112
+ removeModalAttributes(e) {
113
+ }
114
+ setContainerStyle(e) {
115
+ const n = {
116
+ overflow: "hidden"
117
+ }, o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.getElement();
118
+ e.style = {
119
+ overflow: s.style.overflow,
120
+ [o]: s.style[o]
121
+ }, e.scrollBarWidth && (n[o] = `${parseInt(U(s, o) || "0", 10) + e.scrollBarWidth}px`), s.setAttribute(Ae, ""), U(s, n);
122
+ }
123
+ reset() {
124
+ [...this.modals].forEach((e) => this.remove(e));
125
+ }
126
+ removeContainerStyle(e) {
127
+ const n = this.getElement();
128
+ n.removeAttribute(Ae), Object.assign(n.style, e.style);
129
+ }
130
+ add(e) {
131
+ let n = this.modals.indexOf(e);
132
+ return n !== -1 || (n = this.modals.length, this.modals.push(e), this.setModalAttributes(e), n !== 0) || (this.state = {
133
+ scrollBarWidth: this.getScrollbarWidth(),
134
+ style: {}
135
+ }, this.handleContainerOverflow && this.setContainerStyle(this.state)), n;
136
+ }
137
+ remove(e) {
138
+ const n = this.modals.indexOf(e);
139
+ n !== -1 && (this.modals.splice(n, 1), !this.modals.length && this.handleContainerOverflow && this.removeContainerStyle(this.state), this.removeModalAttributes(e));
140
+ }
141
+ isTopModal(e) {
142
+ return !!this.modals.length && this.modals[this.modals.length - 1] === e;
143
+ }
144
+ }
145
+ const xe = wt, xt = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
146
+ function bt(t, e) {
147
+ if (t == null)
148
+ return {};
149
+ var n = {}, o = Object.keys(t), s, i;
150
+ for (i = 0; i < o.length; i++)
151
+ s = o[i], !(e.indexOf(s) >= 0) && (n[s] = t[s]);
152
+ return n;
153
+ }
154
+ let pe;
155
+ function Nt(t) {
156
+ return pe || (pe = new xe({
157
+ ownerDocument: t == null ? void 0 : t.document
158
+ })), pe;
159
+ }
160
+ function Rt(t) {
161
+ const e = Fe(), n = t || Nt(e), o = v({
162
+ dialog: null,
163
+ backdrop: null
164
+ });
165
+ return Object.assign(o.current, {
166
+ add: () => n.add(o.current),
167
+ remove: () => n.remove(o.current),
168
+ isTopModal: () => n.isTopModal(o.current),
169
+ setDialogRef: Me((s) => {
170
+ o.current.dialog = s;
171
+ }, []),
172
+ setBackdropRef: Me((s) => {
173
+ o.current.backdrop = s;
174
+ }, [])
175
+ });
176
+ }
177
+ const $e = /* @__PURE__ */ lt((t, e) => {
178
+ let {
179
+ show: n = !1,
180
+ role: o = "dialog",
181
+ className: s,
182
+ style: i,
183
+ children: E,
184
+ backdrop: h = !0,
185
+ keyboard: M = !0,
186
+ onBackdropClick: b,
187
+ onEscapeKeyDown: m,
188
+ transition: $,
189
+ runTransition: T,
190
+ backdropTransition: N,
191
+ runBackdropTransition: oe,
192
+ autoFocus: V = !0,
193
+ enforceFocus: se = !0,
194
+ restoreFocus: R = !0,
195
+ restoreFocusOptions: ae,
196
+ renderDialog: z,
197
+ renderBackdrop: re = (l) => /* @__PURE__ */ a.jsx("div", Object.assign({}, l)),
198
+ manager: ie,
199
+ container: le,
200
+ onShow: q,
201
+ onHide: I = () => {
202
+ },
203
+ onExit: de,
204
+ onExited: W,
205
+ onExiting: X,
206
+ onEnter: Y,
207
+ onEntering: J,
208
+ onEntered: Q
209
+ } = t, ce = bt(t, xt);
210
+ const g = Fe(), C = Pe(le), c = Rt(ie), ue = et(), Z = gt(n), [w, j] = Ee(!n), f = v(null);
211
+ dt(e, () => c, [c]), Te && !Z && n && (f.current = ge(g == null ? void 0 : g.document)), n && w && j(!1);
212
+ const p = y(() => {
213
+ if (c.add(), k.current = Re(document, "keydown", he), _.current = Re(
214
+ document,
215
+ "focus",
216
+ // the timeout is necessary b/c this will run before the new modal is mounted
217
+ // and so steals focus from it
218
+ () => setTimeout(fe),
219
+ !0
220
+ ), q && q(), V) {
221
+ var l, te;
222
+ const G = ge((l = (te = c.dialog) == null ? void 0 : te.ownerDocument) != null ? l : g == null ? void 0 : g.document);
223
+ c.dialog && G && !Ce(c.dialog, G) && (f.current = G, c.dialog.focus());
224
+ }
225
+ }), H = y(() => {
226
+ if (c.remove(), k.current == null || k.current(), _.current == null || _.current(), R) {
227
+ var l;
228
+ (l = f.current) == null || l.focus == null || l.focus(ae), f.current = null;
229
+ }
230
+ });
231
+ ve(() => {
232
+ !n || !C || p();
233
+ }, [
234
+ n,
235
+ C,
236
+ /* should never change: */
237
+ p
238
+ ]), ve(() => {
239
+ w && H();
240
+ }, [w, H]), Le(() => {
241
+ H();
242
+ });
243
+ const fe = y(() => {
244
+ if (!se || !ue() || !c.isTopModal())
245
+ return;
246
+ const l = ge(g == null ? void 0 : g.document);
247
+ c.dialog && l && !Ce(c.dialog, l) && c.dialog.focus();
248
+ }), P = y((l) => {
249
+ l.target === l.currentTarget && (b == null || b(l), h === !0 && I());
250
+ }), he = y((l) => {
251
+ M && tt(l) && c.isTopModal() && (m == null || m(l), l.defaultPrevented || I());
252
+ }), _ = v(), k = v(), ee = (...l) => {
253
+ j(!0), W == null || W(...l);
254
+ };
255
+ if (!C)
256
+ return null;
257
+ const O = Object.assign({
258
+ role: o,
259
+ ref: c.setDialogRef,
260
+ // apparently only works on the dialog role element
261
+ "aria-modal": o === "dialog" ? !0 : void 0
262
+ }, ce, {
263
+ style: i,
264
+ className: s,
265
+ tabIndex: -1
266
+ });
267
+ let K = z ? z(O) : /* @__PURE__ */ a.jsx("div", Object.assign({}, O, {
268
+ children: /* @__PURE__ */ u.cloneElement(E, {
269
+ role: "document"
270
+ })
271
+ }));
272
+ K = je($, T, {
273
+ unmountOnExit: !0,
274
+ mountOnEnter: !0,
275
+ appear: !0,
276
+ in: !!n,
277
+ onExit: de,
278
+ onExiting: X,
279
+ onExited: ee,
280
+ onEnter: Y,
281
+ onEntering: J,
282
+ onEntered: Q,
283
+ children: K
284
+ });
285
+ let A = null;
286
+ return h && (A = re({
287
+ ref: c.setBackdropRef,
288
+ onClick: P
289
+ }), A = je(N, oe, {
290
+ in: !!n,
291
+ appear: !0,
292
+ mountOnEnter: !0,
293
+ unmountOnExit: !0,
294
+ children: A
295
+ })), /* @__PURE__ */ a.jsx(a.Fragment, {
296
+ children: /* @__PURE__ */ ft.createPortal(/* @__PURE__ */ a.jsxs(a.Fragment, {
297
+ children: [A, K]
298
+ }), C)
299
+ });
300
+ });
301
+ $e.displayName = "Modal";
302
+ const Ct = Object.assign($e, {
303
+ Manager: xe
304
+ });
305
+ function jt(t, e) {
306
+ t.classList ? t.classList.add(e) : nt(t, e) || (typeof t.className == "string" ? t.className = t.className + " " + e : t.setAttribute("class", (t.className && t.className.baseVal || "") + " " + e));
307
+ }
308
+ function Be(t, e) {
309
+ return t.replace(new RegExp("(^|\\s)" + e + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
310
+ }
311
+ function kt(t, e) {
312
+ t.classList ? t.classList.remove(e) : typeof t.className == "string" ? t.className = Be(t.className, e) : t.setAttribute("class", Be(t.className && t.className.baseVal || "", e));
313
+ }
314
+ const L = {
315
+ FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
316
+ STICKY_CONTENT: ".sticky-top",
317
+ NAVBAR_TOGGLER: ".navbar-toggler"
318
+ };
319
+ class Ot extends xe {
320
+ adjustAndStore(e, n, o) {
321
+ const s = n.style[e];
322
+ n.dataset[e] = s, U(n, {
323
+ [e]: `${parseFloat(U(n, e)) + o}px`
324
+ });
325
+ }
326
+ restore(e, n) {
327
+ const o = n.dataset[e];
328
+ o !== void 0 && (delete n.dataset[e], U(n, {
329
+ [e]: o
330
+ }));
331
+ }
332
+ setContainerStyle(e) {
333
+ super.setContainerStyle(e);
334
+ const n = this.getElement();
335
+ if (jt(n, "modal-open"), !e.scrollBarWidth)
336
+ return;
337
+ const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
338
+ F(n, L.FIXED_CONTENT).forEach((i) => this.adjustAndStore(o, i, e.scrollBarWidth)), F(n, L.STICKY_CONTENT).forEach((i) => this.adjustAndStore(s, i, -e.scrollBarWidth)), F(n, L.NAVBAR_TOGGLER).forEach((i) => this.adjustAndStore(s, i, e.scrollBarWidth));
339
+ }
340
+ removeContainerStyle(e) {
341
+ super.removeContainerStyle(e);
342
+ const n = this.getElement();
343
+ kt(n, "modal-open");
344
+ const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
345
+ F(n, L.FIXED_CONTENT).forEach((i) => this.restore(o, i)), F(n, L.STICKY_CONTENT).forEach((i) => this.restore(s, i)), F(n, L.NAVBAR_TOGGLER).forEach((i) => this.restore(s, i));
346
+ }
347
+ }
348
+ let ye;
349
+ function At(t) {
350
+ return ye || (ye = new Ot(t)), ye;
351
+ }
352
+ const Ie = /* @__PURE__ */ u.forwardRef(({
353
+ className: t,
354
+ bsPrefix: e,
355
+ as: n = "div",
356
+ ...o
357
+ }, s) => (e = D(e, "modal-body"), /* @__PURE__ */ a.jsx(n, {
358
+ ref: s,
359
+ className: d(t, e),
360
+ ...o
361
+ })));
362
+ Ie.displayName = "ModalBody";
363
+ const Bt = Ie, St = /* @__PURE__ */ u.createContext({
364
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
365
+ onHide() {
366
+ }
367
+ }), We = St, He = /* @__PURE__ */ u.forwardRef(({
368
+ bsPrefix: t,
369
+ className: e,
370
+ contentClassName: n,
371
+ centered: o,
372
+ size: s,
373
+ fullscreen: i,
374
+ children: E,
375
+ scrollable: h,
376
+ ...M
377
+ }, b) => {
378
+ t = D(t, "modal");
379
+ const m = `${t}-dialog`, $ = typeof i == "string" ? `${t}-fullscreen-${i}` : `${t}-fullscreen`;
380
+ return /* @__PURE__ */ a.jsx("div", {
381
+ ...M,
382
+ ref: b,
383
+ className: d(m, e, s && `${t}-${s}`, o && `${m}-centered`, h && `${m}-scrollable`, i && $),
384
+ children: /* @__PURE__ */ a.jsx("div", {
385
+ className: d(`${t}-content`, n),
386
+ children: E
387
+ })
388
+ });
389
+ });
390
+ He.displayName = "ModalDialog";
391
+ const _e = He, Ke = /* @__PURE__ */ u.forwardRef(({
392
+ className: t,
393
+ bsPrefix: e,
394
+ as: n = "div",
395
+ ...o
396
+ }, s) => (e = D(e, "modal-footer"), /* @__PURE__ */ a.jsx(n, {
397
+ ref: s,
398
+ className: d(t, e),
399
+ ...o
400
+ })));
401
+ Ke.displayName = "ModalFooter";
402
+ const Ft = Ke, Lt = /* @__PURE__ */ u.forwardRef(({
403
+ closeLabel: t = "Close",
404
+ closeVariant: e,
405
+ closeButton: n = !1,
406
+ onHide: o,
407
+ children: s,
408
+ ...i
409
+ }, E) => {
410
+ const h = ct(We), M = y(() => {
411
+ h == null || h.onHide(), o == null || o();
412
+ });
413
+ return /* @__PURE__ */ a.jsxs("div", {
414
+ ref: E,
415
+ ...i,
416
+ children: [s, n && /* @__PURE__ */ a.jsx(yt, {
417
+ "aria-label": t,
418
+ variant: e,
419
+ onClick: M
420
+ })]
421
+ });
422
+ }), Dt = Lt, Ge = /* @__PURE__ */ u.forwardRef(({
423
+ bsPrefix: t,
424
+ className: e,
425
+ closeLabel: n = "Close",
426
+ closeButton: o = !1,
427
+ ...s
428
+ }, i) => (t = D(t, "modal-header"), /* @__PURE__ */ a.jsx(Dt, {
429
+ ref: i,
430
+ ...s,
431
+ className: d(e, t),
432
+ closeLabel: n,
433
+ closeButton: o
434
+ })));
435
+ Ge.displayName = "ModalHeader";
436
+ const $t = Ge, It = mt("h4"), Ue = /* @__PURE__ */ u.forwardRef(({
437
+ className: t,
438
+ bsPrefix: e,
439
+ as: n = It,
440
+ ...o
441
+ }, s) => (e = D(e, "modal-title"), /* @__PURE__ */ a.jsx(n, {
442
+ ref: s,
443
+ className: d(t, e),
444
+ ...o
445
+ })));
446
+ Ue.displayName = "ModalTitle";
447
+ const Wt = Ue;
448
+ function Ht(t) {
449
+ return /* @__PURE__ */ a.jsx(De, {
450
+ ...t,
451
+ timeout: null
452
+ });
453
+ }
454
+ function _t(t) {
455
+ return /* @__PURE__ */ a.jsx(De, {
456
+ ...t,
457
+ timeout: null
458
+ });
459
+ }
460
+ const Ve = /* @__PURE__ */ u.forwardRef(({
461
+ bsPrefix: t,
462
+ className: e,
463
+ style: n,
464
+ dialogClassName: o,
465
+ contentClassName: s,
466
+ children: i,
467
+ dialogAs: E = _e,
468
+ "data-bs-theme": h,
469
+ "aria-labelledby": M,
470
+ "aria-describedby": b,
471
+ "aria-label": m,
472
+ /* BaseModal props */
473
+ show: $ = !1,
474
+ animation: T = !0,
475
+ backdrop: N = !0,
476
+ keyboard: oe = !0,
477
+ onEscapeKeyDown: V,
478
+ onShow: se,
479
+ onHide: R,
480
+ container: ae,
481
+ autoFocus: z = !0,
482
+ enforceFocus: re = !0,
483
+ restoreFocus: ie = !0,
484
+ restoreFocusOptions: le,
485
+ onEntered: q,
486
+ onExit: I,
487
+ onExiting: de,
488
+ onEnter: W,
489
+ onEntering: X,
490
+ onExited: Y,
491
+ backdropClassName: J,
492
+ manager: Q,
493
+ ...ce
494
+ }, g) => {
495
+ const [C, c] = Ee({}), [ue, Z] = Ee(!1), w = v(!1), j = v(!1), f = v(null), [p, H] = ot(), fe = st(g, H), P = y(R), he = at();
496
+ t = D(t, "modal");
497
+ const _ = ut(() => ({
498
+ onHide: P
499
+ }), [P]);
500
+ function k() {
501
+ return Q || At({
502
+ isRTL: he
503
+ });
504
+ }
505
+ function ee(r) {
506
+ if (!Te)
507
+ return;
508
+ const B = k().getScrollbarWidth() > 0, Ne = r.scrollHeight > Se(r).documentElement.clientHeight;
509
+ c({
510
+ paddingRight: B && !Ne ? Oe() : void 0,
511
+ paddingLeft: !B && Ne ? Oe() : void 0
512
+ });
513
+ }
514
+ const O = y(() => {
515
+ p && ee(p.dialog);
516
+ });
517
+ Le(() => {
518
+ ke(window, "resize", O), f.current == null || f.current();
519
+ });
520
+ const K = () => {
521
+ w.current = !0;
522
+ }, A = (r) => {
523
+ w.current && p && r.target === p.dialog && (j.current = !0), w.current = !1;
524
+ }, l = () => {
525
+ Z(!0), f.current = it(p.dialog, () => {
526
+ Z(!1);
527
+ });
528
+ }, te = (r) => {
529
+ r.target === r.currentTarget && l();
530
+ }, G = (r) => {
531
+ if (N === "static") {
532
+ te(r);
533
+ return;
534
+ }
535
+ if (j.current || r.target !== r.currentTarget) {
536
+ j.current = !1;
537
+ return;
538
+ }
539
+ R == null || R();
540
+ }, ze = (r) => {
541
+ oe ? V == null || V(r) : (r.preventDefault(), N === "static" && l());
542
+ }, qe = (r, B) => {
543
+ r && ee(r), W == null || W(r, B);
544
+ }, Xe = (r) => {
545
+ f.current == null || f.current(), I == null || I(r);
546
+ }, Ye = (r, B) => {
547
+ X == null || X(r, B), rt(window, "resize", O);
548
+ }, Je = (r) => {
549
+ r && (r.style.display = ""), Y == null || Y(r), ke(window, "resize", O);
550
+ }, Qe = Me((r) => /* @__PURE__ */ a.jsx("div", {
551
+ ...r,
552
+ className: d(`${t}-backdrop`, J, !T && "show")
553
+ }), [T, J, t]), be = {
554
+ ...n,
555
+ ...C
556
+ };
557
+ be.display = "block";
558
+ const Ze = (r) => /* @__PURE__ */ a.jsx("div", {
559
+ role: "dialog",
560
+ ...r,
561
+ style: be,
562
+ className: d(e, t, ue && `${t}-static`, !T && "show"),
563
+ onClick: N ? G : void 0,
564
+ onMouseUp: A,
565
+ "data-bs-theme": h,
566
+ "aria-label": m,
567
+ "aria-labelledby": M,
568
+ "aria-describedby": b,
569
+ children: /* @__PURE__ */ a.jsx(E, {
570
+ ...ce,
571
+ onMouseDown: K,
572
+ className: o,
573
+ contentClassName: s,
574
+ children: i
575
+ })
576
+ });
577
+ return /* @__PURE__ */ a.jsx(We.Provider, {
578
+ value: _,
579
+ children: /* @__PURE__ */ a.jsx(Ct, {
580
+ show: $,
581
+ ref: fe,
582
+ backdrop: N,
583
+ container: ae,
584
+ keyboard: !0,
585
+ autoFocus: z,
586
+ enforceFocus: re,
587
+ restoreFocus: ie,
588
+ restoreFocusOptions: le,
589
+ onEscapeKeyDown: ze,
590
+ onShow: se,
591
+ onHide: R,
592
+ onEnter: qe,
593
+ onEntering: Ye,
594
+ onEntered: q,
595
+ onExit: Xe,
596
+ onExiting: de,
597
+ onExited: Je,
598
+ manager: k(),
599
+ transition: T ? Ht : void 0,
600
+ backdropTransition: T ? _t : void 0,
601
+ renderBackdrop: Qe,
602
+ renderDialog: Ze
603
+ })
604
+ });
605
+ });
606
+ Ve.displayName = "Modal";
607
+ const Xt = Object.assign(Ve, {
608
+ Body: Bt,
609
+ Header: $t,
610
+ Title: Wt,
611
+ Footer: Ft,
612
+ Dialog: _e,
613
+ TRANSITION_DURATION: 300,
614
+ BACKDROP_TRANSITION_DURATION: 150
615
+ });
616
+ export {
617
+ zt as L,
618
+ Xt as M,
619
+ qt as T,
620
+ Mt as d,
621
+ F as q,
622
+ gt as u
623
+ };