@reykjavik/hanna-react 0.10.103 → 0.10.104
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 +2 -2
- package/Alert.d.ts +2 -2
- package/Alert.js +1 -0
- package/AutosuggestSearch.d.ts +40 -0
- package/AutosuggestSearch.js +70 -0
- package/BasicTable.d.ts +24 -4
- package/BasicTable.js +20 -19
- package/BreadCrumbs.d.ts +2 -2
- package/CHANGELOG.md +34 -0
- package/ContactBubble.d.ts +4 -3
- package/ContactBubble.js +7 -4
- package/Datepicker.d.ts +8 -3
- package/Datepicker.js +36 -14
- package/FileInput.d.ts +2 -1
- package/FileInput.js +2 -2
- package/FormField.js +2 -2
- package/Gallery.d.ts +2 -1
- package/Gallery.js +5 -0
- package/Layout.d.ts +4 -3
- package/Layout.js +0 -3
- package/MainMenu/_PrimaryPanel.d.ts +3 -4
- package/MainMenu/_PrimaryPanel.js +1 -1
- package/MainMenu.d.ts +6 -4
- package/MainMenu.js +8 -16
- package/Multiselect.d.ts +2 -1
- package/Multiselect.js +4 -3
- package/NameCard.d.ts +2 -1
- package/NameCard.js +7 -0
- package/Pagination.d.ts +2 -2
- package/ReadSpeakerPlayer.js +13 -5
- package/SearchInput.d.ts +24 -2
- package/SearchInput.js +13 -3
- package/SearchResults.d.ts +2 -1
- package/SearchResults.js +10 -2
- package/ShareButtons.d.ts +3 -2
- package/SiteSearchAutocomplete.d.ts +11 -11
- package/SiteSearchAutocomplete.js +21 -7
- package/SiteSearchCurtain.js +2 -2
- package/SiteSearchInput.d.ts +19 -10
- package/SiteSearchInput.js +9 -6
- package/Tooltip.js +4 -3
- package/VerticalTabsTOC.js +2 -2
- package/_abstract/_ScrollWrapper.d.ts +10 -0
- package/_abstract/_ScrollWrapper.js +21 -0
- package/_abstract/_Table.d.ts +71 -0
- package/_abstract/_Table.js +55 -0
- package/_abstract/_TogglerGroup.js +2 -2
- package/_abstract/_TogglerInput.js +2 -2
- package/_mixed_export_resolution_/ReactDatepicker.d.ts +3 -0
- package/esm/AccordionList.js +1 -1
- package/esm/Alert.d.ts +2 -2
- package/esm/Alert.js +1 -0
- package/esm/AutosuggestSearch.d.ts +40 -0
- package/esm/AutosuggestSearch.js +66 -0
- package/esm/BasicTable.d.ts +24 -4
- package/esm/BasicTable.js +19 -18
- package/esm/BreadCrumbs.d.ts +2 -2
- package/esm/ContactBubble.d.ts +4 -3
- package/esm/ContactBubble.js +6 -3
- package/esm/Datepicker.d.ts +8 -3
- package/esm/Datepicker.js +35 -13
- package/esm/FileInput.d.ts +2 -1
- package/esm/FileInput.js +1 -1
- package/esm/FormField.js +1 -1
- package/esm/Gallery.d.ts +2 -1
- package/esm/Gallery.js +5 -0
- package/esm/Layout.d.ts +4 -3
- package/esm/Layout.js +0 -3
- package/esm/MainMenu/_PrimaryPanel.d.ts +3 -4
- package/esm/MainMenu/_PrimaryPanel.js +1 -1
- package/esm/MainMenu.d.ts +6 -4
- package/esm/MainMenu.js +8 -16
- package/esm/Multiselect.d.ts +2 -1
- package/esm/Multiselect.js +2 -1
- package/esm/NameCard.d.ts +2 -1
- package/esm/NameCard.js +7 -0
- package/esm/Pagination.d.ts +2 -2
- package/esm/ReadSpeakerPlayer.js +13 -5
- package/esm/SearchInput.d.ts +24 -2
- package/esm/SearchInput.js +13 -3
- package/esm/SearchResults.d.ts +2 -1
- package/esm/SearchResults.js +9 -1
- package/esm/ShareButtons.d.ts +3 -2
- package/esm/SiteSearchAutocomplete.d.ts +11 -11
- package/esm/SiteSearchAutocomplete.js +21 -7
- package/esm/SiteSearchCurtain.js +1 -1
- package/esm/SiteSearchInput.d.ts +19 -10
- package/esm/SiteSearchInput.js +8 -6
- package/esm/Tooltip.js +2 -1
- package/esm/VerticalTabsTOC.js +1 -1
- package/esm/_abstract/_ScrollWrapper.d.ts +10 -0
- package/esm/_abstract/_ScrollWrapper.js +16 -0
- package/esm/_abstract/_Table.d.ts +71 -0
- package/esm/_abstract/_Table.js +51 -0
- package/esm/_abstract/_TogglerGroup.js +1 -1
- package/esm/_abstract/_TogglerInput.js +1 -1
- package/esm/_mixed_export_resolution_/ReactDatepicker.d.ts +3 -0
- package/esm/index.d.ts +1 -0
- package/esm/utils/browserSide.d.ts +119 -1
- package/esm/utils/browserSide.js +152 -1
- package/esm/utils/config.d.ts +1 -14
- package/esm/utils/config.js +0 -2
- package/esm/utils/useCallbackOnEsc.d.ts +6 -0
- package/esm/utils/useCallbackOnEsc.js +25 -0
- package/esm/utils/useDomid.d.ts +8 -0
- package/esm/utils/useDomid.js +17 -0
- package/esm/utils/useLaggedState.d.ts +18 -0
- package/esm/utils/useLaggedState.js +84 -0
- package/esm/utils/useOnClickOutside.d.ts +9 -0
- package/esm/utils/useOnClickOutside.js +32 -0
- package/esm/utils/useScrollEdgeDetect.d.ts +15 -0
- package/esm/utils/useScrollEdgeDetect.js +45 -0
- package/esm/utils/useShortState.d.ts +2 -0
- package/esm/utils/useShortState.js +34 -0
- package/esm/utils.d.ts +1 -0
- package/esm/utils.js +1 -0
- package/index.d.ts +1 -0
- package/package.json +6 -2
- package/utils/browserSide.d.ts +119 -1
- package/utils/browserSide.js +156 -4
- package/utils/config.d.ts +1 -14
- package/utils/config.js +1 -4
- package/utils/useCallbackOnEsc.d.ts +6 -0
- package/utils/useCallbackOnEsc.js +29 -0
- package/utils/useDomid.d.ts +8 -0
- package/utils/useDomid.js +21 -0
- package/utils/useLaggedState.d.ts +18 -0
- package/utils/useLaggedState.js +88 -0
- package/utils/useOnClickOutside.d.ts +9 -0
- package/utils/useOnClickOutside.js +35 -0
- package/utils/useScrollEdgeDetect.d.ts +15 -0
- package/utils/useScrollEdgeDetect.js +50 -0
- package/utils/useShortState.d.ts +2 -0
- package/utils/useShortState.js +38 -0
- package/utils.d.ts +1 -0
- package/utils.js +1 -0
package/esm/Datepicker.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
3
3
|
// For more info on localization see: https://stackoverflow.com/questions/54399084/change-locale-in-react-datepicker/58306958#58306958
|
|
4
4
|
import is from 'date-fns/locale/is/index.js';
|
|
5
5
|
import pl from 'date-fns/locale/pl/index.js';
|
|
6
6
|
import { ReactDatePicker, registerLocale, } from './_mixed_export_resolution_/ReactDatepicker.js'; // Docs: https://reactdatepicker.com/
|
|
7
|
+
import { useDomid } from './utils/useDomid.js';
|
|
7
8
|
import { FormField, groupFormFieldWrapperProps, } from './FormField.js';
|
|
8
9
|
import { useMixedControlState } from './utils.js';
|
|
9
10
|
registerLocale('is', is);
|
|
@@ -17,8 +18,9 @@ export const getDateDiff = (refDate, dayOffset) => {
|
|
|
17
18
|
newDate.setDate(newDate.getDate() + dayOffset);
|
|
18
19
|
return newDate;
|
|
19
20
|
};
|
|
20
|
-
const
|
|
21
|
+
const defaultDatepickerTexts = {
|
|
21
22
|
is: {
|
|
23
|
+
ariaLabelClose: 'Loka',
|
|
22
24
|
nextMonthAriaLabel: 'Næsti mánuður',
|
|
23
25
|
nextMonthButtonLabel: 'Næsti mánuður',
|
|
24
26
|
nextYearAriaLabel: 'Næsta ár',
|
|
@@ -27,14 +29,34 @@ const i18n = {
|
|
|
27
29
|
previousMonthButtonLabel: 'Fyrri mánuður',
|
|
28
30
|
previousYearAriaLabel: 'Fyrra ár',
|
|
29
31
|
previousYearButtonLabel: 'Fyrra ár',
|
|
30
|
-
timeInputLabel: 'Tími:
|
|
31
|
-
weekAriaLabelPrefix: 'Vika:
|
|
32
|
+
timeInputLabel: 'Tími:',
|
|
33
|
+
weekAriaLabelPrefix: 'Vika:',
|
|
32
34
|
weekLabel: 'Vika',
|
|
33
|
-
|
|
35
|
+
monthAriaLabelPrefix: 'Mánuður:',
|
|
34
36
|
chooseDayAriaLabelPrefix: 'Veldu:',
|
|
35
|
-
disabledDayAriaLabelPrefix: '
|
|
37
|
+
disabledDayAriaLabelPrefix: 'Ekki í boði:',
|
|
38
|
+
},
|
|
39
|
+
// React-datepicker has its own (default) English translation built in.
|
|
40
|
+
// No need to repeat all of it here.
|
|
41
|
+
en: {
|
|
42
|
+
// ariaLabelClose: 'Close',
|
|
43
|
+
// nextMonthAriaLabel: 'Next month',
|
|
44
|
+
// nextMonthButtonLabel: 'Next month',
|
|
45
|
+
// nextYearAriaLabel: 'Next year',
|
|
46
|
+
// nextYearButtonLabel: 'Next year',
|
|
47
|
+
// previousMonthAriaLabel: 'Previous month',
|
|
48
|
+
// previousMonthButtonLabel: 'Previous month',
|
|
49
|
+
// previousYearAriaLabel: 'Previous year',
|
|
50
|
+
// previousYearButtonLabel: 'Previous year',
|
|
51
|
+
// timeInputLabel: 'Time:',
|
|
52
|
+
// weekAriaLabelPrefix: 'Week:',
|
|
53
|
+
// weekLabel: 'Week',
|
|
54
|
+
monthAriaLabelPrefix: 'Month:',
|
|
55
|
+
chooseDayAriaLabelPrefix: 'Choose:',
|
|
56
|
+
disabledDayAriaLabelPrefix: 'Not available:',
|
|
36
57
|
},
|
|
37
58
|
pl: {
|
|
59
|
+
ariaLabelClose: 'Zamknij',
|
|
38
60
|
nextMonthAriaLabel: 'Następny miesiącu',
|
|
39
61
|
nextMonthButtonLabel: 'Następny miesiącu',
|
|
40
62
|
nextYearAriaLabel: 'Następny rok',
|
|
@@ -43,12 +65,12 @@ const i18n = {
|
|
|
43
65
|
previousMonthButtonLabel: 'Poprzedni miesiac',
|
|
44
66
|
previousYearAriaLabel: 'Poprzedni rok',
|
|
45
67
|
previousYearButtonLabel: 'Poprzedni rok',
|
|
46
|
-
timeInputLabel: 'Czas:
|
|
47
|
-
weekAriaLabelPrefix: 'Tydzień:
|
|
68
|
+
timeInputLabel: 'Czas:',
|
|
69
|
+
weekAriaLabelPrefix: 'Tydzień:',
|
|
48
70
|
weekLabel: 'Tydzień',
|
|
49
|
-
|
|
71
|
+
monthAriaLabelPrefix: 'Miesiąc:',
|
|
50
72
|
chooseDayAriaLabelPrefix: 'Wybierać:',
|
|
51
|
-
disabledDayAriaLabelPrefix: '
|
|
73
|
+
disabledDayAriaLabelPrefix: 'Niedostępna:',
|
|
52
74
|
},
|
|
53
75
|
};
|
|
54
76
|
/**
|
|
@@ -57,7 +79,7 @@ const i18n = {
|
|
|
57
79
|
* Internally, this component uses the [`react-datepicker`](https://reactdatepicker.com/) component.
|
|
58
80
|
*/
|
|
59
81
|
export const Datepicker = (props) => {
|
|
60
|
-
const { placeholder,
|
|
82
|
+
const { placeholder, dateFormat = 'd.M.yyyy', name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, inputRef, isoMode, texts, lang = props.localeCode, fieldWrapperProps, } = groupFormFieldWrapperProps(props);
|
|
61
83
|
const [value, setValue] = useMixedControlState.raw(props.value || props.initialDate, // eslint-disable-line deprecation/deprecation
|
|
62
84
|
props.defaultValue, 'value');
|
|
63
85
|
/*
|
|
@@ -66,7 +88,7 @@ export const Datepicker = (props) => {
|
|
|
66
88
|
*/
|
|
67
89
|
// const [value, setValue] = useMixedControlState(props, 'value');
|
|
68
90
|
const domid = useDomid(props.id);
|
|
69
|
-
const txts =
|
|
91
|
+
const txts = getTexts({ texts, lang }, defaultDatepickerTexts);
|
|
70
92
|
const filled = !!value;
|
|
71
93
|
const empty = !filled && !placeholder;
|
|
72
94
|
return (React.createElement(FormField, Object.assign({ extraClassName: "Datepicker", filled: filled, empty: empty }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => {
|
|
@@ -77,7 +99,7 @@ export const Datepicker = (props) => {
|
|
|
77
99
|
return elm;
|
|
78
100
|
}) }, addFocusProps()),
|
|
79
101
|
isoMode && (React.createElement("input", { type: "hidden", name: name, value: value === null || value === void 0 ? void 0 : value.toISOString().slice(0, 10) })),
|
|
80
|
-
React.createElement(ReactDatePicker, Object.assign({ id: domid, required: inputProps.required, disabled: inputProps.disabled, readOnly: inputProps.readOnly, selected: value, name: isoMode ? undefined : name, locale:
|
|
102
|
+
React.createElement(ReactDatePicker, Object.assign({ id: domid, required: inputProps.required, disabled: inputProps.disabled, readOnly: inputProps.readOnly, selected: value, name: isoMode ? undefined : name, locale: lang, dateFormat:
|
|
81
103
|
// NOTE: Force all dateFormat values into Array<string> to temporarily work around
|
|
82
104
|
// a bug in the current version of react-datepicker where invalid `string` values
|
|
83
105
|
// are re-parsed with `new Date()`, causing surprising (weird) false positives
|
package/esm/FileInput.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
1
2
|
import { FileListProps } from './FileInput/_FileInputFileList.js';
|
|
2
3
|
import { FormFieldWrappingProps } from './FormField.js';
|
|
3
4
|
export type FileInputProps = FormFieldWrappingProps & {
|
|
@@ -15,7 +16,7 @@ export type FileInputProps = FormFieldWrappingProps & {
|
|
|
15
16
|
accept?: string | Array<string>;
|
|
16
17
|
dropzoneText: string | JSX.Element;
|
|
17
18
|
removeFileText?: string;
|
|
18
|
-
lang?:
|
|
19
|
+
lang?: HannaLang;
|
|
19
20
|
showFileSize?: boolean;
|
|
20
21
|
showImagePreviews?: boolean;
|
|
21
22
|
FileList?: false | ((props: FileListProps) => JSX.Element | null);
|
package/esm/FileInput.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
4
|
-
import { useDomid } from '@hugsmidjan/react/hooks';
|
|
5
4
|
import { DEFAULT_LANG } from '@reykjavik/hanna-utils/i18n';
|
|
6
5
|
import { useDropzone } from './_mixed_export_resolution_/ReactDropzone.js';
|
|
7
6
|
import { addPreview, formatBytes, getFileListUpdate, releasePreview, } from './FileInput/_FileInput.utils.js';
|
|
8
7
|
import { DefaultFileList } from './FileInput/_FileInputFileList.js';
|
|
8
|
+
import { useDomid } from './utils/useDomid.js';
|
|
9
9
|
import FormField, { groupFormFieldWrapperProps, } from './FormField.js';
|
|
10
10
|
const defaultRemoveFileText = {
|
|
11
11
|
is: 'Fjarlægja',
|
package/esm/FormField.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useCallback, useState } from 'react';
|
|
3
3
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
4
|
-
import { useDomid } from '@hugsmidjan/react/hooks';
|
|
5
4
|
import { isPreact } from './utils/env.js';
|
|
5
|
+
import { useDomid } from './utils/useDomid.js';
|
|
6
6
|
import { useIsBrowserSide } from './utils.js';
|
|
7
7
|
const inputClassNames = {
|
|
8
8
|
bem: 'FormField',
|
package/esm/Gallery.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
1
2
|
import { GalleryItemProps } from './Gallery/_GalleryItem.js';
|
|
2
3
|
import { DeprecatedSeenProp } from './utils/seenEffect.js';
|
|
3
4
|
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
@@ -10,7 +11,7 @@ export type GalleryI18n = {
|
|
|
10
11
|
export type GalleryProps = {
|
|
11
12
|
items: Array<GalleryItemProps>;
|
|
12
13
|
texts?: GalleryI18n;
|
|
13
|
-
lang?:
|
|
14
|
+
lang?: HannaLang;
|
|
14
15
|
} & SSRSupportProps & WrapperElmProps & DeprecatedSeenProp;
|
|
15
16
|
export declare const Gallery: (props: GalleryProps) => JSX.Element;
|
|
16
17
|
export default Gallery;
|
package/esm/Gallery.js
CHANGED
|
@@ -15,6 +15,11 @@ const defaultTexts = {
|
|
|
15
15
|
modalPrevLabel: 'Fyrri mynd',
|
|
16
16
|
modalCloseLabel: 'Til baka í grein',
|
|
17
17
|
},
|
|
18
|
+
pl: {
|
|
19
|
+
modalNextLabel: 'Następne zdjęcie',
|
|
20
|
+
modalPrevLabel: 'Poprzednie zdjęcie',
|
|
21
|
+
modalCloseLabel: 'Powrót do artykułu',
|
|
22
|
+
},
|
|
18
23
|
};
|
|
19
24
|
export const Gallery = (props) => {
|
|
20
25
|
const { items, ssr } = props;
|
package/esm/Layout.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import type { HannaColorTheme } from '@reykjavik/hanna-css';
|
|
3
3
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
4
|
-
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
4
|
+
import { DefaultTexts, HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
5
5
|
import { BemModifierProps } from './utils/types.js';
|
|
6
6
|
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
7
7
|
export type LayoutI18n = {
|
|
8
|
-
lang?: string;
|
|
9
8
|
skipLinkLabel: string;
|
|
10
9
|
closeMenuLabel: string;
|
|
11
10
|
closeMenuLabelLong?: string;
|
|
11
|
+
/** @deprecated Not used (Will be removed in v0.11) */
|
|
12
|
+
lang?: string;
|
|
12
13
|
};
|
|
13
14
|
export declare const defaultLayoutTexts: DefaultTexts<LayoutI18n>;
|
|
14
15
|
type LayoutProps = {
|
|
@@ -19,7 +20,7 @@ type LayoutProps = {
|
|
|
19
20
|
logoLink?: string;
|
|
20
21
|
siteName?: string;
|
|
21
22
|
texts?: LayoutI18n;
|
|
22
|
-
lang?:
|
|
23
|
+
lang?: HannaLang;
|
|
23
24
|
} & SSRSupportProps & WrapperElmProps & BemModifierProps & EitherObj<{
|
|
24
25
|
mainChildren: ReactNode;
|
|
25
26
|
}, {
|
package/esm/Layout.js
CHANGED
|
@@ -7,19 +7,16 @@ import { Link } from './_abstract/_Link.js';
|
|
|
7
7
|
import { HannaUIState, useMenuToggling, useScrollbarWidthCSSVar, } from './utils.js';
|
|
8
8
|
export const defaultLayoutTexts = {
|
|
9
9
|
is: {
|
|
10
|
-
lang: 'is',
|
|
11
10
|
skipLinkLabel: 'Valmynd',
|
|
12
11
|
closeMenuLabel: 'Loka',
|
|
13
12
|
closeMenuLabelLong: 'Loka valmynd',
|
|
14
13
|
},
|
|
15
14
|
en: {
|
|
16
|
-
lang: 'en',
|
|
17
15
|
skipLinkLabel: 'Skip to navigation',
|
|
18
16
|
closeMenuLabel: 'Close',
|
|
19
17
|
closeMenuLabelLong: 'Close menu',
|
|
20
18
|
},
|
|
21
19
|
pl: {
|
|
22
|
-
lang: 'pl',
|
|
23
20
|
skipLinkLabel: 'Przejdź do nawigacji',
|
|
24
21
|
closeMenuLabel: 'Zamknij',
|
|
25
22
|
closeMenuLabelLong: 'Zamknij menu',
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
-
import { Modifiers } from '@hugsmidjan/react/types';
|
|
3
2
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
3
|
+
import { BemModifierProps } from '../utils/types.js';
|
|
4
4
|
export type PrimaryPanelI18n = {
|
|
5
5
|
backToMenu: string;
|
|
6
6
|
backToMenuLong?: string;
|
|
7
7
|
};
|
|
8
8
|
export type MegaMenuItem = {
|
|
9
9
|
current?: boolean;
|
|
10
|
-
|
|
11
|
-
modifier?: Modifiers;
|
|
12
|
-
} & EitherObj<{
|
|
10
|
+
} & BemModifierProps & EitherObj<{
|
|
13
11
|
label: string;
|
|
14
12
|
summary?: string;
|
|
15
13
|
href: string;
|
|
16
14
|
lang?: string;
|
|
15
|
+
hrefLang?: string;
|
|
17
16
|
target?: React.HTMLAttributeAnchorTarget;
|
|
18
17
|
}, {
|
|
19
18
|
Content: () => JSX.Element;
|
|
@@ -12,7 +12,7 @@ export const PrimaryPanel = (props) => {
|
|
|
12
12
|
React.createElement("h3", { className: "PrimaryPanel__title" },
|
|
13
13
|
' ',
|
|
14
14
|
isBrowser && !isActive ? (React.createElement("button", { className: "MainMenu__mega__title-toggler", "aria-controls": panel.id, onClick: () => setActivePanel(panel, false), "aria-pressed": isActive, type: "button" }, panel.title)) : (panel.title)),
|
|
15
|
-
React.createElement("ul", { className: "PrimaryPanel__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: modifiedClass('PrimaryPanel__item', item.modifier), "aria-current": item.current || undefined }, item.Content ? (React.createElement(item.Content, null)) : (React.createElement(Link, { className: "PrimaryPanel__link", href: item.href, target: item.target, lang: item.lang },
|
|
15
|
+
React.createElement("ul", { className: "PrimaryPanel__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: modifiedClass('PrimaryPanel__item', item.modifier), "aria-current": item.current || undefined }, item.Content ? (React.createElement(item.Content, null)) : (React.createElement(Link, { className: "PrimaryPanel__link", href: item.href, target: item.target, lang: item.lang, hrefLang: item.hrefLang },
|
|
16
16
|
React.createElement("span", { className: "PrimaryPanel__linkTitle" }, item.label),
|
|
17
17
|
' ',
|
|
18
18
|
React.createElement("small", { className: "PrimaryPanel__summary" }, item.summary),
|
package/esm/MainMenu.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Modifiers } from '@hugsmidjan/qj/classUtils';
|
|
3
3
|
import { Cleanup } from '@reykjavik/hanna-utils';
|
|
4
|
-
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
4
|
+
import { DefaultTexts, HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
5
5
|
import { AuxilaryPanelIllustration, AuxiliaryPanelProps } from './MainMenu/_Auxiliary.js';
|
|
6
6
|
import { MegaMenuItem, MegaMenuItemList, MegaMenuPanel, PrimaryPanelI18n } from './MainMenu/_PrimaryPanel.js';
|
|
7
7
|
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
8
8
|
export type MainMenuI18n = Cleanup<{
|
|
9
|
-
lang?: string;
|
|
10
9
|
homeLabel?: string;
|
|
11
10
|
title: string;
|
|
11
|
+
/** @deprecated Not used (Will be removed in v0.11) */
|
|
12
|
+
lang?: string;
|
|
12
13
|
} & PrimaryPanelI18n>;
|
|
13
|
-
export declare const defaultMainMenuTexts: DefaultTexts<Required<MainMenuI18n
|
|
14
|
+
export declare const defaultMainMenuTexts: DefaultTexts<Required<Omit<MainMenuI18n, 'lang'>>>;
|
|
14
15
|
export type { AuxilaryPanelIllustration, AuxiliaryPanelProps, MegaMenuItem, MegaMenuItemList, MegaMenuPanel, };
|
|
15
16
|
export type MainMenuItem = {
|
|
16
17
|
label: string;
|
|
17
18
|
labelLong?: string;
|
|
18
19
|
lang?: string;
|
|
20
|
+
hrefLang?: string;
|
|
19
21
|
/**
|
|
20
22
|
* Puts a modifier className on the menu item element.
|
|
21
23
|
*
|
|
@@ -63,7 +65,7 @@ export type MainMenuProps = {
|
|
|
63
65
|
onItemClick?: (index: number, item: MainMenuItem) => void | boolean;
|
|
64
66
|
activePanelId?: string;
|
|
65
67
|
texts?: MainMenuI18n;
|
|
66
|
-
lang?:
|
|
68
|
+
lang?: HannaLang;
|
|
67
69
|
} & SSRSupportProps & WrapperElmProps<null, 'aria-label'>;
|
|
68
70
|
export declare const MainMenu: (props: MainMenuProps) => JSX.Element | null;
|
|
69
71
|
export default MainMenu;
|
package/esm/MainMenu.js
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
3
|
import { focusElm } from '@hugsmidjan/qj/focusElm';
|
|
4
|
-
import
|
|
5
|
-
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
4
|
+
import { DEFAULT_LANG, getTexts, } from '@reykjavik/hanna-utils/i18n';
|
|
6
5
|
import { Link } from './_abstract/_Link.js';
|
|
7
6
|
import { AuxiliaryPanel, } from './MainMenu/_Auxiliary.js';
|
|
8
7
|
import { PrimaryPanel, } from './MainMenu/_PrimaryPanel.js';
|
|
9
8
|
import { useHannaUIState } from './utils/HannaUIState.js';
|
|
10
9
|
import { useFormatMonitor } from './utils/useFormatMonitor.js';
|
|
10
|
+
import { useShortState } from './utils/useShortState.js';
|
|
11
11
|
import { useIsBrowserSide } from './utils.js';
|
|
12
12
|
const findActivePanel = (megaPanels, activeId) => activeId ? megaPanels.find((panel) => activeId === panel.id) : undefined;
|
|
13
13
|
export const defaultMainMenuTexts = {
|
|
14
14
|
is: {
|
|
15
|
-
lang: 'is',
|
|
16
15
|
title: 'Aðalvalmynd',
|
|
17
16
|
homeLabel: 'Forsíða',
|
|
18
17
|
backToMenu: 'Loka',
|
|
19
18
|
backToMenuLong: 'Til baka í valmynd',
|
|
20
19
|
},
|
|
21
20
|
en: {
|
|
22
|
-
lang: 'en',
|
|
23
21
|
title: 'Main Menu',
|
|
24
22
|
homeLabel: 'Home page',
|
|
25
23
|
backToMenu: 'Close',
|
|
26
24
|
backToMenuLong: 'Close and return to menu',
|
|
27
25
|
},
|
|
28
26
|
pl: {
|
|
29
|
-
lang: 'pl',
|
|
30
27
|
title: 'Menu główne',
|
|
31
28
|
homeLabel: 'Strona główna',
|
|
32
29
|
backToMenu: 'Zamknij',
|
|
@@ -66,16 +63,11 @@ const normalizeMenuItems = (itemsProp, megaPanels, homeLink, texts) => {
|
|
|
66
63
|
}
|
|
67
64
|
if (!hasHomeItem) {
|
|
68
65
|
if (!homeLink || typeof homeLink === 'string') {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
defaultMainMenuTexts.is;
|
|
75
|
-
label = def.homeLabel;
|
|
76
|
-
lang = def.lang;
|
|
77
|
-
}
|
|
78
|
-
homeLink = { href: homeLink || '/', label, lang };
|
|
66
|
+
homeLink = {
|
|
67
|
+
href: homeLink || '/',
|
|
68
|
+
label: texts.homeLabel || defaultMainMenuTexts[DEFAULT_LANG].homeLabel,
|
|
69
|
+
lang: texts.homeLabel ? undefined : DEFAULT_LANG,
|
|
70
|
+
};
|
|
79
71
|
}
|
|
80
72
|
items.unshift(Object.assign(Object.assign({}, homeLink), { modifier: 'home' }));
|
|
81
73
|
}
|
|
@@ -211,7 +203,7 @@ export const MainMenu = (props) => {
|
|
|
211
203
|
React.createElement(Link, { className: "MainMenu__link", href: item.href, target: item.target, "aria-label": labelLong, title: labelLong, onClick: () => {
|
|
212
204
|
const keepOpen = onItemClick && onItemClick(i, item) === false;
|
|
213
205
|
!keepOpen && closeHamburgerMenu();
|
|
214
|
-
}, lang: lang }, label)) : undefined // skip rendering non-link menu items server side
|
|
206
|
+
}, lang: lang, hrefLang: item.hrefLang }, label)) : undefined // skip rendering non-link menu items server side
|
|
215
207
|
));
|
|
216
208
|
})),
|
|
217
209
|
'\n\n',
|
package/esm/Multiselect.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
1
2
|
import { TogglerGroupFieldProps } from './_abstract/_TogglerGroupField.js';
|
|
2
3
|
import { SearchScoringfn } from './Multiselect/_Multiselect.search.js';
|
|
3
4
|
export type MultiselectI18n = {
|
|
@@ -46,7 +47,7 @@ export type MultiselectProps = TogglerGroupFieldProps<string> & {
|
|
|
46
47
|
*/
|
|
47
48
|
forceSearchable?: boolean;
|
|
48
49
|
texts?: MultiselectI18n;
|
|
49
|
-
lang?:
|
|
50
|
+
lang?: HannaLang;
|
|
50
51
|
};
|
|
51
52
|
export declare const Multiselect: {
|
|
52
53
|
(props: MultiselectProps): JSX.Element;
|
package/esm/Multiselect.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
3
3
|
import domId from '@hugsmidjan/qj/domid';
|
|
4
|
-
import { useDomid, useOnClickOutside } from '@hugsmidjan/react/hooks';
|
|
5
4
|
import { notNully } from '@reykjavik/hanna-utils';
|
|
6
5
|
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
7
6
|
import { FocusTrap } from './_abstract/_FocusTrap.js';
|
|
8
7
|
import { filterItems } from './Multiselect/_Multiselect.search.js';
|
|
8
|
+
import { useDomid } from './utils/useDomid.js';
|
|
9
|
+
import { useOnClickOutside } from './utils/useOnClickOutside.js';
|
|
9
10
|
import Checkbox from './Checkbox.js';
|
|
10
11
|
import FormField, { getFormFieldWrapperProps } from './FormField.js';
|
|
11
12
|
import TagPill from './TagPill.js';
|
package/esm/NameCard.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
1
2
|
import { WrapperElmProps } from './utils.js';
|
|
2
3
|
export type NameCardI18n = {
|
|
3
4
|
updatedLabel: string;
|
|
@@ -54,8 +55,8 @@ export type NameCardProps = {
|
|
|
54
55
|
available?: boolean;
|
|
55
56
|
/** Meta data about freshness status, etc. */
|
|
56
57
|
updated?: string | Date;
|
|
57
|
-
lang?: string;
|
|
58
58
|
texts?: NameCardI18n;
|
|
59
|
+
lang?: HannaLang;
|
|
59
60
|
/** @deprecated Use `available` instead (will be removed in v0.11) */
|
|
60
61
|
vacancy?: boolean;
|
|
61
62
|
/** @deprecated Use `contactInfo` instead (will be removed in v0.11) */
|
package/esm/NameCard.js
CHANGED
|
@@ -34,6 +34,13 @@ const defaultTexts = {
|
|
|
34
34
|
vacancyLabel: 'Laus pláss',
|
|
35
35
|
noVacancyLabel: 'Ekki laus pláss',
|
|
36
36
|
},
|
|
37
|
+
pl: {
|
|
38
|
+
updatedLabel: 'Zaktualizowano',
|
|
39
|
+
availableLabel: '',
|
|
40
|
+
unavailableLabel: '',
|
|
41
|
+
vacancyLabel: 'Wakat',
|
|
42
|
+
noVacancyLabel: 'Brak wakatów',
|
|
43
|
+
},
|
|
37
44
|
};
|
|
38
45
|
export const NameCard = (props) => {
|
|
39
46
|
const { name, location, hours, aboutText, available = props.vacancy, // eslint-disable-line deprecation/deprecation
|
package/esm/Pagination.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { MouseEvent } from 'react';
|
|
2
2
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
3
|
-
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
3
|
+
import { DefaultTexts, HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
4
4
|
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
5
5
|
type StringContaining<Token extends string> = `${string}${Token}${string}`;
|
|
6
6
|
export type PageTemplateString = StringContaining<'${page}'>;
|
|
@@ -19,8 +19,8 @@ export type PaginationProps = {
|
|
|
19
19
|
'aria-controls'?: string;
|
|
20
20
|
title?: string;
|
|
21
21
|
submit?: boolean;
|
|
22
|
-
lang?: string;
|
|
23
22
|
texts?: PaginationI18n;
|
|
23
|
+
lang?: HannaLang;
|
|
24
24
|
} & EitherObj<{
|
|
25
25
|
href: PageTemplateString | ((page: number) => string);
|
|
26
26
|
onChange?: (page: number, clickEvent: MouseEvent) => void;
|
package/esm/ReadSpeakerPlayer.js
CHANGED
|
@@ -3,6 +3,13 @@ import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
|
3
3
|
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
4
4
|
const scriptTagId = 'rs_req_Init';
|
|
5
5
|
const scriptTagSelector = `script#${scriptTagId}`;
|
|
6
|
+
/**
|
|
7
|
+
* Counts the number of ReadSpeaker buttons mounted on the page.
|
|
8
|
+
* When mounting the first button, a script tag will be added to the page,
|
|
9
|
+
* and this counter incremented. When unmounting, this counter is decremented,
|
|
10
|
+
* and when it reaches `0`, the script tag will be removed from the page.
|
|
11
|
+
* GC FTW!
|
|
12
|
+
*/
|
|
6
13
|
let buttons = 0;
|
|
7
14
|
export const defaultReadSpeakerPlayerTexts = {
|
|
8
15
|
en: { linkText: 'Listen', linkLabel: 'Listen to this page read outloud' },
|
|
@@ -19,13 +26,14 @@ export const ReadSpeakerPlayer = (props) => {
|
|
|
19
26
|
const { linkText, linkLabel } = getTexts({ lang: lang.slice(0, 2), texts }, defaultReadSpeakerPlayerTexts);
|
|
20
27
|
useEffect(() => {
|
|
21
28
|
var _a, _b;
|
|
22
|
-
if (buttons < 0) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
29
|
if (buttons === 0) {
|
|
26
30
|
if (document.querySelector(scriptTagSelector)) {
|
|
27
|
-
|
|
31
|
+
// If the script element has been already added to the page
|
|
32
|
+
// while our `button` count is at 0, then someone else
|
|
33
|
+
// must have injected the script, and is presumably managing it.
|
|
34
|
+
// Therefore, our job is done here.
|
|
28
35
|
return;
|
|
36
|
+
// NOTE: We check this every time, in case the script gets removed.
|
|
29
37
|
}
|
|
30
38
|
const script = document.createElement('script');
|
|
31
39
|
script.id = scriptTagId;
|
|
@@ -46,7 +54,7 @@ export const ReadSpeakerPlayer = (props) => {
|
|
|
46
54
|
},
|
|
47
55
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
56
|
[
|
|
49
|
-
// We
|
|
57
|
+
// NOTE: We do not support dynamic changes to `customerId`
|
|
50
58
|
// or multiple different `customerId`s on the same page.
|
|
51
59
|
// If you try that, things will be weird and wonky.
|
|
52
60
|
]);
|
package/esm/SearchInput.d.ts
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { FormFieldWrappingProps } from './FormField.js';
|
|
3
|
+
type InputElmProps = Omit<JSX.IntrinsicElements['input'], 'className' | 'type' | 'disabled' | 'readOnly' | 'required' | 'onSubmit' | 'ref' | 'value'> & {
|
|
4
|
+
value?: string;
|
|
5
|
+
};
|
|
3
6
|
export type SearchInputProps = FormFieldWrappingProps & {
|
|
4
7
|
small?: boolean;
|
|
5
8
|
type?: string;
|
|
6
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Triggered when user hits ENTER key with the focus inside the input field.
|
|
11
|
+
*
|
|
12
|
+
* Return `true` to __allow__ the browser's default submit hehavior.
|
|
13
|
+
*/
|
|
14
|
+
onSubmit?: (value: string) => boolean | void;
|
|
15
|
+
/**
|
|
16
|
+
* Custom action to perform when the user clicks the search button.
|
|
17
|
+
*
|
|
18
|
+
* Return `true` to __allow__ the browser's default submit hehavior.
|
|
19
|
+
*
|
|
20
|
+
* Defaults to `onSubmit`.
|
|
21
|
+
*/
|
|
22
|
+
onButtonClick?: (value: string) => boolean | void;
|
|
23
|
+
/**
|
|
24
|
+
* Toggle the search `<button/>`.
|
|
25
|
+
*
|
|
26
|
+
* Defaults to `true` if onButtonClick is passed, otherwise false.
|
|
27
|
+
*/
|
|
28
|
+
button?: boolean;
|
|
7
29
|
buttonText?: string;
|
|
8
30
|
inputRef?: RefObject<HTMLInputElement>;
|
|
9
31
|
buttonRef?: RefObject<HTMLButtonElement>;
|
|
10
|
-
} &
|
|
32
|
+
} & InputElmProps;
|
|
11
33
|
export declare const SearchInput: (props: SearchInputProps) => JSX.Element;
|
|
12
34
|
export default SearchInput;
|
package/esm/SearchInput.js
CHANGED
|
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import FormField, { groupFormFieldWrapperProps, } from './FormField.js';
|
|
4
4
|
export const SearchInput = (props) => {
|
|
5
5
|
var _a;
|
|
6
|
-
const _b = groupFormFieldWrapperProps(props), { onChange, onButtonClick, buttonText = 'Leita', fieldWrapperProps } = _b, inputElementProps = __rest(_b, ["onChange", "onButtonClick", "buttonText", "fieldWrapperProps"]);
|
|
6
|
+
const _b = groupFormFieldWrapperProps(props), { onChange, onKeyDown, onSubmit, onButtonClick, button, buttonText = 'Leita', inputRef, buttonRef, fieldWrapperProps } = _b, inputElementProps = __rest(_b, ["onChange", "onKeyDown", "onSubmit", "onButtonClick", "button", "buttonText", "inputRef", "buttonRef", "fieldWrapperProps"]);
|
|
7
7
|
const { value, defaultValue, placeholder } = inputElementProps;
|
|
8
8
|
const [hasValue, setHasValue] = useState(undefined);
|
|
9
9
|
const filled = !!((_a = value !== null && value !== void 0 ? value : hasValue) !== null && _a !== void 0 ? _a : !!defaultValue);
|
|
@@ -14,9 +14,19 @@ export const SearchInput = (props) => {
|
|
|
14
14
|
setHasValue(!!e.target.value);
|
|
15
15
|
onChange && onChange(e);
|
|
16
16
|
};
|
|
17
|
+
const showButton = !!onButtonClick || button;
|
|
18
|
+
const handleButtonClick = onButtonClick || onSubmit;
|
|
17
19
|
return (React.createElement(FormField, Object.assign({ extraClassName: "SearchInput", empty: empty, filled: filled }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => (React.createElement("div", Object.assign({ className: className.input }, addFocusProps()),
|
|
18
|
-
React.createElement("input", Object.assign({ className: "SearchInput__input", onChange: _onChange }, inputProps,
|
|
20
|
+
React.createElement("input", Object.assign({ className: "SearchInput__input", onChange: _onChange }, inputProps, { onKeyDown: onSubmit
|
|
21
|
+
? (e) => {
|
|
22
|
+
if (e.key === 'Enter' && !onSubmit(e.currentTarget.value)) {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
}
|
|
25
|
+
onKeyDown && onKeyDown(e);
|
|
26
|
+
}
|
|
27
|
+
: onKeyDown }, inputElementProps, { ref: inputRef })),
|
|
19
28
|
' ',
|
|
20
|
-
|
|
29
|
+
showButton && (React.createElement("button", { className: "SearchInput__button", type: "submit", onClick: handleButtonClick &&
|
|
30
|
+
((e) => !handleButtonClick(e.currentTarget.value) && e.preventDefault()), title: buttonText, ref: buttonRef, disabled: props.disabled || props.readOnly }, buttonText)))) })));
|
|
21
31
|
};
|
|
22
32
|
export default SearchInput;
|
package/esm/SearchResults.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
2
3
|
import { SearchResultsItemProps } from './SearchResults/_SearchResultsItem.js';
|
|
3
4
|
import { WrapperElmProps } from './utils.js';
|
|
4
5
|
export type SearchReesultI18n = {
|
|
@@ -32,7 +33,7 @@ export type SearchResultsProps = {
|
|
|
32
33
|
pages?: number;
|
|
33
34
|
loadMore?: () => void;
|
|
34
35
|
texts?: SearchReesultI18n;
|
|
35
|
-
lang?:
|
|
36
|
+
lang?: HannaLang;
|
|
36
37
|
} & WrapperElmProps;
|
|
37
38
|
export declare const SearchResults: (props: SearchResultsProps) => JSX.Element;
|
|
38
39
|
export default SearchResults;
|
package/esm/SearchResults.js
CHANGED
|
@@ -3,9 +3,9 @@ import { useInView } from 'react-intersection-observer';
|
|
|
3
3
|
import { modifiedClass } from '@hugsmidjan/qj/classUtils';
|
|
4
4
|
import { prettyNum } from '@hugsmidjan/qj/prettyNum';
|
|
5
5
|
import range from '@hugsmidjan/qj/range';
|
|
6
|
-
import { useDomid } from '@hugsmidjan/react/hooks';
|
|
7
6
|
import { getTexts } from '@reykjavik/hanna-utils/i18n';
|
|
8
7
|
import { SearchResultsItem, } from './SearchResults/_SearchResultsItem.js';
|
|
8
|
+
import { useDomid } from './utils/useDomid.js';
|
|
9
9
|
import Alert from './Alert.js';
|
|
10
10
|
import Tabs from './Tabs.js';
|
|
11
11
|
const renderDefaultErrorText = () => (React.createElement(React.Fragment, null,
|
|
@@ -29,6 +29,14 @@ const defaultTexts = {
|
|
|
29
29
|
loadMore: 'Sækja fleiri',
|
|
30
30
|
// loadingMore: 'Sæki fleiri...',
|
|
31
31
|
},
|
|
32
|
+
pl: {
|
|
33
|
+
lang: 'pl',
|
|
34
|
+
loadQueryTitle: 'Ładowanie wyników...',
|
|
35
|
+
resultsTitle: 'wyniki wyszukiwania dla',
|
|
36
|
+
noResultsTitle: 'Nie znaleziono wyników dla',
|
|
37
|
+
loadMore: 'Załaduj więcej',
|
|
38
|
+
// loadingMore: 'Ładowanie...',
|
|
39
|
+
},
|
|
32
40
|
};
|
|
33
41
|
const SearchResults_Tabs = (props) => {
|
|
34
42
|
const { domid, filters, activeIdx, setFilter, lang } = props;
|
package/esm/ShareButtons.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { HannaLang } from '@reykjavik/hanna-utils/i18n';
|
|
1
2
|
import { ShareButtonI18n, ShareButtonPlatforms } from '@reykjavik/hanna-utils/shareButtonsUtils';
|
|
2
3
|
import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
3
4
|
export type ShareButtonsProps = {
|
|
4
|
-
texts?:
|
|
5
|
-
lang?:
|
|
5
|
+
texts?: ShareButtonI18n;
|
|
6
|
+
lang?: HannaLang;
|
|
6
7
|
} & SSRSupportProps & WrapperElmProps<null, 'aria-label'> & Partial<Record<ShareButtonPlatforms, boolean>>;
|
|
7
8
|
export declare const ShareButtons: (props: ShareButtonsProps) => JSX.Element | null;
|
|
8
9
|
export default ShareButtons;
|