@reykjavik/hanna-react 0.10.149 → 0.10.151

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,11 +4,28 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
+ ## 0.10.151
8
+
9
+ _2025-05-22_
10
+
11
+ - `Heading`:
12
+ - fix: Apply `wrapperProps.className` standalone, not as a modifier
13
+ - `Layout`:
14
+ - fix: Suppress rendering of empty `.Layout__footer`
15
+
16
+ ## 0.10.150
17
+
18
+ _2025-05-08_
19
+
20
+ - `InfoBlock`:
21
+ - feat: Suppress rendering empty `div.InfoBlock__items` list element
22
+
7
23
  ## 0.10.149
8
24
 
9
25
  _2025-04-02_
10
26
 
11
- - perf: Don't render `Modal`s (and their contents) unless "visible"
27
+ - `Modal`:
28
+ - perf: Don't render `Modal`s (and their contents) unless "visible"
12
29
 
13
30
  ## 0.10.148
14
31
 
package/Heading.js CHANGED
@@ -14,12 +14,7 @@ const Heading = (props) => {
14
14
  const { size = 'normal', align, wide, children, wrapperProps } = props;
15
15
  const Tag = props.Tag || (props.forceH1 ? 'h1' : 'h2');
16
16
  const suppressWarning = process.env.NODE_ENV !== 'production' && Tag === 'h1' ? true : undefined;
17
- return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { "data-dev-forcedh1": suppressWarning, className: (0, hanna_utils_1.modifiedClass)('Heading', [
18
- sizes[size],
19
- align === 'right' && `align--${align}`,
20
- !align && wide && 'wide',
21
- (wrapperProps || {}).className,
22
- ]) }), children));
17
+ return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { "data-dev-forcedh1": suppressWarning, className: (0, hanna_utils_1.modifiedClass)('Heading', [sizes[size], align === 'right' && `align--${align}`, !align && wide && 'wide'], (wrapperProps || {}).className) }), children));
23
18
  };
24
19
  exports.Heading = Heading;
25
20
  exports.default = exports.Heading;
package/InfoBlock.js CHANGED
@@ -9,7 +9,7 @@ const InfoBlock = (props) => {
9
9
  return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, hanna_utils_1.modifiedClass)('InfoBlock', null, (wrapperProps || {}).className) }),
10
10
  react_1.default.createElement("h2", { className: "InfoBlock__title" }, title),
11
11
  subtitle && react_1.default.createElement("div", { className: "InfoBlock__subtitle" }, subtitle),
12
- react_1.default.createElement("ul", { className: "InfoBlock__items" }, items.map((item, i) => (react_1.default.createElement("li", { key: i, className: "InfoBlock__item" }, item)))),
12
+ items.length > 0 && (react_1.default.createElement("ul", { className: "InfoBlock__items" }, items.map((item, i) => (react_1.default.createElement("li", { key: i, className: "InfoBlock__item" }, item))))),
13
13
  'extraInfo' in props && (react_1.default.createElement("div", { className: "InfoBlock__extrainfo" }, props.extraInfo)),
14
14
  'attention' in props && (react_1.default.createElement("div", { className: "InfoBlock__attention" }, props.attention))));
15
15
  };
package/Layout.js CHANGED
@@ -27,7 +27,7 @@ const Layout = (props) => {
27
27
  navChildren && (react_1.default.createElement("a", { className: "Layout__header__navlink", href: "#pagenav", onClick: (e) => (0, a11yHelpers_js_1.handleAnchorLinkClick)(e, true), "aria-label": txt.skipLinkLabel }, txt.skipLinkLabel))),
28
28
  react_1.default.createElement("div", { className: "Layout__main", role: "main" }, mainChildren || children),
29
29
  navChildren && (react_1.default.createElement("div", { className: "Layout__nav", id: "pagenav", tabIndex: -1, role: "navigation" }, navChildren)),
30
- react_1.default.createElement("div", { className: "Layout__footer", role: "complementary" }, footerChildren))));
30
+ footerChildren && (react_1.default.createElement("div", { className: "Layout__footer", role: "complementary" }, footerChildren)))));
31
31
  };
32
32
  exports.Layout = Layout;
33
33
  exports.default = exports.Layout;
package/esm/Heading.js CHANGED
@@ -10,11 +10,6 @@ export const Heading = (props) => {
10
10
  const { size = 'normal', align, wide, children, wrapperProps } = props;
11
11
  const Tag = props.Tag || (props.forceH1 ? 'h1' : 'h2');
12
12
  const suppressWarning = process.env.NODE_ENV !== 'production' && Tag === 'h1' ? true : undefined;
13
- return (React.createElement(Tag, Object.assign({}, wrapperProps, { "data-dev-forcedh1": suppressWarning, className: modifiedClass('Heading', [
14
- sizes[size],
15
- align === 'right' && `align--${align}`,
16
- !align && wide && 'wide',
17
- (wrapperProps || {}).className,
18
- ]) }), children));
13
+ return (React.createElement(Tag, Object.assign({}, wrapperProps, { "data-dev-forcedh1": suppressWarning, className: modifiedClass('Heading', [sizes[size], align === 'right' && `align--${align}`, !align && wide && 'wide'], (wrapperProps || {}).className) }), children));
19
14
  };
20
15
  export default Heading;
package/esm/InfoBlock.js CHANGED
@@ -5,7 +5,7 @@ export const InfoBlock = (props) => {
5
5
  return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('InfoBlock', null, (wrapperProps || {}).className) }),
6
6
  React.createElement("h2", { className: "InfoBlock__title" }, title),
7
7
  subtitle && React.createElement("div", { className: "InfoBlock__subtitle" }, subtitle),
8
- React.createElement("ul", { className: "InfoBlock__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: "InfoBlock__item" }, item)))),
8
+ items.length > 0 && (React.createElement("ul", { className: "InfoBlock__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: "InfoBlock__item" }, item))))),
9
9
  'extraInfo' in props && (React.createElement("div", { className: "InfoBlock__extrainfo" }, props.extraInfo)),
10
10
  'attention' in props && (React.createElement("div", { className: "InfoBlock__attention" }, props.attention))));
11
11
  };
package/esm/Layout.js CHANGED
@@ -23,6 +23,6 @@ export const Layout = (props) => {
23
23
  navChildren && (React.createElement("a", { className: "Layout__header__navlink", href: "#pagenav", onClick: (e) => handleAnchorLinkClick(e, true), "aria-label": txt.skipLinkLabel }, txt.skipLinkLabel))),
24
24
  React.createElement("div", { className: "Layout__main", role: "main" }, mainChildren || children),
25
25
  navChildren && (React.createElement("div", { className: "Layout__nav", id: "pagenav", tabIndex: -1, role: "navigation" }, navChildren)),
26
- React.createElement("div", { className: "Layout__footer", role: "complementary" }, footerChildren))));
26
+ footerChildren && (React.createElement("div", { className: "Layout__footer", role: "complementary" }, footerChildren)))));
27
27
  };
28
28
  export default Layout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/hanna-react",
3
- "version": "0.10.149",
3
+ "version": "0.10.151",
4
4
  "author": "Reykjavík (http://www.reykjavik.is)",
5
5
  "contributors": [
6
6
  "Hugsmiðjan ehf (http://www.hugsmidjan.is)",
@@ -17,7 +17,7 @@
17
17
  "@floating-ui/react": "^0.19.2",
18
18
  "@hugsmidjan/qj": "^4.22.1",
19
19
  "@hugsmidjan/react": "^0.4.32",
20
- "@reykjavik/hanna-css": "^0.4.17",
20
+ "@reykjavik/hanna-css": "^0.4.18",
21
21
  "@reykjavik/hanna-utils": "^0.2.20",
22
22
  "@types/react-autosuggest": "^10.1.0",
23
23
  "@types/react-datepicker": "^4.8.0",