@redis-ui/components 51.11.0 → 51.12.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.
- package/dist/Modal/components/Content/components/Close/Close.cjs +11 -8
- package/dist/Modal/components/Content/components/Close/Close.js +11 -8
- package/dist/Modal/components/Content/components/Compose/Compose.style.cjs +18 -0
- package/dist/Modal/components/Content/components/Compose/Compose.style.js +18 -0
- package/package.json +1 -1
- package/skills/redis-ui-components/references/Modal.md +1 -1
|
@@ -3,13 +3,16 @@ const require_Close_style = require("./Close.style.cjs");
|
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
let _redislabsdev_redis_ui_icons = require("@redis-ui/icons");
|
|
5
5
|
//#region src/Modal/components/Content/components/Close/Close.tsx
|
|
6
|
-
var Close = ({ children, icon = _redislabsdev_redis_ui_icons.CancelIcon, onClick, persistent, ...buttonProps }) => persistent ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Closable.default, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Close_style.ModalCloseContainer, {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
var Close = ({ children, icon = _redislabsdev_redis_ui_icons.CancelIcon, onClick, persistent, ...buttonProps }) => persistent ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Closable.default, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Close_style.ModalCloseContainer, {
|
|
7
|
+
"data-role": "dialog-close",
|
|
8
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Close_style.IconButton, {
|
|
9
|
+
"aria-label": "close",
|
|
10
|
+
title: "Close",
|
|
11
|
+
onClick,
|
|
12
|
+
size: "M",
|
|
13
|
+
icon,
|
|
14
|
+
...buttonProps
|
|
15
|
+
})
|
|
16
|
+
}) });
|
|
14
17
|
//#endregion
|
|
15
18
|
exports.default = Close;
|
|
@@ -3,13 +3,16 @@ import { IconButton, ModalCloseContainer } from "./Close.style.js";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { CancelIcon } from "@redis-ui/icons";
|
|
5
5
|
//#region src/Modal/components/Content/components/Close/Close.tsx
|
|
6
|
-
var Close = ({ children, icon = CancelIcon, onClick, persistent, ...buttonProps }) => persistent ? null : /* @__PURE__ */ jsx(Closable, { children: /* @__PURE__ */ jsx(ModalCloseContainer, {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
var Close = ({ children, icon = CancelIcon, onClick, persistent, ...buttonProps }) => persistent ? null : /* @__PURE__ */ jsx(Closable, { children: /* @__PURE__ */ jsx(ModalCloseContainer, {
|
|
7
|
+
"data-role": "dialog-close",
|
|
8
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
9
|
+
"aria-label": "close",
|
|
10
|
+
title: "Close",
|
|
11
|
+
onClick,
|
|
12
|
+
size: "M",
|
|
13
|
+
icon,
|
|
14
|
+
...buttonProps
|
|
15
|
+
})
|
|
16
|
+
}) });
|
|
14
17
|
//#endregion
|
|
15
18
|
export { Close as default };
|
|
@@ -36,6 +36,24 @@ var Container = (0, styled_components.default)(require_index.Content).withConfig
|
|
|
36
36
|
flex: none;
|
|
37
37
|
padding-inline: var(--modal-padding-inline);
|
|
38
38
|
}
|
|
39
|
+
/* Themes with a title line height put a direct-child close button on the title row */
|
|
40
|
+
${style.header.titleLineHeight && styled_components.css`
|
|
41
|
+
> [data-role='dialog-close'] {
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset-block-start: var(--modal-padding-block);
|
|
44
|
+
inset-inline-end: var(--modal-padding-inline);
|
|
45
|
+
height: ${style.header.titleLineHeight};
|
|
46
|
+
align-items: center;
|
|
47
|
+
padding-inline: 0;
|
|
48
|
+
}
|
|
49
|
+
&:has(> [data-role='dialog-close']) > [data-role='dialog-header'] {
|
|
50
|
+
min-height: ${style.header.titleLineHeight};
|
|
51
|
+
padding-inline-end: calc(
|
|
52
|
+
var(--modal-padding-inline) + ${theme.components.iconButton.sizes.M.width} +
|
|
53
|
+
${style.header.gap}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
`}
|
|
39
57
|
`;
|
|
40
58
|
});
|
|
41
59
|
var ModalOverlay = styled_components.default.div.withConfig({
|
|
@@ -34,6 +34,24 @@ var Container = _styled(Content).withConfig({
|
|
|
34
34
|
flex: none;
|
|
35
35
|
padding-inline: var(--modal-padding-inline);
|
|
36
36
|
}
|
|
37
|
+
/* Themes with a title line height put a direct-child close button on the title row */
|
|
38
|
+
${style.header.titleLineHeight && css`
|
|
39
|
+
> [data-role='dialog-close'] {
|
|
40
|
+
position: absolute;
|
|
41
|
+
inset-block-start: var(--modal-padding-block);
|
|
42
|
+
inset-inline-end: var(--modal-padding-inline);
|
|
43
|
+
height: ${style.header.titleLineHeight};
|
|
44
|
+
align-items: center;
|
|
45
|
+
padding-inline: 0;
|
|
46
|
+
}
|
|
47
|
+
&:has(> [data-role='dialog-close']) > [data-role='dialog-header'] {
|
|
48
|
+
min-height: ${style.header.titleLineHeight};
|
|
49
|
+
padding-inline-end: calc(
|
|
50
|
+
var(--modal-padding-inline) + ${theme.components.iconButton.sizes.M.width} +
|
|
51
|
+
${style.header.gap}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
`}
|
|
37
55
|
`;
|
|
38
56
|
});
|
|
39
57
|
var ModalOverlay = _styled.div.withConfig({
|
package/package.json
CHANGED
|
@@ -94,7 +94,7 @@ import { Modal } from '@redis-ui/components';
|
|
|
94
94
|
- `Modal.Content.Footer` - Default footer area with primary, secondary, and tertiary action buttons.
|
|
95
95
|
- `Modal.Content.Footer.Compose` - Custom footer container for custom action rows.
|
|
96
96
|
- `Modal.Content.Footer.Group` - Internal button group container used by the default footer layout.
|
|
97
|
-
- `Modal.Content.Close` - Close icon button rendered in the top-right of the modal.
|
|
97
|
+
- `Modal.Content.Close` - Close icon button rendered in the top-right of the modal. In themes that set `modal.header.titleLineHeight` (next themes), a direct-child close button sits on the title row and the header reserves space for it.
|
|
98
98
|
|
|
99
99
|
## Examples
|
|
100
100
|
|