smartsell-ui-kit 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/modal.cjs ADDED
@@ -0,0 +1,660 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/modal.ts
21
+ var modal_exports = {};
22
+ __export(modal_exports, {
23
+ Modal: () => Modal
24
+ });
25
+ module.exports = __toCommonJS(modal_exports);
26
+
27
+ // src/components/Modal.tsx
28
+ var import_react = require("react");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ var defaultThemeColors = {
31
+ background: "#f8fafc",
32
+ surface: "#ffffff",
33
+ onSurface: "#0f172a",
34
+ onBackground: "#0f172a",
35
+ primary: "#0f766e",
36
+ onPrimary: "#ffffff",
37
+ secondary: "#1d4ed8",
38
+ onSecondary: "#ffffff",
39
+ negative: "#dc2626",
40
+ warning: "#d97706"
41
+ };
42
+ var withAlpha = (hex, alpha) => {
43
+ const normalized = hex.replace("#", "").trim();
44
+ const value = normalized.length === 3 ? normalized.split("").map((char) => char + char).join("") : normalized;
45
+ const red = Number.parseInt(value.slice(0, 2), 16);
46
+ const green = Number.parseInt(value.slice(2, 4), 16);
47
+ const blue = Number.parseInt(value.slice(4, 6), 16);
48
+ return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
49
+ };
50
+ var isUiKitThemeTokens = (theme) => {
51
+ return Boolean(theme && typeof theme === "object" && "theme" in theme);
52
+ };
53
+ var resolveTheme = (theme) => {
54
+ var _a;
55
+ const colorOverrides = isUiKitThemeTokens(theme) ? theme.theme.colors : (_a = theme == null ? void 0 : theme.colors) != null ? _a : {};
56
+ const colors = {
57
+ ...defaultThemeColors,
58
+ ...colorOverrides
59
+ };
60
+ return {
61
+ colors,
62
+ borderSoft: isUiKitThemeTokens(theme) ? theme.borderSoft : withAlpha(colors.onSurface, 0.1),
63
+ borderStrong: isUiKitThemeTokens(theme) ? theme.borderStrong : withAlpha(colors.onSurface, 0.16),
64
+ surfaceMuted: isUiKitThemeTokens(theme) ? theme.surfaceMuted : withAlpha(colors.onSurface, 0.04),
65
+ surfaceRaised: isUiKitThemeTokens(theme) ? theme.surfaceRaised : withAlpha(colors.surface, 0.94),
66
+ overlay: isUiKitThemeTokens(theme) ? theme.overlay : withAlpha("#030712", 0.62),
67
+ mutedText: isUiKitThemeTokens(theme) ? theme.mutedText : withAlpha(colors.onSurface, 0.72)
68
+ };
69
+ };
70
+ var normalizeWidth = (maxWidth) => {
71
+ if (typeof maxWidth === "number") {
72
+ return `${maxWidth}px`;
73
+ }
74
+ return maxWidth != null ? maxWidth : "720px";
75
+ };
76
+ var isLikelyMobileViewport = () => {
77
+ if (typeof window === "undefined" || typeof navigator === "undefined") {
78
+ return false;
79
+ }
80
+ return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
81
+ navigator.userAgent
82
+ );
83
+ };
84
+ var isLegacyModalProps = (props) => {
85
+ return "showModal" in props;
86
+ };
87
+ function LegacyActionButton({
88
+ label,
89
+ onClick,
90
+ disabled,
91
+ type = "contained",
92
+ theme,
93
+ style
94
+ }) {
95
+ var _a, _b;
96
+ const { colors } = theme;
97
+ const buttonStyle = {
98
+ width: "100%",
99
+ display: "flex",
100
+ alignItems: "center",
101
+ justifyContent: "center",
102
+ borderRadius: "0.4rem",
103
+ padding: type === "link" ? 0 : "1.3rem",
104
+ boxSizing: "border-box",
105
+ cursor: disabled ? "not-allowed" : "pointer",
106
+ fontWeight: 700,
107
+ fontSize: "1.3rem",
108
+ margin: 0,
109
+ textAlign: "center",
110
+ transition: "0.5s",
111
+ opacity: disabled ? 0.5 : 1,
112
+ filter: disabled ? "saturate(0)" : void 0
113
+ };
114
+ if (type === "text") {
115
+ buttonStyle.background = "none";
116
+ buttonStyle.border = "1px solid transparent";
117
+ buttonStyle.color = colors.primary;
118
+ buttonStyle.boxShadow = "none";
119
+ } else if (type === "link") {
120
+ buttonStyle.background = "none";
121
+ buttonStyle.border = "none";
122
+ buttonStyle.color = colors.primary;
123
+ buttonStyle.boxShadow = "none";
124
+ } else if (type === "outlined") {
125
+ buttonStyle.background = "none";
126
+ buttonStyle.border = `2px solid ${colors.primary}`;
127
+ buttonStyle.color = colors.primary;
128
+ buttonStyle.boxShadow = `0 14px 28px ${withAlpha(colors.onSurface, 0.08)}`;
129
+ } else {
130
+ buttonStyle.background = colors.primary;
131
+ buttonStyle.border = "1px solid transparent";
132
+ buttonStyle.color = colors.onPrimary;
133
+ buttonStyle.boxShadow = `0 14px 28px ${withAlpha(colors.primary, 0.22)}`;
134
+ }
135
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
136
+ "div",
137
+ {
138
+ style: {
139
+ width: (_a = style == null ? void 0 : style.width) != null ? _a : (style == null ? void 0 : style.maxWidth) ? "100%" : "max-content",
140
+ display: "flex",
141
+ alignItems: "center",
142
+ justifyContent: "center",
143
+ margin: "0 5px",
144
+ marginBottom: (_b = style == null ? void 0 : style.marginBottom) != null ? _b : 0,
145
+ ...style
146
+ },
147
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
148
+ "button",
149
+ {
150
+ type: "button",
151
+ onClick: disabled ? void 0 : onClick,
152
+ disabled,
153
+ style: buttonStyle,
154
+ children: label
155
+ }
156
+ )
157
+ }
158
+ );
159
+ }
160
+ function StandardModal({
161
+ isOpen,
162
+ onClose,
163
+ children,
164
+ footer,
165
+ title,
166
+ description,
167
+ headerContent,
168
+ maxWidth,
169
+ closeOnBackdrop = true,
170
+ closeOnEscape = true,
171
+ hideCloseButton = false,
172
+ hideExpandButton = false,
173
+ maximized,
174
+ contentStyle,
175
+ theme
176
+ }) {
177
+ const modalTheme = (0, import_react.useMemo)(() => resolveTheme(theme), [theme]);
178
+ const [isMaximized, setIsMaximized] = (0, import_react.useState)(maximized != null ? maximized : false);
179
+ const titleId = (0, import_react.useMemo)(
180
+ () => `smartsell-modal-${String(title != null ? title : "dialog").toLowerCase().replace(/[^a-z0-9]+/g, "-")}`,
181
+ [title]
182
+ );
183
+ (0, import_react.useEffect)(() => {
184
+ if (typeof maximized === "boolean") {
185
+ setIsMaximized(maximized);
186
+ return;
187
+ }
188
+ if (isLikelyMobileViewport()) {
189
+ setIsMaximized(true);
190
+ }
191
+ }, [maximized]);
192
+ (0, import_react.useEffect)(() => {
193
+ if (!isOpen || typeof window === "undefined" || typeof document === "undefined") {
194
+ return;
195
+ }
196
+ const previousOverflow = document.body.style.overflow;
197
+ document.body.style.overflow = "hidden";
198
+ const handleKeyDown = (event) => {
199
+ if (closeOnEscape && event.key === "Escape") {
200
+ onClose();
201
+ }
202
+ };
203
+ window.addEventListener("keydown", handleKeyDown);
204
+ return () => {
205
+ document.body.style.overflow = previousOverflow;
206
+ window.removeEventListener("keydown", handleKeyDown);
207
+ };
208
+ }, [closeOnEscape, isOpen, onClose]);
209
+ if (!isOpen) {
210
+ return null;
211
+ }
212
+ const header = headerContent != null ? headerContent : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
213
+ title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
214
+ "h2",
215
+ {
216
+ id: titleId,
217
+ style: {
218
+ margin: 0,
219
+ color: modalTheme.colors.onSurface,
220
+ fontSize: 30,
221
+ fontWeight: 800,
222
+ lineHeight: 1.1
223
+ },
224
+ children: title
225
+ }
226
+ ) : null,
227
+ description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
228
+ "p",
229
+ {
230
+ style: {
231
+ margin: 0,
232
+ color: modalTheme.mutedText,
233
+ fontSize: 15,
234
+ lineHeight: 1.6
235
+ },
236
+ children: description
237
+ }
238
+ ) : null
239
+ ] });
240
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
241
+ "div",
242
+ {
243
+ "aria-label": headerContent ? typeof title === "string" ? title : "Dialog" : void 0,
244
+ "aria-labelledby": headerContent ? void 0 : title ? titleId : void 0,
245
+ "aria-modal": "true",
246
+ role: "dialog",
247
+ onMouseDown: (event) => {
248
+ if (closeOnBackdrop && event.target === event.currentTarget) {
249
+ onClose();
250
+ }
251
+ },
252
+ style: {
253
+ position: "fixed",
254
+ inset: 0,
255
+ zIndex: 70,
256
+ display: "flex",
257
+ alignItems: "center",
258
+ justifyContent: "center",
259
+ padding: isMaximized ? 0 : 16,
260
+ backgroundColor: modalTheme.overlay,
261
+ backdropFilter: "blur(8px)"
262
+ },
263
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
264
+ "div",
265
+ {
266
+ style: {
267
+ position: "relative",
268
+ display: "flex",
269
+ flexDirection: "column",
270
+ width: isMaximized ? "100vw" : "min(100%, 100%)",
271
+ maxWidth: isMaximized ? "100vw" : normalizeWidth(maxWidth),
272
+ height: isMaximized ? "100vh" : void 0,
273
+ maxHeight: isMaximized ? "100vh" : "calc(100vh - 32px)",
274
+ borderRadius: isMaximized ? 0 : 30,
275
+ border: `1px solid ${modalTheme.borderSoft}`,
276
+ background: `linear-gradient(180deg, ${modalTheme.surfaceRaised}, ${modalTheme.colors.surface})`,
277
+ boxShadow: `0 34px 80px ${withAlpha("#020617", 0.28)}`,
278
+ color: modalTheme.colors.onSurface,
279
+ overflow: "hidden",
280
+ ...contentStyle
281
+ },
282
+ children: [
283
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
284
+ "div",
285
+ {
286
+ style: {
287
+ display: "flex",
288
+ alignItems: "flex-start",
289
+ justifyContent: "space-between",
290
+ gap: 16,
291
+ padding: "24px 24px 16px",
292
+ borderBottom: `1px solid ${withAlpha(modalTheme.colors.onSurface, 0.06)}`
293
+ },
294
+ children: [
295
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { flex: 1 }, children: header }),
296
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
297
+ !hideExpandButton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
298
+ "button",
299
+ {
300
+ "aria-label": isMaximized ? "Minimize modal" : "Maximize modal",
301
+ title: isMaximized ? "Minimize" : "Maximize",
302
+ type: "button",
303
+ onClick: () => setIsMaximized((current) => !current),
304
+ style: {
305
+ height: 42,
306
+ width: 42,
307
+ borderRadius: 999,
308
+ border: `1px solid ${modalTheme.borderSoft}`,
309
+ backgroundColor: "transparent",
310
+ color: modalTheme.colors.onSurface,
311
+ cursor: "pointer",
312
+ fontSize: 18,
313
+ fontWeight: 700
314
+ },
315
+ children: isMaximized ? "\u25A2" : "\u25A1"
316
+ }
317
+ ) : null,
318
+ !hideCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
319
+ "button",
320
+ {
321
+ "aria-label": "Close modal",
322
+ type: "button",
323
+ onClick: onClose,
324
+ style: {
325
+ height: 42,
326
+ width: 42,
327
+ borderRadius: 999,
328
+ border: `1px solid ${modalTheme.borderSoft}`,
329
+ backgroundColor: "transparent",
330
+ color: modalTheme.colors.onSurface,
331
+ cursor: "pointer",
332
+ fontSize: 20,
333
+ fontWeight: 700
334
+ },
335
+ children: "\xD7"
336
+ }
337
+ ) : null
338
+ ] })
339
+ ]
340
+ }
341
+ ),
342
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
343
+ "div",
344
+ {
345
+ style: {
346
+ flex: 1,
347
+ minHeight: 0,
348
+ overflow: "auto",
349
+ padding: 24
350
+ },
351
+ children
352
+ }
353
+ ),
354
+ footer ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
355
+ "div",
356
+ {
357
+ style: {
358
+ display: "flex",
359
+ justifyContent: "flex-end",
360
+ gap: 12,
361
+ padding: "16px 24px 24px",
362
+ borderTop: `1px solid ${withAlpha(modalTheme.colors.onSurface, 0.06)}`
363
+ },
364
+ children: footer
365
+ }
366
+ ) : null
367
+ ]
368
+ }
369
+ )
370
+ }
371
+ );
372
+ }
373
+ function LegacyModal({
374
+ title,
375
+ showModal,
376
+ closeModal,
377
+ children,
378
+ action,
379
+ actionNameBtn,
380
+ hideActionButton = false,
381
+ cancelButton,
382
+ disableActionBtn = false,
383
+ isLoading = false,
384
+ onlyCloseButton = false,
385
+ hideCloseIcon = false,
386
+ style,
387
+ bodyStyle,
388
+ additionalActions,
389
+ maximized,
390
+ theme
391
+ }) {
392
+ const modalTheme = (0, import_react.useMemo)(() => resolveTheme(theme), [theme]);
393
+ const [isMaximized, setIsMaximized] = (0, import_react.useState)(maximized != null ? maximized : false);
394
+ const resolvedAction = action != null ? action : (() => null);
395
+ (0, import_react.useEffect)(() => {
396
+ if (maximized === void 0 && isLikelyMobileViewport()) {
397
+ setIsMaximized(true);
398
+ }
399
+ }, [maximized]);
400
+ if (!showModal) {
401
+ return null;
402
+ }
403
+ const actionButtons = () => {
404
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
405
+ additionalActions == null ? void 0 : additionalActions.map((item) => {
406
+ var _a, _b, _c;
407
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
408
+ LegacyActionButton,
409
+ {
410
+ label: item.name,
411
+ onClick: item.onClick,
412
+ type: (_a = item.type) != null ? _a : "contained",
413
+ style: (_b = item.style) != null ? _b : { maxWidth: "150px" },
414
+ theme: modalTheme,
415
+ disabled: (_c = item.disable) != null ? _c : disableActionBtn || isLoading
416
+ },
417
+ item.name
418
+ );
419
+ }),
420
+ !hideActionButton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
421
+ LegacyActionButton,
422
+ {
423
+ label: actionNameBtn != null ? actionNameBtn : "Save",
424
+ onClick: resolvedAction,
425
+ type: "contained",
426
+ style: { maxWidth: "100px" },
427
+ theme: modalTheme,
428
+ disabled: disableActionBtn || isLoading
429
+ }
430
+ ) : null
431
+ ] });
432
+ };
433
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
434
+ "div",
435
+ {
436
+ "aria-labelledby": "modal-title",
437
+ "aria-modal": "true",
438
+ role: "dialog",
439
+ style: {
440
+ background: `${modalTheme.colors.background}90`,
441
+ backdropFilter: "blur(2px)",
442
+ width: "100%",
443
+ height: "100%",
444
+ position: "fixed",
445
+ zIndex: 999,
446
+ top: 0,
447
+ left: 0,
448
+ display: "flex",
449
+ justifyContent: "center",
450
+ alignItems: "center",
451
+ boxSizing: "border-box"
452
+ },
453
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
454
+ "div",
455
+ {
456
+ id: isLoading ? "ldg1" : void 0,
457
+ style: {
458
+ position: isMaximized ? "fixed" : "relative",
459
+ left: isMaximized ? 0 : void 0,
460
+ top: isMaximized ? 0 : void 0,
461
+ background: modalTheme.colors.background,
462
+ display: "flex",
463
+ alignItems: "center",
464
+ flexDirection: "column",
465
+ borderRadius: "0.8rem",
466
+ boxSizing: "border-box",
467
+ maxHeight: isMaximized ? "100vh" : "80vh",
468
+ maxWidth: isMaximized ? "100vw" : "80vw",
469
+ minWidth: isMaximized ? "100vw" : 300,
470
+ minHeight: isMaximized ? "100vh" : void 0,
471
+ width: isMaximized ? "100vw" : void 0,
472
+ boxShadow: "0 24px 64px rgba(15, 23, 42, 0.18)",
473
+ ...isLoading ? { opacity: 0.5 } : null,
474
+ ...style
475
+ },
476
+ children: [
477
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
478
+ "div",
479
+ {
480
+ style: {
481
+ background: modalTheme.colors.surface,
482
+ color: modalTheme.colors.onSurface,
483
+ position: "absolute",
484
+ top: 0,
485
+ zIndex: 500,
486
+ display: "flex",
487
+ justifyContent: "space-between",
488
+ alignItems: "center",
489
+ width: "100%",
490
+ height: "4rem",
491
+ padding: "1rem",
492
+ boxSizing: "border-box",
493
+ borderTopLeftRadius: "0.8rem",
494
+ borderTopRightRadius: "0.8rem",
495
+ borderBottom: `1px solid ${withAlpha(modalTheme.colors.onBackground, 0.1)}`
496
+ },
497
+ children: [
498
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "modal-title", style: { fontWeight: "bold", fontSize: "1.3rem" }, children: title }),
499
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
500
+ "div",
501
+ {
502
+ id: "modal-header-icons",
503
+ style: { display: "flex", alignItems: "center", gap: "0.5rem" },
504
+ children: [
505
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
506
+ "button",
507
+ {
508
+ "aria-label": isMaximized ? "Minimize modal" : "Maximize modal",
509
+ title: isMaximized ? "Minimize" : "Maximize",
510
+ type: "button",
511
+ onClick: () => setIsMaximized((current) => !current),
512
+ style: {
513
+ border: "none",
514
+ background: "transparent",
515
+ color: modalTheme.colors.onSurface,
516
+ cursor: "pointer",
517
+ fontSize: 18,
518
+ lineHeight: 1,
519
+ padding: 0
520
+ },
521
+ children: isMaximized ? "\u25A2" : "\u25A1"
522
+ }
523
+ ),
524
+ !hideCloseIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
525
+ "button",
526
+ {
527
+ "aria-label": "Close modal",
528
+ title: "Close",
529
+ type: "button",
530
+ onClick: isLoading ? void 0 : closeModal,
531
+ style: {
532
+ border: "none",
533
+ background: "transparent",
534
+ color: modalTheme.colors.onSurface,
535
+ cursor: isLoading ? "not-allowed" : "pointer",
536
+ fontSize: 22,
537
+ lineHeight: 1,
538
+ padding: 0,
539
+ opacity: isLoading ? 0.5 : 1
540
+ },
541
+ children: "\xD7"
542
+ }
543
+ ) : null
544
+ ]
545
+ }
546
+ )
547
+ ]
548
+ }
549
+ ),
550
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
551
+ "div",
552
+ {
553
+ style: {
554
+ scrollbarWidth: "thin",
555
+ width: "100%",
556
+ maxWidth: "100%",
557
+ paddingTop: "4rem",
558
+ paddingBottom: "4rem",
559
+ overflow: "auto",
560
+ ...bodyStyle
561
+ },
562
+ children
563
+ }
564
+ ),
565
+ onlyCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
566
+ "div",
567
+ {
568
+ style: {
569
+ background: modalTheme.colors.surface,
570
+ color: modalTheme.colors.onSurface,
571
+ position: "absolute",
572
+ bottom: 0,
573
+ width: "100%",
574
+ height: "4rem",
575
+ padding: "0.5rem",
576
+ borderTop: `1px solid ${withAlpha(modalTheme.colors.onBackground, 0.1)}`,
577
+ boxSizing: "border-box",
578
+ borderBottomLeftRadius: "0.8rem",
579
+ borderBottomRightRadius: "0.8rem"
580
+ },
581
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
582
+ "div",
583
+ {
584
+ className: "buttons-footer",
585
+ style: { flex: 1, display: "flex", justifyContent: "end" },
586
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
587
+ LegacyActionButton,
588
+ {
589
+ label: "Close",
590
+ onClick: closeModal,
591
+ theme: modalTheme,
592
+ disabled: isLoading
593
+ }
594
+ )
595
+ }
596
+ )
597
+ }
598
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
599
+ "div",
600
+ {
601
+ style: {
602
+ background: modalTheme.colors.surface,
603
+ color: modalTheme.colors.onSurface,
604
+ position: "absolute",
605
+ bottom: 0,
606
+ width: "100%",
607
+ height: "4rem",
608
+ padding: "0.5rem",
609
+ borderTop: `1px solid ${withAlpha(modalTheme.colors.onBackground, 0.1)}`,
610
+ boxSizing: "border-box",
611
+ borderBottomLeftRadius: "0.8rem",
612
+ borderBottomRightRadius: "0.8rem"
613
+ },
614
+ children: cancelButton ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
615
+ "div",
616
+ {
617
+ className: "buttons-footer",
618
+ style: { flex: 1, display: "flex", justifyContent: "end" },
619
+ children: [
620
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
621
+ LegacyActionButton,
622
+ {
623
+ label: "Cancel",
624
+ onClick: cancelButton,
625
+ type: "text",
626
+ style: { maxWidth: "100px" },
627
+ theme: modalTheme,
628
+ disabled: false
629
+ }
630
+ ),
631
+ actionButtons()
632
+ ]
633
+ }
634
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
635
+ "div",
636
+ {
637
+ className: "buttons-footer",
638
+ style: { flex: 1, display: "flex", justifyContent: "end" },
639
+ children: actionButtons()
640
+ }
641
+ )
642
+ }
643
+ )
644
+ ]
645
+ }
646
+ )
647
+ }
648
+ );
649
+ }
650
+ function Modal(props) {
651
+ if (isLegacyModalProps(props)) {
652
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LegacyModal, { ...props });
653
+ }
654
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandardModal, { ...props });
655
+ }
656
+ // Annotate the CommonJS export names for ESM import in node:
657
+ 0 && (module.exports = {
658
+ Modal
659
+ });
660
+ //# sourceMappingURL=modal.cjs.map