@reykjavik/hanna-react 0.10.59 → 0.10.62
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.js +3 -28
- package/ActionCards.js +2 -4
- package/Alert.js +7 -32
- package/ArticleCards.js +2 -4
- package/ArticleCarousel/_ArticleCarouselCard.js +4 -6
- package/ArticleCarousel.js +3 -5
- package/ArticleMeta.js +3 -28
- package/Attention.js +3 -5
- package/BasicTable.js +5 -7
- package/BgBox.js +3 -5
- package/Bling.js +3 -5
- package/BlockBreak.js +2 -4
- package/BlockQuote.js +2 -4
- package/BreadCrumbs.js +2 -4
- package/ButtonBack.js +3 -5
- package/ButtonBar.js +3 -5
- package/ButtonPrimary.js +3 -5
- package/ButtonSecondary.js +3 -5
- package/ButtonTertiary.js +3 -5
- package/CHANGELOG.md +24 -0
- package/Carousel.js +3 -5
- package/CarouselStepper.js +3 -5
- package/CenterColumn.js +3 -5
- package/Checkbox.js +3 -5
- package/CheckboxButtonsGroup.js +4 -6
- package/CheckboxGroup.js +4 -6
- package/CityBlock.js +3 -5
- package/ContactBubble.js +4 -29
- package/ContentArticle.js +8 -10
- package/ContentImage.js +3 -5
- package/Datepicker.js +6 -31
- package/ExtraLinks.js +4 -17
- package/FeatureList.js +3 -5
- package/FieldGroup.js +3 -5
- package/FileInput.d.ts +16 -1
- package/FileInput.js +24 -61
- package/Foonote.js +2 -4
- package/FooterBadges.js +2 -4
- package/FooterInfo.js +3 -5
- package/Footnote.js +2 -4
- package/Form.js +3 -5
- package/FormField.js +3 -28
- package/Gallery/_GalleryItem.js +6 -42
- package/Gallery/_GalleryModal.js +6 -31
- package/Gallery/_GalleryModalContext.js +2 -4
- package/Gallery/_GalleryModalItem.js +4 -17
- package/Gallery.js +6 -31
- package/GridBlocks.js +5 -7
- package/Heading.js +3 -5
- package/HeroBlock.js +5 -7
- package/IframeBlock.d.ts +5 -1
- package/IframeBlock.js +6 -8
- package/Illustration.js +3 -5
- package/ImageCards.js +4 -17
- package/InfoBlock.js +2 -4
- package/InfoHero.js +7 -9
- package/IslandBlock.js +3 -5
- package/IslandPageBlock.js +3 -5
- package/LabeledTextBlock.js +4 -6
- package/Layout.js +4 -6
- package/MainMenu/_Auxiliary.js +2 -4
- package/MainMenu/_PrimaryPanel.js +3 -5
- package/MainMenu.js +5 -30
- package/MiniMetrics.js +4 -6
- package/Modal.js +3 -5
- package/NameCard.js +5 -7
- package/NameCards.js +3 -5
- package/NewsHero.js +6 -8
- package/PageFilter.js +4 -6
- package/PageHeading.js +3 -5
- package/Picture.js +4 -6
- package/ProcessOverview.js +3 -5
- package/PullQuote.js +2 -4
- package/RadioButtonsGroup.js +4 -6
- package/RadioGroup.js +4 -6
- package/RelatedLinks.js +2 -4
- package/RowBlock.js +3 -5
- package/RowBlockColumn.js +3 -5
- package/SearchInput.js +5 -41
- package/SearchResults/_SearchResultsItem.js +3 -5
- package/SearchResults.js +7 -32
- package/SeenEffect.js +3 -16
- package/Selectbox.js +6 -42
- package/ShareButtons.js +2 -24
- package/Sharpie.js +3 -5
- package/SiteSearchAutocomplete.js +5 -41
- package/SiteSearchCurtain.js +3 -28
- package/SiteSearchInput.d.ts +1 -1
- package/SiteSearchInput.js +4 -40
- package/Skeleton.js +4 -6
- package/SubHeading.js +3 -5
- package/Tabs.js +3 -28
- package/TagPill.js +5 -18
- package/TextBlock.js +3 -5
- package/TextButton.js +3 -5
- package/TextInput.js +5 -41
- package/VSpacer.js +3 -5
- package/VerticalTabsTOC.js +3 -28
- package/WizardLayout.js +3 -5
- package/WizardLayoutClose.js +3 -5
- package/WizardStepper.js +3 -5
- package/_abstract/_AbstractCarousel.js +45 -95
- package/_abstract/_Blings.js +3 -5
- package/_abstract/_Block.js +5 -7
- package/_abstract/_Button.js +4 -17
- package/_abstract/_CardList.js +4 -6
- package/_abstract/_Image.js +3 -5
- package/_abstract/_Link.js +2 -4
- package/_abstract/_Quote.js +2 -4
- package/_abstract/_TogglerGroup.js +8 -8
- package/_abstract/_TogglerGroupField.js +6 -19
- package/_abstract/_TogglerInput.js +4 -17
- package/_abstract/breakOnNL.js +2 -4
- package/assets.d.ts +1 -1
- package/package.json +4 -378
- package/utils/env.js +2 -4
- package/utils/seenEffect.d.ts +3 -4
- package/utils/seenEffect.js +20 -19
- package/utils/useScrollbarWidthCSSVar.js +2 -4
- package/utils.js +3 -16
- package/esm/AccordionList.d.ts +0 -17
- package/esm/AccordionList.js +0 -24
- package/esm/ActionCards.d.ts +0 -5
- package/esm/ActionCards.js +0 -9
- package/esm/Alert.d.ts +0 -49
- package/esm/Alert.js +0 -92
- package/esm/ArticleCards.d.ts +0 -6
- package/esm/ArticleCards.js +0 -4
- package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +0 -27
- package/esm/ArticleCarousel/_ArticleCarouselCard.js +0 -24
- package/esm/ArticleCarousel.d.ts +0 -12
- package/esm/ArticleCarousel.js +0 -8
- package/esm/ArticleMeta.d.ts +0 -10
- package/esm/ArticleMeta.js +0 -19
- package/esm/Attention.d.ts +0 -7
- package/esm/Attention.js +0 -4
- package/esm/BasicTable.d.ts +0 -12
- package/esm/BasicTable.js +0 -29
- package/esm/BgBox.d.ts +0 -8
- package/esm/BgBox.js +0 -9
- package/esm/Bling.d.ts +0 -81
- package/esm/Bling.js +0 -44
- package/esm/BlockBreak.d.ts +0 -2
- package/esm/BlockBreak.js +0 -6
- package/esm/BlockQuote.d.ts +0 -4
- package/esm/BlockQuote.js +0 -4
- package/esm/BreadCrumbs.d.ts +0 -11
- package/esm/BreadCrumbs.js +0 -28
- package/esm/ButtonBack.d.ts +0 -7
- package/esm/ButtonBack.js +0 -4
- package/esm/ButtonBar.d.ts +0 -16
- package/esm/ButtonBar.js +0 -14
- package/esm/ButtonPrimary.d.ts +0 -7
- package/esm/ButtonPrimary.js +0 -4
- package/esm/ButtonSecondary.d.ts +0 -7
- package/esm/ButtonSecondary.js +0 -4
- package/esm/ButtonTertiary.d.ts +0 -12
- package/esm/ButtonTertiary.js +0 -15
- package/esm/Carousel.d.ts +0 -4
- package/esm/Carousel.js +0 -4
- package/esm/CarouselStepper.d.ts +0 -4
- package/esm/CarouselStepper.js +0 -4
- package/esm/CenterColumn.d.ts +0 -7
- package/esm/CenterColumn.js +0 -7
- package/esm/Checkbox.d.ts +0 -4
- package/esm/Checkbox.js +0 -4
- package/esm/CheckboxButtonsGroup.d.ts +0 -11
- package/esm/CheckboxButtonsGroup.js +0 -14
- package/esm/CheckboxGroup.d.ts +0 -9
- package/esm/CheckboxGroup.js +0 -7
- package/esm/CityBlock.d.ts +0 -23
- package/esm/CityBlock.js +0 -18
- package/esm/ContactBubble.d.ts +0 -58
- package/esm/ContactBubble.js +0 -148
- package/esm/ContentArticle.d.ts +0 -15
- package/esm/ContentArticle.js +0 -21
- package/esm/ContentImage.d.ts +0 -8
- package/esm/ContentImage.js +0 -18
- package/esm/Datepicker.d.ts +0 -39
- package/esm/Datepicker.js +0 -63
- package/esm/ExtraLinks.d.ts +0 -18
- package/esm/ExtraLinks.js +0 -34
- package/esm/FeatureList.d.ts +0 -12
- package/esm/FeatureList.js +0 -16
- package/esm/FieldGroup.d.ts +0 -9
- package/esm/FieldGroup.js +0 -9
- package/esm/FileInput.d.ts +0 -17
- package/esm/FileInput.js +0 -154
- package/esm/Foonote.d.ts +0 -12
- package/esm/Foonote.js +0 -7
- package/esm/FooterBadges.d.ts +0 -9
- package/esm/FooterBadges.js +0 -12
- package/esm/FooterInfo.d.ts +0 -18
- package/esm/FooterInfo.js +0 -9
- package/esm/Footnote.d.ts +0 -6
- package/esm/Footnote.js +0 -3
- package/esm/Form.d.ts +0 -7
- package/esm/Form.js +0 -10
- package/esm/FormField.d.ts +0 -65
- package/esm/FormField.js +0 -91
- package/esm/Gallery/_GalleryItem.d.ts +0 -8
- package/esm/Gallery/_GalleryItem.js +0 -30
- package/esm/Gallery/_GalleryModal.d.ts +0 -6
- package/esm/Gallery/_GalleryModal.js +0 -54
- package/esm/Gallery/_GalleryModalContext.d.ts +0 -9
- package/esm/Gallery/_GalleryModalContext.js +0 -3
- package/esm/Gallery/_GalleryModalItem.d.ts +0 -3
- package/esm/Gallery/_GalleryModalItem.js +0 -22
- package/esm/Gallery.d.ts +0 -17
- package/esm/Gallery.js +0 -27
- package/esm/GridBlocks.d.ts +0 -26
- package/esm/GridBlocks.js +0 -24
- package/esm/Heading.d.ts +0 -16
- package/esm/Heading.js +0 -17
- package/esm/HeroBlock.d.ts +0 -19
- package/esm/HeroBlock.js +0 -21
- package/esm/IframeBlock.d.ts +0 -23
- package/esm/IframeBlock.js +0 -26
- package/esm/Illustration.d.ts +0 -13
- package/esm/Illustration.js +0 -8
- package/esm/ImageCards.d.ts +0 -8
- package/esm/ImageCards.js +0 -22
- package/esm/InfoBlock.d.ts +0 -17
- package/esm/InfoBlock.js +0 -13
- package/esm/InfoHero.d.ts +0 -17
- package/esm/InfoHero.js +0 -82
- package/esm/IslandBlock.d.ts +0 -25
- package/esm/IslandBlock.js +0 -16
- package/esm/IslandPageBlock.d.ts +0 -24
- package/esm/IslandPageBlock.js +0 -16
- package/esm/LabeledTextBlock.d.ts +0 -11
- package/esm/LabeledTextBlock.js +0 -14
- package/esm/Layout.d.ts +0 -33
- package/esm/Layout.js +0 -52
- package/esm/MainMenu/_Auxiliary.d.ts +0 -6
- package/esm/MainMenu/_Auxiliary.js +0 -13
- package/esm/MainMenu/_PrimaryPanel.d.ts +0 -13
- package/esm/MainMenu/_PrimaryPanel.js +0 -22
- package/esm/MainMenu.d.ts +0 -48
- package/esm/MainMenu.js +0 -136
- package/esm/MiniMetrics.d.ts +0 -8
- package/esm/MiniMetrics.js +0 -12
- package/esm/Modal.d.ts +0 -10
- package/esm/Modal.js +0 -14
- package/esm/NameCard.d.ts +0 -64
- package/esm/NameCard.js +0 -82
- package/esm/NameCards.d.ts +0 -6
- package/esm/NameCards.js +0 -7
- package/esm/NewsHero.d.ts +0 -14
- package/esm/NewsHero.js +0 -86
- package/esm/PageFilter.d.ts +0 -17
- package/esm/PageFilter.js +0 -15
- package/esm/PageHeading.d.ts +0 -10
- package/esm/PageHeading.js +0 -12
- package/esm/Picture.d.ts +0 -7
- package/esm/Picture.js +0 -8
- package/esm/ProcessOverview.d.ts +0 -13
- package/esm/ProcessOverview.js +0 -17
- package/esm/PullQuote.d.ts +0 -4
- package/esm/PullQuote.js +0 -4
- package/esm/RadioButtonsGroup.d.ts +0 -11
- package/esm/RadioButtonsGroup.js +0 -14
- package/esm/RadioGroup.d.ts +0 -13
- package/esm/RadioGroup.js +0 -7
- package/esm/RelatedLinks.d.ts +0 -20
- package/esm/RelatedLinks.js +0 -26
- package/esm/RowBlock.d.ts +0 -12
- package/esm/RowBlock.js +0 -9
- package/esm/RowBlockColumn.d.ts +0 -8
- package/esm/RowBlockColumn.js +0 -11
- package/esm/SearchInput.d.ts +0 -18
- package/esm/SearchInput.js +0 -33
- package/esm/SearchResults/_SearchResultsItem.d.ts +0 -18
- package/esm/SearchResults/_SearchResultsItem.js +0 -15
- package/esm/SearchResults.d.ts +0 -33
- package/esm/SearchResults.js +0 -109
- package/esm/SeenEffect.d.ts +0 -4
- package/esm/SeenEffect.js +0 -19
- package/esm/Selectbox.d.ts +0 -8
- package/esm/Selectbox.js +0 -46
- package/esm/ShareButtons.d.ts +0 -9
- package/esm/ShareButtons.js +0 -51
- package/esm/Sharpie.d.ts +0 -23
- package/esm/Sharpie.js +0 -22
- package/esm/SiteSearchAutocomplete.d.ts +0 -40
- package/esm/SiteSearchAutocomplete.js +0 -58
- package/esm/SiteSearchCurtain.d.ts +0 -6
- package/esm/SiteSearchCurtain.js +0 -33
- package/esm/SiteSearchInput.d.ts +0 -24
- package/esm/SiteSearchInput.js +0 -40
- package/esm/Skeleton.d.ts +0 -25
- package/esm/Skeleton.js +0 -30
- package/esm/SubHeading.d.ts +0 -10
- package/esm/SubHeading.js +0 -13
- package/esm/Tabs.d.ts +0 -35
- package/esm/Tabs.js +0 -94
- package/esm/TagPill.d.ts +0 -27
- package/esm/TagPill.js +0 -43
- package/esm/TextBlock.d.ts +0 -15
- package/esm/TextBlock.js +0 -15
- package/esm/TextButton.d.ts +0 -9
- package/esm/TextButton.js +0 -9
- package/esm/TextInput.d.ts +0 -16
- package/esm/TextInput.js +0 -35
- package/esm/VSpacer.d.ts +0 -24
- package/esm/VSpacer.js +0 -41
- package/esm/VerticalTabsTOC.d.ts +0 -14
- package/esm/VerticalTabsTOC.js +0 -68
- package/esm/WizardLayout.d.ts +0 -15
- package/esm/WizardLayout.js +0 -30
- package/esm/WizardLayoutClose.d.ts +0 -3
- package/esm/WizardLayoutClose.js +0 -4
- package/esm/WizardStepper.d.ts +0 -36
- package/esm/WizardStepper.js +0 -25
- package/esm/_abstract/_AbstractCarousel.d.ts +0 -25
- package/esm/_abstract/_AbstractCarousel.js +0 -130
- package/esm/_abstract/_Blings.d.ts +0 -11
- package/esm/_abstract/_Blings.js +0 -12
- package/esm/_abstract/_Block.d.ts +0 -22
- package/esm/_abstract/_Block.js +0 -24
- package/esm/_abstract/_Button.d.ts +0 -40
- package/esm/_abstract/_Button.js +0 -47
- package/esm/_abstract/_CardList.d.ts +0 -30
- package/esm/_abstract/_CardList.js +0 -38
- package/esm/_abstract/_Image.d.ts +0 -36
- package/esm/_abstract/_Image.js +0 -27
- package/esm/_abstract/_Link.d.ts +0 -27
- package/esm/_abstract/_Link.js +0 -24
- package/esm/_abstract/_Quote.d.ts +0 -9
- package/esm/_abstract/_Quote.js +0 -8
- package/esm/_abstract/_TogglerGroup.d.ts +0 -31
- package/esm/_abstract/_TogglerGroup.js +0 -29
- package/esm/_abstract/_TogglerGroupField.d.ts +0 -17
- package/esm/_abstract/_TogglerGroupField.js +0 -22
- package/esm/_abstract/_TogglerInput.d.ts +0 -22
- package/esm/_abstract/_TogglerInput.js +0 -33
- package/esm/_abstract/breakOnNL.d.ts +0 -2
- package/esm/_abstract/breakOnNL.js +0 -8
- package/esm/assets.d.ts +0 -42
- package/esm/assets.js +0 -56
- package/esm/constants.d.ts +0 -39
- package/esm/constants.js +0 -22
- package/esm/focus-visible.d.ts +0 -1
- package/esm/focus-visible.js +0 -1
- package/esm/package.json +0 -1
- package/esm/utils/env.d.ts +0 -1
- package/esm/utils/env.js +0 -8
- package/esm/utils/seenEffect.d.ts +0 -28
- package/esm/utils/seenEffect.js +0 -73
- package/esm/utils/useFormatMonitor.d.ts +0 -38
- package/esm/utils/useFormatMonitor.js +0 -41
- package/esm/utils/useGetSVGtext.d.ts +0 -6
- package/esm/utils/useGetSVGtext.js +0 -19
- package/esm/utils/useMenuToggling.d.ts +0 -8
- package/esm/utils/useMenuToggling.js +0 -62
- package/esm/utils/useScrollbarWidthCSSVar.d.ts +0 -1
- package/esm/utils/useScrollbarWidthCSSVar.js +0 -3
- package/esm/utils.d.ts +0 -2
- package/esm/utils.js +0 -2
package/esm/MainMenu.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
2
|
-
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
3
|
-
import { AuxilaryPanelIllustration, AuxiliaryPanelProps } from './MainMenu/_Auxiliary';
|
|
4
|
-
export declare type MainMenuI18n = {
|
|
5
|
-
lang?: string;
|
|
6
|
-
backToMenu: string;
|
|
7
|
-
backToMenuLong?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const defaultMainMenuTexts: DefaultTexts<MainMenuI18n>;
|
|
10
|
-
export type { AuxilaryPanelIllustration, AuxiliaryPanelProps };
|
|
11
|
-
export declare type MainMenuItem = {
|
|
12
|
-
label: string;
|
|
13
|
-
labelLong?: string;
|
|
14
|
-
lang?: string;
|
|
15
|
-
modifier?: string;
|
|
16
|
-
current?: boolean;
|
|
17
|
-
href?: string;
|
|
18
|
-
onClick?: (index: number, item: MainMenuItem) => void;
|
|
19
|
-
controlsId?: string;
|
|
20
|
-
};
|
|
21
|
-
export declare type MainMenuSeparator = '---';
|
|
22
|
-
export declare type MainMenuItemList = Array<MainMenuItem | MainMenuSeparator>;
|
|
23
|
-
export declare type MegaMenuItem = {
|
|
24
|
-
label: string;
|
|
25
|
-
summary?: string;
|
|
26
|
-
href: string;
|
|
27
|
-
lang?: string;
|
|
28
|
-
current?: boolean;
|
|
29
|
-
target?: string;
|
|
30
|
-
};
|
|
31
|
-
export declare type MegaMenuPanel = {
|
|
32
|
-
title: string;
|
|
33
|
-
items: Array<MegaMenuItem>;
|
|
34
|
-
id: string;
|
|
35
|
-
};
|
|
36
|
-
export declare type MainMenuProps = {
|
|
37
|
-
title: string;
|
|
38
|
-
items: MainMenuItemList;
|
|
39
|
-
megaPanels?: Array<MegaMenuPanel>;
|
|
40
|
-
auxiliaryPanel?: AuxiliaryPanelProps;
|
|
41
|
-
onItemClick?: (index: number, item: MainMenuItem) => void;
|
|
42
|
-
activePanelId?: string;
|
|
43
|
-
texts?: MainMenuI18n;
|
|
44
|
-
lang?: string;
|
|
45
|
-
ssr?: SSRSupport;
|
|
46
|
-
};
|
|
47
|
-
declare const MainMenu: (props: MainMenuProps) => JSX.Element | null;
|
|
48
|
-
export default MainMenu;
|
package/esm/MainMenu.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import focusElm from '@hugsmidjan/qj/focusElm';
|
|
3
|
-
import { useIsBrowserSide } from '@hugsmidjan/react/hooks';
|
|
4
|
-
import useShortState from '@hugsmidjan/react/hooks/useShortState';
|
|
5
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
6
|
-
import { getPageScrollElm } from '@reykjavik/hanna-utils';
|
|
7
|
-
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
8
|
-
import { Link } from './_abstract/_Link';
|
|
9
|
-
import { AuxiliaryPanel, } from './MainMenu/_Auxiliary';
|
|
10
|
-
import { PrimaryPanel } from './MainMenu/_PrimaryPanel';
|
|
11
|
-
import { useFormatMonitor } from './utils/useFormatMonitor';
|
|
12
|
-
const findActivePanel = (megaPanels, activeId) => activeId ? megaPanels.find((panel) => activeId === panel.id) : undefined;
|
|
13
|
-
export const defaultMainMenuTexts = {
|
|
14
|
-
is: { lang: 'is', backToMenu: 'Loka', backToMenuLong: 'Til baka í valmynd' },
|
|
15
|
-
en: { lang: 'en', backToMenu: 'Close', backToMenuLong: 'Close and return to menu' },
|
|
16
|
-
};
|
|
17
|
-
const MainMenu = (props) => {
|
|
18
|
-
const { title, megaPanels = [], onItemClick, ssr, auxiliaryPanel } = props;
|
|
19
|
-
const isBrowser = useIsBrowserSide(ssr);
|
|
20
|
-
const menuElmRef = useRef(null);
|
|
21
|
-
const pressedLinkRef = useRef(null);
|
|
22
|
-
const activePanelRef = useRef(null);
|
|
23
|
-
const [activePanel, _setActivePanel] = useState(() => isBrowser && findActivePanel(megaPanels, props.activePanelId));
|
|
24
|
-
const [laggyActivePanel, setLaggyActivePanel] = useShortState();
|
|
25
|
-
const setActivePanel = useCallback((newActive, setFocus = true) => {
|
|
26
|
-
const htmlElmDataset = document.documentElement.dataset;
|
|
27
|
-
// const menuElm = menuElmRef.current as HTMLElement;
|
|
28
|
-
_setActivePanel((activePanel) => {
|
|
29
|
-
const scrollElm = getPageScrollElm();
|
|
30
|
-
if (!newActive) {
|
|
31
|
-
activePanel && setLaggyActivePanel(activePanel, 1000);
|
|
32
|
-
scrollElm.scrollTop = parseInt(htmlElmDataset.scrollTop || '') || 0;
|
|
33
|
-
delete htmlElmDataset.scrollTop;
|
|
34
|
-
delete htmlElmDataset.megaPanelActive;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
setLaggyActivePanel(undefined, 0);
|
|
38
|
-
htmlElmDataset.scrollTop = String(scrollElm.scrollTop);
|
|
39
|
-
scrollElm.scrollTop = 0;
|
|
40
|
-
htmlElmDataset.megaPanelActive = '';
|
|
41
|
-
}
|
|
42
|
-
if (setFocus) {
|
|
43
|
-
const pressedLinkElm = pressedLinkRef.current; // pressedLinkElm will be undefined when setTimeout fires
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
if (!newActive) {
|
|
46
|
-
// const buttonElm = menuElm.querySelector<HTMLButtonElement>(
|
|
47
|
-
// 'button.MainMenu__link[aria-pressed="true"]'
|
|
48
|
-
// );
|
|
49
|
-
focusElm(pressedLinkElm);
|
|
50
|
-
}
|
|
51
|
-
else if (newActive !== activePanel) {
|
|
52
|
-
// const panelElm = menuElm.querySelector<HTMLButtonElement>(
|
|
53
|
-
// '.PrimaryPanel--active'
|
|
54
|
-
// );
|
|
55
|
-
focusElm(activePanelRef.current);
|
|
56
|
-
}
|
|
57
|
-
}, 100);
|
|
58
|
-
}
|
|
59
|
-
return newActive;
|
|
60
|
-
});
|
|
61
|
-
}, [setLaggyActivePanel]);
|
|
62
|
-
useFormatMonitor((media) => {
|
|
63
|
-
if (media.leftTopmenu) {
|
|
64
|
-
setActivePanel(undefined);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
const hasActivePanel = !!activePanel;
|
|
68
|
-
const menuItems = useMemo(() => props.items.map((item) => {
|
|
69
|
-
if (item === '---') {
|
|
70
|
-
return item;
|
|
71
|
-
}
|
|
72
|
-
const href = item.href;
|
|
73
|
-
const controlsId = item.controlsId || (href && /^#/.test(href) && href.slice(1)) || undefined;
|
|
74
|
-
return Object.assign(Object.assign({}, item), { controlsId, megaPanel: controlsId && megaPanels.find((panel) => panel.id === controlsId) });
|
|
75
|
-
}), [props.items, megaPanels]);
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
setActivePanel(findActivePanel(megaPanels, props.activePanelId));
|
|
78
|
-
}, [props.activePanelId, megaPanels, setActivePanel]);
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
const menuElm = menuElmRef.current;
|
|
81
|
-
if (!hasActivePanel || !menuElm) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const escHandler = (e) => {
|
|
85
|
-
if (e.key === 'Escape') {
|
|
86
|
-
setActivePanel(undefined);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const clickHandler = (e) => {
|
|
90
|
-
if (!menuElm.contains(e.target)) {
|
|
91
|
-
setActivePanel(undefined);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
document.addEventListener('keydown', escHandler);
|
|
95
|
-
document.addEventListener('click', clickHandler, true);
|
|
96
|
-
return () => {
|
|
97
|
-
document.removeEventListener('keydown', escHandler);
|
|
98
|
-
document.removeEventListener('click', clickHandler, true);
|
|
99
|
-
};
|
|
100
|
-
}, [hasActivePanel, setActivePanel]);
|
|
101
|
-
if (menuItems.length === 0) {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
return (React.createElement("nav", { className: "MainMenu", "aria-label": title, "data-sprinkled": isBrowser, ref: menuElmRef },
|
|
105
|
-
React.createElement("h2", { className: "MainMenu__title" }, title),
|
|
106
|
-
React.createElement("ul", { className: "MainMenu__items" }, menuItems.map((item, i) => {
|
|
107
|
-
if (item === '---') {
|
|
108
|
-
return React.createElement("li", { key: i, className: "MainMenu__separator", "aria-hidden": "true" });
|
|
109
|
-
}
|
|
110
|
-
const { label, labelLong, lang, controlsId, onClick } = item;
|
|
111
|
-
const pressed = (activePanel && controlsId === activePanel.id) || undefined;
|
|
112
|
-
return (React.createElement("li", { key: i, className: getBemClass('MainMenu__item', item.modifier), "aria-current": item.current || undefined }, onClick || (!!item.megaPanel && (isBrowser || item.href != null)) ? (
|
|
113
|
-
// only print script-driven buttons in the browser
|
|
114
|
-
React.createElement("button", { className: "MainMenu__link", onClick: () => {
|
|
115
|
-
item.megaPanel && setActivePanel(item.megaPanel);
|
|
116
|
-
onClick && onClick(i, item);
|
|
117
|
-
onItemClick && onItemClick(i, item);
|
|
118
|
-
}, ref: pressed && pressedLinkRef, "aria-pressed": pressed, "aria-controls": controlsId, "aria-label": labelLong, title: labelLong, lang: lang, type: "button" }, label)) : item.href != null ? (
|
|
119
|
-
// always render links server-side
|
|
120
|
-
React.createElement(Link, { className: "MainMenu__link", href: item.href, "aria-label": labelLong, title: labelLong, onClick: onItemClick && (() => onItemClick(i, item)), lang: lang }, label)) : undefined // skip rendering non-link menu items server side
|
|
121
|
-
));
|
|
122
|
-
})),
|
|
123
|
-
'\n\n',
|
|
124
|
-
megaPanels.length > 0 && (React.createElement("div", { className: getBemClass('MainMenu__panelsWrap', [activePanel && 'active']) },
|
|
125
|
-
React.createElement("ul", { className: "MainMenu__panels" },
|
|
126
|
-
megaPanels.map((panel, i) => {
|
|
127
|
-
if (!panel.items.length) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
const isActive = activePanel === panel || laggyActivePanel === panel || undefined;
|
|
131
|
-
const isParent = !!panel.items.find((item) => item.current);
|
|
132
|
-
return (React.createElement(PrimaryPanel, { key: i, isParent: isParent, isActive: isActive, panel: panel, isBrowser: isBrowser, setActivePanel: setActivePanel, texts: getTexts(props, defaultMainMenuTexts), activeRef: activePanelRef }));
|
|
133
|
-
}),
|
|
134
|
-
auxiliaryPanel && React.createElement(AuxiliaryPanel, Object.assign({}, auxiliaryPanel)))))));
|
|
135
|
-
};
|
|
136
|
-
export default MainMenu;
|
package/esm/MiniMetrics.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from './_abstract/_Button';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
export declare type MiniMetricsProps = {
|
|
4
|
-
text: string;
|
|
5
|
-
moreButton: ButtonProps;
|
|
6
|
-
} & SeenProp;
|
|
7
|
-
declare const MiniMetrics: (props: MiniMetricsProps) => JSX.Element;
|
|
8
|
-
export default MiniMetrics;
|
package/esm/MiniMetrics.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Button from './_abstract/_Button';
|
|
3
|
-
import SeenEffect from './SeenEffect';
|
|
4
|
-
const MiniMetrics = (props) => {
|
|
5
|
-
const { text, moreButton, startSeen } = props;
|
|
6
|
-
return (React.createElement(SeenEffect, { className: "MiniMetrics", startSeen: startSeen },
|
|
7
|
-
React.createElement("strong", { className: "MiniMetrics__text" }, text),
|
|
8
|
-
" ",
|
|
9
|
-
'\n',
|
|
10
|
-
React.createElement(Button, Object.assign({ bem: "MiniMetrics__more" }, moreButton))));
|
|
11
|
-
};
|
|
12
|
-
export default MiniMetrics;
|
package/esm/Modal.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { ModalProps as _ModalProps } from '@hugsmidjan/react/Modal';
|
|
3
|
-
export declare type ModalProps = _ModalProps & {
|
|
4
|
-
bem?: never;
|
|
5
|
-
bodyWrap?: never;
|
|
6
|
-
modifier?: 'w6' | 'w8' | 'w10';
|
|
7
|
-
bling?: ReactElement;
|
|
8
|
-
};
|
|
9
|
-
declare const Modal: (props: ModalProps) => JSX.Element;
|
|
10
|
-
export default Modal;
|
package/esm/Modal.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import _Modal from '@hugsmidjan/react/Modal';
|
|
3
|
-
const Modal = (props) => {
|
|
4
|
-
const { closeDelay = 500, texts = {
|
|
5
|
-
closeButton: 'Loka ',
|
|
6
|
-
}, bling, children, render = () => children, } = props;
|
|
7
|
-
return (React.createElement(_Modal, Object.assign({}, props, { bodyWrap: false, bem: "Modal", closeDelay: closeDelay, texts: texts, render: (args) => bling ? (React.createElement(React.Fragment, null,
|
|
8
|
-
render(args),
|
|
9
|
-
React.createElement("div", { className: "Modal__blings" },
|
|
10
|
-
React.createElement("div", { className: "Modal__blings__inner" }, bling)))) : (render(args)),
|
|
11
|
-
// eslint-disable-next-line react/no-children-prop
|
|
12
|
-
children: undefined })));
|
|
13
|
-
};
|
|
14
|
-
export default Modal;
|
package/esm/NameCard.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export declare type NameCardI18n = {
|
|
2
|
-
updatedLabel: string;
|
|
3
|
-
availableLabel: string;
|
|
4
|
-
unavailableLabel: string;
|
|
5
|
-
/** @deprecated Use availableLabel instead (will be removed in v0.11) */
|
|
6
|
-
vacancyLabel?: string;
|
|
7
|
-
/** @deprecated Use unavailableLabel instead (will be removed in v0.11) */
|
|
8
|
-
noVacancyLabel?: string;
|
|
9
|
-
/** @deprecated Not used anymore (will be rmoved in v0.11) */
|
|
10
|
-
telLabel?: string;
|
|
11
|
-
};
|
|
12
|
-
declare type ContactInfo = {
|
|
13
|
-
href: string;
|
|
14
|
-
label: string;
|
|
15
|
-
longLabel?: string;
|
|
16
|
-
};
|
|
17
|
-
/** @deprecated use label and longLabel props instead (Will be removed in v0.11) */
|
|
18
|
-
declare type DeprecatedContactInfo = {
|
|
19
|
-
href: string;
|
|
20
|
-
value: string;
|
|
21
|
-
label?: string;
|
|
22
|
-
};
|
|
23
|
-
export declare type NameCardProps = {
|
|
24
|
-
name: string;
|
|
25
|
-
/** Phone numbers, e-mail addresses, etc. */
|
|
26
|
-
contactInfo?: Array<string | ContactInfo | DeprecatedContactInfo>;
|
|
27
|
-
/** Address/location info
|
|
28
|
-
*
|
|
29
|
-
* Special handling of string:
|
|
30
|
-
* Inserts `<br/>`s on `\n`. Collapses multiple `\n`s.
|
|
31
|
-
*
|
|
32
|
-
* Only simple, inline element HTML allowed
|
|
33
|
-
*/
|
|
34
|
-
location?: string | JSX.Element;
|
|
35
|
-
/** Misc info such as opening-hours, etc.
|
|
36
|
-
*
|
|
37
|
-
* Special handling of string:
|
|
38
|
-
* Inserts `<br/>`s on `\n`. Collapses multiple `\n`s.
|
|
39
|
-
*
|
|
40
|
-
* Only simple, inline element HTML allowed
|
|
41
|
-
*/
|
|
42
|
-
aboutText?: string | JSX.Element;
|
|
43
|
-
/**
|
|
44
|
-
* Designated for info about working/opening hours
|
|
45
|
-
*
|
|
46
|
-
* Special handling of string:
|
|
47
|
-
* Inserts `<br/>`s on `\n`. Collapses multiple `\n`s.
|
|
48
|
-
*
|
|
49
|
-
* Only simple, inline element HTML allowed
|
|
50
|
-
*/
|
|
51
|
-
hours?: string | JSX.Element;
|
|
52
|
-
/** Displays "active" indicator. Use for vacancies, inline-status, etc. */
|
|
53
|
-
available?: boolean;
|
|
54
|
-
/** Meta data about freshness status, etc. */
|
|
55
|
-
updated?: string | Date;
|
|
56
|
-
lang?: string;
|
|
57
|
-
texts?: NameCardI18n;
|
|
58
|
-
/** @deprecated Use `available` instead (will be removed in v0.11) */
|
|
59
|
-
vacancy?: boolean;
|
|
60
|
-
/** @deprecated Use `contactInfo` instead (will be removed in v0.11) */
|
|
61
|
-
tel?: string | Array<string>;
|
|
62
|
-
};
|
|
63
|
-
declare const NameCard: (props: NameCardProps) => JSX.Element;
|
|
64
|
-
export default NameCard;
|
package/esm/NameCard.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
4
|
-
import Button from './_abstract/_Button';
|
|
5
|
-
import breakOnNL from './_abstract/breakOnNL';
|
|
6
|
-
const formatDate = (date) => {
|
|
7
|
-
return typeof date === 'string'
|
|
8
|
-
? date
|
|
9
|
-
: date.toISOString().slice(0, 10).replace(/-/g, '.');
|
|
10
|
-
};
|
|
11
|
-
const _telToContactInfo = (tel) => {
|
|
12
|
-
if (!tel) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
tel = typeof tel === 'string' ? [tel] : tel;
|
|
16
|
-
return tel.map((tel) => ({
|
|
17
|
-
href: 'tel:' + tel,
|
|
18
|
-
value: tel,
|
|
19
|
-
}));
|
|
20
|
-
};
|
|
21
|
-
const renderContent = (content) => typeof content === 'string' ? breakOnNL(content) : content;
|
|
22
|
-
const defaultTexts = {
|
|
23
|
-
en: {
|
|
24
|
-
updatedLabel: 'Updated on',
|
|
25
|
-
availableLabel: '',
|
|
26
|
-
unavailableLabel: '',
|
|
27
|
-
vacancyLabel: 'Vacancy',
|
|
28
|
-
noVacancyLabel: 'No vacancy',
|
|
29
|
-
},
|
|
30
|
-
is: {
|
|
31
|
-
updatedLabel: 'Uppfært síðast',
|
|
32
|
-
availableLabel: '',
|
|
33
|
-
unavailableLabel: '',
|
|
34
|
-
vacancyLabel: 'Laus pláss',
|
|
35
|
-
noVacancyLabel: 'Ekki laus pláss',
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
const NameCard = (props) => {
|
|
39
|
-
const { name, location, hours, aboutText, available = props.vacancy, updated } = props;
|
|
40
|
-
const renderMeta = () => {
|
|
41
|
-
if (available == null && !updated) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const texts = getTexts(props, defaultTexts);
|
|
45
|
-
const { updatedLabel, availableLabel, unavailableLabel } = texts;
|
|
46
|
-
return (React.createElement("div", { className: "NameCard__meta" },
|
|
47
|
-
available != null && (React.createElement("span", { className: getBemClass('NameCard__availability', available && 'available') },
|
|
48
|
-
available
|
|
49
|
-
? availableLabel || texts.vacancyLabel
|
|
50
|
-
: unavailableLabel || texts.noVacancyLabel,
|
|
51
|
-
' ')),
|
|
52
|
-
updated != null && (React.createElement("span", { className: "NameCard__updated" },
|
|
53
|
-
updatedLabel,
|
|
54
|
-
" ",
|
|
55
|
-
formatDate(updated)))));
|
|
56
|
-
};
|
|
57
|
-
let contactInfo = props.contactInfo;
|
|
58
|
-
if (!contactInfo) {
|
|
59
|
-
contactInfo = _telToContactInfo(props.tel) || [];
|
|
60
|
-
}
|
|
61
|
-
// Remove/map @deprecated contactinfo items
|
|
62
|
-
const cleanContactInfo = contactInfo.map((item) => {
|
|
63
|
-
if (typeof item !== 'string' && 'value' in item) {
|
|
64
|
-
return {
|
|
65
|
-
href: item.href,
|
|
66
|
-
label: item.value,
|
|
67
|
-
longLabel: item.label,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return item;
|
|
71
|
-
});
|
|
72
|
-
return (React.createElement("div", { className: "NameCard" },
|
|
73
|
-
React.createElement("div", { className: "NameCard__name" }, name),
|
|
74
|
-
contactInfo.length > 0 && (React.createElement("p", { className: "NameCard__contactinfo" }, cleanContactInfo.map((item, i) => (React.createElement(React.Fragment, null,
|
|
75
|
-
typeof item === 'string' ? (React.createElement("span", { className: "NameCard__contactinfo__item" }, item)) : (React.createElement(Button, { key: i, bem: "NameCard__contactinfo__item", href: item.href, "aria-label": item.longLabel, title: item.longLabel }, item.label)),
|
|
76
|
-
' '))))),
|
|
77
|
-
location && React.createElement("p", { className: "NameCard__location" }, renderContent(location)),
|
|
78
|
-
hours && React.createElement("p", { className: "NameCard__hours" }, renderContent(hours)),
|
|
79
|
-
aboutText && React.createElement("p", { className: "NameCard__abouttext" }, renderContent(aboutText)),
|
|
80
|
-
renderMeta()));
|
|
81
|
-
};
|
|
82
|
-
export default NameCard;
|
package/esm/NameCards.d.ts
DELETED
package/esm/NameCards.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import NameCard from './NameCard';
|
|
3
|
-
const NameCards = (props) => {
|
|
4
|
-
const { items } = props;
|
|
5
|
-
return (React.createElement("div", { className: "NameCards" }, items.map((item, i) => (React.createElement(NameCard, Object.assign({ key: i }, item))))));
|
|
6
|
-
};
|
|
7
|
-
export default NameCards;
|
package/esm/NewsHero.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ImageProps } from './_abstract/_Image';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
declare type BlingOptions = 'interesting' | 'snake' | 'pentagon' | 'dome' | 'balls-small' | 'balls-large';
|
|
4
|
-
export declare type NewsHeroProps = {
|
|
5
|
-
title: string;
|
|
6
|
-
meta?: string;
|
|
7
|
-
summary?: string | JSX.Element;
|
|
8
|
-
/** For custom sharing component */
|
|
9
|
-
sharing?: boolean | (() => JSX.Element);
|
|
10
|
-
image?: ImageProps;
|
|
11
|
-
blingType?: BlingOptions;
|
|
12
|
-
} & SeenProp;
|
|
13
|
-
declare const NewsHero: (props: NewsHeroProps) => JSX.Element;
|
|
14
|
-
export default NewsHero;
|
package/esm/NewsHero.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import { getStableRandomItem } from '@reykjavik/hanna-utils';
|
|
4
|
-
import Blings from './_abstract/_Blings';
|
|
5
|
-
import Image from './_abstract/_Image';
|
|
6
|
-
import { useSeenEffect } from './utils/seenEffect';
|
|
7
|
-
import ShareButtons from './ShareButtons';
|
|
8
|
-
const blingOptions = {
|
|
9
|
-
interesting: [
|
|
10
|
-
{
|
|
11
|
-
type: 'circle-xlarge',
|
|
12
|
-
parent: 'center',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
type: 'loops-small',
|
|
16
|
-
color: 'secondary',
|
|
17
|
-
align: 'left-ish',
|
|
18
|
-
vertical: 'down-ish',
|
|
19
|
-
parent: 'center',
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
snake: [
|
|
23
|
-
{
|
|
24
|
-
type: 'snake-large',
|
|
25
|
-
align: 'left',
|
|
26
|
-
parent: 'top',
|
|
27
|
-
vertical: 'down',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
pentagon: [
|
|
31
|
-
{
|
|
32
|
-
type: 'pentagon-large',
|
|
33
|
-
align: 'left',
|
|
34
|
-
parent: 'center',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
dome: [
|
|
38
|
-
{
|
|
39
|
-
type: 'dome-large',
|
|
40
|
-
align: 'left-ish',
|
|
41
|
-
parent: 'top',
|
|
42
|
-
vertical: 'down',
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
'balls-small': [
|
|
46
|
-
{
|
|
47
|
-
type: 'circle-large',
|
|
48
|
-
align: 'left',
|
|
49
|
-
parent: 'center',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
type: 'circle-small',
|
|
53
|
-
color: 'secondary',
|
|
54
|
-
align: 'right',
|
|
55
|
-
parent: 'bottom',
|
|
56
|
-
vertical: 'down',
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
'balls-large': [
|
|
60
|
-
{
|
|
61
|
-
type: 'halfcircle-down-large',
|
|
62
|
-
align: 'left',
|
|
63
|
-
parent: 'bottom',
|
|
64
|
-
vertical: 'up',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
type: 'circle-medium',
|
|
68
|
-
color: 'secondary',
|
|
69
|
-
align: 'left-center',
|
|
70
|
-
parent: 'bottom',
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
};
|
|
74
|
-
const NewsHero = (props) => {
|
|
75
|
-
const { title, sharing = true, meta, summary, image, blingType, startSeen } = props;
|
|
76
|
-
const [ref] = useSeenEffect(startSeen);
|
|
77
|
-
const blings = (blingType && blingOptions[blingType]) || getStableRandomItem(blingOptions, title);
|
|
78
|
-
return (React.createElement("div", { className: getBemClass('NewsHero', [!image && 'align--right']), ref: ref },
|
|
79
|
-
React.createElement("div", { className: "NewsHero__content" },
|
|
80
|
-
React.createElement("h1", { className: "NewsHero__title" }, title),
|
|
81
|
-
meta && React.createElement("span", { className: "NewsHero__meta" }, meta),
|
|
82
|
-
React.createElement("div", { className: "NewsHero__summary" }, summary),
|
|
83
|
-
sharing === true ? React.createElement(ShareButtons, null) : sharing && sharing()),
|
|
84
|
-
image ? (React.createElement(Image, Object.assign({ className: "NewsHero__image" }, image))) : (React.createElement(Blings, { blings: blings }))));
|
|
85
|
-
};
|
|
86
|
-
export default NewsHero;
|
package/esm/PageFilter.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
export declare type PageFilterProps = {
|
|
4
|
-
title: string;
|
|
5
|
-
summary?: React.ReactNode;
|
|
6
|
-
footnote?: React.ReactNode;
|
|
7
|
-
buttonRow?: React.ReactNode;
|
|
8
|
-
underlap?: boolean;
|
|
9
|
-
} & ({
|
|
10
|
-
filters: React.ReactNode;
|
|
11
|
-
children?: never;
|
|
12
|
-
} | {
|
|
13
|
-
filters?: never;
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
}) & SeenProp;
|
|
16
|
-
declare const PageFilter: (props: PageFilterProps) => JSX.Element;
|
|
17
|
-
export default PageFilter;
|
package/esm/PageFilter.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import { useSeenEffect } from './utils/seenEffect';
|
|
4
|
-
import Footnote from './Footnote';
|
|
5
|
-
const PageFilter = (props) => {
|
|
6
|
-
const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen } = props;
|
|
7
|
-
const [ref] = useSeenEffect(startSeen);
|
|
8
|
-
return (React.createElement("div", { className: getBemClass('PageFilter', underlap && 'underlap'), ref: ref },
|
|
9
|
-
React.createElement("h2", { className: "PageFilter__title" }, title),
|
|
10
|
-
summary && React.createElement("div", { className: "PageFilter__summary" }, summary),
|
|
11
|
-
React.createElement("div", { className: "PageFilter__filters" }, filters || children),
|
|
12
|
-
React.createElement("div", { className: "PageFilter__buttons" }, buttonRow),
|
|
13
|
-
footnote && React.createElement(Footnote, null, footnote)));
|
|
14
|
-
};
|
|
15
|
-
export default PageFilter;
|
package/esm/PageHeading.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
export declare type PageHeadingProps = {
|
|
4
|
-
Tag?: 'h1' | 'h2';
|
|
5
|
-
align?: 'right';
|
|
6
|
-
small?: boolean;
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
} & SeenProp;
|
|
9
|
-
declare const PageHeading: (props: PageHeadingProps) => JSX.Element;
|
|
10
|
-
export default PageHeading;
|
package/esm/PageHeading.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import { useSeenEffect } from './utils/seenEffect';
|
|
4
|
-
const PageHeading = (props) => {
|
|
5
|
-
const { Tag = 'h1', align, small, children, startSeen } = props;
|
|
6
|
-
const [ref] = useSeenEffect(startSeen);
|
|
7
|
-
return (React.createElement(Tag, { className: getBemClass('PageHeading', [
|
|
8
|
-
small && 'small',
|
|
9
|
-
align === 'right' && 'align--' + align,
|
|
10
|
-
]), ref: ref }, children));
|
|
11
|
-
};
|
|
12
|
-
export default PageHeading;
|
package/esm/Picture.d.ts
DELETED
package/esm/Picture.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import Image from './_abstract/_Image';
|
|
4
|
-
const Picture = (props) => {
|
|
5
|
-
const { contain, className } = props;
|
|
6
|
-
return (React.createElement(Image, Object.assign({}, props, { className: getBemClass('Picture', contain && 'contain', className) })));
|
|
7
|
-
};
|
|
8
|
-
export default Picture;
|
package/esm/ProcessOverview.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare type ProcessOverviewItemProps = {
|
|
2
|
-
title: string;
|
|
3
|
-
content: string | JSX.Element;
|
|
4
|
-
};
|
|
5
|
-
export declare type ProcessOverviewProps = {
|
|
6
|
-
title: string;
|
|
7
|
-
items: Array<ProcessOverviewItemProps>;
|
|
8
|
-
attention?: string | JSX.Element;
|
|
9
|
-
transparent?: boolean;
|
|
10
|
-
narrow?: boolean;
|
|
11
|
-
};
|
|
12
|
-
declare const ProcessOverview: (props: ProcessOverviewProps) => JSX.Element;
|
|
13
|
-
export default ProcessOverview;
|
package/esm/ProcessOverview.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
const ProcessOverview = (props) => {
|
|
4
|
-
const { title, items, attention, transparent, narrow } = props;
|
|
5
|
-
return (React.createElement("div", { className: getBemClass('ProcessOverview', [
|
|
6
|
-
transparent && 'transparent',
|
|
7
|
-
narrow && 'narrow',
|
|
8
|
-
]) },
|
|
9
|
-
React.createElement("h2", { className: "ProcessOverview__title" }, title),
|
|
10
|
-
items.map(({ title, content }, i) => {
|
|
11
|
-
return (React.createElement("div", { key: i, className: "ProcessOverview__item" },
|
|
12
|
-
React.createElement("h3", { className: "ProcessOverview__item__title" }, title),
|
|
13
|
-
React.createElement("div", { className: "ProcessOverview__item__content" }, content)));
|
|
14
|
-
}),
|
|
15
|
-
attention && React.createElement("div", { className: "ProcessOverview__attention" }, attention)));
|
|
16
|
-
};
|
|
17
|
-
export default ProcessOverview;
|
package/esm/PullQuote.d.ts
DELETED
package/esm/PullQuote.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField';
|
|
2
|
-
export declare type RadioButtonsGroupProps = TogglerGroupFieldProps & {
|
|
3
|
-
value?: string;
|
|
4
|
-
/** @deprecated (Will be removed in v0.9) */
|
|
5
|
-
columns?: '2col' | '3col';
|
|
6
|
-
/** @deprecated (Will be removed in v0.9) */
|
|
7
|
-
layout?: 'slim';
|
|
8
|
-
};
|
|
9
|
-
export declare type RadioButtonsGroupOptions = TogglerGroupFieldOptions;
|
|
10
|
-
declare const RadioButtonsGroup: (props: RadioButtonsGroupProps) => JSX.Element;
|
|
11
|
-
export default RadioButtonsGroup;
|
package/esm/RadioButtonsGroup.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import TogglerGroupField from './_abstract/_TogglerGroupField';
|
|
3
|
-
import TogglerInput from './_abstract/_TogglerInput';
|
|
4
|
-
const RadioButton = (props) => (React.createElement(TogglerInput, Object.assign({}, props, { bem: "RadioButton", type: "radio" })));
|
|
5
|
-
const RadioButtonsGroup = (props) => {
|
|
6
|
-
if (props.layout) {
|
|
7
|
-
console.warn('`RadioButtonsGroupProps.layout` is deprecated.');
|
|
8
|
-
}
|
|
9
|
-
if (props.columns) {
|
|
10
|
-
console.warn('`RadioButtonsGroupProps.columns` is deprecated.');
|
|
11
|
-
}
|
|
12
|
-
return React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "RadioButtonsGroup", Toggler: RadioButton }));
|
|
13
|
-
};
|
|
14
|
-
export default RadioButtonsGroup;
|