@redis-ui/components 51.11.0 → 51.13.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.
@@ -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, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Close_style.IconButton, {
7
- "aria-label": "close",
8
- title: "Close",
9
- onClick,
10
- size: "M",
11
- icon,
12
- ...buttonProps
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, { children: /* @__PURE__ */ jsx(IconButton, {
7
- "aria-label": "close",
8
- title: "Close",
9
- onClick,
10
- size: "M",
11
- icon,
12
- ...buttonProps
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({
@@ -3,9 +3,11 @@ const require_TextButton = require("../../../../../Button/TextButton/TextButton.
3
3
  const require_Compose = require("./components/Compose/Compose.cjs");
4
4
  const require_Footer_style = require("./Footer.style.cjs");
5
5
  const require_Closable = require("../../../Closable/Closable.cjs");
6
+ let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
6
7
  let react_jsx_runtime = require("react/jsx-runtime");
7
8
  //#region src/Modal/components/Content/components/Footer/Footer.tsx
8
9
  var Footer = Object.assign(({ primaryButtonText, secondaryButtonText, tertiaryButtonText, tertiaryButtonIcon, primaryButtonDisabled, secondaryButtonDisabled, tertiaryButtonDisabled, onPrimaryButtonClick, onSecondaryButtonClick, onTertiaryButtonClick, ...restProps }) => {
10
+ const { secondaryButtonVariant = "secondary-ghost" } = (0, _redislabsdev_redis_ui_styles.useTheme)().components.modal.footer;
9
11
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Footer.Compose, {
10
12
  ...restProps,
11
13
  children: [tertiaryButtonText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Closable.default, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_TextButton.default, {
@@ -17,7 +19,7 @@ var Footer = Object.assign(({ primaryButtonText, secondaryButtonText, tertiaryBu
17
19
  "aria-label": secondaryButtonText,
18
20
  disabled: secondaryButtonDisabled,
19
21
  onClick: onSecondaryButtonClick,
20
- variant: "secondary-ghost",
22
+ variant: secondaryButtonVariant,
21
23
  size: "large",
22
24
  children: secondaryButtonText
23
25
  }) }), primaryButtonText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Closable.default, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.default, {
@@ -3,9 +3,11 @@ import TextButton from "../../../../../Button/TextButton/TextButton.js";
3
3
  import Compose from "./components/Compose/Compose.js";
4
4
  import { FooterGroup } from "./Footer.style.js";
5
5
  import Closable from "../../../Closable/Closable.js";
6
+ import { useTheme } from "@redis-ui/styles";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  //#region src/Modal/components/Content/components/Footer/Footer.tsx
8
9
  var Footer = Object.assign(({ primaryButtonText, secondaryButtonText, tertiaryButtonText, tertiaryButtonIcon, primaryButtonDisabled, secondaryButtonDisabled, tertiaryButtonDisabled, onPrimaryButtonClick, onSecondaryButtonClick, onTertiaryButtonClick, ...restProps }) => {
10
+ const { secondaryButtonVariant = "secondary-ghost" } = useTheme().components.modal.footer;
9
11
  return /* @__PURE__ */ jsxs(Footer.Compose, {
10
12
  ...restProps,
11
13
  children: [tertiaryButtonText && /* @__PURE__ */ jsx(Closable, { children: /* @__PURE__ */ jsxs(TextButton, {
@@ -17,7 +19,7 @@ var Footer = Object.assign(({ primaryButtonText, secondaryButtonText, tertiaryBu
17
19
  "aria-label": secondaryButtonText,
18
20
  disabled: secondaryButtonDisabled,
19
21
  onClick: onSecondaryButtonClick,
20
- variant: "secondary-ghost",
22
+ variant: secondaryButtonVariant,
21
23
  size: "large",
22
24
  children: secondaryButtonText
23
25
  }) }), primaryButtonText && /* @__PURE__ */ jsx(Closable, { children: /* @__PURE__ */ jsx(Button, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@redis-ui/components",
3
3
  "license": "UNLICENSED",
4
- "version": "51.11.0",
4
+ "version": "51.13.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.18.0",
33
+ "@redis-ui/styles": "^21.19.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"
@@ -62,7 +62,7 @@ import { Modal } from '@redis-ui/components';
62
62
  | `Modal.Content.Body.Compose` | `width` | `string` | - | Optional width for the body container |
63
63
  | `Modal.Content.Body.Text` | `Typography.Body props` | - | - | Typography wrapper for body text |
64
64
  | `Modal.Content.Footer` | `primaryButtonText` | `string` | - | Label for the primary action button |
65
- | `Modal.Content.Footer` | `secondaryButtonText` | `string` | - | Label for the secondary action button |
65
+ | `Modal.Content.Footer` | `secondaryButtonText` | `string` | - | Label for the secondary action button. Its variant comes from the theme `modal.footer.secondaryButtonVariant` (`secondary-ghost` classic, `secondary-fill` next) |
66
66
  | `Modal.Content.Footer` | `tertiaryButtonText` | `string` | - | Label for the tertiary action button |
67
67
  | `Modal.Content.Footer` | `tertiaryButtonIcon` | `IconType` | - | Icon shown inside the tertiary action button |
68
68
  | `Modal.Content.Footer` | `primaryButtonDisabled` | `boolean` | `false` | Disables the primary action button |
@@ -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