@reykjavik/hanna-react 0.10.75 → 0.10.77
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 +3 -3
- package/AccordionList.js +1 -1
- package/ActionCards.d.ts +2 -2
- package/Alert.d.ts +4 -4
- package/Alert.js +4 -4
- package/ArticleCards.d.ts +3 -3
- package/ArticleCarousel/_ArticleCarouselCard.d.ts +2 -2
- package/ArticleCarousel.d.ts +2 -2
- package/ArticleMeta.d.ts +2 -2
- package/Attention.d.ts +1 -1
- package/BasicTable.d.ts +1 -1
- package/BgBox.d.ts +1 -1
- package/Bling.d.ts +5 -5
- package/BlockQuote.d.ts +1 -1
- package/BreadCrumbs.d.ts +3 -3
- package/ButtonBack.d.ts +1 -1
- package/ButtonBar.d.ts +1 -1
- package/ButtonPrimary.d.ts +1 -1
- package/ButtonSecondary.d.ts +1 -1
- package/ButtonTertiary.d.ts +3 -3
- package/CHANGELOG.md +19 -2
- package/CarouselStepper.d.ts +1 -1
- package/CenterColumn.d.ts +1 -1
- package/Checkbox.d.ts +1 -1
- package/CheckboxButton.d.ts +4 -0
- package/CheckboxButton.js +9 -0
- package/CheckboxButtonsGroup.d.ts +3 -2
- package/CheckboxButtonsGroup.js +2 -3
- package/CheckboxGroup.d.ts +4 -3
- package/CityBlock.d.ts +1 -1
- package/ContactBubble.d.ts +5 -5
- package/ContactBubble.js +2 -1
- package/ContentArticle.d.ts +1 -1
- package/ContentArticle.js +4 -2
- package/ContentImage.d.ts +1 -1
- package/Datepicker.d.ts +2 -2
- package/Datepicker.js +5 -5
- package/ExtraLinks.d.ts +4 -4
- package/FeatureList.d.ts +1 -1
- package/FieldGroup.d.ts +1 -1
- package/FileInput/_FileInput.utils.d.ts +1 -1
- package/FileInput/_FileInputFileList.d.ts +1 -1
- package/FileInput.d.ts +1 -1
- package/Foonote.d.ts +1 -1
- package/FooterBadges.d.ts +1 -1
- package/FooterInfo.d.ts +3 -3
- package/Footnote.d.ts +1 -1
- package/Form.d.ts +1 -1
- package/FormField.d.ts +8 -8
- package/FormField.js +7 -6
- package/Gallery/_GalleryItem.d.ts +1 -1
- package/Gallery/_GalleryModal.d.ts +1 -1
- package/Gallery/_GalleryModalContext.d.ts +1 -1
- package/Gallery.d.ts +3 -3
- package/GridBlocks.d.ts +3 -3
- package/Heading.d.ts +2 -2
- package/Heading.js +1 -1
- package/HeroBlock.d.ts +2 -2
- package/IframeBlock.d.ts +1 -1
- package/Illustration.d.ts +1 -1
- package/ImageCards.d.ts +3 -3
- package/InfoBlock.d.ts +1 -1
- package/InfoHero.d.ts +2 -2
- package/IslandBlock.d.ts +4 -4
- package/IslandPageBlock.d.ts +3 -3
- package/LabeledTextBlock.d.ts +1 -1
- package/Layout.d.ts +3 -3
- package/Layout.js +2 -2
- package/MainMenu/_Auxiliary.d.ts +2 -2
- package/MainMenu/_PrimaryPanel.d.ts +1 -1
- package/MainMenu.d.ts +8 -8
- package/MainMenu.js +2 -2
- package/MiniMetrics.d.ts +1 -1
- package/Modal.d.ts +1 -1
- package/NameCard.d.ts +4 -4
- package/NameCards.d.ts +1 -1
- package/NewsHero.d.ts +2 -2
- package/PageFilter.d.ts +1 -1
- package/PageHeading.d.ts +1 -1
- package/Picture.d.ts +1 -1
- package/ProcessOverview.d.ts +2 -2
- package/PullQuote.d.ts +1 -1
- package/README.md +1 -1
- package/RadioButtonsGroup.d.ts +3 -2
- package/RadioButtonsGroup.js +2 -2
- package/RadioGroup.d.ts +5 -4
- package/RadioGroup.js +1 -1
- package/RelatedLinks.d.ts +3 -3
- package/RowBlock.d.ts +1 -1
- package/RowBlockColumn.d.ts +1 -1
- package/SearchInput.d.ts +3 -3
- package/SearchResults/_SearchResultsItem.d.ts +2 -2
- package/SearchResults.d.ts +4 -4
- package/SeenEffect.d.ts +1 -1
- package/Selectbox.d.ts +2 -2
- package/ShareButtons.d.ts +2 -2
- package/Sharpie.d.ts +3 -3
- package/SiteSearchAutocomplete.d.ts +2 -2
- package/SiteSearchCurtain.d.ts +2 -2
- package/SiteSearchCurtain.js +7 -12
- package/SiteSearchInput.d.ts +5 -5
- package/Skeleton.d.ts +3 -3
- package/SubHeading.d.ts +1 -1
- package/Tabs.d.ts +6 -6
- package/Tabs.js +2 -2
- package/TagPill.d.ts +2 -2
- package/TextBlock.d.ts +1 -1
- package/TextButton.d.ts +1 -1
- package/TextInput.d.ts +3 -3
- package/VSpacer.d.ts +3 -3
- package/VerticalTabsTOC.d.ts +3 -3
- package/WizardLayout.d.ts +2 -2
- package/WizardLayout.js +2 -2
- package/WizardStepper.d.ts +2 -2
- package/_abstract/_AbstractCarousel.d.ts +3 -3
- package/_abstract/_AbstractCarousel.js +2 -2
- package/_abstract/_Blings.d.ts +2 -2
- package/_abstract/_Block.d.ts +4 -4
- package/_abstract/_Button.d.ts +9 -9
- package/_abstract/_CardList.d.ts +8 -8
- package/_abstract/_Image.d.ts +5 -5
- package/_abstract/_Link.d.ts +42 -9
- package/_abstract/_Link.js +44 -4
- package/_abstract/_Quote.d.ts +1 -1
- package/_abstract/_TogglerGroup.d.ts +7 -5
- package/_abstract/_TogglerGroup.js +14 -16
- package/_abstract/_TogglerGroupField.d.ts +6 -4
- package/_abstract/_TogglerGroupField.js +9 -3
- package/_abstract/_TogglerInput.d.ts +3 -2
- package/_abstract/_TogglerInput.js +9 -7
- package/assets.d.ts +4 -4
- package/constants.d.ts +2 -2
- package/index.d.ts +1 -0
- package/package.json +6 -6
- package/utils/browserSide.d.ts +1 -0
- package/utils/browserSide.js +6 -0
- package/utils/config.d.ts +2 -0
- package/utils/config.js +3 -4
- package/utils/seenEffect.d.ts +3 -3
- package/utils/useFormatMonitor.js +1 -1
- package/utils/useGetSVGtext.d.ts +1 -1
- package/utils/useMenuToggling.d.ts +1 -1
- package/utils/useMixedControlState.d.ts +5 -5
- package/utils.d.ts +1 -0
- package/utils.js +1 -0
package/AccordionList.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
2
1
|
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
|
|
2
|
+
import { SSRSupport } from './utils';
|
|
3
|
+
export type AccordionListItemProps = {
|
|
4
4
|
title: string | JSX.Element;
|
|
5
5
|
content: string | JSX.Element | undefined;
|
|
6
6
|
id?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type AccordionListProps = {
|
|
10
10
|
items: Array<AccordionListItemProps>;
|
|
11
11
|
/** Index of the currently open items (controlled use) */
|
|
12
12
|
open?: Array<number>;
|
package/AccordionList.js
CHANGED
|
@@ -11,7 +11,7 @@ const AccordionListItem = (props) => {
|
|
|
11
11
|
const { title, content, id, disabled = false, ssr, open, onToggle } = props;
|
|
12
12
|
const defaultOpen = (0, react_1.useRef)(props.defaultOpen);
|
|
13
13
|
const domid = (0, hooks_1.useDomid)();
|
|
14
|
-
const isBrowser = (0,
|
|
14
|
+
const isBrowser = (0, utils_1.useIsBrowserSide)(ssr);
|
|
15
15
|
const itemDisabled = (isBrowser && disabled) || !content;
|
|
16
16
|
return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('AccordionList__item', [itemDisabled && 'disabled']), id: id, "data-start-open": defaultOpen.current, "data-sprinkled": isBrowser },
|
|
17
17
|
react_1.default.createElement("h3", { className: "AccordionList__title" }, isBrowser ? (react_1.default.createElement("button", { type: "button", className: "AccordionList__button", "aria-controls": domid, "aria-expanded": open || undefined, onClick: onToggle, disabled: itemDisabled }, title)) : (title)),
|
package/ActionCards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CardListSummaryProps, TextCardListProps, TextCardProps } from './_abstract/_CardList';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type ActionCardsProps = TextCardListProps & CardListSummaryProps & SeenProp;
|
|
4
|
+
export type ActionCardsItemProps = TextCardProps;
|
|
5
5
|
export declare const ActionCards: (props: ActionCardsProps) => JSX.Element;
|
|
6
6
|
export default ActionCards;
|
package/Alert.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
3
2
|
import { EitherObj } from '@reykjavik/hanna-utils';
|
|
4
3
|
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
5
|
-
|
|
4
|
+
import { SSRSupport } from './utils';
|
|
5
|
+
export type AlertI18n = {
|
|
6
6
|
closeLabel: string;
|
|
7
7
|
closeLabelLong?: string;
|
|
8
8
|
};
|
|
@@ -14,8 +14,8 @@ export declare const alertTypes: {
|
|
|
14
14
|
error: number;
|
|
15
15
|
critical: number;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
export
|
|
17
|
+
type AlertType = keyof typeof alertTypes;
|
|
18
|
+
export type AlertProps = {
|
|
19
19
|
type: AlertType;
|
|
20
20
|
closable?: boolean;
|
|
21
21
|
children?: ReactNode;
|
package/Alert.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Alert = exports.alertTypes = exports.defaultAlertTexts = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const hooks_1 = require("@hugsmidjan/react/hooks");
|
|
7
6
|
const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
|
|
8
7
|
const i18n_1 = require("@reykjavik/hanna-utils/i18n");
|
|
9
8
|
const _Button_1 = require("./_abstract/_Button");
|
|
10
9
|
const env_1 = require("./utils/env");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
11
|
// FIXME: Eventually import from @reykjavik/hanna-css
|
|
12
12
|
const AlertCloseTransitionDuration = 400;
|
|
13
13
|
const useAutoClosing = (autoClose) => {
|
|
@@ -41,12 +41,12 @@ const Alert = (props) => {
|
|
|
41
41
|
const autoClose = Math.max(props.autoClose || 0, 0);
|
|
42
42
|
const closing = (0, react_1.useRef)();
|
|
43
43
|
const [open, setOpen] = (0, react_1.useState)(!!ssr);
|
|
44
|
-
const isBrowser = (0,
|
|
44
|
+
const isBrowser = (0, utils_1.useIsBrowserSide)(ssr);
|
|
45
45
|
const showCloseButton = closable && (isBrowser || closeUrl != null);
|
|
46
46
|
const { closeLabel, closeLabelLong } = (0, i18n_1.getTexts)(props, exports.defaultAlertTexts);
|
|
47
|
-
(0,
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
48
|
setOpen(true);
|
|
49
|
-
});
|
|
49
|
+
}, []);
|
|
50
50
|
const closeAlert = (0, react_1.useCallback)((event) => {
|
|
51
51
|
const ret = onClose &&
|
|
52
52
|
// @ts-expect-error (@deprecated `event` parameter will be removed in v0.11)
|
package/ArticleCards.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Cleanup } from '@reykjavik/hanna-utils';
|
|
2
2
|
import { ImageCardListProps, ImageCardProps } from './_abstract/_CardList';
|
|
3
|
-
export
|
|
3
|
+
export type ArticleCardsItemProps = ImageCardProps;
|
|
4
4
|
/** @deprecated Use `ArticleCardsItemProps` instead (Remove in v0.11) */
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type ArticleCardProps = ArticleCardsItemProps;
|
|
6
|
+
export type ArticleCardsProps = Cleanup<Pick<ImageCardListProps, 'cards' | 'imgPlaceholder'>>;
|
|
7
7
|
export declare const ArticleCards: (props: ArticleCardsProps) => JSX.Element;
|
|
8
8
|
export default ArticleCards;
|
|
@@ -2,10 +2,10 @@ import type { HannaColorTheme } from '@reykjavik/hanna-css';
|
|
|
2
2
|
import { Illustration } from '@reykjavik/hanna-utils/assets';
|
|
3
3
|
import { ImageProps } from '../_abstract/_Image';
|
|
4
4
|
import { ColorFamily } from '../constants';
|
|
5
|
-
export
|
|
5
|
+
export type ArticleCarouselImageProps = ImageProps & {
|
|
6
6
|
photo?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type ArticleCarouselCardProps = {
|
|
9
9
|
date?: string;
|
|
10
10
|
title: string;
|
|
11
11
|
summary: string;
|
package/ArticleCarousel.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
2
1
|
import { ArticleCarouselCardProps, ArticleCarouselImageProps } from './ArticleCarousel/_ArticleCarouselCard';
|
|
3
2
|
import { SeenProp } from './utils/seenEffect';
|
|
4
|
-
|
|
3
|
+
import { SSRSupport } from './utils';
|
|
4
|
+
export type ArticleCarouselProps = {
|
|
5
5
|
items: Array<ArticleCarouselCardProps>;
|
|
6
6
|
title?: string;
|
|
7
7
|
moreLabel?: string;
|
package/ArticleMeta.d.ts
CHANGED
package/Attention.d.ts
CHANGED
package/BasicTable.d.ts
CHANGED
|
@@ -1,7 +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';
|
|
4
|
-
export
|
|
4
|
+
export type BasicTableProps = {
|
|
5
5
|
compact?: boolean;
|
|
6
6
|
type?: 'text' | 'number';
|
|
7
7
|
modifier?: string;
|
package/BgBox.d.ts
CHANGED
package/Bling.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare const colors: {
|
|
|
4
4
|
secondary: boolean;
|
|
5
5
|
primary: boolean;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type BlingColor = keyof typeof colors;
|
|
8
8
|
declare const aligns: {
|
|
9
9
|
left: boolean;
|
|
10
10
|
'left-ish': boolean;
|
|
@@ -13,7 +13,7 @@ declare const aligns: {
|
|
|
13
13
|
'right-ish': boolean;
|
|
14
14
|
right: boolean;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type BlingAlignment = keyof typeof aligns;
|
|
17
17
|
declare const valigns: {
|
|
18
18
|
up: boolean;
|
|
19
19
|
'up-ish': boolean;
|
|
@@ -21,7 +21,7 @@ declare const valigns: {
|
|
|
21
21
|
'down-ish': boolean;
|
|
22
22
|
down: boolean;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type BlingVAlignment = keyof typeof valigns;
|
|
25
25
|
declare const parentOffset: {
|
|
26
26
|
top: boolean;
|
|
27
27
|
'top-ish': boolean;
|
|
@@ -29,8 +29,8 @@ declare const parentOffset: {
|
|
|
29
29
|
'bottom-ish': boolean;
|
|
30
30
|
bottom: boolean;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
33
|
-
export
|
|
32
|
+
export type BlingParentOffset = keyof typeof parentOffset;
|
|
33
|
+
export type BlingProps = {
|
|
34
34
|
/**
|
|
35
35
|
* Horizontal alignment relative to the bling container's
|
|
36
36
|
* full width
|
package/BlockQuote.d.ts
CHANGED
package/BreadCrumbs.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type BreadCrumb = {
|
|
2
2
|
href?: string;
|
|
3
3
|
label: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type BreadCrumbTrail = Array<BreadCrumb>;
|
|
6
|
+
export type BreadCrumbsProps = {
|
|
7
7
|
title: string;
|
|
8
8
|
trail: BreadCrumbTrail;
|
|
9
9
|
};
|
package/ButtonBack.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from './_abstract/_Button';
|
|
3
|
-
export
|
|
3
|
+
export type ButtonBackProps = ButtonProps;
|
|
4
4
|
export declare const ButtonBack: (props: ButtonBackProps & {
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
}) => JSX.Element;
|
package/ButtonBar.d.ts
CHANGED
package/ButtonPrimary.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
|
|
3
|
-
export
|
|
3
|
+
export type ButtonPrimaryProps = ButtonProps & ButtonVariantProps;
|
|
4
4
|
export declare const ButtonPrimary: (props: ButtonPrimaryProps & {
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
}) => JSX.Element;
|
package/ButtonSecondary.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
|
|
3
|
-
export
|
|
3
|
+
export type ButtonSecondaryProps = ButtonProps & ButtonVariantProps;
|
|
4
4
|
export declare const ButtonSecondary: (props: ButtonSecondaryProps & {
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
}) => JSX.Element;
|
package/ButtonTertiary.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
3
|
+
type TertiarySize = Extract<ButtonVariantProps['size'], 'normal' | 'small'>;
|
|
4
|
+
type TertiaryIcon = Extract<ButtonVariantProps['icon'], 'none' | 'go-back'>;
|
|
5
|
+
export type ButtonTertiaryProps = ButtonProps & Omit<ButtonVariantProps, 'icon' | 'size'> & {
|
|
6
6
|
size?: TertiarySize;
|
|
7
7
|
icon?: TertiaryIcon;
|
|
8
8
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -4,12 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
- ... <!-- Add new lines here. -->
|
|
6
6
|
|
|
7
|
-
## 0.10.
|
|
7
|
+
## 0.10.77
|
|
8
|
+
|
|
9
|
+
_2022-12-18_
|
|
10
|
+
|
|
11
|
+
- feat: Add standalone component `.CheckboxButton`
|
|
12
|
+
- feat: Add `.CheckboxButton__label__wrap` and `.RadioButton__label__wrap`
|
|
13
|
+
- feat: Add `utils` hooks `useIsBrowserSide`, `useIsServerSide` — for
|
|
14
|
+
progressive enhancement
|
|
15
|
+
- feat: Add `utils` helper `setDefaultSSR()`
|
|
16
|
+
- feat: `ContentArticle` emits `__header` wrapper
|
|
17
|
+
- fix: Support "uncontrolled" use of all `Checkbox` and `Radio` groups
|
|
18
|
+
- fix: Edge-case bugs in `SiteSearchCurtain` focus-detection
|
|
19
|
+
- fix: Typo in `Datpicker`'s default `dateFormat`, broke typed input parsing
|
|
20
|
+
|
|
21
|
+
## 0.10.75 – 0.10.76
|
|
8
22
|
|
|
9
23
|
_2022-12-15_
|
|
10
24
|
|
|
25
|
+
- feat: Add `setLinkRenderer.pop()` to unset the last custom renderer
|
|
11
26
|
- feat: Add `setLinkRenderer`, exported from `/utils` — to allow hooking
|
|
12
27
|
`hanna-react` into custom routing components
|
|
28
|
+
- fix: Suppress react warning about mixed-case `data-*` attributes
|
|
29
|
+
- fix: Update props type of `LinkRenderer` to use "modern" `ref`
|
|
13
30
|
|
|
14
31
|
## 0.10.74
|
|
15
32
|
|
|
@@ -149,7 +166,7 @@ _2022-08-11_
|
|
|
149
166
|
_2022-06-24_
|
|
150
167
|
|
|
151
168
|
- fix: Add missing prop `checkOrigin` on `IframeBlock` (default: `false`)
|
|
152
|
-
- fix:
|
|
169
|
+
- fix: Support "uncontrolled" use of `CheckboxGroup`, `RadioGroup`, et al.
|
|
153
170
|
- fix: Change build to only export CommonJS
|
|
154
171
|
|
|
155
172
|
## 0.10.59
|
package/CarouselStepper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Props } from '@hugsmidjan/react/CarouselStepper';
|
|
2
|
-
|
|
2
|
+
type CarouselStepperProps = Omit<Props, 'bem' | 'modifier'>;
|
|
3
3
|
export declare const CarouselStepper: (props: CarouselStepperProps) => JSX.Element;
|
|
4
4
|
export default CarouselStepper;
|
package/CenterColumn.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { EffectProp, SeenProp } from './utils/seenEffect';
|
|
3
|
-
export
|
|
3
|
+
export type CenterColumnProps = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
} & SeenProp & EffectProp;
|
|
6
6
|
export declare const CenterColumn: (props: CenterColumnProps) => JSX.Element;
|
package/Checkbox.d.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckboxButton = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const _TogglerInput_1 = require("./_abstract/_TogglerInput");
|
|
7
|
+
const CheckboxButton = (props) => (react_1.default.createElement(_TogglerInput_1.TogglerInput, Object.assign({ bem: "CheckboxButton" }, props, { type: "checkbox", innerWrap: true })));
|
|
8
|
+
exports.CheckboxButton = CheckboxButton;
|
|
9
|
+
exports.default = exports.CheckboxButton;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField';
|
|
2
|
-
export
|
|
2
|
+
export type CheckboxButtonsGroupProps = TogglerGroupFieldProps & {
|
|
3
3
|
value?: Array<string>;
|
|
4
|
+
defaultValue?: Array<string>;
|
|
4
5
|
/** @deprecated (Will be removed in v0.11) */
|
|
5
6
|
columns?: '2col' | '3col';
|
|
6
7
|
/** @deprecated (Will be removed in v0.11) */
|
|
7
8
|
layout?: 'slim';
|
|
8
9
|
};
|
|
9
|
-
export
|
|
10
|
+
export type CheckboxButtonsGroupOptions = TogglerGroupFieldOptions;
|
|
10
11
|
export declare const CheckboxButtonsGroup: (props: CheckboxButtonsGroupProps) => JSX.Element;
|
|
11
12
|
export default CheckboxButtonsGroup;
|
package/CheckboxButtonsGroup.js
CHANGED
|
@@ -4,8 +4,7 @@ exports.CheckboxButtonsGroup = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const _TogglerGroupField_1 = require("./_abstract/_TogglerGroupField");
|
|
7
|
-
const
|
|
8
|
-
const CheckboxButton = (props) => (react_1.default.createElement(_TogglerInput_1.TogglerInput, Object.assign({ bem: "CheckboxButton" }, props, { type: "checkbox" })));
|
|
7
|
+
const CheckboxButton_1 = tslib_1.__importDefault(require("./CheckboxButton"));
|
|
9
8
|
const CheckboxButtonsGroup = (props) => {
|
|
10
9
|
if (props.layout) {
|
|
11
10
|
console.warn('`CheckboxButtonsGroupProps.layout` is deprecated.');
|
|
@@ -13,7 +12,7 @@ const CheckboxButtonsGroup = (props) => {
|
|
|
13
12
|
if (props.columns) {
|
|
14
13
|
console.warn('`CheckboxButtonsGroupProps.columns` is deprecated.');
|
|
15
14
|
}
|
|
16
|
-
return (react_1.default.createElement(_TogglerGroupField_1.TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler:
|
|
15
|
+
return (react_1.default.createElement(_TogglerGroupField_1.TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler: CheckboxButton_1.default })));
|
|
17
16
|
};
|
|
18
17
|
exports.CheckboxButtonsGroup = CheckboxButtonsGroup;
|
|
19
18
|
exports.default = exports.CheckboxButtonsGroup;
|
package/CheckboxGroup.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TogglerGroupFieldOption, TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField';
|
|
2
|
-
export
|
|
2
|
+
export type CheckboxGroupProps = TogglerGroupFieldProps & {
|
|
3
3
|
layout?: 'inline';
|
|
4
4
|
value?: Array<string>;
|
|
5
|
+
defaultValue?: Array<string>;
|
|
5
6
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
7
|
+
export type CheckboxGroupOption = TogglerGroupFieldOption;
|
|
8
|
+
export type CheckboxGroupOptions = TogglerGroupFieldOptions;
|
|
8
9
|
export declare const CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element;
|
|
9
10
|
export default CheckboxGroup;
|
package/CityBlock.d.ts
CHANGED
package/ContactBubble.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
2
1
|
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
3
|
-
|
|
2
|
+
import { SSRSupport } from './utils';
|
|
3
|
+
export type ContactBubbleI18n = {
|
|
4
4
|
lang?: string;
|
|
5
5
|
openBtn: string;
|
|
6
6
|
openBtnLong?: string;
|
|
@@ -15,9 +15,9 @@ declare const icons: {
|
|
|
15
15
|
readonly livechat: 1;
|
|
16
16
|
readonly other: 0;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type ContactBubbleIcon = keyof typeof icons;
|
|
19
19
|
export declare const ensureIcon: (maybeIcon: string | undefined) => ContactBubbleIcon | undefined;
|
|
20
|
-
export
|
|
20
|
+
export type ContactBubbleItem = {
|
|
21
21
|
label: string;
|
|
22
22
|
extraLabel?: string;
|
|
23
23
|
icon?: ContactBubbleIcon;
|
|
@@ -31,7 +31,7 @@ export declare type ContactBubbleItem = {
|
|
|
31
31
|
href?: undefined;
|
|
32
32
|
target?: undefined;
|
|
33
33
|
});
|
|
34
|
-
export
|
|
34
|
+
export type ContactBubbleProps = {
|
|
35
35
|
title?: string;
|
|
36
36
|
links: Array<ContactBubbleItem>;
|
|
37
37
|
/** By default the ContactBubble's toggler is hidden if the page
|
package/ContactBubble.js
CHANGED
|
@@ -9,6 +9,7 @@ const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/g
|
|
|
9
9
|
const hanna_utils_1 = require("@reykjavik/hanna-utils");
|
|
10
10
|
const i18n_1 = require("@reykjavik/hanna-utils/i18n");
|
|
11
11
|
const _Link_1 = require("./_abstract/_Link");
|
|
12
|
+
const utils_1 = require("./utils");
|
|
12
13
|
exports.defaultTexts = {
|
|
13
14
|
is: {
|
|
14
15
|
lang: 'is',
|
|
@@ -41,7 +42,7 @@ const ContactBubble = (props) => {
|
|
|
41
42
|
const useLocalState = props.open == null;
|
|
42
43
|
const [localOpen, setLocalOpen] = (0, react_1.useState)(false);
|
|
43
44
|
const open = useLocalState ? localOpen : props.open;
|
|
44
|
-
const isBrowser = (0,
|
|
45
|
+
const isBrowser = (0, utils_1.useIsBrowserSide)(props.ssr);
|
|
45
46
|
const domid = (0, hooks_1.useDomid)();
|
|
46
47
|
const wrapperRef = (0, react_1.useRef)(null);
|
|
47
48
|
const { openBubble, closeBubble } = (0, react_1.useMemo)(() => ({
|
package/ContentArticle.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { SeenProp } from './utils/seenEffect';
|
|
|
3
3
|
import { ArticleMetaProps } from './ArticleMeta';
|
|
4
4
|
import { ContentImageProps } from './ContentImage';
|
|
5
5
|
import { RelatedLinksProps } from './RelatedLinks';
|
|
6
|
-
export
|
|
6
|
+
export type ContentArticleProps = {
|
|
7
7
|
/** Date, author, etc. */
|
|
8
8
|
meta?: ArticleMetaProps['items'];
|
|
9
9
|
headline: string;
|
package/ContentArticle.js
CHANGED
|
@@ -13,9 +13,11 @@ const VSpacer_1 = tslib_1.__importDefault(require("./VSpacer"));
|
|
|
13
13
|
const ContentArticle = (props) => {
|
|
14
14
|
const { relatedLinks } = props;
|
|
15
15
|
const [ref] = (0, seenEffect_1.useSeenEffect)(props.startSeen);
|
|
16
|
+
const headingElm = (react_1.default.createElement(Heading_1.default, { forceH1: props.headlineTag === 'h1' }, props.headline));
|
|
16
17
|
return (react_1.default.createElement("div", { className: "ContentArticle", ref: ref },
|
|
17
|
-
props.meta
|
|
18
|
-
|
|
18
|
+
props.meta ? (react_1.default.createElement("div", { className: "ContentArticle__header" },
|
|
19
|
+
headingElm,
|
|
20
|
+
react_1.default.createElement(ArticleMeta_1.default, { items: props.meta }))) : (headingElm),
|
|
19
21
|
react_1.default.createElement(TextBlock_1.default, { startSeen: true },
|
|
20
22
|
props.topImage && react_1.default.createElement(ContentImage_1.default, Object.assign({}, props.topImage)),
|
|
21
23
|
props.body),
|
package/ContentImage.d.ts
CHANGED
package/Datepicker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { FormFieldWrappingProps } from './FormField';
|
|
3
|
-
export
|
|
3
|
+
export type DatepickerProps = {
|
|
4
4
|
small?: boolean;
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
value?: Date;
|
|
@@ -20,7 +20,7 @@ export declare type DatepickerProps = {
|
|
|
20
20
|
initialDate?: Date;
|
|
21
21
|
} & FormFieldWrappingProps;
|
|
22
22
|
export declare const getDateDiff: (date: Date, diff: number) => Date;
|
|
23
|
-
export
|
|
23
|
+
export type DatepickerLocaleProps = {
|
|
24
24
|
nextMonthAriaLabel: string;
|
|
25
25
|
nextMonthButtonLabel: string;
|
|
26
26
|
nextYearAriaLabel: string;
|
package/Datepicker.js
CHANGED
|
@@ -54,7 +54,7 @@ const i18n = {
|
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
56
|
const Datepicker = (props) => {
|
|
57
|
-
const { className, id, label, hideLabel, assistText, disabled, readOnly, invalid, errorMessage, required, reqText, placeholder, small, localeCode = 'is', dateFormat = 'd.M.
|
|
57
|
+
const { className, id, label, hideLabel, assistText, disabled, readOnly, invalid, errorMessage, required, reqText, placeholder, small, localeCode = 'is', dateFormat = 'd.M.yyyy', initialDate, value = initialDate, name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, ssr, inputRef, } = props;
|
|
58
58
|
const domid = (0, hooks_1.useDomid)(id);
|
|
59
59
|
const txts = (localeCode && i18n[localeCode]) || {};
|
|
60
60
|
const filled = !!value;
|
|
@@ -72,13 +72,13 @@ const Datepicker = (props) => {
|
|
|
72
72
|
if (inputElm) {
|
|
73
73
|
inputElm.dispatchEvent(new Event('change', { bubbles: true }));
|
|
74
74
|
}
|
|
75
|
+
}, onChangeRaw: (e) => {
|
|
76
|
+
const { value } = e.currentTarget;
|
|
77
|
+
console.log({ value });
|
|
75
78
|
}, placeholderText: placeholder,
|
|
76
79
|
// TODO: Implement this
|
|
77
80
|
// selectsRange
|
|
78
|
-
minDate: minDate, maxDate: maxDate, startDate: startDate, endDate: endDate, selectsStart: isStartDate, selectsEnd: isEndDate, formatWeekDay: (weekday) =>
|
|
79
|
-
// TODO: if we use costom locale we don't need this
|
|
80
|
-
return weekday.charAt(0).toUpperCase();
|
|
81
|
-
}, showYearDropdown: true, scrollableYearDropdown: true, yearDropdownItemNumber: 15, showMonthDropdown: true }, inputProps, txts, datepickerExtraProps))));
|
|
81
|
+
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))));
|
|
82
82
|
} }));
|
|
83
83
|
};
|
|
84
84
|
exports.Datepicker = Datepicker;
|
package/ExtraLinks.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TextCardListProps } from './_abstract/_CardList';
|
|
2
2
|
import { SeenProp } from './utils/seenEffect';
|
|
3
|
-
export
|
|
3
|
+
export type RelatedLink = {
|
|
4
4
|
href: string;
|
|
5
5
|
label: string;
|
|
6
6
|
blank?: boolean;
|
|
7
7
|
type?: 'link' | 'pdf' | 'text';
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type RelatedProps = {
|
|
10
10
|
relatedTitle?: string;
|
|
11
11
|
relatedLinks?: Array<RelatedLink>;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type ExtraLinksCardProps = TextCardListProps['cards'][number];
|
|
14
|
+
export type ExtraLinksProps = TextCardListProps & RelatedProps & {
|
|
15
15
|
className?: string;
|
|
16
16
|
} & SeenProp;
|
|
17
17
|
export declare const ExtraLinks: (props: ExtraLinksProps) => JSX.Element;
|
package/FeatureList.d.ts
CHANGED
package/FieldGroup.d.ts
CHANGED
package/FileInput.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileListProps } from './FileInput/_FileInputFileList';
|
|
2
2
|
import { FormFieldWrappingProps } from './FormField';
|
|
3
|
-
export
|
|
3
|
+
export type FileInputProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Flags if the input should accept multiple, or just a single file at a time.
|
|
6
6
|
*
|
package/Foonote.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { FootnoteProps as _FootnoteProps } from './Footnote';
|
|
|
3
3
|
*
|
|
4
4
|
* This module file is a typo. import from `Footnote` instead
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type FootnoteProps = _FootnoteProps;
|
|
7
7
|
/** @deprecated (Will be removed in v0.11)
|
|
8
8
|
*
|
|
9
9
|
* This module file is a typo. import from `Footnote` instead
|
package/FooterBadges.d.ts
CHANGED