@reykjavik/hanna-react 0.10.83 → 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 +13 -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 +390 -4
- 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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from './_Button.js';
|
|
3
|
+
import { Image } from './_Image.js';
|
|
4
|
+
const Card = (props) => {
|
|
5
|
+
const { bem, href, title, imgPlaceholder, image, meta, summary } = props;
|
|
6
|
+
const cardClass = `${bem}__card`;
|
|
7
|
+
return (React.createElement(React.Fragment, null,
|
|
8
|
+
React.createElement(Button, { bem: cardClass, href: href },
|
|
9
|
+
' ',
|
|
10
|
+
React.createElement(Image, Object.assign({ className: `${bem}__image` }, image, { placeholder: imgPlaceholder })),
|
|
11
|
+
React.createElement("span", { className: `${cardClass}__title` }, title),
|
|
12
|
+
' ',
|
|
13
|
+
meta && React.createElement("span", { className: `${cardClass}__meta` }, meta),
|
|
14
|
+
' ',
|
|
15
|
+
summary && React.createElement("span", { className: `${cardClass}__summary` }, summary),
|
|
16
|
+
' '),
|
|
17
|
+
' '));
|
|
18
|
+
};
|
|
19
|
+
export const CardList = (props) => {
|
|
20
|
+
const { bemPrefix, title, summaryElement, cards, titleTag = 'h2', children, imgPlaceholder, } = props;
|
|
21
|
+
const TitleTag = titleTag;
|
|
22
|
+
const fallbackImageUrl = (imgPlaceholder !== true && imgPlaceholder) || undefined;
|
|
23
|
+
const fallbackImageStyle = fallbackImageUrl
|
|
24
|
+
? {
|
|
25
|
+
['--' + bemPrefix + '--fallback']: `url("${fallbackImageUrl}")`,
|
|
26
|
+
}
|
|
27
|
+
: undefined;
|
|
28
|
+
return (React.createElement(React.Fragment, null,
|
|
29
|
+
summaryElement ? (React.createElement("div", { className: bemPrefix + '__summary' },
|
|
30
|
+
title && React.createElement(TitleTag, { className: bemPrefix + '__title' }, title),
|
|
31
|
+
summaryElement)) : (title && React.createElement(TitleTag, { className: bemPrefix + '__title' }, title)),
|
|
32
|
+
React.createElement("ul", { className: bemPrefix + (props.standalone ? '' : '__list'), style: fallbackImageStyle }, cards.map((card, i) => (React.createElement("li", { key: i, className: bemPrefix + '__item' },
|
|
33
|
+
React.createElement(Card
|
|
34
|
+
/* Assert as `ImageCardProps` to silence the imgPlaceholder false-positive */
|
|
35
|
+
, Object.assign({}, card, { bem: bemPrefix, imgPlaceholder: !!imgPlaceholder })))))),
|
|
36
|
+
children));
|
|
37
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type Source = {
|
|
2
|
+
srcset: string;
|
|
3
|
+
media: string;
|
|
4
|
+
};
|
|
5
|
+
export type ImagePropsLinked = {
|
|
6
|
+
altText?: string;
|
|
7
|
+
sources?: Array<Source>;
|
|
8
|
+
/** The default image source to (lazy) load */
|
|
9
|
+
src?: string;
|
|
10
|
+
/** Eagerly-loaded placeholder/thunbnail to use until a `sources` item has been picked. */
|
|
11
|
+
preloadSrc?: string;
|
|
12
|
+
inline?: false;
|
|
13
|
+
focalPoint?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ImagePropsInlinedSvg = {
|
|
16
|
+
altText?: string;
|
|
17
|
+
/** Should the image be fetched and inlined as <svg/> */
|
|
18
|
+
inline: true;
|
|
19
|
+
src: string;
|
|
20
|
+
sources?: undefined;
|
|
21
|
+
preloadSrc?: undefined;
|
|
22
|
+
focalPoint?: undefined;
|
|
23
|
+
};
|
|
24
|
+
export type ImageProps = ImagePropsLinked | ImagePropsInlinedSvg;
|
|
25
|
+
type _ImageProps = {
|
|
26
|
+
/** container className */
|
|
27
|
+
className: string | undefined;
|
|
28
|
+
/** Controls if the container is rendered when image is missing/undefined.
|
|
29
|
+
* (With a `--missing` className modifier added.)
|
|
30
|
+
*
|
|
31
|
+
* Accepts a function that defines a default content for the container.
|
|
32
|
+
*/
|
|
33
|
+
placeholder?: boolean | (() => JSX.Element);
|
|
34
|
+
};
|
|
35
|
+
export declare const Image: (props: ImageProps & _ImageProps) => JSX.Element | null;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
+
import { useGetSVGtext } from '../utils/useGetSVGtext.js';
|
|
4
|
+
// eslint-disable-next-line complexity
|
|
5
|
+
export const Image = (props) => {
|
|
6
|
+
const { src, altText = '', sources = [], preloadSrc, className, inline, placeholder, focalPoint, } = props;
|
|
7
|
+
const _src = (sources.length && preloadSrc) || src;
|
|
8
|
+
const imageSrc = _src || (sources[0] != null ? sources[0].srcset.split(' ')[0] : undefined);
|
|
9
|
+
const imgLoading = preloadSrc ? 'eager' : 'lazy';
|
|
10
|
+
const inlineSvg = useGetSVGtext(inline ? imageSrc : undefined);
|
|
11
|
+
if (!imageSrc) {
|
|
12
|
+
return placeholder ? (React.createElement("span", { className: className && getBemClass(className, 'missing') }, placeholder !== true && placeholder())) : null;
|
|
13
|
+
}
|
|
14
|
+
if (inline && inlineSvg) {
|
|
15
|
+
const __html = inlineSvg.imageSrc === imageSrc ? inlineSvg.code : '';
|
|
16
|
+
return React.createElement("span", { className: className, dangerouslySetInnerHTML: { __html } });
|
|
17
|
+
}
|
|
18
|
+
return (React.createElement("picture", { className: className, style: focalPoint ? { '--focalPoint': focalPoint } : undefined },
|
|
19
|
+
' ',
|
|
20
|
+
sources.map((source, i) => (React.createElement(React.Fragment, null,
|
|
21
|
+
React.createElement("source", { key: i, srcSet: source.srcset, media: source.media }),
|
|
22
|
+
' '))),
|
|
23
|
+
' ',
|
|
24
|
+
React.createElement("img", { src: imageSrc, alt: altText, loading: imgLoading }),
|
|
25
|
+
' '));
|
|
26
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type HTMLAnchorProps = JSX.IntrinsicElements['a'];
|
|
2
|
+
type LinkProps = HTMLAnchorProps & {
|
|
3
|
+
href: string;
|
|
4
|
+
};
|
|
5
|
+
type _LinkRenderer_internal = (props: LinkProps) => JSX.Element;
|
|
6
|
+
export declare let Link: _LinkRenderer_internal;
|
|
7
|
+
/**
|
|
8
|
+
* Props object ready to be ..spread onto an anchor element
|
|
9
|
+
* */
|
|
10
|
+
export type LinkRendererProps = Omit<LinkProps, 'ref'> & {
|
|
11
|
+
ref: Exclude<HTMLAnchorProps['ref'], string>;
|
|
12
|
+
};
|
|
13
|
+
export type LinkRenderer = (props: LinkRendererProps) => JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Allows you to set a callback function to wrapp <a href=""/> links with
|
|
16
|
+
* a custom routing component.
|
|
17
|
+
*
|
|
18
|
+
* Example use:
|
|
19
|
+
*
|
|
20
|
+
* ```js
|
|
21
|
+
* import { Link } from 'remix'; // or whatever :-)
|
|
22
|
+
*
|
|
23
|
+
* setLinkRenderer((linkProps) =>
|
|
24
|
+
* <Link to={linkProps.href}><a {...linkProps} /></Link>);
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* The link renderers are pushed to a simple stack, and if you want to unset
|
|
28
|
+
* a custom renderer, use the `setLinkRenderer.pop()` method to go back to
|
|
29
|
+
* the previous one. Example:
|
|
30
|
+
*
|
|
31
|
+
* ```js
|
|
32
|
+
* const BlockLinks = (props) =>
|
|
33
|
+
* <span className={props.className}>[Link temporarily out of order]</span>
|
|
34
|
+
*
|
|
35
|
+
* setLinkRenderer(BlockLinks);
|
|
36
|
+
* // ...render some Hanna components...
|
|
37
|
+
* setLinkRenderer.pop(); // reset link rendering
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* The default linkrenderer is defined as:
|
|
41
|
+
*
|
|
42
|
+
* ```js
|
|
43
|
+
* (linkProps) => React.createElement('a', linkProps);
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* ...and you can explicitly switch to using this default by passing `undefined`
|
|
47
|
+
* as an argument — like so:
|
|
48
|
+
*
|
|
49
|
+
* ```js
|
|
50
|
+
* setLinkRenderer(undefined); // pushes the default linkrenderer to the stack
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare const setLinkRenderer: {
|
|
54
|
+
(linkRenderer: LinkRenderer | undefined): void;
|
|
55
|
+
/**
|
|
56
|
+
* Unsets the last pushed custom renderer
|
|
57
|
+
*/
|
|
58
|
+
pop(): void;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const DefaultLinkRenderer = (props) => React.createElement('a', props);
|
|
3
|
+
export let Link = DefaultLinkRenderer;
|
|
4
|
+
const history = [];
|
|
5
|
+
/**
|
|
6
|
+
* Allows you to set a callback function to wrapp <a href=""/> links with
|
|
7
|
+
* a custom routing component.
|
|
8
|
+
*
|
|
9
|
+
* Example use:
|
|
10
|
+
*
|
|
11
|
+
* ```js
|
|
12
|
+
* import { Link } from 'remix'; // or whatever :-)
|
|
13
|
+
*
|
|
14
|
+
* setLinkRenderer((linkProps) =>
|
|
15
|
+
* <Link to={linkProps.href}><a {...linkProps} /></Link>);
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* The link renderers are pushed to a simple stack, and if you want to unset
|
|
19
|
+
* a custom renderer, use the `setLinkRenderer.pop()` method to go back to
|
|
20
|
+
* the previous one. Example:
|
|
21
|
+
*
|
|
22
|
+
* ```js
|
|
23
|
+
* const BlockLinks = (props) =>
|
|
24
|
+
* <span className={props.className}>[Link temporarily out of order]</span>
|
|
25
|
+
*
|
|
26
|
+
* setLinkRenderer(BlockLinks);
|
|
27
|
+
* // ...render some Hanna components...
|
|
28
|
+
* setLinkRenderer.pop(); // reset link rendering
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* The default linkrenderer is defined as:
|
|
32
|
+
*
|
|
33
|
+
* ```js
|
|
34
|
+
* (linkProps) => React.createElement('a', linkProps);
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* ...and you can explicitly switch to using this default by passing `undefined`
|
|
38
|
+
* as an argument — like so:
|
|
39
|
+
*
|
|
40
|
+
* ```js
|
|
41
|
+
* setLinkRenderer(undefined); // pushes the default linkrenderer to the stack
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export const setLinkRenderer = (linkRenderer) => {
|
|
45
|
+
// Here we tell a "white" lie. Nobody uses string-type `ref` attributes
|
|
46
|
+
// anymore. With this lie we're able to provide nice type signature for modern
|
|
47
|
+
// use-cases (e.g. Next.js and Remix.run <Link> elements) while still
|
|
48
|
+
// providing easy to use (easy to Type `JSX.IntrinsicElements['a']` signatures)
|
|
49
|
+
// internally within the hanna-react codebase.
|
|
50
|
+
//
|
|
51
|
+
// This decision may need to be reversed if scream-test results are negative.
|
|
52
|
+
//
|
|
53
|
+
// TODO: Add a project-global `HTMLAnchorProps` with modern `ref` and use it
|
|
54
|
+
// everywhere, and then remove this hack.
|
|
55
|
+
Link = linkRenderer || DefaultLinkRenderer;
|
|
56
|
+
history.unshift(Link);
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Unsets the last pushed custom renderer
|
|
60
|
+
*/
|
|
61
|
+
setLinkRenderer.pop = () => {
|
|
62
|
+
history.shift();
|
|
63
|
+
Link = history[0] || DefaultLinkRenderer;
|
|
64
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
3
|
+
export type QuoteProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
} & EitherObj<object, {
|
|
6
|
+
by: string | JSX.Element;
|
|
7
|
+
byHref?: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const _Quote: (props: {
|
|
10
|
+
bem: string;
|
|
11
|
+
} & QuoteProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from './_Link.js';
|
|
3
|
+
export const _Quote = (props) => {
|
|
4
|
+
const { bem, children, by, byHref } = props;
|
|
5
|
+
return (React.createElement("figure", { className: bem },
|
|
6
|
+
React.createElement("blockquote", { className: bem + '__quote' }, children),
|
|
7
|
+
by && (React.createElement("figcaption", { className: bem + '__by' }, byHref ? (React.createElement(Link, { href: byHref }, by)) : typeof by === 'string' ? (React.createElement("span", null, by)) : (by)))));
|
|
8
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FormFieldInputProps } from '../FormField.js';
|
|
2
|
+
import { TogglerInputProps } from './_TogglerInput.js';
|
|
3
|
+
export type TogglerGroupOption = {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string | JSX.Element;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
};
|
|
9
|
+
export type TogglerGroupOptions = Array<TogglerGroupOption>;
|
|
10
|
+
type RestrictedInputProps = Omit<JSX.IntrinsicElements['input'], 'type' | 'value' | 'defaultValue' | 'checked' | 'defaultChecked' | 'className' | 'id' | 'name' | 'children'>;
|
|
11
|
+
export type TogglerGroupProps = {
|
|
12
|
+
options: TogglerGroupOptions;
|
|
13
|
+
className?: string;
|
|
14
|
+
name: string;
|
|
15
|
+
disabled?: boolean | ReadonlyArray<number>;
|
|
16
|
+
inputProps?: RestrictedInputProps;
|
|
17
|
+
onSelected?: (payload: {
|
|
18
|
+
value: string;
|
|
19
|
+
checked: boolean;
|
|
20
|
+
option: TogglerGroupOption;
|
|
21
|
+
selectedValues: Array<string>;
|
|
22
|
+
}) => void;
|
|
23
|
+
} & Omit<FormFieldInputProps, 'disabled'>;
|
|
24
|
+
type _TogglerGroupProps = {
|
|
25
|
+
bem: string;
|
|
26
|
+
Toggler: (props: TogglerInputProps) => JSX.Element;
|
|
27
|
+
value?: ReadonlyArray<string>;
|
|
28
|
+
defaultValue?: ReadonlyArray<string>;
|
|
29
|
+
isRadio?: true;
|
|
30
|
+
};
|
|
31
|
+
export declare const TogglerGroup: (props: TogglerGroupProps & _TogglerGroupProps) => JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
+
import { useMixedControlState } from '../utils.js';
|
|
4
|
+
export const TogglerGroup = (props) => {
|
|
5
|
+
const {
|
|
6
|
+
// id,
|
|
7
|
+
className, bem, name, disabled, Toggler, onSelected, options, isRadio, inputProps = {}, } = props;
|
|
8
|
+
const [values, setValues] = useMixedControlState(props, 'value', []);
|
|
9
|
+
return (React.createElement("ul", { className: getBemClass(bem, null, className), role: "group", "aria-labelledby": props['aria-labelledby'], "aria-describedby": props['aria-describedby'], "aria-required": props.required }, options.map((option, i) => {
|
|
10
|
+
const isDisabled = option.disabled != null
|
|
11
|
+
? option.disabled
|
|
12
|
+
: disabled && typeof disabled !== 'boolean'
|
|
13
|
+
? disabled.includes(i)
|
|
14
|
+
: disabled;
|
|
15
|
+
const isChecked = values.includes(option.value);
|
|
16
|
+
return (React.createElement(Toggler, Object.assign({ key: i }, inputProps, { className: bem + '__item', name: name, Wrapper: "li" }, option, { label: option.label || option.value, onChange: (e) => {
|
|
17
|
+
inputProps.onChange && inputProps.onChange(e);
|
|
18
|
+
const { value } = option;
|
|
19
|
+
const checked = e.currentTarget.checked;
|
|
20
|
+
const selectedValues = isRadio ? [] : values.filter((val) => val !== value);
|
|
21
|
+
if (checked) {
|
|
22
|
+
selectedValues.push(value);
|
|
23
|
+
}
|
|
24
|
+
setValues(selectedValues);
|
|
25
|
+
onSelected && onSelected({ value, checked, option, selectedValues });
|
|
26
|
+
}, disabled: isDisabled, "aria-invalid": props['aria-invalid'], checked: isChecked })));
|
|
27
|
+
})));
|
|
28
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { BemPropsModifier } from '@hugsmidjan/react/types';
|
|
3
|
+
import { FormFieldGroupWrappingProps } from '../FormField.js';
|
|
4
|
+
import { TogglerGroupOption, TogglerGroupOptions, TogglerGroupProps } from './_TogglerGroup.js';
|
|
5
|
+
import { TogglerInputProps } from './_TogglerInput.js';
|
|
6
|
+
export type TogglerGroupFieldProps = {
|
|
7
|
+
className?: string;
|
|
8
|
+
} & FormFieldGroupWrappingProps & TogglerGroupProps;
|
|
9
|
+
type _TogglerGroupFieldProps = {
|
|
10
|
+
Toggler: (props: TogglerInputProps) => ReactElement;
|
|
11
|
+
isRadio?: true;
|
|
12
|
+
value?: string | ReadonlyArray<string>;
|
|
13
|
+
defaultValue?: string | ReadonlyArray<string>;
|
|
14
|
+
bem: string;
|
|
15
|
+
} & BemPropsModifier;
|
|
16
|
+
export type TogglerGroupFieldOption = TogglerGroupOption;
|
|
17
|
+
export type TogglerGroupFieldOptions = TogglerGroupOptions;
|
|
18
|
+
export declare const TogglerGroupField: (props: TogglerGroupFieldProps & _TogglerGroupFieldProps) => JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
4
|
+
import FormField from '../FormField.js';
|
|
5
|
+
import { TogglerGroup, } from './_TogglerGroup.js';
|
|
6
|
+
export const TogglerGroupField = (props) => {
|
|
7
|
+
const { bem, Toggler, className, modifier, label, LabelTag, assistText, hideLabel, disabled, readOnly, invalid, errorMessage, required, reqText, id, value, defaultValue } = props, togglerGroupProps = __rest(props, ["bem", "Toggler", "className", "modifier", "label", "LabelTag", "assistText", "hideLabel", "disabled", "readOnly", "invalid", "errorMessage", "required", "reqText", "id", "value", "defaultValue"]);
|
|
8
|
+
const _value = useMemo(() => (value == null ? undefined : typeof value === 'string' ? [value] : value), [value]);
|
|
9
|
+
const _defaultValue = useMemo(() => defaultValue == null
|
|
10
|
+
? undefined
|
|
11
|
+
: typeof defaultValue === 'string'
|
|
12
|
+
? [defaultValue]
|
|
13
|
+
: defaultValue, [defaultValue]);
|
|
14
|
+
return (React.createElement(FormField, { className: getBemClass(bem, modifier, className), group: true, label: label, LabelTag: LabelTag, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps) => {
|
|
15
|
+
return (React.createElement(TogglerGroup, Object.assign({ bem: className.options }, inputProps, togglerGroupProps, { value: _value, defaultValue: _defaultValue, Toggler: Toggler })));
|
|
16
|
+
} }));
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BemPropsModifier } from '@hugsmidjan/react/types';
|
|
2
|
+
export type TogglerInputProps = {
|
|
3
|
+
label: string | JSX.Element;
|
|
4
|
+
children?: never;
|
|
5
|
+
Wrapper?: 'div' | 'li';
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
/** Hidden label prefix text to indicate that the field is required.
|
|
8
|
+
*
|
|
9
|
+
* If your field is required but should not say so in its label
|
|
10
|
+
* then set this prop to `false`
|
|
11
|
+
*
|
|
12
|
+
* Default: `"Þarf að fylla út"`
|
|
13
|
+
* */
|
|
14
|
+
reqText?: string | false;
|
|
15
|
+
errorMessage?: string | JSX.Element;
|
|
16
|
+
} & BemPropsModifier & Omit<JSX.IntrinsicElements['input'], 'type'>;
|
|
17
|
+
type _TogglerInputProps = {
|
|
18
|
+
bem: string;
|
|
19
|
+
type: 'radio' | 'checkbox';
|
|
20
|
+
innerWrap?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const TogglerInput: (props: TogglerInputProps & _TogglerInputProps) => JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useDomid } from '@hugsmidjan/react/hooks';
|
|
4
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
5
|
+
export const TogglerInput = (props) => {
|
|
6
|
+
const { bem, modifier, className, label, invalid, errorMessage, Wrapper = 'div', required, reqText, type, id, innerWrap } = props, inputProps = __rest(props, ["bem", "modifier", "className", "label", "invalid", "errorMessage", "Wrapper", "required", "reqText", "type", "id", "innerWrap"]);
|
|
7
|
+
const domid = useDomid(id);
|
|
8
|
+
const errorId = errorMessage && 'error' + domid;
|
|
9
|
+
const reqStar = required && reqText !== false && (React.createElement("abbr", { className: bem + '__label__reqstar',
|
|
10
|
+
// TODO: add mo-better i18n thinking
|
|
11
|
+
title: (reqText || 'Þarf að haka í') + ': ' }, "*"));
|
|
12
|
+
const labelContent = (React.createElement(React.Fragment, null,
|
|
13
|
+
' ',
|
|
14
|
+
reqStar,
|
|
15
|
+
" ",
|
|
16
|
+
label,
|
|
17
|
+
' '));
|
|
18
|
+
return (React.createElement(Wrapper, { className: getBemClass(bem, modifier, className) },
|
|
19
|
+
React.createElement("input", Object.assign({ className: bem + '__input', type: type, id: domid, "aria-invalid": invalid || !!errorMessage || undefined, "aria-describedby": errorId }, inputProps)),
|
|
20
|
+
' ',
|
|
21
|
+
React.createElement("label", { className: bem + '__label', htmlFor: domid }, innerWrap ? (React.createElement("span", { className: bem + '__label__wrap' }, labelContent)) : (labelContent)),
|
|
22
|
+
errorMessage && (React.createElement("div", { className: bem + '__error', id: errorId }, errorMessage))));
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const breakOnNL: (text: string | undefined) => "" | (string | JSX.Element)[] | undefined;
|
package/esm/assets.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { BlingType, Efnistakn, Formheimur, Illustration } from '@reykjavik/hanna-utils/assets';
|
|
2
|
+
import { blingTypes, efnistakn, getAssetUrl, getBlingUrl, getEfnistaknUrl, getFormheimurUrl, getIllustrationUrl, illustrations } from '@reykjavik/hanna-utils/assets';
|
|
3
|
+
export type {
|
|
4
|
+
/** @deprecated Instead `import type { BlingType } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
5
|
+
BlingType,
|
|
6
|
+
/** @deprecated Instead `import type { Efnistakn } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
7
|
+
Efnistakn,
|
|
8
|
+
/** @deprecated Instead `import type { Formheimur } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
9
|
+
Formheimur,
|
|
10
|
+
/** @deprecated Instead `import type { Illustration } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
11
|
+
Illustration, };
|
|
12
|
+
export {
|
|
13
|
+
/** @deprecated Instead `import type { blingTypes } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
14
|
+
blingTypes,
|
|
15
|
+
/** @deprecated Instead `import type { efnistakn } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
16
|
+
efnistakn,
|
|
17
|
+
/** @deprecated Instead `import type { getAssetUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
18
|
+
getAssetUrl,
|
|
19
|
+
/** @deprecated Instead `import type { getBlingUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
20
|
+
getBlingUrl,
|
|
21
|
+
/** @deprecated Instead `import type { getEfnistaknUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
22
|
+
getEfnistaknUrl,
|
|
23
|
+
/** @deprecated Instead `import type { getFormheimurUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
24
|
+
getFormheimurUrl,
|
|
25
|
+
/** @deprecated Instead `import type { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
26
|
+
getIllustrationUrl,
|
|
27
|
+
/** @deprecated Instead `import type { illustrations } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
28
|
+
illustrations, };
|
|
29
|
+
/** @deprecated Use `getCssBundleUrl` from '@reykjavik/hanna-css' instead (Will be reomved in v0.11) */
|
|
30
|
+
export declare const getCssBundleUrl: (cssTokens: string | Array<string>, version?: string) => string;
|
|
31
|
+
/** @deprecated (Will be removed in v0.11) */
|
|
32
|
+
export declare const efnistakn_menu: readonly ["menu/borgarstjori", "menu/borgarstjorn", "menu/bygg_framkv", "menu/fjarmal", "menu/fundargerdir", "menu/itrottir_aftreying", "menu/log_reglugerdir", "menu/mannaudur", "menu/menning", "menu/rad_nefndir", "menu/skipulag", "menu/skolar_fristund", "menu/svid_deildir", "menu/umhverfi_samgongur", "menu/velferd_fjolskylda"];
|
|
33
|
+
/** @deprecated (Will be removed in v0.11) */
|
|
34
|
+
export type Efnistakn_Menu = (typeof efnistakn_menu)[number];
|
|
35
|
+
/** @deprecated (Will be removed in v0.11) */
|
|
36
|
+
export declare const auxiliary_menu_images: Array<Illustration>;
|
|
37
|
+
/** @deprecated Instead `import type { AuxilaryPanelIllustration } from '@reykjavik/hanna-react/MainMenu';` (Will be removed in v0.11) */
|
|
38
|
+
export type Auxilary_MenuImages = (typeof auxiliary_menu_images)[number];
|
|
39
|
+
/** @deprecated Instead `import type { BlingType } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
40
|
+
export type BlingTypes = BlingType;
|
|
41
|
+
/** @deprecated Instead `import type { Illustration } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
42
|
+
export type Illustrations = Illustration;
|
package/esm/assets.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getCssBundleUrl as _getCssBundleUrl } from '@reykjavik/hanna-css';
|
|
2
|
+
import { blingTypes, efnistakn, getAssetUrl, getBlingUrl, getEfnistaknUrl, getFormheimurUrl, getIllustrationUrl, illustrations, } from '@reykjavik/hanna-utils/assets';
|
|
3
|
+
export {
|
|
4
|
+
/** @deprecated Instead `import type { blingTypes } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
5
|
+
blingTypes,
|
|
6
|
+
/** @deprecated Instead `import type { efnistakn } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
7
|
+
efnistakn,
|
|
8
|
+
/** @deprecated Instead `import type { getAssetUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
9
|
+
getAssetUrl,
|
|
10
|
+
/** @deprecated Instead `import type { getBlingUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
11
|
+
getBlingUrl,
|
|
12
|
+
/** @deprecated Instead `import type { getEfnistaknUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
13
|
+
getEfnistaknUrl,
|
|
14
|
+
/** @deprecated Instead `import type { getFormheimurUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
15
|
+
getFormheimurUrl,
|
|
16
|
+
/** @deprecated Instead `import type { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
17
|
+
getIllustrationUrl,
|
|
18
|
+
/** @deprecated Instead `import type { illustrations } from '@reykjavik/hanna-utils/assets';` (Will be removed in v0.11) */
|
|
19
|
+
illustrations, };
|
|
20
|
+
/** @deprecated Use `getCssBundleUrl` from '@reykjavik/hanna-css' instead (Will be reomved in v0.11) */
|
|
21
|
+
export const getCssBundleUrl = (cssTokens,
|
|
22
|
+
/** If you want to pin your CSS files to a specific version */
|
|
23
|
+
version) => _getCssBundleUrl(cssTokens, {
|
|
24
|
+
version: version,
|
|
25
|
+
});
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Based on "https://styles.reykjavik.is/assets/efnistakn/menu/files.json"
|
|
28
|
+
/** @deprecated (Will be removed in v0.11) */
|
|
29
|
+
export const efnistakn_menu = [
|
|
30
|
+
'menu/borgarstjori',
|
|
31
|
+
'menu/borgarstjorn',
|
|
32
|
+
'menu/bygg_framkv',
|
|
33
|
+
'menu/fjarmal',
|
|
34
|
+
'menu/fundargerdir',
|
|
35
|
+
'menu/itrottir_aftreying',
|
|
36
|
+
'menu/log_reglugerdir',
|
|
37
|
+
'menu/mannaudur',
|
|
38
|
+
'menu/menning',
|
|
39
|
+
'menu/rad_nefndir',
|
|
40
|
+
'menu/skipulag',
|
|
41
|
+
'menu/skolar_fristund',
|
|
42
|
+
'menu/svid_deildir',
|
|
43
|
+
'menu/umhverfi_samgongur',
|
|
44
|
+
'menu/velferd_fjolskylda',
|
|
45
|
+
];
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
/** @deprecated (Will be removed in v0.11) */
|
|
48
|
+
export const auxiliary_menu_images = [
|
|
49
|
+
'hanna-veitiggi',
|
|
50
|
+
'hanna-vandro',
|
|
51
|
+
'hanna-hugsi',
|
|
52
|
+
'hanna-hissa',
|
|
53
|
+
'hanna-hahaha',
|
|
54
|
+
'hanna-hae',
|
|
55
|
+
'hanna-god_spurning',
|
|
56
|
+
'hanna-gjuggiborg',
|
|
57
|
+
'hanna-benda',
|
|
58
|
+
];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
2
|
+
/** @depcrecated import `colorFamilies` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
3
|
+
export declare const colorFamilies: readonly ["esja", "faxafloi", "nautholsvik", "heidmork", "ellidaardalur", "blafjoll", "sund", "rokkur", "suld"] & Readonly<Record<import("@reykjavik/hanna-css").ColorFamily, import("@reykjavik/hanna-css").ColorFamily>> & {
|
|
4
|
+
/** @deprecated This is a typo (Will be removed in v0.11) */
|
|
5
|
+
ellidarardalur: string;
|
|
6
|
+
};
|
|
7
|
+
/** @depcrecated import type `ColorFamily` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
8
|
+
export type { ColorFamily } from '@reykjavik/hanna-css';
|
|
9
|
+
/** @depcrecated import `colorThemes` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
10
|
+
export declare const themeOptions: readonly ["trustworthy", "dependable", "friendly", "lively", "colorful"] & Readonly<Record<import("@reykjavik/hanna-css").HannaColorTheme, import("@reykjavik/hanna-css").HannaColorTheme>>;
|
|
11
|
+
/** @depcrecated import type `HannaColorTheme` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
12
|
+
export type { HannaColorTheme as ThemeOption } from '@reykjavik/hanna-css';
|
|
13
|
+
export type Alignment = 'right' | 'left';
|
|
14
|
+
export declare const aligns: Record<string, true | undefined>;
|
|
15
|
+
export type ComponentLayoutProps<Align extends string = 'right'> = EitherObj<{
|
|
16
|
+
wide?: boolean;
|
|
17
|
+
}, {
|
|
18
|
+
align?: Align;
|
|
19
|
+
}>;
|
package/esm/constants.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { colorFamilies as _colorFamilies, colorThemes } from '@reykjavik/hanna-css';
|
|
2
|
+
/** @depcrecated import `colorFamilies` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
3
|
+
export const colorFamilies = Object.assign([
|
|
4
|
+
'esja',
|
|
5
|
+
'faxafloi',
|
|
6
|
+
'nautholsvik',
|
|
7
|
+
'heidmork',
|
|
8
|
+
'ellidaardalur',
|
|
9
|
+
'blafjoll',
|
|
10
|
+
'sund',
|
|
11
|
+
'rokkur',
|
|
12
|
+
'suld',
|
|
13
|
+
], _colorFamilies, {
|
|
14
|
+
/** @deprecated This is a typo (Will be removed in v0.11) */
|
|
15
|
+
ellidarardalur: 'ellidaardalur',
|
|
16
|
+
});
|
|
17
|
+
/** @depcrecated import `colorThemes` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
|
|
18
|
+
export const themeOptions = Object.assign(['trustworthy', 'dependable', 'friendly', 'lively', 'colorful'], colorThemes);
|
|
19
|
+
export const aligns = {
|
|
20
|
+
right: true,
|
|
21
|
+
left: true,
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@reykjavik/hanna-utils/focus-visible';
|