@reykjavik/hanna-react 0.10.70 → 0.10.72
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/AccordionList.d.ts +1 -1
- package/AccordionList.js +3 -1
- package/ActionCards.d.ts +1 -1
- package/ActionCards.js +3 -1
- package/Alert.d.ts +2 -3
- package/Alert.js +5 -4
- package/ArticleCards.d.ts +4 -2
- package/ArticleCards.js +3 -1
- package/ArticleCarousel/_ArticleCarouselCard.d.ts +1 -1
- package/ArticleCarousel/_ArticleCarouselCard.js +2 -2
- package/ArticleCarousel.d.ts +1 -1
- package/ArticleCarousel.js +5 -3
- package/ArticleMeta.d.ts +1 -1
- package/ArticleMeta.js +3 -1
- package/Attention.d.ts +1 -1
- package/Attention.js +3 -1
- package/BasicTable.d.ts +5 -3
- package/BasicTable.js +3 -1
- package/BgBox.d.ts +1 -1
- package/BgBox.js +3 -1
- package/Bling.d.ts +1 -1
- package/Bling.js +3 -1
- package/BlockBreak.d.ts +1 -1
- package/BlockBreak.js +3 -1
- package/BlockQuote.d.ts +1 -1
- package/BlockQuote.js +4 -2
- package/BreadCrumbs.d.ts +1 -1
- package/BreadCrumbs.js +3 -1
- package/ButtonBack.d.ts +1 -1
- package/ButtonBack.js +5 -3
- package/ButtonPrimary.d.ts +1 -1
- package/ButtonPrimary.js +5 -3
- package/ButtonSecondary.d.ts +1 -1
- package/ButtonSecondary.js +5 -3
- package/ButtonTertiary.d.ts +1 -1
- package/ButtonTertiary.js +5 -3
- package/CHANGELOG.md +41 -0
- package/Carousel.d.ts +1 -1
- package/Carousel.js +5 -3
- package/CarouselStepper.d.ts +1 -1
- package/CarouselStepper.js +3 -1
- package/CenterColumn.d.ts +1 -1
- package/CenterColumn.js +3 -1
- package/Checkbox.d.ts +1 -1
- package/Checkbox.js +5 -3
- package/CheckboxButtonsGroup.d.ts +3 -3
- package/CheckboxButtonsGroup.js +7 -5
- package/CheckboxGroup.d.ts +1 -1
- package/CheckboxGroup.js +5 -3
- package/CityBlock.d.ts +1 -1
- package/CityBlock.js +5 -3
- package/ContactBubble.d.ts +1 -1
- package/ContactBubble.js +3 -2
- package/ContentArticle.d.ts +2 -2
- package/ContentArticle.js +8 -5
- package/ContentImage.d.ts +1 -1
- package/ContentImage.js +5 -3
- package/Datepicker.d.ts +2 -1
- package/Datepicker.js +8 -7
- package/ExtraLinks.d.ts +1 -1
- package/ExtraLinks.js +3 -1
- package/FeatureList.d.ts +1 -1
- package/FeatureList.js +3 -1
- package/FieldGroup.d.ts +1 -1
- package/FieldGroup.js +3 -1
- package/FileInput/_FileInput.utils.d.ts +1 -1
- package/FileInput/_FileInput.utils.js +12 -5
- package/FileInput/_FileInputFileList.js +2 -2
- package/FileInput.d.ts +5 -5
- package/FileInput.js +19 -10
- package/Foonote.d.ts +1 -1
- package/Foonote.js +3 -2
- package/FooterBadges.d.ts +1 -1
- package/FooterBadges.js +3 -1
- package/FooterInfo.d.ts +4 -2
- package/FooterInfo.js +7 -2
- package/Footnote.d.ts +1 -1
- package/Footnote.js +3 -1
- package/Form.d.ts +1 -1
- package/Form.js +3 -1
- package/FormField.d.ts +1 -1
- package/FormField.js +3 -1
- package/Gallery/_GalleryItem.d.ts +1 -2
- package/Gallery/_GalleryItem.js +9 -8
- package/Gallery/_GalleryModal.d.ts +2 -2
- package/Gallery/_GalleryModal.js +6 -5
- package/Gallery/_GalleryModalContext.d.ts +2 -2
- package/Gallery/_GalleryModalContext.js +2 -2
- package/Gallery/_GalleryModalItem.d.ts +1 -2
- package/Gallery/_GalleryModalItem.js +4 -3
- package/Gallery.d.ts +1 -1
- package/Gallery.js +10 -8
- package/GridBlocks.d.ts +1 -1
- package/GridBlocks.js +5 -3
- package/Heading.d.ts +3 -2
- package/Heading.js +5 -2
- package/HeroBlock.d.ts +1 -1
- package/HeroBlock.js +5 -3
- package/IframeBlock.d.ts +3 -1
- package/IframeBlock.js +5 -3
- package/Illustration.d.ts +5 -8
- package/Illustration.js +5 -3
- package/ImageCards.d.ts +3 -3
- package/ImageCards.js +3 -1
- package/InfoBlock.d.ts +8 -12
- package/InfoBlock.js +4 -2
- package/InfoHero.d.ts +1 -1
- package/InfoHero.js +9 -7
- package/IslandBlock.d.ts +1 -1
- package/IslandBlock.js +5 -3
- package/IslandPageBlock.d.ts +1 -1
- package/IslandPageBlock.js +5 -3
- package/LabeledTextBlock.d.ts +1 -1
- package/LabeledTextBlock.js +3 -1
- package/Layout.d.ts +2 -2
- package/Layout.js +5 -4
- package/MainMenu.d.ts +1 -1
- package/MainMenu.js +10 -6
- package/MiniMetrics.d.ts +1 -1
- package/MiniMetrics.js +5 -3
- package/Modal.d.ts +2 -4
- package/Modal.js +3 -1
- package/NameCard.d.ts +1 -1
- package/NameCard.js +7 -5
- package/NameCards.d.ts +1 -1
- package/NameCards.js +3 -1
- package/NewsHero.d.ts +1 -1
- package/NewsHero.js +6 -4
- package/PageFilter.d.ts +1 -1
- package/PageFilter.js +3 -1
- package/PageHeading.d.ts +1 -1
- package/PageHeading.js +3 -1
- package/Picture.d.ts +1 -1
- package/Picture.js +5 -3
- package/ProcessOverview.d.ts +1 -1
- package/ProcessOverview.js +3 -1
- package/PullQuote.d.ts +1 -1
- package/PullQuote.js +3 -1
- package/README.md +6 -1
- package/RadioButtonsGroup.d.ts +3 -3
- package/RadioButtonsGroup.js +7 -5
- package/RadioGroup.d.ts +4 -2
- package/RadioGroup.js +9 -6
- package/RelatedLinks.d.ts +1 -1
- package/RelatedLinks.js +3 -1
- package/RowBlock.d.ts +1 -1
- package/RowBlock.js +3 -1
- package/RowBlockColumn.d.ts +1 -1
- package/RowBlockColumn.js +3 -1
- package/SearchInput.d.ts +2 -2
- package/SearchInput.js +4 -2
- package/SearchResults/_SearchResultsItem.d.ts +2 -2
- package/SearchResults/_SearchResultsItem.js +4 -3
- package/SearchResults.d.ts +1 -1
- package/SearchResults.js +7 -6
- package/SeenEffect.d.ts +1 -1
- package/SeenEffect.js +3 -1
- package/Selectbox.d.ts +1 -1
- package/Selectbox.js +15 -9
- package/ShareButtons.d.ts +2 -2
- package/ShareButtons.js +15 -8
- package/Sharpie.d.ts +1 -1
- package/Sharpie.js +3 -1
- package/SiteSearchAutocomplete.d.ts +2 -2
- package/SiteSearchAutocomplete.js +4 -3
- package/SiteSearchCurtain.d.ts +1 -1
- package/SiteSearchCurtain.js +3 -1
- package/SiteSearchInput.d.ts +2 -2
- package/SiteSearchInput.js +3 -2
- package/Skeleton.d.ts +1 -1
- package/Skeleton.js +5 -3
- package/SubHeading.d.ts +1 -1
- package/SubHeading.js +3 -1
- package/Tabs.d.ts +1 -1
- package/Tabs.js +4 -2
- package/TagPill.d.ts +1 -1
- package/TagPill.js +6 -4
- package/TextBlock.d.ts +1 -1
- package/TextBlock.js +3 -1
- package/TextButton.d.ts +1 -1
- package/TextButton.js +5 -3
- package/TextInput.d.ts +2 -2
- package/TextInput.js +3 -1
- package/VSpacer.d.ts +1 -1
- package/VSpacer.js +3 -1
- package/VerticalTabsTOC.d.ts +1 -1
- package/VerticalTabsTOC.js +3 -1
- package/WizardLayout.d.ts +4 -4
- package/WizardLayout.js +5 -3
- package/WizardLayoutClose.d.ts +1 -1
- package/WizardLayoutClose.js +5 -3
- package/WizardStepper.d.ts +2 -2
- package/WizardStepper.js +5 -2
- package/_abstract/_AbstractCarousel.d.ts +12 -5
- package/_abstract/_AbstractCarousel.js +8 -3
- package/_abstract/_Blings.d.ts +2 -2
- package/_abstract/_Blings.js +2 -1
- package/_abstract/_Block.d.ts +1 -2
- package/_abstract/_Block.js +6 -5
- package/_abstract/_Button.d.ts +2 -2
- package/_abstract/_Button.js +2 -1
- package/_abstract/_CardList.js +4 -4
- package/_abstract/_Image.d.ts +2 -2
- package/_abstract/_Image.js +2 -1
- package/_abstract/_TogglerGroup.d.ts +2 -3
- package/_abstract/_TogglerGroup.js +2 -1
- package/_abstract/_TogglerGroupField.d.ts +2 -2
- package/_abstract/_TogglerGroupField.js +4 -3
- package/_abstract/_TogglerInput.d.ts +3 -3
- package/_abstract/_TogglerInput.js +2 -1
- package/_abstract/breakOnNL.d.ts +1 -2
- package/_abstract/breakOnNL.js +2 -1
- package/assets.js +1 -1
- package/constants.d.ts +8 -28
- package/focus-visible.js +2 -0
- package/package.json +4 -4
package/WizardLayout.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
3
|
-
import { HannaColorTheme } from '@reykjavik/hanna-css';
|
|
3
|
+
import type { HannaColorTheme } from '@reykjavik/hanna-css';
|
|
4
4
|
declare type WizardLayoutProps = {
|
|
5
|
-
wizardStepper?: ReactNode;
|
|
6
|
-
wizardFooter?: ReactNode;
|
|
5
|
+
wizardStepper?: ReactNode | false;
|
|
6
|
+
wizardFooter?: ReactNode | false;
|
|
7
7
|
colorTheme?: HannaColorTheme;
|
|
8
8
|
siteName?: string;
|
|
9
9
|
logoLink?: string;
|
|
@@ -11,5 +11,5 @@ declare type WizardLayoutProps = {
|
|
|
11
11
|
ssr?: SSRSupport;
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
};
|
|
14
|
-
declare const WizardLayout: (props: WizardLayoutProps) => JSX.Element;
|
|
14
|
+
export declare const WizardLayout: (props: WizardLayoutProps) => JSX.Element;
|
|
15
15
|
export default WizardLayout;
|
package/WizardLayout.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WizardLayout = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const hooks_1 = require("@hugsmidjan/react/hooks");
|
|
6
7
|
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
7
|
-
const _Image_1 =
|
|
8
|
+
const _Image_1 = require("./_abstract/_Image");
|
|
8
9
|
const _Link_1 = require("./_abstract/_Link");
|
|
9
10
|
const useScrollbarWidthCSSVar_1 = require("./utils/useScrollbarWidthCSSVar");
|
|
10
11
|
const WizardLayout = (props) => {
|
|
@@ -19,7 +20,7 @@ const WizardLayout = (props) => {
|
|
|
19
20
|
react_1.default.createElement("div", { className: "WizardLayout__header", role: "banner" },
|
|
20
21
|
react_1.default.createElement(_Link_1.Link, { className: "WizardLayout__header__logo", href: logoLink },
|
|
21
22
|
' ',
|
|
22
|
-
react_1.default.createElement(_Image_1.
|
|
23
|
+
react_1.default.createElement(_Image_1.Image, { className: undefined, inline: true, src: (0, assets_1.getAssetUrl)('reykjavik-logo.svg') }),
|
|
23
24
|
' ',
|
|
24
25
|
siteName,
|
|
25
26
|
' '),
|
|
@@ -30,4 +31,5 @@ const WizardLayout = (props) => {
|
|
|
30
31
|
react_1.default.createElement("div", { className: "WizardLayout__deco WizardLayout__deco--geometry" })),
|
|
31
32
|
react_1.default.createElement("div", { className: "WizardLayout__footer", role: "complementary" }, wizardFooter))));
|
|
32
33
|
};
|
|
33
|
-
exports.
|
|
34
|
+
exports.WizardLayout = WizardLayout;
|
|
35
|
+
exports.default = exports.WizardLayout;
|
package/WizardLayoutClose.d.ts
CHANGED
package/WizardLayoutClose.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WizardLayoutClose = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
-
const _Button_1 =
|
|
6
|
-
const WizardLayoutClose = (props) => (react_1.default.createElement(_Button_1.
|
|
7
|
-
exports.
|
|
6
|
+
const _Button_1 = require("./_abstract/_Button");
|
|
7
|
+
const WizardLayoutClose = (props) => (react_1.default.createElement(_Button_1.Button, Object.assign({ bem: "WizardLayoutClose" }, props)));
|
|
8
|
+
exports.WizardLayoutClose = WizardLayoutClose;
|
|
9
|
+
exports.default = exports.WizardLayoutClose;
|
package/WizardStepper.d.ts
CHANGED
|
@@ -26,11 +26,11 @@ export declare type WizardStepperProps = {
|
|
|
26
26
|
steps: ReadonlyArray<WizardStepperStep>;
|
|
27
27
|
/** Zero-based index of the active (current) step */
|
|
28
28
|
activeStep?: number;
|
|
29
|
-
/** By default, clickable
|
|
29
|
+
/** By default, clickable steps remain clickable once "done" */
|
|
30
30
|
disableBacktrack?: boolean;
|
|
31
31
|
/** By default, clickable steps after the active step are not immediately clickable */
|
|
32
32
|
allowForwardSkip?: boolean;
|
|
33
33
|
onClick: (clickedIndex: number) => void;
|
|
34
34
|
};
|
|
35
|
-
declare const WizardStepper: (props: WizardStepperProps) => JSX.Element;
|
|
35
|
+
export declare const WizardStepper: (props: WizardStepperProps) => JSX.Element;
|
|
36
36
|
export default WizardStepper;
|
package/WizardStepper.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WizardStepper = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
6
7
|
const WizardStepper = (props) => {
|
|
7
8
|
const { steps, activeStep = -1, allowForwardSkip, disableBacktrack, onClick } = props;
|
|
8
9
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('WizardStepper', activeStep === -1 && 'preview') }, steps.map((step, i) => {
|
|
9
|
-
const {
|
|
10
|
+
const { clickable, done, neutral } = step;
|
|
11
|
+
const label = step.label || '…';
|
|
10
12
|
const stepClass = (0, getBemClass_1.default)('WizardStepper__step', [
|
|
11
13
|
(done || (done == null && i < activeStep)) && 'done',
|
|
12
14
|
neutral && 'neutral',
|
|
@@ -25,4 +27,5 @@ const WizardStepper = (props) => {
|
|
|
25
27
|
' '));
|
|
26
28
|
})));
|
|
27
29
|
};
|
|
28
|
-
exports.
|
|
30
|
+
exports.WizardStepper = WizardStepper;
|
|
31
|
+
exports.default = exports.WizardStepper;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
3
3
|
import { BemProps } from '@hugsmidjan/react/types';
|
|
4
4
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
@@ -13,10 +13,17 @@ export declare type CarouselProps<I extends Record<string, unknown> = {}, P exte
|
|
|
13
13
|
Component: (props: P extends undefined ? I : I & P) => ReactElement | null;
|
|
14
14
|
ComponentProps?: P;
|
|
15
15
|
}, {
|
|
16
|
-
children:
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Explicit number of items contained by the `children` prop
|
|
19
|
+
*
|
|
20
|
+
* Use this when your returned child elements are wrapped in a
|
|
21
|
+
* `<Fragment />` or some such.
|
|
22
|
+
*/
|
|
23
|
+
itemCount?: number;
|
|
17
24
|
}> & SeenProp;
|
|
18
|
-
declare type AbstractCarouselProps<I extends Record<string, unknown> =
|
|
25
|
+
declare type AbstractCarouselProps<I extends Record<string, unknown> = Record<string, unknown>, P extends Record<string, unknown> | undefined = Record<string, unknown>> = CarouselProps<I, P> & BemProps & {
|
|
19
26
|
title?: string;
|
|
20
27
|
};
|
|
21
|
-
declare const AbstractCarousel: <I extends Record<string, unknown> =
|
|
22
|
-
export
|
|
28
|
+
export declare const AbstractCarousel: <I extends Record<string, unknown> = Record<string, unknown>, P extends Record<string, unknown> | undefined = Record<string, unknown>>(props: AbstractCarouselProps<I, P>) => JSX.Element | null;
|
|
29
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractCarousel = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
6
|
const A_1 = tslib_1.__importDefault(require("@hugsmidjan/qj/A"));
|
|
@@ -24,9 +25,13 @@ const scrollXBy = (elm, deltaX) => {
|
|
|
24
25
|
};
|
|
25
26
|
const AbstractCarousel = (props) => {
|
|
26
27
|
const { title, items = [], Component, ComponentProps, bem = 'Carousel', modifier, ssr, startSeen, } = props;
|
|
27
|
-
const children = props.children
|
|
28
|
+
const children = !props.children
|
|
29
|
+
? undefined
|
|
30
|
+
: Array.isArray(props.children)
|
|
31
|
+
? props.children.filter(hanna_utils_1.notNully)
|
|
32
|
+
: [props.children];
|
|
28
33
|
const [leftOffset, setLeftOffset] = (0, react_1.useState)();
|
|
29
|
-
const itemCount = (children || items).length;
|
|
34
|
+
const itemCount = props.itemCount || (children || items).length;
|
|
30
35
|
const listRef = (0, react_1.useRef)(null);
|
|
31
36
|
const [activeItem, setActiveItem] = (0, react_1.useState)(0);
|
|
32
37
|
const isBrowser = (0, hooks_1.useIsBrowserSide)(ssr);
|
|
@@ -105,4 +110,4 @@ const AbstractCarousel = (props) => {
|
|
|
105
110
|
}, onMouseOver: () => delayedScrollRight(activeItem), onMouseOut: () => delayedScrollRight.cancel() })))) : (itemList),
|
|
106
111
|
isBrowser && (react_1.default.createElement(CarouselStepper_1.default, { itemCount: itemCount, setCurrent: scrollToItem, current: activeItem }))));
|
|
107
112
|
};
|
|
108
|
-
exports.
|
|
113
|
+
exports.AbstractCarousel = AbstractCarousel;
|
package/_abstract/_Blings.d.ts
CHANGED
package/_abstract/_Blings.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Blings = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const Bling_1 = tslib_1.__importDefault(require("../Bling"));
|
|
@@ -12,4 +13,4 @@ const inverseAlignments = {
|
|
|
12
13
|
right: 'left',
|
|
13
14
|
};
|
|
14
15
|
const Blings = (props) => (react_1.default.createElement(react_1.default.Fragment, null, props.blings.map(({ type, align, vertical, color, overlay, parent }, i) => (react_1.default.createElement(Bling_1.default, { key: type + '-' + i, type: type, align: props.mirror ? inverseAlignments[align || 'left'] : align, vertical: vertical, color: color, overlay: overlay, parent: parent })))));
|
|
15
|
-
exports.
|
|
16
|
+
exports.Blings = Blings;
|
package/_abstract/_Block.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ export declare type ContentBlock = {
|
|
|
16
16
|
image?: undefined;
|
|
17
17
|
} & SeenProp;
|
|
18
18
|
export declare type BlockProps = BemPropsModifier & (ContentBlock | ContentImageBlock);
|
|
19
|
-
declare const Block: (props: BlockProps & {
|
|
19
|
+
export declare const Block: (props: BlockProps & {
|
|
20
20
|
bem: string;
|
|
21
21
|
}) => JSX.Element;
|
|
22
|
-
export default Block;
|
package/_abstract/_Block.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Block = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
6
7
|
const seenEffect_1 = require("../utils/seenEffect");
|
|
7
|
-
const _Button_1 =
|
|
8
|
-
const _Image_1 =
|
|
8
|
+
const _Button_1 = require("./_Button");
|
|
9
|
+
const _Image_1 = require("./_Image");
|
|
9
10
|
const Block = (props) => {
|
|
10
11
|
const { image, modifier, bem, content, startSeen } = props;
|
|
11
12
|
const [ref] = (0, seenEffect_1.useSeenEffect)(startSeen);
|
|
@@ -19,9 +20,9 @@ const Block = (props) => {
|
|
|
19
20
|
buttons.length > 0 && (react_1.default.createElement("div", { className: `${bem}__buttons` },
|
|
20
21
|
' ',
|
|
21
22
|
buttons.map((buttonProps, i) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
22
|
-
react_1.default.createElement(_Button_1.
|
|
23
|
+
react_1.default.createElement(_Button_1.Button, Object.assign({ bem: `${bem}__button`, key: i }, buttonProps)),
|
|
23
24
|
' ')))))));
|
|
24
25
|
}),
|
|
25
|
-
image && react_1.default.createElement(_Image_1.
|
|
26
|
+
image && react_1.default.createElement(_Image_1.Image, Object.assign({ className: `${bem}__image` }, image))));
|
|
26
27
|
};
|
|
27
|
-
exports.
|
|
28
|
+
exports.Block = Block;
|
package/_abstract/_Button.d.ts
CHANGED
|
@@ -36,5 +36,5 @@ export declare type ButtonVariantProps = {
|
|
|
36
36
|
declare type _ButtonProps = ButtonProps & ButtonVariantProps & BemProps & {
|
|
37
37
|
children?: ReactNode;
|
|
38
38
|
};
|
|
39
|
-
declare const Button: (props: _ButtonProps) => JSX.Element;
|
|
40
|
-
export
|
|
39
|
+
export declare const Button: (props: _ButtonProps) => JSX.Element;
|
|
40
|
+
export {};
|
package/_abstract/_Button.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
@@ -36,4 +37,4 @@ const Button = (props) => {
|
|
|
36
37
|
return (react_1.default.createElement("button", Object.assign({ className: className, type: "button" }, buttonProps, { style: undefined }, iconProp), label));
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
|
-
exports.
|
|
40
|
+
exports.Button = Button;
|
package/_abstract/_CardList.js
CHANGED
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CardList = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const _Button_1 =
|
|
7
|
-
const _Image_1 =
|
|
6
|
+
const _Button_1 = require("./_Button");
|
|
7
|
+
const _Image_1 = require("./_Image");
|
|
8
8
|
const Card = (props) => {
|
|
9
9
|
const { bem, href, title, imgPlaceholder, image, meta, summary } = props;
|
|
10
10
|
const cardClass = `${bem}__card`;
|
|
11
11
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
|
-
react_1.default.createElement(_Button_1.
|
|
12
|
+
react_1.default.createElement(_Button_1.Button, { bem: cardClass, href: href },
|
|
13
13
|
' ',
|
|
14
|
-
react_1.default.createElement(_Image_1.
|
|
14
|
+
react_1.default.createElement(_Image_1.Image, Object.assign({ className: `${bem}__image` }, image, { placeholder: imgPlaceholder })),
|
|
15
15
|
react_1.default.createElement("span", { className: `${cardClass}__title` }, title),
|
|
16
16
|
' ',
|
|
17
17
|
meta && react_1.default.createElement("span", { className: `${cardClass}__meta` }, meta),
|
package/_abstract/_Image.d.ts
CHANGED
|
@@ -32,5 +32,5 @@ declare type _ImageProps = {
|
|
|
32
32
|
*/
|
|
33
33
|
placeholder?: boolean | (() => JSX.Element);
|
|
34
34
|
};
|
|
35
|
-
declare const Image: (props: ImageProps & _ImageProps) => JSX.Element | null;
|
|
36
|
-
export
|
|
35
|
+
export declare const Image: (props: ImageProps & _ImageProps) => JSX.Element | null;
|
|
36
|
+
export {};
|
package/_abstract/_Image.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Image = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
@@ -27,4 +28,4 @@ const Image = (props) => {
|
|
|
27
28
|
react_1.default.createElement("img", { src: imageSrc, alt: altText, loading: imgLoading }),
|
|
28
29
|
' '));
|
|
29
30
|
};
|
|
30
|
-
exports.
|
|
31
|
+
exports.Image = Image;
|
|
@@ -12,7 +12,6 @@ export declare type TogglerGroupProps = {
|
|
|
12
12
|
options: TogglerGroupOptions;
|
|
13
13
|
className?: string;
|
|
14
14
|
name: string;
|
|
15
|
-
children?: undefined;
|
|
16
15
|
disabled?: boolean | ReadonlyArray<number>;
|
|
17
16
|
inputProps?: RestrictedInputProps;
|
|
18
17
|
onSelected?: (payload: {
|
|
@@ -27,5 +26,5 @@ declare type _TogglerGroupProps = {
|
|
|
27
26
|
Toggler: (props: TogglerInputProps) => JSX.Element;
|
|
28
27
|
value?: ReadonlyArray<string>;
|
|
29
28
|
};
|
|
30
|
-
declare const TogglerGroup: (props: TogglerGroupProps & _TogglerGroupProps) => JSX.Element;
|
|
31
|
-
export
|
|
29
|
+
export declare const TogglerGroup: (props: TogglerGroupProps & _TogglerGroupProps) => JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TogglerGroup = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
@@ -31,4 +32,4 @@ const TogglerGroup = (props) => {
|
|
|
31
32
|
: inputProps.onChange, disabled: isDisabled, "aria-invalid": props['aria-invalid'], checked: isChecked })));
|
|
32
33
|
})));
|
|
33
34
|
};
|
|
34
|
-
exports.
|
|
35
|
+
exports.TogglerGroup = TogglerGroup;
|
|
@@ -13,5 +13,5 @@ declare type _TogglerGroupFieldProps = {
|
|
|
13
13
|
} & BemPropsModifier;
|
|
14
14
|
export declare type TogglerGroupFieldOption = TogglerGroupOption;
|
|
15
15
|
export declare type TogglerGroupFieldOptions = TogglerGroupOptions;
|
|
16
|
-
declare const TogglerGroupField: (props: TogglerGroupFieldProps & _TogglerGroupFieldProps) => JSX.Element;
|
|
17
|
-
export
|
|
16
|
+
export declare const TogglerGroupField: (props: TogglerGroupFieldProps & _TogglerGroupFieldProps) => JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TogglerGroupField = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
6
7
|
const FormField_1 = tslib_1.__importDefault(require("../FormField"));
|
|
7
|
-
const _TogglerGroup_1 =
|
|
8
|
+
const _TogglerGroup_1 = require("./_TogglerGroup");
|
|
8
9
|
const TogglerGroupField = (props) => {
|
|
9
10
|
const { bem, Toggler, className, modifier, label, LabelTag, assistText, hideLabel, disabled, readOnly, invalid, errorMessage, required, reqText, id, value } = props, togglerGroupProps = tslib_1.__rest(props, ["bem", "Toggler", "className", "modifier", "label", "LabelTag", "assistText", "hideLabel", "disabled", "readOnly", "invalid", "errorMessage", "required", "reqText", "id", "value"]);
|
|
10
11
|
return (react_1.default.createElement(FormField_1.default, { className: (0, getBemClass_1.default)(bem, modifier, className), group: true, label: label, LabelTag: LabelTag, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps) => {
|
|
11
|
-
return (react_1.default.createElement(_TogglerGroup_1.
|
|
12
|
+
return (react_1.default.createElement(_TogglerGroup_1.TogglerGroup, Object.assign({ bem: className.options }, inputProps, togglerGroupProps, { value: Array.isArray(value) ? value : value != null ? [value] : undefined, Toggler: Toggler })));
|
|
12
13
|
} }));
|
|
13
14
|
};
|
|
14
|
-
exports.
|
|
15
|
+
exports.TogglerGroupField = TogglerGroupField;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BemPropsModifier } from '@hugsmidjan/react/types';
|
|
2
2
|
export declare type TogglerInputProps = {
|
|
3
3
|
label: string | JSX.Element;
|
|
4
|
-
children?:
|
|
4
|
+
children?: never;
|
|
5
5
|
Wrapper?: 'div' | 'li';
|
|
6
6
|
invalid?: boolean;
|
|
7
7
|
/** Hidden label prefix text to indicate that the field is required.
|
|
@@ -18,5 +18,5 @@ declare type _TogglerInputProps = {
|
|
|
18
18
|
bem: string;
|
|
19
19
|
type: 'radio' | 'checkbox';
|
|
20
20
|
};
|
|
21
|
-
declare const TogglerInput: (props: TogglerInputProps & _TogglerInputProps) => JSX.Element;
|
|
22
|
-
export
|
|
21
|
+
export declare const TogglerInput: (props: TogglerInputProps & _TogglerInputProps) => JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TogglerInput = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const hooks_1 = require("@hugsmidjan/react/hooks");
|
|
@@ -22,4 +23,4 @@ const TogglerInput = (props) => {
|
|
|
22
23
|
' '),
|
|
23
24
|
errorMessage && (react_1.default.createElement("div", { className: bem + '__error', id: errorId }, errorMessage))));
|
|
24
25
|
};
|
|
25
|
-
exports.
|
|
26
|
+
exports.TogglerInput = TogglerInput;
|
package/_abstract/breakOnNL.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const breakOnNL: (text: string | undefined) => "" | (string | JSX.Element)[] | undefined;
|
|
2
|
-
export default breakOnNL;
|
|
1
|
+
export declare const breakOnNL: (text: string | undefined) => "" | (string | JSX.Element)[] | undefined;
|
package/_abstract/breakOnNL.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.breakOnNL = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const breakOnNL = (text) => text &&
|
|
@@ -8,4 +9,4 @@ const breakOnNL = (text) => text &&
|
|
|
8
9
|
.replace(/(?:\n\s*)+/g, '\n\n')
|
|
9
10
|
.split(/\n/)
|
|
10
11
|
.map((bit) => bit || react_1.default.createElement("br", null));
|
|
11
|
-
exports.
|
|
12
|
+
exports.breakOnNL = breakOnNL;
|
package/assets.js
CHANGED
|
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "illustrations", { enumerable: true, get: functio
|
|
|
14
14
|
/** @deprecated Use `getCssBundleUrl` from '@reykjavik/hanna-css' instead (Will be reomved in v0.11) */
|
|
15
15
|
const getCssBundleUrl = (cssTokens,
|
|
16
16
|
/** If you want to pin your CSS files to a specific version */
|
|
17
|
-
version) => (0, hanna_css_1.getCssBundleUrl)(cssTokens, { version });
|
|
17
|
+
version) => (0, hanna_css_1.getCssBundleUrl)(cssTokens, { version: version });
|
|
18
18
|
exports.getCssBundleUrl = getCssBundleUrl;
|
|
19
19
|
// ---------------------------------------------------------------------------
|
|
20
20
|
// Based on "https://styles.reykjavik.is/assets/efnistakn/menu/files.json"
|
package/constants.d.ts
CHANGED
|
@@ -1,39 +1,19 @@
|
|
|
1
|
+
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
1
2
|
/** @depcrecated import `colorFamilies` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
2
|
-
export declare const colorFamilies: readonly ["esja", "faxafloi", "nautholsvik", "heidmork", "ellidaardalur", "blafjoll", "sund", "rokkur", "suld"] & {
|
|
3
|
-
readonly esja: "esja";
|
|
4
|
-
readonly faxafloi: "faxafloi";
|
|
5
|
-
readonly nautholsvik: "nautholsvik";
|
|
6
|
-
readonly heidmork: "heidmork";
|
|
7
|
-
readonly ellidaardalur: "ellidaardalur";
|
|
8
|
-
readonly blafjoll: "blafjoll";
|
|
9
|
-
readonly sund: "sund";
|
|
10
|
-
readonly rokkur: "rokkur";
|
|
11
|
-
readonly suld: "suld";
|
|
12
|
-
} & {
|
|
3
|
+
export declare const colorFamilies: readonly ["esja", "faxafloi", "nautholsvik", "heidmork", "ellidaardalur", "blafjoll", "sund", "rokkur", "suld"] & Readonly<Record<import("@reykjavik/hanna-css").ColorFamily, import("@reykjavik/hanna-css").ColorFamily>> & {
|
|
13
4
|
/** @deprecated This is a typo (Will be removed in v0.11) */
|
|
14
5
|
ellidarardalur: string;
|
|
15
6
|
};
|
|
16
7
|
/** @depcrecated import type `ColorFamily` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
17
8
|
export type { ColorFamily } from '@reykjavik/hanna-css';
|
|
18
9
|
/** @depcrecated import `colorThemes` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
19
|
-
export declare const themeOptions: readonly ["trustworthy", "dependable", "friendly", "lively", "colorful"] &
|
|
20
|
-
readonly trustworthy: "trustworthy";
|
|
21
|
-
readonly dependable: "dependable";
|
|
22
|
-
readonly friendly: "friendly";
|
|
23
|
-
readonly lively: "lively";
|
|
24
|
-
readonly colorful: "colorful";
|
|
25
|
-
};
|
|
10
|
+
export declare const themeOptions: readonly ["trustworthy", "dependable", "friendly", "lively", "colorful"] & Readonly<Record<import("@reykjavik/hanna-css").HannaColorTheme, import("@reykjavik/hanna-css").HannaColorTheme>>;
|
|
26
11
|
/** @depcrecated import type `HannaColorTheme` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
27
12
|
export type { HannaColorTheme as ThemeOption } from '@reykjavik/hanna-css';
|
|
28
13
|
export declare type Alignment = 'right' | 'left';
|
|
29
14
|
export declare const aligns: Record<string, true | undefined>;
|
|
30
|
-
export declare type ComponentLayoutProps<Align extends string = 'right'> = {
|
|
31
|
-
wide?:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
align?: undefined;
|
|
36
|
-
} | {
|
|
37
|
-
wide?: undefined;
|
|
38
|
-
align: Align;
|
|
39
|
-
};
|
|
15
|
+
export declare type ComponentLayoutProps<Align extends string = 'right'> = EitherObj<{
|
|
16
|
+
wide?: boolean;
|
|
17
|
+
}, {
|
|
18
|
+
align?: Align;
|
|
19
|
+
}>;
|
package/focus-visible.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// expose `focus-visible` to consumers of `@reykjavik/hanna-react`
|
|
4
|
+
// without requiring them to install it as a dependency in their project.
|
|
3
5
|
require("@reykjavik/hanna-utils/focus-visible");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reykjavik/hanna-react",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.72",
|
|
4
4
|
"author": "Reykjavík (http://www.reykjavik.is)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Hugsmiðjan ehf (http://www.hugsmidjan.is)",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@hugsmidjan/qj": "^4.10.2",
|
|
17
|
-
"@hugsmidjan/react": "^0.4.
|
|
18
|
-
"@reykjavik/hanna-css": "^0.3.
|
|
19
|
-
"@reykjavik/hanna-utils": "^0.1.
|
|
17
|
+
"@hugsmidjan/react": "^0.4.20",
|
|
18
|
+
"@reykjavik/hanna-css": "^0.3.10",
|
|
19
|
+
"@reykjavik/hanna-utils": "^0.1.17",
|
|
20
20
|
"@types/react": "^17.0.24",
|
|
21
21
|
"@types/react-autosuggest": "^10.1.0",
|
|
22
22
|
"@types/react-datepicker": "^3.0.2",
|