@reykjavik/hanna-react 0.10.57 → 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.d.ts +1 -1
- package/ActionCards.js +4 -6
- package/Alert.js +5 -30
- package/ArticleCards.d.ts +6 -0
- package/ArticleCards.js +7 -0
- package/ArticleCarousel/_ArticleCarouselCard.d.ts +1 -1
- package/ArticleCarousel/_ArticleCarouselCard.js +8 -10
- package/ArticleCarousel.js +3 -5
- package/ArticleMeta.d.ts +1 -0
- package/ArticleMeta.js +7 -28
- package/Attention.js +3 -5
- package/BasicTable.js +5 -7
- package/{esm/CenterColumn.d.ts → BgBox.d.ts} +4 -3
- package/BgBox.js +12 -0
- package/Bling.js +3 -5
- package/BlockBreak.js +2 -4
- package/BlockQuote.js +2 -4
- package/BreadCrumbs.js +4 -6
- package/ButtonBack.d.ts +1 -1
- package/ButtonBack.js +4 -6
- package/ButtonBar.js +3 -5
- package/ButtonPrimary.d.ts +1 -1
- package/ButtonPrimary.js +4 -6
- package/ButtonSecondary.d.ts +1 -1
- package/ButtonSecondary.js +4 -6
- package/ButtonTertiary.d.ts +1 -1
- package/ButtonTertiary.js +4 -6
- package/CHANGELOG.md +20 -1
- package/Carousel.js +3 -5
- package/CarouselStepper.js +3 -5
- package/CenterColumn.js +3 -5
- package/Checkbox.d.ts +1 -1
- package/Checkbox.js +4 -6
- package/CheckboxButtonsGroup.d.ts +1 -1
- package/CheckboxButtonsGroup.js +6 -8
- package/CheckboxGroup.d.ts +1 -1
- package/CheckboxGroup.js +5 -7
- package/CityBlock.d.ts +1 -1
- package/CityBlock.js +3 -5
- package/ContactBubble.js +6 -31
- package/ContentArticle.js +8 -10
- package/ContentImage.d.ts +1 -1
- package/ContentImage.js +4 -6
- package/Datepicker.js +6 -31
- package/ExtraLinks.d.ts +1 -1
- package/ExtraLinks.js +8 -21
- package/FeatureList.js +3 -5
- package/FieldGroup.js +3 -5
- package/FileInput.js +5 -41
- package/Foonote.js +2 -4
- package/FooterBadges.js +4 -6
- package/FooterInfo.js +3 -5
- package/Footnote.js +2 -4
- package/Form.js +3 -5
- package/FormField.js +3 -28
- package/Gallery/_GalleryItem.d.ts +1 -1
- package/Gallery/_GalleryItem.js +9 -45
- package/Gallery/_GalleryModal.js +6 -31
- package/Gallery/_GalleryModalContext.js +2 -4
- package/Gallery/_GalleryModalItem.js +5 -18
- package/Gallery.js +6 -31
- package/GridBlocks.d.ts +2 -2
- package/GridBlocks.js +8 -10
- package/Heading.d.ts +1 -1
- package/Heading.js +4 -6
- package/HeroBlock.d.ts +2 -2
- package/HeroBlock.js +6 -8
- package/IframeBlock.d.ts +5 -1
- package/IframeBlock.js +6 -8
- package/Illustration.d.ts +1 -1
- package/Illustration.js +4 -6
- package/ImageCards.d.ts +1 -1
- package/ImageCards.js +6 -19
- package/InfoBlock.js +2 -4
- package/InfoHero.d.ts +2 -2
- package/InfoHero.js +8 -10
- package/IslandBlock.d.ts +1 -1
- package/IslandBlock.js +3 -5
- package/IslandPageBlock.d.ts +1 -1
- package/IslandPageBlock.js +3 -5
- package/LabeledTextBlock.d.ts +1 -1
- package/LabeledTextBlock.js +4 -6
- package/Layout.js +9 -11
- package/MainMenu/_Auxiliary.js +4 -6
- package/MainMenu/_PrimaryPanel.js +5 -7
- package/MainMenu.js +7 -32
- package/MiniMetrics.d.ts +1 -1
- package/MiniMetrics.js +5 -7
- package/Modal.js +3 -5
- package/NameCard.js +6 -8
- package/NameCards.js +3 -5
- package/NewsHero.d.ts +1 -1
- package/NewsHero.js +7 -9
- package/PageFilter.js +4 -6
- package/PageHeading.js +3 -5
- package/Picture.d.ts +7 -0
- package/Picture.js +11 -0
- package/ProcessOverview.js +3 -5
- package/PullQuote.js +2 -4
- package/RadioButtonsGroup.d.ts +1 -1
- package/RadioButtonsGroup.js +6 -8
- package/RadioGroup.d.ts +2 -2
- package/RadioGroup.js +6 -8
- package/RelatedLinks.js +4 -6
- package/RowBlock.js +3 -5
- package/RowBlockColumn.js +3 -5
- package/SearchInput.js +5 -41
- package/SearchResults/_SearchResultsItem.js +6 -8
- package/SearchResults.js +7 -32
- package/SeenEffect.js +3 -16
- package/Selectbox.js +6 -42
- package/ShareButtons.js +4 -26
- 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.d.ts +1 -1
- package/TagPill.js +7 -20
- package/TextBlock.js +3 -5
- package/TextButton.d.ts +1 -1
- package/TextButton.js +4 -6
- package/TextInput.js +5 -41
- package/VSpacer.js +3 -5
- package/VerticalTabsTOC.js +3 -28
- package/WizardLayout.js +7 -9
- package/WizardLayoutClose.d.ts +1 -1
- package/WizardLayoutClose.js +4 -6
- package/WizardStepper.js +3 -5
- package/_abstract/_AbstractCarousel.js +7 -32
- package/_abstract/_Blings.js +3 -5
- package/_abstract/_Block.d.ts +2 -2
- package/_abstract/_Block.js +7 -9
- package/_abstract/{Button.d.ts → _Button.d.ts} +0 -0
- package/_abstract/{Button.js → _Button.js} +6 -19
- package/{esm/_abstract/CardList.d.ts → _abstract/_CardList.d.ts} +2 -1
- package/_abstract/{CardList.js → _CardList.js} +12 -12
- package/{esm/_abstract/Image.d.ts → _abstract/_Image.d.ts} +9 -5
- package/_abstract/{Image.js → _Image.js} +5 -7
- package/_abstract/{Link.d.ts → _Link.d.ts} +0 -0
- package/_abstract/{Link.js → _Link.js} +2 -4
- package/_abstract/_Quote.js +4 -6
- package/{esm/_abstract/TogglerGroup.d.ts → _abstract/_TogglerGroup.d.ts} +1 -1
- package/_abstract/{TogglerGroup.js → _TogglerGroup.js} +8 -8
- package/{esm/_abstract/TogglerGroupField.d.ts → _abstract/_TogglerGroupField.d.ts} +2 -2
- package/_abstract/_TogglerGroupField.js +14 -0
- package/_abstract/{TogglerInput.d.ts → _TogglerInput.d.ts} +0 -0
- package/_abstract/{TogglerInput.js → _TogglerInput.js} +4 -17
- package/_abstract/breakOnNL.js +2 -4
- package/package.json +6 -365
- package/utils/env.js +2 -4
- package/utils/seenEffect.d.ts +2 -2
- package/utils/seenEffect.js +1 -1
- package/utils/useScrollbarWidthCSSVar.js +2 -4
- package/utils.js +3 -16
- package/_abstract/CardList.d.ts +0 -29
- package/_abstract/Image.d.ts +0 -32
- package/_abstract/TogglerGroup.d.ts +0 -31
- package/_abstract/TogglerGroupField.d.ts +0 -17
- package/_abstract/TogglerGroupField.js +0 -27
- 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/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 -9
- package/esm/ArticleMeta.js +0 -18
- 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/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.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/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/Button.d.ts +0 -40
- package/esm/_abstract/Button.js +0 -47
- package/esm/_abstract/CardList.js +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/TogglerGroup.js +0 -29
- 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/_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/_Quote.d.ts +0 -9
- package/esm/_abstract/_Quote.js +0 -8
- 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/_abstract/_Block.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
6
|
const seenEffect_1 = require("../utils/seenEffect");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
7
|
+
const _Button_1 = tslib_1.__importDefault(require("./_Button"));
|
|
8
|
+
const _Image_1 = tslib_1.__importDefault(require("./_Image"));
|
|
11
9
|
const Block = (props) => {
|
|
12
10
|
const { image, modifier, bem, content, startSeen } = props;
|
|
13
11
|
const [ref] = (0, seenEffect_1.useSeenEffect)(startSeen);
|
|
@@ -21,9 +19,9 @@ const Block = (props) => {
|
|
|
21
19
|
buttons.length > 0 && (react_1.default.createElement("div", { className: `${bem}__buttons` },
|
|
22
20
|
' ',
|
|
23
21
|
buttons.map((buttonProps, i) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
24
|
-
react_1.default.createElement(
|
|
22
|
+
react_1.default.createElement(_Button_1.default, Object.assign({ bem: `${bem}__button`, key: i }, buttonProps)),
|
|
25
23
|
' ')))))));
|
|
26
24
|
}),
|
|
27
|
-
image && react_1.default.createElement(
|
|
25
|
+
image && react_1.default.createElement(_Image_1.default, Object.assign({ className: `${bem}__image` }, image))));
|
|
28
26
|
};
|
|
29
27
|
exports.default = Block;
|
|
File without changes
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
6
|
+
const _Link_1 = require("./_Link");
|
|
20
7
|
// ---------------------------------------------------------------------------
|
|
21
8
|
const sizes = {
|
|
22
9
|
normal: '',
|
|
@@ -38,12 +25,12 @@ const icons = {
|
|
|
38
25
|
edit: 'edit',
|
|
39
26
|
};
|
|
40
27
|
const Button = (props) => {
|
|
41
|
-
const { bem, small, size = 'normal', modifier, children, variant = 'normal', icon = 'none', label = children } = props, buttonProps = __rest(props, ["bem", "small", "size", "modifier", "children", "variant", "icon", "label"]);
|
|
28
|
+
const { bem, small, size = 'normal', modifier, children, variant = 'normal', icon = 'none', label = children } = props, buttonProps = tslib_1.__rest(props, ["bem", "small", "size", "modifier", "children", "variant", "icon", "label"]);
|
|
42
29
|
const className = bem &&
|
|
43
30
|
(0, getBemClass_1.default)(bem, [modifier, variants[variant], sizes[size], navigationFlags[icon]]);
|
|
44
31
|
const iconProp = icons[icon] && { 'data-icon': icons[icon] };
|
|
45
32
|
if (buttonProps.href != null) {
|
|
46
|
-
return (react_1.default.createElement(
|
|
33
|
+
return (react_1.default.createElement(_Link_1.Link, Object.assign({ className: className }, buttonProps, { style: undefined }, iconProp), label));
|
|
47
34
|
}
|
|
48
35
|
else {
|
|
49
36
|
return (react_1.default.createElement("button", Object.assign({ className: className, type: "button" }, buttonProps, { style: undefined }, iconProp), label));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { ImageProps } from './
|
|
2
|
+
import { ImageProps } from './_Image';
|
|
3
3
|
declare type BaseCardProps = {
|
|
4
4
|
title: string;
|
|
5
5
|
href: string;
|
|
@@ -24,6 +24,7 @@ export declare type TextCardListProps = CardListProps<TextCardProps>;
|
|
|
24
24
|
declare type _CardListProps = CardListProps<BaseCardProps> & {
|
|
25
25
|
bemPrefix: string;
|
|
26
26
|
children?: ReactNode;
|
|
27
|
+
standalone?: boolean;
|
|
27
28
|
};
|
|
28
29
|
export declare const CardList: (props: _CardListProps) => JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.CardList = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const _Button_1 = tslib_1.__importDefault(require("./_Button"));
|
|
7
|
+
const _Image_1 = tslib_1.__importDefault(require("./_Image"));
|
|
10
8
|
const Card = (props) => {
|
|
11
9
|
const { bem, href, title, imgPlaceholder } = props;
|
|
12
10
|
const cardClass = `${bem}__card`;
|
|
@@ -14,9 +12,9 @@ const Card = (props) => {
|
|
|
14
12
|
const meta = 'meta' in props && props.meta;
|
|
15
13
|
const summary = 'summary' in props && props.summary;
|
|
16
14
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
17
|
-
react_1.default.createElement(
|
|
15
|
+
react_1.default.createElement(_Button_1.default, { bem: cardClass, href: href },
|
|
18
16
|
' ',
|
|
19
|
-
react_1.default.createElement(
|
|
17
|
+
react_1.default.createElement(_Image_1.default, Object.assign({ className: `${bem}__image` }, image, { placeholder: imgPlaceholder })),
|
|
20
18
|
react_1.default.createElement("span", { className: `${cardClass}__title` }, title),
|
|
21
19
|
' ',
|
|
22
20
|
meta && react_1.default.createElement("span", { className: `${cardClass}__meta` }, meta),
|
|
@@ -28,15 +26,17 @@ const Card = (props) => {
|
|
|
28
26
|
const CardList = (props) => {
|
|
29
27
|
const { bemPrefix, title, summaryElement, cards, titleTag = 'h2', children, imgPlaceholder, } = props;
|
|
30
28
|
const TitleTag = titleTag;
|
|
31
|
-
const
|
|
32
|
-
const fallbackImageStyle =
|
|
33
|
-
? {
|
|
29
|
+
const fallbackImageUrl = (imgPlaceholder !== true && imgPlaceholder) || undefined;
|
|
30
|
+
const fallbackImageStyle = fallbackImageUrl
|
|
31
|
+
? {
|
|
32
|
+
['--' + bemPrefix + '--fallback']: `url("${fallbackImageUrl}")`,
|
|
33
|
+
}
|
|
34
34
|
: undefined;
|
|
35
35
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
36
36
|
summaryElement ? (react_1.default.createElement("div", { className: bemPrefix + '__summary' },
|
|
37
37
|
title && react_1.default.createElement(TitleTag, { className: bemPrefix + '__title' }, title),
|
|
38
38
|
summaryElement)) : (title && react_1.default.createElement(TitleTag, { className: bemPrefix + '__title' }, title)),
|
|
39
|
-
react_1.default.createElement("ul", { className: bemPrefix + '__list', style: fallbackImageStyle }, cards.map((card, i) => (react_1.default.createElement("li", { key: i, className: bemPrefix + '__item' },
|
|
39
|
+
react_1.default.createElement("ul", { className: bemPrefix + (props.standalone ? '' : '__list'), style: fallbackImageStyle }, cards.map((card, i) => (react_1.default.createElement("li", { key: i, className: bemPrefix + '__item' },
|
|
40
40
|
react_1.default.createElement(Card, Object.assign({}, card, { bem: bemPrefix, imgPlaceholder: !!imgPlaceholder })))))),
|
|
41
41
|
children));
|
|
42
42
|
};
|
|
@@ -2,25 +2,29 @@ export declare type Source = {
|
|
|
2
2
|
srcset: string;
|
|
3
3
|
media: string;
|
|
4
4
|
};
|
|
5
|
-
export declare type
|
|
5
|
+
export declare type ImagePropsLinked = {
|
|
6
6
|
altText?: string;
|
|
7
|
-
} & ({
|
|
8
7
|
sources?: Array<Source>;
|
|
9
8
|
/** The default image source to (lazy) load */
|
|
10
9
|
src?: string;
|
|
11
10
|
/** Eagerly-loaded placeholder/thunbnail to use until a `sources` item has been picked. */
|
|
12
11
|
preloadSrc?: string;
|
|
13
12
|
inline?: false;
|
|
14
|
-
|
|
13
|
+
focalPoint?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare type ImagePropsInlinedSvg = {
|
|
16
|
+
altText?: string;
|
|
15
17
|
/** Should the image be fetched and inlined as <svg/> */
|
|
16
18
|
inline: true;
|
|
17
19
|
src: string;
|
|
18
20
|
sources?: undefined;
|
|
19
21
|
preloadSrc?: undefined;
|
|
20
|
-
|
|
22
|
+
focalPoint?: undefined;
|
|
23
|
+
};
|
|
24
|
+
export declare type ImageProps = ImagePropsLinked | ImagePropsInlinedSvg;
|
|
21
25
|
declare type _ImageProps = {
|
|
22
26
|
/** container className */
|
|
23
|
-
className
|
|
27
|
+
className: string | undefined;
|
|
24
28
|
/** Controls if the container is rendered when image is missing/undefined.
|
|
25
29
|
* (With a `--missing` className modifier added.)
|
|
26
30
|
*
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
6
|
const useGetSVGtext_1 = require("../utils/useGetSVGtext");
|
|
9
7
|
// eslint-disable-next-line complexity
|
|
10
8
|
const Image = (props) => {
|
|
11
|
-
const { src, altText = '', sources = [], preloadSrc, className, inline, placeholder, } = props;
|
|
9
|
+
const { src, altText = '', sources = [], preloadSrc, className, inline, placeholder, focalPoint, } = props;
|
|
12
10
|
const _src = (sources.length && preloadSrc) || src;
|
|
13
11
|
const imageSrc = _src || (sources[0] != null ? sources[0].srcset.split(' ')[0] : undefined);
|
|
14
12
|
const imgLoading = preloadSrc ? 'eager' : 'lazy';
|
|
@@ -20,7 +18,7 @@ const Image = (props) => {
|
|
|
20
18
|
const __html = inlineSvg.imageSrc === imageSrc ? inlineSvg.code : '';
|
|
21
19
|
return react_1.default.createElement("span", { className: className, dangerouslySetInnerHTML: { __html } });
|
|
22
20
|
}
|
|
23
|
-
return (react_1.default.createElement("picture", { className: className },
|
|
21
|
+
return (react_1.default.createElement("picture", { className: className, style: focalPoint ? { '--focalPoint': focalPoint } : undefined },
|
|
24
22
|
' ',
|
|
25
23
|
sources.map((source, i) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
26
24
|
react_1.default.createElement("source", { key: i, srcSet: source.srcset, media: source.media }),
|
|
File without changes
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.setLinkRenderer = exports.Link = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
8
6
|
const DefaultLinkRenderer = (props) => react_1.default.createElement('a', props);
|
|
9
7
|
exports.Link = DefaultLinkRenderer;
|
|
10
8
|
/**
|
package/_abstract/_Quote.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports._Quote = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const _Link_1 = require("./_Link");
|
|
9
7
|
const _Quote = (props) => {
|
|
10
8
|
const { bem, children, by, byHref } = props;
|
|
11
9
|
return (react_1.default.createElement("figure", { className: bem },
|
|
12
10
|
react_1.default.createElement("blockquote", { className: bem + '__quote' }, children),
|
|
13
|
-
by && (react_1.default.createElement("figcaption", { className: bem + '__by' }, byHref ? (react_1.default.createElement(
|
|
11
|
+
by && (react_1.default.createElement("figcaption", { className: bem + '__by' }, byHref ? (react_1.default.createElement(_Link_1.Link, { href: byHref }, by)) : typeof by === 'string' ? (react_1.default.createElement("span", null, by)) : (by)))));
|
|
14
12
|
};
|
|
15
13
|
exports._Quote = _Quote;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
6
|
const TogglerGroup = (props) => {
|
|
9
7
|
const {
|
|
10
8
|
// id,
|
|
11
9
|
className, bem, name, disabled, Toggler, onSelected, options, inputProps = {}, } = props;
|
|
12
|
-
const values = props.value
|
|
10
|
+
const values = props.value;
|
|
13
11
|
return (react_1.default.createElement("ul", { className: (0, getBemClass_1.default)(bem, null, className), role: "group", "aria-labelledby": props['aria-labelledby'], "aria-describedby": props['aria-describedby'], "aria-required": props.required }, options.map((option, i) => {
|
|
14
12
|
const isDisabled = option.disabled != null
|
|
15
13
|
? option.disabled
|
|
16
14
|
: disabled && typeof disabled !== 'boolean'
|
|
17
15
|
? disabled.includes(i)
|
|
18
16
|
: disabled;
|
|
19
|
-
const isChecked = values.includes(option.value);
|
|
17
|
+
const isChecked = values && values.includes(option.value);
|
|
20
18
|
return (react_1.default.createElement(Toggler, Object.assign({ key: i }, inputProps, { className: bem + '__item', name: name, Wrapper: "li" }, option, { label: option.label || option.value, onChange: onSelected
|
|
21
19
|
? (e) => {
|
|
22
20
|
const { value } = option;
|
|
23
21
|
const checked = e.currentTarget.checked;
|
|
24
22
|
inputProps.onChange && inputProps.onChange(e);
|
|
25
|
-
const selectedValues = values
|
|
23
|
+
const selectedValues = values
|
|
24
|
+
? values.filter((val) => val !== value)
|
|
25
|
+
: [];
|
|
26
26
|
if (checked) {
|
|
27
27
|
selectedValues.push(value);
|
|
28
28
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { BemPropsModifier } from '@hugsmidjan/react/types';
|
|
3
3
|
import { FormFieldGroupWrappingProps } from '../FormField';
|
|
4
|
-
import { TogglerGroupOption, TogglerGroupOptions, TogglerGroupProps } from './
|
|
5
|
-
import { TogglerInputProps } from './
|
|
4
|
+
import { TogglerGroupOption, TogglerGroupOptions, TogglerGroupProps } from './_TogglerGroup';
|
|
5
|
+
import { TogglerInputProps } from './_TogglerInput';
|
|
6
6
|
export declare type TogglerGroupFieldProps = {
|
|
7
7
|
className?: string;
|
|
8
8
|
} & FormFieldGroupWrappingProps & TogglerGroupProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
6
|
+
const FormField_1 = tslib_1.__importDefault(require("../FormField"));
|
|
7
|
+
const _TogglerGroup_1 = tslib_1.__importDefault(require("./_TogglerGroup"));
|
|
8
|
+
const TogglerGroupField = (props) => {
|
|
9
|
+
const { bem, Toggler, className, modifier, label, LabelTag, assistText, hideLabel, disabled, readOnly, invalid, errorMessage, required, reqText, id, value } = props, togglerGroupProps = tslib_1.__rest(props, ["bem", "Toggler", "className", "modifier", "label", "LabelTag", "assistText", "hideLabel", "disabled", "readOnly", "invalid", "errorMessage", "required", "reqText", "id", "value"]);
|
|
10
|
+
return (react_1.default.createElement(FormField_1.default, { className: (0, getBemClass_1.default)(bem, modifier, className), group: true, label: label, LabelTag: LabelTag, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps) => {
|
|
11
|
+
return (react_1.default.createElement(_TogglerGroup_1.default, Object.assign({ bem: className.options }, inputProps, togglerGroupProps, { value: Array.isArray(value) ? value : value != null ? [value] : undefined, Toggler: Toggler })));
|
|
12
|
+
} }));
|
|
13
|
+
};
|
|
14
|
+
exports.default = TogglerGroupField;
|
|
File without changes
|
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
18
5
|
const hooks_1 = require("@hugsmidjan/react/hooks");
|
|
19
|
-
const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
6
|
+
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
20
7
|
const TogglerInput = (props) => {
|
|
21
|
-
const { bem, modifier, className, label, invalid, errorMessage, Wrapper = 'div', required, reqText, type, id } = props, inputProps = __rest(props, ["bem", "modifier", "className", "label", "invalid", "errorMessage", "Wrapper", "required", "reqText", "type", "id"]);
|
|
8
|
+
const { bem, modifier, className, label, invalid, errorMessage, Wrapper = 'div', required, reqText, type, id } = props, inputProps = tslib_1.__rest(props, ["bem", "modifier", "className", "label", "invalid", "errorMessage", "Wrapper", "required", "reqText", "type", "id"]);
|
|
22
9
|
const domid = (0, hooks_1.useDomid)(id);
|
|
23
10
|
const errorId = errorMessage && 'error' + domid;
|
|
24
11
|
const reqStar = required && reqText !== false && (react_1.default.createElement("abbr", { className: bem + '__label__reqstar',
|
package/_abstract/breakOnNL.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
7
5
|
const breakOnNL = (text) => text &&
|
|
8
6
|
text
|
|
9
7
|
.trim()
|