@reykjavik/hanna-react 0.10.84 → 0.10.85
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 +2 -2
- package/AccordionList.js +5 -5
- package/ActionCards.d.ts +2 -2
- package/ActionCards.js +4 -4
- package/Alert.d.ts +1 -1
- package/Alert.js +6 -6
- package/ArticleCards.d.ts +1 -1
- package/ArticleCards.js +2 -2
- package/ArticleCarousel/_ArticleCarouselCard.d.ts +2 -2
- package/ArticleCarousel/_ArticleCarouselCard.js +7 -7
- package/ArticleCarousel.d.ts +3 -3
- package/ArticleCarousel.js +3 -3
- package/ArticleMeta.js +2 -2
- package/BasicTable.d.ts +1 -1
- package/BasicTable.js +2 -2
- package/BgBox.d.ts +1 -1
- package/BgBox.js +3 -3
- package/Bling.js +2 -2
- package/BlockQuote.d.ts +1 -1
- package/BlockQuote.js +2 -2
- package/BreadCrumbs.js +2 -2
- package/ButtonBack.d.ts +1 -1
- package/ButtonBack.js +2 -2
- package/ButtonPrimary.d.ts +1 -1
- package/ButtonPrimary.js +2 -2
- package/ButtonSecondary.d.ts +1 -1
- package/ButtonSecondary.js +2 -2
- package/ButtonTertiary.d.ts +1 -1
- package/ButtonTertiary.js +2 -2
- package/CHANGELOG.md +7 -0
- package/Carousel.d.ts +2 -2
- package/Carousel.js +2 -2
- package/CenterColumn.d.ts +1 -1
- package/CenterColumn.js +2 -2
- package/Checkbox.d.ts +1 -1
- package/Checkbox.js +2 -2
- package/CheckboxButton.d.ts +1 -1
- package/CheckboxButton.js +2 -2
- package/CheckboxButtonsGroup.d.ts +1 -1
- package/CheckboxButtonsGroup.js +3 -3
- package/CheckboxGroup.d.ts +1 -1
- package/CheckboxGroup.js +3 -3
- package/CityBlock.d.ts +4 -4
- package/CityBlock.js +4 -4
- package/ContactBubble.d.ts +1 -1
- package/ContactBubble.js +6 -6
- package/ContentArticle.d.ts +4 -4
- package/ContentArticle.js +14 -14
- package/ContentImage.d.ts +1 -1
- package/ContentImage.js +2 -2
- package/Datepicker.d.ts +1 -1
- package/Datepicker.js +2 -2
- package/ExtraLinks.d.ts +2 -2
- package/ExtraLinks.js +6 -6
- package/FeatureList.d.ts +1 -1
- package/FeatureList.js +4 -4
- package/FileInput.d.ts +2 -2
- package/FileInput.js +4 -4
- package/Foonote.d.ts +1 -1
- package/Foonote.js +2 -2
- package/FooterBadges.js +2 -2
- package/Form.d.ts +1 -1
- package/FormField.d.ts +1 -1
- package/FormField.js +4 -4
- package/Gallery/_GalleryItem.d.ts +1 -1
- package/Gallery/_GalleryItem.js +7 -7
- package/Gallery/_GalleryModal.d.ts +1 -1
- package/Gallery/_GalleryModal.js +4 -4
- package/Gallery/_GalleryModalContext.d.ts +2 -2
- package/Gallery/_GalleryModalItem.d.ts +1 -1
- package/Gallery/_GalleryModalItem.js +2 -2
- package/Gallery.d.ts +4 -4
- package/Gallery.js +7 -7
- package/GridBlocks.d.ts +3 -3
- package/GridBlocks.js +8 -8
- package/Heading.d.ts +1 -1
- package/HeroBlock.d.ts +3 -3
- package/HeroBlock.js +8 -8
- package/Illustration.d.ts +1 -1
- package/Illustration.js +2 -2
- package/ImageCards.d.ts +2 -2
- package/ImageCards.js +4 -4
- package/InfoBlock.d.ts +1 -1
- package/InfoBlock.js +2 -2
- package/InfoHero.d.ts +3 -3
- package/InfoHero.js +10 -10
- package/IslandBlock.d.ts +4 -4
- package/IslandBlock.js +4 -4
- package/IslandPageBlock.d.ts +4 -4
- package/IslandPageBlock.js +4 -4
- package/LabeledTextBlock.d.ts +2 -2
- package/LabeledTextBlock.js +4 -4
- package/Layout.d.ts +1 -1
- package/Layout.js +13 -13
- package/MainMenu/_Auxiliary.d.ts +1 -1
- package/MainMenu/_Auxiliary.js +2 -2
- package/MainMenu/_PrimaryPanel.js +2 -2
- package/MainMenu.d.ts +3 -3
- package/MainMenu.js +15 -13
- package/MiniMetrics.d.ts +2 -2
- package/MiniMetrics.js +4 -4
- package/NameCard.js +4 -4
- package/NameCards.d.ts +1 -1
- package/NameCards.js +2 -2
- package/NewsHero.d.ts +2 -2
- package/NewsHero.js +7 -7
- package/PageFilter.d.ts +1 -1
- package/PageFilter.js +4 -4
- package/PageHeading.d.ts +1 -1
- package/PageHeading.js +2 -2
- package/Picture.d.ts +1 -1
- package/Picture.js +2 -2
- package/PullQuote.d.ts +1 -1
- package/PullQuote.js +2 -2
- package/RadioButtonsGroup.d.ts +1 -1
- package/RadioButtonsGroup.js +4 -4
- package/RadioGroup.d.ts +2 -2
- package/RadioGroup.js +4 -4
- package/RelatedLinks.js +2 -2
- package/RowBlock.d.ts +1 -1
- package/RowBlock.js +2 -2
- package/SearchInput.d.ts +1 -1
- package/SearchInput.js +2 -2
- package/SearchResults/_SearchResultsItem.js +4 -4
- package/SearchResults.d.ts +2 -2
- package/SearchResults.js +7 -7
- package/SeenEffect.d.ts +1 -1
- package/SeenEffect.js +3 -3
- package/Selectbox.d.ts +2 -2
- package/Selectbox.js +2 -2
- package/ShareButtons.d.ts +1 -1
- package/ShareButtons.js +2 -2
- package/SiteSearchAutocomplete.js +2 -2
- package/SiteSearchCurtain.js +2 -2
- package/SiteSearchInput.d.ts +2 -2
- package/SiteSearchInput.js +2 -2
- package/SubHeading.d.ts +2 -2
- package/SubHeading.js +2 -2
- package/Tabs.d.ts +2 -2
- package/Tabs.js +4 -4
- package/TagPill.d.ts +1 -1
- package/TagPill.js +3 -3
- package/TextBlock.d.ts +2 -2
- package/TextBlock.js +2 -2
- package/TextButton.d.ts +1 -1
- package/TextButton.js +2 -2
- package/TextInput.d.ts +1 -1
- package/TextInput.js +2 -2
- package/VerticalTabsTOC.d.ts +1 -1
- package/VerticalTabsTOC.js +2 -2
- package/WizardLayout.d.ts +1 -1
- package/WizardLayout.js +8 -8
- package/WizardLayoutClose.d.ts +1 -1
- package/WizardLayoutClose.js +2 -2
- package/_abstract/_AbstractCarousel.d.ts +2 -2
- package/_abstract/_AbstractCarousel.js +6 -6
- package/_abstract/_Blings.d.ts +1 -1
- package/_abstract/_Blings.js +2 -2
- package/_abstract/_Block.d.ts +3 -3
- package/_abstract/_Block.js +6 -6
- package/_abstract/_Button.js +2 -2
- package/_abstract/_CardList.d.ts +1 -1
- package/_abstract/_CardList.js +4 -4
- package/_abstract/_Image.js +2 -2
- package/_abstract/_Quote.js +2 -2
- package/_abstract/_TogglerGroup.d.ts +2 -2
- package/_abstract/_TogglerGroup.js +2 -2
- package/_abstract/_TogglerGroupField.d.ts +3 -3
- package/_abstract/_TogglerGroupField.js +4 -4
- package/assets.d.ts +2 -2
- package/esm/AccordionList.d.ts +25 -0
- package/esm/AccordionList.js +32 -0
- package/esm/ActionCards.d.ts +6 -0
- package/esm/ActionCards.js +9 -0
- package/esm/Alert.d.ts +48 -0
- package/esm/Alert.js +90 -0
- package/esm/ArticleCards.d.ts +8 -0
- package/esm/ArticleCards.js +4 -0
- package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +28 -0
- package/esm/ArticleCarousel/_ArticleCarouselCard.js +24 -0
- package/esm/ArticleCarousel.d.ts +12 -0
- package/esm/ArticleCarousel.js +8 -0
- package/esm/ArticleMeta.d.ts +10 -0
- package/esm/ArticleMeta.js +19 -0
- package/esm/Attention.d.ts +7 -0
- package/esm/Attention.js +4 -0
- package/esm/BasicTable.d.ts +14 -0
- package/esm/BasicTable.js +29 -0
- package/esm/BgBox.d.ts +8 -0
- package/esm/BgBox.js +9 -0
- package/esm/Bling.d.ts +81 -0
- package/esm/Bling.js +44 -0
- package/esm/BlockBreak.d.ts +2 -0
- package/esm/BlockBreak.js +6 -0
- package/esm/BlockQuote.d.ts +4 -0
- package/esm/BlockQuote.js +4 -0
- package/esm/BreadCrumbs.d.ts +11 -0
- package/esm/BreadCrumbs.js +28 -0
- package/esm/ButtonBack.d.ts +7 -0
- package/esm/ButtonBack.js +4 -0
- package/esm/ButtonBar.d.ts +17 -0
- package/esm/ButtonBar.js +15 -0
- package/esm/ButtonPrimary.d.ts +7 -0
- package/esm/ButtonPrimary.js +4 -0
- package/esm/ButtonSecondary.d.ts +7 -0
- package/esm/ButtonSecondary.js +4 -0
- package/esm/ButtonTertiary.d.ts +12 -0
- package/esm/ButtonTertiary.js +15 -0
- package/esm/Carousel.d.ts +4 -0
- package/esm/Carousel.js +4 -0
- package/esm/CarouselStepper.d.ts +4 -0
- package/esm/CarouselStepper.js +4 -0
- package/esm/CenterColumn.d.ts +7 -0
- package/esm/CenterColumn.js +7 -0
- package/esm/Checkbox.d.ts +4 -0
- package/esm/Checkbox.js +4 -0
- package/esm/CheckboxButton.d.ts +4 -0
- package/esm/CheckboxButton.js +4 -0
- package/esm/CheckboxButtonsGroup.d.ts +12 -0
- package/esm/CheckboxButtonsGroup.js +13 -0
- package/esm/CheckboxGroup.d.ts +10 -0
- package/esm/CheckboxGroup.js +7 -0
- package/esm/CityBlock.d.ts +21 -0
- package/esm/CityBlock.js +18 -0
- package/esm/ContactBubble.d.ts +58 -0
- package/esm/ContactBubble.js +152 -0
- package/esm/ContentArticle.d.ts +16 -0
- package/esm/ContentArticle.js +24 -0
- package/esm/ContentImage.d.ts +8 -0
- package/esm/ContentImage.js +18 -0
- package/esm/Datepicker.d.ts +40 -0
- package/esm/Datepicker.js +78 -0
- package/esm/ExtraLinks.d.ts +18 -0
- package/esm/ExtraLinks.js +24 -0
- package/esm/FeatureList.d.ts +12 -0
- package/esm/FeatureList.js +16 -0
- package/esm/FieldGroup.d.ts +10 -0
- package/esm/FieldGroup.js +9 -0
- package/esm/FileInput/_FileInput.utils.d.ts +36 -0
- package/esm/FileInput/_FileInput.utils.js +69 -0
- package/esm/FileInput/_FileInputFileList.d.ts +11 -0
- package/esm/FileInput/_FileInputFileList.js +19 -0
- package/esm/FileInput.d.ts +48 -0
- package/esm/FileInput.js +130 -0
- package/esm/Foonote.d.ts +12 -0
- package/esm/Foonote.js +7 -0
- package/esm/FooterBadges.d.ts +9 -0
- package/esm/FooterBadges.js +12 -0
- package/esm/FooterInfo.d.ts +20 -0
- package/esm/FooterInfo.js +12 -0
- package/esm/Footnote.d.ts +6 -0
- package/esm/Footnote.js +3 -0
- package/esm/Form.d.ts +7 -0
- package/esm/Form.js +10 -0
- package/esm/FormField.d.ts +65 -0
- package/esm/FormField.js +92 -0
- package/esm/Gallery/_GalleryItem.d.ts +7 -0
- package/esm/Gallery/_GalleryItem.js +19 -0
- package/esm/Gallery/_GalleryModal.d.ts +6 -0
- package/esm/Gallery/_GalleryModal.js +53 -0
- package/esm/Gallery/_GalleryModalContext.d.ts +9 -0
- package/esm/Gallery/_GalleryModalContext.js +2 -0
- package/esm/Gallery/_GalleryModalItem.d.ts +2 -0
- package/esm/Gallery/_GalleryModalItem.js +11 -0
- package/esm/Gallery.d.ts +17 -0
- package/esm/Gallery.js +27 -0
- package/esm/GridBlocks.d.ts +26 -0
- package/esm/GridBlocks.js +24 -0
- package/esm/Heading.d.ts +22 -0
- package/esm/Heading.js +19 -0
- package/esm/HeroBlock.d.ts +19 -0
- package/esm/HeroBlock.js +21 -0
- package/esm/IframeBlock.d.ts +28 -0
- package/esm/IframeBlock.js +26 -0
- package/esm/Illustration.d.ts +10 -0
- package/esm/Illustration.js +8 -0
- package/esm/ImageCards.d.ts +10 -0
- package/esm/ImageCards.js +12 -0
- package/esm/InfoBlock.d.ts +13 -0
- package/esm/InfoBlock.js +13 -0
- package/esm/InfoHero.d.ts +18 -0
- package/esm/InfoHero.js +83 -0
- package/esm/IslandBlock.d.ts +25 -0
- package/esm/IslandBlock.js +16 -0
- package/esm/IslandPageBlock.d.ts +24 -0
- package/esm/IslandPageBlock.js +16 -0
- package/esm/LabeledTextBlock.d.ts +11 -0
- package/esm/LabeledTextBlock.js +14 -0
- package/esm/Layout.d.ts +32 -0
- package/esm/Layout.js +56 -0
- package/esm/MainMenu/_Auxiliary.d.ts +6 -0
- package/esm/MainMenu/_Auxiliary.js +13 -0
- package/esm/MainMenu/_PrimaryPanel.d.ts +29 -0
- package/esm/MainMenu/_PrimaryPanel.js +22 -0
- package/esm/MainMenu.d.ts +62 -0
- package/esm/MainMenu.js +221 -0
- package/esm/MiniMetrics.d.ts +8 -0
- package/esm/MiniMetrics.js +12 -0
- package/esm/Modal.d.ts +8 -0
- package/esm/Modal.js +14 -0
- package/esm/NameCard.d.ts +64 -0
- package/esm/NameCard.js +82 -0
- package/esm/NameCards.d.ts +6 -0
- package/esm/NameCards.js +7 -0
- package/esm/NewsHero.d.ts +14 -0
- package/esm/NewsHero.js +86 -0
- package/esm/PageFilter.d.ts +16 -0
- package/esm/PageFilter.js +15 -0
- package/esm/PageHeading.d.ts +10 -0
- package/esm/PageHeading.js +12 -0
- package/esm/Picture.d.ts +7 -0
- package/esm/Picture.js +8 -0
- package/esm/ProcessOverview.d.ts +13 -0
- package/esm/ProcessOverview.js +17 -0
- package/esm/PullQuote.d.ts +4 -0
- package/esm/PullQuote.js +4 -0
- package/esm/RadioButtonsGroup.d.ts +12 -0
- package/esm/RadioButtonsGroup.js +14 -0
- package/esm/RadioGroup.d.ts +16 -0
- package/esm/RadioGroup.js +8 -0
- package/esm/RelatedLinks.d.ts +20 -0
- package/esm/RelatedLinks.js +26 -0
- package/esm/RowBlock.d.ts +12 -0
- package/esm/RowBlock.js +9 -0
- package/esm/RowBlockColumn.d.ts +8 -0
- package/esm/RowBlockColumn.js +11 -0
- package/esm/SearchInput.d.ts +18 -0
- package/esm/SearchInput.js +23 -0
- package/esm/SearchResults/_SearchResultsItem.d.ts +18 -0
- package/esm/SearchResults/_SearchResultsItem.js +14 -0
- package/esm/SearchResults.d.ts +37 -0
- package/esm/SearchResults.js +108 -0
- package/esm/SeenEffect.d.ts +4 -0
- package/esm/SeenEffect.js +9 -0
- package/esm/Selectbox.d.ts +11 -0
- package/esm/Selectbox.js +40 -0
- package/esm/ShareButtons.d.ts +9 -0
- package/esm/ShareButtons.js +56 -0
- package/esm/Sharpie.d.ts +23 -0
- package/esm/Sharpie.js +22 -0
- package/esm/SiteSearchAutocomplete.d.ts +40 -0
- package/esm/SiteSearchAutocomplete.js +48 -0
- package/esm/SiteSearchCurtain.d.ts +6 -0
- package/esm/SiteSearchCurtain.js +28 -0
- package/esm/SiteSearchInput.d.ts +24 -0
- package/esm/SiteSearchInput.js +30 -0
- package/esm/Skeleton.d.ts +25 -0
- package/esm/Skeleton.js +30 -0
- package/esm/SubHeading.d.ts +10 -0
- package/esm/SubHeading.js +13 -0
- package/esm/Tabs.d.ts +35 -0
- package/esm/Tabs.js +94 -0
- package/esm/TagPill.d.ts +25 -0
- package/esm/TagPill.js +34 -0
- package/esm/TextBlock.d.ts +15 -0
- package/esm/TextBlock.js +15 -0
- package/esm/TextButton.d.ts +9 -0
- package/esm/TextButton.js +9 -0
- package/esm/TextInput.d.ts +16 -0
- package/esm/TextInput.js +32 -0
- package/esm/Tooltip.d.ts +7 -0
- package/esm/Tooltip.js +58 -0
- package/esm/VSpacer.d.ts +22 -0
- package/esm/VSpacer.js +41 -0
- package/esm/VerticalTabsTOC.d.ts +14 -0
- package/esm/VerticalTabsTOC.js +68 -0
- package/esm/WizardLayout.d.ts +15 -0
- package/esm/WizardLayout.js +30 -0
- package/esm/WizardLayoutClose.d.ts +3 -0
- package/esm/WizardLayoutClose.js +4 -0
- package/esm/WizardStepper.d.ts +36 -0
- package/esm/WizardStepper.js +26 -0
- package/esm/_abstract/_AbstractCarousel.d.ts +29 -0
- package/esm/_abstract/_AbstractCarousel.js +108 -0
- package/esm/_abstract/_Blings.d.ts +11 -0
- package/esm/_abstract/_Blings.js +11 -0
- package/esm/_abstract/_Block.d.ts +21 -0
- package/esm/_abstract/_Block.js +23 -0
- package/esm/_abstract/_Button.d.ts +40 -0
- package/esm/_abstract/_Button.js +36 -0
- package/esm/_abstract/_CardList.d.ts +34 -0
- package/esm/_abstract/_CardList.js +37 -0
- package/esm/_abstract/_Image.d.ts +36 -0
- package/esm/_abstract/_Image.js +26 -0
- package/esm/_abstract/_Link.d.ts +60 -0
- package/esm/_abstract/_Link.js +64 -0
- package/esm/_abstract/_Quote.d.ts +11 -0
- package/esm/_abstract/_Quote.js +8 -0
- package/esm/_abstract/_TogglerGroup.d.ts +32 -0
- package/esm/_abstract/_TogglerGroup.js +28 -0
- package/esm/_abstract/_TogglerGroupField.d.ts +19 -0
- package/esm/_abstract/_TogglerGroupField.js +17 -0
- package/esm/_abstract/_TogglerInput.d.ts +23 -0
- package/esm/_abstract/_TogglerInput.js +23 -0
- package/esm/_abstract/breakOnNL.d.ts +1 -0
- package/esm/_abstract/breakOnNL.js +7 -0
- package/esm/assets.d.ts +42 -0
- package/esm/assets.js +58 -0
- package/esm/constants.d.ts +19 -0
- package/esm/constants.js +22 -0
- package/esm/focus-visible.d.ts +1 -0
- package/esm/focus-visible.js +3 -0
- package/esm/index.d.ts +97 -0
- package/esm/index.js +1 -0
- package/esm/package.json +1 -0
- package/esm/utils/HannaUIState.d.ts +8 -0
- package/esm/utils/HannaUIState.js +7 -0
- package/esm/utils/browserSide.d.ts +1 -0
- package/esm/utils/browserSide.js +1 -0
- package/esm/utils/config.d.ts +4 -0
- package/esm/utils/config.js +2 -0
- package/esm/utils/env.d.ts +1 -0
- package/esm/utils/env.js +8 -0
- package/esm/utils/seenEffect.d.ts +27 -0
- package/esm/utils/seenEffect.js +75 -0
- package/esm/utils/useDidChange.d.ts +37 -0
- package/esm/utils/useDidChange.js +43 -0
- package/esm/utils/useFormatMonitor.d.ts +38 -0
- package/esm/utils/useFormatMonitor.js +41 -0
- package/esm/utils/useGetSVGtext.d.ts +10 -0
- package/esm/utils/useGetSVGtext.js +23 -0
- package/esm/utils/useMenuToggling.d.ts +8 -0
- package/esm/utils/useMenuToggling.js +62 -0
- package/esm/utils/useMixedControlState.d.ts +137 -0
- package/esm/utils/useMixedControlState.js +101 -0
- package/esm/utils/useScrollbarWidthCSSVar.d.ts +17 -0
- package/esm/utils/useScrollbarWidthCSSVar.js +19 -0
- package/esm/utils.d.ts +8 -0
- package/esm/utils.js +8 -0
- package/package.json +389 -3
- package/utils/config.d.ts +2 -2
- package/utils/config.js +2 -2
- package/utils/useDidChange.d.ts +1 -1
- package/utils/useDidChange.js +1 -1
- package/utils/useMenuToggling.js +2 -2
- package/utils.d.ts +8 -8
- package/utils.js +8 -8
package/Illustration.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
2
2
|
import { Illustration as IllustrationName } from '@reykjavik/hanna-utils/assets';
|
|
3
|
-
import { ImageProps } from './_abstract/_Image';
|
|
3
|
+
import { ImageProps } from './_abstract/_Image.js';
|
|
4
4
|
type IllustrationProps = EitherObj<{
|
|
5
5
|
type: IllustrationName;
|
|
6
6
|
}, {
|
package/Illustration.js
CHANGED
|
@@ -4,10 +4,10 @@ exports.Illustration = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
7
|
-
const
|
|
7
|
+
const _Image_js_1 = require("./_abstract/_Image.js");
|
|
8
8
|
const Illustration = (props) => {
|
|
9
9
|
const imgProps = props.type ? { src: (0, assets_1.getIllustrationUrl)(props.type) } : props.image;
|
|
10
|
-
return react_1.default.createElement(
|
|
10
|
+
return react_1.default.createElement(_Image_js_1.Image, Object.assign({ className: "Illustration" }, imgProps));
|
|
11
11
|
};
|
|
12
12
|
exports.Illustration = Illustration;
|
|
13
13
|
exports.default = exports.Illustration;
|
package/ImageCards.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CardListSummaryProps, ImageCardListProps, ImageCardProps as _ImageCardProps } from './_abstract/_CardList';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
1
|
+
import { CardListSummaryProps, ImageCardListProps, ImageCardProps as _ImageCardProps } from './_abstract/_CardList.js';
|
|
2
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
3
3
|
export type ImageCardsItemProps = _ImageCardProps;
|
|
4
4
|
/** @deprecated Use `ImageCardsItemProps` instead. (Will be removed in v0.11) */
|
|
5
5
|
export type ImageCardProps = ImageCardsItemProps;
|
package/ImageCards.js
CHANGED
|
@@ -4,13 +4,13 @@ exports.ImageCards = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const _CardList_js_1 = require("./_abstract/_CardList.js");
|
|
8
|
+
const seenEffect_js_1 = require("./utils/seenEffect.js");
|
|
9
9
|
const ImageCards = (props) => {
|
|
10
10
|
const { background, startSeen } = props, cardListProps = tslib_1.__rest(props, ["background", "startSeen"]);
|
|
11
|
-
const [ref] = (0,
|
|
11
|
+
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
12
12
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('ImageCards', background && 'background'), ref: ref },
|
|
13
|
-
react_1.default.createElement(
|
|
13
|
+
react_1.default.createElement(_CardList_js_1.CardList, Object.assign({}, cardListProps, { bemPrefix: "ImageCards", imgPlaceholder: props.imgPlaceholder || true }))));
|
|
14
14
|
};
|
|
15
15
|
exports.ImageCards = ImageCards;
|
|
16
16
|
exports.default = exports.ImageCards;
|
package/InfoBlock.d.ts
CHANGED
package/InfoBlock.js
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.InfoBlock = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const
|
|
6
|
+
const seenEffect_js_1 = require("./utils/seenEffect.js");
|
|
7
7
|
const InfoBlock = (props) => {
|
|
8
8
|
const { title, subtitle, items, startSeen } = props;
|
|
9
|
-
const [ref] = (0,
|
|
9
|
+
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
10
10
|
return (react_1.default.createElement("div", { className: "InfoBlock", ref: ref },
|
|
11
11
|
react_1.default.createElement("h2", { className: "InfoBlock__title" }, title),
|
|
12
12
|
subtitle && react_1.default.createElement("div", { className: "InfoBlock__subtitle" }, subtitle),
|
package/InfoHero.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ButtonProps } from './_abstract/_Button';
|
|
2
|
-
import { ImageProps } from './_abstract/_Image';
|
|
3
|
-
import { Alignment } from './constants';
|
|
1
|
+
import { ButtonProps } from './_abstract/_Button.js';
|
|
2
|
+
import { ImageProps } from './_abstract/_Image.js';
|
|
3
|
+
import { Alignment } from './constants.js';
|
|
4
4
|
type BlingOptions = 'waves' | 'sunny-waves' | 'triangles' | 'circles';
|
|
5
5
|
export type InfoHeroProps = {
|
|
6
6
|
title: string;
|
package/InfoHero.js
CHANGED
|
@@ -4,11 +4,11 @@ exports.InfoHero = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
7
|
+
const _Blings_js_1 = require("./_abstract/_Blings.js");
|
|
8
|
+
const _Image_js_1 = require("./_abstract/_Image.js");
|
|
9
|
+
const breakOnNL_js_1 = require("./_abstract/breakOnNL.js");
|
|
10
|
+
const ButtonTertiary_js_1 = tslib_1.__importDefault(require("./ButtonTertiary.js"));
|
|
11
|
+
const constants_js_1 = require("./constants.js");
|
|
12
12
|
const blingOptions = {
|
|
13
13
|
waves: [
|
|
14
14
|
{
|
|
@@ -70,19 +70,19 @@ const blingOptions = {
|
|
|
70
70
|
const InfoHero = (props) => {
|
|
71
71
|
const { title, titleBlurb, subTitle, blurb, image, buttons = [], footer, align, blingType, } = props;
|
|
72
72
|
const showButtons = Boolean(buttons.length);
|
|
73
|
-
const alignment = align &&
|
|
73
|
+
const alignment = align && constants_js_1.aligns[align] ? align : 'right';
|
|
74
74
|
const blings = (blingType && blingOptions[blingType]) ||
|
|
75
75
|
blingOptions.waves; // default to `waves`
|
|
76
76
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('InfoHero', 'align--' + alignment) },
|
|
77
77
|
react_1.default.createElement("div", { className: "InfoHero__content" },
|
|
78
78
|
react_1.default.createElement("h1", { className: "InfoHero__title" }, title),
|
|
79
79
|
titleBlurb && react_1.default.createElement("div", { className: "InfoHero__titleblurb" }, titleBlurb),
|
|
80
|
-
subTitle && react_1.default.createElement("div", { className: "InfoHero__subtitle" }, (0,
|
|
80
|
+
subTitle && react_1.default.createElement("div", { className: "InfoHero__subtitle" }, (0, breakOnNL_js_1.breakOnNL)(subTitle)),
|
|
81
81
|
blurb && react_1.default.createElement("div", { className: "InfoHero__blurb" }, blurb),
|
|
82
|
-
showButtons && (react_1.default.createElement("div", { className: "InfoHero__buttons" }, buttons.map((buttonProps, i) => (react_1.default.createElement(
|
|
82
|
+
showButtons && (react_1.default.createElement("div", { className: "InfoHero__buttons" }, buttons.map((buttonProps, i) => (react_1.default.createElement(ButtonTertiary_js_1.default, Object.assign({ key: i }, buttonProps)))))),
|
|
83
83
|
footer && react_1.default.createElement("div", { className: "InfoHero__footer" }, footer)),
|
|
84
|
-
react_1.default.createElement(
|
|
85
|
-
react_1.default.createElement(
|
|
84
|
+
react_1.default.createElement(_Image_js_1.Image, Object.assign({ className: "InfoHero__image", altText: title }, image, { placeholder: true })),
|
|
85
|
+
react_1.default.createElement(_Blings_js_1.Blings, { blings: blings, mirror: alignment === 'right' })));
|
|
86
86
|
};
|
|
87
87
|
exports.InfoHero = InfoHero;
|
|
88
88
|
exports.default = exports.InfoHero;
|
package/IslandBlock.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Formheimur } from '@reykjavik/hanna-utils/assets';
|
|
2
|
-
import { BlockItem } from './_abstract/_Block';
|
|
3
|
-
import { ImageProps } from './_abstract/_Image';
|
|
4
|
-
import { SeenProp } from './utils/seenEffect';
|
|
5
|
-
import { Alignment } from './constants';
|
|
2
|
+
import { BlockItem } from './_abstract/_Block.js';
|
|
3
|
+
import { ImageProps } from './_abstract/_Image.js';
|
|
4
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
5
|
+
import { Alignment } from './constants.js';
|
|
6
6
|
type IslandBaseBlockProps = {
|
|
7
7
|
align?: Alignment;
|
|
8
8
|
};
|
package/IslandBlock.js
CHANGED
|
@@ -4,18 +4,18 @@ exports.IslandBlock = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const _Block_js_1 = require("./_abstract/_Block.js");
|
|
8
|
+
const constants_js_1 = require("./constants.js");
|
|
9
9
|
const IslandBlock = (props) => {
|
|
10
10
|
const { align, content, shapes, image, startSeen } = props;
|
|
11
|
-
const alignment = align &&
|
|
11
|
+
const alignment = align && constants_js_1.aligns[align] ? align : 'right';
|
|
12
12
|
const blockProps = Array.isArray(content)
|
|
13
13
|
? { content }
|
|
14
14
|
: {
|
|
15
15
|
content,
|
|
16
16
|
image: shapes ? { src: (0, assets_1.getFormheimurUrl)(shapes), inline: true } : image || {},
|
|
17
17
|
};
|
|
18
|
-
return (react_1.default.createElement(
|
|
18
|
+
return (react_1.default.createElement(_Block_js_1.Block, Object.assign({ bem: "IslandBlock", modifier: 'align--' + alignment }, blockProps, { startSeen: startSeen })));
|
|
19
19
|
};
|
|
20
20
|
exports.IslandBlock = IslandBlock;
|
|
21
21
|
exports.default = exports.IslandBlock;
|
package/IslandPageBlock.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Illustration } from '@reykjavik/hanna-utils/assets';
|
|
2
|
-
import { BlockItem } from './_abstract/_Block';
|
|
3
|
-
import { ImageProps } from './_abstract/_Image';
|
|
4
|
-
import { SeenProp } from './utils/seenEffect';
|
|
5
|
-
import { Alignment } from './constants';
|
|
2
|
+
import { BlockItem } from './_abstract/_Block.js';
|
|
3
|
+
import { ImageProps } from './_abstract/_Image.js';
|
|
4
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
5
|
+
import { Alignment } from './constants.js';
|
|
6
6
|
declare const backgrounds: {
|
|
7
7
|
none: undefined;
|
|
8
8
|
gray: string;
|
package/IslandPageBlock.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.IslandPageBlock = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const _Block_js_1 = require("./_abstract/_Block.js");
|
|
8
|
+
const constants_js_1 = require("./constants.js");
|
|
9
9
|
const backgrounds = {
|
|
10
10
|
none: undefined,
|
|
11
11
|
gray: 'gray',
|
|
@@ -13,9 +13,9 @@ const backgrounds = {
|
|
|
13
13
|
};
|
|
14
14
|
const IslandPageBlock = (props) => {
|
|
15
15
|
const { title, summary, buttons, illustration, image, align, background, startSeen } = props;
|
|
16
|
-
const alignment = align &&
|
|
16
|
+
const alignment = align && constants_js_1.aligns[align] ? align : 'right';
|
|
17
17
|
const bg = backgrounds[background || 'none'];
|
|
18
|
-
return (react_1.default.createElement(
|
|
18
|
+
return (react_1.default.createElement(_Block_js_1.Block, { bem: "IslandPageBlock", modifier: ['align--' + alignment, bg && 'background--' + bg], content: { title, summary, buttons }, image: illustration ? { src: (0, assets_1.getIllustrationUrl)(illustration) } : image || {}, startSeen: startSeen }));
|
|
19
19
|
};
|
|
20
20
|
exports.IslandPageBlock = IslandPageBlock;
|
|
21
21
|
exports.default = exports.IslandPageBlock;
|
package/LabeledTextBlock.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { ButtonProps } from './_abstract/_Button';
|
|
3
|
-
import { SeenProp } from './utils/seenEffect';
|
|
2
|
+
import { ButtonProps } from './_abstract/_Button.js';
|
|
3
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
4
4
|
export type LabeledTextBlockProps = {
|
|
5
5
|
label: string;
|
|
6
6
|
summary: string | ReactElement;
|
package/LabeledTextBlock.js
CHANGED
|
@@ -4,16 +4,16 @@ exports.LabeledTextBlock = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const seenEffect_js_1 = require("./utils/seenEffect.js");
|
|
8
|
+
const ButtonTertiary_js_1 = tslib_1.__importDefault(require("./ButtonTertiary.js"));
|
|
9
9
|
const LabeledTextBlock = (props) => {
|
|
10
10
|
const { label, summary, wide, buttons = [], startSeen } = props;
|
|
11
|
-
const [ref] = (0,
|
|
11
|
+
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
12
12
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('LabeledTextBlock', wide && 'wide'), ref: ref },
|
|
13
13
|
react_1.default.createElement("h2", { className: "LabeledTextBlock__label" }, label),
|
|
14
14
|
react_1.default.createElement("div", { className: "LabeledTextBlock__summary" },
|
|
15
15
|
summary,
|
|
16
|
-
buttons.map((button, i) => (react_1.default.createElement(
|
|
16
|
+
buttons.map((button, i) => (react_1.default.createElement(ButtonTertiary_js_1.default, Object.assign({ key: i }, button)))))));
|
|
17
17
|
};
|
|
18
18
|
exports.LabeledTextBlock = LabeledTextBlock;
|
|
19
19
|
exports.default = exports.LabeledTextBlock;
|
package/Layout.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BemPropsModifier } from '@hugsmidjan/react/types';
|
|
|
3
3
|
import type { HannaColorTheme } from '@reykjavik/hanna-css';
|
|
4
4
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
5
5
|
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
6
|
-
import { SSRSupport } from './utils';
|
|
6
|
+
import { SSRSupport } from './utils.js';
|
|
7
7
|
export type LayoutI18n = {
|
|
8
8
|
lang?: string;
|
|
9
9
|
skipLinkLabel: string;
|
package/Layout.js
CHANGED
|
@@ -6,12 +6,12 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
7
7
|
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
8
8
|
const i18n_1 = require("@reykjavik/hanna-utils/i18n");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
9
|
+
const _Image_js_1 = require("./_abstract/_Image.js");
|
|
10
|
+
const _Link_js_1 = require("./_abstract/_Link.js");
|
|
11
|
+
const HannaUIState_js_1 = require("./utils/HannaUIState.js");
|
|
12
|
+
const useMenuToggling_js_1 = require("./utils/useMenuToggling.js");
|
|
13
|
+
const useScrollbarWidthCSSVar_js_1 = require("./utils/useScrollbarWidthCSSVar.js");
|
|
14
|
+
const utils_js_1 = require("./utils.js");
|
|
15
15
|
exports.defaultLayoutTexts = {
|
|
16
16
|
is: {
|
|
17
17
|
lang: 'is',
|
|
@@ -27,30 +27,30 @@ exports.defaultLayoutTexts = {
|
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
29
|
const Layout = (props) => {
|
|
30
|
-
(0,
|
|
30
|
+
(0, useScrollbarWidthCSSVar_js_1.useScrollbarWidthCSSVar)();
|
|
31
31
|
const { ssr, globalAlerts, mainChildren, navChildren, footerChildren, colorTheme, children, siteName = 'Reykjavík', logoLink = '/', } = props;
|
|
32
|
-
const { isMenuActive, isMenuOpen, closeMenu, toggleMenu } = (0,
|
|
33
|
-
const isBrowser = (0,
|
|
32
|
+
const { isMenuActive, isMenuOpen, closeMenu, toggleMenu } = (0, useMenuToggling_js_1.useMenuToggling)(ssr !== 'ssr-only');
|
|
33
|
+
const isBrowser = (0, utils_js_1.useIsBrowserSide)( /* ssr */);
|
|
34
34
|
const txt = (0, i18n_1.getTexts)(props, exports.defaultLayoutTexts);
|
|
35
35
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('Layout', props.modifier), "data-sprinkled": isBrowser, "data-color-theme": colorTheme },
|
|
36
36
|
globalAlerts && (react_1.default.createElement("div", { className: "Layout__alerts", role: "alert" }, globalAlerts)),
|
|
37
37
|
react_1.default.createElement("div", { className: "Layout__content" },
|
|
38
38
|
react_1.default.createElement("div", { className: "Layout__header", role: "banner" },
|
|
39
|
-
react_1.default.createElement(
|
|
39
|
+
react_1.default.createElement(_Link_js_1.Link, { className: "Layout__header__logo", href: logoLink },
|
|
40
40
|
' ',
|
|
41
|
-
react_1.default.createElement(
|
|
41
|
+
react_1.default.createElement(_Image_js_1.Image, { className: undefined, inline: true, src: (0, assets_1.getAssetUrl)('reykjavik-logo.svg') }),
|
|
42
42
|
' ',
|
|
43
43
|
siteName,
|
|
44
44
|
' '),
|
|
45
45
|
' ',
|
|
46
|
-
navChildren && (react_1.default.createElement(
|
|
46
|
+
navChildren && (react_1.default.createElement(_Link_js_1.Link, { className: "Layout__header__skiplink", href: "#pagenav", onClick: isMenuActive &&
|
|
47
47
|
((e) => {
|
|
48
48
|
e.preventDefault();
|
|
49
49
|
toggleMenu();
|
|
50
50
|
}), "aria-label": txt.skipLinkLabel }, txt.skipLinkLabel))),
|
|
51
51
|
react_1.default.createElement("div", { className: "Layout__main", role: "main" }, mainChildren || children),
|
|
52
52
|
navChildren && (react_1.default.createElement("div", { className: "Layout__nav", id: "pagenav", role: "navigation" },
|
|
53
|
-
react_1.default.createElement(
|
|
53
|
+
react_1.default.createElement(HannaUIState_js_1.HannaUIState, { value: {
|
|
54
54
|
closeHamburgerMenu: closeMenu,
|
|
55
55
|
isHamburgerMenuOpen: isMenuOpen,
|
|
56
56
|
} }, navChildren),
|
package/MainMenu/_Auxiliary.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MegaMenuPanel } from './_PrimaryPanel';
|
|
1
|
+
import { MegaMenuPanel } from './_PrimaryPanel.js';
|
|
2
2
|
export type AuxilaryPanelIllustration = 'hanna-veitiggi' | 'hanna-vandro' | 'hanna-hugsi' | 'hanna-hissa' | 'hanna-hahaha' | 'hanna-hae' | 'hanna-god_spurning' | 'hanna-gjuggiborg' | 'hanna-benda';
|
|
3
3
|
export type AuxiliaryPanelProps = MegaMenuPanel & {
|
|
4
4
|
image?: AuxilaryPanelIllustration;
|
package/MainMenu/_Auxiliary.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.AuxiliaryPanel = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const assets_1 = require("@reykjavik/hanna-utils/assets");
|
|
7
|
-
const
|
|
7
|
+
const _Link_js_1 = require("../_abstract/_Link.js");
|
|
8
8
|
const AuxiliaryPanel = (props) => {
|
|
9
9
|
const { title, id, items, image } = props;
|
|
10
10
|
const imageUrl = image ? (0, assets_1.getIllustrationUrl)(image) : image;
|
|
@@ -13,6 +13,6 @@ const AuxiliaryPanel = (props) => {
|
|
|
13
13
|
: undefined },
|
|
14
14
|
react_1.default.createElement("h3", { className: "AuxiliaryPanel__title" }, title),
|
|
15
15
|
react_1.default.createElement("ul", { className: "AuxiliaryPanel__items" }, items.map((item, i) => (react_1.default.createElement("li", { key: i, className: "AuxiliaryPanel__item", "aria-current": item.current || undefined },
|
|
16
|
-
react_1.default.createElement(
|
|
16
|
+
react_1.default.createElement(_Link_js_1.Link, { className: "AuxiliaryPanel__link", href: item.href, target: item.target, lang: item.lang }, item.label)))))));
|
|
17
17
|
};
|
|
18
18
|
exports.AuxiliaryPanel = AuxiliaryPanel;
|
|
@@ -4,7 +4,7 @@ exports.PrimaryPanel = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
7
|
-
const
|
|
7
|
+
const _Link_js_1 = require("../_abstract/_Link.js");
|
|
8
8
|
const PrimaryPanel = (props) => {
|
|
9
9
|
const { setActivePanel, panel, isParent, isActive, isBrowser, texts } = props;
|
|
10
10
|
const { items } = panel;
|
|
@@ -17,7 +17,7 @@ const PrimaryPanel = (props) => {
|
|
|
17
17
|
' ',
|
|
18
18
|
isBrowser && !isActive ? (react_1.default.createElement("button", { className: "MainMenu__mega__title-toggler", "aria-controls": panel.id, onClick: () => setActivePanel(panel, false), "aria-pressed": isActive, type: "button" }, panel.title)) : (panel.title)),
|
|
19
19
|
react_1.default.createElement("ul", { className: "PrimaryPanel__items" }, items.map((item, i) => (react_1.default.createElement("li", { key: i, className: "PrimaryPanel__item", "aria-current": item.current || undefined },
|
|
20
|
-
react_1.default.createElement(
|
|
20
|
+
react_1.default.createElement(_Link_js_1.Link, { className: "PrimaryPanel__link", href: item.href, target: item.target, lang: item.lang },
|
|
21
21
|
react_1.default.createElement("span", { className: "PrimaryPanel__linkTitle" }, item.label),
|
|
22
22
|
' ',
|
|
23
23
|
react_1.default.createElement("small", { className: "PrimaryPanel__summary" }, item.summary),
|
package/MainMenu.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Cleanup } from '@reykjavik/hanna-utils';
|
|
2
2
|
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
3
|
-
import { AuxilaryPanelIllustration, AuxiliaryPanelProps } from './MainMenu/_Auxiliary';
|
|
4
|
-
import { MegaMenuItem, MegaMenuPanel, PrimaryPanelI18n } from './MainMenu/_PrimaryPanel';
|
|
5
|
-
import { SSRSupport } from './utils';
|
|
3
|
+
import { AuxilaryPanelIllustration, AuxiliaryPanelProps } from './MainMenu/_Auxiliary.js';
|
|
4
|
+
import { MegaMenuItem, MegaMenuPanel, PrimaryPanelI18n } from './MainMenu/_PrimaryPanel.js';
|
|
5
|
+
import { SSRSupport } from './utils.js';
|
|
6
6
|
export type MainMenuI18n = Cleanup<{
|
|
7
7
|
lang?: string;
|
|
8
8
|
homeLabel?: string;
|
package/MainMenu.js
CHANGED
|
@@ -8,12 +8,12 @@ const useShortState_1 = tslib_1.__importDefault(require("@hugsmidjan/react/hooks
|
|
|
8
8
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
9
9
|
const hanna_utils_1 = require("@reykjavik/hanna-utils");
|
|
10
10
|
const i18n_1 = require("@reykjavik/hanna-utils/i18n");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
11
|
+
const _Link_js_1 = require("./_abstract/_Link.js");
|
|
12
|
+
const _Auxiliary_js_1 = require("./MainMenu/_Auxiliary.js");
|
|
13
|
+
const _PrimaryPanel_js_1 = require("./MainMenu/_PrimaryPanel.js");
|
|
14
|
+
const HannaUIState_js_1 = require("./utils/HannaUIState.js");
|
|
15
|
+
const useFormatMonitor_js_1 = require("./utils/useFormatMonitor.js");
|
|
16
|
+
const utils_js_1 = require("./utils.js");
|
|
17
17
|
const findActivePanel = (megaPanels, activeId) => activeId ? megaPanels.find((panel) => activeId === panel.id) : undefined;
|
|
18
18
|
exports.defaultMainMenuTexts = {
|
|
19
19
|
is: {
|
|
@@ -84,11 +84,13 @@ const normalizeMenuItems = (itemsProp, megaPanels, homeLink, texts) => {
|
|
|
84
84
|
}
|
|
85
85
|
return items;
|
|
86
86
|
};
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
const emptyPanelList = [];
|
|
87
89
|
const MainMenu = (props) => {
|
|
88
|
-
const { title, megaPanels =
|
|
90
|
+
const { title, megaPanels = emptyPanelList, onItemClick, ssr, auxiliaryPanel } = props;
|
|
89
91
|
const texts = (0, i18n_1.getTexts)(props, exports.defaultMainMenuTexts);
|
|
90
|
-
const { closeHamburgerMenu } = (0,
|
|
91
|
-
const isBrowser = (0,
|
|
92
|
+
const { closeHamburgerMenu } = (0, HannaUIState_js_1.useHannaUIState)();
|
|
93
|
+
const isBrowser = (0, utils_js_1.useIsBrowserSide)(ssr);
|
|
92
94
|
const menuElmRef = (0, react_1.useRef)(null);
|
|
93
95
|
const pressedLinkRef = (0, react_1.useRef)(null);
|
|
94
96
|
const activePanelRef = (0, react_1.useRef)(null);
|
|
@@ -133,7 +135,7 @@ const MainMenu = (props) => {
|
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
137
|
: () => undefined, [setLaggyActivePanel, isBrowser]);
|
|
136
|
-
(0,
|
|
138
|
+
(0, useFormatMonitor_js_1.useFormatMonitor)((media) => {
|
|
137
139
|
if (media.leftTopmenu) {
|
|
138
140
|
setActivePanel(undefined);
|
|
139
141
|
}
|
|
@@ -201,7 +203,7 @@ const MainMenu = (props) => {
|
|
|
201
203
|
}
|
|
202
204
|
}, ref: pressed && pressedLinkRef, "aria-pressed": pressed, "aria-controls": controlsId, "aria-label": labelLong, title: labelLong, lang: lang, type: "button" }, label)) : item.href != null ? (
|
|
203
205
|
// always render links server-side
|
|
204
|
-
react_1.default.createElement(
|
|
206
|
+
react_1.default.createElement(_Link_js_1.Link, { className: "MainMenu__link", href: item.href, "aria-label": labelLong, title: labelLong, onClick: () => {
|
|
205
207
|
const keepOpen = onItemClick && onItemClick(i, item) === false;
|
|
206
208
|
!keepOpen && closeHamburgerMenu();
|
|
207
209
|
}, lang: lang }, label)) : undefined // skip rendering non-link menu items server side
|
|
@@ -216,9 +218,9 @@ const MainMenu = (props) => {
|
|
|
216
218
|
}
|
|
217
219
|
const isActive = activePanel === panel || laggyActivePanel === panel || undefined;
|
|
218
220
|
const isParent = !!panel.items.find((item) => item.current);
|
|
219
|
-
return (react_1.default.createElement(
|
|
221
|
+
return (react_1.default.createElement(_PrimaryPanel_js_1.PrimaryPanel, { key: i, isParent: isParent, isActive: isActive, panel: panel, isBrowser: isBrowser, setActivePanel: setActivePanel, texts: texts, activeRef: activePanelRef }));
|
|
220
222
|
}),
|
|
221
|
-
auxiliaryPanel && react_1.default.createElement(
|
|
223
|
+
auxiliaryPanel && react_1.default.createElement(_Auxiliary_js_1.AuxiliaryPanel, Object.assign({}, auxiliaryPanel)))))));
|
|
222
224
|
};
|
|
223
225
|
exports.MainMenu = MainMenu;
|
|
224
226
|
exports.default = exports.MainMenu;
|
package/MiniMetrics.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ButtonProps } from './_abstract/_Button';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
1
|
+
import { ButtonProps } from './_abstract/_Button.js';
|
|
2
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
3
3
|
export type MiniMetricsProps = {
|
|
4
4
|
text: string;
|
|
5
5
|
moreButton: ButtonProps;
|
package/MiniMetrics.js
CHANGED
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MiniMetrics = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const _Button_js_1 = require("./_abstract/_Button.js");
|
|
7
|
+
const SeenEffect_js_1 = tslib_1.__importDefault(require("./SeenEffect.js"));
|
|
8
8
|
const MiniMetrics = (props) => {
|
|
9
9
|
const { text, moreButton, startSeen } = props;
|
|
10
|
-
return (react_1.default.createElement(
|
|
10
|
+
return (react_1.default.createElement(SeenEffect_js_1.default, { className: "MiniMetrics", startSeen: startSeen },
|
|
11
11
|
react_1.default.createElement("strong", { className: "MiniMetrics__text" }, text),
|
|
12
12
|
" ",
|
|
13
13
|
'\n',
|
|
14
|
-
react_1.default.createElement(
|
|
14
|
+
react_1.default.createElement(_Button_js_1.Button, Object.assign({ bem: "MiniMetrics__more" }, moreButton))));
|
|
15
15
|
};
|
|
16
16
|
exports.MiniMetrics = MiniMetrics;
|
|
17
17
|
exports.default = exports.MiniMetrics;
|
package/NameCard.js
CHANGED
|
@@ -5,8 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
7
7
|
const i18n_1 = require("@reykjavik/hanna-utils/i18n");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const _Button_js_1 = require("./_abstract/_Button.js");
|
|
9
|
+
const breakOnNL_js_1 = require("./_abstract/breakOnNL.js");
|
|
10
10
|
const formatDate = (date) => {
|
|
11
11
|
return typeof date === 'string'
|
|
12
12
|
? date
|
|
@@ -22,7 +22,7 @@ const _telToContactInfo = (tel) => {
|
|
|
22
22
|
value: tel,
|
|
23
23
|
}));
|
|
24
24
|
};
|
|
25
|
-
const renderContent = (content) => typeof content === 'string' ? (0,
|
|
25
|
+
const renderContent = (content) => typeof content === 'string' ? (0, breakOnNL_js_1.breakOnNL)(content) : content;
|
|
26
26
|
const defaultTexts = {
|
|
27
27
|
en: {
|
|
28
28
|
updatedLabel: 'Updated on',
|
|
@@ -76,7 +76,7 @@ const NameCard = (props) => {
|
|
|
76
76
|
return (react_1.default.createElement("div", { className: "NameCard" },
|
|
77
77
|
react_1.default.createElement("div", { className: "NameCard__name" }, name),
|
|
78
78
|
contactInfo.length > 0 && (react_1.default.createElement("p", { className: "NameCard__contactinfo" }, cleanContactInfo.map((item, i) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
79
|
-
typeof item === 'string' ? (react_1.default.createElement("span", { className: "NameCard__contactinfo__item" }, item)) : (react_1.default.createElement(
|
|
79
|
+
typeof item === 'string' ? (react_1.default.createElement("span", { className: "NameCard__contactinfo__item" }, item)) : (react_1.default.createElement(_Button_js_1.Button, { key: i, bem: "NameCard__contactinfo__item", href: item.href, "aria-label": item.longLabel, title: item.longLabel }, item.label)),
|
|
80
80
|
' '))))),
|
|
81
81
|
location && react_1.default.createElement("p", { className: "NameCard__location" }, renderContent(location)),
|
|
82
82
|
hours && react_1.default.createElement("p", { className: "NameCard__hours" }, renderContent(hours)),
|
package/NameCards.d.ts
CHANGED
package/NameCards.js
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NameCards = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const
|
|
6
|
+
const NameCard_js_1 = tslib_1.__importDefault(require("./NameCard.js"));
|
|
7
7
|
const NameCards = (props) => {
|
|
8
8
|
const { items } = props;
|
|
9
|
-
return (react_1.default.createElement("div", { className: "NameCards" }, items.map((item, i) => (react_1.default.createElement(
|
|
9
|
+
return (react_1.default.createElement("div", { className: "NameCards" }, items.map((item, i) => (react_1.default.createElement(NameCard_js_1.default, Object.assign({ key: i }, item))))));
|
|
10
10
|
};
|
|
11
11
|
exports.NameCards = NameCards;
|
|
12
12
|
exports.default = exports.NameCards;
|
package/NewsHero.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ImageProps } from './_abstract/_Image';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
1
|
+
import { ImageProps } from './_abstract/_Image.js';
|
|
2
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
3
3
|
type BlingOptions = 'interesting' | 'snake' | 'pentagon' | 'dome' | 'balls-small' | 'balls-large';
|
|
4
4
|
export type NewsHeroProps = {
|
|
5
5
|
title: string;
|
package/NewsHero.js
CHANGED
|
@@ -5,10 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
7
7
|
const hanna_utils_1 = require("@reykjavik/hanna-utils");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
8
|
+
const _Blings_js_1 = require("./_abstract/_Blings.js");
|
|
9
|
+
const _Image_js_1 = require("./_abstract/_Image.js");
|
|
10
|
+
const seenEffect_js_1 = require("./utils/seenEffect.js");
|
|
11
|
+
const ShareButtons_js_1 = tslib_1.__importDefault(require("./ShareButtons.js"));
|
|
12
12
|
const blingOptions = {
|
|
13
13
|
interesting: [
|
|
14
14
|
{
|
|
@@ -77,15 +77,15 @@ const blingOptions = {
|
|
|
77
77
|
};
|
|
78
78
|
const NewsHero = (props) => {
|
|
79
79
|
const { title, sharing = true, meta, summary, image, blingType, startSeen } = props;
|
|
80
|
-
const [ref] = (0,
|
|
80
|
+
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
81
81
|
const blings = (blingType && blingOptions[blingType]) || (0, hanna_utils_1.getStableRandomItem)(blingOptions, title);
|
|
82
82
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('NewsHero', [!image && 'align--right']), ref: ref },
|
|
83
83
|
react_1.default.createElement("div", { className: "NewsHero__content" },
|
|
84
84
|
react_1.default.createElement("h1", { className: "NewsHero__title" }, title),
|
|
85
85
|
meta && react_1.default.createElement("span", { className: "NewsHero__meta" }, meta),
|
|
86
86
|
react_1.default.createElement("div", { className: "NewsHero__summary" }, summary),
|
|
87
|
-
sharing === true ? react_1.default.createElement(
|
|
88
|
-
image ? (react_1.default.createElement(
|
|
87
|
+
sharing === true ? react_1.default.createElement(ShareButtons_js_1.default, null) : sharing && sharing()),
|
|
88
|
+
image ? (react_1.default.createElement(_Image_js_1.Image, Object.assign({ className: "NewsHero__image" }, image))) : (react_1.default.createElement(_Blings_js_1.Blings, { blings: blings }))));
|
|
89
89
|
};
|
|
90
90
|
exports.NewsHero = NewsHero;
|
|
91
91
|
exports.default = exports.NewsHero;
|
package/PageFilter.d.ts
CHANGED
package/PageFilter.js
CHANGED
|
@@ -4,17 +4,17 @@ exports.PageFilter = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const seenEffect_js_1 = require("./utils/seenEffect.js");
|
|
8
|
+
const Footnote_js_1 = tslib_1.__importDefault(require("./Footnote.js"));
|
|
9
9
|
const PageFilter = (props) => {
|
|
10
10
|
const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen } = props;
|
|
11
|
-
const [ref] = (0,
|
|
11
|
+
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
12
12
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('PageFilter', underlap && 'underlap'), ref: ref },
|
|
13
13
|
react_1.default.createElement("h2", { className: "PageFilter__title" }, title),
|
|
14
14
|
summary && react_1.default.createElement("div", { className: "PageFilter__summary" }, summary),
|
|
15
15
|
react_1.default.createElement("div", { className: "PageFilter__filters" }, filters || children),
|
|
16
16
|
react_1.default.createElement("div", { className: "PageFilter__buttons" }, buttonRow),
|
|
17
|
-
footnote && react_1.default.createElement(
|
|
17
|
+
footnote && react_1.default.createElement(Footnote_js_1.default, null, footnote)));
|
|
18
18
|
};
|
|
19
19
|
exports.PageFilter = PageFilter;
|
|
20
20
|
exports.default = exports.PageFilter;
|
package/PageHeading.d.ts
CHANGED