@reykjavik/hanna-react 0.10.59 → 0.10.60
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 +4 -29
- 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 +8 -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.js +5 -41
- 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 +7 -32
- 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/package.json +4 -378
- package/utils/env.js +2 -4
- 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/AccordionList.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
declare type AccordionListItemProps = {
|
|
4
|
-
title: string | JSX.Element;
|
|
5
|
-
content: string | JSX.Element | undefined;
|
|
6
|
-
id?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare type AccordionListProps = {
|
|
10
|
-
items: Array<AccordionListItemProps>;
|
|
11
|
-
ssr?: SSRSupport;
|
|
12
|
-
wide?: boolean;
|
|
13
|
-
/** Index of those items that should start open */
|
|
14
|
-
defaultOpen?: Array<number>;
|
|
15
|
-
} & SeenProp;
|
|
16
|
-
declare const AccordionList: (props: AccordionListProps) => JSX.Element;
|
|
17
|
-
export default AccordionList;
|
package/esm/AccordionList.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { useDomid, useIsBrowserSide } from '@hugsmidjan/react/hooks';
|
|
3
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
4
|
-
import { useSeenEffect } from './utils/seenEffect';
|
|
5
|
-
const AccordionListItem = (props) => {
|
|
6
|
-
const { title, content, id, disabled = false, defaultOpen, ssr } = props;
|
|
7
|
-
const [open, setOpen] = useState(defaultOpen);
|
|
8
|
-
useEffect(() => setOpen(defaultOpen), [defaultOpen]);
|
|
9
|
-
const domid = useDomid();
|
|
10
|
-
const isBrowser = useIsBrowserSide(ssr);
|
|
11
|
-
const itemDisabled = (isBrowser && disabled) || !content;
|
|
12
|
-
return (React.createElement("div", { className: getBemClass('AccordionList__item', [itemDisabled && 'disabled']), id: id, "data-start-open": defaultOpen || undefined, "data-sprinkled": isBrowser },
|
|
13
|
-
React.createElement("h3", { className: "AccordionList__title" }, isBrowser ? (React.createElement("button", { type: "button", className: "AccordionList__button", "aria-controls": domid, "aria-expanded": open || undefined, onClick: () => {
|
|
14
|
-
setOpen(!open);
|
|
15
|
-
}, disabled: itemDisabled }, title)) : (title)),
|
|
16
|
-
React.createElement("div", { id: isBrowser && domid, className: "AccordionList__content", hidden: isBrowser && (!open || itemDisabled) }, content)));
|
|
17
|
-
};
|
|
18
|
-
// ---------------------------------------------------------------------------
|
|
19
|
-
const AccordionList = (props) => {
|
|
20
|
-
const { items, ssr, wide, defaultOpen, startSeen } = props;
|
|
21
|
-
const [ref] = useSeenEffect(startSeen);
|
|
22
|
-
return (React.createElement("div", { className: getBemClass('AccordionList', [wide && 'wide']), ref: ref }, items.map((item, i) => (React.createElement(AccordionListItem, Object.assign({ key: i }, item, { ssr: ssr, defaultOpen: defaultOpen && defaultOpen.includes(i) }))))));
|
|
23
|
-
};
|
|
24
|
-
export default AccordionList;
|
package/esm/ActionCards.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { TextCardListProps } from './_abstract/_CardList';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
export declare type ActionCardsProps = TextCardListProps & SeenProp;
|
|
4
|
-
declare const ActionCards: (props: ActionCardsProps) => JSX.Element;
|
|
5
|
-
export default ActionCards;
|
package/esm/ActionCards.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CardList } from './_abstract/_CardList';
|
|
3
|
-
import { useSeenEffect } from './utils/seenEffect';
|
|
4
|
-
const ActionCards = (props) => {
|
|
5
|
-
const [ref] = useSeenEffect(props.startSeen);
|
|
6
|
-
return (React.createElement("div", { className: "ActionCards", ref: ref },
|
|
7
|
-
React.createElement(CardList, Object.assign({}, props, { bemPrefix: "ActionCards" }))));
|
|
8
|
-
};
|
|
9
|
-
export default ActionCards;
|
package/esm/Alert.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
3
|
-
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
4
|
-
export declare type AlertI18n = {
|
|
5
|
-
closeLabel: string;
|
|
6
|
-
closeLabelLong?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const defaultAlertTexts: DefaultTexts<AlertI18n>;
|
|
9
|
-
export declare const alertTypes: {
|
|
10
|
-
info: number;
|
|
11
|
-
success: number;
|
|
12
|
-
warning: number;
|
|
13
|
-
error: number;
|
|
14
|
-
critical: number;
|
|
15
|
-
};
|
|
16
|
-
declare type AlertType = keyof typeof alertTypes;
|
|
17
|
-
export declare type AlertProps = {
|
|
18
|
-
type: AlertType;
|
|
19
|
-
closable?: boolean;
|
|
20
|
-
children?: ReactNode;
|
|
21
|
-
childrenHTML?: string;
|
|
22
|
-
/** server-side anchor href */
|
|
23
|
-
closeUrl?: string;
|
|
24
|
-
texts?: AlertI18n;
|
|
25
|
-
lang?: string;
|
|
26
|
-
ssr?: SSRSupport;
|
|
27
|
-
} & ({
|
|
28
|
-
/** Seconds until the Alert auto-closes.
|
|
29
|
-
*
|
|
30
|
-
* Mosueover and keyboard focus resets the timer.
|
|
31
|
-
*/
|
|
32
|
-
autoClose: number;
|
|
33
|
-
/** Return `false` to prevent the alert from closing. */
|
|
34
|
-
onClose?: () => void | boolean;
|
|
35
|
-
/** Callback that fires when the alert has closed/transitoned out */
|
|
36
|
-
onClosed: () => void;
|
|
37
|
-
} | {
|
|
38
|
-
autoClose?: never;
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated This signature with the `event` argument will be removed in hanna-react v0.9
|
|
41
|
-
*
|
|
42
|
-
* Return `false` to prevent the alert from closing
|
|
43
|
-
*/
|
|
44
|
-
onClose?(event: MouseEvent): void | boolean;
|
|
45
|
-
/** Callback that fires after the alert has closed/transitoned out */
|
|
46
|
-
onClosed?(): void;
|
|
47
|
-
});
|
|
48
|
-
declare const Alert: (props: AlertProps) => JSX.Element;
|
|
49
|
-
export default Alert;
|
package/esm/Alert.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState, } from 'react';
|
|
2
|
-
import { useIsBrowserSide, useOnMount } from '@hugsmidjan/react/hooks';
|
|
3
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
4
|
-
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
5
|
-
import Button from './_abstract/_Button';
|
|
6
|
-
import { isPreact } from './utils/env';
|
|
7
|
-
// FIXME: Eventually import from @reykjavik/hanna-styles/constants
|
|
8
|
-
const AlertCloseTransitionDuration = 400;
|
|
9
|
-
const useAutoClosing = (autoClose) => {
|
|
10
|
-
const [temp, setTemp] = useState(0);
|
|
11
|
-
if (!autoClose) {
|
|
12
|
-
return { autoClosing: false };
|
|
13
|
-
}
|
|
14
|
-
const thaw = () => setTemp((temp) => temp + 1);
|
|
15
|
-
const freeze = () => setTemp((temp) => temp - 1);
|
|
16
|
-
return {
|
|
17
|
-
autoClosing: temp === 0,
|
|
18
|
-
autoClosingProps: Object.assign({ onMouseEnter: freeze, onMouseLeave: thaw, onFocus: freeze, onBlur: thaw }, (isPreact
|
|
19
|
-
? {
|
|
20
|
-
onfocusin: (e) => e.currentTarget !== e.target && freeze(),
|
|
21
|
-
onfocusout: (e) => e.currentTarget !== e.target && thaw(),
|
|
22
|
-
}
|
|
23
|
-
: undefined)),
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export const defaultAlertTexts = {
|
|
27
|
-
en: { closeLabel: 'Hide' },
|
|
28
|
-
is: { closeLabel: 'Fela' },
|
|
29
|
-
};
|
|
30
|
-
export const alertTypes = {
|
|
31
|
-
info: 1,
|
|
32
|
-
success: 1,
|
|
33
|
-
warning: 1,
|
|
34
|
-
error: 1,
|
|
35
|
-
critical: 1,
|
|
36
|
-
};
|
|
37
|
-
const Alert = (props) => {
|
|
38
|
-
const { type, childrenHTML, children, onClose, closeUrl, closable = !!(onClose || closeUrl != null), ssr, onClosed, } = props;
|
|
39
|
-
const autoClose = props.autoClose && props.autoClose > 0 ? props.autoClose : 0;
|
|
40
|
-
const closing = useRef();
|
|
41
|
-
const [open, setOpen] = useState(!!ssr);
|
|
42
|
-
const isBrowser = useIsBrowserSide(ssr);
|
|
43
|
-
const showCloseButton = closable && (isBrowser || closeUrl != null);
|
|
44
|
-
const { closeLabel, closeLabelLong } = getTexts(props, defaultAlertTexts);
|
|
45
|
-
useOnMount(() => {
|
|
46
|
-
setOpen(true);
|
|
47
|
-
});
|
|
48
|
-
const closeAlert = useCallback((event) => {
|
|
49
|
-
const ret = onClose &&
|
|
50
|
-
// @ts-expect-error (@deprecated `event` parameter will be removed in v0.9)
|
|
51
|
-
onClose(event);
|
|
52
|
-
if (ret !== false) {
|
|
53
|
-
setOpen(false);
|
|
54
|
-
if (closing.current) {
|
|
55
|
-
clearTimeout(closing.current);
|
|
56
|
-
closing.current = undefined;
|
|
57
|
-
}
|
|
58
|
-
closing.current = setTimeout(() => {
|
|
59
|
-
onClosed && onClosed();
|
|
60
|
-
}, AlertCloseTransitionDuration);
|
|
61
|
-
}
|
|
62
|
-
}, [onClose, onClosed]);
|
|
63
|
-
const { autoClosing, autoClosingProps } = useAutoClosing(autoClose);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
if (autoClosing) {
|
|
66
|
-
let autoCloseTimeout;
|
|
67
|
-
autoCloseTimeout = setTimeout(() => {
|
|
68
|
-
closeAlert();
|
|
69
|
-
}, autoClose * 1000);
|
|
70
|
-
return () => {
|
|
71
|
-
if (autoCloseTimeout) {
|
|
72
|
-
clearTimeout(autoCloseTimeout);
|
|
73
|
-
autoCloseTimeout = undefined;
|
|
74
|
-
}
|
|
75
|
-
if (closing.current) {
|
|
76
|
-
clearTimeout(closing.current);
|
|
77
|
-
closing.current = undefined;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}, [closeAlert, autoClosing, autoClose]);
|
|
82
|
-
return (React.createElement("div", Object.assign({ className: getBemClass('Alert', [
|
|
83
|
-
!!alertTypes[type] && type,
|
|
84
|
-
closable && 'closable',
|
|
85
|
-
]), role: "alert", hidden: !open || undefined }, autoClosingProps),
|
|
86
|
-
childrenHTML ? (React.createElement("div", { dangerouslySetInnerHTML: { __html: childrenHTML } })) : (children),
|
|
87
|
-
' ',
|
|
88
|
-
showCloseButton && (React.createElement(Button, Object.assign({ bem: "Alert__close" }, (closeUrl != null ? { href: closeUrl } : { type: 'button' }), { onClick: (e) => {
|
|
89
|
-
closeAlert(e);
|
|
90
|
-
}, "aria-label": closeLabelLong, title: closeLabelLong || closeLabel }), closeLabel))));
|
|
91
|
-
};
|
|
92
|
-
export default Alert;
|
package/esm/ArticleCards.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Resolve } from '@reykjavik/hanna-utils';
|
|
2
|
-
import { ImageCardListProps, ImageCardProps } from './_abstract/_CardList';
|
|
3
|
-
export declare type ArticleCardProps = ImageCardProps;
|
|
4
|
-
export declare type ArticleCardsProps = Resolve<Pick<ImageCardListProps, 'cards' | 'imgPlaceholder'>>;
|
|
5
|
-
declare const ArticleCards: (props: ArticleCardsProps) => JSX.Element;
|
|
6
|
-
export default ArticleCards;
|
package/esm/ArticleCards.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CardList } from './_abstract/_CardList';
|
|
3
|
-
const ArticleCards = (props) => (React.createElement(CardList, { bemPrefix: "ArticleCards", standalone: true, cards: props.cards, imgPlaceholder: props.imgPlaceholder || true }));
|
|
4
|
-
export default ArticleCards;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { HannaColorTheme } from '@reykjavik/hanna-css';
|
|
2
|
-
import { Illustration } from '@reykjavik/hanna-utils/assets';
|
|
3
|
-
import { ImageProps } from '../_abstract/_Image';
|
|
4
|
-
import { ColorFamily } from '../constants';
|
|
5
|
-
export declare type ArticleCarouselImageProps = ImageProps & {
|
|
6
|
-
photo?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare type ArticleCarouselCardProps = {
|
|
9
|
-
date?: string;
|
|
10
|
-
title: string;
|
|
11
|
-
summary: string;
|
|
12
|
-
href: string;
|
|
13
|
-
color?: ColorFamily;
|
|
14
|
-
/** NOTE: if both `color` and `theme` are specified
|
|
15
|
-
* then `color` takes precedence.
|
|
16
|
-
*/
|
|
17
|
-
theme?: HannaColorTheme;
|
|
18
|
-
} & ({
|
|
19
|
-
illustration: Illustration;
|
|
20
|
-
image?: undefined;
|
|
21
|
-
} | {
|
|
22
|
-
illustration?: undefined;
|
|
23
|
-
image: ArticleCarouselImageProps | undefined;
|
|
24
|
-
});
|
|
25
|
-
export declare const ArticleCarouselCard: (props: ArticleCarouselCardProps & {
|
|
26
|
-
moreLabel?: string;
|
|
27
|
-
}) => JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
|
|
4
|
-
import Image from '../_abstract/_Image';
|
|
5
|
-
import { Link } from '../_abstract/_Link';
|
|
6
|
-
import { colorFamilies, themeOptions } from '../constants';
|
|
7
|
-
export const ArticleCarouselCard = (props) => {
|
|
8
|
-
const { date, title, summary, href, moreLabel, color, theme, illustration, image } = props;
|
|
9
|
-
const photo = image === null || image === void 0 ? void 0 : image.photo;
|
|
10
|
-
const imageProps = illustration ? { src: getIllustrationUrl(illustration) } : image;
|
|
11
|
-
return (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 },
|
|
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, "aria-label": title },
|
|
21
|
-
' ',
|
|
22
|
-
moreLabel,
|
|
23
|
-
' '))));
|
|
24
|
-
};
|
package/esm/ArticleCarousel.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
2
|
-
import { ArticleCarouselCardProps, ArticleCarouselImageProps } from './ArticleCarousel/_ArticleCarouselCard';
|
|
3
|
-
import { SeenProp } from './utils/seenEffect';
|
|
4
|
-
export declare type ArticleCarouselProps = {
|
|
5
|
-
items: Array<ArticleCarouselCardProps>;
|
|
6
|
-
title?: string;
|
|
7
|
-
moreLabel?: string;
|
|
8
|
-
ssr?: SSRSupport;
|
|
9
|
-
} & SeenProp;
|
|
10
|
-
export type { ArticleCarouselCardProps, ArticleCarouselImageProps };
|
|
11
|
-
declare const ArticleCarousel: (props: ArticleCarouselProps) => JSX.Element;
|
|
12
|
-
export default ArticleCarousel;
|
package/esm/ArticleCarousel.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import AbstractCarousel from './_abstract/_AbstractCarousel';
|
|
3
|
-
import { ArticleCarouselCard, } from './ArticleCarousel/_ArticleCarouselCard';
|
|
4
|
-
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;
|
package/esm/ArticleMeta.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare type ArticleMetaItem = {
|
|
2
|
-
label: string;
|
|
3
|
-
href?: string;
|
|
4
|
-
};
|
|
5
|
-
export declare type ArticleMetaProps = {
|
|
6
|
-
items: Array<ArticleMetaItem>;
|
|
7
|
-
small?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const ArticleMeta: (props: ArticleMetaProps) => JSX.Element | null;
|
|
10
|
-
export default ArticleMeta;
|
package/esm/ArticleMeta.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import { Link } from './_abstract/_Link';
|
|
4
|
-
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.d.ts
DELETED
package/esm/Attention.js
DELETED
package/esm/BasicTable.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TableProps } from '@hugsmidjan/react/Table';
|
|
2
|
-
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
declare type BasicTableProps = {
|
|
4
|
-
compact?: boolean;
|
|
5
|
-
type?: 'text' | 'number';
|
|
6
|
-
children?: undefined;
|
|
7
|
-
modifier?: string;
|
|
8
|
-
fullWidth?: boolean;
|
|
9
|
-
align?: 'right';
|
|
10
|
-
} & SeenProp & Omit<TableProps, 'className' | 'children'>;
|
|
11
|
-
declare const BasicTable: (props: BasicTableProps) => JSX.Element;
|
|
12
|
-
export default BasicTable;
|
package/esm/BasicTable.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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';
|
|
6
|
-
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
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { EffectProp, SeenProp } from './utils/seenEffect';
|
|
3
|
-
export declare type BgBoxProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
} & SeenProp & EffectProp;
|
|
7
|
-
declare const BgBox: (props: BgBoxProps) => JSX.Element;
|
|
8
|
-
export default BgBox;
|
package/esm/BgBox.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import getBemClass from '@hugsmidjan/react/utils/getBemClass';
|
|
3
|
-
import { getEffectAttr, useSeenEffect } from './utils/seenEffect';
|
|
4
|
-
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
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { BlingType } from '@reykjavik/hanna-utils/assets';
|
|
2
|
-
declare const colors: {
|
|
3
|
-
tertiary: boolean;
|
|
4
|
-
secondary: boolean;
|
|
5
|
-
primary: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare 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 declare 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 declare 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 declare type BlingParentOffset = keyof typeof parentOffset;
|
|
33
|
-
export declare 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
|
-
declare const Bling: (props: BlingProps) => JSX.Element;
|
|
81
|
-
export default Bling;
|
package/esm/Bling.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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';
|
|
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
|
-
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;
|
package/esm/BlockBreak.d.ts
DELETED
package/esm/BlockBreak.js
DELETED
package/esm/BlockQuote.d.ts
DELETED
package/esm/BlockQuote.js
DELETED
package/esm/BreadCrumbs.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare type BreadCrumb = {
|
|
2
|
-
href?: string;
|
|
3
|
-
label: string;
|
|
4
|
-
};
|
|
5
|
-
export declare type BreadCrumbTrail = Array<BreadCrumb>;
|
|
6
|
-
export declare type BreadCrumbsProps = {
|
|
7
|
-
title: string;
|
|
8
|
-
trail: BreadCrumbTrail;
|
|
9
|
-
};
|
|
10
|
-
declare const BreadCrumbs: (props: BreadCrumbsProps) => JSX.Element | null;
|
|
11
|
-
export default BreadCrumbs;
|
package/esm/BreadCrumbs.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Link } from './_abstract/_Link';
|
|
3
|
-
const BreadCrumbs__item = (props) => {
|
|
4
|
-
const { link, current } = props;
|
|
5
|
-
return link.href != null ? (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
|
-
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;
|
package/esm/ButtonBack.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ButtonProps } from './_abstract/_Button';
|
|
3
|
-
export declare type ButtonBackProps = ButtonProps;
|
|
4
|
-
declare const ButtonBack: (props: ButtonBackProps & {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
-
export default ButtonBack;
|
package/esm/ButtonBack.js
DELETED
package/esm/ButtonBar.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export declare type ButtonBarProps = {
|
|
3
|
-
align?: 'right';
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
};
|
|
6
|
-
export declare const ButtonBar: {
|
|
7
|
-
(props: ButtonBarProps): JSX.Element;
|
|
8
|
-
Split(): JSX.Element;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Prefer using `ButtonBar.Split` instead.
|
|
12
|
-
*
|
|
13
|
-
* (This export token is only to aid discovery.)
|
|
14
|
-
*/
|
|
15
|
-
export declare const ButtonBar__split: () => JSX.Element;
|
|
16
|
-
export default ButtonBar;
|
package/esm/ButtonBar.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
ButtonBar.Split = () => React.createElement("span", { className: "ButtonBar__split" });
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Prefer using `ButtonBar.Split` instead.
|
|
10
|
-
*
|
|
11
|
-
* (This export token is only to aid discovery.)
|
|
12
|
-
*/
|
|
13
|
-
export const ButtonBar__split = ButtonBar.Split;
|
|
14
|
-
export default ButtonBar;
|