@redis-ui/components 51.10.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/Modal.d.ts +1 -1
- package/dist/Modal/components/Content/Content.d.ts +1 -1
- 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/dist/Modal/components/Content/components/Header/Header.d.ts +1 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.cjs +6 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.d.ts +1 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.js +6 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.style.cjs +7 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.style.d.ts +3 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.style.js +8 -2
- package/package.json +2 -2
- package/skills/redis-ui-components/references/Modal.md +2 -2
package/dist/Modal/Modal.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare const Modal: (({ children, defaultOpen, onOpenChange, open, withButton,
|
|
|
5
5
|
Compose: ({ persistent, onCancel, ...props }: import("./components/Content/components/Compose/Compose.types").ContentComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Header: (({ title, titleHidden, ...restProps }: import("./components/Content/components/Header/Header.types").ContentHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
7
7
|
Compose: (props: import("./components/Content/components/Header/components/Compose/Compose.types").ContentHeaderComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
Title: ({ hidden, children, ...restProps }: import("./components/Content/components/Header/components/Title/Title.types").TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Title: ({ hidden, size, children, ...restProps }: import("./components/Content/components/Header/components/Title/Title.types").TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
};
|
|
10
10
|
Description: (({ hidden, children, ...restProps }: import("./components/Content/components/Description/Description.types").ModalDescriptionProps & import("./components/Content/components/Description/Description.types").RestModalDescriptionProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
11
11
|
Text: (props: import("./components/Content/components/Description/components/Text/Text.types").ModalDescriptionTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ declare const Content: (({ title, description, descriptionHidden, onCancel, prim
|
|
|
3
3
|
Compose: ({ persistent, onCancel, ...props }: import("./components/Compose/Compose.types").ContentComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
Header: (({ title, titleHidden, ...restProps }: import("./components/Header/Header.types").ContentHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
5
5
|
Compose: (props: import("./components/Header/components/Compose/Compose.types").ContentHeaderComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
Title: ({ hidden, children, ...restProps }: import("./components/Header/components/Title/Title.types").TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Title: ({ hidden, size, children, ...restProps }: import("./components/Header/components/Title/Title.types").TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
};
|
|
8
8
|
Description: (({ hidden, children, ...restProps }: import("./components/Description/Description.types").ModalDescriptionProps & import("./components/Description/Description.types").RestModalDescriptionProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
9
9
|
Text: (props: import("./components/Description/components/Text/Text.types").ModalDescriptionTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContentHeaderProps } from './Header.types';
|
|
2
2
|
declare const Header: (({ title, titleHidden, ...restProps }: ContentHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
3
3
|
Compose: (props: import("./components/Compose/Compose.types").ContentHeaderComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
Title: ({ hidden, children, ...restProps }: import("./components/Title/Title.types").TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
Title: ({ hidden, size, children, ...restProps }: import("./components/Title/Title.types").TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
};
|
|
6
6
|
export default Header;
|
|
@@ -2,14 +2,19 @@ const require_react_utils = require("../../../../../../../Helpers/react.utils.cj
|
|
|
2
2
|
const require_index = require("../../../../../../../packages/components/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs");
|
|
3
3
|
const require_index$1 = require("../../../../../../../node_modules/@radix-ui/react-dialog/dist/index.cjs");
|
|
4
4
|
const require_Title_style = require("./Title.style.cjs");
|
|
5
|
+
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
5
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
7
|
//#region src/Modal/components/Content/components/Header/components/Title/Title.tsx
|
|
7
|
-
var Title = ({ hidden = false, children, ...restProps }) => {
|
|
8
|
+
var Title = ({ hidden = false, size, children, ...restProps }) => {
|
|
9
|
+
const { titleSize, titleLineHeight } = (0, _redislabsdev_redis_ui_styles.useTheme)().components.modal.header;
|
|
10
|
+
const resolvedSize = size ?? titleSize;
|
|
8
11
|
const emptyContent = !require_react_utils.childrenToString(children)?.trim();
|
|
9
12
|
const TitleComponent = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.Title, {
|
|
10
13
|
asChild: true,
|
|
11
14
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Title_style.Title, {
|
|
12
15
|
"data-role": "dialog-heading",
|
|
16
|
+
size: resolvedSize,
|
|
17
|
+
$lineHeight: resolvedSize === titleSize ? titleLineHeight : void 0,
|
|
13
18
|
...restProps,
|
|
14
19
|
children: emptyContent ? "dialog" : children
|
|
15
20
|
})
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TitleProps } from './Title.types';
|
|
2
|
-
declare const Title: ({ hidden, children, ...restProps }: TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Title: ({ hidden, size, children, ...restProps }: TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Title;
|
|
@@ -2,14 +2,19 @@ import { childrenToString } from "../../../../../../../Helpers/react.utils.js";
|
|
|
2
2
|
import { VisuallyHidden } from "../../../../../../../packages/components/node_modules/@radix-ui/react-visually-hidden/dist/index.js";
|
|
3
3
|
import { Title as Title$1 } from "../../../../../../../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
4
4
|
import { Title as Title$2 } from "./Title.style.js";
|
|
5
|
+
import { useTheme } from "@redis-ui/styles";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
//#region src/Modal/components/Content/components/Header/components/Title/Title.tsx
|
|
7
|
-
var Title = ({ hidden = false, children, ...restProps }) => {
|
|
8
|
+
var Title = ({ hidden = false, size, children, ...restProps }) => {
|
|
9
|
+
const { titleSize, titleLineHeight } = useTheme().components.modal.header;
|
|
10
|
+
const resolvedSize = size ?? titleSize;
|
|
8
11
|
const emptyContent = !childrenToString(children)?.trim();
|
|
9
12
|
const TitleComponent = /* @__PURE__ */ jsx(Title$1, {
|
|
10
13
|
asChild: true,
|
|
11
14
|
children: /* @__PURE__ */ jsx(Title$2, {
|
|
12
15
|
"data-role": "dialog-heading",
|
|
16
|
+
size: resolvedSize,
|
|
17
|
+
$lineHeight: resolvedSize === titleSize ? titleLineHeight : void 0,
|
|
13
18
|
...restProps,
|
|
14
19
|
children: emptyContent ? "dialog" : children
|
|
15
20
|
})
|
|
@@ -7,6 +7,12 @@ let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
|
7
7
|
var Title = (0, styled_components.default)(require_Typography.default.Heading).withConfig({
|
|
8
8
|
displayName: "Titlestyle__Title",
|
|
9
9
|
componentId: "RedisUI__sc-9hk6e2-0"
|
|
10
|
-
})([
|
|
10
|
+
})([
|
|
11
|
+
"color:",
|
|
12
|
+
";",
|
|
13
|
+
""
|
|
14
|
+
], () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.modal.header.textColor, ({ $lineHeight }) => $lineHeight && styled_components.css`
|
|
15
|
+
line-height: ${$lineHeight};
|
|
16
|
+
`);
|
|
11
17
|
//#endregion
|
|
12
18
|
exports.Title = Title;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export declare const Title: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../../..").TypographyHeadingProps & import("react").RefAttributes<HTMLElement>>, any, {
|
|
1
|
+
export declare const Title: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../../..").TypographyHeadingProps & import("react").RefAttributes<HTMLElement>>, any, {
|
|
2
|
+
$lineHeight?: string;
|
|
3
|
+
}, never>;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import Typography from "../../../../../../../Typography/Typography.js";
|
|
2
|
-
import _styled from "styled-components";
|
|
2
|
+
import _styled, { css } from "styled-components";
|
|
3
3
|
import { useTheme } from "@redis-ui/styles";
|
|
4
4
|
//#region src/Modal/components/Content/components/Header/components/Title/Title.style.ts
|
|
5
5
|
var Title = _styled(Typography.Heading).withConfig({
|
|
6
6
|
displayName: "Titlestyle__Title",
|
|
7
7
|
componentId: "RedisUI__sc-9hk6e2-0"
|
|
8
|
-
})([
|
|
8
|
+
})([
|
|
9
|
+
"color:",
|
|
10
|
+
";",
|
|
11
|
+
""
|
|
12
|
+
], () => useTheme().components.modal.header.textColor, ({ $lineHeight }) => $lineHeight && css`
|
|
13
|
+
line-height: ${$lineHeight};
|
|
14
|
+
`);
|
|
9
15
|
//#endregion
|
|
10
16
|
export { Title };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redis-ui/components",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "51.
|
|
4
|
+
"version": "51.12.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"repository": "git@github.com:redislabsdev/redis-ui.git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@redis-ui/icons": "^8.0.0 || ^9.0.0 || ^10.0.0",
|
|
33
|
-
"@redis-ui/styles": "^21.
|
|
33
|
+
"@redis-ui/styles": "^21.18.0",
|
|
34
34
|
"react": "^18.0.0 || ^19.0.0",
|
|
35
35
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
36
36
|
"styled-components": "^5.0.0"
|
|
@@ -52,7 +52,7 @@ import { Modal } from '@redis-ui/components';
|
|
|
52
52
|
| `Modal.Content.Header` | `titleHidden` | `boolean` | `false` | Hides the title visually while keeping it accessible |
|
|
53
53
|
| `Modal.Content.Header.Compose` | `children` | `React.ReactNode` | required | Custom header container content |
|
|
54
54
|
| `Modal.Content.Header.Title` | `hidden` | `boolean` | `false` | Hides the title visually while keeping the dialog title accessible |
|
|
55
|
-
| `Modal.Content.Header.Title` | `Typography.Heading props` | - | - | Inherits the `Typography.Heading` prop surface |
|
|
55
|
+
| `Modal.Content.Header.Title` | `Typography.Heading props` | - | - | Inherits the `Typography.Heading` prop surface. `size` defaults to the theme `modal.header.titleSize` (`XL` classic, `L` next) |
|
|
56
56
|
| `Modal.Content.Description` | `children` | `React.ReactNode` | required | Description content rendered below the title |
|
|
57
57
|
| `Modal.Content.Description` | `hidden` | `boolean` | `false` | Hides the description visually while keeping it accessible |
|
|
58
58
|
| `Modal.Content.Description.Text` | `Typography.Heading props` | - | - | Typography wrapper for description text, rendered at size `XS` |
|
|
@@ -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
|
|