@reykjavik/hanna-react 0.10.66 → 0.10.68
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/ActionCards.d.ts +3 -2
- package/ArticleCarousel/_ArticleCarouselCard.d.ts +1 -0
- package/ArticleCarousel/_ArticleCarouselCard.js +3 -3
- package/BasicTable.d.ts +1 -1
- package/ButtonBar.d.ts +1 -0
- package/ButtonBar.js +1 -0
- package/CHANGELOG.md +27 -0
- package/ContentArticle.d.ts +1 -0
- package/ContentArticle.js +1 -1
- package/Heading.d.ts +5 -0
- package/Heading.js +2 -1
- package/ImageCards.d.ts +6 -4
- package/Selectbox.d.ts +7 -4
- package/SiteSearchInput.d.ts +1 -1
- package/TextInput.js +8 -1
- package/_abstract/_CardList.d.ts +8 -4
- package/_abstract/_CardList.js +4 -5
- package/_abstract/_Quote.d.ts +4 -2
- package/index.d.ts +95 -0
- package/index.js +2 -0
- package/package.json +2 -2
package/ActionCards.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TextCardListProps } from './_abstract/_CardList';
|
|
1
|
+
import { CardListSummaryProps, TextCardListProps, TextCardProps } from './_abstract/_CardList';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
export declare type ActionCardsProps = TextCardListProps & SeenProp;
|
|
3
|
+
export declare type ActionCardsProps = TextCardListProps & CardListSummaryProps & SeenProp;
|
|
4
|
+
export declare type ActionCardsItemProps = TextCardProps;
|
|
4
5
|
declare const ActionCards: (props: ActionCardsProps) => JSX.Element;
|
|
5
6
|
export default ActionCards;
|
|
@@ -9,11 +9,11 @@ const _Image_1 = tslib_1.__importDefault(require("../_abstract/_Image"));
|
|
|
9
9
|
const _Link_1 = require("../_abstract/_Link");
|
|
10
10
|
const constants_1 = require("../constants");
|
|
11
11
|
const ArticleCarouselCard = (props) => {
|
|
12
|
-
const { date, title, summary, href, moreLabel, color, theme, illustration, image } = props;
|
|
12
|
+
const { date, title, summary, href, target, moreLabel, color, theme, illustration, image, } = props;
|
|
13
13
|
const photo = image === null || image === void 0 ? void 0 : image.photo;
|
|
14
14
|
const imageProps = illustration ? { src: (0, assets_1.getIllustrationUrl)(illustration) } : image;
|
|
15
15
|
return (react_1.default.createElement("div", { className: "ArticleCarouselCard", "data-color": color && constants_1.colorFamilies[color], "data-color-theme": !color ? theme && constants_1.themeOptions[theme] : undefined },
|
|
16
|
-
react_1.default.createElement(_Link_1.Link, { className: "ArticleCarouselCard__link", href: href },
|
|
16
|
+
react_1.default.createElement(_Link_1.Link, { className: "ArticleCarouselCard__link", href: href, target: target },
|
|
17
17
|
' ',
|
|
18
18
|
react_1.default.createElement(_Image_1.default, Object.assign({ placeholder: true, className: (0, getBemClass_1.default)('ArticleCarouselCard__illustration', photo && 'photo') }, imageProps)),
|
|
19
19
|
react_1.default.createElement("h3", { className: "ArticleCarouselCard__title" }, title),
|
|
@@ -21,7 +21,7 @@ const ArticleCarouselCard = (props) => {
|
|
|
21
21
|
' ',
|
|
22
22
|
date && react_1.default.createElement("span", { className: "ArticleCarouselCard__date" }, date),
|
|
23
23
|
react_1.default.createElement("div", { className: "ArticleCarouselCard__summary" }, summary),
|
|
24
|
-
moreLabel && (react_1.default.createElement(_Link_1.Link, { className: "ArticleCarouselCard__morelink", href: href, "aria-label": title },
|
|
24
|
+
moreLabel && (react_1.default.createElement(_Link_1.Link, { className: "ArticleCarouselCard__morelink", href: href, target: target, "aria-label": title },
|
|
25
25
|
' ',
|
|
26
26
|
moreLabel,
|
|
27
27
|
' '))));
|
package/BasicTable.d.ts
CHANGED
package/ButtonBar.d.ts
CHANGED
package/ButtonBar.js
CHANGED
|
@@ -9,6 +9,7 @@ const ButtonBar = (props) => {
|
|
|
9
9
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('ButtonBar', align === 'right' && 'align--right') }, children));
|
|
10
10
|
};
|
|
11
11
|
exports.ButtonBar = ButtonBar;
|
|
12
|
+
/** A Splitter token to use directly inside <ButtonBar/> wrappers */
|
|
12
13
|
exports.ButtonBar.Split = () => react_1.default.createElement("span", { className: "ButtonBar__split" });
|
|
13
14
|
/**
|
|
14
15
|
* @deprecated Prefer using `ButtonBar.Split` instead.
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,33 @@
|
|
|
4
4
|
|
|
5
5
|
- ... <!-- Add new lines here. -->
|
|
6
6
|
|
|
7
|
+
## 0.10.68
|
|
8
|
+
|
|
9
|
+
_2022-09-26_
|
|
10
|
+
|
|
11
|
+
- feat: Add prop `target` to `ArticleCarouselCardProps`
|
|
12
|
+
- feat: Improve `Selectbox`'s `options` and `onSelected` prop generics
|
|
13
|
+
- feat: Add prop `headingTag` to `ContentArticle` to support `<h1/>`
|
|
14
|
+
- feat: Add prop `forceH1` to `Heading`
|
|
15
|
+
- fix: Mark uncontrolled `TextInput`'s with user input `--filled` after reload
|
|
16
|
+
- fix(ts): Botched re-export of `SelectboxOption*` types
|
|
17
|
+
|
|
18
|
+
## 0.10.67
|
|
19
|
+
|
|
20
|
+
_2022-09-14_
|
|
21
|
+
|
|
22
|
+
- chore(ts): Add reference paths for better Intellisense sub module discovery
|
|
23
|
+
- feat: Add prop `summaryElement` to `ActionCards`
|
|
24
|
+
- feat(ts): Export `ActionCardsItemProps` type
|
|
25
|
+
- feat(ts): Export `ImageCardsProps`, `ImageCardsItemProps`, deprecate
|
|
26
|
+
`ImageCardProps`
|
|
27
|
+
- feat(ts): Export `SelectboxOptionList`, deprecate `SelectboxOptions`
|
|
28
|
+
- fix(ts): Export omitted types `BasicTableProps` and `SelectboxOption`
|
|
29
|
+
- fix(ts): Make `PullQuote` & `BlockQuote`'s `by` prop required for `byHref`
|
|
30
|
+
- fix(ts): Remove accidentally exposed props on several `*Cards` components —
|
|
31
|
+
these props were never supported and were either a no-op, or resulted in
|
|
32
|
+
unstyled garbage.
|
|
33
|
+
|
|
7
34
|
## 0.10.66
|
|
8
35
|
|
|
9
36
|
_2022-09-01_
|
package/ContentArticle.d.ts
CHANGED
package/ContentArticle.js
CHANGED
|
@@ -13,7 +13,7 @@ const ContentArticle = (props) => {
|
|
|
13
13
|
const [ref] = (0, seenEffect_1.useSeenEffect)(props.startSeen);
|
|
14
14
|
return (react_1.default.createElement("div", { className: "ContentArticle", ref: ref },
|
|
15
15
|
react_1.default.createElement(ArticleMeta_1.default, { items: props.meta }),
|
|
16
|
-
react_1.default.createElement(Heading_1.default,
|
|
16
|
+
react_1.default.createElement(Heading_1.default, { forceH1: props.headlineTag === 'h1' }, props.headline),
|
|
17
17
|
react_1.default.createElement(TextBlock_1.default, { startSeen: true },
|
|
18
18
|
props.topImage && react_1.default.createElement(ContentImage_1.default, Object.assign({}, props.topImage)),
|
|
19
19
|
props.body),
|
package/Heading.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export declare type HeadingProps = {
|
|
|
11
11
|
Tag?: 'h2' | 'h3';
|
|
12
12
|
size?: HeadingSize;
|
|
13
13
|
children: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Make an exception and render a `<h1/>` element.
|
|
16
|
+
*
|
|
17
|
+
* This prop is ignore if the `Tag` prop is defined. */
|
|
18
|
+
forceH1?: boolean;
|
|
14
19
|
} & ComponentLayoutProps;
|
|
15
20
|
declare const Heading: (props: HeadingProps) => JSX.Element;
|
|
16
21
|
export default Heading;
|
package/Heading.js
CHANGED
|
@@ -10,7 +10,8 @@ const sizes = {
|
|
|
10
10
|
large: 'large',
|
|
11
11
|
};
|
|
12
12
|
const Heading = (props) => {
|
|
13
|
-
const { size = 'normal',
|
|
13
|
+
const { size = 'normal', align, wide, children } = props;
|
|
14
|
+
const Tag = props.Tag || (props.forceH1 ? 'h1' : 'h2');
|
|
14
15
|
return (react_1.default.createElement(Tag, { className: (0, getBemClass_1.default)('Heading', [
|
|
15
16
|
sizes[size],
|
|
16
17
|
align === 'right' && 'align--' + align,
|
package/ImageCards.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { ImageCardListProps, ImageCardProps as
|
|
1
|
+
import { CardListSummaryProps, ImageCardListProps, ImageCardProps as _ImageCardProps } from './_abstract/_CardList';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
|
|
4
|
-
declare type
|
|
3
|
+
/** @deprecated Use `ImageCard` instead. (Will be removed in v0.11) */
|
|
4
|
+
export declare type ImageCardProps = _ImageCardProps;
|
|
5
|
+
export declare type ImageCardsItemProps = _ImageCardProps;
|
|
6
|
+
export declare type ImageCardsProps = ImageCardListProps & CardListSummaryProps & {
|
|
5
7
|
background?: boolean;
|
|
6
8
|
} & SeenProp;
|
|
7
|
-
declare const ImageCards: (props:
|
|
9
|
+
declare const ImageCards: (props: ImageCardsProps) => JSX.Element;
|
|
8
10
|
export default ImageCards;
|
package/Selectbox.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { SelectboxProps as _SelectboxProps } from '@hugsmidjan/react/Selectbox';
|
|
1
|
+
import type { SelectboxProps as _SelectboxProps } from '@hugsmidjan/react/Selectbox';
|
|
2
2
|
import { FormFieldWrappingProps } from './FormField';
|
|
3
|
-
export
|
|
3
|
+
export { type SelectboxOption, type SelectboxOptions as SelectboxOptionList,
|
|
4
|
+
/** @deprecated Use `SelectboxOptionList` instead (Will be removed in v0.11) */
|
|
5
|
+
type SelectboxOptions, } from '@hugsmidjan/react/Selectbox';
|
|
6
|
+
declare type OptionOrValue = _SelectboxProps['options'][0];
|
|
7
|
+
export declare type SelectboxProps<O extends OptionOrValue = OptionOrValue> = FormFieldWrappingProps & Omit<_SelectboxProps<O>, 'bem'> & {
|
|
4
8
|
small?: boolean;
|
|
5
9
|
};
|
|
6
|
-
|
|
7
|
-
declare const Selectbox: (props: SelectboxProps) => JSX.Element;
|
|
10
|
+
declare const Selectbox: <O extends import("@hugsmidjan/react/__types/Selectbox.privates").OptionOrValue>(props: SelectboxProps<O>) => JSX.Element;
|
|
8
11
|
export default Selectbox;
|
package/SiteSearchInput.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ export declare type SiteSearchInputProps = {
|
|
|
20
20
|
children?: undefined;
|
|
21
21
|
ssr?: SSRSupport;
|
|
22
22
|
} & WrappingProps & InputElmProps;
|
|
23
|
-
declare const SiteSearchInput: React.ForwardRefExoticComponent<Pick<SiteSearchInputProps, "title" | "id" | "ssr" | "form" | "label" | "slot" | "style" | "pattern" | "children" | "hidden" | "onClick" | "
|
|
23
|
+
declare const SiteSearchInput: React.ForwardRefExoticComponent<Pick<SiteSearchInputProps, "title" | "id" | "ssr" | "form" | "label" | "slot" | "style" | "pattern" | "children" | "hidden" | "onClick" | "is" | "key" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "step" | "src" | "multiple" | "alt" | "width" | "accept" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "enterKeyHint" | "height" | "max" | "maxLength" | "min" | "minLength" | "onButtonClick" | "buttonText"> & React.RefAttributes<HTMLInputElement>>;
|
|
24
24
|
export default SiteSearchInput;
|
package/TextInput.js
CHANGED
|
@@ -6,7 +6,8 @@ const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/g
|
|
|
6
6
|
const FormField_1 = tslib_1.__importDefault(require("./FormField"));
|
|
7
7
|
const TextInput = (props) => {
|
|
8
8
|
var _a;
|
|
9
|
-
const
|
|
9
|
+
const _inputRef = (0, react_1.useRef)(null);
|
|
10
|
+
const { className, label, assistText, hideLabel, disabled, readOnly, invalid, errorMessage, required, reqText, id, onChange, small, type, ssr, inputRef = _inputRef } = props, inputElementProps = tslib_1.__rest(props, ["className", "label", "assistText", "hideLabel", "disabled", "readOnly", "invalid", "errorMessage", "required", "reqText", "id", "onChange", "small", "type", "ssr", "inputRef"]);
|
|
10
11
|
const { value, defaultValue, placeholder } = inputElementProps;
|
|
11
12
|
const [hasValue, setHasValue] = (0, react_1.useState)(undefined);
|
|
12
13
|
const filled = !!((_a = value !== null && value !== void 0 ? value : hasValue) !== null && _a !== void 0 ? _a : !!defaultValue);
|
|
@@ -22,6 +23,12 @@ const TextInput = (props) => {
|
|
|
22
23
|
// TypeScript is silly sometimes.
|
|
23
24
|
e);
|
|
24
25
|
};
|
|
26
|
+
(0, react_1.useEffect)(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) {
|
|
29
|
+
setHasValue(true);
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
25
32
|
return (react_1.default.createElement(FormField_1.default, { className: (0, getBemClass_1.default)('TextInput', modifiers, className), ssr: ssr, small: small, label: label, empty: empty, filled: filled, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps, addFocusProps) => multiline ? (react_1.default.createElement("textarea", Object.assign({ className: className.input, onChange: _onChange }, inputProps, addFocusProps(inputElementProps), { ref: inputRef }))) : (react_1.default.createElement("input", Object.assign({ className: className.input, onChange: _onChange, type: type }, inputProps, addFocusProps(inputElementProps), { ref: inputRef }))) }));
|
|
26
33
|
};
|
|
27
34
|
exports.default = TextInput;
|
package/_abstract/_CardList.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
2
3
|
import { ImageProps } from './_Image';
|
|
3
4
|
declare type BaseCardProps = {
|
|
4
5
|
title: string;
|
|
5
6
|
href: string;
|
|
6
|
-
imgPlaceholder?: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare type ImageCardProps = BaseCardProps & {
|
|
9
9
|
meta?: string;
|
|
10
10
|
image?: ImageProps;
|
|
11
|
+
imgPlaceholder?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare type TextCardProps = BaseCardProps & {
|
|
13
14
|
summary?: string;
|
|
@@ -15,13 +16,16 @@ export declare type TextCardProps = BaseCardProps & {
|
|
|
15
16
|
export declare type CardListProps<T> = {
|
|
16
17
|
cards: Array<T>;
|
|
17
18
|
title?: string | undefined;
|
|
18
|
-
summaryElement?: ReactElement;
|
|
19
19
|
titleTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'p';
|
|
20
|
+
};
|
|
21
|
+
export declare type CardListSummaryProps = {
|
|
22
|
+
summaryElement?: ReactElement;
|
|
23
|
+
};
|
|
24
|
+
export declare type ImageCardListProps = CardListProps<ImageCardProps> & {
|
|
20
25
|
imgPlaceholder?: boolean | string;
|
|
21
26
|
};
|
|
22
|
-
export declare type ImageCardListProps = CardListProps<ImageCardProps>;
|
|
23
27
|
export declare type TextCardListProps = CardListProps<TextCardProps>;
|
|
24
|
-
declare type _CardListProps =
|
|
28
|
+
declare type _CardListProps = EitherObj<ImageCardListProps, TextCardListProps> & CardListSummaryProps & {
|
|
25
29
|
bemPrefix: string;
|
|
26
30
|
children?: ReactNode;
|
|
27
31
|
standalone?: boolean;
|
package/_abstract/_CardList.js
CHANGED
|
@@ -6,11 +6,8 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const _Button_1 = tslib_1.__importDefault(require("./_Button"));
|
|
7
7
|
const _Image_1 = tslib_1.__importDefault(require("./_Image"));
|
|
8
8
|
const Card = (props) => {
|
|
9
|
-
const { bem, href, title, imgPlaceholder } = props;
|
|
9
|
+
const { bem, href, title, imgPlaceholder, image, meta, summary } = props;
|
|
10
10
|
const cardClass = `${bem}__card`;
|
|
11
|
-
const image = 'image' in props && props.image;
|
|
12
|
-
const meta = 'meta' in props && props.meta;
|
|
13
|
-
const summary = 'summary' in props && props.summary;
|
|
14
11
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
12
|
react_1.default.createElement(_Button_1.default, { bem: cardClass, href: href },
|
|
16
13
|
' ',
|
|
@@ -37,7 +34,9 @@ const CardList = (props) => {
|
|
|
37
34
|
title && react_1.default.createElement(TitleTag, { className: bemPrefix + '__title' }, title),
|
|
38
35
|
summaryElement)) : (title && react_1.default.createElement(TitleTag, { className: bemPrefix + '__title' }, title)),
|
|
39
36
|
react_1.default.createElement("ul", { className: bemPrefix + (props.standalone ? '' : '__list'), style: fallbackImageStyle }, cards.map((card, i) => (react_1.default.createElement("li", { key: i, className: bemPrefix + '__item' },
|
|
40
|
-
react_1.default.createElement(Card
|
|
37
|
+
react_1.default.createElement(Card
|
|
38
|
+
/* Assert as `ImageCardProps` to silence the imgPlaceholder false-positive */
|
|
39
|
+
, Object.assign({}, card, { bem: bemPrefix, imgPlaceholder: !!imgPlaceholder })))))),
|
|
41
40
|
children));
|
|
42
41
|
};
|
|
43
42
|
exports.CardList = CardList;
|
package/_abstract/_Quote.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
2
3
|
export declare type QuoteProps = {
|
|
3
4
|
children: ReactNode;
|
|
4
|
-
|
|
5
|
+
} & EitherObj<object, {
|
|
6
|
+
by: string | JSX.Element;
|
|
5
7
|
byHref?: string;
|
|
6
|
-
}
|
|
8
|
+
}>;
|
|
7
9
|
export declare const _Quote: (props: {
|
|
8
10
|
bem: string;
|
|
9
11
|
} & QuoteProps) => JSX.Element;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/// <reference path="./AccordionList.d.tsx" />
|
|
2
|
+
/// <reference path="./ActionCards.d.tsx" />
|
|
3
|
+
/// <reference path="./Alert.d.tsx" />
|
|
4
|
+
/// <reference path="./ArticleCards.d.tsx" />
|
|
5
|
+
/// <reference path="./ArticleCarousel.d.tsx" />
|
|
6
|
+
/// <reference path="./ArticleMeta.d.tsx" />
|
|
7
|
+
/// <reference path="./assets.d.ts" />
|
|
8
|
+
/// <reference path="./Attention.d.tsx" />
|
|
9
|
+
/// <reference path="./BasicTable.d.tsx" />
|
|
10
|
+
/// <reference path="./BgBox.d.tsx" />
|
|
11
|
+
/// <reference path="./Bling.d.tsx" />
|
|
12
|
+
/// <reference path="./BlockBreak.d.tsx" />
|
|
13
|
+
/// <reference path="./BlockQuote.d.tsx" />
|
|
14
|
+
/// <reference path="./BreadCrumbs.d.tsx" />
|
|
15
|
+
/// <reference path="./ButtonBack.d.tsx" />
|
|
16
|
+
/// <reference path="./ButtonBar.d.tsx" />
|
|
17
|
+
/// <reference path="./ButtonPrimary.d.tsx" />
|
|
18
|
+
/// <reference path="./ButtonSecondary.d.tsx" />
|
|
19
|
+
/// <reference path="./ButtonTertiary.d.tsx" />
|
|
20
|
+
/// <reference path="./Carousel.d.tsx" />
|
|
21
|
+
/// <reference path="./CarouselStepper.d.tsx" />
|
|
22
|
+
/// <reference path="./CenterColumn.d.tsx" />
|
|
23
|
+
/// <reference path="./Checkbox.d.tsx" />
|
|
24
|
+
/// <reference path="./CheckboxButtonsGroup.d.tsx" />
|
|
25
|
+
/// <reference path="./CheckboxGroup.d.tsx" />
|
|
26
|
+
/// <reference path="./CityBlock.d.tsx" />
|
|
27
|
+
/// <reference path="./constants.d.ts" />
|
|
28
|
+
/// <reference path="./ContactBubble.d.tsx" />
|
|
29
|
+
/// <reference path="./ContentArticle.d.tsx" />
|
|
30
|
+
/// <reference path="./ContentImage.d.tsx" />
|
|
31
|
+
/// <reference path="./Datepicker.d.tsx" />
|
|
32
|
+
/// <reference path="./ExtraLinks.d.tsx" />
|
|
33
|
+
/// <reference path="./FeatureList.d.tsx" />
|
|
34
|
+
/// <reference path="./FieldGroup.d.tsx" />
|
|
35
|
+
/// <reference path="./FileInput.d.tsx" />
|
|
36
|
+
/// <reference path="./focus-visible.d.ts" />
|
|
37
|
+
/// <reference path="./Foonote.d.tsx" />
|
|
38
|
+
/// <reference path="./FooterBadges.d.tsx" />
|
|
39
|
+
/// <reference path="./FooterInfo.d.tsx" />
|
|
40
|
+
/// <reference path="./Footnote.d.tsx" />
|
|
41
|
+
/// <reference path="./Form.d.tsx" />
|
|
42
|
+
/// <reference path="./FormField.d.tsx" />
|
|
43
|
+
/// <reference path="./Gallery.d.tsx" />
|
|
44
|
+
/// <reference path="./GridBlocks.d.tsx" />
|
|
45
|
+
/// <reference path="./Heading.d.tsx" />
|
|
46
|
+
/// <reference path="./HeroBlock.d.tsx" />
|
|
47
|
+
/// <reference path="./IframeBlock.d.tsx" />
|
|
48
|
+
/// <reference path="./Illustration.d.tsx" />
|
|
49
|
+
/// <reference path="./ImageCards.d.tsx" />
|
|
50
|
+
/// <reference path="./InfoBlock.d.tsx" />
|
|
51
|
+
/// <reference path="./InfoHero.d.tsx" />
|
|
52
|
+
/// <reference path="./IslandBlock.d.tsx" />
|
|
53
|
+
/// <reference path="./IslandPageBlock.d.tsx" />
|
|
54
|
+
/// <reference path="./LabeledTextBlock.d.tsx" />
|
|
55
|
+
/// <reference path="./Layout.d.tsx" />
|
|
56
|
+
/// <reference path="./MainMenu.d.tsx" />
|
|
57
|
+
/// <reference path="./MiniMetrics.d.tsx" />
|
|
58
|
+
/// <reference path="./Modal.d.tsx" />
|
|
59
|
+
/// <reference path="./NameCard.d.tsx" />
|
|
60
|
+
/// <reference path="./NameCards.d.tsx" />
|
|
61
|
+
/// <reference path="./NewsHero.d.tsx" />
|
|
62
|
+
/// <reference path="./PageFilter.d.tsx" />
|
|
63
|
+
/// <reference path="./PageHeading.d.tsx" />
|
|
64
|
+
/// <reference path="./Picture.d.tsx" />
|
|
65
|
+
/// <reference path="./ProcessOverview.d.tsx" />
|
|
66
|
+
/// <reference path="./PullQuote.d.tsx" />
|
|
67
|
+
/// <reference path="./RadioButtonsGroup.d.tsx" />
|
|
68
|
+
/// <reference path="./RadioGroup.d.tsx" />
|
|
69
|
+
/// <reference path="./RelatedLinks.d.tsx" />
|
|
70
|
+
/// <reference path="./RowBlock.d.tsx" />
|
|
71
|
+
/// <reference path="./RowBlockColumn.d.tsx" />
|
|
72
|
+
/// <reference path="./SearchInput.d.tsx" />
|
|
73
|
+
/// <reference path="./SearchResults.d.tsx" />
|
|
74
|
+
/// <reference path="./SeenEffect.d.tsx" />
|
|
75
|
+
/// <reference path="./Selectbox.d.tsx" />
|
|
76
|
+
/// <reference path="./ShareButtons.d.tsx" />
|
|
77
|
+
/// <reference path="./Sharpie.d.tsx" />
|
|
78
|
+
/// <reference path="./SiteSearchAutocomplete.d.tsx" />
|
|
79
|
+
/// <reference path="./SiteSearchCurtain.d.tsx" />
|
|
80
|
+
/// <reference path="./SiteSearchInput.d.tsx" />
|
|
81
|
+
/// <reference path="./Skeleton.d.tsx" />
|
|
82
|
+
/// <reference path="./SubHeading.d.tsx" />
|
|
83
|
+
/// <reference path="./Tabs.d.tsx" />
|
|
84
|
+
/// <reference path="./TagPill.d.tsx" />
|
|
85
|
+
/// <reference path="./TextBlock.d.tsx" />
|
|
86
|
+
/// <reference path="./TextButton.d.tsx" />
|
|
87
|
+
/// <reference path="./TextInput.d.tsx" />
|
|
88
|
+
/// <reference path="./utils.d.ts" />
|
|
89
|
+
/// <reference path="./VerticalTabsTOC.d.tsx" />
|
|
90
|
+
/// <reference path="./VSpacer.d.tsx" />
|
|
91
|
+
/// <reference path="./WizardLayout.d.tsx" />
|
|
92
|
+
/// <reference path="./WizardLayoutClose.d.tsx" />
|
|
93
|
+
/// <reference path="./WizardStepper.d.tsx" />
|
|
94
|
+
|
|
95
|
+
export {};
|
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reykjavik/hanna-react",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.68",
|
|
4
4
|
"author": "Reykjavík (http://www.reykjavik.is)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Hugsmiðjan ehf (http://www.hugsmidjan.is)",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@hugsmidjan/qj": "^4.10.2",
|
|
17
17
|
"@hugsmidjan/react": "^0.4.17",
|
|
18
18
|
"@reykjavik/hanna-css": "^0.3.7",
|
|
19
|
-
"@reykjavik/hanna-utils": "^0.1.
|
|
19
|
+
"@reykjavik/hanna-utils": "^0.1.13",
|
|
20
20
|
"@types/react": "^17.0.24",
|
|
21
21
|
"@types/react-autosuggest": "^10.1.0",
|
|
22
22
|
"@types/react-datepicker": "^3.0.2",
|