@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
+
import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
|
|
4
|
+
import { Image } from '../_abstract/_Image.js';
|
|
5
|
+
import { Link } from '../_abstract/_Link.js';
|
|
6
|
+
import { colorFamilies, themeOptions } from '../constants.js';
|
|
7
|
+
export const ArticleCarouselCard = (props) => {
|
|
8
|
+
const { date, title, summary, href, target, moreLabel, color, theme, illustration, image, } = props;
|
|
9
|
+
const photo = image === null || image === void 0 ? void 0 : image.photo;
|
|
10
|
+
const imageProps = illustration ? { src: getIllustrationUrl(illustration) } : image;
|
|
11
|
+
return (React.createElement("div", { className: "ArticleCarouselCard", "data-color": color && colorFamilies[color], "data-color-theme": !color ? theme && themeOptions[theme] : undefined },
|
|
12
|
+
React.createElement(Link, { className: "ArticleCarouselCard__link", href: href, target: target },
|
|
13
|
+
' ',
|
|
14
|
+
React.createElement(Image, Object.assign({ placeholder: true, className: getBemClass('ArticleCarouselCard__illustration', photo && 'photo') }, imageProps)),
|
|
15
|
+
React.createElement("h3", { className: "ArticleCarouselCard__title" }, title),
|
|
16
|
+
' '),
|
|
17
|
+
' ',
|
|
18
|
+
date && React.createElement("span", { className: "ArticleCarouselCard__date" }, date),
|
|
19
|
+
React.createElement("div", { className: "ArticleCarouselCard__summary" }, summary),
|
|
20
|
+
moreLabel && (React.createElement(Link, { className: "ArticleCarouselCard__morelink", href: href, target: target, "aria-label": title },
|
|
21
|
+
' ',
|
|
22
|
+
moreLabel,
|
|
23
|
+
' '))));
|
|
24
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ArticleCarouselCardProps, ArticleCarouselImageProps } from './ArticleCarousel/_ArticleCarouselCard.js';
|
|
2
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
import { SSRSupport } from './utils.js';
|
|
4
|
+
export type ArticleCarouselProps = {
|
|
5
|
+
items: Array<ArticleCarouselCardProps>;
|
|
6
|
+
title?: string;
|
|
7
|
+
moreLabel?: string;
|
|
8
|
+
ssr?: SSRSupport;
|
|
9
|
+
} & SeenProp;
|
|
10
|
+
export type { ArticleCarouselCardProps, ArticleCarouselImageProps };
|
|
11
|
+
export declare const ArticleCarousel: (props: ArticleCarouselProps) => JSX.Element;
|
|
12
|
+
export default ArticleCarousel;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AbstractCarousel } from './_abstract/_AbstractCarousel.js';
|
|
3
|
+
import { ArticleCarouselCard, } from './ArticleCarousel/_ArticleCarouselCard.js';
|
|
4
|
+
export const ArticleCarousel = (props) => {
|
|
5
|
+
const { title, items, moreLabel, ssr, startSeen } = props;
|
|
6
|
+
return (React.createElement(AbstractCarousel, { bem: "ArticleCarousel", title: title, items: items, Component: ArticleCarouselCard, ComponentProps: { moreLabel }, ssr: ssr, startSeen: startSeen }));
|
|
7
|
+
};
|
|
8
|
+
export default ArticleCarousel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ArticleMetaItem = {
|
|
2
|
+
label: string;
|
|
3
|
+
href?: string;
|
|
4
|
+
};
|
|
5
|
+
export type ArticleMetaProps = {
|
|
6
|
+
items: Array<ArticleMetaItem>;
|
|
7
|
+
small?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const ArticleMeta: (props: ArticleMetaProps) => JSX.Element | null;
|
|
10
|
+
export default ArticleMeta;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
+
import { Link } from './_abstract/_Link.js';
|
|
4
|
+
export const ArticleMeta = (props) => {
|
|
5
|
+
const { items, small } = props;
|
|
6
|
+
if (items.length === 0) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return (React.createElement("div", { className: getBemClass('ArticleMeta', small && 'small') }, items.map(({ label, href }, i) => (React.createElement(Fragment, { key: i },
|
|
10
|
+
href == null ? (React.createElement("span", { className: "ArticleMeta__item" },
|
|
11
|
+
" ",
|
|
12
|
+
label,
|
|
13
|
+
" ")) : (React.createElement(Link, { className: "ArticleMeta__item", href: href },
|
|
14
|
+
' ',
|
|
15
|
+
label,
|
|
16
|
+
' ')),
|
|
17
|
+
' ')))));
|
|
18
|
+
};
|
|
19
|
+
export default ArticleMeta;
|
package/esm/Attention.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TableProps } from '@hugsmidjan/react/Table';
|
|
2
|
+
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
3
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
4
|
+
export type BasicTableProps = {
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
type?: 'text' | 'number';
|
|
7
|
+
modifier?: string;
|
|
8
|
+
} & EitherObj<{
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
}, {
|
|
11
|
+
align?: 'right';
|
|
12
|
+
}> & SeenProp & Omit<TableProps, 'className' | 'children'>;
|
|
13
|
+
export declare const BasicTable: (props: BasicTableProps) => JSX.Element;
|
|
14
|
+
export default BasicTable;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Table from '@hugsmidjan/react/Table';
|
|
3
|
+
import TableWrapper from '@hugsmidjan/react/TableWrapper';
|
|
4
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
5
|
+
import { useSeenEffect } from './utils/seenEffect.js';
|
|
6
|
+
export const BasicTable = (props) => {
|
|
7
|
+
const { cols, caption, thead, tfoot, align, fullWidth, startSeen } = props;
|
|
8
|
+
const tbodyProps = props.tbodies
|
|
9
|
+
? { tbodies: props.tbodies }
|
|
10
|
+
: { tbody: props.tbody || [] };
|
|
11
|
+
const modifier = props.modifier;
|
|
12
|
+
const [ref] = useSeenEffect(startSeen);
|
|
13
|
+
return (React.createElement(TableWrapper, { modifier: [
|
|
14
|
+
'BasicTable',
|
|
15
|
+
modifier && 'BasicTable--' + modifier,
|
|
16
|
+
fullWidth && 'BasicTable--fullwidth',
|
|
17
|
+
align === 'right' && !fullWidth && 'BasicTable--align--' + align,
|
|
18
|
+
], wrapperRef: ref },
|
|
19
|
+
React.createElement(Table, Object.assign({ className: getBemClass('BasicTable', [
|
|
20
|
+
props.compact && 'compact',
|
|
21
|
+
modifier && modifier,
|
|
22
|
+
]) }, {
|
|
23
|
+
cols,
|
|
24
|
+
caption,
|
|
25
|
+
thead,
|
|
26
|
+
tfoot,
|
|
27
|
+
}, tbodyProps))));
|
|
28
|
+
};
|
|
29
|
+
export default BasicTable;
|
package/esm/BgBox.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { EffectProp, SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
export type BgBoxProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
} & SeenProp & EffectProp;
|
|
7
|
+
export declare const BgBox: (props: BgBoxProps) => JSX.Element;
|
|
8
|
+
export default BgBox;
|
package/esm/BgBox.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
+
import { getEffectAttr, useSeenEffect, } from './utils/seenEffect.js';
|
|
4
|
+
export const BgBox = (props) => {
|
|
5
|
+
const { className, children, effectType, startSeen } = props;
|
|
6
|
+
const [ref] = useSeenEffect(startSeen);
|
|
7
|
+
return (React.createElement("div", Object.assign({ className: getBemClass('BgBox', undefined, className), ref: ref }, getEffectAttr(effectType)), children));
|
|
8
|
+
};
|
|
9
|
+
export default BgBox;
|
package/esm/Bling.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { BlingType } from '@reykjavik/hanna-utils/assets';
|
|
2
|
+
declare const colors: {
|
|
3
|
+
tertiary: boolean;
|
|
4
|
+
secondary: boolean;
|
|
5
|
+
primary: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type BlingColor = keyof typeof colors;
|
|
8
|
+
declare const aligns: {
|
|
9
|
+
left: boolean;
|
|
10
|
+
'left-ish': boolean;
|
|
11
|
+
'left-center': boolean;
|
|
12
|
+
'right-center': boolean;
|
|
13
|
+
'right-ish': boolean;
|
|
14
|
+
right: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type BlingAlignment = keyof typeof aligns;
|
|
17
|
+
declare const valigns: {
|
|
18
|
+
up: boolean;
|
|
19
|
+
'up-ish': boolean;
|
|
20
|
+
center: boolean;
|
|
21
|
+
'down-ish': boolean;
|
|
22
|
+
down: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type BlingVAlignment = keyof typeof valigns;
|
|
25
|
+
declare const parentOffset: {
|
|
26
|
+
top: boolean;
|
|
27
|
+
'top-ish': boolean;
|
|
28
|
+
center: boolean;
|
|
29
|
+
'bottom-ish': boolean;
|
|
30
|
+
bottom: boolean;
|
|
31
|
+
};
|
|
32
|
+
export type BlingParentOffset = keyof typeof parentOffset;
|
|
33
|
+
export type BlingProps = {
|
|
34
|
+
/**
|
|
35
|
+
* Horizontal alignment relative to the bling container's
|
|
36
|
+
* full width
|
|
37
|
+
*
|
|
38
|
+
* NOTE: Blings should always be placed in a layout context
|
|
39
|
+
* where they can stretch to a full (12 columns) width
|
|
40
|
+
*/
|
|
41
|
+
align?: BlingAlignment;
|
|
42
|
+
/**
|
|
43
|
+
* Vertical shift along the vertical insertion point
|
|
44
|
+
*
|
|
45
|
+
* Defult: `center`
|
|
46
|
+
*/
|
|
47
|
+
vertical?: BlingVAlignment;
|
|
48
|
+
/**
|
|
49
|
+
* Vertical positioning of the insertion point within
|
|
50
|
+
* the Bling's offset parent element.
|
|
51
|
+
*
|
|
52
|
+
* Default is the natural layout flow position of the
|
|
53
|
+
* Bling element (no vertical re-positioning)
|
|
54
|
+
*/
|
|
55
|
+
parent?: BlingParentOffset;
|
|
56
|
+
/**
|
|
57
|
+
* Theme color (combo) for the elelment
|
|
58
|
+
*
|
|
59
|
+
* Default: `tertiary`
|
|
60
|
+
*/
|
|
61
|
+
color?: BlingColor;
|
|
62
|
+
/**
|
|
63
|
+
* Gives the Bling a positive `z-index` value.
|
|
64
|
+
*
|
|
65
|
+
* By default Blings layer themselves *underneath* other page content.
|
|
66
|
+
*/
|
|
67
|
+
overlay?: boolean;
|
|
68
|
+
/** Additional className (use sparingly) */
|
|
69
|
+
className?: string;
|
|
70
|
+
} & ({
|
|
71
|
+
/** The name of the Bling shape to display */
|
|
72
|
+
type: BlingType;
|
|
73
|
+
/** Not allowed when `type` is set */
|
|
74
|
+
blingUrl?: undefined;
|
|
75
|
+
} | {
|
|
76
|
+
type?: undefined;
|
|
77
|
+
/** Custom SVG URL to load (use sparingly) */
|
|
78
|
+
blingUrl: string;
|
|
79
|
+
});
|
|
80
|
+
export declare const Bling: (props: BlingProps) => JSX.Element;
|
|
81
|
+
export default Bling;
|
package/esm/Bling.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
+
import { getBlingUrl } from '@reykjavik/hanna-utils/assets';
|
|
4
|
+
import { useGetSVGtext } from './utils/useGetSVGtext.js';
|
|
5
|
+
const colors = {
|
|
6
|
+
tertiary: true,
|
|
7
|
+
secondary: true,
|
|
8
|
+
primary: true,
|
|
9
|
+
};
|
|
10
|
+
const aligns = {
|
|
11
|
+
left: true,
|
|
12
|
+
'left-ish': true,
|
|
13
|
+
'left-center': true,
|
|
14
|
+
'right-center': true,
|
|
15
|
+
'right-ish': true,
|
|
16
|
+
right: true,
|
|
17
|
+
};
|
|
18
|
+
const valigns = {
|
|
19
|
+
up: true,
|
|
20
|
+
'up-ish': true,
|
|
21
|
+
center: true,
|
|
22
|
+
'down-ish': true,
|
|
23
|
+
down: true,
|
|
24
|
+
};
|
|
25
|
+
const parentOffset = {
|
|
26
|
+
top: true,
|
|
27
|
+
'top-ish': true,
|
|
28
|
+
center: true,
|
|
29
|
+
'bottom-ish': true,
|
|
30
|
+
bottom: true,
|
|
31
|
+
};
|
|
32
|
+
export const Bling = (props) => {
|
|
33
|
+
const { align, vertical, color, overlay, type, blingUrl, parent, className } = props;
|
|
34
|
+
const imageUrl = type ? getBlingUrl(type) : blingUrl;
|
|
35
|
+
const inlineSvg = useGetSVGtext(imageUrl);
|
|
36
|
+
return (React.createElement("div", { className: getBemClass('Bling', [
|
|
37
|
+
'align--' + (align && align in aligns ? align : 'left'),
|
|
38
|
+
vertical && vertical in valigns && 'vertical--' + vertical,
|
|
39
|
+
color && color in colors && 'color--' + color,
|
|
40
|
+
parent && parent in parentOffset && 'parent--' + parent,
|
|
41
|
+
overlay && 'overlay',
|
|
42
|
+
], className), "data-bling-type": type, "data-bling-image": !type ? blingUrl : undefined, dangerouslySetInnerHTML: inlineSvg && { __html: inlineSvg.code } }));
|
|
43
|
+
};
|
|
44
|
+
export default Bling;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type BreadCrumb = {
|
|
2
|
+
href?: string;
|
|
3
|
+
label: string;
|
|
4
|
+
};
|
|
5
|
+
export type BreadCrumbTrail = Array<BreadCrumb>;
|
|
6
|
+
export type BreadCrumbsProps = {
|
|
7
|
+
title: string;
|
|
8
|
+
trail: BreadCrumbTrail;
|
|
9
|
+
};
|
|
10
|
+
export declare const BreadCrumbs: (props: BreadCrumbsProps) => JSX.Element | null;
|
|
11
|
+
export default BreadCrumbs;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from './_abstract/_Link.js';
|
|
3
|
+
const BreadCrumbs__item = (props) => {
|
|
4
|
+
const { link, current } = props;
|
|
5
|
+
return link.href != null ? (React.createElement(Link, { className: "BreadCrumbs__item", href: link.href, "aria-current": current || undefined }, link.label)) : (React.createElement("span", { className: "BreadCrumbs__item", "aria-current": current || undefined }, link.label));
|
|
6
|
+
};
|
|
7
|
+
export const BreadCrumbs = (props) => {
|
|
8
|
+
const { title, trail } = props;
|
|
9
|
+
if (trail.length === 0) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const ancestors = trail.slice(0, -1);
|
|
13
|
+
const current = trail[trail.length - 1];
|
|
14
|
+
return (React.createElement("nav", { className: "BreadCrumbs", "aria-label": title },
|
|
15
|
+
React.createElement("span", { className: "BreadCrumbs__title" },
|
|
16
|
+
title,
|
|
17
|
+
":"),
|
|
18
|
+
' ',
|
|
19
|
+
ancestors.map((link, i) => {
|
|
20
|
+
return (React.createElement(React.Fragment, { key: i },
|
|
21
|
+
React.createElement(BreadCrumbs__item, { link: link }),
|
|
22
|
+
' ',
|
|
23
|
+
React.createElement("span", { className: "BreadCrumbs__separator", "aria-label": "" }, ">"),
|
|
24
|
+
' '));
|
|
25
|
+
}),
|
|
26
|
+
React.createElement(BreadCrumbs__item, { link: current, current: true })));
|
|
27
|
+
};
|
|
28
|
+
export default BreadCrumbs;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from './_abstract/_Button.js';
|
|
3
|
+
export type ButtonBackProps = ButtonProps;
|
|
4
|
+
export declare const ButtonBack: (props: ButtonBackProps & {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
export default ButtonBack;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ButtonBarProps = {
|
|
3
|
+
align?: 'right';
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const ButtonBar: {
|
|
7
|
+
(props: ButtonBarProps): JSX.Element;
|
|
8
|
+
/** A Splitter token to use directly inside <ButtonBar/> wrappers */
|
|
9
|
+
Split(): JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Prefer using `ButtonBar.Split` instead.
|
|
13
|
+
*
|
|
14
|
+
* (This export token is only to aid discovery.)
|
|
15
|
+
*/
|
|
16
|
+
export declare const ButtonBar__split: () => JSX.Element;
|
|
17
|
+
export default ButtonBar;
|
package/esm/ButtonBar.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
+
export const ButtonBar = (props) => {
|
|
4
|
+
const { align, children } = props;
|
|
5
|
+
return (React.createElement("div", { className: getBemClass('ButtonBar', align === 'right' && 'align--right') }, children));
|
|
6
|
+
};
|
|
7
|
+
/** A Splitter token to use directly inside <ButtonBar/> wrappers */
|
|
8
|
+
ButtonBar.Split = () => React.createElement("span", { className: "ButtonBar__split" });
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Prefer using `ButtonBar.Split` instead.
|
|
11
|
+
*
|
|
12
|
+
* (This export token is only to aid discovery.)
|
|
13
|
+
*/
|
|
14
|
+
export const ButtonBar__split = ButtonBar.Split;
|
|
15
|
+
export default ButtonBar;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps, ButtonVariantProps } from './_abstract/_Button.js';
|
|
3
|
+
export type ButtonPrimaryProps = ButtonProps & ButtonVariantProps;
|
|
4
|
+
export declare const ButtonPrimary: (props: ButtonPrimaryProps & {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
export default ButtonPrimary;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps, ButtonVariantProps } from './_abstract/_Button.js';
|
|
3
|
+
export type ButtonSecondaryProps = ButtonProps & ButtonVariantProps;
|
|
4
|
+
export declare const ButtonSecondary: (props: ButtonSecondaryProps & {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
export default ButtonSecondary;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps, ButtonVariantProps } from './_abstract/_Button.js';
|
|
3
|
+
type TertiarySize = Extract<ButtonVariantProps['size'], 'normal' | 'small'>;
|
|
4
|
+
type TertiaryIcon = Extract<ButtonVariantProps['icon'], 'none' | 'go-back'>;
|
|
5
|
+
export type ButtonTertiaryProps = ButtonProps & Omit<ButtonVariantProps, 'icon' | 'size'> & {
|
|
6
|
+
size?: TertiarySize;
|
|
7
|
+
icon?: TertiaryIcon;
|
|
8
|
+
};
|
|
9
|
+
export declare const ButtonTertiary: (props: ButtonTertiaryProps & {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
export default ButtonTertiary;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from './_abstract/_Button.js';
|
|
3
|
+
const sizes = {
|
|
4
|
+
normal: 'normal',
|
|
5
|
+
small: 'small',
|
|
6
|
+
};
|
|
7
|
+
const icons = {
|
|
8
|
+
none: 'none',
|
|
9
|
+
'go-back': 'go-back',
|
|
10
|
+
};
|
|
11
|
+
export const ButtonTertiary = (props) => {
|
|
12
|
+
const { size = 'normal', icon = 'none' } = props;
|
|
13
|
+
return React.createElement(Button, Object.assign({ bem: "ButtonTertiary" }, props, { size: sizes[size], icon: icons[icon] }));
|
|
14
|
+
};
|
|
15
|
+
export default ButtonTertiary;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CarouselProps } from './_abstract/_AbstractCarousel.js';
|
|
2
|
+
export type { CarouselProps } from './_abstract/_AbstractCarousel.js';
|
|
3
|
+
export declare const Carousel: <I extends Record<string, unknown> = {}, P extends Record<string, unknown> | undefined = {}>(props: CarouselProps<I, P>) => JSX.Element;
|
|
4
|
+
export default Carousel;
|
package/esm/Carousel.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AbstractCarousel } from './_abstract/_AbstractCarousel.js';
|
|
3
|
+
export const Carousel = (props) => (React.createElement(AbstractCarousel, Object.assign({}, props, { bem: undefined, modifier: undefined, title: undefined })));
|
|
4
|
+
export default Carousel;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import _CarouselStepper from '@hugsmidjan/react/CarouselStepper';
|
|
3
|
+
export const CarouselStepper = (props) => (React.createElement(_CarouselStepper, Object.assign({}, props, { bem: undefined, modifier: undefined })));
|
|
4
|
+
export default CarouselStepper;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { EffectProp, SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
export type CenterColumnProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
} & SeenProp & EffectProp;
|
|
6
|
+
export declare const CenterColumn: (props: CenterColumnProps) => JSX.Element;
|
|
7
|
+
export default CenterColumn;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SeenEffect from './SeenEffect.js';
|
|
3
|
+
export const CenterColumn = (props) => {
|
|
4
|
+
const { children, startSeen, effectType } = props;
|
|
5
|
+
return startSeen == null ? (React.createElement("div", { className: "CenterColumn" }, children)) : (React.createElement(SeenEffect, { className: "CenterColumn", startSeen: startSeen, effectType: effectType }, children));
|
|
6
|
+
};
|
|
7
|
+
export default CenterColumn;
|
package/esm/Checkbox.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TogglerInput } from './_abstract/_TogglerInput.js';
|
|
3
|
+
export const CheckboxButton = (props) => (React.createElement(TogglerInput, Object.assign({ bem: "CheckboxButton" }, props, { type: "checkbox", innerWrap: true })));
|
|
4
|
+
export default CheckboxButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField.js';
|
|
2
|
+
export type CheckboxButtonsGroupProps = TogglerGroupFieldProps & {
|
|
3
|
+
value?: Array<string>;
|
|
4
|
+
defaultValue?: Array<string>;
|
|
5
|
+
/** @deprecated (Will be removed in v0.11) */
|
|
6
|
+
columns?: '2col' | '3col';
|
|
7
|
+
/** @deprecated (Will be removed in v0.11) */
|
|
8
|
+
layout?: 'slim';
|
|
9
|
+
};
|
|
10
|
+
export type CheckboxButtonsGroupOptions = TogglerGroupFieldOptions;
|
|
11
|
+
export declare const CheckboxButtonsGroup: (props: CheckboxButtonsGroupProps) => JSX.Element;
|
|
12
|
+
export default CheckboxButtonsGroup;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TogglerGroupField, } from './_abstract/_TogglerGroupField.js';
|
|
3
|
+
import CheckboxButton from './CheckboxButton.js';
|
|
4
|
+
export const CheckboxButtonsGroup = (props) => {
|
|
5
|
+
if (props.layout) {
|
|
6
|
+
console.warn('`CheckboxButtonsGroupProps.layout` is deprecated.');
|
|
7
|
+
}
|
|
8
|
+
if (props.columns) {
|
|
9
|
+
console.warn('`CheckboxButtonsGroupProps.columns` is deprecated.');
|
|
10
|
+
}
|
|
11
|
+
return (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler: CheckboxButton })));
|
|
12
|
+
};
|
|
13
|
+
export default CheckboxButtonsGroup;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TogglerGroupFieldOption, TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField.js';
|
|
2
|
+
export type CheckboxGroupProps = TogglerGroupFieldProps & {
|
|
3
|
+
layout?: 'inline';
|
|
4
|
+
value?: Array<string>;
|
|
5
|
+
defaultValue?: Array<string>;
|
|
6
|
+
};
|
|
7
|
+
export type CheckboxGroupOption = TogglerGroupFieldOption;
|
|
8
|
+
export type CheckboxGroupOptions = TogglerGroupFieldOptions;
|
|
9
|
+
export declare const CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element;
|
|
10
|
+
export default CheckboxGroup;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TogglerGroupField, } from './_abstract/_TogglerGroupField.js';
|
|
3
|
+
import Checkbox from './Checkbox.js';
|
|
4
|
+
export const CheckboxGroup = (props) => {
|
|
5
|
+
return (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "CheckboxGroup", modifier: props.layout, Toggler: Checkbox })));
|
|
6
|
+
};
|
|
7
|
+
export default CheckboxGroup;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
2
|
+
import { Illustration } from '@reykjavik/hanna-utils/assets';
|
|
3
|
+
import { BlockItem } from './_abstract/_Block.js';
|
|
4
|
+
import { ImageProps } from './_abstract/_Image.js';
|
|
5
|
+
import { SeenProp } from './utils/seenEffect.js';
|
|
6
|
+
import { Alignment } from './constants.js';
|
|
7
|
+
declare const types: {
|
|
8
|
+
largebox: boolean;
|
|
9
|
+
largeimage: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type CityBlockProps = {
|
|
12
|
+
align?: Alignment;
|
|
13
|
+
type?: keyof typeof types;
|
|
14
|
+
content: BlockItem;
|
|
15
|
+
} & EitherObj<{
|
|
16
|
+
illustration: Illustration;
|
|
17
|
+
}, {
|
|
18
|
+
image: ImageProps;
|
|
19
|
+
}> & SeenProp;
|
|
20
|
+
export declare const CityBlock: (props: CityBlockProps) => JSX.Element;
|
|
21
|
+
export default CityBlock;
|
package/esm/CityBlock.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
|
|
3
|
+
import { Block } from './_abstract/_Block.js';
|
|
4
|
+
import { aligns } from './constants.js';
|
|
5
|
+
const types = {
|
|
6
|
+
largebox: true,
|
|
7
|
+
largeimage: true,
|
|
8
|
+
};
|
|
9
|
+
export const CityBlock = (props) => {
|
|
10
|
+
const align = props.align || 'right';
|
|
11
|
+
const type = !props.illustration && props.type; // The presence of illustration prop suppresses type
|
|
12
|
+
const modifier = [aligns[align] && 'align--' + align, type && types[type] && type];
|
|
13
|
+
const imageProps = props.illustration != null
|
|
14
|
+
? { src: getIllustrationUrl(props.illustration) }
|
|
15
|
+
: props.image;
|
|
16
|
+
return (React.createElement(Block, { bem: "CityBlock", modifier: modifier, content: props.content, image: imageProps, startSeen: props.startSeen }));
|
|
17
|
+
};
|
|
18
|
+
export default CityBlock;
|