@reykjavik/hanna-react 0.10.56 → 0.10.57
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.jsx → AccordionList.js} +5 -14
- package/{ActionCards.jsx → ActionCards.js} +2 -3
- package/{Alert.jsx → Alert.js} +6 -8
- package/ArticleCarousel/_ArticleCarouselCard.js +31 -0
- package/{ArticleCarousel.jsx → ArticleCarousel.js} +1 -1
- package/{ArticleMeta.jsx → ArticleMeta.js} +9 -8
- package/{Attention.jsx → Attention.js} +1 -1
- package/{BasicTable.jsx → BasicTable.js} +11 -12
- package/{Bling.jsx → Bling.js} +2 -2
- package/{BlockBreak.jsx → BlockBreak.js} +1 -1
- package/{BlockQuote.jsx → BlockQuote.js} +1 -1
- package/BreadCrumbs.js +33 -0
- package/{ButtonBack.jsx → ButtonBack.js} +1 -1
- package/{ButtonBar.jsx → ButtonBar.js} +2 -4
- package/{ButtonPrimary.jsx → ButtonPrimary.js} +1 -1
- package/{ButtonSecondary.jsx → ButtonSecondary.js} +1 -1
- package/{ButtonTertiary.jsx → ButtonTertiary.js} +1 -1
- package/CHANGELOG.md +1 -1
- package/{Carousel.jsx → Carousel.js} +1 -1
- package/{CarouselStepper.jsx → CarouselStepper.js} +1 -1
- package/{CenterColumn.jsx → CenterColumn.js} +1 -3
- package/{Checkbox.jsx → Checkbox.js} +1 -1
- package/{CheckboxButtonsGroup.jsx → CheckboxButtonsGroup.js} +2 -2
- package/{CheckboxGroup.jsx → CheckboxGroup.js} +1 -1
- package/{CityBlock.jsx → CityBlock.js} +1 -1
- package/{ContactBubble.jsx → ContactBubble.js} +12 -26
- package/{ContentArticle.jsx → ContentArticle.js} +9 -12
- package/ContentImage.js +23 -0
- package/{Datepicker.jsx → Datepicker.js} +17 -18
- package/{ExtraLinks.jsx → ExtraLinks.js} +9 -17
- package/FeatureList.js +21 -0
- package/{FieldGroup.jsx → FieldGroup.js} +3 -4
- package/{FileInput.jsx → FileInput.js} +22 -25
- package/{Foonote.jsx → Foonote.js} +0 -0
- package/FooterBadges.js +17 -0
- package/FooterInfo.js +14 -0
- package/{Footnote.jsx → Footnote.js} +1 -1
- package/{Form.jsx → Form.js} +2 -4
- package/{FormField.jsx → FormField.js} +20 -22
- package/Gallery/{_GalleryItem.jsx → _GalleryItem.js} +8 -9
- package/Gallery/{_GalleryModal.jsx → _GalleryModal.js} +11 -15
- package/Gallery/{_GalleryModalItem.jsx → _GalleryModalItem.js} +5 -7
- package/{Gallery.jsx → Gallery.js} +3 -4
- package/GridBlocks.js +29 -0
- package/{Heading.jsx → Heading.js} +2 -4
- package/{HeroBlock.jsx → HeroBlock.js} +8 -9
- package/{IframeBlock.jsx → IframeBlock.js} +6 -6
- package/{Illustration.jsx → Illustration.js} +1 -1
- package/{ImageCards.jsx → ImageCards.js} +2 -3
- package/InfoBlock.js +18 -0
- package/{InfoHero.jsx → InfoHero.js} +9 -15
- package/{IslandBlock.jsx → IslandBlock.js} +1 -1
- package/{IslandPageBlock.jsx → IslandPageBlock.js} +1 -1
- package/{LabeledTextBlock.jsx → LabeledTextBlock.js} +5 -7
- package/Layout.js +58 -0
- package/MainMenu/{_Auxiliary.jsx → _Auxiliary.js} +5 -11
- package/MainMenu/_PrimaryPanel.js +29 -0
- package/{MainMenu.jsx → MainMenu.js} +27 -40
- package/{MiniMetrics.jsx → MiniMetrics.js} +5 -4
- package/Modal.js +19 -0
- package/{NameCard.jsx → NameCard.js} +18 -23
- package/{NameCards.jsx → NameCards.js} +1 -3
- package/{NewsHero.jsx → NewsHero.js} +7 -9
- package/{PageFilter.jsx → PageFilter.js} +6 -7
- package/{PageHeading.jsx → PageHeading.js} +2 -4
- package/ProcessOverview.js +22 -0
- package/{PullQuote.jsx → PullQuote.js} +1 -1
- package/{RadioButtonsGroup.jsx → RadioButtonsGroup.js} +2 -2
- package/{RadioGroup.jsx → RadioGroup.js} +2 -2
- package/{RelatedLinks.jsx → RelatedLinks.js} +9 -13
- package/{RowBlock.jsx → RowBlock.js} +1 -3
- package/{RowBlockColumn.jsx → RowBlockColumn.js} +2 -4
- package/{SearchInput.jsx → SearchInput.js} +4 -6
- package/SearchResults/_SearchResultsItem.js +20 -0
- package/{SearchResults.jsx → SearchResults.js} +27 -36
- package/{SeenEffect.jsx → SeenEffect.js} +1 -1
- package/{Selectbox.jsx → Selectbox.js} +1 -1
- package/{ShareButtons.jsx → ShareButtons.js} +6 -12
- package/{Sharpie.jsx → Sharpie.js} +1 -1
- package/{SiteSearchAutocomplete.jsx → SiteSearchAutocomplete.js} +5 -7
- package/{SiteSearchCurtain.jsx → SiteSearchCurtain.js} +1 -5
- package/{SiteSearchInput.jsx → SiteSearchInput.js} +10 -12
- package/{Skeleton.jsx → Skeleton.js} +5 -5
- package/{SubHeading.jsx → SubHeading.js} +2 -4
- package/{Tabs.jsx → Tabs.js} +12 -12
- package/{TagPill.jsx → TagPill.js} +11 -16
- package/{TextBlock.jsx → TextBlock.js} +2 -4
- package/{TextButton.jsx → TextButton.js} +1 -1
- package/{TextInput.jsx → TextInput.js} +1 -1
- package/{VSpacer.jsx → VSpacer.js} +1 -1
- package/{VerticalTabsTOC.jsx → VerticalTabsTOC.js} +2 -2
- package/WizardLayout.js +35 -0
- package/{WizardLayoutClose.jsx → WizardLayoutClose.js} +1 -1
- package/WizardStepper.js +30 -0
- package/_abstract/{Button.jsx → Button.js} +2 -6
- package/_abstract/CardList.js +43 -0
- package/_abstract/{Image.jsx → Image.js} +10 -12
- package/_abstract/{Link.jsx → Link.js} +0 -0
- package/_abstract/TogglerGroup.js +34 -0
- package/_abstract/{TogglerGroupField.jsx → TogglerGroupField.js} +3 -3
- package/_abstract/{TogglerInput.jsx → TogglerInput.js} +13 -15
- package/_abstract/{_AbstractCarousel.jsx → _AbstractCarousel.js} +7 -10
- package/_abstract/{_Blings.jsx → _Blings.js} +1 -3
- package/_abstract/_Block.js +29 -0
- package/_abstract/{_Quote.jsx → _Quote.js} +3 -6
- package/_abstract/{breakOnNL.jsx → breakOnNL.js} +1 -1
- package/esm/AccordionList.js +24 -0
- package/esm/{ActionCards.jsx → ActionCards.js} +2 -3
- package/esm/{Alert.jsx → Alert.js} +6 -8
- package/esm/ArticleCarousel/_ArticleCarouselCard.js +24 -0
- package/esm/{ArticleCarousel.jsx → ArticleCarousel.js} +1 -1
- package/esm/ArticleMeta.js +18 -0
- package/esm/Attention.js +4 -0
- package/esm/{BasicTable.jsx → BasicTable.js} +11 -12
- package/esm/{Bling.jsx → Bling.js} +2 -2
- package/esm/BlockBreak.js +6 -0
- package/esm/BlockQuote.js +4 -0
- package/esm/BreadCrumbs.js +28 -0
- package/esm/ButtonBack.js +4 -0
- package/esm/{ButtonBar.jsx → ButtonBar.js} +2 -4
- package/esm/ButtonPrimary.js +4 -0
- package/esm/ButtonSecondary.js +4 -0
- package/esm/{ButtonTertiary.jsx → ButtonTertiary.js} +1 -1
- package/esm/Carousel.js +4 -0
- package/esm/CarouselStepper.js +4 -0
- package/esm/CenterColumn.js +7 -0
- package/esm/Checkbox.js +4 -0
- package/esm/{CheckboxButtonsGroup.jsx → CheckboxButtonsGroup.js} +2 -2
- package/esm/{CheckboxGroup.jsx → CheckboxGroup.js} +1 -1
- package/esm/{CityBlock.jsx → CityBlock.js} +1 -1
- package/esm/{ContactBubble.jsx → ContactBubble.js} +12 -26
- package/esm/ContentArticle.js +21 -0
- package/esm/ContentImage.js +18 -0
- package/esm/{Datepicker.jsx → Datepicker.js} +17 -18
- package/esm/{ExtraLinks.jsx → ExtraLinks.js} +9 -17
- package/esm/FeatureList.js +16 -0
- package/esm/FieldGroup.js +9 -0
- package/esm/{FileInput.jsx → FileInput.js} +22 -25
- package/esm/{Foonote.jsx → Foonote.js} +0 -0
- package/esm/FooterBadges.js +12 -0
- package/esm/FooterInfo.js +9 -0
- package/esm/Footnote.js +3 -0
- package/esm/{Form.jsx → Form.js} +2 -4
- package/esm/{FormField.jsx → FormField.js} +20 -22
- package/esm/Gallery/{_GalleryItem.jsx → _GalleryItem.js} +8 -9
- package/esm/Gallery/{_GalleryModal.jsx → _GalleryModal.js} +11 -15
- package/esm/Gallery/{_GalleryModalItem.jsx → _GalleryModalItem.js} +5 -7
- package/esm/{Gallery.jsx → Gallery.js} +3 -4
- package/esm/GridBlocks.js +24 -0
- package/esm/{Heading.jsx → Heading.js} +2 -4
- package/esm/HeroBlock.js +21 -0
- package/esm/{IframeBlock.jsx → IframeBlock.js} +6 -6
- package/esm/{Illustration.jsx → Illustration.js} +1 -1
- package/esm/{ImageCards.jsx → ImageCards.js} +2 -3
- package/esm/InfoBlock.js +13 -0
- package/esm/{InfoHero.jsx → InfoHero.js} +9 -15
- package/esm/{IslandBlock.jsx → IslandBlock.js} +1 -1
- package/esm/{IslandPageBlock.jsx → IslandPageBlock.js} +1 -1
- package/esm/LabeledTextBlock.js +14 -0
- package/esm/Layout.js +52 -0
- package/esm/MainMenu/_Auxiliary.js +13 -0
- package/esm/MainMenu/_PrimaryPanel.js +22 -0
- package/esm/{MainMenu.jsx → MainMenu.js} +27 -40
- package/esm/MiniMetrics.js +12 -0
- package/esm/Modal.js +14 -0
- package/esm/{NameCard.jsx → NameCard.js} +18 -23
- package/esm/NameCards.js +7 -0
- package/esm/{NewsHero.jsx → NewsHero.js} +7 -9
- package/esm/PageFilter.js +15 -0
- package/esm/{PageHeading.jsx → PageHeading.js} +2 -4
- package/esm/ProcessOverview.js +17 -0
- package/esm/PullQuote.js +4 -0
- package/esm/{RadioButtonsGroup.jsx → RadioButtonsGroup.js} +2 -2
- package/esm/RadioGroup.js +7 -0
- package/esm/RelatedLinks.js +26 -0
- package/esm/{RowBlock.jsx → RowBlock.js} +1 -3
- package/esm/{RowBlockColumn.jsx → RowBlockColumn.js} +2 -4
- package/esm/{SearchInput.jsx → SearchInput.js} +4 -6
- package/esm/SearchResults/_SearchResultsItem.js +15 -0
- package/esm/{SearchResults.jsx → SearchResults.js} +27 -36
- package/esm/{SeenEffect.jsx → SeenEffect.js} +1 -1
- package/esm/{Selectbox.jsx → Selectbox.js} +1 -1
- package/esm/{ShareButtons.jsx → ShareButtons.js} +6 -12
- package/esm/{Sharpie.jsx → Sharpie.js} +1 -1
- package/esm/{SiteSearchAutocomplete.jsx → SiteSearchAutocomplete.js} +5 -7
- package/esm/{SiteSearchCurtain.jsx → SiteSearchCurtain.js} +1 -5
- package/esm/{SiteSearchInput.jsx → SiteSearchInput.js} +10 -12
- package/esm/{Skeleton.jsx → Skeleton.js} +5 -5
- package/esm/{SubHeading.jsx → SubHeading.js} +2 -4
- package/esm/{Tabs.jsx → Tabs.js} +12 -12
- package/esm/{TagPill.jsx → TagPill.js} +11 -16
- package/esm/{TextBlock.jsx → TextBlock.js} +2 -4
- package/esm/{TextButton.jsx → TextButton.js} +1 -1
- package/esm/{TextInput.jsx → TextInput.js} +1 -1
- package/esm/{VSpacer.jsx → VSpacer.js} +1 -1
- package/esm/{VerticalTabsTOC.jsx → VerticalTabsTOC.js} +2 -2
- package/esm/WizardLayout.js +30 -0
- package/esm/WizardLayoutClose.js +4 -0
- package/esm/WizardStepper.js +25 -0
- package/esm/_abstract/{Button.jsx → Button.js} +2 -6
- package/esm/_abstract/CardList.js +36 -0
- package/esm/_abstract/{Image.jsx → Image.js} +10 -12
- package/esm/_abstract/{Link.jsx → Link.js} +0 -0
- package/esm/_abstract/TogglerGroup.js +29 -0
- package/esm/_abstract/{TogglerGroupField.jsx → TogglerGroupField.js} +3 -3
- package/esm/_abstract/{TogglerInput.jsx → TogglerInput.js} +13 -15
- package/esm/_abstract/{_AbstractCarousel.jsx → _AbstractCarousel.js} +7 -10
- package/esm/_abstract/_Blings.js +12 -0
- package/esm/_abstract/_Block.js +24 -0
- package/esm/_abstract/_Quote.js +8 -0
- package/esm/_abstract/{breakOnNL.jsx → breakOnNL.js} +1 -1
- package/package.json +91 -91
- package/ArticleCarousel/_ArticleCarouselCard.jsx +0 -32
- package/BreadCrumbs.jsx +0 -36
- package/ContentImage.jsx +0 -18
- package/FeatureList.jsx +0 -28
- package/FooterBadges.jsx +0 -21
- package/FooterInfo.jsx +0 -19
- package/GridBlocks.jsx +0 -40
- package/InfoBlock.jsx +0 -23
- package/Layout.jsx +0 -69
- package/MainMenu/_PrimaryPanel.jsx +0 -37
- package/Modal.jsx +0 -21
- package/ProcessOverview.jsx +0 -25
- package/SearchResults/_SearchResultsItem.jsx +0 -24
- package/WizardLayout.jsx +0 -44
- package/WizardStepper.jsx +0 -34
- package/_abstract/CardList.jsx +0 -46
- package/_abstract/TogglerGroup.jsx +0 -36
- package/_abstract/_Block.jsx +0 -32
- package/esm/AccordionList.jsx +0 -33
- package/esm/ArticleCarousel/_ArticleCarouselCard.jsx +0 -25
- package/esm/ArticleMeta.jsx +0 -17
- package/esm/Attention.jsx +0 -4
- package/esm/BlockBreak.jsx +0 -6
- package/esm/BlockQuote.jsx +0 -4
- package/esm/BreadCrumbs.jsx +0 -31
- package/esm/ButtonBack.jsx +0 -4
- package/esm/ButtonPrimary.jsx +0 -4
- package/esm/ButtonSecondary.jsx +0 -4
- package/esm/Carousel.jsx +0 -4
- package/esm/CarouselStepper.jsx +0 -4
- package/esm/CenterColumn.jsx +0 -9
- package/esm/Checkbox.jsx +0 -4
- package/esm/ContentArticle.jsx +0 -24
- package/esm/ContentImage.jsx +0 -13
- package/esm/FeatureList.jsx +0 -23
- package/esm/FieldGroup.jsx +0 -10
- package/esm/FooterBadges.jsx +0 -16
- package/esm/FooterInfo.jsx +0 -14
- package/esm/Footnote.jsx +0 -3
- package/esm/GridBlocks.jsx +0 -35
- package/esm/HeroBlock.jsx +0 -22
- package/esm/InfoBlock.jsx +0 -18
- package/esm/LabeledTextBlock.jsx +0 -16
- package/esm/Layout.jsx +0 -63
- package/esm/MainMenu/_Auxiliary.jsx +0 -19
- package/esm/MainMenu/_PrimaryPanel.jsx +0 -30
- package/esm/MiniMetrics.jsx +0 -11
- package/esm/Modal.jsx +0 -16
- package/esm/NameCards.jsx +0 -9
- package/esm/PageFilter.jsx +0 -16
- package/esm/ProcessOverview.jsx +0 -20
- package/esm/PullQuote.jsx +0 -4
- package/esm/RadioGroup.jsx +0 -7
- package/esm/RelatedLinks.jsx +0 -30
- package/esm/SearchResults/_SearchResultsItem.jsx +0 -19
- package/esm/WizardLayout.jsx +0 -39
- package/esm/WizardLayoutClose.jsx +0 -4
- package/esm/WizardStepper.jsx +0 -29
- package/esm/_abstract/CardList.jsx +0 -39
- package/esm/_abstract/TogglerGroup.jsx +0 -31
- package/esm/_abstract/_Blings.jsx +0 -14
- package/esm/_abstract/_Block.jsx +0 -27
- package/esm/_abstract/_Quote.jsx +0 -11
package/GridBlocks.jsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
|
-
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
9
|
-
const Image_1 = __importDefault(require("./_abstract/Image"));
|
|
10
|
-
const Link_1 = require("./_abstract/Link");
|
|
11
|
-
const seenEffect_1 = require("./utils/seenEffect");
|
|
12
|
-
const ButtonTertiary_1 = __importDefault(require("./ButtonTertiary"));
|
|
13
|
-
const GridBlocks = (props) => {
|
|
14
|
-
const { blocks, twocol, startSeen } = props;
|
|
15
|
-
const [ref] = (0, seenEffect_1.useSeenEffect)(startSeen);
|
|
16
|
-
return (<div className={(0, getBemClass_1.default)('GridBlocks', [twocol && 'twocol'])} ref={ref}>
|
|
17
|
-
{blocks.map(({ title, summary, href, links = [], icon, image }, i) => {
|
|
18
|
-
const imageProps = icon ? { src: (0, assets_1.getEfnistaknUrl)(icon) } : image;
|
|
19
|
-
return (<div key={i} className="GridBlocks__item">
|
|
20
|
-
{imageProps && <Image_1.default className="GridBlocks__illustration" {...imageProps}/>}
|
|
21
|
-
<div className="GridBlocks__textwrap">
|
|
22
|
-
<h3 className="GridBlocks__item__title">
|
|
23
|
-
{href != null ? (<Link_1.Link className="GridBlocks__item__titlelink" href={href}>
|
|
24
|
-
{title}
|
|
25
|
-
</Link_1.Link>) : (title)}
|
|
26
|
-
</h3>
|
|
27
|
-
<div className="GridBlocks__item__summary">{summary}</div>
|
|
28
|
-
<ul className="GridBlocks__links">
|
|
29
|
-
{links.map((link, i) => {
|
|
30
|
-
return (<li key={i} className="GridBlocks__link">
|
|
31
|
-
<ButtonTertiary_1.default {...link}/>
|
|
32
|
-
</li>);
|
|
33
|
-
})}
|
|
34
|
-
</ul>
|
|
35
|
-
</div>
|
|
36
|
-
</div>);
|
|
37
|
-
})}
|
|
38
|
-
</div>);
|
|
39
|
-
};
|
|
40
|
-
exports.default = GridBlocks;
|
package/InfoBlock.jsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const seenEffect_1 = require("./utils/seenEffect");
|
|
8
|
-
const InfoBlock = (props) => {
|
|
9
|
-
const { title, subtitle, items, startSeen } = props;
|
|
10
|
-
const [ref] = (0, seenEffect_1.useSeenEffect)(startSeen);
|
|
11
|
-
return (<div className="InfoBlock" ref={ref}>
|
|
12
|
-
<h2 className="InfoBlock__title">{title}</h2>
|
|
13
|
-
<div className="InfoBlock__subtitle">{subtitle}</div>
|
|
14
|
-
<ul className="InfoBlock__items">
|
|
15
|
-
{items.map((item, i) => (<li key={i} className="InfoBlock__item">
|
|
16
|
-
{item}
|
|
17
|
-
</li>))}
|
|
18
|
-
</ul>
|
|
19
|
-
{'extraInfo' in props && (<div className="InfoBlock__extrainfo">{props.extraInfo}</div>)}
|
|
20
|
-
{'attention' in props && (<div className="InfoBlock__attention">{props.attention}</div>)}
|
|
21
|
-
</div>);
|
|
22
|
-
};
|
|
23
|
-
exports.default = InfoBlock;
|
package/Layout.jsx
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.defaultLayoutTexts = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const hooks_1 = require("@hugsmidjan/react/hooks");
|
|
9
|
-
const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
10
|
-
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
11
|
-
const i18n_1 = require("@reykjavik/hanna-utils/i18n");
|
|
12
|
-
const Image_1 = __importDefault(require("./_abstract/Image"));
|
|
13
|
-
const Link_1 = require("./_abstract/Link");
|
|
14
|
-
const useMenuToggling_1 = require("./utils/useMenuToggling");
|
|
15
|
-
const useScrollbarWidthCSSVar_1 = require("./utils/useScrollbarWidthCSSVar");
|
|
16
|
-
exports.defaultLayoutTexts = {
|
|
17
|
-
is: {
|
|
18
|
-
lang: 'is',
|
|
19
|
-
skipLinkLabel: 'Valmynd',
|
|
20
|
-
closeMenuLabel: 'Loka',
|
|
21
|
-
closeMenuLabelLong: 'Loka valmynd',
|
|
22
|
-
},
|
|
23
|
-
en: {
|
|
24
|
-
lang: 'en',
|
|
25
|
-
skipLinkLabel: 'Skip to navigation',
|
|
26
|
-
closeMenuLabel: 'Close',
|
|
27
|
-
closeMenuLabelLong: 'Close menu',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
const Layout = (props) => {
|
|
31
|
-
(0, useScrollbarWidthCSSVar_1.useScrollbarWidthCSSVar)();
|
|
32
|
-
const { ssr, globalAlerts, mainChildren, navChildren, footerChildren, colorTheme, children, siteName = 'Reykjavík', logoLink = '/', } = props;
|
|
33
|
-
const { isMenuActive, closeMenu, toggleMenu } = (0, useMenuToggling_1.useMenuToggling)(ssr !== 'ssr-only');
|
|
34
|
-
const isBrowser = (0, hooks_1.useIsBrowserSide)( /* ssr */);
|
|
35
|
-
const txt = (0, i18n_1.getTexts)(props, exports.defaultLayoutTexts);
|
|
36
|
-
return (<div className={(0, getBemClass_1.default)('Layout', props.modifier)} data-sprinkled={isBrowser} data-color-theme={colorTheme}>
|
|
37
|
-
{globalAlerts && (<div className="Layout__alerts" role="alert">
|
|
38
|
-
{globalAlerts}
|
|
39
|
-
</div>)}
|
|
40
|
-
<div className="Layout__content">
|
|
41
|
-
<div className="Layout__header" role="banner">
|
|
42
|
-
<Link_1.Link className="Layout__header__logo" href={logoLink}>
|
|
43
|
-
{' '}
|
|
44
|
-
<Image_1.default inline={true} src={(0, assets_1.getAssetUrl)('reykjavik-logo.svg')}/> {siteName}{' '}
|
|
45
|
-
</Link_1.Link>{' '}
|
|
46
|
-
{navChildren && (<Link_1.Link className="Layout__header__skiplink" href="#pagenav" onClick={isMenuActive &&
|
|
47
|
-
((e) => {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
toggleMenu();
|
|
50
|
-
})} aria-label={txt.skipLinkLabel}>
|
|
51
|
-
{txt.skipLinkLabel}
|
|
52
|
-
</Link_1.Link>)}
|
|
53
|
-
</div>
|
|
54
|
-
<div className="Layout__main" role="main">
|
|
55
|
-
{mainChildren || children}
|
|
56
|
-
</div>
|
|
57
|
-
{navChildren && (<div className="Layout__nav" id="pagenav" role="navigation">
|
|
58
|
-
{navChildren}
|
|
59
|
-
{isMenuActive && (<button className="Layout__nav__closebutton" onClick={closeMenu} aria-label={txt.closeMenuLabelLong} type="button">
|
|
60
|
-
{txt.closeMenuLabel}
|
|
61
|
-
</button>)}
|
|
62
|
-
</div>)}
|
|
63
|
-
<div className="Layout__footer" role="complementary">
|
|
64
|
-
{footerChildren}
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>);
|
|
68
|
-
};
|
|
69
|
-
exports.default = Layout;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PrimaryPanel = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
9
|
-
const Link_1 = require("../_abstract/Link");
|
|
10
|
-
const PrimaryPanel = (props) => {
|
|
11
|
-
const { setActivePanel, panel, isParent, isActive, isBrowser, texts } = props;
|
|
12
|
-
const { items } = panel;
|
|
13
|
-
return (<li ref={isActive ? props.activeRef : undefined} className={(0, getBemClass_1.default)('PrimaryPanel', [
|
|
14
|
-
isParent && 'parent',
|
|
15
|
-
isActive && 'active',
|
|
16
|
-
items.length > 5 && 'twocol', // TODO: allow setting twocol manually?
|
|
17
|
-
])} id={panel.id}>
|
|
18
|
-
<h3 className="PrimaryPanel__title">
|
|
19
|
-
{' '}
|
|
20
|
-
{isBrowser && !isActive ? (<button className="MainMenu__mega__title-toggler" aria-controls={panel.id} onClick={() => setActivePanel(panel, false)} aria-pressed={isActive} type="button">
|
|
21
|
-
{panel.title}
|
|
22
|
-
</button>) : (panel.title)}
|
|
23
|
-
</h3>
|
|
24
|
-
<ul className="PrimaryPanel__items">
|
|
25
|
-
{items.map((item, i) => (<li key={i} className="PrimaryPanel__item" aria-current={item.current || undefined}>
|
|
26
|
-
<Link_1.Link className="PrimaryPanel__link" href={item.href} target={item.target} lang={item.lang}>
|
|
27
|
-
<span className="PrimaryPanel__linkTitle">{item.label}</span>{' '}
|
|
28
|
-
<small className="PrimaryPanel__summary">{item.summary}</small>{' '}
|
|
29
|
-
</Link_1.Link>
|
|
30
|
-
</li>))}
|
|
31
|
-
</ul>
|
|
32
|
-
{isBrowser && isActive && (<button className="MainMenu__megapanel__backtomenu" aria-controls={panel.id} aria-label={texts.backToMenuLong} onClick={() => setActivePanel(undefined)} type="button">
|
|
33
|
-
{texts.backToMenu}
|
|
34
|
-
</button>)}
|
|
35
|
-
</li>);
|
|
36
|
-
};
|
|
37
|
-
exports.PrimaryPanel = PrimaryPanel;
|
package/Modal.jsx
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const Modal_1 = __importDefault(require("@hugsmidjan/react/Modal"));
|
|
8
|
-
const Modal = (props) => {
|
|
9
|
-
const { closeDelay = 500, texts = {
|
|
10
|
-
closeButton: 'Loka ',
|
|
11
|
-
}, bling, children, render = () => children, } = props;
|
|
12
|
-
return (<Modal_1.default {...props} bodyWrap={false} bem="Modal" closeDelay={closeDelay} texts={texts} render={(args) => bling ? (<>
|
|
13
|
-
{render(args)}
|
|
14
|
-
<div className="Modal__blings">
|
|
15
|
-
<div className="Modal__blings__inner">{bling}</div>
|
|
16
|
-
</div>
|
|
17
|
-
</>) : (render(args))}
|
|
18
|
-
// eslint-disable-next-line react/no-children-prop
|
|
19
|
-
children={undefined}/>);
|
|
20
|
-
};
|
|
21
|
-
exports.default = Modal;
|
package/ProcessOverview.jsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
|
-
const ProcessOverview = (props) => {
|
|
9
|
-
const { title, items, attention, transparent, narrow } = props;
|
|
10
|
-
return (<div className={(0, getBemClass_1.default)('ProcessOverview', [
|
|
11
|
-
transparent && 'transparent',
|
|
12
|
-
narrow && 'narrow',
|
|
13
|
-
])}>
|
|
14
|
-
<h2 className="ProcessOverview__title">{title}</h2>
|
|
15
|
-
{items.map(({ title, content }, i) => {
|
|
16
|
-
return (<div key={i} className="ProcessOverview__item">
|
|
17
|
-
<h3 className="ProcessOverview__item__title">{title}</h3>
|
|
18
|
-
<div className="ProcessOverview__item__content">{content}</div>
|
|
19
|
-
</div>);
|
|
20
|
-
})}
|
|
21
|
-
|
|
22
|
-
{attention && <div className="ProcessOverview__attention">{attention}</div>}
|
|
23
|
-
</div>);
|
|
24
|
-
};
|
|
25
|
-
exports.default = ProcessOverview;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const Image_1 = __importDefault(require("../_abstract/Image"));
|
|
8
|
-
const Link_1 = require("../_abstract/Link");
|
|
9
|
-
const SearchResultsItem = (props) => {
|
|
10
|
-
const { highlight, title, summary, href, meta, image } = props;
|
|
11
|
-
const bem = highlight ? 'SearchResultsHighlightItem' : 'SearchResultsItem';
|
|
12
|
-
const metaArr = (Array.isArray(meta) ? meta : [meta]);
|
|
13
|
-
return (<li className={bem}>
|
|
14
|
-
<Link_1.Link className={bem + '__link'} href={href}>
|
|
15
|
-
<h3 className={bem + '__title'}>{title}</h3>
|
|
16
|
-
{metaArr.length > 0 && (<span className={bem + '__meta'}>
|
|
17
|
-
{metaArr.map((item, i) => typeof item === 'function' ? item() : item && <span key={i}>{item}</span>)}
|
|
18
|
-
</span>)}
|
|
19
|
-
{highlight && image && <Image_1.default className={bem + '__image'} src={image}/>}
|
|
20
|
-
<div className={bem + '__summary'} dangerouslySetInnerHTML={{ __html: summary }}/>
|
|
21
|
-
</Link_1.Link>
|
|
22
|
-
</li>);
|
|
23
|
-
};
|
|
24
|
-
exports.default = SearchResultsItem;
|
package/WizardLayout.jsx
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const hooks_1 = require("@hugsmidjan/react/hooks");
|
|
8
|
-
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
9
|
-
const Image_1 = __importDefault(require("./_abstract/Image"));
|
|
10
|
-
const Link_1 = require("./_abstract/Link");
|
|
11
|
-
const useScrollbarWidthCSSVar_1 = require("./utils/useScrollbarWidthCSSVar");
|
|
12
|
-
const WizardLayout = (props) => {
|
|
13
|
-
(0, useScrollbarWidthCSSVar_1.useScrollbarWidthCSSVar)();
|
|
14
|
-
const {
|
|
15
|
-
// ssr,
|
|
16
|
-
wizardStepper, wizardFooter, children, colorTheme, logoLink = '/', siteName = 'Reykjavík', globalAlerts, } = props;
|
|
17
|
-
const isBrowser = (0, hooks_1.useIsBrowserSide)( /* ssr */);
|
|
18
|
-
return (<div className="WizardLayout" data-sprinkled={isBrowser} data-color-theme={colorTheme}>
|
|
19
|
-
{globalAlerts && (<div className="WizardLayout__alerts" role="alert">
|
|
20
|
-
{globalAlerts}
|
|
21
|
-
</div>)}
|
|
22
|
-
<div className="WizardLayout__content">
|
|
23
|
-
<div className="WizardLayout__header" role="banner">
|
|
24
|
-
<Link_1.Link className="WizardLayout__header__logo" href={logoLink}>
|
|
25
|
-
{' '}
|
|
26
|
-
<Image_1.default inline={true} src={(0, assets_1.getAssetUrl)('reykjavik-logo.svg')}/> {siteName}{' '}
|
|
27
|
-
</Link_1.Link>{' '}
|
|
28
|
-
</div>
|
|
29
|
-
<div className="WizardLayout__wrap">
|
|
30
|
-
{wizardStepper && (<div className="WizardLayout__stepper" role="navigation">
|
|
31
|
-
{wizardStepper}
|
|
32
|
-
</div>)}
|
|
33
|
-
<div className="WizardLayout__main" role="main">
|
|
34
|
-
{children}
|
|
35
|
-
</div>
|
|
36
|
-
<div className="WizardLayout__deco WizardLayout__deco--geometry"/>
|
|
37
|
-
</div>
|
|
38
|
-
<div className="WizardLayout__footer" role="complementary">
|
|
39
|
-
{wizardFooter}
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>);
|
|
43
|
-
};
|
|
44
|
-
exports.default = WizardLayout;
|
package/WizardStepper.jsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
|
-
const WizardStepper = (props) => {
|
|
9
|
-
const { steps, activeStep = -1, allowForwardSkip, disableBacktrack, onClick } = props;
|
|
10
|
-
return (<div className={(0, getBemClass_1.default)('WizardStepper', activeStep === -1 && 'preview')}>
|
|
11
|
-
{steps.map((step, i) => {
|
|
12
|
-
const { label, clickable, done, neutral } = step;
|
|
13
|
-
const stepClass = (0, getBemClass_1.default)('WizardStepper__step', [
|
|
14
|
-
(done || (done == null && i < activeStep)) && 'done',
|
|
15
|
-
neutral && 'neutral',
|
|
16
|
-
]);
|
|
17
|
-
const isClickable = clickable === 'always' ||
|
|
18
|
-
(clickable &&
|
|
19
|
-
(activeStep === i ||
|
|
20
|
-
(i > activeStep && allowForwardSkip) ||
|
|
21
|
-
(i < activeStep && !disableBacktrack)));
|
|
22
|
-
const ariaCurrent = activeStep === i ? 'step' : undefined;
|
|
23
|
-
return (<react_1.default.Fragment key={i}>
|
|
24
|
-
{isClickable ? (<button type="button" className={stepClass} onClick={() => onClick(i)} aria-current={ariaCurrent}>
|
|
25
|
-
{label}
|
|
26
|
-
</button>) : (<span className={stepClass} aria-current={ariaCurrent}>
|
|
27
|
-
{' '}
|
|
28
|
-
{label}{' '}
|
|
29
|
-
</span>)}{' '}
|
|
30
|
-
</react_1.default.Fragment>);
|
|
31
|
-
})}
|
|
32
|
-
</div>);
|
|
33
|
-
};
|
|
34
|
-
exports.default = WizardStepper;
|
package/_abstract/CardList.jsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CardList = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const Button_1 = __importDefault(require("./Button"));
|
|
9
|
-
const Image_1 = __importDefault(require("./Image"));
|
|
10
|
-
const Card = (props) => {
|
|
11
|
-
const { bem, href, title, imgPlaceholder } = props;
|
|
12
|
-
const cardClass = `${bem}__card`;
|
|
13
|
-
const image = 'image' in props && props.image;
|
|
14
|
-
const meta = 'meta' in props && props.meta;
|
|
15
|
-
const summary = 'summary' in props && props.summary;
|
|
16
|
-
return (<>
|
|
17
|
-
<Button_1.default bem={cardClass} href={href}>
|
|
18
|
-
{' '}
|
|
19
|
-
<Image_1.default className={`${bem}__image`} {...image} placeholder={imgPlaceholder}/>
|
|
20
|
-
<span className={`${cardClass}__title`}>{title}</span>{' '}
|
|
21
|
-
{meta && <span className={`${cardClass}__meta`}>{meta}</span>}{' '}
|
|
22
|
-
{summary && <span className={`${cardClass}__summary`}>{summary}</span>}{' '}
|
|
23
|
-
</Button_1.default>{' '}
|
|
24
|
-
</>);
|
|
25
|
-
};
|
|
26
|
-
const CardList = (props) => {
|
|
27
|
-
const { bemPrefix, title, summaryElement, cards, titleTag = 'h2', children, imgPlaceholder, } = props;
|
|
28
|
-
const TitleTag = titleTag;
|
|
29
|
-
const fallbackImage = (imgPlaceholder !== true && imgPlaceholder) || undefined;
|
|
30
|
-
const fallbackImageStyle = fallbackImage
|
|
31
|
-
? { '--ImageCards--fallback': `url("${fallbackImage}")` }
|
|
32
|
-
: undefined;
|
|
33
|
-
return (<>
|
|
34
|
-
{summaryElement ? (<div className={bemPrefix + '__summary'}>
|
|
35
|
-
{title && <TitleTag className={bemPrefix + '__title'}>{title}</TitleTag>}
|
|
36
|
-
{summaryElement}
|
|
37
|
-
</div>) : (title && <TitleTag className={bemPrefix + '__title'}>{title}</TitleTag>)}
|
|
38
|
-
<ul className={bemPrefix + '__list'} style={fallbackImageStyle}>
|
|
39
|
-
{cards.map((card, i) => (<li key={i} className={bemPrefix + '__item'}>
|
|
40
|
-
<Card {...card} bem={bemPrefix} imgPlaceholder={!!imgPlaceholder}/>
|
|
41
|
-
</li>))}
|
|
42
|
-
</ul>
|
|
43
|
-
{children}
|
|
44
|
-
</>);
|
|
45
|
-
};
|
|
46
|
-
exports.CardList = CardList;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
|
-
const TogglerGroup = (props) => {
|
|
9
|
-
const {
|
|
10
|
-
// id,
|
|
11
|
-
className, bem, name, disabled, Toggler, onSelected, options, inputProps = {}, } = props;
|
|
12
|
-
const values = props.value || [];
|
|
13
|
-
return (<ul className={(0, getBemClass_1.default)(bem, null, className)} role="group" aria-labelledby={props['aria-labelledby']} aria-describedby={props['aria-describedby']} aria-required={props.required}>
|
|
14
|
-
{options.map((option, i) => {
|
|
15
|
-
const isDisabled = option.disabled != null
|
|
16
|
-
? option.disabled
|
|
17
|
-
: disabled && typeof disabled !== 'boolean'
|
|
18
|
-
? disabled.includes(i)
|
|
19
|
-
: disabled;
|
|
20
|
-
const isChecked = values.includes(option.value);
|
|
21
|
-
return (<Toggler key={i} {...inputProps} className={bem + '__item'} name={name} Wrapper="li" {...option} label={option.label || option.value} onChange={onSelected
|
|
22
|
-
? (e) => {
|
|
23
|
-
const { value } = option;
|
|
24
|
-
const checked = e.currentTarget.checked;
|
|
25
|
-
inputProps.onChange && inputProps.onChange(e);
|
|
26
|
-
const selectedValues = values.filter((val) => val !== value);
|
|
27
|
-
if (checked) {
|
|
28
|
-
selectedValues.push(value);
|
|
29
|
-
}
|
|
30
|
-
onSelected({ value, checked, option, selectedValues });
|
|
31
|
-
}
|
|
32
|
-
: inputProps.onChange} disabled={isDisabled} aria-invalid={props['aria-invalid']} checked={isChecked}/>);
|
|
33
|
-
})}
|
|
34
|
-
</ul>);
|
|
35
|
-
};
|
|
36
|
-
exports.default = TogglerGroup;
|
package/_abstract/_Block.jsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
|
-
const seenEffect_1 = require("../utils/seenEffect");
|
|
9
|
-
const Button_1 = __importDefault(require("./Button"));
|
|
10
|
-
const Image_1 = __importDefault(require("./Image"));
|
|
11
|
-
const Block = (props) => {
|
|
12
|
-
const { image, modifier, bem, content, startSeen } = props;
|
|
13
|
-
const [ref] = (0, seenEffect_1.useSeenEffect)(startSeen);
|
|
14
|
-
const contentItems = Array.isArray(content) ? content : [content];
|
|
15
|
-
return (<div className={(0, getBemClass_1.default)(bem, modifier)} ref={ref}>
|
|
16
|
-
{contentItems.map(({ title, summary, buttons = [] }, i) => {
|
|
17
|
-
const hasSummary = summary && (typeof summary !== 'string' || !!summary.trim());
|
|
18
|
-
return (<div key={i} className={`${bem}__content`}>
|
|
19
|
-
<h2 className={`${bem}__title`}>{title}</h2>
|
|
20
|
-
{hasSummary && <div className={`${bem}__summary`}>{summary}</div>}
|
|
21
|
-
{buttons.length > 0 && (<div className={`${bem}__buttons`}>
|
|
22
|
-
{' '}
|
|
23
|
-
{buttons.map((buttonProps, i) => (<>
|
|
24
|
-
<Button_1.default bem={`${bem}__button`} key={i} {...buttonProps}/>{' '}
|
|
25
|
-
</>))}
|
|
26
|
-
</div>)}
|
|
27
|
-
</div>);
|
|
28
|
-
})}
|
|
29
|
-
{image && <Image_1.default className={`${bem}__image`} {...image}/>}
|
|
30
|
-
</div>);
|
|
31
|
-
};
|
|
32
|
-
exports.default = Block;
|
package/esm/AccordionList.jsx
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { useDomid, useIsBrowserSide } from '@hugsmidjan/react/hooks';
|
|
3
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
4
|
-
import { useSeenEffect } from './utils/seenEffect';
|
|
5
|
-
const AccordionListItem = (props) => {
|
|
6
|
-
const { title, content, id, disabled = false, defaultOpen, ssr } = props;
|
|
7
|
-
const [open, setOpen] = useState(defaultOpen);
|
|
8
|
-
useEffect(() => setOpen(defaultOpen), [defaultOpen]);
|
|
9
|
-
const domid = useDomid();
|
|
10
|
-
const isBrowser = useIsBrowserSide(ssr);
|
|
11
|
-
const itemDisabled = (isBrowser && disabled) || !content;
|
|
12
|
-
return (<div className={getBemClass('AccordionList__item', [itemDisabled && 'disabled'])} id={id} data-start-open={defaultOpen || undefined} data-sprinkled={isBrowser}>
|
|
13
|
-
<h3 className="AccordionList__title">
|
|
14
|
-
{isBrowser ? (<button type="button" className="AccordionList__button" aria-controls={domid} aria-expanded={open || undefined} onClick={() => {
|
|
15
|
-
setOpen(!open);
|
|
16
|
-
}} disabled={itemDisabled}>
|
|
17
|
-
{title}
|
|
18
|
-
</button>) : (title)}
|
|
19
|
-
</h3>
|
|
20
|
-
<div id={isBrowser && domid} className="AccordionList__content" hidden={isBrowser && (!open || itemDisabled)}>
|
|
21
|
-
{content}
|
|
22
|
-
</div>
|
|
23
|
-
</div>);
|
|
24
|
-
};
|
|
25
|
-
// ---------------------------------------------------------------------------
|
|
26
|
-
const AccordionList = (props) => {
|
|
27
|
-
const { items, ssr, wide, defaultOpen, startSeen } = props;
|
|
28
|
-
const [ref] = useSeenEffect(startSeen);
|
|
29
|
-
return (<div className={getBemClass('AccordionList', [wide && 'wide'])} ref={ref}>
|
|
30
|
-
{items.map((item, i) => (<AccordionListItem key={i} {...item} ssr={ssr} defaultOpen={defaultOpen && defaultOpen.includes(i)}/>))}
|
|
31
|
-
</div>);
|
|
32
|
-
};
|
|
33
|
-
export default AccordionList;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
|
|
4
|
-
import Image from '../_abstract/Image';
|
|
5
|
-
import { Link } from '../_abstract/Link';
|
|
6
|
-
import { colorFamilies, themeOptions } from '../constants';
|
|
7
|
-
export const ArticleCarouselCard = (props) => {
|
|
8
|
-
const { date, title, summary, href, moreLabel, color, theme, illustration, image } = props;
|
|
9
|
-
const photo = image === null || image === void 0 ? void 0 : image.photo;
|
|
10
|
-
const imageProps = illustration ? { src: getIllustrationUrl(illustration) } : image;
|
|
11
|
-
return (<div className="ArticleCarouselCard" data-color={color && colorFamilies[color]} data-color-theme={!color ? theme && themeOptions[theme] : undefined} // color takes precedence over "theme"
|
|
12
|
-
>
|
|
13
|
-
<Link className="ArticleCarouselCard__link" href={href}>
|
|
14
|
-
{' '}
|
|
15
|
-
<Image placeholder className={getBemClass('ArticleCarouselCard__illustration', photo && 'photo')} {...imageProps}/>
|
|
16
|
-
<h3 className="ArticleCarouselCard__title">{title}</h3>{' '}
|
|
17
|
-
</Link>{' '}
|
|
18
|
-
{date && <span className="ArticleCarouselCard__date">{date}</span>}
|
|
19
|
-
<div className="ArticleCarouselCard__summary">{summary}</div>
|
|
20
|
-
{moreLabel && (<Link className="ArticleCarouselCard__morelink" href={href} aria-label={title}>
|
|
21
|
-
{' '}
|
|
22
|
-
{moreLabel}{' '}
|
|
23
|
-
</Link>)}
|
|
24
|
-
</div>);
|
|
25
|
-
};
|
package/esm/ArticleMeta.jsx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import { Link } from './_abstract/Link';
|
|
3
|
-
const ArticleMeta = (props) => {
|
|
4
|
-
const { items } = props;
|
|
5
|
-
if (items.length === 0) {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
return (<div className="ArticleMeta">
|
|
9
|
-
{items.map(({ label, href }, i) => (<Fragment key={i}>
|
|
10
|
-
{href == null ? (<span className="ArticleMeta__item"> {label} </span>) : (<Link className="ArticleMeta__item" href={href}>
|
|
11
|
-
{' '}
|
|
12
|
-
{label}{' '}
|
|
13
|
-
</Link>)}{' '}
|
|
14
|
-
</Fragment>))}
|
|
15
|
-
</div>);
|
|
16
|
-
};
|
|
17
|
-
export default ArticleMeta;
|
package/esm/Attention.jsx
DELETED
package/esm/BlockBreak.jsx
DELETED
package/esm/BlockQuote.jsx
DELETED
package/esm/BreadCrumbs.jsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Link } from './_abstract/Link';
|
|
3
|
-
const BreadCrumbs__item = (props) => {
|
|
4
|
-
const { link, current } = props;
|
|
5
|
-
return link.href != null ? (<Link className="BreadCrumbs__item" href={link.href} aria-current={current || undefined}>
|
|
6
|
-
{link.label}
|
|
7
|
-
</Link>) : (<span className="BreadCrumbs__item" aria-current={current || undefined}>
|
|
8
|
-
{link.label}
|
|
9
|
-
</span>);
|
|
10
|
-
};
|
|
11
|
-
const BreadCrumbs = (props) => {
|
|
12
|
-
const { title, trail } = props;
|
|
13
|
-
if (trail.length === 0) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
const ancestors = trail.slice(0, -1);
|
|
17
|
-
const current = trail[trail.length - 1];
|
|
18
|
-
return (<nav className="BreadCrumbs" aria-label={title}>
|
|
19
|
-
<span className="BreadCrumbs__title">{title}:</span>{' '}
|
|
20
|
-
{ancestors.map((link, i) => {
|
|
21
|
-
return (<React.Fragment key={i}>
|
|
22
|
-
<BreadCrumbs__item link={link}/>{' '}
|
|
23
|
-
<span className="BreadCrumbs__separator" aria-label="">
|
|
24
|
-
>
|
|
25
|
-
</span>{' '}
|
|
26
|
-
</React.Fragment>);
|
|
27
|
-
})}
|
|
28
|
-
<BreadCrumbs__item link={current} current/>
|
|
29
|
-
</nav>);
|
|
30
|
-
};
|
|
31
|
-
export default BreadCrumbs;
|
package/esm/ButtonBack.jsx
DELETED
package/esm/ButtonPrimary.jsx
DELETED
package/esm/ButtonSecondary.jsx
DELETED
package/esm/Carousel.jsx
DELETED
package/esm/CarouselStepper.jsx
DELETED
package/esm/CenterColumn.jsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import SeenEffect from './SeenEffect';
|
|
3
|
-
const CenterColumn = (props) => {
|
|
4
|
-
const { children, startSeen, effectType } = props;
|
|
5
|
-
return startSeen == null ? (<div className="CenterColumn">{children}</div>) : (<SeenEffect className="CenterColumn" startSeen={startSeen} effectType={effectType}>
|
|
6
|
-
{children}
|
|
7
|
-
</SeenEffect>);
|
|
8
|
-
};
|
|
9
|
-
export default CenterColumn;
|
package/esm/Checkbox.jsx
DELETED