@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/esm/Attention.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
|
-
export const Attention = (props) =>
|
|
3
|
+
export const Attention = (props) => {
|
|
4
|
+
const { small, children, wrapperProps } = props;
|
|
5
|
+
return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('Attention', small && 'small', (wrapperProps || {}).className) }), children));
|
|
6
|
+
};
|
|
4
7
|
export default Attention;
|
package/esm/BasicTable.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TableProps } from '@hugsmidjan/react/Table';
|
|
2
2
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
3
3
|
import { SeenProp } from './utils/seenEffect.js';
|
|
4
|
+
import { MissingWrapperElmProps } from './utils.js';
|
|
4
5
|
export type BasicTableProps = {
|
|
5
6
|
compact?: boolean;
|
|
6
7
|
type?: 'text' | 'number';
|
|
@@ -9,6 +10,6 @@ export type BasicTableProps = {
|
|
|
9
10
|
fullWidth?: boolean;
|
|
10
11
|
}, {
|
|
11
12
|
align?: 'right';
|
|
12
|
-
}> & SeenProp & Omit<TableProps, 'className' | 'children'>;
|
|
13
|
+
}> & MissingWrapperElmProps & SeenProp & Omit<TableProps, 'className' | 'children'>;
|
|
13
14
|
export declare const BasicTable: (props: BasicTableProps) => JSX.Element;
|
|
14
15
|
export default BasicTable;
|
package/esm/BgBox.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { EffectProp, SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
import { WrapperElmProps } from './utils.js';
|
|
3
4
|
export type BgBoxProps = {
|
|
4
5
|
className?: string;
|
|
5
6
|
children: ReactNode;
|
|
6
|
-
} & SeenProp & EffectProp;
|
|
7
|
+
} & WrapperElmProps & SeenProp & EffectProp;
|
|
7
8
|
export declare const BgBox: (props: BgBoxProps) => JSX.Element;
|
|
8
9
|
export default BgBox;
|
package/esm/BgBox.js
CHANGED
|
@@ -2,8 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
3
|
import { getEffectAttr, useSeenEffect, } from './utils/seenEffect.js';
|
|
4
4
|
export const BgBox = (props) => {
|
|
5
|
-
const { className, children, effectType, startSeen } = props;
|
|
5
|
+
const { className, children, effectType, startSeen, wrapperProps } = props;
|
|
6
6
|
const [ref] = useSeenEffect(startSeen);
|
|
7
|
-
return (React.createElement("div", Object.assign({ className: modifiedClass('BgBox', undefined,
|
|
7
|
+
return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('BgBox', undefined,
|
|
8
|
+
// Prefer `className` over `wrapperProps.className`
|
|
9
|
+
className || (wrapperProps || {}).className), ref: ref }, getEffectAttr(effectType)), children));
|
|
8
10
|
};
|
|
9
11
|
export default BgBox;
|
package/esm/Bling.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BlingType } from '@reykjavik/hanna-utils/assets';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
declare const colors: {
|
|
3
4
|
tertiary: boolean;
|
|
4
5
|
secondary: boolean;
|
|
@@ -76,6 +77,6 @@ export type BlingProps = {
|
|
|
76
77
|
type?: undefined;
|
|
77
78
|
/** Custom SVG URL to load (use sparingly) */
|
|
78
79
|
blingUrl: string;
|
|
79
|
-
})
|
|
80
|
+
}) & WrapperElmProps<null, 'data-bling-type' | 'data-bling-image'>;
|
|
80
81
|
export declare const Bling: (props: BlingProps) => JSX.Element;
|
|
81
82
|
export default Bling;
|
package/esm/Bling.js
CHANGED
|
@@ -30,15 +30,17 @@ const parentOffset = {
|
|
|
30
30
|
bottom: true,
|
|
31
31
|
};
|
|
32
32
|
export const Bling = (props) => {
|
|
33
|
-
const { align, vertical, color, overlay, type, blingUrl, parent, className } = props;
|
|
33
|
+
const { align, vertical, color, overlay, type, blingUrl, parent, className, wrapperProps, } = props;
|
|
34
34
|
const imageUrl = type ? getBlingUrl(type) : blingUrl;
|
|
35
35
|
const inlineSvg = useGetSVGtext(imageUrl);
|
|
36
|
-
return (React.createElement("div", { className: modifiedClass('Bling', [
|
|
36
|
+
return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('Bling', [
|
|
37
37
|
'align--' + (align && align in aligns ? align : 'left'),
|
|
38
38
|
vertical && vertical in valigns && 'vertical--' + vertical,
|
|
39
39
|
color && color in colors && 'color--' + color,
|
|
40
40
|
parent && parent in parentOffset && 'parent--' + parent,
|
|
41
41
|
overlay && 'overlay',
|
|
42
|
-
],
|
|
42
|
+
],
|
|
43
|
+
// Prefer `className` over `wrapperProps.className`
|
|
44
|
+
className || (wrapperProps || {}).className), "data-bling-type": type, "data-bling-image": !type ? blingUrl : undefined, dangerouslySetInnerHTML: inlineSvg && { __html: inlineSvg.code } })));
|
|
43
45
|
};
|
|
44
46
|
export default Bling;
|
package/esm/BlockBreak.js
CHANGED
package/esm/BreadCrumbs.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
export type BreadCrumb = {
|
|
3
4
|
href?: string;
|
|
4
5
|
label: string;
|
|
@@ -11,6 +12,6 @@ export type BreadCrumbsProps = {
|
|
|
11
12
|
title?: string;
|
|
12
13
|
lang?: string;
|
|
13
14
|
trail: BreadCrumbTrail;
|
|
14
|
-
}
|
|
15
|
+
} & WrapperElmProps<null, 'aria-label'>;
|
|
15
16
|
export declare const BreadCrumbs: (props: BreadCrumbsProps) => JSX.Element | null;
|
|
16
17
|
export default BreadCrumbs;
|
package/esm/BreadCrumbs.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
2
3
|
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
3
4
|
import { Link } from './_abstract/_Link.js';
|
|
4
5
|
export const defaultBreadCrumbsTexts = {
|
|
@@ -11,14 +12,14 @@ const BreadCrumbs__item = (props) => {
|
|
|
11
12
|
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));
|
|
12
13
|
};
|
|
13
14
|
export const BreadCrumbs = (props) => {
|
|
14
|
-
const { trail, title, lang } = props;
|
|
15
|
+
const { trail, title, lang, wrapperProps } = props;
|
|
15
16
|
const texts = getTexts({ texts: title ? { title } : undefined, lang }, defaultBreadCrumbsTexts);
|
|
16
17
|
if (trail.length === 0) {
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
20
|
const ancestors = trail.slice(0, -1);
|
|
20
21
|
const current = trail[trail.length - 1];
|
|
21
|
-
return (React.createElement("nav", { className:
|
|
22
|
+
return (React.createElement("nav", Object.assign({}, wrapperProps, { className: modifiedClass('BreadCrumbs', null, (wrapperProps || {}).className), "aria-label": texts.title }),
|
|
22
23
|
React.createElement("span", { className: "BreadCrumbs__title" },
|
|
23
24
|
texts.title,
|
|
24
25
|
":"),
|
package/esm/ButtonBack.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from './_abstract/_Button.js';
|
|
3
|
+
// NOTE: As a `_abstract/_Button.tsx`-derived component, all `<button/>` and
|
|
4
|
+
// `<a/>` props are allowed directly, so adding `wrapperProps` makes no sense.
|
|
3
5
|
export const ButtonBack = (props) => (React.createElement(Button, Object.assign({ bem: "ButtonBack" }, props)));
|
|
4
6
|
export default ButtonBack;
|
package/esm/ButtonBar.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
export type ButtonBarProps = {
|
|
3
4
|
align?: 'right';
|
|
4
5
|
children: ReactNode;
|
|
5
|
-
};
|
|
6
|
+
} & WrapperElmProps;
|
|
6
7
|
export declare const ButtonBar: {
|
|
7
8
|
(props: ButtonBarProps): JSX.Element;
|
|
8
9
|
/** A Splitter token to use directly inside <ButtonBar/> wrappers */
|
|
9
|
-
Split(): JSX.Element;
|
|
10
|
+
Split({ wrapperProps }: WrapperElmProps): JSX.Element;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* @deprecated Prefer using `ButtonBar.Split` instead.
|
|
13
14
|
*
|
|
14
15
|
* (This export token is only to aid discovery.)
|
|
15
16
|
*/
|
|
16
|
-
export declare const ButtonBar__split: () => JSX.Element;
|
|
17
|
+
export declare const ButtonBar__split: ({ wrapperProps }: WrapperElmProps) => JSX.Element;
|
|
17
18
|
export default ButtonBar;
|
package/esm/ButtonBar.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
3
|
export const ButtonBar = (props) => {
|
|
4
|
-
const { align, children } = props;
|
|
5
|
-
return (React.createElement("div", { className: modifiedClass('ButtonBar', align === 'right' && 'align--right') }, children));
|
|
4
|
+
const { align, children, wrapperProps } = props;
|
|
5
|
+
return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('ButtonBar', align === 'right' && 'align--right', (wrapperProps || {}).className) }), children));
|
|
6
6
|
};
|
|
7
7
|
/** A Splitter token to use directly inside <ButtonBar/> wrappers */
|
|
8
|
-
ButtonBar.Split = () => React.createElement("span", { className:
|
|
8
|
+
ButtonBar.Split = ({ wrapperProps }) => (React.createElement("span", Object.assign({}, wrapperProps, { className: modifiedClass('ButtonBar__split', null, (wrapperProps || {}).className) })));
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated Prefer using `ButtonBar.Split` instead.
|
|
11
11
|
*
|
package/esm/ButtonPrimary.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from './_abstract/_Button.js';
|
|
3
|
+
// NOTE: As a `_abstract/_Button.tsx`-derived component, all `<button/>` and
|
|
4
|
+
// `<a/>` props are allowed directly, so adding `wrapperProps` makes no sense.
|
|
3
5
|
export const ButtonPrimary = (props) => (React.createElement(Button, Object.assign({ bem: "ButtonPrimary" }, props)));
|
|
4
6
|
export default ButtonPrimary;
|
package/esm/ButtonSecondary.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from './_abstract/_Button.js';
|
|
3
|
+
// NOTE: As a `_abstract/_Button.tsx`-derived component, all `<button/>` and
|
|
4
|
+
// `<a/>` props are allowed directly, so adding `wrapperProps` makes no sense.
|
|
3
5
|
export const ButtonSecondary = (props) => React.createElement(Button, Object.assign({ bem: "ButtonSecondary" }, props));
|
|
4
6
|
export default ButtonSecondary;
|
package/esm/ButtonTertiary.js
CHANGED
|
@@ -8,6 +8,8 @@ const icons = {
|
|
|
8
8
|
none: 'none',
|
|
9
9
|
'go-back': 'go-back',
|
|
10
10
|
};
|
|
11
|
+
// NOTE: As a `_abstract/_Button.tsx`-derived component, all `<button/>` and
|
|
12
|
+
// `<a/>` props are allowed directly, so adding `wrapperProps` makes no sense.
|
|
11
13
|
export const ButtonTertiary = (props) => {
|
|
12
14
|
const { size = 'normal', icon = 'none' } = props;
|
|
13
15
|
return React.createElement(Button, Object.assign({ bem: "ButtonTertiary" }, props, { size: sizes[size], icon: icons[icon] }));
|
package/esm/CarouselStepper.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Props } from '@hugsmidjan/react/CarouselStepper';
|
|
2
|
-
|
|
2
|
+
import { MissingWrapperElmProps } from './utils.js';
|
|
3
|
+
type CarouselStepperProps = Omit<Props, 'bem' | 'modifier'> & MissingWrapperElmProps;
|
|
3
4
|
export declare const CarouselStepper: (props: CarouselStepperProps) => JSX.Element;
|
|
4
5
|
export default CarouselStepper;
|
package/esm/CenterColumn.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { EffectProp, SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
import { WrapperElmProps } from './utils.js';
|
|
3
4
|
export type CenterColumnProps = {
|
|
4
5
|
children: ReactNode;
|
|
5
|
-
} & SeenProp & EffectProp;
|
|
6
|
+
} & SeenProp & WrapperElmProps & EffectProp;
|
|
6
7
|
export declare const CenterColumn: (props: CenterColumnProps) => JSX.Element;
|
|
7
8
|
export default CenterColumn;
|
package/esm/CenterColumn.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
2
3
|
import SeenEffect from './SeenEffect.js';
|
|
3
4
|
export const CenterColumn = (props) => {
|
|
4
|
-
const { children, startSeen, effectType } = props;
|
|
5
|
-
|
|
5
|
+
const { children, startSeen, effectType, wrapperProps } = props;
|
|
6
|
+
const className = modifiedClass('CenterColumn', null, (wrapperProps || {}).className);
|
|
7
|
+
return startSeen == null ? (React.createElement("div", Object.assign({}, wrapperProps, { className: className }), children)) : (React.createElement(SeenEffect, Object.assign({}, wrapperProps, { className: className, startSeen: startSeen, effectType: effectType }), children));
|
|
6
8
|
};
|
|
7
9
|
export default CenterColumn;
|
package/esm/CheckboxButton.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { TogglerInputProps } from './_abstract/_TogglerInput.js';
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
/** @deprecated Use `CheckboxButtonProps` instead (Will be removed in v0.11) */
|
|
3
|
+
export type CheckboxProps = CheckboxButtonProps;
|
|
4
|
+
export type CheckboxButtonProps = TogglerInputProps;
|
|
5
|
+
export declare const CheckboxButton: (props: CheckboxButtonProps) => JSX.Element;
|
|
4
6
|
export default CheckboxButton;
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { TogglerGroupField, } from './_abstract/_TogglerGroupField.js';
|
|
3
3
|
import CheckboxButton from './CheckboxButton.js';
|
|
4
4
|
export const CheckboxButtonsGroup = (props) => {
|
|
5
|
-
if (props.layout) {
|
|
5
|
+
if (props.layout /* eslint-disable-line deprecation/deprecation */) {
|
|
6
6
|
console.warn('`CheckboxButtonsGroupProps.layout` is deprecated.');
|
|
7
7
|
}
|
|
8
|
-
if (props.columns) {
|
|
8
|
+
if (props.columns /* eslint-disable-line deprecation/deprecation */) {
|
|
9
9
|
console.warn('`CheckboxButtonsGroupProps.columns` is deprecated.');
|
|
10
10
|
}
|
|
11
11
|
return (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler: CheckboxButton })));
|
package/esm/CityBlock.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { BlockItem } from './_abstract/_Block.js';
|
|
|
4
4
|
import { ImageProps } from './_abstract/_Image.js';
|
|
5
5
|
import { SeenProp } from './utils/seenEffect.js';
|
|
6
6
|
import { Alignment } from './constants.js';
|
|
7
|
+
import { WrapperElmProps } from './utils.js';
|
|
7
8
|
declare const types: {
|
|
8
9
|
largebox: boolean;
|
|
9
10
|
largeimage: boolean;
|
|
@@ -16,6 +17,6 @@ export type CityBlockProps = {
|
|
|
16
17
|
illustration: Illustration;
|
|
17
18
|
}, {
|
|
18
19
|
image: ImageProps;
|
|
19
|
-
}> & SeenProp;
|
|
20
|
+
}> & WrapperElmProps & SeenProp;
|
|
20
21
|
export declare const CityBlock: (props: CityBlockProps) => JSX.Element;
|
|
21
22
|
export default CityBlock;
|
package/esm/CityBlock.js
CHANGED
|
@@ -13,6 +13,6 @@ export const CityBlock = (props) => {
|
|
|
13
13
|
const imageProps = props.illustration != null
|
|
14
14
|
? { src: getIllustrationUrl(props.illustration) }
|
|
15
15
|
: props.image;
|
|
16
|
-
return (React.createElement(Block, { bem: "CityBlock", modifier: modifier, content: props.content, image: imageProps, startSeen: props.startSeen }));
|
|
16
|
+
return (React.createElement(Block, { bem: "CityBlock", modifier: modifier, content: props.content, image: imageProps, wrapperProps: props.wrapperProps, startSeen: props.startSeen }));
|
|
17
17
|
};
|
|
18
18
|
export default CityBlock;
|
package/esm/ContactBubble.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
3
|
-
import { SSRSupportProps } from './utils.js';
|
|
3
|
+
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
4
4
|
export type ContactBubbleI18n = {
|
|
5
5
|
lang?: string;
|
|
6
6
|
openBtn: string;
|
|
@@ -47,7 +47,7 @@ export type ContactBubbleProps = {
|
|
|
47
47
|
alwaysShow?: boolean;
|
|
48
48
|
texts?: ContactBubbleI18n;
|
|
49
49
|
lang?: string;
|
|
50
|
-
} & SSRSupportProps & ({
|
|
50
|
+
} & SSRSupportProps & WrapperElmProps & ({
|
|
51
51
|
open?: boolean;
|
|
52
52
|
onToggle: (isOpen: boolean) => void;
|
|
53
53
|
} | {
|
package/esm/ContactBubble.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
2
3
|
import { focusElm } from '@hugsmidjan/qj/focusElm';
|
|
3
4
|
import { useDomid } from '@hugsmidjan/react/hooks';
|
|
4
|
-
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
5
5
|
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
6
6
|
import { Link } from './_abstract/_Link.js';
|
|
7
7
|
import { breakOnNL } from './_abstract/breakOnNL.js';
|
|
@@ -32,14 +32,15 @@ export const ensureIcon = (maybeIcon) => maybeIcon && icons[maybeIcon]
|
|
|
32
32
|
? maybeIcon
|
|
33
33
|
: undefined;
|
|
34
34
|
export const ContactBubble = (props) => {
|
|
35
|
-
const { title, links, onToggle, alwaysShow } = props;
|
|
35
|
+
const { title, links, onToggle, alwaysShow, wrapperProps = {} } = props;
|
|
36
36
|
const txt = getTexts(props, defaultTexts);
|
|
37
37
|
const useLocalState = props.open == null;
|
|
38
38
|
const [localOpen, setLocalOpen] = useState(false);
|
|
39
39
|
const open = useLocalState ? localOpen : props.open;
|
|
40
40
|
const isBrowser = useIsBrowserSide(props.ssr);
|
|
41
41
|
const domid = useDomid();
|
|
42
|
-
const
|
|
42
|
+
const _wrapperRef = useRef(null);
|
|
43
|
+
const wrapperRef = wrapperProps.ref || _wrapperRef;
|
|
43
44
|
const { openBubble, closeBubble } = useMemo(() => ({
|
|
44
45
|
openBubble: () => {
|
|
45
46
|
useLocalState && setLocalOpen(true);
|
|
@@ -116,7 +117,7 @@ export const ContactBubble = (props) => {
|
|
|
116
117
|
if (links.length === 0) {
|
|
117
118
|
return null;
|
|
118
119
|
}
|
|
119
|
-
const menu = (React.createElement("div", { className:
|
|
120
|
+
const menu = (React.createElement("div", Object.assign({}, props.wrapperProps, { className: modifiedClass('ContactBubble', null, wrapperProps.className), id: isBrowser && domid, hidden: isBrowser && !open, "data-always-show": alwaysShow || undefined, "data-sprinkled": isBrowser }),
|
|
120
121
|
React.createElement("h2", { className: "ContactBubble__title" }, title || txt.openBtn),
|
|
121
122
|
React.createElement("ul", { className: "ContactBubble__list" }, links.map((linkInfo, i) => {
|
|
122
123
|
const { href, label, extraLabel, target, onClick } = linkInfo;
|
package/esm/ContentArticle.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { SeenProp } from './utils/seenEffect.js';
|
|
|
3
3
|
import { ArticleMetaProps } from './ArticleMeta.js';
|
|
4
4
|
import { ContentImageProps } from './ContentImage.js';
|
|
5
5
|
import { RelatedLinksProps } from './RelatedLinks.js';
|
|
6
|
+
import { WrapperElmProps } from './utils.js';
|
|
6
7
|
export type ContentArticleProps = {
|
|
7
8
|
/** Date, author, etc. */
|
|
8
9
|
meta?: ArticleMetaProps['items'];
|
|
@@ -11,6 +12,6 @@ export type ContentArticleProps = {
|
|
|
11
12
|
topImage?: ContentImageProps;
|
|
12
13
|
body: ReactNode;
|
|
13
14
|
relatedLinks?: RelatedLinksProps;
|
|
14
|
-
} & SeenProp;
|
|
15
|
+
} & SeenProp & WrapperElmProps;
|
|
15
16
|
export declare const ContentArticle: (props: ContentArticleProps) => JSX.Element;
|
|
16
17
|
export default ContentArticle;
|
package/esm/ContentArticle.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
2
3
|
import { useSeenEffect } from './utils/seenEffect.js';
|
|
3
4
|
import ArticleMeta from './ArticleMeta.js';
|
|
4
5
|
import ContentImage from './ContentImage.js';
|
|
@@ -7,10 +8,10 @@ import RelatedLinks from './RelatedLinks.js';
|
|
|
7
8
|
import TextBlock from './TextBlock.js';
|
|
8
9
|
import VSpacer from './VSpacer.js';
|
|
9
10
|
export const ContentArticle = (props) => {
|
|
10
|
-
const { relatedLinks } = props;
|
|
11
|
+
const { relatedLinks, wrapperProps } = props;
|
|
11
12
|
const [ref] = useSeenEffect(props.startSeen);
|
|
12
13
|
const headingElm = (React.createElement(Heading, { forceH1: props.headlineTag === 'h1' }, props.headline));
|
|
13
|
-
return (React.createElement("div", { className:
|
|
14
|
+
return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('ContentArticle', null, (wrapperProps || {}).className), ref: ref }),
|
|
14
15
|
props.meta ? (React.createElement("div", { className: "ContentArticle__header" },
|
|
15
16
|
headingElm,
|
|
16
17
|
React.createElement(ArticleMeta, { items: props.meta }))) : (headingElm),
|
package/esm/ContentImage.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ImageProps } from './_abstract/_Image.js';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
export type ContentImageProps = {
|
|
3
4
|
image?: ImageProps;
|
|
4
5
|
caption?: string | JSX.Element;
|
|
5
6
|
credit?: string | JSX.Element;
|
|
6
|
-
};
|
|
7
|
+
} & WrapperElmProps;
|
|
7
8
|
export declare const ContentImage: (props: ContentImageProps) => JSX.Element;
|
|
8
9
|
export default ContentImage;
|
package/esm/ContentImage.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
2
3
|
import { Image } from './_abstract/_Image.js';
|
|
3
4
|
export const ContentImage = (props) => {
|
|
4
|
-
const { image, caption, credit } = props;
|
|
5
|
-
return (React.createElement("figure", { className:
|
|
5
|
+
const { image, caption, credit, wrapperProps } = props;
|
|
6
|
+
return (React.createElement("figure", Object.assign({}, wrapperProps, { className: modifiedClass('ContentImage', null, (wrapperProps || {}).className) }),
|
|
6
7
|
(caption || credit) && (React.createElement("figcaption", { className: "ContentImage__caption" },
|
|
7
8
|
caption && React.createElement("span", { className: "ContentImage__text" },
|
|
8
9
|
" ",
|
|
@@ -13,6 +14,6 @@ export const ContentImage = (props) => {
|
|
|
13
14
|
" ",
|
|
14
15
|
credit,
|
|
15
16
|
" "))),
|
|
16
|
-
React.createElement(Image, Object.assign({
|
|
17
|
+
React.createElement(Image, Object.assign({ bem: "ContentImage__image" }, image))));
|
|
17
18
|
};
|
|
18
19
|
export default ContentImage;
|
package/esm/Datepicker.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useDomid } from '@hugsmidjan/react/hooks';
|
|
3
|
-
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
4
3
|
// For more info on localization see: https://stackoverflow.com/questions/54399084/change-locale-in-react-datepicker/58306958#58306958
|
|
5
4
|
import is from 'date-fns/locale/is/index.js';
|
|
6
5
|
import pl from 'date-fns/locale/pl/index.js';
|
|
7
6
|
import { ReactDatePicker, registerLocale, } from './_mixed_export_resolution_/ReactDatepicker.js'; // Docs: https://reactdatepicker.com/
|
|
8
|
-
import { FormField } from './FormField.js';
|
|
7
|
+
import { FormField, groupFormFieldWrapperProps, } from './FormField.js';
|
|
9
8
|
import { useMixedControlState } from './utils.js';
|
|
10
9
|
registerLocale('is', is);
|
|
11
10
|
registerLocale('pl', pl);
|
|
@@ -58,18 +57,19 @@ const i18n = {
|
|
|
58
57
|
* Internally, this component uses the [`react-datepicker`](https://reactdatepicker.com/) component.
|
|
59
58
|
*/
|
|
60
59
|
export const Datepicker = (props) => {
|
|
61
|
-
const {
|
|
62
|
-
const [value, setValue] = useMixedControlState.raw(props.value || props.initialDate,
|
|
60
|
+
const { placeholder, localeCode = 'is', dateFormat = 'd.M.yyyy', name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, inputRef, isoMode, fieldWrapperProps, } = groupFormFieldWrapperProps(props);
|
|
61
|
+
const [value, setValue] = useMixedControlState.raw(props.value || props.initialDate, // eslint-disable-line deprecation/deprecation
|
|
62
|
+
props.defaultValue, 'value');
|
|
63
63
|
/*
|
|
64
64
|
TODO: Revert to this simpler pattern once we hit v0.11
|
|
65
65
|
and `props.initialDate` is removed:
|
|
66
66
|
*/
|
|
67
67
|
// const [value, setValue] = useMixedControlState(props, 'value');
|
|
68
|
-
const domid = useDomid(id);
|
|
68
|
+
const domid = useDomid(props.id);
|
|
69
69
|
const txts = i18n[localeCode] || {};
|
|
70
70
|
const filled = !!value;
|
|
71
71
|
const empty = !filled && !placeholder;
|
|
72
|
-
return (React.createElement(FormField, {
|
|
72
|
+
return (React.createElement(FormField, Object.assign({ extraClassName: "Datepicker", filled: filled, empty: empty }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => {
|
|
73
73
|
return (React.createElement("div", Object.assign({ className: className.input, onClick: ({ target, currentTarget }) => { var _a; return target === currentTarget && ((_a = currentTarget.querySelector('input')) === null || _a === void 0 ? void 0 : _a.focus()); }, ref: inputRef &&
|
|
74
74
|
((elm) => {
|
|
75
75
|
inputRef.current =
|
|
@@ -99,6 +99,6 @@ export const Datepicker = (props) => {
|
|
|
99
99
|
// TODO: Implement this
|
|
100
100
|
// selectsRange
|
|
101
101
|
minDate: minDate, maxDate: maxDate, startDate: startDate, endDate: endDate, selectsStart: isStartDate, selectsEnd: isEndDate, formatWeekDay: (weekday) => weekday.charAt(0).toUpperCase(), showYearDropdown: true, scrollableYearDropdown: true, yearDropdownItemNumber: 15, showMonthDropdown: true }, inputProps, txts, datepickerExtraProps))));
|
|
102
|
-
} }));
|
|
102
|
+
} })));
|
|
103
103
|
};
|
|
104
104
|
export default Datepicker;
|
package/esm/ExtraLinks.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CardListProps, TextCardProps } from './_abstract/_CardList.js';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
import { WrapperElmProps } from './utils.js';
|
|
3
4
|
export type RelatedLink = {
|
|
4
5
|
href: string;
|
|
5
6
|
label: string;
|
|
@@ -13,6 +14,6 @@ type RelatedProps = {
|
|
|
13
14
|
export type ExtraLinksCardProps = Omit<TextCardProps, 'meta'>;
|
|
14
15
|
export type ExtraLinksProps = CardListProps<ExtraLinksCardProps> & RelatedProps & {
|
|
15
16
|
className?: string;
|
|
16
|
-
} & SeenProp;
|
|
17
|
+
} & WrapperElmProps & SeenProp;
|
|
17
18
|
export declare const ExtraLinks: (props: ExtraLinksProps) => JSX.Element;
|
|
18
19
|
export default ExtraLinks;
|
package/esm/ExtraLinks.js
CHANGED
|
@@ -13,10 +13,12 @@ const ExtraLinks__related = (props) => {
|
|
|
13
13
|
React.createElement(Link, { className: modifiedClass('ExtraLinks__related__link', type), href: href, target: blank ? '_blank' : '', rel: blank ? 'noreferrer noopener' : '' }, label)))))));
|
|
14
14
|
};
|
|
15
15
|
export const ExtraLinks = (props) => {
|
|
16
|
-
const { relatedTitle, relatedLinks, className, startSeen } = props, cardListProps = __rest(props, ["relatedTitle", "relatedLinks", "className", "startSeen"]);
|
|
16
|
+
const { relatedTitle, relatedLinks, className, startSeen, wrapperProps } = props, cardListProps = __rest(props, ["relatedTitle", "relatedLinks", "className", "startSeen", "wrapperProps"]);
|
|
17
17
|
const hasRelated = !!(relatedLinks && relatedLinks.length);
|
|
18
18
|
const [ref] = useSeenEffect(startSeen);
|
|
19
|
-
return (React.createElement("div", { className: modifiedClass('ExtraLinks', hasRelated && 'related',
|
|
19
|
+
return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('ExtraLinks', hasRelated && 'related',
|
|
20
|
+
// Prefer `className` over `wrapperProps.className`
|
|
21
|
+
className || (wrapperProps || {}).className), ref: ref }),
|
|
20
22
|
React.createElement("div", { className: "ExtraLinks__main" },
|
|
21
23
|
React.createElement(CardList, Object.assign({}, cardListProps, { bemPrefix: "ExtraLinks" }))),
|
|
22
24
|
hasRelated && (React.createElement(ExtraLinks__related, { relatedTitle: relatedTitle, relatedLinks: relatedLinks }))));
|
package/esm/FeatureList.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Efnistakn } from '@reykjavik/hanna-utils/assets';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect.js';
|
|
3
|
+
import { WrapperElmProps } from './utils.js';
|
|
3
4
|
export type FeatureListProps = {
|
|
4
5
|
title: string;
|
|
5
6
|
features: Array<{
|
|
@@ -7,6 +8,6 @@ export type FeatureListProps = {
|
|
|
7
8
|
iconUrl?: string;
|
|
8
9
|
name: string;
|
|
9
10
|
}>;
|
|
10
|
-
} & SeenProp;
|
|
11
|
+
} & WrapperElmProps & SeenProp;
|
|
11
12
|
export declare const FeatureList: (props: FeatureListProps) => JSX.Element;
|
|
12
13
|
export default FeatureList;
|
package/esm/FeatureList.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
2
3
|
import { useSeenEffect } from './utils/seenEffect.js';
|
|
3
4
|
import Bling from './Bling.js';
|
|
4
5
|
export const FeatureList = (props) => {
|
|
5
|
-
const { title, features, startSeen } = props;
|
|
6
|
+
const { title, features, startSeen, wrapperProps } = props;
|
|
6
7
|
const [ref] = useSeenEffect(startSeen);
|
|
7
8
|
const _features = features.length ? features : [{ name: '...' }];
|
|
8
9
|
return (React.createElement(React.Fragment, null,
|
|
9
10
|
React.createElement(Bling, { type: "snake-large", align: "left", vertical: "down-ish" }),
|
|
10
|
-
React.createElement("div", { className:
|
|
11
|
+
React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('FeatureList', null, (wrapperProps || {}).className), ref: ref }),
|
|
11
12
|
React.createElement("h2", { className: "FeatureList__title" }, title),
|
|
12
13
|
React.createElement("ul", { className: "FeatureList__list" }, _features.map(({ name, icon, iconUrl }, i) => (React.createElement("li", { key: i, className: "FeatureList__feature", style: iconUrl
|
|
13
14
|
? { '--efnistakn': `url("${iconUrl}")` }
|
package/esm/FieldGroup.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
export type FieldGroupProps = {
|
|
3
4
|
legend: string;
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
small?: boolean;
|
|
6
7
|
className?: string;
|
|
7
8
|
children: ReactNode;
|
|
8
|
-
}
|
|
9
|
+
} & WrapperElmProps<'fieldset'>;
|
|
9
10
|
export declare const FieldGroup: (props: FieldGroupProps) => JSX.Element;
|
|
10
11
|
export default FieldGroup;
|
package/esm/FieldGroup.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
3
|
export const FieldGroup = (props) => {
|
|
4
|
-
const { legend, children, className, disabled, small } = props;
|
|
5
|
-
return (React.createElement("fieldset", { className: modifiedClass('FieldGroup', small && 'small',
|
|
4
|
+
const { legend, children, className, disabled, small, wrapperProps } = props;
|
|
5
|
+
return (React.createElement("fieldset", Object.assign({}, wrapperProps, { className: modifiedClass('FieldGroup', small && 'small',
|
|
6
|
+
// Prefer `className` over `wrapperProps.className`
|
|
7
|
+
className || (wrapperProps || {}).className), disabled: disabled }),
|
|
6
8
|
React.createElement("legend", { className: "FieldGroup__legend" }, legend),
|
|
7
9
|
children));
|
|
8
10
|
};
|
package/esm/FileInput.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileListProps } from './FileInput/_FileInputFileList.js';
|
|
2
2
|
import { FormFieldWrappingProps } from './FormField.js';
|
|
3
|
-
export type FileInputProps = {
|
|
3
|
+
export type FileInputProps = FormFieldWrappingProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Flags if the input should accept multiple, or just a single file at a time.
|
|
6
6
|
*
|
|
@@ -43,6 +43,6 @@ export type FileInputProps = {
|
|
|
43
43
|
accept?: string;
|
|
44
44
|
multiple?: boolean;
|
|
45
45
|
};
|
|
46
|
-
}
|
|
46
|
+
};
|
|
47
47
|
export declare const FileInput: (props: FileInputProps) => JSX.Element;
|
|
48
48
|
export default FileInput;
|
package/esm/FileInput.js
CHANGED
|
@@ -6,7 +6,7 @@ import { DEFAULT_LANG } from '@reykjavik/hanna-utils/i18n';
|
|
|
6
6
|
import { useDropzone } from './_mixed_export_resolution_/ReactDropzone.js';
|
|
7
7
|
import { addPreview, formatBytes, getFileListUpdate, releasePreview, } from './FileInput/_FileInput.utils.js';
|
|
8
8
|
import { DefaultFileList } from './FileInput/_FileInputFileList.js';
|
|
9
|
-
import FormField from './FormField.js';
|
|
9
|
+
import FormField, { groupFormFieldWrapperProps, } from './FormField.js';
|
|
10
10
|
const defaultRemoveFileText = {
|
|
11
11
|
is: 'Fjarlægja',
|
|
12
12
|
en: 'Remove',
|
|
@@ -28,8 +28,13 @@ const arrayToFileList = (arr) => {
|
|
|
28
28
|
return fileList.files;
|
|
29
29
|
};
|
|
30
30
|
export const FileInput = (props) => {
|
|
31
|
-
|
|
32
|
-
const
|
|
31
|
+
var _a, _b, _c;
|
|
32
|
+
const lang = props.lang || DEFAULT_LANG;
|
|
33
|
+
const _d = groupFormFieldWrapperProps(props), { dropzoneProps, // eslint-disable-line deprecation/deprecation
|
|
34
|
+
multiple = (_b = (_a = props.dropzoneProps) === null || _a === void 0 ? void 0 : _a.multiple) !== null && _b !== void 0 ? _b : true, // eslint-disable-line deprecation/deprecation
|
|
35
|
+
accept = (_c = props.dropzoneProps) === null || _c === void 0 ? void 0 : _c.accept, // eslint-disable-line deprecation/deprecation
|
|
36
|
+
dropzoneText, removeFileText = defaultRemoveFileText[lang] || defaultRemoveFileText[DEFAULT_LANG], FileList = DefaultFileList, onFilesUpdated = () => undefined, onFilesRejected, showFileSize, showImagePreviews, value = [], fieldWrapperProps } = _d, inputElementProps = __rest(_d, ["dropzoneProps", "multiple", "accept", "dropzoneText", "removeFileText", "FileList", "onFilesUpdated", "onFilesRejected", "showFileSize", "showImagePreviews", "value", "fieldWrapperProps"]);
|
|
37
|
+
const domid = useDomid(props.id);
|
|
33
38
|
const fileInputWrapper = useRef(null);
|
|
34
39
|
const fileInput = useRef(null);
|
|
35
40
|
const files = value;
|
|
@@ -101,7 +106,7 @@ export const FileInput = (props) => {
|
|
|
101
106
|
}
|
|
102
107
|
onFilesUpdated(fileList, diff);
|
|
103
108
|
};
|
|
104
|
-
return (React.createElement(FormField, {
|
|
109
|
+
return (React.createElement(FormField, Object.assign({ extraClassName: modifiedClass('FileInput', [multiple && 'multi']) }, fieldWrapperProps, { id: domid + '-fake', LabelTag: "h4", renderInput: (className, inputProps /* , addFocusProps */) => {
|
|
105
110
|
return (React.createElement("div", { className: className.control, ref: fileInputWrapper },
|
|
106
111
|
// Explicitly skip rendering of input element if no
|
|
107
112
|
// name prop is provided. This is implicitly what the
|
|
@@ -125,6 +130,6 @@ export const FileInput = (props) => {
|
|
|
125
130
|
removeFile,
|
|
126
131
|
formatBytes,
|
|
127
132
|
})))));
|
|
128
|
-
} }));
|
|
133
|
+
} })));
|
|
129
134
|
};
|
|
130
135
|
export default FileInput;
|