@reykjavik/hanna-react 0.10.167 → 0.10.168

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/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
+ ## 0.10.168
8
+
9
+ _2026-02-23_
10
+
11
+ - `Modal`:
12
+ - fix: `children` render function not invoked correctly
13
+ - fix: Drop redundant `visible` flag for the `children` render function —
14
+ (It was always `true`)
15
+
7
16
  ## 0.10.167
8
17
 
9
18
  _2026-02-17_
package/Modal.js CHANGED
@@ -6,16 +6,19 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _AbstractModal_js_1 = require("./_abstract/_AbstractModal.js");
7
7
  exports.defaultModalTexts = _AbstractModal_js_1.defaultAbstractModalTexts;
8
8
  const Modal = (props) => {
9
- const { bling, render, children } = props;
10
- return (react_1.default.createElement(_AbstractModal_js_1.AbstractModal, Object.assign({}, props, { bem: "Modal", render: (renderProps) => {
11
- const _children = render ? render(renderProps) : children;
12
- return bling ? (react_1.default.createElement(react_1.default.Fragment, null,
13
- _children,
14
- react_1.default.createElement("div", { className: "Modal__blings" },
15
- react_1.default.createElement("div", { className: "Modal__blings__inner" }, bling)))) : (_children);
16
- },
17
- // Required since props might contain children
18
- children: undefined })));
9
+ const { bling, render, // eslint-disable-line deprecation/deprecation
10
+ children, } = props;
11
+ return (react_1.default.createElement(_AbstractModal_js_1.AbstractModal, Object.assign({}, props, { bem: "Modal", render: undefined }), (renderProps) => {
12
+ const _children = render
13
+ ? render(renderProps)
14
+ : typeof children === 'function'
15
+ ? children(renderProps)
16
+ : children;
17
+ return bling ? (react_1.default.createElement(react_1.default.Fragment, null,
18
+ _children,
19
+ react_1.default.createElement("div", { className: "Modal__blings" },
20
+ react_1.default.createElement("div", { className: "Modal__blings__inner" }, bling)))) : (_children);
21
+ }));
19
22
  };
20
23
  exports.Modal = Modal;
21
24
  exports.default = exports.Modal;
@@ -98,12 +98,6 @@ export type AbstractModalProps = {
98
98
  children: ReactNode | ((props: {
99
99
  /** Action dispacher that initiates modal closing action */
100
100
  closeModal(): void;
101
- /**
102
- * Whether the modal is visible or not. The `onOpen` and `onClosed`
103
- * callbacks are triggered once the modal has become fully visible or
104
- * fully hidden.
105
- */
106
- visible: boolean;
107
101
  }) => ReactNode);
108
102
  }> & WrapperElmProps<'div', 'hidden' | 'role'> & SSRSupportProps;
109
103
  type AbstractModalProps_private = AbstractModalProps & BemProps<true>;
@@ -132,7 +132,7 @@ const AbstractModal = (props) => {
132
132
  render
133
133
  ? render({ closeModal })
134
134
  : typeof children === 'function'
135
- ? children({ closeModal, visible })
135
+ ? children({ closeModal })
136
136
  : children,
137
137
  isBrowser && !props.noCloseButton && (react_1.default.createElement("button", { className: `${bem}__closebutton`, type: "button", onClick: closeModal, "aria-label": closeButtonLabel, "aria-controls": domid, title: closeButtonLabel }, txt.closeButton))),
138
138
  isBrowser && react_1.default.createElement(FocusTrap_js_1.FocusTrap, null)))));
package/esm/Modal.js CHANGED
@@ -2,15 +2,18 @@ import React from 'react';
2
2
  import { AbstractModal, defaultAbstractModalTexts, } from './_abstract/_AbstractModal.js';
3
3
  export const defaultModalTexts = defaultAbstractModalTexts;
4
4
  export const Modal = (props) => {
5
- const { bling, render, children } = props;
6
- return (React.createElement(AbstractModal, Object.assign({}, props, { bem: "Modal", render: (renderProps) => {
7
- const _children = render ? render(renderProps) : children;
8
- return bling ? (React.createElement(React.Fragment, null,
9
- _children,
10
- React.createElement("div", { className: "Modal__blings" },
11
- React.createElement("div", { className: "Modal__blings__inner" }, bling)))) : (_children);
12
- },
13
- // Required since props might contain children
14
- children: undefined })));
5
+ const { bling, render, // eslint-disable-line deprecation/deprecation
6
+ children, } = props;
7
+ return (React.createElement(AbstractModal, Object.assign({}, props, { bem: "Modal", render: undefined }), (renderProps) => {
8
+ const _children = render
9
+ ? render(renderProps)
10
+ : typeof children === 'function'
11
+ ? children(renderProps)
12
+ : children;
13
+ return bling ? (React.createElement(React.Fragment, null,
14
+ _children,
15
+ React.createElement("div", { className: "Modal__blings" },
16
+ React.createElement("div", { className: "Modal__blings__inner" }, bling)))) : (_children);
17
+ }));
15
18
  };
16
19
  export default Modal;
@@ -98,12 +98,6 @@ export type AbstractModalProps = {
98
98
  children: ReactNode | ((props: {
99
99
  /** Action dispacher that initiates modal closing action */
100
100
  closeModal(): void;
101
- /**
102
- * Whether the modal is visible or not. The `onOpen` and `onClosed`
103
- * callbacks are triggered once the modal has become fully visible or
104
- * fully hidden.
105
- */
106
- visible: boolean;
107
101
  }) => ReactNode);
108
102
  }> & WrapperElmProps<'div', 'hidden' | 'role'> & SSRSupportProps;
109
103
  type AbstractModalProps_private = AbstractModalProps & BemProps<true>;
@@ -128,7 +128,7 @@ export const AbstractModal = (props) => {
128
128
  render
129
129
  ? render({ closeModal })
130
130
  : typeof children === 'function'
131
- ? children({ closeModal, visible })
131
+ ? children({ closeModal })
132
132
  : children,
133
133
  isBrowser && !props.noCloseButton && (React.createElement("button", { className: `${bem}__closebutton`, type: "button", onClick: closeModal, "aria-label": closeButtonLabel, "aria-controls": domid, title: closeButtonLabel }, txt.closeButton))),
134
134
  isBrowser && React.createElement(FocusTrap, null)))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/hanna-react",
3
- "version": "0.10.167",
3
+ "version": "0.10.168",
4
4
  "author": "Reykjavík (http://www.reykjavik.is)",
5
5
  "contributors": [
6
6
  "Hugsmiðjan ehf (http://www.hugsmidjan.is)",