@startdownnotez404/ui 1.3.5 → 1.3.6
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/AutocompleteField-653233JU.mjs +203 -0
- package/dist/AutocompleteField-653233JU.mjs.map +1 -0
- package/dist/AvatarField-KFASMVZU.mjs +378 -0
- package/dist/AvatarField-KFASMVZU.mjs.map +1 -0
- package/dist/{DateField-ZYMZFHL4.mjs → DateField-CDJ6W6XF.mjs} +19 -7
- package/dist/DateField-CDJ6W6XF.mjs.map +1 -0
- package/dist/DateRangeField-ZWSFT5KV.mjs +118 -0
- package/dist/DateRangeField-ZWSFT5KV.mjs.map +1 -0
- package/dist/{DateTimeField-TPTJ7YIZ.mjs → DateTimeField-SFAF4I6A.mjs} +36 -11
- package/dist/DateTimeField-SFAF4I6A.mjs.map +1 -0
- package/dist/FileUploadField-TSNCSLXX.mjs +101 -0
- package/dist/FileUploadField-TSNCSLXX.mjs.map +1 -0
- package/dist/{JSONEditorField-TMRWGXVR.mjs → JSONEditorField-3KXC2GOG.mjs} +7 -6
- package/dist/{JSONEditorField-TMRWGXVR.mjs.map → JSONEditorField-3KXC2GOG.mjs.map} +1 -1
- package/dist/{PopperMenu-LJ36RPBW.mjs → PopperMenu-PSHLKIEZ.mjs} +26 -12
- package/dist/{PopperMenu-LJ36RPBW.mjs.map → PopperMenu-PSHLKIEZ.mjs.map} +1 -1
- package/dist/{TelField-LOGRVZ4I.mjs → TelField-FRQT2UBJ.mjs} +8 -7
- package/dist/{TelField-LOGRVZ4I.mjs.map → TelField-FRQT2UBJ.mjs.map} +1 -1
- package/dist/TimeField-XVWXBJID.mjs +94 -0
- package/dist/TimeField-XVWXBJID.mjs.map +1 -0
- package/dist/alert.d.mts +148 -18
- package/dist/alert.d.ts +148 -18
- package/dist/alert.js +698 -254
- package/dist/alert.js.map +1 -1
- package/dist/alert.mjs +46 -10
- package/dist/autocomplete.d.mts +438 -4
- package/dist/autocomplete.d.ts +438 -4
- package/dist/autocomplete.js +632 -21
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.mjs +26 -7
- package/dist/avatar.js +2 -1
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.mjs +12 -11
- package/dist/box.mjs +2 -1
- package/dist/button.mjs +3 -2
- package/dist/chart.mjs +3 -2
- package/dist/checkbox.mjs +3 -2
- package/dist/chunk-2FK24ZPJ.mjs +78 -0
- package/dist/chunk-2FK24ZPJ.mjs.map +1 -0
- package/dist/{chunk-V26V2S3W.mjs → chunk-3O3N6X6D.mjs} +3 -3
- package/dist/{chunk-Y74ALKBL.mjs → chunk-4MSPA7U7.mjs} +11 -9
- package/dist/{chunk-Y74ALKBL.mjs.map → chunk-4MSPA7U7.mjs.map} +1 -1
- package/dist/{chunk-24XDGNJ6.mjs → chunk-4P45Z5LR.mjs} +63 -41
- package/dist/chunk-4P45Z5LR.mjs.map +1 -0
- package/dist/chunk-4SSJY32J.mjs +1182 -0
- package/dist/chunk-4SSJY32J.mjs.map +1 -0
- package/dist/{chunk-XJ2SXC2Q.mjs → chunk-6B6I27TT.mjs} +18 -16
- package/dist/{chunk-XJ2SXC2Q.mjs.map → chunk-6B6I27TT.mjs.map} +1 -1
- package/dist/chunk-6JKMEH2L.mjs +205 -0
- package/dist/chunk-6JKMEH2L.mjs.map +1 -0
- package/dist/{chunk-IN3O4R7Q.mjs → chunk-7O526A2D.mjs} +6 -4
- package/dist/{chunk-IN3O4R7Q.mjs.map → chunk-7O526A2D.mjs.map} +1 -1
- package/dist/chunk-AFLEG5ZC.mjs +28 -0
- package/dist/chunk-AFLEG5ZC.mjs.map +1 -0
- package/dist/{chunk-UGMRJMFZ.mjs → chunk-BO5CU4ZM.mjs} +4 -4
- package/dist/{chunk-JIU5GVM7.mjs → chunk-D4XPNSSI.mjs} +5 -3
- package/dist/{chunk-JIU5GVM7.mjs.map → chunk-D4XPNSSI.mjs.map} +1 -1
- package/dist/chunk-DPIMA5IO.mjs +72 -0
- package/dist/chunk-DPIMA5IO.mjs.map +1 -0
- package/dist/chunk-F2CGFVIZ.mjs +83 -0
- package/dist/chunk-F2CGFVIZ.mjs.map +1 -0
- package/dist/{chunk-R5MKQN6D.mjs → chunk-FBLSJQWK.mjs} +3 -3
- package/dist/{chunk-BGB7JHIU.mjs → chunk-FMGZCOJC.mjs} +5 -3
- package/dist/{chunk-BGB7JHIU.mjs.map → chunk-FMGZCOJC.mjs.map} +1 -1
- package/dist/{chunk-UTVSYS6S.mjs → chunk-FNSIQ2B7.mjs} +18 -6
- package/dist/chunk-FNSIQ2B7.mjs.map +1 -0
- package/dist/{chunk-JWANK42G.mjs → chunk-FUZ2JNTZ.mjs} +3 -3
- package/dist/{chunk-CRYIEYZZ.mjs → chunk-HAJWE62X.mjs} +66 -42
- package/dist/chunk-HAJWE62X.mjs.map +1 -0
- package/dist/{chunk-CWFWRZWU.mjs → chunk-KSN33A6I.mjs} +3 -2
- package/dist/{chunk-CWFWRZWU.mjs.map → chunk-KSN33A6I.mjs.map} +1 -1
- package/dist/chunk-KYTHGFFY.mjs +866 -0
- package/dist/chunk-KYTHGFFY.mjs.map +1 -0
- package/dist/{chunk-QKGCW37O.mjs → chunk-LDFM46LV.mjs} +5 -3
- package/dist/{chunk-QKGCW37O.mjs.map → chunk-LDFM46LV.mjs.map} +1 -1
- package/dist/chunk-LQNDBPHU.mjs +142 -0
- package/dist/chunk-LQNDBPHU.mjs.map +1 -0
- package/dist/{chunk-E3I2VDHZ.mjs → chunk-M2PYXSAF.mjs} +6 -4
- package/dist/{chunk-E3I2VDHZ.mjs.map → chunk-M2PYXSAF.mjs.map} +1 -1
- package/dist/{chunk-DELCADNF.mjs → chunk-ODVKRIVN.mjs} +30 -30
- package/dist/{chunk-HR3A4H4E.mjs → chunk-PEJL2T2K.mjs} +13 -11
- package/dist/{chunk-HR3A4H4E.mjs.map → chunk-PEJL2T2K.mjs.map} +1 -1
- package/dist/{chunk-OGNGPI3M.mjs → chunk-PL55YKT4.mjs} +2 -2
- package/dist/{chunk-S6EZVRZC.mjs → chunk-PNSJC6PC.mjs} +5 -28
- package/dist/chunk-PNSJC6PC.mjs.map +1 -0
- package/dist/{chunk-TDRA5EZI.mjs → chunk-PUREEN2J.mjs} +7 -7
- package/dist/chunk-QFS5CENY.mjs +659 -0
- package/dist/chunk-QFS5CENY.mjs.map +1 -0
- package/dist/chunk-RSN7NH2J.mjs +250 -0
- package/dist/chunk-RSN7NH2J.mjs.map +1 -0
- package/dist/{chunk-UDREPVEY.mjs → chunk-RVSMEZE3.mjs} +12 -78
- package/dist/chunk-RVSMEZE3.mjs.map +1 -0
- package/dist/{chunk-SRWPHN2N.mjs → chunk-S64IYJ6Y.mjs} +2 -2
- package/dist/{chunk-ZG3NQI77.mjs → chunk-SMD7OEUW.mjs} +6 -4
- package/dist/{chunk-ZG3NQI77.mjs.map → chunk-SMD7OEUW.mjs.map} +1 -1
- package/dist/{chunk-NJYNJLT7.mjs → chunk-SWFB3A3G.mjs} +2 -2
- package/dist/{chunk-RXBQ7KXF.mjs → chunk-USXGNKWJ.mjs} +98 -44
- package/dist/chunk-USXGNKWJ.mjs.map +1 -0
- package/dist/{chunk-OJV6V7YZ.mjs → chunk-VL7V52YD.mjs} +27 -20
- package/dist/chunk-VL7V52YD.mjs.map +1 -0
- package/dist/{chunk-2ZZJTBTE.mjs → chunk-WJZ3IYET.mjs} +2 -2
- package/dist/chunk-XAJAMVAG.mjs +1720 -0
- package/dist/chunk-XAJAMVAG.mjs.map +1 -0
- package/dist/chunk-YIJ5QVJ6.mjs +277 -0
- package/dist/chunk-YIJ5QVJ6.mjs.map +1 -0
- package/dist/{chunk-T6AMRENK.mjs → chunk-YRW5NKD7.mjs} +148 -112
- package/dist/chunk-YRW5NKD7.mjs.map +1 -0
- package/dist/chunk-ZMJKG2UI.mjs +71 -0
- package/dist/chunk-ZMJKG2UI.mjs.map +1 -0
- package/dist/confirm.d.mts +48 -0
- package/dist/confirm.d.ts +48 -0
- package/dist/confirm.js +334 -0
- package/dist/confirm.js.map +1 -0
- package/dist/confirm.mjs +20 -0
- package/dist/datePicker.d.mts +256 -14
- package/dist/datePicker.d.ts +256 -14
- package/dist/datePicker.js +1624 -145
- package/dist/datePicker.js.map +1 -1
- package/dist/datePicker.mjs +19 -6
- package/dist/dialog.d.mts +166 -0
- package/dist/dialog.d.ts +166 -0
- package/dist/dialog.js +362 -0
- package/dist/dialog.js.map +1 -0
- package/dist/dialog.mjs +45 -0
- package/dist/emptyState.d.mts +17 -0
- package/dist/emptyState.d.ts +17 -0
- package/dist/emptyState.js +253 -0
- package/dist/emptyState.js.map +1 -0
- package/dist/emptyState.mjs +12 -0
- package/dist/emptyState.mjs.map +1 -0
- package/dist/errorState.d.mts +18 -0
- package/dist/errorState.d.ts +18 -0
- package/dist/{displayFile.js → errorState.js} +107 -156
- package/dist/errorState.js.map +1 -0
- package/dist/errorState.mjs +15 -0
- package/dist/errorState.mjs.map +1 -0
- package/dist/fileUpload.d.mts +197 -0
- package/dist/fileUpload.d.ts +197 -0
- package/dist/fileUpload.js +1483 -0
- package/dist/fileUpload.js.map +1 -0
- package/dist/fileUpload.mjs +65 -0
- package/dist/fileUpload.mjs.map +1 -0
- package/dist/flowMap.mjs +7 -6
- package/dist/flowMap.mjs.map +1 -1
- package/dist/image.js +1195 -429
- package/dist/image.js.map +1 -1
- package/dist/image.mjs +8 -6
- package/dist/index.d.ts +7 -2
- package/dist/index.js +8606 -4087
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +314 -152
- package/dist/inlineError.d.mts +16 -0
- package/dist/inlineError.d.ts +16 -0
- package/dist/inlineError.js +297 -0
- package/dist/inlineError.js.map +1 -0
- package/dist/inlineError.mjs +15 -0
- package/dist/inlineError.mjs.map +1 -0
- package/dist/input.mjs +8 -7
- package/dist/jsonEditor.mjs +3 -2
- package/dist/list.mjs +7 -6
- package/dist/loading.mjs +8 -6
- package/dist/markdown.mjs +7 -6
- package/dist/markdown.mjs.map +1 -1
- package/dist/menu.mjs +9 -8
- package/dist/modal.js +2 -1
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +7 -5
- package/dist/process.d.mts +33 -75
- package/dist/process.d.ts +33 -75
- package/dist/process.js +1275 -203
- package/dist/process.js.map +1 -1
- package/dist/process.mjs +12 -9
- package/dist/scrollToLoad.mjs +4 -3
- package/dist/select.mjs +10 -9
- package/dist/skeleton.d.mts +15 -1
- package/dist/skeleton.d.ts +15 -1
- package/dist/skeleton.js +114 -2
- package/dist/skeleton.js.map +1 -1
- package/dist/skeleton.mjs +6 -3
- package/dist/stepper.mjs +4 -3
- package/dist/tab.mjs +10 -9
- package/dist/table.d.mts +269 -85
- package/dist/table.d.ts +269 -85
- package/dist/table.js +5102 -3153
- package/dist/table.js.map +1 -1
- package/dist/table.mjs +21 -19
- package/dist/theme.js +1766 -432
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +32 -25
- package/dist/timeline.mjs +4 -3
- package/dist/toast.d.mts +49 -0
- package/dist/toast.d.ts +49 -0
- package/dist/toast.js +175 -0
- package/dist/toast.js.map +1 -0
- package/dist/toast.mjs +9 -0
- package/dist/toast.mjs.map +1 -0
- package/dist/toggleButtonGroup.mjs +3 -2
- package/dist/useForm.d.mts +270 -86
- package/dist/useForm.d.ts +270 -86
- package/dist/useForm.js +4672 -2727
- package/dist/useForm.js.map +1 -1
- package/dist/useForm.mjs +18 -16
- package/dist/useSearch.mjs +13 -12
- package/dist/variablesRenderer.mjs +8 -7
- package/package.json +3 -3
- package/dist/AutocompleteField-ZKNU2IRR.mjs +0 -181
- package/dist/AutocompleteField-ZKNU2IRR.mjs.map +0 -1
- package/dist/AvatarField-SAODT3CZ.mjs +0 -275
- package/dist/AvatarField-SAODT3CZ.mjs.map +0 -1
- package/dist/DateField-ZYMZFHL4.mjs.map +0 -1
- package/dist/DateTimeField-TPTJ7YIZ.mjs.map +0 -1
- package/dist/FileUploadField-NTMWBJER.mjs +0 -78
- package/dist/FileUploadField-NTMWBJER.mjs.map +0 -1
- package/dist/chunk-24XDGNJ6.mjs.map +0 -1
- package/dist/chunk-27KYFU7R.mjs +0 -30
- package/dist/chunk-27KYFU7R.mjs.map +0 -1
- package/dist/chunk-AAH2O24U.mjs +0 -325
- package/dist/chunk-AAH2O24U.mjs.map +0 -1
- package/dist/chunk-CRYIEYZZ.mjs.map +0 -1
- package/dist/chunk-EEH7HACG.mjs +0 -249
- package/dist/chunk-EEH7HACG.mjs.map +0 -1
- package/dist/chunk-EKPULYPU.mjs +0 -497
- package/dist/chunk-EKPULYPU.mjs.map +0 -1
- package/dist/chunk-OJV6V7YZ.mjs.map +0 -1
- package/dist/chunk-RXBQ7KXF.mjs.map +0 -1
- package/dist/chunk-S6EZVRZC.mjs.map +0 -1
- package/dist/chunk-SGCUDWO3.mjs +0 -396
- package/dist/chunk-SGCUDWO3.mjs.map +0 -1
- package/dist/chunk-T6AMRENK.mjs.map +0 -1
- package/dist/chunk-UDREPVEY.mjs.map +0 -1
- package/dist/chunk-UTVSYS6S.mjs.map +0 -1
- package/dist/chunk-XIMFP6RB.mjs +0 -161
- package/dist/chunk-XIMFP6RB.mjs.map +0 -1
- package/dist/displayFile.d.mts +0 -95
- package/dist/displayFile.d.ts +0 -95
- package/dist/displayFile.js.map +0 -1
- package/dist/displayFile.mjs +0 -19
- package/dist/fileUploader.d.mts +0 -86
- package/dist/fileUploader.d.ts +0 -86
- package/dist/fileUploader.js +0 -722
- package/dist/fileUploader.js.map +0 -1
- package/dist/fileUploader.mjs +0 -16
- /package/dist/{chunk-V26V2S3W.mjs.map → chunk-3O3N6X6D.mjs.map} +0 -0
- /package/dist/{chunk-UGMRJMFZ.mjs.map → chunk-BO5CU4ZM.mjs.map} +0 -0
- /package/dist/{chunk-R5MKQN6D.mjs.map → chunk-FBLSJQWK.mjs.map} +0 -0
- /package/dist/{chunk-JWANK42G.mjs.map → chunk-FUZ2JNTZ.mjs.map} +0 -0
- /package/dist/{chunk-DELCADNF.mjs.map → chunk-ODVKRIVN.mjs.map} +0 -0
- /package/dist/{chunk-OGNGPI3M.mjs.map → chunk-PL55YKT4.mjs.map} +0 -0
- /package/dist/{chunk-TDRA5EZI.mjs.map → chunk-PUREEN2J.mjs.map} +0 -0
- /package/dist/{chunk-SRWPHN2N.mjs.map → chunk-S64IYJ6Y.mjs.map} +0 -0
- /package/dist/{chunk-NJYNJLT7.mjs.map → chunk-SWFB3A3G.mjs.map} +0 -0
- /package/dist/{chunk-2ZZJTBTE.mjs.map → chunk-WJZ3IYET.mjs.map} +0 -0
- /package/dist/{displayFile.mjs.map → confirm.mjs.map} +0 -0
- /package/dist/{fileUploader.mjs.map → dialog.mjs.map} +0 -0
package/dist/alert.js
CHANGED
|
@@ -30,13 +30,24 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/components/compound/Alert/index.ts
|
|
31
31
|
var Alert_exports = {};
|
|
32
32
|
__export(Alert_exports, {
|
|
33
|
+
ALERT_STYLE_VARIANTs: () => ALERT_STYLE_VARIANTs,
|
|
33
34
|
ALERT_VARIANTs: () => ALERT_VARIANTs,
|
|
34
35
|
AlertProvider: () => AlertProvider,
|
|
36
|
+
AlertStyleVariantContext: () => AlertStyleVariantContext,
|
|
35
37
|
CollapsableAlert: () => CollapsableAlert,
|
|
36
38
|
DEFAULTs: () => DEFAULTs,
|
|
37
39
|
ERRORs: () => ERRORs,
|
|
40
|
+
SoftAlertContent: () => SoftAlertContent,
|
|
38
41
|
alertTheme: () => alertTheme,
|
|
42
|
+
collapsableAlertClassicRootSx: () => collapsableAlertClassicRootSx,
|
|
39
43
|
collapsableAlertRootSx: () => collapsableAlertRootSx,
|
|
44
|
+
collapsableAlertSoftRootSx: () => collapsableAlertSoftRootSx,
|
|
45
|
+
collapsableClassicHeaderSx: () => collapsableClassicHeaderSx,
|
|
46
|
+
collapsableClassicIconButtonSx: () => collapsableClassicIconButtonSx,
|
|
47
|
+
collapsableClassicPanelSx: () => collapsableClassicPanelSx,
|
|
48
|
+
collapsableSoftHeaderSx: () => collapsableSoftHeaderSx,
|
|
49
|
+
collapsableSoftIconButtonSx: () => collapsableSoftIconButtonSx,
|
|
50
|
+
collapsableSoftPanelSx: () => collapsableSoftPanelSx,
|
|
40
51
|
enqueueAlert: () => enqueueAlert,
|
|
41
52
|
enqueueCollapsable: () => enqueueCollapsable,
|
|
42
53
|
enqueueError: () => enqueueError,
|
|
@@ -45,22 +56,25 @@ __export(Alert_exports, {
|
|
|
45
56
|
enqueueSuccess: () => enqueueSuccess,
|
|
46
57
|
enqueueSystem: () => enqueueSystem,
|
|
47
58
|
enqueueWarning: () => enqueueWarning,
|
|
48
|
-
|
|
59
|
+
softAlertAccentBarSx: () => softAlertAccentBarSx,
|
|
60
|
+
softAlertIconSx: () => softAlertIconSx,
|
|
61
|
+
softAlertItemRootSx: () => softAlertItemRootSx,
|
|
62
|
+
toast: () => toast,
|
|
63
|
+
useAlert: () => useAlert,
|
|
64
|
+
useAlertStyleVariantDefault: () => useAlertStyleVariantDefault,
|
|
65
|
+
useToast: () => useToast
|
|
49
66
|
});
|
|
50
67
|
module.exports = __toCommonJS(Alert_exports);
|
|
51
68
|
|
|
52
69
|
// src/components/compound/Alert/src/AlertProvider.tsx
|
|
53
|
-
var
|
|
54
|
-
var
|
|
70
|
+
var import_react6 = __toESM(require("react"));
|
|
71
|
+
var import_notistack5 = require("notistack");
|
|
55
72
|
|
|
56
73
|
// src/components/compound/Alert/src/MuiAlertVariant.tsx
|
|
57
|
-
var
|
|
58
|
-
var
|
|
74
|
+
var import_react4 = require("react");
|
|
75
|
+
var import_notistack3 = require("notistack");
|
|
59
76
|
var import_Alert = __toESM(require("@mui/material/Alert"));
|
|
60
77
|
|
|
61
|
-
// src/components/compound/Alert/src/_utils/utils.ts
|
|
62
|
-
var import_notistack = require("notistack");
|
|
63
|
-
|
|
64
78
|
// src/_utils/_func/random.ts
|
|
65
79
|
function randomStrGenerator(length = 20) {
|
|
66
80
|
let result = "";
|
|
@@ -71,6 +85,108 @@ function randomStrGenerator(length = 20) {
|
|
|
71
85
|
return result;
|
|
72
86
|
}
|
|
73
87
|
|
|
88
|
+
// src/_utils/_func/sx.ts
|
|
89
|
+
function flattenSx(part) {
|
|
90
|
+
if (part == null || typeof part === "boolean") {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
if (Array.isArray(part)) {
|
|
94
|
+
return part.flatMap(flattenSx);
|
|
95
|
+
}
|
|
96
|
+
if (typeof part === "function" || typeof part === "object") {
|
|
97
|
+
return [part];
|
|
98
|
+
}
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
function mergeSx(...parts) {
|
|
102
|
+
const list = parts.flatMap(flattenSx);
|
|
103
|
+
if (list.length === 0) {
|
|
104
|
+
return void 0;
|
|
105
|
+
}
|
|
106
|
+
if (list.length === 1) {
|
|
107
|
+
return list[0];
|
|
108
|
+
}
|
|
109
|
+
return list;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/components/elemental/Box/src/index.ts
|
|
113
|
+
var import_Box = __toESM(require("@mui/material/Box"));
|
|
114
|
+
var import_Stack = __toESM(require("@mui/material/Stack"));
|
|
115
|
+
var import_Grid = __toESM(require("@mui/material/Grid"));
|
|
116
|
+
|
|
117
|
+
// src/components/elemental/Button/src/Button/Button.tsx
|
|
118
|
+
var import_Button = __toESM(require("@mui/material/Button"));
|
|
119
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
120
|
+
function Button(p) {
|
|
121
|
+
const { children, slotProps, ...rest } = p;
|
|
122
|
+
const { sx, ...boxRest } = slotProps?.innerBox ?? {};
|
|
123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.default, { ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
124
|
+
import_Box.default,
|
|
125
|
+
{
|
|
126
|
+
...boxRest,
|
|
127
|
+
sx: mergeSx(
|
|
128
|
+
{
|
|
129
|
+
textOverflow: "ellipsis",
|
|
130
|
+
overflow: "hidden",
|
|
131
|
+
whiteSpace: "pre"
|
|
132
|
+
},
|
|
133
|
+
sx
|
|
134
|
+
),
|
|
135
|
+
children
|
|
136
|
+
}
|
|
137
|
+
) });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/components/elemental/Button/src/IconButton/IconButton.tsx
|
|
141
|
+
var import_react = require("react");
|
|
142
|
+
var import_IconButton = __toESM(require("@mui/material/IconButton"));
|
|
143
|
+
|
|
144
|
+
// src/components/elemental/Tooltip/src/Tooltip/index.ts
|
|
145
|
+
var import_Tooltip = __toESM(require("@mui/material/Tooltip"));
|
|
146
|
+
|
|
147
|
+
// src/components/elemental/Button/src/IconButton/IconButton.tsx
|
|
148
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
149
|
+
var IconButton = (0, import_react.forwardRef)(({
|
|
150
|
+
title = "",
|
|
151
|
+
children,
|
|
152
|
+
color,
|
|
153
|
+
size,
|
|
154
|
+
slotProps,
|
|
155
|
+
selected,
|
|
156
|
+
className,
|
|
157
|
+
...props
|
|
158
|
+
}, ref) => {
|
|
159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
160
|
+
import_Tooltip.default,
|
|
161
|
+
{
|
|
162
|
+
title,
|
|
163
|
+
slotProps: {
|
|
164
|
+
popper: {
|
|
165
|
+
sx: {
|
|
166
|
+
textTransform: "capitalize"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
...slotProps?.tooltip
|
|
170
|
+
},
|
|
171
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Box.default, { component: "span", sx: { width: "fit-content" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
172
|
+
import_IconButton.default,
|
|
173
|
+
{
|
|
174
|
+
ref,
|
|
175
|
+
color,
|
|
176
|
+
size,
|
|
177
|
+
className: [className, selected ? "Mui-selected" : ""].filter(Boolean).join(" "),
|
|
178
|
+
...props,
|
|
179
|
+
children
|
|
180
|
+
}
|
|
181
|
+
) })
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
});
|
|
185
|
+
var IconButton_default = IconButton;
|
|
186
|
+
|
|
187
|
+
// src/components/compound/Alert/src/_utils/utils.ts
|
|
188
|
+
var import_notistack = require("notistack");
|
|
189
|
+
|
|
74
190
|
// src/components/compound/Alert/src/_utils/const.ts
|
|
75
191
|
var ALERT_VARIANTs = {
|
|
76
192
|
info: "myInfo",
|
|
@@ -81,8 +197,14 @@ var ALERT_VARIANTs = {
|
|
|
81
197
|
insight: "myInsight",
|
|
82
198
|
collapsable: "myCollapsable"
|
|
83
199
|
};
|
|
200
|
+
var ALERT_STYLE_VARIANTs = {
|
|
201
|
+
soft: "soft",
|
|
202
|
+
classic: "classic"
|
|
203
|
+
};
|
|
84
204
|
var DEFAULTs = {
|
|
85
205
|
AUTO_HIDE_DURATION: 3e3,
|
|
206
|
+
/** Quiet glass toast look is the default snackbar chrome. */
|
|
207
|
+
STYLE_VARIANT: "soft",
|
|
86
208
|
ANCHOR_ORIGIN: { horizontal: "right", vertical: "top" },
|
|
87
209
|
PROVIDER_CONFIGs: {
|
|
88
210
|
maxSnack: 3,
|
|
@@ -106,6 +228,8 @@ function enqueueAlertWith(enqueue, {
|
|
|
106
228
|
autoHideDuration = DEFAULTs.AUTO_HIDE_DURATION,
|
|
107
229
|
anchorOrigin = DEFAULTs.ANCHOR_ORIGIN,
|
|
108
230
|
icon,
|
|
231
|
+
styleVariant,
|
|
232
|
+
action,
|
|
109
233
|
...rest
|
|
110
234
|
}) {
|
|
111
235
|
try {
|
|
@@ -116,42 +240,44 @@ function enqueueAlertWith(enqueue, {
|
|
|
116
240
|
key: id,
|
|
117
241
|
id,
|
|
118
242
|
icon,
|
|
243
|
+
styleVariant,
|
|
244
|
+
alertAction: action,
|
|
119
245
|
...rest
|
|
120
246
|
});
|
|
121
247
|
return { success: true, data: id };
|
|
122
|
-
} catch (
|
|
123
|
-
console.error("Failed to enqueue alert:",
|
|
124
|
-
return { success: false, error:
|
|
248
|
+
} catch (error2) {
|
|
249
|
+
console.error("Failed to enqueue alert:", error2);
|
|
250
|
+
return { success: false, error: error2 instanceof Error ? error2.message : "Unknown error" };
|
|
125
251
|
}
|
|
126
252
|
}
|
|
127
253
|
function enqueueCollapsableWith(enqueue, {
|
|
128
254
|
id = randomStrGenerator(10),
|
|
129
255
|
autoHideDuration = DEFAULTs.AUTO_HIDE_DURATION,
|
|
130
256
|
anchorOrigin = DEFAULTs.ANCHOR_ORIGIN,
|
|
257
|
+
styleVariant,
|
|
131
258
|
componentProps = {},
|
|
132
|
-
componentWrapperProps = {
|
|
133
|
-
Renderer: () => null
|
|
134
|
-
},
|
|
259
|
+
componentWrapperProps = {},
|
|
135
260
|
...rest
|
|
136
261
|
}) {
|
|
137
262
|
try {
|
|
138
|
-
enqueue({
|
|
263
|
+
enqueue("", {
|
|
139
264
|
variant: ALERT_VARIANTs.collapsable,
|
|
140
265
|
anchorOrigin,
|
|
141
266
|
autoHideDuration,
|
|
142
267
|
componentProps,
|
|
143
268
|
componentWrapperProps,
|
|
144
269
|
id,
|
|
270
|
+
styleVariant,
|
|
145
271
|
...rest
|
|
146
272
|
});
|
|
147
273
|
return { success: true, data: id };
|
|
148
|
-
} catch (
|
|
149
|
-
console.error("Failed to enqueue collapsable alert:",
|
|
150
|
-
return { success: false, error:
|
|
274
|
+
} catch (error2) {
|
|
275
|
+
console.error("Failed to enqueue collapsable alert:", error2);
|
|
276
|
+
return { success: false, error: error2 instanceof Error ? error2.message : "Unknown error" };
|
|
151
277
|
}
|
|
152
278
|
}
|
|
153
279
|
function useAlert() {
|
|
154
|
-
const { enqueueSnackbar: enqueue, closeSnackbar } = (0, import_notistack.useSnackbar)();
|
|
280
|
+
const { enqueueSnackbar: enqueue, closeSnackbar: closeSnackbar2 } = (0, import_notistack.useSnackbar)();
|
|
155
281
|
const enqueueAlert2 = (options) => enqueueAlertWith(enqueue, options);
|
|
156
282
|
const enqueueCollapsable2 = (options) => enqueueCollapsableWith(enqueue, options);
|
|
157
283
|
const enqueueError2 = (message, options) => enqueueAlert2({ variant: ALERT_VARIANTs.error, message, ...options });
|
|
@@ -169,7 +295,7 @@ function useAlert() {
|
|
|
169
295
|
enqueueInfo: enqueueInfo2,
|
|
170
296
|
enqueueSystem: enqueueSystem2,
|
|
171
297
|
enqueueInsight: enqueueInsight2,
|
|
172
|
-
closeSnackbar
|
|
298
|
+
closeSnackbar: closeSnackbar2
|
|
173
299
|
};
|
|
174
300
|
}
|
|
175
301
|
function enqueueAlert({
|
|
@@ -179,6 +305,8 @@ function enqueueAlert({
|
|
|
179
305
|
autoHideDuration = DEFAULTs.AUTO_HIDE_DURATION,
|
|
180
306
|
anchorOrigin = DEFAULTs.ANCHOR_ORIGIN,
|
|
181
307
|
icon,
|
|
308
|
+
styleVariant,
|
|
309
|
+
action,
|
|
182
310
|
...rest
|
|
183
311
|
}) {
|
|
184
312
|
return enqueueAlertWith(import_notistack.enqueueSnackbar, {
|
|
@@ -188,6 +316,8 @@ function enqueueAlert({
|
|
|
188
316
|
autoHideDuration,
|
|
189
317
|
anchorOrigin,
|
|
190
318
|
icon,
|
|
319
|
+
styleVariant,
|
|
320
|
+
action,
|
|
191
321
|
...rest
|
|
192
322
|
});
|
|
193
323
|
}
|
|
@@ -195,16 +325,16 @@ function enqueueCollapsable({
|
|
|
195
325
|
id = randomStrGenerator(10),
|
|
196
326
|
autoHideDuration = DEFAULTs.AUTO_HIDE_DURATION,
|
|
197
327
|
anchorOrigin = DEFAULTs.ANCHOR_ORIGIN,
|
|
328
|
+
styleVariant,
|
|
198
329
|
componentProps = {},
|
|
199
|
-
componentWrapperProps = {
|
|
200
|
-
Renderer: () => null
|
|
201
|
-
},
|
|
330
|
+
componentWrapperProps = {},
|
|
202
331
|
...rest
|
|
203
332
|
}) {
|
|
204
333
|
return enqueueCollapsableWith(import_notistack.enqueueSnackbar, {
|
|
205
334
|
id,
|
|
206
335
|
autoHideDuration,
|
|
207
336
|
anchorOrigin,
|
|
337
|
+
styleVariant,
|
|
208
338
|
componentProps,
|
|
209
339
|
componentWrapperProps,
|
|
210
340
|
...rest
|
|
@@ -253,143 +383,18 @@ function enqueueInsight(message, options) {
|
|
|
253
383
|
});
|
|
254
384
|
}
|
|
255
385
|
|
|
256
|
-
// src/components/compound/Alert/src/
|
|
257
|
-
var
|
|
258
|
-
var
|
|
259
|
-
|
|
260
|
-
[ALERT_VARIANTs.warning]: "warning",
|
|
261
|
-
[ALERT_VARIANTs.success]: "success",
|
|
262
|
-
[ALERT_VARIANTs.error]: "error",
|
|
263
|
-
[ALERT_VARIANTs.system]: "system",
|
|
264
|
-
[ALERT_VARIANTs.insight]: "insight",
|
|
265
|
-
[ALERT_VARIANTs.collapsable]: "info"
|
|
266
|
-
// Default to info for collapsable
|
|
267
|
-
};
|
|
268
|
-
var MuiAlertVariant = (0, import_react.forwardRef)(
|
|
269
|
-
(props, ref) => {
|
|
270
|
-
const { id, message, variant, icon, style } = props;
|
|
271
|
-
const { closeSnackbar } = (0, import_notistack2.useSnackbar)();
|
|
272
|
-
const handleDismiss = (0, import_react.useCallback)(() => {
|
|
273
|
-
closeSnackbar(id);
|
|
274
|
-
}, [id, closeSnackbar]);
|
|
275
|
-
const severity = variantToSeverity[variant] || "info";
|
|
276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
277
|
-
import_Alert.default,
|
|
278
|
-
{
|
|
279
|
-
ref,
|
|
280
|
-
severity,
|
|
281
|
-
onClose: handleDismiss,
|
|
282
|
-
icon,
|
|
283
|
-
style,
|
|
284
|
-
children: message
|
|
285
|
-
}
|
|
286
|
-
);
|
|
287
|
-
}
|
|
386
|
+
// src/components/compound/Alert/src/AlertStyleVariantContext.tsx
|
|
387
|
+
var import_react2 = __toESM(require("react"));
|
|
388
|
+
var AlertStyleVariantContext = import_react2.default.createContext(
|
|
389
|
+
DEFAULTs.STYLE_VARIANT
|
|
288
390
|
);
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
var import_react3 = require("react");
|
|
292
|
-
var import_notistack3 = require("notistack");
|
|
293
|
-
var import_CardActions2 = __toESM(require("@mui/material/CardActions"));
|
|
294
|
-
|
|
295
|
-
// src/components/elemental/Card/src/Card/index.ts
|
|
296
|
-
var import_Card2 = __toESM(require("@mui/material/Card"));
|
|
297
|
-
|
|
298
|
-
// src/components/elemental/Card/src/Card/Card.tsx
|
|
299
|
-
var import_Card = __toESM(require("@mui/material/Card"));
|
|
300
|
-
var import_CardContent = __toESM(require("@mui/material/CardContent"));
|
|
301
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
302
|
-
function Card({
|
|
303
|
-
children,
|
|
304
|
-
slotProps,
|
|
305
|
-
...rest
|
|
306
|
-
}) {
|
|
307
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Card.default, { ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_CardContent.default, { ...slotProps?.cardContent, children }) });
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// src/components/elemental/Card/src/Card/index.ts
|
|
311
|
-
var import_CardContent2 = __toESM(require("@mui/material/CardContent"));
|
|
312
|
-
var import_CardHeader = __toESM(require("@mui/material/CardHeader"));
|
|
313
|
-
var import_CardActions = __toESM(require("@mui/material/CardActions"));
|
|
314
|
-
|
|
315
|
-
// src/components/elemental/Collapse/src/Collapse/index.ts
|
|
316
|
-
var import_Collapse = __toESM(require("@mui/material/Collapse"));
|
|
317
|
-
|
|
318
|
-
// src/_utils/_func/sx.ts
|
|
319
|
-
function flattenSx(part) {
|
|
320
|
-
if (part == null || typeof part === "boolean") {
|
|
321
|
-
return [];
|
|
322
|
-
}
|
|
323
|
-
if (Array.isArray(part)) {
|
|
324
|
-
return part.flatMap(flattenSx);
|
|
325
|
-
}
|
|
326
|
-
if (typeof part === "function" || typeof part === "object") {
|
|
327
|
-
return [part];
|
|
328
|
-
}
|
|
329
|
-
return [];
|
|
330
|
-
}
|
|
331
|
-
function mergeSx(...parts) {
|
|
332
|
-
const list = parts.flatMap(flattenSx);
|
|
333
|
-
if (list.length === 0) {
|
|
334
|
-
return void 0;
|
|
335
|
-
}
|
|
336
|
-
if (list.length === 1) {
|
|
337
|
-
return list[0];
|
|
338
|
-
}
|
|
339
|
-
return list;
|
|
391
|
+
function useAlertStyleVariantDefault() {
|
|
392
|
+
return import_react2.default.useContext(AlertStyleVariantContext);
|
|
340
393
|
}
|
|
341
394
|
|
|
342
|
-
// src/components/
|
|
343
|
-
var
|
|
344
|
-
var
|
|
345
|
-
var import_Grid = __toESM(require("@mui/material/Grid"));
|
|
346
|
-
|
|
347
|
-
// src/components/elemental/Button/src/IconButton/IconButton.tsx
|
|
348
|
-
var import_react2 = require("react");
|
|
349
|
-
var import_IconButton = __toESM(require("@mui/material/IconButton"));
|
|
350
|
-
|
|
351
|
-
// src/components/elemental/Tooltip/src/Tooltip/index.ts
|
|
352
|
-
var import_Tooltip = __toESM(require("@mui/material/Tooltip"));
|
|
353
|
-
|
|
354
|
-
// src/components/elemental/Button/src/IconButton/IconButton.tsx
|
|
355
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
356
|
-
var IconButton = (0, import_react2.forwardRef)(({
|
|
357
|
-
title = "",
|
|
358
|
-
children,
|
|
359
|
-
color,
|
|
360
|
-
size,
|
|
361
|
-
slotProps,
|
|
362
|
-
selected,
|
|
363
|
-
className,
|
|
364
|
-
...props
|
|
365
|
-
}, ref) => {
|
|
366
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
367
|
-
import_Tooltip.default,
|
|
368
|
-
{
|
|
369
|
-
title,
|
|
370
|
-
slotProps: {
|
|
371
|
-
popper: {
|
|
372
|
-
sx: {
|
|
373
|
-
textTransform: "capitalize"
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
...slotProps?.tooltip
|
|
377
|
-
},
|
|
378
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Box.default, { component: "span", sx: { width: "fit-content" }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
379
|
-
import_IconButton.default,
|
|
380
|
-
{
|
|
381
|
-
ref,
|
|
382
|
-
color,
|
|
383
|
-
size,
|
|
384
|
-
className: [className, selected ? "Mui-selected" : ""].filter(Boolean).join(" "),
|
|
385
|
-
...props,
|
|
386
|
-
children
|
|
387
|
-
}
|
|
388
|
-
) })
|
|
389
|
-
}
|
|
390
|
-
);
|
|
391
|
-
});
|
|
392
|
-
var IconButton_default = IconButton;
|
|
395
|
+
// src/components/compound/Alert/src/SoftAlertContent.tsx
|
|
396
|
+
var import_react3 = require("react");
|
|
397
|
+
var import_notistack2 = require("notistack");
|
|
393
398
|
|
|
394
399
|
// src/components/elemental/Typography/src/Typography.ts
|
|
395
400
|
var import_Typography = __toESM(require("@mui/material/Typography"));
|
|
@@ -543,10 +548,162 @@ var import_ErrorOutlineOutlined = __toESM(require("@mui/icons-material/ErrorOutl
|
|
|
543
548
|
var import_Download = __toESM(require("@mui/icons-material/Download"));
|
|
544
549
|
|
|
545
550
|
// src/components/compound/Alert/src/theme.ts
|
|
546
|
-
var
|
|
547
|
-
"--collapse-bg": "var(--mui-palette-
|
|
551
|
+
var collapsableAlertClassicRootSx = {
|
|
552
|
+
"--collapse-bg": "var(--mui-palette-background-paper)",
|
|
553
|
+
"--collapse-border": "var(--mui-palette-border-1)",
|
|
554
|
+
"--collapse-title-color": "var(--mui-palette-text-primary)",
|
|
555
|
+
"--collapse-shadow": "0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 8px rgba(15, 23, 42, 0.04)",
|
|
556
|
+
pointerEvents: "auto",
|
|
557
|
+
display: "flex",
|
|
558
|
+
flexDirection: "column",
|
|
559
|
+
minWidth: 280,
|
|
560
|
+
maxWidth: "min(420px, calc(100vw - 24px))",
|
|
561
|
+
width: "100%",
|
|
562
|
+
borderRadius: "10px",
|
|
563
|
+
border: "1px solid var(--collapse-border)",
|
|
564
|
+
backgroundColor: "var(--collapse-bg)",
|
|
565
|
+
color: "var(--collapse-title-color)",
|
|
566
|
+
boxShadow: "var(--collapse-shadow)",
|
|
567
|
+
boxSizing: "border-box",
|
|
568
|
+
overflow: "hidden",
|
|
569
|
+
'[color-scheme="dark"] &': {
|
|
570
|
+
"--collapse-bg": "var(--mui-palette-container-bg-1, var(--mui-palette-background-paper))",
|
|
571
|
+
"--collapse-shadow": "0 1px 2px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.16)"
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
var collapsableAlertRootSx = collapsableAlertClassicRootSx;
|
|
575
|
+
var collapsableAlertSoftRootSx = {
|
|
576
|
+
"--collapse-bg": "color-mix(in srgb, var(--mui-palette-background-paper) 88%, transparent)",
|
|
548
577
|
"--collapse-border": "var(--mui-palette-border-1)",
|
|
549
|
-
"--collapse-title-color": "var(--mui-palette-text-primary)"
|
|
578
|
+
"--collapse-title-color": "var(--mui-palette-text-primary)",
|
|
579
|
+
"--collapse-shadow": "0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06)",
|
|
580
|
+
pointerEvents: "auto",
|
|
581
|
+
display: "flex",
|
|
582
|
+
flexDirection: "column",
|
|
583
|
+
minWidth: 280,
|
|
584
|
+
maxWidth: "min(420px, calc(100vw - 24px))",
|
|
585
|
+
width: "100%",
|
|
586
|
+
borderRadius: "12px",
|
|
587
|
+
border: "1px solid var(--collapse-border)",
|
|
588
|
+
backgroundColor: "var(--collapse-bg)",
|
|
589
|
+
color: "var(--collapse-title-color)",
|
|
590
|
+
boxShadow: "var(--collapse-shadow)",
|
|
591
|
+
backdropFilter: "blur(10px)",
|
|
592
|
+
WebkitBackdropFilter: "blur(10px)",
|
|
593
|
+
boxSizing: "border-box",
|
|
594
|
+
overflow: "hidden",
|
|
595
|
+
'[color-scheme="dark"] &': {
|
|
596
|
+
"--collapse-shadow": "0 1px 2px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.14)"
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
var collapsableSoftHeaderSx = {
|
|
600
|
+
display: "flex",
|
|
601
|
+
alignItems: "center",
|
|
602
|
+
justifyContent: "space-between",
|
|
603
|
+
gap: 1,
|
|
604
|
+
px: 1.5,
|
|
605
|
+
py: 1.25,
|
|
606
|
+
minHeight: 40
|
|
607
|
+
};
|
|
608
|
+
var collapsableClassicHeaderSx = {
|
|
609
|
+
display: "flex",
|
|
610
|
+
alignItems: "center",
|
|
611
|
+
justifyContent: "space-between",
|
|
612
|
+
gap: 1,
|
|
613
|
+
px: 1.5,
|
|
614
|
+
py: 1.125,
|
|
615
|
+
minHeight: 44
|
|
616
|
+
};
|
|
617
|
+
var collapsableSoftIconButtonSx = {
|
|
618
|
+
flexShrink: 0,
|
|
619
|
+
p: 0.25,
|
|
620
|
+
color: "var(--mui-palette-text-secondary)",
|
|
621
|
+
backgroundColor: "transparent",
|
|
622
|
+
borderRadius: "8px",
|
|
623
|
+
"&:hover": {
|
|
624
|
+
backgroundColor: "color-mix(in srgb, var(--mui-palette-text-primary) 6%, transparent)"
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
var collapsableClassicIconButtonSx = {
|
|
628
|
+
flexShrink: 0,
|
|
629
|
+
p: 0.375,
|
|
630
|
+
color: "var(--mui-palette-text-secondary)",
|
|
631
|
+
backgroundColor: "transparent",
|
|
632
|
+
borderRadius: "8px",
|
|
633
|
+
"&:hover": {
|
|
634
|
+
backgroundColor: "color-mix(in srgb, var(--mui-palette-text-primary) 8%, transparent)",
|
|
635
|
+
color: "var(--mui-palette-text-primary)"
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
var collapsableSoftPanelSx = {
|
|
639
|
+
px: 1.5,
|
|
640
|
+
pb: 1.5,
|
|
641
|
+
pt: 0.75,
|
|
642
|
+
borderTop: "1px solid var(--collapse-border)"
|
|
643
|
+
};
|
|
644
|
+
var collapsableClassicPanelSx = {
|
|
645
|
+
px: 1.5,
|
|
646
|
+
pb: 1.5,
|
|
647
|
+
pt: 1,
|
|
648
|
+
borderTop: "1px solid var(--collapse-border)",
|
|
649
|
+
backgroundColor: "color-mix(in srgb, var(--mui-palette-text-primary) 2.5%, var(--collapse-bg))"
|
|
650
|
+
};
|
|
651
|
+
var softAlertItemRootSx = {
|
|
652
|
+
"--soft-alert-bg": "color-mix(in srgb, var(--mui-palette-background-paper) 88%, transparent)",
|
|
653
|
+
"--soft-alert-border": "var(--mui-palette-border-1)",
|
|
654
|
+
"--soft-alert-fg": "var(--mui-palette-text-primary)",
|
|
655
|
+
"--soft-alert-accent": "var(--mui-palette-info-main)",
|
|
656
|
+
"--soft-alert-shadow": "0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06)",
|
|
657
|
+
pointerEvents: "auto",
|
|
658
|
+
display: "flex",
|
|
659
|
+
alignItems: "center",
|
|
660
|
+
gap: 1,
|
|
661
|
+
px: 1.5,
|
|
662
|
+
py: 1.25,
|
|
663
|
+
minWidth: 280,
|
|
664
|
+
maxWidth: "min(420px, calc(100vw - 24px))",
|
|
665
|
+
borderRadius: "12px",
|
|
666
|
+
border: "1px solid var(--soft-alert-border)",
|
|
667
|
+
backgroundColor: "var(--soft-alert-bg)",
|
|
668
|
+
color: "var(--soft-alert-fg)",
|
|
669
|
+
boxShadow: "var(--soft-alert-shadow)",
|
|
670
|
+
backdropFilter: "blur(10px)",
|
|
671
|
+
WebkitBackdropFilter: "blur(10px)",
|
|
672
|
+
boxSizing: "border-box",
|
|
673
|
+
'[color-scheme="dark"] &': {
|
|
674
|
+
"--soft-alert-shadow": "0 1px 2px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.14)"
|
|
675
|
+
},
|
|
676
|
+
"&[data-variant=success]": {
|
|
677
|
+
"--soft-alert-accent": "var(--mui-palette-success-main)"
|
|
678
|
+
},
|
|
679
|
+
"&[data-variant=error]": {
|
|
680
|
+
"--soft-alert-accent": "var(--mui-palette-error-main)"
|
|
681
|
+
},
|
|
682
|
+
"&[data-variant=warning]": {
|
|
683
|
+
"--soft-alert-accent": "var(--mui-palette-warning-main)"
|
|
684
|
+
},
|
|
685
|
+
"&[data-variant=info]": {
|
|
686
|
+
"--soft-alert-accent": "var(--mui-palette-info-main)"
|
|
687
|
+
},
|
|
688
|
+
"&[data-variant=system]": {
|
|
689
|
+
"--soft-alert-accent": "var(--mui-palette-system-main)"
|
|
690
|
+
},
|
|
691
|
+
"&[data-variant=insight]": {
|
|
692
|
+
"--soft-alert-accent": "var(--mui-palette-insight-main)"
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
var softAlertAccentBarSx = {
|
|
696
|
+
width: 3,
|
|
697
|
+
alignSelf: "stretch",
|
|
698
|
+
borderRadius: 2,
|
|
699
|
+
backgroundColor: "var(--soft-alert-accent)",
|
|
700
|
+
flexShrink: 0,
|
|
701
|
+
opacity: 0.85
|
|
702
|
+
};
|
|
703
|
+
var softAlertIconSx = {
|
|
704
|
+
color: "var(--soft-alert-accent)",
|
|
705
|
+
fontSize: "1.25rem",
|
|
706
|
+
flexShrink: 0
|
|
550
707
|
};
|
|
551
708
|
var alertTheme = {
|
|
552
709
|
styleOverrides: {
|
|
@@ -635,113 +792,287 @@ var alertTheme = {
|
|
|
635
792
|
}
|
|
636
793
|
};
|
|
637
794
|
|
|
638
|
-
// src/components/compound/Alert/src/
|
|
639
|
-
var
|
|
640
|
-
var
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
795
|
+
// src/components/compound/Alert/src/SoftAlertContent.tsx
|
|
796
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
797
|
+
var VARIANT_ICON = {
|
|
798
|
+
[ALERT_VARIANTs.success]: import_CheckCircle.default,
|
|
799
|
+
[ALERT_VARIANTs.error]: import_ErrorOutlineOutlined.default,
|
|
800
|
+
[ALERT_VARIANTs.warning]: import_WarningOutlined.default,
|
|
801
|
+
[ALERT_VARIANTs.info]: import_InfoOutlined.default,
|
|
802
|
+
[ALERT_VARIANTs.system]: import_Settings.default,
|
|
803
|
+
[ALERT_VARIANTs.insight]: import_AutoAwesomeRounded.default,
|
|
804
|
+
[ALERT_VARIANTs.collapsable]: import_InfoOutlined.default
|
|
805
|
+
};
|
|
806
|
+
var VARIANT_DATA = {
|
|
807
|
+
[ALERT_VARIANTs.success]: "success",
|
|
808
|
+
[ALERT_VARIANTs.error]: "error",
|
|
809
|
+
[ALERT_VARIANTs.warning]: "warning",
|
|
810
|
+
[ALERT_VARIANTs.info]: "info",
|
|
811
|
+
[ALERT_VARIANTs.system]: "system",
|
|
812
|
+
[ALERT_VARIANTs.insight]: "insight",
|
|
813
|
+
[ALERT_VARIANTs.collapsable]: "info"
|
|
814
|
+
};
|
|
815
|
+
var SoftAlertContent = (0, import_react3.forwardRef)(
|
|
816
|
+
function SoftAlertContent2(props, ref) {
|
|
817
|
+
const { id, message, variant, icon, style, alertAction: action } = props;
|
|
818
|
+
const { closeSnackbar: closeSnackbar2 } = (0, import_notistack2.useSnackbar)();
|
|
647
819
|
const handleDismiss = (0, import_react3.useCallback)(() => {
|
|
648
|
-
|
|
649
|
-
}, [id,
|
|
650
|
-
const {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
|
|
820
|
+
closeSnackbar2(id);
|
|
821
|
+
}, [id, closeSnackbar2]);
|
|
822
|
+
const handleAction = (0, import_react3.useCallback)(() => {
|
|
823
|
+
action?.onClick();
|
|
824
|
+
closeSnackbar2(id);
|
|
825
|
+
}, [action, closeSnackbar2, id]);
|
|
826
|
+
const Icon = VARIANT_ICON[variant] ?? import_InfoOutlined.default;
|
|
827
|
+
const dataVariant = VARIANT_DATA[variant] ?? "info";
|
|
828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
829
|
+
import_Box.default,
|
|
656
830
|
{
|
|
657
831
|
ref,
|
|
832
|
+
role: "status",
|
|
833
|
+
"aria-live": "polite",
|
|
834
|
+
"data-variant": dataVariant,
|
|
835
|
+
"data-style-variant": "soft",
|
|
836
|
+
"data-testid": "soft-alert",
|
|
658
837
|
style,
|
|
659
|
-
sx:
|
|
660
|
-
"&.MuiPaper-root": {
|
|
661
|
-
background: "var(--collapse-bg)",
|
|
662
|
-
backdropFilter: "blur(9px)",
|
|
663
|
-
transition: "all 0.3s ease-in-out, color 0s",
|
|
664
|
-
color: "text.primary",
|
|
665
|
-
height: "fit-content",
|
|
666
|
-
border: `1px solid var(--collapse-border)`
|
|
667
|
-
}
|
|
668
|
-
}),
|
|
838
|
+
sx: softAlertItemRootSx,
|
|
669
839
|
children: [
|
|
670
|
-
/* @__PURE__ */ (0,
|
|
671
|
-
|
|
840
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Box.default, { sx: softAlertAccentBarSx, "aria-hidden": true }),
|
|
841
|
+
icon === null ? null : icon !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Box.default, { sx: { display: "flex", flexShrink: 0, color: "var(--soft-alert-accent)" }, children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { sx: softAlertIconSx, "aria-hidden": true }),
|
|
842
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Box.default, { sx: { flex: 1, minWidth: 0 }, children: typeof message === "string" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Typography.default, { variant: "body2", sx: { m: 0, lineHeight: 1.4 }, children: message }) : message }),
|
|
843
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
844
|
+
Button,
|
|
672
845
|
{
|
|
846
|
+
size: "small",
|
|
847
|
+
variant: "text",
|
|
848
|
+
onClick: handleAction,
|
|
673
849
|
sx: {
|
|
674
|
-
|
|
675
|
-
|
|
850
|
+
flexShrink: 0,
|
|
851
|
+
alignSelf: "center",
|
|
852
|
+
minWidth: "auto",
|
|
853
|
+
color: "var(--soft-alert-accent)",
|
|
854
|
+
textTransform: "none",
|
|
855
|
+
fontWeight: 600,
|
|
856
|
+
lineHeight: 1.25
|
|
676
857
|
},
|
|
677
|
-
children:
|
|
678
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
679
|
-
import_Typography.default,
|
|
680
|
-
{
|
|
681
|
-
variant: "body2",
|
|
682
|
-
sx: {
|
|
683
|
-
color: "var(--collapse-title-color)",
|
|
684
|
-
paddingLeft: "8px",
|
|
685
|
-
fontWeight: 600
|
|
686
|
-
},
|
|
687
|
-
children: componentProps?.title || "Alert Title"
|
|
688
|
-
}
|
|
689
|
-
),
|
|
690
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_Box.default, { sx: {
|
|
691
|
-
display: "flex",
|
|
692
|
-
alignItems: "center",
|
|
693
|
-
gap: 0.5
|
|
694
|
-
}, children: [
|
|
695
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
696
|
-
IconButton_default,
|
|
697
|
-
{
|
|
698
|
-
"aria-label": "Show more",
|
|
699
|
-
size: "small",
|
|
700
|
-
onClick: handleExpandClick,
|
|
701
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
702
|
-
import_ExpandMore.default,
|
|
703
|
-
{
|
|
704
|
-
style: {
|
|
705
|
-
transform: expanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
706
|
-
transition: "transform 0.3s ease-in-out"
|
|
707
|
-
},
|
|
708
|
-
sx: { fontSize: "1rem" }
|
|
709
|
-
}
|
|
710
|
-
)
|
|
711
|
-
}
|
|
712
|
-
),
|
|
713
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
714
|
-
IconButton_default,
|
|
715
|
-
{
|
|
716
|
-
size: "small",
|
|
717
|
-
"aria-label": "close",
|
|
718
|
-
onClick: handleDismiss,
|
|
719
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Close.default, { sx: { fontSize: "1rem" } })
|
|
720
|
-
}
|
|
721
|
-
)
|
|
722
|
-
] })
|
|
723
|
-
]
|
|
858
|
+
children: action.label
|
|
724
859
|
}
|
|
725
|
-
),
|
|
726
|
-
/* @__PURE__ */ (0,
|
|
727
|
-
|
|
860
|
+
) : null,
|
|
861
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
862
|
+
IconButton_default,
|
|
728
863
|
{
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
864
|
+
size: "small",
|
|
865
|
+
"aria-label": "Close",
|
|
866
|
+
onClick: handleDismiss,
|
|
867
|
+
sx: {
|
|
868
|
+
flexShrink: 0,
|
|
869
|
+
alignSelf: "center",
|
|
870
|
+
p: 0.25,
|
|
871
|
+
color: "var(--mui-palette-text-secondary)"
|
|
872
|
+
},
|
|
873
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Close.default, { sx: { fontSize: "1rem" } })
|
|
735
874
|
}
|
|
736
|
-
)
|
|
875
|
+
)
|
|
737
876
|
]
|
|
738
877
|
}
|
|
739
878
|
);
|
|
740
879
|
}
|
|
741
880
|
);
|
|
742
881
|
|
|
743
|
-
// src/components/compound/Alert/src/
|
|
882
|
+
// src/components/compound/Alert/src/MuiAlertVariant.tsx
|
|
883
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
884
|
+
var variantToSeverity = {
|
|
885
|
+
[ALERT_VARIANTs.info]: "info",
|
|
886
|
+
[ALERT_VARIANTs.warning]: "warning",
|
|
887
|
+
[ALERT_VARIANTs.success]: "success",
|
|
888
|
+
[ALERT_VARIANTs.error]: "error",
|
|
889
|
+
[ALERT_VARIANTs.system]: "system",
|
|
890
|
+
[ALERT_VARIANTs.insight]: "insight",
|
|
891
|
+
[ALERT_VARIANTs.collapsable]: "info"
|
|
892
|
+
// Default to info for collapsable
|
|
893
|
+
};
|
|
894
|
+
var MuiAlertVariant = (0, import_react4.forwardRef)(
|
|
895
|
+
(props, ref) => {
|
|
896
|
+
const {
|
|
897
|
+
id,
|
|
898
|
+
message,
|
|
899
|
+
variant,
|
|
900
|
+
icon,
|
|
901
|
+
style,
|
|
902
|
+
styleVariant: styleVariantProp,
|
|
903
|
+
alertAction,
|
|
904
|
+
action: actionProp
|
|
905
|
+
} = props;
|
|
906
|
+
const action = alertAction ?? actionProp;
|
|
907
|
+
const providerDefault = useAlertStyleVariantDefault();
|
|
908
|
+
const styleVariant = styleVariantProp ?? providerDefault ?? DEFAULTs.STYLE_VARIANT;
|
|
909
|
+
const { closeSnackbar: closeSnackbar2 } = (0, import_notistack3.useSnackbar)();
|
|
910
|
+
const handleDismiss = (0, import_react4.useCallback)(() => {
|
|
911
|
+
closeSnackbar2(id);
|
|
912
|
+
}, [id, closeSnackbar2]);
|
|
913
|
+
const handleAction = (0, import_react4.useCallback)(() => {
|
|
914
|
+
action?.onClick();
|
|
915
|
+
closeSnackbar2(id);
|
|
916
|
+
}, [action, closeSnackbar2, id]);
|
|
917
|
+
if (styleVariant === "soft") {
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
919
|
+
SoftAlertContent,
|
|
920
|
+
{
|
|
921
|
+
ref,
|
|
922
|
+
...props,
|
|
923
|
+
alertAction: action
|
|
924
|
+
}
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
const severity = variantToSeverity[variant] || "info";
|
|
928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
929
|
+
import_Alert.default,
|
|
930
|
+
{
|
|
931
|
+
ref,
|
|
932
|
+
severity,
|
|
933
|
+
onClose: handleDismiss,
|
|
934
|
+
icon,
|
|
935
|
+
style,
|
|
936
|
+
"data-style-variant": "classic",
|
|
937
|
+
"data-testid": "classic-alert",
|
|
938
|
+
action: action ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Box.default, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
939
|
+
Button,
|
|
940
|
+
{
|
|
941
|
+
size: "small",
|
|
942
|
+
variant: "text",
|
|
943
|
+
onClick: handleAction,
|
|
944
|
+
sx: {
|
|
945
|
+
minWidth: "auto",
|
|
946
|
+
color: "var(--alert-icon-color, inherit)",
|
|
947
|
+
textTransform: "none",
|
|
948
|
+
fontWeight: 600
|
|
949
|
+
},
|
|
950
|
+
children: action.label
|
|
951
|
+
}
|
|
952
|
+
) }) : void 0,
|
|
953
|
+
children: message
|
|
954
|
+
}
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
);
|
|
958
|
+
|
|
959
|
+
// src/components/compound/Alert/src/CollapsableAlert.tsx
|
|
960
|
+
var import_react5 = require("react");
|
|
961
|
+
var import_notistack4 = require("notistack");
|
|
962
|
+
|
|
963
|
+
// src/components/elemental/Collapse/src/Collapse/index.ts
|
|
964
|
+
var import_Collapse = __toESM(require("@mui/material/Collapse"));
|
|
965
|
+
|
|
966
|
+
// src/components/compound/Alert/src/CollapsableAlert.tsx
|
|
744
967
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
968
|
+
var CollapsableAlert = (0, import_react5.forwardRef)(function CollapsableAlert2({ id, componentProps, componentWrapperProps, style, styleVariant: styleVariantProp }, ref) {
|
|
969
|
+
const [expanded, setExpanded] = (0, import_react5.useState)(false);
|
|
970
|
+
const { closeSnackbar: closeSnackbar2 } = (0, import_notistack4.useSnackbar)();
|
|
971
|
+
const providerDefault = useAlertStyleVariantDefault();
|
|
972
|
+
const styleVariant = styleVariantProp ?? providerDefault ?? DEFAULTs.STYLE_VARIANT;
|
|
973
|
+
const isSoft = styleVariant === "soft";
|
|
974
|
+
const handleExpandClick = (0, import_react5.useCallback)(() => {
|
|
975
|
+
setExpanded((oldExpanded) => !oldExpanded);
|
|
976
|
+
}, []);
|
|
977
|
+
const handleDismiss = (0, import_react5.useCallback)(() => {
|
|
978
|
+
closeSnackbar2(id);
|
|
979
|
+
}, [id, closeSnackbar2]);
|
|
980
|
+
const { Renderer, ...restCollapse } = componentWrapperProps || {};
|
|
981
|
+
const titleNode = componentProps?.title || "Alert Title";
|
|
982
|
+
const iconButtonSx = isSoft ? collapsableSoftIconButtonSx : collapsableClassicIconButtonSx;
|
|
983
|
+
const iconButtons = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
984
|
+
import_Box.default,
|
|
985
|
+
{
|
|
986
|
+
sx: {
|
|
987
|
+
display: "flex",
|
|
988
|
+
alignItems: "center",
|
|
989
|
+
gap: 0.25,
|
|
990
|
+
flexShrink: 0
|
|
991
|
+
},
|
|
992
|
+
children: [
|
|
993
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
994
|
+
IconButton_default,
|
|
995
|
+
{
|
|
996
|
+
"aria-label": "Show more",
|
|
997
|
+
size: "small",
|
|
998
|
+
onClick: handleExpandClick,
|
|
999
|
+
sx: iconButtonSx,
|
|
1000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1001
|
+
import_ExpandMore.default,
|
|
1002
|
+
{
|
|
1003
|
+
style: {
|
|
1004
|
+
transform: expanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
1005
|
+
transition: "transform 0.3s ease-in-out"
|
|
1006
|
+
},
|
|
1007
|
+
sx: { fontSize: "1rem" }
|
|
1008
|
+
}
|
|
1009
|
+
)
|
|
1010
|
+
}
|
|
1011
|
+
),
|
|
1012
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1013
|
+
IconButton_default,
|
|
1014
|
+
{
|
|
1015
|
+
size: "small",
|
|
1016
|
+
"aria-label": "Close",
|
|
1017
|
+
onClick: handleDismiss,
|
|
1018
|
+
sx: iconButtonSx,
|
|
1019
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Close.default, { sx: { fontSize: "1rem" } })
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1022
|
+
]
|
|
1023
|
+
}
|
|
1024
|
+
);
|
|
1025
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Collapse.default, { in: expanded, timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1026
|
+
import_Box.default,
|
|
1027
|
+
{
|
|
1028
|
+
...restCollapse,
|
|
1029
|
+
sx: mergeSx(
|
|
1030
|
+
isSoft ? collapsableSoftPanelSx : collapsableClassicPanelSx,
|
|
1031
|
+
restCollapse.sx
|
|
1032
|
+
),
|
|
1033
|
+
children: [
|
|
1034
|
+
Renderer ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Renderer, { ...componentProps }) : null,
|
|
1035
|
+
!Renderer && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box.default, { sx: { py: 0.25 }, children: componentProps?.children || "Collapsible content" })
|
|
1036
|
+
]
|
|
1037
|
+
}
|
|
1038
|
+
) });
|
|
1039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1040
|
+
import_Box.default,
|
|
1041
|
+
{
|
|
1042
|
+
ref,
|
|
1043
|
+
style,
|
|
1044
|
+
role: "status",
|
|
1045
|
+
"aria-live": "polite",
|
|
1046
|
+
"data-style-variant": isSoft ? "soft" : "classic",
|
|
1047
|
+
"data-testid": isSoft ? "collapsable-alert-soft" : "collapsable-alert-classic",
|
|
1048
|
+
sx: isSoft ? collapsableAlertSoftRootSx : collapsableAlertClassicRootSx,
|
|
1049
|
+
children: [
|
|
1050
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box.default, { sx: isSoft ? collapsableSoftHeaderSx : collapsableClassicHeaderSx, children: [
|
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1052
|
+
import_Typography.default,
|
|
1053
|
+
{
|
|
1054
|
+
variant: "body2",
|
|
1055
|
+
sx: {
|
|
1056
|
+
color: "var(--collapse-title-color)",
|
|
1057
|
+
fontWeight: 600,
|
|
1058
|
+
lineHeight: 1.4,
|
|
1059
|
+
m: 0,
|
|
1060
|
+
minWidth: 0,
|
|
1061
|
+
flex: 1
|
|
1062
|
+
},
|
|
1063
|
+
children: titleNode
|
|
1064
|
+
}
|
|
1065
|
+
),
|
|
1066
|
+
iconButtons
|
|
1067
|
+
] }),
|
|
1068
|
+
body
|
|
1069
|
+
]
|
|
1070
|
+
}
|
|
1071
|
+
);
|
|
1072
|
+
});
|
|
1073
|
+
|
|
1074
|
+
// src/components/compound/Alert/src/AlertProvider.tsx
|
|
1075
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
745
1076
|
var ALERT_COMPONENTS = {
|
|
746
1077
|
[ALERT_VARIANTs.info]: MuiAlertVariant,
|
|
747
1078
|
[ALERT_VARIANTs.warning]: MuiAlertVariant,
|
|
@@ -751,26 +1082,133 @@ var ALERT_COMPONENTS = {
|
|
|
751
1082
|
[ALERT_VARIANTs.insight]: MuiAlertVariant,
|
|
752
1083
|
[ALERT_VARIANTs.collapsable]: CollapsableAlert
|
|
753
1084
|
};
|
|
754
|
-
var AlertProvider =
|
|
755
|
-
|
|
756
|
-
|
|
1085
|
+
var AlertProvider = import_react6.default.memo(function AlertProvider2({
|
|
1086
|
+
children,
|
|
1087
|
+
defaultStyleVariant = DEFAULTs.STYLE_VARIANT
|
|
1088
|
+
}) {
|
|
1089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AlertStyleVariantContext.Provider, { value: defaultStyleVariant, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1090
|
+
import_notistack5.SnackbarProvider,
|
|
757
1091
|
{
|
|
758
1092
|
maxSnack: DEFAULTs.PROVIDER_CONFIGs.maxSnack,
|
|
759
1093
|
anchorOrigin: DEFAULTs.ANCHOR_ORIGIN,
|
|
760
1094
|
Components: ALERT_COMPONENTS,
|
|
761
1095
|
children
|
|
762
1096
|
}
|
|
763
|
-
);
|
|
1097
|
+
) });
|
|
1098
|
+
});
|
|
1099
|
+
|
|
1100
|
+
// src/components/compound/Alert/src/toast.ts
|
|
1101
|
+
var import_notistack6 = require("notistack");
|
|
1102
|
+
var TOAST_TO_ALERT = {
|
|
1103
|
+
success: ALERT_VARIANTs.success,
|
|
1104
|
+
error: ALERT_VARIANTs.error,
|
|
1105
|
+
info: ALERT_VARIANTs.info,
|
|
1106
|
+
warning: ALERT_VARIANTs.warning
|
|
1107
|
+
};
|
|
1108
|
+
var DEFAULT_DURATION = 4e3;
|
|
1109
|
+
function toAlertOptions(message, options = {}) {
|
|
1110
|
+
const variant = options.variant ?? "info";
|
|
1111
|
+
const duration = options.duration === void 0 ? DEFAULT_DURATION : options.duration;
|
|
1112
|
+
return {
|
|
1113
|
+
message,
|
|
1114
|
+
variant: TOAST_TO_ALERT[variant],
|
|
1115
|
+
id: options.id,
|
|
1116
|
+
autoHideDuration: duration,
|
|
1117
|
+
styleVariant: "soft",
|
|
1118
|
+
action: options.action,
|
|
1119
|
+
// Historical toast.* corner was bottom-right.
|
|
1120
|
+
anchorOrigin: { horizontal: "right", vertical: "bottom" }
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
function show(message, options) {
|
|
1124
|
+
const result = enqueueAlert(toAlertOptions(message, options));
|
|
1125
|
+
return result.success ? result.data : options?.id ?? "";
|
|
1126
|
+
}
|
|
1127
|
+
function success(message, options) {
|
|
1128
|
+
return show(message, { ...options, variant: "success" });
|
|
1129
|
+
}
|
|
1130
|
+
function error(message, options) {
|
|
1131
|
+
return show(message, { ...options, variant: "error" });
|
|
1132
|
+
}
|
|
1133
|
+
function info(message, options) {
|
|
1134
|
+
return show(message, { ...options, variant: "info" });
|
|
1135
|
+
}
|
|
1136
|
+
function warning(message, options) {
|
|
1137
|
+
return show(message, { ...options, variant: "warning" });
|
|
1138
|
+
}
|
|
1139
|
+
function dismiss(id) {
|
|
1140
|
+
(0, import_notistack6.closeSnackbar)(id);
|
|
1141
|
+
}
|
|
1142
|
+
function dismissAll() {
|
|
1143
|
+
(0, import_notistack6.closeSnackbar)();
|
|
1144
|
+
}
|
|
1145
|
+
var toast = Object.assign(show, {
|
|
1146
|
+
success,
|
|
1147
|
+
error,
|
|
1148
|
+
info,
|
|
1149
|
+
warning,
|
|
1150
|
+
dismiss,
|
|
1151
|
+
dismissAll,
|
|
1152
|
+
show
|
|
764
1153
|
});
|
|
1154
|
+
|
|
1155
|
+
// src/components/compound/Alert/src/useToast.ts
|
|
1156
|
+
var import_react7 = require("react");
|
|
1157
|
+
var import_notistack7 = require("notistack");
|
|
1158
|
+
function useToast() {
|
|
1159
|
+
const { closeSnackbar: closeSnackbar2 } = (0, import_notistack7.useSnackbar)();
|
|
1160
|
+
const show2 = (0, import_react7.useCallback)(
|
|
1161
|
+
(message, options) => toast.show(message, options),
|
|
1162
|
+
[]
|
|
1163
|
+
);
|
|
1164
|
+
const success2 = (0, import_react7.useCallback)(
|
|
1165
|
+
(message, options) => toast.success(message, options),
|
|
1166
|
+
[]
|
|
1167
|
+
);
|
|
1168
|
+
const error2 = (0, import_react7.useCallback)(
|
|
1169
|
+
(message, options) => toast.error(message, options),
|
|
1170
|
+
[]
|
|
1171
|
+
);
|
|
1172
|
+
const info2 = (0, import_react7.useCallback)(
|
|
1173
|
+
(message, options) => toast.info(message, options),
|
|
1174
|
+
[]
|
|
1175
|
+
);
|
|
1176
|
+
const warning2 = (0, import_react7.useCallback)(
|
|
1177
|
+
(message, options) => toast.warning(message, options),
|
|
1178
|
+
[]
|
|
1179
|
+
);
|
|
1180
|
+
const dismiss2 = (0, import_react7.useCallback)((id) => closeSnackbar2(id), [closeSnackbar2]);
|
|
1181
|
+
const dismissAll2 = (0, import_react7.useCallback)(() => closeSnackbar2(), [closeSnackbar2]);
|
|
1182
|
+
return {
|
|
1183
|
+
show: show2,
|
|
1184
|
+
success: success2,
|
|
1185
|
+
error: error2,
|
|
1186
|
+
info: info2,
|
|
1187
|
+
warning: warning2,
|
|
1188
|
+
dismiss: dismiss2,
|
|
1189
|
+
dismissAll: dismissAll2
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
765
1192
|
// Annotate the CommonJS export names for ESM import in node:
|
|
766
1193
|
0 && (module.exports = {
|
|
1194
|
+
ALERT_STYLE_VARIANTs,
|
|
767
1195
|
ALERT_VARIANTs,
|
|
768
1196
|
AlertProvider,
|
|
1197
|
+
AlertStyleVariantContext,
|
|
769
1198
|
CollapsableAlert,
|
|
770
1199
|
DEFAULTs,
|
|
771
1200
|
ERRORs,
|
|
1201
|
+
SoftAlertContent,
|
|
772
1202
|
alertTheme,
|
|
1203
|
+
collapsableAlertClassicRootSx,
|
|
773
1204
|
collapsableAlertRootSx,
|
|
1205
|
+
collapsableAlertSoftRootSx,
|
|
1206
|
+
collapsableClassicHeaderSx,
|
|
1207
|
+
collapsableClassicIconButtonSx,
|
|
1208
|
+
collapsableClassicPanelSx,
|
|
1209
|
+
collapsableSoftHeaderSx,
|
|
1210
|
+
collapsableSoftIconButtonSx,
|
|
1211
|
+
collapsableSoftPanelSx,
|
|
774
1212
|
enqueueAlert,
|
|
775
1213
|
enqueueCollapsable,
|
|
776
1214
|
enqueueError,
|
|
@@ -779,6 +1217,12 @@ var AlertProvider = import_react4.default.memo(function AlertProvider2({ childre
|
|
|
779
1217
|
enqueueSuccess,
|
|
780
1218
|
enqueueSystem,
|
|
781
1219
|
enqueueWarning,
|
|
782
|
-
|
|
1220
|
+
softAlertAccentBarSx,
|
|
1221
|
+
softAlertIconSx,
|
|
1222
|
+
softAlertItemRootSx,
|
|
1223
|
+
toast,
|
|
1224
|
+
useAlert,
|
|
1225
|
+
useAlertStyleVariantDefault,
|
|
1226
|
+
useToast
|
|
783
1227
|
});
|
|
784
1228
|
//# sourceMappingURL=alert.js.map
|