@eclass/ui-kit 1.54.3 → 1.54.5
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/eclass-ui-kit.es.js +31 -109
- package/dist/eclass-ui-kit.es.js.map +1 -1
- package/dist/eclass-ui-kit.umd.js +28 -28
- package/dist/eclass-ui-kit.umd.js.map +1 -1
- package/dist/molecules/NavBarButtons/NavBarButton.d.ts.map +1 -1
- package/dist/organisms/Modals/Modal/Modal.d.ts +2 -1
- package/dist/organisms/Modals/Modal/Modal.d.ts.map +1 -1
- package/dist/organisms/Modals/Modal/ModalButtons.d.ts +13 -1
- package/dist/organisms/Modals/Modal/ModalButtons.d.ts.map +1 -1
- package/dist/organisms/Modals/ModalAlert/ModalAlert.d.ts +12 -1
- package/dist/organisms/Modals/ModalAlert/ModalAlert.d.ts.map +1 -1
- package/dist/organisms/Modals/index.d.ts +2 -1
- package/dist/organisms/Modals/index.d.ts.map +1 -1
- package/dist/organisms/Modals/resetStyleModal.d.ts +1 -0
- package/dist/organisms/Modals/resetStyleModal.d.ts.map +1 -1
- package/dist/organisms/Modals/types.d.ts +8 -20
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/eclass-ui-kit.es.js
CHANGED
|
@@ -108,6 +108,7 @@ const overlay = {
|
|
|
108
108
|
};
|
|
109
109
|
const dialog = {
|
|
110
110
|
boxShadow: shadows.lg,
|
|
111
|
+
bg: colors.neutral.white,
|
|
111
112
|
borderRadius: radii.big
|
|
112
113
|
};
|
|
113
114
|
const theme = extendTheme({
|
|
@@ -1870,6 +1871,7 @@ const NavBarButton = ({
|
|
|
1870
1871
|
id: isAccessibility ? "UserWayButton" : "",
|
|
1871
1872
|
onClick: isAccessibility ? triggerWidget : onClick,
|
|
1872
1873
|
sx: {
|
|
1874
|
+
alignItems: "center",
|
|
1873
1875
|
background: "none !important",
|
|
1874
1876
|
border: "1px transparent !important",
|
|
1875
1877
|
cursor: "pointer",
|
|
@@ -4115,55 +4117,8 @@ const useFlashNotification = ({ state, message }) => {
|
|
|
4115
4117
|
}
|
|
4116
4118
|
};
|
|
4117
4119
|
};
|
|
4118
|
-
const
|
|
4119
|
-
const ModalButtons = ({
|
|
4120
|
-
buttons,
|
|
4121
|
-
buttonsCenter,
|
|
4122
|
-
buttonsColumn,
|
|
4123
|
-
buttonsInside,
|
|
4124
|
-
isDesktop,
|
|
4125
|
-
px,
|
|
4126
|
-
py
|
|
4127
|
-
}) => {
|
|
4128
|
-
if (!buttons || buttons && buttons.length === 0) {
|
|
4129
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
4130
|
-
}
|
|
4131
|
-
const buttonFull = !isDesktop && buttonsColumn;
|
|
4132
|
-
const hasLoading = buttons.some((button) => button.isLoading);
|
|
4133
|
-
return /* @__PURE__ */ jsx(StyledModalFooter, {
|
|
4134
|
-
as: "footer",
|
|
4135
|
-
flexDirection: buttonFull ? "column" : "row",
|
|
4136
|
-
gap: "24px",
|
|
4137
|
-
justifyContent: buttonsCenter ? "center" : "flex-start",
|
|
4138
|
-
pb: buttonsInside ? 0 : py,
|
|
4139
|
-
pt: py,
|
|
4140
|
-
px: buttonsInside ? 0 : px,
|
|
4141
|
-
children: buttons.map((button, index2) => {
|
|
4142
|
-
var _a, _b;
|
|
4143
|
-
if ((button == null ? void 0 : button.type) === "secondary") {
|
|
4144
|
-
return /* @__PURE__ */ jsx(BtnSecondary, {
|
|
4145
|
-
onClick: () => button.action(),
|
|
4146
|
-
isFullWidth: buttonFull,
|
|
4147
|
-
isLoading: button.isLoading,
|
|
4148
|
-
disabled: (_a = button.isDisabled) != null ? _a : hasLoading,
|
|
4149
|
-
children: button.text
|
|
4150
|
-
}, index2);
|
|
4151
|
-
}
|
|
4152
|
-
return /* @__PURE__ */ jsx(BtnPrimary, {
|
|
4153
|
-
onClick: () => button.action(),
|
|
4154
|
-
isFullWidth: buttonFull,
|
|
4155
|
-
isLoading: button.isLoading,
|
|
4156
|
-
disabled: (_b = button.isDisabled) != null ? _b : hasLoading,
|
|
4157
|
-
children: button.text
|
|
4158
|
-
}, index2);
|
|
4159
|
-
})
|
|
4160
|
-
});
|
|
4161
|
-
};
|
|
4120
|
+
const uiKitModalIsDesktop = 641;
|
|
4162
4121
|
const Modal = ({
|
|
4163
|
-
buttons,
|
|
4164
|
-
buttonsCenter,
|
|
4165
|
-
buttonsColumn = true,
|
|
4166
|
-
buttonsInside,
|
|
4167
4122
|
children,
|
|
4168
4123
|
closeOnOverlayClick = true,
|
|
4169
4124
|
fixedSubtitle,
|
|
@@ -4171,38 +4126,48 @@ const Modal = ({
|
|
|
4171
4126
|
onClose,
|
|
4172
4127
|
title,
|
|
4173
4128
|
withoutMargin = false,
|
|
4174
|
-
scrollBehavior = "outside"
|
|
4129
|
+
scrollBehavior = "outside",
|
|
4130
|
+
fixedButtons = false
|
|
4175
4131
|
}) => {
|
|
4176
4132
|
const py = "32px";
|
|
4177
4133
|
const px = "24px";
|
|
4178
|
-
const [isDesktop] = useMediaQuery(
|
|
4179
|
-
const
|
|
4180
|
-
const handleClose = () => {
|
|
4181
|
-
if (hasLoading)
|
|
4182
|
-
return;
|
|
4183
|
-
return onClose();
|
|
4184
|
-
};
|
|
4185
|
-
const isInside = scrollBehavior === "inside";
|
|
4134
|
+
const [isDesktop] = useMediaQuery(`(min-width: ${uiKitModalIsDesktop}px)`);
|
|
4135
|
+
const isInside = scrollBehavior === "inside" || fixedButtons;
|
|
4186
4136
|
return /* @__PURE__ */ jsx(Fragment, {
|
|
4187
4137
|
children: /* @__PURE__ */ jsxs(Modal$1, {
|
|
4188
|
-
closeOnOverlayClick
|
|
4138
|
+
closeOnOverlayClick,
|
|
4139
|
+
closeOnEsc: closeOnOverlayClick,
|
|
4189
4140
|
isOpen,
|
|
4190
4141
|
motionPreset: "scale",
|
|
4191
|
-
onClose
|
|
4192
|
-
scrollBehavior,
|
|
4142
|
+
onClose,
|
|
4143
|
+
scrollBehavior: isInside ? "inside" : "outside",
|
|
4193
4144
|
children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent, {
|
|
4194
4145
|
maxH: isInside ? "100dvh" : "auto",
|
|
4195
|
-
minH: "300px",
|
|
4146
|
+
minH: isDesktop ? "300px" : "100dvh",
|
|
4196
4147
|
padding: 0,
|
|
4197
4148
|
width: "100%",
|
|
4198
4149
|
sx: {
|
|
4150
|
+
bgColor: vars("colors-neutral-white"),
|
|
4199
4151
|
borderRadius: isDesktop ? "8px" : 0,
|
|
4200
|
-
height: isDesktop ? "auto" : "100dvh",
|
|
4201
4152
|
mt: isDesktop ? "48px" : 0,
|
|
4202
4153
|
marginX: isDesktop ? "auto" : 0,
|
|
4203
4154
|
mb: 0,
|
|
4204
4155
|
maxH: isInside ? "calc(100dvh - 96px)" : "auto",
|
|
4205
|
-
maxWidth: isDesktop ? "600px" : "100%"
|
|
4156
|
+
maxWidth: isDesktop ? "600px" : "100%",
|
|
4157
|
+
...fixedButtons && {
|
|
4158
|
+
".uikit-modalContent": {
|
|
4159
|
+
pb: 0
|
|
4160
|
+
},
|
|
4161
|
+
".uikit-modalButtons": {
|
|
4162
|
+
py
|
|
4163
|
+
}
|
|
4164
|
+
},
|
|
4165
|
+
...withoutMargin && {
|
|
4166
|
+
".uikit-modalContent": {
|
|
4167
|
+
pt: 0,
|
|
4168
|
+
px: 0
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4206
4171
|
},
|
|
4207
4172
|
children: [/* @__PURE__ */ jsx(ModalHeader, {
|
|
4208
4173
|
bg: vars("colors-main-deepSkyBlue"),
|
|
@@ -4234,27 +4199,7 @@ const Modal = ({
|
|
|
4234
4199
|
textAlign: "center",
|
|
4235
4200
|
px,
|
|
4236
4201
|
children: fixedSubtitle
|
|
4237
|
-
}), children
|
|
4238
|
-
px: withoutMargin ? 0 : px,
|
|
4239
|
-
py: 0,
|
|
4240
|
-
mb: (buttons == null ? void 0 : buttons.length) === 0 ? py : buttonsInside ? py : 0,
|
|
4241
|
-
children: [children, buttonsInside && buttons && buttons.length > 0 && /* @__PURE__ */ jsx(ModalButtons, {
|
|
4242
|
-
buttons,
|
|
4243
|
-
buttonsCenter,
|
|
4244
|
-
buttonsColumn,
|
|
4245
|
-
buttonsInside: true,
|
|
4246
|
-
isDesktop,
|
|
4247
|
-
px,
|
|
4248
|
-
py
|
|
4249
|
-
})]
|
|
4250
|
-
}), !buttonsInside && /* @__PURE__ */ jsx(ModalButtons, {
|
|
4251
|
-
buttons,
|
|
4252
|
-
buttonsCenter,
|
|
4253
|
-
buttonsColumn,
|
|
4254
|
-
isDesktop,
|
|
4255
|
-
px,
|
|
4256
|
-
py
|
|
4257
|
-
})]
|
|
4202
|
+
}), children]
|
|
4258
4203
|
})]
|
|
4259
4204
|
})
|
|
4260
4205
|
});
|
|
@@ -4305,9 +4250,9 @@ const ModalAlertNew = ({
|
|
|
4305
4250
|
type,
|
|
4306
4251
|
isOpen,
|
|
4307
4252
|
onClose,
|
|
4253
|
+
children,
|
|
4308
4254
|
title,
|
|
4309
4255
|
description,
|
|
4310
|
-
buttons,
|
|
4311
4256
|
status
|
|
4312
4257
|
}) => {
|
|
4313
4258
|
const [isDesktop] = useMediaQuery("(min-width: 641px)");
|
|
@@ -4349,30 +4294,7 @@ const ModalAlertNew = ({
|
|
|
4349
4294
|
lineHeight: "24px",
|
|
4350
4295
|
children: description
|
|
4351
4296
|
})]
|
|
4352
|
-
}), type
|
|
4353
|
-
display: "flex",
|
|
4354
|
-
borderTop: `1px solid ${vars("colors-neutral-platinum")}`,
|
|
4355
|
-
sx: {
|
|
4356
|
-
button: {
|
|
4357
|
-
borderRight: `1px solid ${vars("colors-neutral-platinum")}`,
|
|
4358
|
-
fontFamily: "Roboto",
|
|
4359
|
-
fontSize: "16px",
|
|
4360
|
-
fontWeight: 500,
|
|
4361
|
-
lineHeight: "21px",
|
|
4362
|
-
p: "16px",
|
|
4363
|
-
textDecor: "none",
|
|
4364
|
-
width: "100%",
|
|
4365
|
-
"&:last-child": {
|
|
4366
|
-
borderRight: "none"
|
|
4367
|
-
}
|
|
4368
|
-
}
|
|
4369
|
-
},
|
|
4370
|
-
children: buttons.map((button, index2) => /* @__PURE__ */ jsx(BtnLink, {
|
|
4371
|
-
as: "button",
|
|
4372
|
-
onClick: () => button.action(),
|
|
4373
|
-
children: button.text
|
|
4374
|
-
}, index2))
|
|
4375
|
-
})]
|
|
4297
|
+
}), type !== "loading" && children ? children : /* @__PURE__ */ jsx(Fragment, {})]
|
|
4376
4298
|
})]
|
|
4377
4299
|
})
|
|
4378
4300
|
});
|