@reykjavik/hanna-react 0.10.99 → 0.10.101
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 +2 -2
- package/ActionCards.d.ts +2 -1
- package/ActionCards.js +1 -1
- package/Alert.d.ts +2 -2
- package/Alert.js +20 -12
- package/ArticleCards.d.ts +4 -1
- package/ArticleCards.js +1 -1
- package/ArticleCarousel/_ArticleCarouselCard.js +1 -2
- package/ArticleCarousel.d.ts +2 -2
- package/ArticleCarousel.js +1 -1
- package/ArticleMeta.d.ts +2 -1
- package/ArticleMeta.js +2 -2
- package/Attention.d.ts +2 -1
- package/Attention.js +4 -1
- package/BasicTable.d.ts +2 -1
- package/BgBox.d.ts +2 -1
- package/BgBox.js +4 -2
- package/Bling.d.ts +2 -1
- package/Bling.js +5 -3
- package/BlockBreak.js +1 -0
- package/BreadCrumbs.d.ts +2 -1
- package/BreadCrumbs.js +3 -2
- package/ButtonBack.js +2 -0
- package/ButtonBar.d.ts +4 -3
- package/ButtonBar.js +3 -3
- package/ButtonPrimary.js +2 -0
- package/ButtonSecondary.js +2 -0
- package/ButtonTertiary.js +2 -0
- package/CHANGELOG.md +14 -1
- package/CarouselStepper.d.ts +2 -1
- package/CenterColumn.d.ts +2 -1
- package/CenterColumn.js +4 -2
- package/CheckboxButton.d.ts +4 -2
- package/CheckboxButtonsGroup.js +2 -2
- package/CityBlock.d.ts +2 -1
- package/CityBlock.js +1 -1
- package/ContactBubble.d.ts +2 -2
- package/ContactBubble.js +5 -4
- package/ContentArticle.d.ts +2 -1
- package/ContentArticle.js +3 -2
- package/ContentImage.d.ts +2 -1
- package/ContentImage.js +4 -3
- package/Datepicker.js +6 -6
- package/ExtraLinks.d.ts +2 -1
- package/ExtraLinks.js +4 -2
- package/FeatureList.d.ts +2 -1
- package/FeatureList.js +3 -2
- package/FieldGroup.d.ts +2 -1
- package/FieldGroup.js +4 -2
- package/FileInput.d.ts +2 -2
- package/FileInput.js +10 -5
- package/Foonote.js +3 -4
- package/Footnote.d.ts +2 -1
- package/Footnote.js +2 -1
- package/Form.js +4 -5
- package/FormField.d.ts +25 -5
- package/FormField.js +32 -7
- package/Gallery/_GalleryItem.js +2 -2
- package/Gallery/_GalleryModalItem.js +1 -1
- package/Gallery.d.ts +2 -2
- package/Gallery.js +5 -4
- package/GridBlocks.d.ts +2 -5
- package/GridBlocks.js +3 -3
- package/Heading.d.ts +2 -1
- package/Heading.js +3 -3
- package/HeroBlock.d.ts +2 -1
- package/HeroBlock.js +4 -3
- package/IframeBlock.d.ts +9 -4
- package/IframeBlock.js +13 -12
- package/Illustration.d.ts +2 -1
- package/Illustration.js +1 -1
- package/ImageCards.d.ts +2 -1
- package/ImageCards.js +2 -2
- package/InfoBlock.d.ts +2 -1
- package/InfoBlock.js +3 -2
- package/InfoHero.d.ts +2 -1
- package/InfoHero.js +3 -3
- package/IslandBlock.d.ts +2 -1
- package/IslandBlock.js +2 -2
- package/IslandPageBlock.d.ts +2 -1
- package/IslandPageBlock.js +2 -2
- package/LabeledTextBlock.d.ts +2 -1
- package/LabeledTextBlock.js +2 -2
- package/Layout.d.ts +2 -2
- package/Layout.js +3 -3
- package/MainMenu.d.ts +2 -2
- package/MainMenu.js +4 -3
- package/MiniMetrics.d.ts +2 -1
- package/MiniMetrics.js +3 -2
- package/Modal.d.ts +2 -1
- package/Multiselect.d.ts +11 -6
- package/Multiselect.js +15 -11
- package/NameCard.d.ts +2 -1
- package/NameCard.js +10 -6
- package/NameCards.d.ts +3 -2
- package/NameCards.js +3 -2
- package/NewsHero.d.ts +2 -1
- package/NewsHero.js +3 -3
- package/PageFilter.d.ts +2 -1
- package/PageFilter.js +2 -2
- package/PageHeading.d.ts +2 -1
- package/PageHeading.js +2 -5
- package/Picture.d.ts +2 -1
- package/Picture.js +1 -5
- package/ProcessOverview.d.ts +2 -1
- package/ProcessOverview.js +2 -5
- package/RadioButtonsGroup.js +2 -2
- package/RadioGroup.js +1 -1
- package/ReadSpeakerPlayer.d.ts +1 -1
- package/ReadSpeakerPlayer.js +2 -2
- package/RelatedLinks.d.ts +2 -1
- package/RelatedLinks.js +3 -2
- package/RowBlock.d.ts +2 -1
- package/RowBlock.js +2 -2
- package/RowBlockColumn.d.ts +2 -1
- package/RowBlockColumn.js +3 -3
- package/SearchInput.d.ts +3 -9
- package/SearchInput.js +4 -5
- package/SearchResults/_SearchResultsItem.js +1 -1
- package/SearchResults.d.ts +2 -1
- package/SearchResults.js +2 -2
- package/SeenEffect.js +2 -0
- package/Selectbox.js +3 -4
- package/ShareButtons.d.ts +2 -2
- package/ShareButtons.js +5 -3
- package/Sharpie.d.ts +2 -1
- package/Sharpie.js +2 -2
- package/SiteSearchAutocomplete.d.ts +2 -1
- package/SiteSearchAutocomplete.js +4 -4
- package/SiteSearchCurtain.js +2 -0
- package/SiteSearchInput.d.ts +3 -6
- package/SiteSearchInput.js +4 -4
- package/Skeleton.d.ts +4 -1
- package/Skeleton.js +15 -18
- package/SubHeading.d.ts +2 -1
- package/SubHeading.js +3 -3
- package/Tabs.d.ts +2 -2
- package/Tabs.js +5 -5
- package/TagPill.js +2 -0
- package/TextBlock.d.ts +2 -1
- package/TextBlock.js +3 -3
- package/TextButton.js +2 -0
- package/TextInput.d.ts +2 -2
- package/TextInput.js +3 -4
- package/Tooltip.d.ts +2 -1
- package/Tooltip.js +28 -15
- package/VSpacer.d.ts +2 -1
- package/VSpacer.js +3 -7
- package/VerticalTabsTOC.d.ts +1 -1
- package/VerticalTabsTOC.js +1 -1
- package/WizardLayout.d.ts +2 -2
- package/WizardLayout.js +4 -3
- package/WizardLayoutClose.js +2 -0
- package/WizardStepper.d.ts +2 -1
- package/WizardStepper.js +2 -2
- package/_abstract/_AbstractCarousel.d.ts +2 -2
- package/_abstract/_AbstractCarousel.js +6 -3
- package/_abstract/_Block.d.ts +2 -1
- package/_abstract/_Block.js +3 -3
- package/_abstract/_Button.js +4 -1
- package/_abstract/_CardList.d.ts +3 -1
- package/_abstract/_CardList.js +6 -3
- package/_abstract/_Image.d.ts +6 -3
- package/_abstract/_Image.js +11 -4
- package/_abstract/_Quote.d.ts +2 -1
- package/_abstract/_Quote.js +3 -2
- package/_abstract/_TogglerGroup.js +1 -1
- package/_abstract/_TogglerGroupField.js +5 -5
- package/_abstract/_TogglerInput.d.ts +2 -2
- package/_abstract/_TogglerInput.js +4 -2
- package/esm/AccordionList.d.ts +2 -2
- package/esm/AccordionList.js +3 -3
- package/esm/ActionCards.d.ts +2 -1
- package/esm/ActionCards.js +1 -1
- package/esm/Alert.d.ts +2 -2
- package/esm/Alert.js +21 -13
- package/esm/ArticleCards.d.ts +4 -1
- package/esm/ArticleCards.js +1 -1
- package/esm/ArticleCarousel/_ArticleCarouselCard.js +1 -2
- package/esm/ArticleCarousel.d.ts +2 -2
- package/esm/ArticleCarousel.js +1 -1
- package/esm/ArticleMeta.d.ts +2 -1
- package/esm/ArticleMeta.js +2 -2
- package/esm/Attention.d.ts +2 -1
- package/esm/Attention.js +4 -1
- package/esm/BasicTable.d.ts +2 -1
- package/esm/BgBox.d.ts +2 -1
- package/esm/BgBox.js +4 -2
- package/esm/Bling.d.ts +2 -1
- package/esm/Bling.js +5 -3
- package/esm/BlockBreak.js +1 -0
- package/esm/BreadCrumbs.d.ts +2 -1
- package/esm/BreadCrumbs.js +3 -2
- package/esm/ButtonBack.js +2 -0
- package/esm/ButtonBar.d.ts +4 -3
- package/esm/ButtonBar.js +3 -3
- package/esm/ButtonPrimary.js +2 -0
- package/esm/ButtonSecondary.js +2 -0
- package/esm/ButtonTertiary.js +2 -0
- package/esm/CarouselStepper.d.ts +2 -1
- package/esm/CenterColumn.d.ts +2 -1
- package/esm/CenterColumn.js +4 -2
- package/esm/CheckboxButton.d.ts +4 -2
- package/esm/CheckboxButtonsGroup.js +2 -2
- package/esm/CityBlock.d.ts +2 -1
- package/esm/CityBlock.js +1 -1
- package/esm/ContactBubble.d.ts +2 -2
- package/esm/ContactBubble.js +5 -4
- package/esm/ContentArticle.d.ts +2 -1
- package/esm/ContentArticle.js +3 -2
- package/esm/ContentImage.d.ts +2 -1
- package/esm/ContentImage.js +4 -3
- package/esm/Datepicker.js +7 -7
- package/esm/ExtraLinks.d.ts +2 -1
- package/esm/ExtraLinks.js +4 -2
- package/esm/FeatureList.d.ts +2 -1
- package/esm/FeatureList.js +3 -2
- package/esm/FieldGroup.d.ts +2 -1
- package/esm/FieldGroup.js +4 -2
- package/esm/FileInput.d.ts +2 -2
- package/esm/FileInput.js +10 -5
- package/esm/Foonote.js +2 -2
- package/esm/Footnote.d.ts +2 -1
- package/esm/Footnote.js +2 -1
- package/esm/Form.js +5 -5
- package/esm/FormField.d.ts +25 -5
- package/esm/FormField.js +30 -6
- package/esm/Gallery/_GalleryItem.js +2 -2
- package/esm/Gallery/_GalleryModalItem.js +1 -1
- package/esm/Gallery.d.ts +2 -2
- package/esm/Gallery.js +6 -5
- package/esm/GridBlocks.d.ts +2 -5
- package/esm/GridBlocks.js +3 -3
- package/esm/Heading.d.ts +2 -1
- package/esm/Heading.js +3 -3
- package/esm/HeroBlock.d.ts +2 -1
- package/esm/HeroBlock.js +4 -3
- package/esm/IframeBlock.d.ts +9 -4
- package/esm/IframeBlock.js +13 -12
- package/esm/Illustration.d.ts +2 -1
- package/esm/Illustration.js +1 -1
- package/esm/ImageCards.d.ts +2 -1
- package/esm/ImageCards.js +2 -2
- package/esm/InfoBlock.d.ts +2 -1
- package/esm/InfoBlock.js +3 -2
- package/esm/InfoHero.d.ts +2 -1
- package/esm/InfoHero.js +3 -3
- package/esm/IslandBlock.d.ts +2 -1
- package/esm/IslandBlock.js +2 -2
- package/esm/IslandPageBlock.d.ts +2 -1
- package/esm/IslandPageBlock.js +2 -2
- package/esm/LabeledTextBlock.d.ts +2 -1
- package/esm/LabeledTextBlock.js +2 -2
- package/esm/Layout.d.ts +2 -2
- package/esm/Layout.js +3 -3
- package/esm/MainMenu.d.ts +2 -2
- package/esm/MainMenu.js +4 -3
- package/esm/MiniMetrics.d.ts +2 -1
- package/esm/MiniMetrics.js +3 -2
- package/esm/Modal.d.ts +2 -1
- package/esm/Multiselect.d.ts +11 -6
- package/esm/Multiselect.js +15 -11
- package/esm/NameCard.d.ts +2 -1
- package/esm/NameCard.js +10 -6
- package/esm/NameCards.d.ts +3 -2
- package/esm/NameCards.js +3 -2
- package/esm/NewsHero.d.ts +2 -1
- package/esm/NewsHero.js +3 -3
- package/esm/PageFilter.d.ts +2 -1
- package/esm/PageFilter.js +2 -2
- package/esm/PageHeading.d.ts +2 -1
- package/esm/PageHeading.js +2 -5
- package/esm/Picture.d.ts +2 -1
- package/esm/Picture.js +1 -5
- package/esm/ProcessOverview.d.ts +2 -1
- package/esm/ProcessOverview.js +2 -5
- package/esm/RadioButtonsGroup.js +2 -2
- package/esm/RadioGroup.js +1 -1
- package/esm/ReadSpeakerPlayer.d.ts +1 -1
- package/esm/ReadSpeakerPlayer.js +2 -2
- package/esm/RelatedLinks.d.ts +2 -1
- package/esm/RelatedLinks.js +3 -2
- package/esm/RowBlock.d.ts +2 -1
- package/esm/RowBlock.js +2 -2
- package/esm/RowBlockColumn.d.ts +2 -1
- package/esm/RowBlockColumn.js +3 -3
- package/esm/SearchInput.d.ts +3 -9
- package/esm/SearchInput.js +4 -5
- package/esm/SearchResults/_SearchResultsItem.js +1 -1
- package/esm/SearchResults.d.ts +2 -1
- package/esm/SearchResults.js +2 -2
- package/esm/SeenEffect.js +2 -0
- package/esm/Selectbox.js +3 -4
- package/esm/ShareButtons.d.ts +2 -2
- package/esm/ShareButtons.js +5 -3
- package/esm/Sharpie.d.ts +2 -1
- package/esm/Sharpie.js +2 -2
- package/esm/SiteSearchAutocomplete.d.ts +2 -1
- package/esm/SiteSearchAutocomplete.js +4 -4
- package/esm/SiteSearchCurtain.js +2 -0
- package/esm/SiteSearchInput.d.ts +3 -6
- package/esm/SiteSearchInput.js +4 -4
- package/esm/Skeleton.d.ts +4 -1
- package/esm/Skeleton.js +15 -18
- package/esm/SubHeading.d.ts +2 -1
- package/esm/SubHeading.js +3 -3
- package/esm/Tabs.d.ts +2 -2
- package/esm/Tabs.js +5 -5
- package/esm/TagPill.js +2 -0
- package/esm/TextBlock.d.ts +2 -1
- package/esm/TextBlock.js +3 -3
- package/esm/TextButton.js +2 -0
- package/esm/TextInput.d.ts +2 -2
- package/esm/TextInput.js +3 -4
- package/esm/Tooltip.d.ts +2 -1
- package/esm/Tooltip.js +28 -15
- package/esm/VSpacer.d.ts +2 -1
- package/esm/VSpacer.js +3 -7
- package/esm/VerticalTabsTOC.d.ts +1 -1
- package/esm/VerticalTabsTOC.js +1 -1
- package/esm/WizardLayout.d.ts +2 -2
- package/esm/WizardLayout.js +4 -3
- package/esm/WizardLayoutClose.js +2 -0
- package/esm/WizardStepper.d.ts +2 -1
- package/esm/WizardStepper.js +2 -2
- package/esm/_abstract/_AbstractCarousel.d.ts +2 -2
- package/esm/_abstract/_AbstractCarousel.js +6 -3
- package/esm/_abstract/_Block.d.ts +2 -1
- package/esm/_abstract/_Block.js +3 -3
- package/esm/_abstract/_Button.js +4 -1
- package/esm/_abstract/_CardList.d.ts +3 -1
- package/esm/_abstract/_CardList.js +6 -3
- package/esm/_abstract/_Image.d.ts +6 -3
- package/esm/_abstract/_Image.js +12 -5
- package/esm/_abstract/_Quote.d.ts +2 -1
- package/esm/_abstract/_Quote.js +3 -2
- package/esm/_abstract/_TogglerGroup.js +1 -1
- package/esm/_abstract/_TogglerGroupField.js +5 -5
- package/esm/_abstract/_TogglerInput.d.ts +2 -2
- package/esm/_abstract/_TogglerInput.js +4 -2
- package/esm/utils.d.ts +25 -2
- package/package.json +1 -1
- package/utils.d.ts +25 -2
package/NameCard.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WrapperElmProps } from './utils.js';
|
|
1
2
|
export type NameCardI18n = {
|
|
2
3
|
updatedLabel: string;
|
|
3
4
|
availableLabel: string;
|
|
@@ -59,6 +60,6 @@ export type NameCardProps = {
|
|
|
59
60
|
vacancy?: boolean;
|
|
60
61
|
/** @deprecated Use `contactInfo` instead (will be removed in v0.11) */
|
|
61
62
|
tel?: string | Array<string>;
|
|
62
|
-
};
|
|
63
|
+
} & WrapperElmProps;
|
|
63
64
|
export declare const NameCard: (props: NameCardProps) => JSX.Element;
|
|
64
65
|
export default NameCard;
|
package/NameCard.js
CHANGED
|
@@ -40,7 +40,8 @@ const defaultTexts = {
|
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
42
|
const NameCard = (props) => {
|
|
43
|
-
const { name, location, hours, aboutText, available = props.vacancy,
|
|
43
|
+
const { name, location, hours, aboutText, available = props.vacancy, // eslint-disable-line deprecation/deprecation
|
|
44
|
+
updated, wrapperProps, } = props;
|
|
44
45
|
const renderMeta = () => {
|
|
45
46
|
if (available == null && !updated) {
|
|
46
47
|
return;
|
|
@@ -50,8 +51,9 @@ const NameCard = (props) => {
|
|
|
50
51
|
return (react_1.default.createElement("div", { className: "NameCard__meta" },
|
|
51
52
|
available != null && (react_1.default.createElement("span", { className: (0, classUtils_1.modifiedClass)('NameCard__availability', available && 'available') },
|
|
52
53
|
available
|
|
53
|
-
? availableLabel || texts.vacancyLabel
|
|
54
|
-
: unavailableLabel || texts.noVacancyLabel
|
|
54
|
+
? availableLabel || texts.vacancyLabel // eslint-disable-line deprecation/deprecation
|
|
55
|
+
: unavailableLabel || texts.noVacancyLabel // eslint-disable-line deprecation/deprecation
|
|
56
|
+
,
|
|
55
57
|
' ')),
|
|
56
58
|
updated != null && (react_1.default.createElement("span", { className: "NameCard__updated" },
|
|
57
59
|
updatedLabel,
|
|
@@ -60,10 +62,12 @@ const NameCard = (props) => {
|
|
|
60
62
|
};
|
|
61
63
|
let contactInfo = props.contactInfo;
|
|
62
64
|
if (!contactInfo) {
|
|
63
|
-
contactInfo = _telToContactInfo(props.tel) || [];
|
|
65
|
+
contactInfo = _telToContactInfo(props.tel) || []; // eslint-disable-line deprecation/deprecation
|
|
64
66
|
}
|
|
65
67
|
// Remove/map @deprecated contactinfo items
|
|
66
|
-
const cleanContactInfo = contactInfo.map(
|
|
68
|
+
const cleanContactInfo = contactInfo.map(
|
|
69
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
70
|
+
(item) => {
|
|
67
71
|
if (typeof item !== 'string' && 'value' in item) {
|
|
68
72
|
return {
|
|
69
73
|
href: item.href,
|
|
@@ -73,7 +77,7 @@ const NameCard = (props) => {
|
|
|
73
77
|
}
|
|
74
78
|
return item;
|
|
75
79
|
});
|
|
76
|
-
return (react_1.default.createElement("div", { className:
|
|
80
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('NameCard', null, (wrapperProps || {}).className) }),
|
|
77
81
|
react_1.default.createElement("div", { className: "NameCard__name" }, name),
|
|
78
82
|
contactInfo.length > 0 && (react_1.default.createElement("p", { className: "NameCard__contactinfo" }, cleanContactInfo.map((item, i) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
79
83
|
typeof item === 'string' ? (react_1.default.createElement("span", { className: "NameCard__contactinfo__item" }, item)) : (react_1.default.createElement(_Button_js_1.Button, { key: i, bem: "NameCard__contactinfo__item", href: item.href, "aria-label": item.longLabel, title: item.longLabel }, item.label)),
|
package/NameCards.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NameCardProps } from './NameCard.js';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
type NameCardsProps = {
|
|
3
|
-
items: Array<NameCardProps
|
|
4
|
-
};
|
|
4
|
+
items: Array<Omit<NameCardProps, 'wrapperProps'>>;
|
|
5
|
+
} & WrapperElmProps;
|
|
5
6
|
export declare const NameCards: (props: NameCardsProps) => JSX.Element;
|
|
6
7
|
export default NameCards;
|
package/NameCards.js
CHANGED
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NameCards = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
6
7
|
const NameCard_js_1 = tslib_1.__importDefault(require("./NameCard.js"));
|
|
7
8
|
const NameCards = (props) => {
|
|
8
|
-
const { items } = props;
|
|
9
|
-
return (react_1.default.createElement("div", { className:
|
|
9
|
+
const { items, wrapperProps } = props;
|
|
10
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('NameCards', null, (wrapperProps || {}).className) }), items.map((item, i) => (react_1.default.createElement(NameCard_js_1.default, Object.assign({ key: i }, item))))));
|
|
10
11
|
};
|
|
11
12
|
exports.NameCards = NameCards;
|
|
12
13
|
exports.default = exports.NameCards;
|
package/NewsHero.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ImageProps } from './_abstract/_Image.js';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
import { WrapperElmProps } from './utils.js';
|
|
3
4
|
type BlingOptions = 'interesting' | 'snake' | 'pentagon' | 'dome' | 'balls-small' | 'balls-large';
|
|
4
5
|
export type NewsHeroProps = {
|
|
5
6
|
title: string;
|
|
@@ -9,6 +10,6 @@ export type NewsHeroProps = {
|
|
|
9
10
|
sharing?: boolean | (() => JSX.Element);
|
|
10
11
|
image?: ImageProps;
|
|
11
12
|
blingType?: BlingOptions;
|
|
12
|
-
} & SeenProp;
|
|
13
|
+
} & WrapperElmProps & SeenProp;
|
|
13
14
|
export declare const NewsHero: (props: NewsHeroProps) => JSX.Element;
|
|
14
15
|
export default NewsHero;
|
package/NewsHero.js
CHANGED
|
@@ -76,16 +76,16 @@ const blingOptions = {
|
|
|
76
76
|
],
|
|
77
77
|
};
|
|
78
78
|
const NewsHero = (props) => {
|
|
79
|
-
const { title, sharing = true, meta, summary, image, blingType, startSeen } = props;
|
|
79
|
+
const { title, sharing = true, meta, summary, image, blingType, startSeen, wrapperProps, } = props;
|
|
80
80
|
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
81
81
|
const blings = (blingType && blingOptions[blingType]) || (0, hanna_utils_1.getStableRandomItem)(blingOptions, title);
|
|
82
|
-
return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('NewsHero', [!image && 'align--right']), ref: ref },
|
|
82
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('NewsHero', [!image && 'align--right'], (wrapperProps || {}).className), ref: ref }),
|
|
83
83
|
react_1.default.createElement("div", { className: "NewsHero__content" },
|
|
84
84
|
react_1.default.createElement("h1", { className: "NewsHero__title" }, title),
|
|
85
85
|
meta && react_1.default.createElement("span", { className: "NewsHero__meta" }, meta),
|
|
86
86
|
react_1.default.createElement("div", { className: "NewsHero__summary" }, summary),
|
|
87
87
|
sharing === true ? react_1.default.createElement(ShareButtons_js_1.default, null) : sharing && sharing()),
|
|
88
|
-
image ?
|
|
88
|
+
image ? react_1.default.createElement(_Image_js_1.Image, Object.assign({ bem: "NewsHero__image" }, image)) : react_1.default.createElement(_Blings_js_1.Blings, { blings: blings })));
|
|
89
89
|
};
|
|
90
90
|
exports.NewsHero = NewsHero;
|
|
91
91
|
exports.default = exports.NewsHero;
|
package/PageFilter.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
3
3
|
import { SeenProp } from './utils/seenEffect.js';
|
|
4
|
+
import { WrapperElmProps } from './utils.js';
|
|
4
5
|
export type PageFilterProps = {
|
|
5
6
|
title: string;
|
|
6
7
|
summary?: React.ReactNode;
|
|
@@ -11,6 +12,6 @@ export type PageFilterProps = {
|
|
|
11
12
|
filters: React.ReactNode;
|
|
12
13
|
}, {
|
|
13
14
|
children: React.ReactNode;
|
|
14
|
-
}> & SeenProp;
|
|
15
|
+
}> & WrapperElmProps & SeenProp;
|
|
15
16
|
export declare const PageFilter: (props: PageFilterProps) => JSX.Element;
|
|
16
17
|
export default PageFilter;
|
package/PageFilter.js
CHANGED
|
@@ -7,9 +7,9 @@ const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
|
7
7
|
const seenEffect_js_1 = require("./utils/seenEffect.js");
|
|
8
8
|
const Footnote_js_1 = tslib_1.__importDefault(require("./Footnote.js"));
|
|
9
9
|
const PageFilter = (props) => {
|
|
10
|
-
const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen } = props;
|
|
10
|
+
const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen, wrapperProps, } = props;
|
|
11
11
|
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
12
|
-
return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('PageFilter', underlap && 'underlap'), ref: ref },
|
|
12
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('PageFilter', underlap && 'underlap', (wrapperProps || {}).className), ref: ref }),
|
|
13
13
|
react_1.default.createElement("h2", { className: "PageFilter__title" }, title),
|
|
14
14
|
summary && react_1.default.createElement("div", { className: "PageFilter__summary" }, summary),
|
|
15
15
|
react_1.default.createElement("div", { className: "PageFilter__filters" }, filters || children),
|
package/PageHeading.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
import { WrapperElmProps } from './utils.js';
|
|
3
4
|
export type PageHeadingProps = {
|
|
4
5
|
Tag?: 'h1' | 'h2';
|
|
5
6
|
align?: 'right';
|
|
6
7
|
small?: boolean;
|
|
7
8
|
children: ReactNode;
|
|
8
|
-
} & SeenProp;
|
|
9
|
+
} & WrapperElmProps & SeenProp;
|
|
9
10
|
export declare const PageHeading: (props: PageHeadingProps) => JSX.Element;
|
|
10
11
|
export default PageHeading;
|
package/PageHeading.js
CHANGED
|
@@ -6,12 +6,9 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
7
|
const seenEffect_js_1 = require("./utils/seenEffect.js");
|
|
8
8
|
const PageHeading = (props) => {
|
|
9
|
-
const { Tag = 'h1', align, small, children, startSeen } = props;
|
|
9
|
+
const { Tag = 'h1', align, small, children, startSeen, wrapperProps } = props;
|
|
10
10
|
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
11
|
-
return (react_1.default.createElement(Tag, { className: (0, classUtils_1.modifiedClass)('PageHeading', [
|
|
12
|
-
small && 'small',
|
|
13
|
-
align === 'right' && 'align--' + align,
|
|
14
|
-
]), ref: ref }, children));
|
|
11
|
+
return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('PageHeading', [small && 'small', align === 'right' && 'align--' + align], (wrapperProps || {}).className), ref: ref }), children));
|
|
15
12
|
};
|
|
16
13
|
exports.PageHeading = PageHeading;
|
|
17
14
|
exports.default = exports.PageHeading;
|
package/Picture.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ImagePropsLinked } from './_abstract/_Image.js';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
export type PictureProps = ImagePropsLinked & {
|
|
3
4
|
contain?: boolean;
|
|
4
5
|
className?: string;
|
|
5
|
-
};
|
|
6
|
+
} & WrapperElmProps;
|
|
6
7
|
export declare const Picture: (props: PictureProps) => JSX.Element;
|
|
7
8
|
export default Picture;
|
package/Picture.js
CHANGED
|
@@ -3,11 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Picture = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
6
|
const _Image_js_1 = require("./_abstract/_Image.js");
|
|
8
|
-
const Picture = (props) => {
|
|
9
|
-
const { contain, className } = props;
|
|
10
|
-
return (react_1.default.createElement(_Image_js_1.Image, Object.assign({}, props, { className: (0, classUtils_1.modifiedClass)('Picture', contain && 'contain', className) })));
|
|
11
|
-
};
|
|
7
|
+
const Picture = (props) => (react_1.default.createElement(_Image_js_1.Image, Object.assign({}, props, { bem: "Picture", modifier: props.contain && 'contain' })));
|
|
12
8
|
exports.Picture = Picture;
|
|
13
9
|
exports.default = exports.Picture;
|
package/ProcessOverview.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WrapperElmProps } from './utils.js';
|
|
1
2
|
export type ProcessOverviewItemProps = {
|
|
2
3
|
title: string;
|
|
3
4
|
content: string | JSX.Element;
|
|
@@ -8,6 +9,6 @@ export type ProcessOverviewProps = {
|
|
|
8
9
|
attention?: string | JSX.Element;
|
|
9
10
|
transparent?: boolean;
|
|
10
11
|
narrow?: boolean;
|
|
11
|
-
};
|
|
12
|
+
} & WrapperElmProps;
|
|
12
13
|
export declare const ProcessOverview: (props: ProcessOverviewProps) => JSX.Element;
|
|
13
14
|
export default ProcessOverview;
|
package/ProcessOverview.js
CHANGED
|
@@ -5,11 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
7
|
const ProcessOverview = (props) => {
|
|
8
|
-
const { title, items, attention, transparent, narrow } = props;
|
|
9
|
-
return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('ProcessOverview', [
|
|
10
|
-
transparent && 'transparent',
|
|
11
|
-
narrow && 'narrow',
|
|
12
|
-
]) },
|
|
8
|
+
const { title, items, attention, transparent, narrow, wrapperProps } = props;
|
|
9
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ProcessOverview', [transparent && 'transparent', narrow && 'narrow'], (wrapperProps || {}).className) }),
|
|
13
10
|
react_1.default.createElement("h2", { className: "ProcessOverview__title" }, title),
|
|
14
11
|
items.map(({ title, content }, i) => {
|
|
15
12
|
return (react_1.default.createElement("div", { key: i, className: "ProcessOverview__item" },
|
package/RadioButtonsGroup.js
CHANGED
|
@@ -7,10 +7,10 @@ const _TogglerGroupField_js_1 = require("./_abstract/_TogglerGroupField.js");
|
|
|
7
7
|
const _TogglerInput_js_1 = require("./_abstract/_TogglerInput.js");
|
|
8
8
|
const RadioButton = (props) => (react_1.default.createElement(_TogglerInput_js_1.TogglerInput, Object.assign({}, props, { bem: "RadioButton", type: "radio", innerWrap: true })));
|
|
9
9
|
const RadioButtonsGroup = (props) => {
|
|
10
|
-
if (props.layout) {
|
|
10
|
+
if (props.layout /* eslint-disable-line deprecation/deprecation */) {
|
|
11
11
|
console.warn('`RadioButtonsGroupProps.layout` is deprecated.');
|
|
12
12
|
}
|
|
13
|
-
if (props.columns) {
|
|
13
|
+
if (props.columns /* eslint-disable-line deprecation/deprecation */) {
|
|
14
14
|
console.warn('`RadioButtonsGroupProps.columns` is deprecated.');
|
|
15
15
|
}
|
|
16
16
|
return (react_1.default.createElement(_TogglerGroupField_js_1.TogglerGroupField, Object.assign({}, props, { bem: "RadioButtonsGroup", Toggler: RadioButton, isRadio: true })));
|
package/RadioGroup.js
CHANGED
|
@@ -9,5 +9,5 @@ const Radio = (props) => react_1.default.createElement(_TogglerInput_js_1.Toggle
|
|
|
9
9
|
const RadioGroup = (props) => (react_1.default.createElement(_TogglerGroupField_js_1.TogglerGroupField, Object.assign({}, props, { bem: "RadioGroup", modifier: props.layout, isRadio: true, Toggler: Radio })));
|
|
10
10
|
exports.RadioGroup = RadioGroup;
|
|
11
11
|
/** @deprecated Exposed for testing purposes only. This may disappear at any time. */
|
|
12
|
-
exports.RadioGroup.__Radio = Radio;
|
|
12
|
+
exports.RadioGroup.__Radio = Radio; // eslint-disable-line deprecation/deprecation
|
|
13
13
|
exports.default = exports.RadioGroup;
|
package/ReadSpeakerPlayer.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export type ReadSpeakerPlayerProps = {
|
|
|
49
49
|
/** Tooggles CSS float layout */
|
|
50
50
|
float?: boolean;
|
|
51
51
|
/** Custom HTML attributes for the wrapper element. */
|
|
52
|
-
wrapperProps?: HTMLProps
|
|
52
|
+
wrapperProps?: HTMLProps;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* Embeds a ReadSpeaker player in the page
|
package/ReadSpeakerPlayer.js
CHANGED
|
@@ -19,7 +19,7 @@ exports.defaultReadSpeakerPlayerTexts = {
|
|
|
19
19
|
* @see https://docs.typo3.org/p/readspeaker/readspeaker-services/main/en-us/Configuration/Index.html
|
|
20
20
|
*/
|
|
21
21
|
const ReadSpeakerPlayer = (props) => {
|
|
22
|
-
const { align, float, customerId = '11315', lang = '', voice = /^is(?:_is)?$/i.test(lang) ? 'is_dora' : '', readId = '', readClass = readId ? '' : 'Layout__main', wrapperProps
|
|
22
|
+
const { align, float, customerId = '11315', lang = '', voice = /^is(?:_is)?$/i.test(lang) ? 'is_dora' : '', readId = '', readClass = readId ? '' : 'Layout__main', wrapperProps, texts, } = props;
|
|
23
23
|
const { linkText, linkLabel } = (0, i18n_1.getTexts)({ lang: lang.slice(0, 2), texts }, exports.defaultReadSpeakerPlayerTexts);
|
|
24
24
|
(0, react_1.useEffect)(() => {
|
|
25
25
|
var _a, _b;
|
|
@@ -54,7 +54,7 @@ const ReadSpeakerPlayer = (props) => {
|
|
|
54
54
|
// or multiple different `customerId`s on the same page.
|
|
55
55
|
// If you try that, things will be weird and wonky.
|
|
56
56
|
]);
|
|
57
|
-
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ReadSpeakerPlayer', [align === 'right' && `align-${align}`, float && 'float'], wrapperProps.className) }),
|
|
57
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ReadSpeakerPlayer', [align === 'right' && `align-${align}`, float && 'float'], (wrapperProps || {}).className) }),
|
|
58
58
|
react_1.default.createElement("div", { id: "readspeaker_button1", className: "rs_skip rsbtn rs_preserve" },
|
|
59
59
|
react_1.default.createElement("a", { rel: "nofollow", className: "rsbtn_play", accessKey: "L", title: linkLabel || linkText, href: `https://app-eu.readspeaker.com/cgi-bin/rsent?${new URLSearchParams({
|
|
60
60
|
customerid: customerId,
|
package/RelatedLinks.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
declare const types: {
|
|
3
4
|
readonly external: 1;
|
|
4
5
|
readonly document: 1;
|
|
@@ -16,6 +17,6 @@ export type RelatedLinksProps = {
|
|
|
16
17
|
title?: string;
|
|
17
18
|
titleTag?: 'h2' | 'h3' | 'h4' | 'h5';
|
|
18
19
|
links: Array<RelatedLinkItem>;
|
|
19
|
-
};
|
|
20
|
+
} & WrapperElmProps;
|
|
20
21
|
export declare const RelatedLinks: (props: RelatedLinksProps) => JSX.Element | null;
|
|
21
22
|
export default RelatedLinks;
|
package/RelatedLinks.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RelatedLinks = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
6
7
|
const _Link_js_1 = require("./_abstract/_Link.js");
|
|
7
8
|
const types = {
|
|
8
9
|
external: 1,
|
|
@@ -11,12 +12,12 @@ const types = {
|
|
|
11
12
|
link: 0,
|
|
12
13
|
};
|
|
13
14
|
const RelatedLinks = (props) => {
|
|
14
|
-
const { title, links } = props;
|
|
15
|
+
const { title, links, wrapperProps } = props;
|
|
15
16
|
if (links.length === 0) {
|
|
16
17
|
return null;
|
|
17
18
|
}
|
|
18
19
|
const TitleTag = props.titleTag || 'h3';
|
|
19
|
-
return (react_1.default.createElement("div", { className:
|
|
20
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('RelatedLinks', null, (wrapperProps || {}).className) }),
|
|
20
21
|
title && react_1.default.createElement(TitleTag, { className: "RelatedLinks__title" }, title),
|
|
21
22
|
react_1.default.createElement("ul", { className: "RelatedLinks__list" }, links.map(({ href, label, type, target }, i) => {
|
|
22
23
|
type = type && types[type] ? type : undefined;
|
package/RowBlock.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect.js';
|
|
3
3
|
import { BemModifierProps } from './utils/types.js';
|
|
4
|
+
import { WrapperElmProps } from './utils.js';
|
|
4
5
|
export type RowBlockProps = {
|
|
5
6
|
/** Float the first RowBlockColumn to the right on larger screens. */
|
|
6
7
|
right?: boolean;
|
|
7
8
|
/** Custom **additional** class-name */
|
|
8
9
|
className?: string;
|
|
9
10
|
children: ReactNode;
|
|
10
|
-
} & BemModifierProps & SeenProp;
|
|
11
|
+
} & BemModifierProps & WrapperElmProps & SeenProp;
|
|
11
12
|
export declare const RowBlock: (props: RowBlockProps) => JSX.Element;
|
|
12
13
|
export default RowBlock;
|
package/RowBlock.js
CHANGED
|
@@ -6,9 +6,9 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
7
|
const seenEffect_js_1 = require("./utils/seenEffect.js");
|
|
8
8
|
const RowBlock = (props) => {
|
|
9
|
-
const { right, modifier, className, children, startSeen } = props;
|
|
9
|
+
const { right, modifier, className, children, startSeen, wrapperProps } = props;
|
|
10
10
|
const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
|
|
11
|
-
return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('RowBlock', [modifier, right && 'align--right'], className), ref: ref }, children));
|
|
11
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('RowBlock', [modifier, right && 'align--right'], className || (wrapperProps || {}).className), ref: ref }), children));
|
|
12
12
|
};
|
|
13
13
|
exports.RowBlock = RowBlock;
|
|
14
14
|
exports.default = exports.RowBlock;
|
package/RowBlockColumn.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
export type RowBlockColumnProps = {
|
|
3
4
|
background?: boolean | 'primary';
|
|
4
5
|
narrow?: boolean;
|
|
5
6
|
children: ReactNode;
|
|
6
|
-
};
|
|
7
|
+
} & WrapperElmProps;
|
|
7
8
|
export declare const RowBlockColumn: (props: RowBlockColumnProps) => JSX.Element;
|
|
8
9
|
export default RowBlockColumn;
|
package/RowBlockColumn.js
CHANGED
|
@@ -5,12 +5,12 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
7
|
const RowBlockColumn = (props) => {
|
|
8
|
-
const { background, narrow, children } = props;
|
|
9
|
-
return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('RowBlockColumn', [
|
|
8
|
+
const { background, narrow, children, wrapperProps } = props;
|
|
9
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('RowBlockColumn', [
|
|
10
10
|
narrow && 'narrow',
|
|
11
11
|
background && 'background',
|
|
12
12
|
background === 'primary' && 'background--primary',
|
|
13
|
-
]) }, children));
|
|
13
|
+
], (wrapperProps || {}).className) }), children));
|
|
14
14
|
};
|
|
15
15
|
exports.RowBlockColumn = RowBlockColumn;
|
|
16
16
|
exports.default = exports.RowBlockColumn;
|
package/SearchInput.d.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { FormFieldWrappingProps } from './FormField.js';
|
|
3
|
-
type
|
|
4
|
-
type BaseProps<Type extends {
|
|
5
|
-
type?: string;
|
|
6
|
-
}, InputProps extends object> = {
|
|
3
|
+
export type SearchInputProps = FormFieldWrappingProps & {
|
|
7
4
|
small?: boolean;
|
|
8
|
-
|
|
5
|
+
type?: string;
|
|
9
6
|
onButtonClick?: () => void;
|
|
10
7
|
buttonText?: string;
|
|
11
8
|
inputRef?: RefObject<HTMLInputElement>;
|
|
12
9
|
buttonRef?: RefObject<HTMLButtonElement>;
|
|
13
|
-
} &
|
|
14
|
-
export type SearchInputProps = BaseProps<{
|
|
15
|
-
type?: 'text';
|
|
16
|
-
}, InputElmProps>;
|
|
10
|
+
} & JSX.IntrinsicElements['input'];
|
|
17
11
|
export declare const SearchInput: (props: SearchInputProps) => JSX.Element;
|
|
18
12
|
export default SearchInput;
|
package/SearchInput.js
CHANGED
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SearchInput = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const
|
|
7
|
-
const FormField_js_1 = tslib_1.__importDefault(require("./FormField.js"));
|
|
6
|
+
const FormField_js_1 = tslib_1.__importStar(require("./FormField.js"));
|
|
8
7
|
const SearchInput = (props) => {
|
|
9
8
|
var _a;
|
|
10
|
-
const
|
|
9
|
+
const _b = (0, FormField_js_1.groupFormFieldWrapperProps)(props), { onChange, onButtonClick, buttonText = 'Leita', fieldWrapperProps } = _b, inputElementProps = tslib_1.__rest(_b, ["onChange", "onButtonClick", "buttonText", "fieldWrapperProps"]);
|
|
11
10
|
const { value, defaultValue, placeholder } = inputElementProps;
|
|
12
11
|
const [hasValue, setHasValue] = (0, react_1.useState)(undefined);
|
|
13
12
|
const filled = !!((_a = value !== null && value !== void 0 ? value : hasValue) !== null && _a !== void 0 ? _a : !!defaultValue);
|
|
@@ -18,10 +17,10 @@ const SearchInput = (props) => {
|
|
|
18
17
|
setHasValue(!!e.target.value);
|
|
19
18
|
onChange && onChange(e);
|
|
20
19
|
};
|
|
21
|
-
return (react_1.default.createElement(FormField_js_1.default, {
|
|
20
|
+
return (react_1.default.createElement(FormField_js_1.default, Object.assign({ extraClassName: "SearchInput", empty: empty, filled: filled }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => (react_1.default.createElement("div", Object.assign({ className: className.input }, addFocusProps()),
|
|
22
21
|
react_1.default.createElement("input", Object.assign({ className: "SearchInput__input", onChange: _onChange }, inputProps, inputElementProps, { ref: props.inputRef })),
|
|
23
22
|
' ',
|
|
24
|
-
onButtonClick && (react_1.default.createElement("button", { className: "SearchInput__button", type: "button", onClick: onButtonClick, title: buttonText, ref: props.buttonRef, disabled: disabled || readOnly }, buttonText)))) }));
|
|
23
|
+
onButtonClick && (react_1.default.createElement("button", { className: "SearchInput__button", type: "button", onClick: onButtonClick, title: buttonText, ref: props.buttonRef, disabled: props.disabled || props.readOnly }, buttonText)))) })));
|
|
25
24
|
};
|
|
26
25
|
exports.SearchInput = SearchInput;
|
|
27
26
|
exports.default = exports.SearchInput;
|
|
@@ -13,7 +13,7 @@ const SearchResultsItem = (props) => {
|
|
|
13
13
|
react_1.default.createElement(_Link_js_1.Link, { className: bem + '__link', href: href },
|
|
14
14
|
react_1.default.createElement("h3", { className: bem + '__title' }, title),
|
|
15
15
|
metaArr.length > 0 && (react_1.default.createElement("span", { className: bem + '__meta' }, metaArr.map((item, i) => typeof item === 'function' ? item() : item && react_1.default.createElement("span", { key: i }, item)))),
|
|
16
|
-
highlight && image && react_1.default.createElement(_Image_js_1.Image, {
|
|
16
|
+
highlight && image && react_1.default.createElement(_Image_js_1.Image, { bem: bem + '__image', src: image }),
|
|
17
17
|
react_1.default.createElement("div", { className: bem + '__summary', dangerouslySetInnerHTML: { __html: summary } }))));
|
|
18
18
|
};
|
|
19
19
|
exports.SearchResultsItem = SearchResultsItem;
|
package/SearchResults.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SearchResultsItemProps } from './SearchResults/_SearchResultsItem.js';
|
|
3
|
+
import { WrapperElmProps } from './utils.js';
|
|
3
4
|
export type SearchReesultI18n = {
|
|
4
5
|
lang: string;
|
|
5
6
|
loadQueryTitle: string;
|
|
@@ -32,6 +33,6 @@ export type SearchResultsProps = {
|
|
|
32
33
|
loadMore?: () => void;
|
|
33
34
|
texts?: SearchReesultI18n;
|
|
34
35
|
lang?: string;
|
|
35
|
-
};
|
|
36
|
+
} & WrapperElmProps;
|
|
36
37
|
export declare const SearchResults: (props: SearchResultsProps) => JSX.Element;
|
|
37
38
|
export default SearchResults;
|
package/SearchResults.js
CHANGED
|
@@ -98,10 +98,10 @@ const renderLoadMore = (props, texts) => {
|
|
|
98
98
|
};
|
|
99
99
|
// TODO: add plural translation thingy for result string
|
|
100
100
|
const SearchResults = (props) => {
|
|
101
|
-
const { filters, activeFilterIdx, setFilter, status, errorText } = props;
|
|
101
|
+
const { filters, activeFilterIdx, setFilter, status, errorText, wrapperProps } = props;
|
|
102
102
|
const texts = (0, i18n_1.getTexts)(props, defaultTexts);
|
|
103
103
|
const domid = (0, hooks_1.useDomid)();
|
|
104
|
-
return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('SearchResults', status !== 'results' && status) },
|
|
104
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('SearchResults', status !== 'results' && status, (wrapperProps || {}).className) }),
|
|
105
105
|
renderTitle(props, texts),
|
|
106
106
|
react_1.default.createElement(SearchResults_Tabs, { domid: domid, filters: filters, activeIdx: activeFilterIdx, setFilter: setFilter, lang: texts.lang }),
|
|
107
107
|
react_1.default.createElement("div", { className: "SearchResults__results", id: domid },
|
package/SeenEffect.js
CHANGED
|
@@ -9,6 +9,8 @@ const _SeenEffect = (props) => {
|
|
|
9
9
|
const [ref] = (0, seenEffect_js_1.useSeenEffect)();
|
|
10
10
|
return react_1.default.createElement(Tag, Object.assign({}, tagProps, { ref: ref }, (0, seenEffect_js_1.getEffectAttr)(effectType)));
|
|
11
11
|
};
|
|
12
|
+
// NOTE: As this component already accepts all `<div/>` props directly,
|
|
13
|
+
// it makes little sense to add support for `wrapperProps` on top.
|
|
12
14
|
const SeenEffect = (props) => {
|
|
13
15
|
const _a = props, { Tag = 'div', effectType, startSeen } = _a, tagProps = tslib_1.__rest(_a, ["Tag", "effectType", "startSeen"]);
|
|
14
16
|
const addEffects = (effectType || '') !== 'none' || startSeen !== true;
|
package/Selectbox.js
CHANGED
|
@@ -3,15 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Selectbox = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
7
6
|
const Selectbox_1 = tslib_1.__importDefault(require("@hugsmidjan/react/Selectbox"));
|
|
8
|
-
const FormField_js_1 = tslib_1.
|
|
7
|
+
const FormField_js_1 = tslib_1.__importStar(require("./FormField.js"));
|
|
9
8
|
const getValue = (opt) => {
|
|
10
9
|
const val = typeof opt === 'object' ? opt.value : opt;
|
|
11
10
|
return typeof val === 'number' ? String(val) : val;
|
|
12
11
|
};
|
|
13
12
|
const Selectbox = (props) => {
|
|
14
|
-
const
|
|
13
|
+
const _a = (0, FormField_js_1.groupFormFieldWrapperProps)(props), { onChange, fieldWrapperProps } = _a, selectProps = tslib_1.__rest(_a, ["onChange", "fieldWrapperProps"]);
|
|
15
14
|
const { value, defaultValue, placeholder, options } = selectProps;
|
|
16
15
|
const _selectRef = (0, react_1.useRef)(null);
|
|
17
16
|
const selectRef = selectProps.selectRef || _selectRef;
|
|
@@ -35,7 +34,7 @@ const Selectbox = (props) => {
|
|
|
35
34
|
setIsEmpty(!((_a = selectElm.selectedOptions[0]) === null || _a === void 0 ? void 0 : _a.text));
|
|
36
35
|
onChange && onChange(e);
|
|
37
36
|
};
|
|
38
|
-
return (react_1.default.createElement(FormField_js_1.default, {
|
|
37
|
+
return (react_1.default.createElement(FormField_js_1.default, Object.assign({ extraClassName: "Selectbox", empty: isEmpty, filled: isFilled }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => (react_1.default.createElement(Selectbox_1.default, Object.assign({ bem: className.input, ssr: props.ssr, onChange: _onChange }, inputProps, addFocusProps(selectProps), { selectRef: selectRef }))) })));
|
|
39
38
|
};
|
|
40
39
|
exports.Selectbox = Selectbox;
|
|
41
40
|
// /** @deprecated Use named export instead (The default export will be removed in v0.11+) */
|
package/ShareButtons.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ShareButtonI18n, ShareButtonPlatforms } from '@reykjavik/hanna-utils/shareButtonsUtils';
|
|
2
|
-
import { SSRSupportProps } from './utils.js';
|
|
2
|
+
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
3
3
|
export type ShareButtonsProps = {
|
|
4
4
|
texts?: Readonly<ShareButtonI18n>;
|
|
5
5
|
lang?: string;
|
|
6
|
-
} & SSRSupportProps & Partial<Record<ShareButtonPlatforms, boolean>>;
|
|
6
|
+
} & SSRSupportProps & WrapperElmProps<null, 'aria-label'> & Partial<Record<ShareButtonPlatforms, boolean>>;
|
|
7
7
|
export declare const ShareButtons: (props: ShareButtonsProps) => JSX.Element | null;
|
|
8
8
|
export default ShareButtons;
|
package/ShareButtons.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ShareButtons = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const classUtils_1 = require("@hugsmidjan/qj/classUtils");
|
|
6
7
|
const i18n_1 = require("@reykjavik/hanna-utils/i18n");
|
|
7
8
|
const shareButtonsUtils_1 = require("@reykjavik/hanna-utils/shareButtonsUtils");
|
|
8
9
|
const _Link_js_1 = require("./_abstract/_Link.js");
|
|
@@ -24,7 +25,7 @@ const ShareButtons__item = (props) => {
|
|
|
24
25
|
react_1.default.createElement(_Link_js_1.Link, { className: 'ShareButtons__link ShareButtons__link--' + type, href: href, title: buttonText, rel: "noopener noreferrer", target: popup ? '_blank' : undefined, onClick: popup ? shareButtonsUtils_1.openInPopup : undefined }, buttonText)));
|
|
25
26
|
};
|
|
26
27
|
const ShareButtons = (props) => {
|
|
27
|
-
const { texts, lang, ssr, facebook = true, twitter = true, linkedin, email, } = props;
|
|
28
|
+
const { texts, lang, ssr, facebook = true, twitter = true, linkedin, email, wrapperProps, } = props;
|
|
28
29
|
const [docMeta, setDocMeta] = (0, react_1.useState)();
|
|
29
30
|
const href = docLoc.href; // assign to local variable to silence `react-hooks/exhaustive-deps`
|
|
30
31
|
(0, react_1.useEffect)(() => {
|
|
@@ -43,9 +44,10 @@ const ShareButtons = (props) => {
|
|
|
43
44
|
(docMeta && (shareButtonsUtils_1.shareButtonTexts[docMeta.lang] || shareButtonsUtils_1.shareButtonTexts[i18n_1.DEFAULT_LANG])) ||
|
|
44
45
|
{};
|
|
45
46
|
const { label, buttonLabel, emailSubject } = txt;
|
|
47
|
+
const className = (0, classUtils_1.modifiedClass)('ShareButtons', null, (wrapperProps || {}).className);
|
|
46
48
|
if (!docMeta || ssr === 'ssr-only') {
|
|
47
49
|
// Generate SSR markup for hanna-sprinkles to pick up on.
|
|
48
|
-
return (react_1.default.createElement("div", { className:
|
|
50
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: className, "data-button-types": generateTypeList(facebook, twitter, linkedin, email), "data-label": label, "data-buttonlabel": buttonLabel, "data-emailsubject": emailSubject || undefined })));
|
|
49
51
|
}
|
|
50
52
|
const showTypes = {
|
|
51
53
|
facebook,
|
|
@@ -53,7 +55,7 @@ const ShareButtons = (props) => {
|
|
|
53
55
|
linkedin,
|
|
54
56
|
email,
|
|
55
57
|
};
|
|
56
|
-
return (react_1.default.createElement("div", { className:
|
|
58
|
+
return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: className, "aria-label": label, "data-sprinkled": "true" }),
|
|
57
59
|
label && react_1.default.createElement("strong", { className: "ShareButtons__label" }, label),
|
|
58
60
|
react_1.default.createElement("ul", { className: "ShareButtons__list" }, shareButtonsUtils_1.shareButtonTypes.map((type) => showTypes[type] && (react_1.default.createElement(ShareButtons__item, { key: type, type: type, label: buttonLabel || '', href: docMeta.hrefs[type] }))))));
|
|
59
61
|
};
|
package/Sharpie.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
declare const colors: {
|
|
3
4
|
green: number;
|
|
4
5
|
red: number;
|
|
@@ -18,6 +19,6 @@ export type SharpieProps = {
|
|
|
18
19
|
color: SharpieColor;
|
|
19
20
|
tag?: SharpieTag;
|
|
20
21
|
children: ReactNode;
|
|
21
|
-
};
|
|
22
|
+
} & WrapperElmProps;
|
|
22
23
|
export declare const Sharpie: (props: SharpieProps) => JSX.Element;
|
|
23
24
|
export default Sharpie;
|
package/Sharpie.js
CHANGED
|
@@ -18,10 +18,10 @@ const tags = {
|
|
|
18
18
|
s: 1,
|
|
19
19
|
};
|
|
20
20
|
const Sharpie = (props) => {
|
|
21
|
-
const { color, tag, children } = props;
|
|
21
|
+
const { color, tag, children, wrapperProps } = props;
|
|
22
22
|
const colorModifier = colors[color] ? color : 'green';
|
|
23
23
|
const Tag = tag && tags[tag] ? tag : 'span';
|
|
24
|
-
return react_1.default.createElement(Tag, { className: (0, classUtils_1.modifiedClass)('Sharpie', colorModifier) }, children);
|
|
24
|
+
return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('Sharpie', colorModifier, (wrapperProps || {}).className) }), children));
|
|
25
25
|
};
|
|
26
26
|
exports.Sharpie = Sharpie;
|
|
27
27
|
exports.default = exports.Sharpie;
|