@reykjavik/hanna-react 0.10.164 → 0.10.165

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/Alert.js CHANGED
@@ -47,9 +47,12 @@ exports.alertTypes = {
47
47
  error: 1,
48
48
  critical: 1,
49
49
  };
50
+ // eslint-disable-next-line complexity
50
51
  const Alert = (props) => {
51
- const { type, childrenHTML, children, onClose, closeUrl, closable = !!(onClose || closeUrl != null), ssr, onClosed, instantShow, wrapperProps, } = props;
52
+ var _a;
53
+ const { type, childrenHTML, children, onClose, closeUrl, ssr, onClosed, instantShow, wrapperProps, } = props;
52
54
  const autoClose = Math.max(props.autoClose || 0, 0);
55
+ const closable = (_a = props.closable) !== null && _a !== void 0 ? _a : !!(onClose || (onClosed && !autoClose) || closeUrl != null);
53
56
  const closing = (0, react_1.useRef)();
54
57
  const isBrowser = (0, utils_js_1.useIsBrowserSide)(ssr);
55
58
  const [open, setOpen] = (0, react_1.useState)(instantShow || !isBrowser);
package/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
+ ## 0.10.165
8
+
9
+ _2026-01-23_
10
+
11
+ - `Alert`:
12
+ - feat: Auto-show close button if `onClosed` is set without `autoClose`
13
+ - `Picture`:
14
+ - feat: Add prop `inline` to support inlined SVGs
15
+
7
16
  ## 0.10.164
8
17
 
9
18
  _2026-01-20_
package/Picture.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ImagePropsLinked } from './_abstract/_Image.js';
1
+ import { ImageProps } from './_abstract/_Image.js';
2
2
  import { WrapperElmProps } from './utils.js';
3
- export type PictureProps = ImagePropsLinked & {
3
+ export type PictureProps = ImageProps & {
4
4
  contain?: boolean;
5
5
  className?: string;
6
6
  } & WrapperElmProps;
package/Picture.js CHANGED
@@ -4,6 +4,9 @@ exports.Picture = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _Image_js_1 = require("./_abstract/_Image.js");
7
- const Picture = (props) => (react_1.default.createElement(_Image_js_1.Image, Object.assign({}, props, { bem: "Picture", modifier: props.contain && 'contain' })));
7
+ const Picture = (props) => (react_1.default.createElement(_Image_js_1.Image, Object.assign({}, props, { bem: "Picture", modifier: [
8
+ props.contain && 'contain',
9
+ props.inline && /\.svg(?:\?|$)/i.test(props.src) && 'inlined',
10
+ ] })));
8
11
  exports.Picture = Picture;
9
12
  exports.default = exports.Picture;
package/esm/Alert.js CHANGED
@@ -43,9 +43,12 @@ export const alertTypes = {
43
43
  error: 1,
44
44
  critical: 1,
45
45
  };
46
+ // eslint-disable-next-line complexity
46
47
  export const Alert = (props) => {
47
- const { type, childrenHTML, children, onClose, closeUrl, closable = !!(onClose || closeUrl != null), ssr, onClosed, instantShow, wrapperProps, } = props;
48
+ var _a;
49
+ const { type, childrenHTML, children, onClose, closeUrl, ssr, onClosed, instantShow, wrapperProps, } = props;
48
50
  const autoClose = Math.max(props.autoClose || 0, 0);
51
+ const closable = (_a = props.closable) !== null && _a !== void 0 ? _a : !!(onClose || (onClosed && !autoClose) || closeUrl != null);
49
52
  const closing = useRef();
50
53
  const isBrowser = useIsBrowserSide(ssr);
51
54
  const [open, setOpen] = useState(instantShow || !isBrowser);
package/esm/Picture.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ImagePropsLinked } from './_abstract/_Image.js';
1
+ import { ImageProps } from './_abstract/_Image.js';
2
2
  import { WrapperElmProps } from './utils.js';
3
- export type PictureProps = ImagePropsLinked & {
3
+ export type PictureProps = ImageProps & {
4
4
  contain?: boolean;
5
5
  className?: string;
6
6
  } & WrapperElmProps;
package/esm/Picture.js CHANGED
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Image } from './_abstract/_Image.js';
3
- export const Picture = (props) => (React.createElement(Image, Object.assign({}, props, { bem: "Picture", modifier: props.contain && 'contain' })));
3
+ export const Picture = (props) => (React.createElement(Image, Object.assign({}, props, { bem: "Picture", modifier: [
4
+ props.contain && 'contain',
5
+ props.inline && /\.svg(?:\?|$)/i.test(props.src) && 'inlined',
6
+ ] })));
4
7
  export default Picture;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/hanna-react",
3
- "version": "0.10.164",
3
+ "version": "0.10.165",
4
4
  "author": "Reykjavík (http://www.reykjavik.is)",
5
5
  "contributors": [
6
6
  "Hugsmiðjan ehf (http://www.hugsmidjan.is)",