@reykjavik/hanna-react 0.10.53
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/CHANGELOG.md +795 -0
- package/README.md +69 -0
- package/lib/AccordionList.cjs +91 -0
- package/lib/AccordionList.mjs +69 -0
- package/lib/ActionCards.cjs +57 -0
- package/lib/ActionCards.mjs +35 -0
- package/lib/Alert.cjs +159 -0
- package/lib/Alert.mjs +139 -0
- package/lib/ArticleCarousel/_ArticleCarouselCard.cjs +75 -0
- package/lib/ArticleCarousel/_ArticleCarouselCard.mjs +51 -0
- package/lib/ArticleCarousel.cjs +43 -0
- package/lib/ArticleCarousel.mjs +21 -0
- package/lib/ArticleMeta.cjs +46 -0
- package/lib/ArticleMeta.mjs +22 -0
- package/lib/Attention.cjs +33 -0
- package/lib/Attention.mjs +9 -0
- package/lib/BasicTable.cjs +72 -0
- package/lib/BasicTable.mjs +50 -0
- package/lib/Bling.cjs +76 -0
- package/lib/Bling.mjs +52 -0
- package/lib/BlockBreak.cjs +32 -0
- package/lib/BlockBreak.mjs +8 -0
- package/lib/BlockQuote.cjs +47 -0
- package/lib/BlockQuote.mjs +25 -0
- package/lib/BreadCrumbs.cjs +67 -0
- package/lib/BreadCrumbs.mjs +43 -0
- package/lib/ButtonBack.cjs +47 -0
- package/lib/ButtonBack.mjs +25 -0
- package/lib/ButtonBar.cjs +45 -0
- package/lib/ButtonBar.mjs +18 -0
- package/lib/ButtonPrimary.cjs +47 -0
- package/lib/ButtonPrimary.mjs +25 -0
- package/lib/ButtonSecondary.cjs +47 -0
- package/lib/ButtonSecondary.mjs +25 -0
- package/lib/ButtonTertiary.cjs +64 -0
- package/lib/ButtonTertiary.mjs +42 -0
- package/lib/Carousel.cjs +52 -0
- package/lib/Carousel.mjs +30 -0
- package/lib/CarouselStepper.cjs +51 -0
- package/lib/CarouselStepper.mjs +29 -0
- package/lib/CenterColumn.cjs +40 -0
- package/lib/CenterColumn.mjs +16 -0
- package/lib/Checkbox.cjs +52 -0
- package/lib/Checkbox.mjs +30 -0
- package/lib/CheckboxButtonsGroup.cjs +65 -0
- package/lib/CheckboxButtonsGroup.mjs +43 -0
- package/lib/CheckboxGroup.cjs +55 -0
- package/lib/CheckboxGroup.mjs +33 -0
- package/lib/CityBlock.cjs +49 -0
- package/lib/CityBlock.mjs +25 -0
- package/lib/ContactBubble.cjs +200 -0
- package/lib/ContactBubble.mjs +173 -0
- package/lib/ContentArticle.cjs +63 -0
- package/lib/ContentArticle.mjs +41 -0
- package/lib/ContentImage.cjs +58 -0
- package/lib/ContentImage.mjs +36 -0
- package/lib/Datepicker.cjs +164 -0
- package/lib/Datepicker.mjs +142 -0
- package/lib/ExtraLinks.cjs +96 -0
- package/lib/ExtraLinks.mjs +74 -0
- package/lib/FeatureList.cjs +53 -0
- package/lib/FeatureList.mjs +29 -0
- package/lib/FieldGroup.cjs +40 -0
- package/lib/FieldGroup.mjs +16 -0
- package/lib/FileInput.cjs +256 -0
- package/lib/FileInput.mjs +234 -0
- package/lib/Foonote.cjs +30 -0
- package/lib/Foonote.mjs +6 -0
- package/lib/FooterBadges.cjs +49 -0
- package/lib/FooterBadges.mjs +25 -0
- package/lib/FooterInfo.cjs +47 -0
- package/lib/FooterInfo.mjs +23 -0
- package/lib/Footnote.cjs +32 -0
- package/lib/Footnote.mjs +8 -0
- package/lib/Form.cjs +56 -0
- package/lib/Form.mjs +34 -0
- package/lib/FormField.cjs +153 -0
- package/lib/FormField.mjs +131 -0
- package/lib/Gallery/_GalleryItem.cjs +83 -0
- package/lib/Gallery/_GalleryItem.mjs +61 -0
- package/lib/Gallery/_GalleryModal.cjs +104 -0
- package/lib/Gallery/_GalleryModal.mjs +82 -0
- package/lib/Gallery/_GalleryModalContext.cjs +30 -0
- package/lib/Gallery/_GalleryModalContext.mjs +6 -0
- package/lib/Gallery/_GalleryModalItem.cjs +59 -0
- package/lib/Gallery/_GalleryModalItem.mjs +36 -0
- package/lib/Gallery.cjs +79 -0
- package/lib/Gallery.mjs +57 -0
- package/lib/GridBlocks.cjs +81 -0
- package/lib/GridBlocks.mjs +59 -0
- package/lib/Heading.cjs +45 -0
- package/lib/Heading.mjs +21 -0
- package/lib/HeroBlock.cjs +74 -0
- package/lib/HeroBlock.mjs +52 -0
- package/lib/IframeBlock.cjs +48 -0
- package/lib/IframeBlock.mjs +24 -0
- package/lib/Illustration.cjs +51 -0
- package/lib/Illustration.mjs +31 -0
- package/lib/ImageCards.cjs +72 -0
- package/lib/ImageCards.mjs +52 -0
- package/lib/InfoBlock.cjs +51 -0
- package/lib/InfoBlock.mjs +27 -0
- package/lib/InfoHero.cjs +150 -0
- package/lib/InfoHero.mjs +128 -0
- package/lib/IslandBlock.cjs +63 -0
- package/lib/IslandBlock.mjs +41 -0
- package/lib/IslandPageBlock.cjs +49 -0
- package/lib/IslandPageBlock.mjs +25 -0
- package/lib/LabeledTextBlock.cjs +60 -0
- package/lib/LabeledTextBlock.mjs +38 -0
- package/lib/Layout.cjs +113 -0
- package/lib/Layout.mjs +87 -0
- package/lib/MainMenu/_Auxiliary.cjs +54 -0
- package/lib/MainMenu/_Auxiliary.mjs +28 -0
- package/lib/MainMenu/_PrimaryPanel.cjs +74 -0
- package/lib/MainMenu/_PrimaryPanel.mjs +48 -0
- package/lib/MainMenu.cjs +209 -0
- package/lib/MainMenu.mjs +187 -0
- package/lib/MiniMetrics.cjs +56 -0
- package/lib/MiniMetrics.mjs +34 -0
- package/lib/Modal.cjs +70 -0
- package/lib/Modal.mjs +48 -0
- package/lib/NameCard.cjs +115 -0
- package/lib/NameCard.mjs +91 -0
- package/lib/NameCards.cjs +52 -0
- package/lib/NameCards.mjs +30 -0
- package/lib/NewsHero.cjs +136 -0
- package/lib/NewsHero.mjs +114 -0
- package/lib/PageFilter.cjs +48 -0
- package/lib/PageFilter.mjs +24 -0
- package/lib/PageHeading.cjs +42 -0
- package/lib/PageHeading.mjs +18 -0
- package/lib/ProcessOverview.cjs +52 -0
- package/lib/ProcessOverview.mjs +28 -0
- package/lib/PullQuote.cjs +47 -0
- package/lib/PullQuote.mjs +25 -0
- package/lib/RadioButtonsGroup.cjs +64 -0
- package/lib/RadioButtonsGroup.mjs +42 -0
- package/lib/RadioGroup.cjs +58 -0
- package/lib/RadioGroup.mjs +36 -0
- package/lib/RelatedLinks.cjs +61 -0
- package/lib/RelatedLinks.mjs +37 -0
- package/lib/RowBlock.cjs +39 -0
- package/lib/RowBlock.mjs +15 -0
- package/lib/RowBlockColumn.cjs +40 -0
- package/lib/RowBlockColumn.mjs +16 -0
- package/lib/SearchInput.cjs +136 -0
- package/lib/SearchInput.mjs +114 -0
- package/lib/SearchResults/_SearchResultsItem.cjs +54 -0
- package/lib/SearchResults/_SearchResultsItem.mjs +30 -0
- package/lib/SearchResults.cjs +172 -0
- package/lib/SearchResults.mjs +150 -0
- package/lib/SeenEffect.cjs +66 -0
- package/lib/SeenEffect.mjs +44 -0
- package/lib/Selectbox.cjs +144 -0
- package/lib/Selectbox.mjs +122 -0
- package/lib/ShareButtons.cjs +101 -0
- package/lib/ShareButtons.mjs +83 -0
- package/lib/Sharpie.cjs +51 -0
- package/lib/Sharpie.mjs +27 -0
- package/lib/SiteSearchAutocomplete.cjs +150 -0
- package/lib/SiteSearchAutocomplete.mjs +126 -0
- package/lib/SiteSearchCurtain.cjs +78 -0
- package/lib/SiteSearchCurtain.mjs +56 -0
- package/lib/SiteSearchInput.cjs +119 -0
- package/lib/SiteSearchInput.mjs +97 -0
- package/lib/Skeleton.cjs +63 -0
- package/lib/Skeleton.mjs +39 -0
- package/lib/SubHeading.cjs +43 -0
- package/lib/SubHeading.mjs +19 -0
- package/lib/Tabs.cjs +166 -0
- package/lib/Tabs.mjs +144 -0
- package/lib/TagPill.cjs +113 -0
- package/lib/TagPill.mjs +91 -0
- package/lib/TextBlock.cjs +45 -0
- package/lib/TextBlock.mjs +21 -0
- package/lib/TextButton.cjs +55 -0
- package/lib/TextButton.mjs +33 -0
- package/lib/TextInput.cjs +136 -0
- package/lib/TextInput.mjs +114 -0
- package/lib/VSpacer.cjs +70 -0
- package/lib/VSpacer.mjs +46 -0
- package/lib/VerticalTabsTOC.cjs +123 -0
- package/lib/VerticalTabsTOC.mjs +101 -0
- package/lib/WizardLayout.cjs +79 -0
- package/lib/WizardLayout.mjs +55 -0
- package/lib/WizardLayoutClose.cjs +47 -0
- package/lib/WizardLayoutClose.mjs +25 -0
- package/lib/WizardStepper.cjs +55 -0
- package/lib/WizardStepper.mjs +31 -0
- package/lib/_abstract/Button.cjs +114 -0
- package/lib/_abstract/Button.mjs +92 -0
- package/lib/_abstract/CardList.cjs +100 -0
- package/lib/_abstract/CardList.mjs +76 -0
- package/lib/_abstract/Image.cjs +75 -0
- package/lib/_abstract/Image.mjs +51 -0
- package/lib/_abstract/Link.cjs +37 -0
- package/lib/_abstract/Link.mjs +10 -0
- package/lib/_abstract/TogglerGroup.cjs +92 -0
- package/lib/_abstract/TogglerGroup.mjs +70 -0
- package/lib/_abstract/TogglerGroupField.cjs +121 -0
- package/lib/_abstract/TogglerGroupField.mjs +99 -0
- package/lib/_abstract/TogglerInput.cjs +105 -0
- package/lib/_abstract/TogglerInput.mjs +83 -0
- package/lib/_abstract/_AbstractCarousel.cjs +170 -0
- package/lib/_abstract/_AbstractCarousel.mjs +152 -0
- package/lib/_abstract/_Blings.cjs +47 -0
- package/lib/_abstract/_Blings.mjs +23 -0
- package/lib/_abstract/_Block.cjs +73 -0
- package/lib/_abstract/_Block.mjs +51 -0
- package/lib/_abstract/_Quote.cjs +43 -0
- package/lib/_abstract/_Quote.mjs +17 -0
- package/lib/_abstract/breakOnNL.cjs +30 -0
- package/lib/_abstract/breakOnNL.mjs +6 -0
- package/lib/assets.cjs +77 -0
- package/lib/assets.mjs +53 -0
- package/lib/constants.cjs +49 -0
- package/lib/constants.mjs +24 -0
- package/lib/focus-visible.cjs +1 -0
- package/lib/focus-visible.mjs +1 -0
- package/lib/utils/config.cjs +27 -0
- package/lib/utils/config.mjs +4 -0
- package/lib/utils/detectEdgeScroll.cjs +95 -0
- package/lib/utils/detectEdgeScroll.mjs +71 -0
- package/lib/utils/env.cjs +31 -0
- package/lib/utils/env.mjs +5 -0
- package/lib/utils/seenEffect.cjs +93 -0
- package/lib/utils/seenEffect.mjs +65 -0
- package/lib/utils/useFormatMonitor.cjs +29 -0
- package/lib/utils/useFormatMonitor.mjs +6 -0
- package/lib/utils/useGetSVGtext.cjs +44 -0
- package/lib/utils/useGetSVGtext.mjs +21 -0
- package/lib/utils/useMenuToggling.cjs +83 -0
- package/lib/utils/useMenuToggling.mjs +60 -0
- package/lib/utils/useScrollbarWidthCSSVar.cjs +32 -0
- package/lib/utils/useScrollbarWidthCSSVar.mjs +6 -0
- package/lib/utils.cjs +18 -0
- package/lib/utils.mjs +2 -0
- package/package.json +491 -0
- package/types/AccordionList.d.ts +17 -0
- package/types/ActionCards.d.ts +5 -0
- package/types/Alert.d.ts +49 -0
- package/types/ArticleCarousel/_ArticleCarouselCard.d.ts +27 -0
- package/types/ArticleCarousel.d.ts +12 -0
- package/types/ArticleMeta.d.ts +9 -0
- package/types/Attention.d.ts +7 -0
- package/types/BasicTable.d.ts +12 -0
- package/types/Bling.d.ts +81 -0
- package/types/BlockBreak.d.ts +2 -0
- package/types/BlockQuote.d.ts +4 -0
- package/types/BreadCrumbs.d.ts +11 -0
- package/types/ButtonBack.d.ts +7 -0
- package/types/ButtonBar.d.ts +16 -0
- package/types/ButtonPrimary.d.ts +7 -0
- package/types/ButtonSecondary.d.ts +7 -0
- package/types/ButtonTertiary.d.ts +12 -0
- package/types/Carousel.d.ts +4 -0
- package/types/CarouselStepper.d.ts +4 -0
- package/types/CenterColumn.d.ts +7 -0
- package/types/Checkbox.d.ts +4 -0
- package/types/CheckboxButtonsGroup.d.ts +11 -0
- package/types/CheckboxGroup.d.ts +9 -0
- package/types/CityBlock.d.ts +23 -0
- package/types/ContactBubble.d.ts +58 -0
- package/types/ContentArticle.d.ts +15 -0
- package/types/ContentImage.d.ts +8 -0
- package/types/Datepicker.d.ts +39 -0
- package/types/ExtraLinks.d.ts +18 -0
- package/types/FeatureList.d.ts +12 -0
- package/types/FieldGroup.d.ts +9 -0
- package/types/FileInput.d.ts +17 -0
- package/types/Foonote.d.ts +12 -0
- package/types/FooterBadges.d.ts +9 -0
- package/types/FooterInfo.d.ts +18 -0
- package/types/Footnote.d.ts +6 -0
- package/types/Form.d.ts +7 -0
- package/types/FormField.d.ts +65 -0
- package/types/Gallery/_GalleryItem.d.ts +8 -0
- package/types/Gallery/_GalleryModal.d.ts +6 -0
- package/types/Gallery/_GalleryModalContext.d.ts +9 -0
- package/types/Gallery/_GalleryModalItem.d.ts +3 -0
- package/types/Gallery.d.ts +17 -0
- package/types/GridBlocks.d.ts +26 -0
- package/types/Heading.d.ts +16 -0
- package/types/HeroBlock.d.ts +19 -0
- package/types/IframeBlock.d.ts +23 -0
- package/types/Illustration.d.ts +13 -0
- package/types/ImageCards.d.ts +8 -0
- package/types/InfoBlock.d.ts +17 -0
- package/types/InfoHero.d.ts +17 -0
- package/types/IslandBlock.d.ts +25 -0
- package/types/IslandPageBlock.d.ts +24 -0
- package/types/LabeledTextBlock.d.ts +11 -0
- package/types/Layout.d.ts +33 -0
- package/types/MainMenu/_Auxiliary.d.ts +6 -0
- package/types/MainMenu/_PrimaryPanel.d.ts +13 -0
- package/types/MainMenu.d.ts +48 -0
- package/types/MiniMetrics.d.ts +8 -0
- package/types/Modal.d.ts +10 -0
- package/types/NameCard.d.ts +64 -0
- package/types/NameCards.d.ts +6 -0
- package/types/NewsHero.d.ts +14 -0
- package/types/PageFilter.d.ts +17 -0
- package/types/PageHeading.d.ts +10 -0
- package/types/ProcessOverview.d.ts +13 -0
- package/types/PullQuote.d.ts +4 -0
- package/types/RadioButtonsGroup.d.ts +11 -0
- package/types/RadioGroup.d.ts +13 -0
- package/types/RelatedLinks.d.ts +20 -0
- package/types/RowBlock.d.ts +12 -0
- package/types/RowBlockColumn.d.ts +8 -0
- package/types/SearchInput.d.ts +18 -0
- package/types/SearchResults/_SearchResultsItem.d.ts +18 -0
- package/types/SearchResults.d.ts +33 -0
- package/types/SeenEffect.d.ts +4 -0
- package/types/Selectbox.d.ts +8 -0
- package/types/ShareButtons.d.ts +9 -0
- package/types/Sharpie.d.ts +23 -0
- package/types/SiteSearchAutocomplete.d.ts +40 -0
- package/types/SiteSearchCurtain.d.ts +6 -0
- package/types/SiteSearchInput.d.ts +24 -0
- package/types/Skeleton.d.ts +25 -0
- package/types/SubHeading.d.ts +10 -0
- package/types/Tabs.d.ts +35 -0
- package/types/TagPill.d.ts +27 -0
- package/types/TextBlock.d.ts +15 -0
- package/types/TextButton.d.ts +9 -0
- package/types/TextInput.d.ts +16 -0
- package/types/VSpacer.d.ts +24 -0
- package/types/VerticalTabsTOC.d.ts +14 -0
- package/types/WizardLayout.d.ts +15 -0
- package/types/WizardLayoutClose.d.ts +3 -0
- package/types/WizardStepper.d.ts +36 -0
- package/types/_abstract/Button.d.ts +40 -0
- package/types/_abstract/CardList.d.ts +29 -0
- package/types/_abstract/Image.d.ts +32 -0
- package/types/_abstract/Link.d.ts +27 -0
- package/types/_abstract/TogglerGroup.d.ts +31 -0
- package/types/_abstract/TogglerGroupField.d.ts +17 -0
- package/types/_abstract/TogglerInput.d.ts +22 -0
- package/types/_abstract/_AbstractCarousel.d.ts +25 -0
- package/types/_abstract/_Blings.d.ts +11 -0
- package/types/_abstract/_Block.d.ts +22 -0
- package/types/_abstract/_Quote.d.ts +9 -0
- package/types/_abstract/breakOnNL.d.ts +2 -0
- package/types/assets.d.ts +42 -0
- package/types/constants.d.ts +39 -0
- package/types/focus-visible.d.ts +1 -0
- package/types/utils/config.d.ts +2 -0
- package/types/utils/detectEdgeScroll.d.ts +52 -0
- package/types/utils/env.d.ts +1 -0
- package/types/utils/seenEffect.d.ts +28 -0
- package/types/utils/useFormatMonitor.d.ts +38 -0
- package/types/utils/useGetSVGtext.d.ts +6 -0
- package/types/utils/useMenuToggling.d.ts +8 -0
- package/types/utils/useScrollbarWidthCSSVar.d.ts +1 -0
- package/types/utils.d.ts +2 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Autosuggest, { RenderSuggestion } from 'react-autosuggest';
|
|
3
|
+
import { BemProps } from '@hugsmidjan/react/types';
|
|
4
|
+
import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
|
|
5
|
+
export declare type SiteSearchACI18n = {
|
|
6
|
+
lang?: string;
|
|
7
|
+
/** Label for the autocomplete's combobox container div */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Label for the text input */
|
|
10
|
+
inputLabel: string;
|
|
11
|
+
/** Placeholder text for the text input */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** Label for the suggestions item list container */
|
|
14
|
+
suggestionsLabel: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const defaultSiteSearchACTexts: DefaultTexts<SiteSearchACI18n>;
|
|
17
|
+
export declare type SiteSearchAutocompleteProps<T> = {
|
|
18
|
+
suggestions: Array<T>;
|
|
19
|
+
renderSuggestion: RenderSuggestion<T>;
|
|
20
|
+
setSuggestions: (suggestions: Array<T>) => void;
|
|
21
|
+
getSuggestionValue: (suggestion: T) => string;
|
|
22
|
+
onSuggestionsFetchRequested: (request: Autosuggest.SuggestionsFetchRequestedParams) => void;
|
|
23
|
+
onSuggestionSelected?: (event: React.FormEvent<HTMLElement>, data: Autosuggest.SuggestionSelectedEventData<T>) => void;
|
|
24
|
+
onSuggestionHighlighted?: (params: {
|
|
25
|
+
suggestion: T;
|
|
26
|
+
}) => void;
|
|
27
|
+
/** Triggered when user hits ENTER key with the focus inside the input field */
|
|
28
|
+
onSubmit?: (value: string) => void;
|
|
29
|
+
/** Custom action to perform when the user clicks the search button
|
|
30
|
+
*
|
|
31
|
+
* Defaults to `onSubmit`
|
|
32
|
+
*/
|
|
33
|
+
onButtonClick?: (value: string) => void;
|
|
34
|
+
lang?: string;
|
|
35
|
+
texts?: SiteSearchACI18n;
|
|
36
|
+
/** @deprecated Use `text` prop instead (will be removed in v0.11) */
|
|
37
|
+
label?: string;
|
|
38
|
+
} & BemProps;
|
|
39
|
+
declare const SiteSearchAutocomplete: <T>(props: SiteSearchAutocompleteProps<T>) => JSX.Element;
|
|
40
|
+
export default SiteSearchAutocomplete;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
3
|
+
import { FormFieldWrappingProps } from './FormField';
|
|
4
|
+
declare type InputElmProps = Omit<JSX.IntrinsicElements['input'], 'className' | 'type' | 'disabled' | 'readOnly' | 'required' | 'onSubmit'>;
|
|
5
|
+
declare type WrappingProps = Pick<FormFieldWrappingProps, 'id' | 'label'>;
|
|
6
|
+
export declare type SiteSearchInputProps = {
|
|
7
|
+
/** Triggered when user hits ENTER key with the focus inside the input field
|
|
8
|
+
*
|
|
9
|
+
* Return `true` to **allow** the browser's default submit hehavior
|
|
10
|
+
*/
|
|
11
|
+
onSubmit?: () => boolean | void;
|
|
12
|
+
/** Custom action to perform when the user clicks the search button
|
|
13
|
+
*
|
|
14
|
+
* Return `true` to **allow** the browser's default submit hehavior
|
|
15
|
+
*
|
|
16
|
+
* Defaults to `onSearch`
|
|
17
|
+
*/
|
|
18
|
+
onButtonClick?: () => boolean | void;
|
|
19
|
+
buttonText?: string;
|
|
20
|
+
children?: undefined;
|
|
21
|
+
ssr?: SSRSupport;
|
|
22
|
+
} & WrappingProps & InputElmProps;
|
|
23
|
+
declare const SiteSearchInput: React.ForwardRefExoticComponent<Pick<SiteSearchInputProps, "dir" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "is" | "name" | "width" | "aria-controls" | "ssr" | "children" | "hidden" | "color" | "size" | "multiple" | "onMouseLeave" | "prefix" | "key" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "src" | "alt" | "accept" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "onButtonClick" | "buttonText"> & React.RefAttributes<HTMLInputElement>>;
|
|
24
|
+
export default SiteSearchInput;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export declare type SkeletonProps = {
|
|
3
|
+
text?: boolean;
|
|
4
|
+
height?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
5
|
+
items?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
6
|
+
gap?: 1 | 2 | 3 | 4 | 5;
|
|
7
|
+
};
|
|
8
|
+
declare const Skeleton: {
|
|
9
|
+
(props: SkeletonProps): JSX.Element;
|
|
10
|
+
/** Returns a single `<Skeleton height={X}/>` element of branded type `SkeletonBlock` */
|
|
11
|
+
block(height?: SkeletonProps['height']): SkeletonBlock;
|
|
12
|
+
/** Returns a single `<Skeleton text height={X}/>` element of branded type `SkeletonText` */
|
|
13
|
+
text(height?: SkeletonProps['height']): SkeletonText;
|
|
14
|
+
};
|
|
15
|
+
export default Skeleton;
|
|
16
|
+
declare const _SkeletonBlock__Brand: unique symbol;
|
|
17
|
+
/** The `<Skeleton height={X}/>` element returned by `Skeleton.block(X)` */
|
|
18
|
+
export declare type SkeletonBlock = ReactElement & {
|
|
19
|
+
[_SkeletonBlock__Brand]: true;
|
|
20
|
+
};
|
|
21
|
+
declare const _SkeletonText__Brand: unique symbol;
|
|
22
|
+
/** The `<Skeleton text height={X}/>` element returned by `Skeleton.text(X)` */
|
|
23
|
+
export declare type SkeletonText = ReactElement & {
|
|
24
|
+
[_SkeletonText__Brand]: true;
|
|
25
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SeenProp } from './utils/seenEffect';
|
|
3
|
+
import { ComponentLayoutProps } from './constants';
|
|
4
|
+
export declare type SubHeadingProps = {
|
|
5
|
+
Tag?: 'h2' | 'h3';
|
|
6
|
+
small?: boolean;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
} & ComponentLayoutProps & SeenProp;
|
|
9
|
+
declare const SubHeading: (props: SubHeadingProps) => JSX.Element;
|
|
10
|
+
export default SubHeading;
|
package/types/Tabs.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
2
|
+
import { SeenProp } from './utils/seenEffect';
|
|
3
|
+
export declare type TabItemProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
badge?: string | number;
|
|
6
|
+
longLabel?: string;
|
|
7
|
+
type?: 'button' | 'submit';
|
|
8
|
+
id?: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
'aria-controls'?: string;
|
|
11
|
+
onActivated?: () => void | false;
|
|
12
|
+
};
|
|
13
|
+
/** @deprecated Use `TabItemProps` instead (Will be removed in v0.11) */
|
|
14
|
+
export declare type TabProps = TabItemProps;
|
|
15
|
+
declare type BaseTabsProps<T extends TabItemProps = TabItemProps> = {
|
|
16
|
+
id?: string;
|
|
17
|
+
'aria-label'?: string;
|
|
18
|
+
'aria-labelledby'?: string;
|
|
19
|
+
tabs: Array<T>;
|
|
20
|
+
activeIdx?: number;
|
|
21
|
+
onSetActive?: (idx: number, tab: T) => void;
|
|
22
|
+
role?: 'tablist' | 'toc';
|
|
23
|
+
'aria-controls'?: string;
|
|
24
|
+
activateOnFocus?: boolean;
|
|
25
|
+
ssr?: SSRSupport;
|
|
26
|
+
};
|
|
27
|
+
export declare type TabsProps<T extends TabItemProps = TabItemProps> = BaseTabsProps<T> & {
|
|
28
|
+
vertical?: boolean;
|
|
29
|
+
/** Optional <Tabs/> block connected to the currently active tab */
|
|
30
|
+
subTabs?: BaseTabsProps;
|
|
31
|
+
} & SeenProp;
|
|
32
|
+
/** @deprecated Use `TabsProps` instead (Will be removed in v0.11) */
|
|
33
|
+
export declare type TablistProps<T extends TabItemProps = TabItemProps> = TabsProps<T>;
|
|
34
|
+
declare const Tabs: (props: TabsProps) => JSX.Element;
|
|
35
|
+
export default Tabs;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from './_abstract/Button';
|
|
3
|
+
declare const colors: {
|
|
4
|
+
readonly normal: "";
|
|
5
|
+
readonly green: "color--green";
|
|
6
|
+
readonly yellow: "color--yellow";
|
|
7
|
+
readonly orange: "color--orange";
|
|
8
|
+
readonly red: "color--red";
|
|
9
|
+
};
|
|
10
|
+
export declare type TagPillColor = keyof typeof colors;
|
|
11
|
+
export declare type TagPillProps = ButtonProps & {
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
large?: boolean;
|
|
14
|
+
color?: TagPillColor;
|
|
15
|
+
} & ({
|
|
16
|
+
removable?: false;
|
|
17
|
+
onRemove?: never;
|
|
18
|
+
removeLabel?: never;
|
|
19
|
+
removeLabelLong?: never;
|
|
20
|
+
} | {
|
|
21
|
+
removable: true;
|
|
22
|
+
onRemove?: () => void;
|
|
23
|
+
removeLabel?: string;
|
|
24
|
+
removeLabelLong?: string;
|
|
25
|
+
});
|
|
26
|
+
declare const TagPill: (props: TagPillProps) => JSX.Element;
|
|
27
|
+
export default TagPill;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SeenProp } from './utils/seenEffect';
|
|
3
|
+
import { ComponentLayoutProps } from './constants';
|
|
4
|
+
export declare type TextBlockProps = ComponentLayoutProps & {
|
|
5
|
+
/** Make H2 headings float to the left
|
|
6
|
+
*
|
|
7
|
+
* Overrides the `align` and `wide` prop and automatically sets `align` to `right`
|
|
8
|
+
*/
|
|
9
|
+
labelled?: boolean;
|
|
10
|
+
/** Sets a smaller text-size */
|
|
11
|
+
small?: boolean;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
} & SeenProp;
|
|
14
|
+
declare const TextBlock: (props: TextBlockProps) => JSX.Element;
|
|
15
|
+
export default TextBlock;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from './_abstract/Button';
|
|
3
|
+
export declare type TextButtonProps = ButtonProps & {
|
|
4
|
+
disabled?: never;
|
|
5
|
+
};
|
|
6
|
+
declare const TextButton: (props: TextButtonProps & {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
export default TextButton;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { FormFieldWrappingProps } from './FormField';
|
|
3
|
+
declare type InputElmProps = JSX.IntrinsicElements['input'];
|
|
4
|
+
declare type TextareaElmProps = JSX.IntrinsicElements['textarea'];
|
|
5
|
+
export declare type TextInputProps = {
|
|
6
|
+
small?: boolean;
|
|
7
|
+
children?: undefined;
|
|
8
|
+
} & FormFieldWrappingProps & (({
|
|
9
|
+
type?: 'text' | 'email' | 'tel' | 'number' | 'date' | 'url' | 'password' | 'search';
|
|
10
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
11
|
+
} & InputElmProps) | ({
|
|
12
|
+
type: 'textarea';
|
|
13
|
+
inputRef?: RefObject<HTMLTextAreaElement>;
|
|
14
|
+
} & TextareaElmProps));
|
|
15
|
+
declare const TextInput: (props: TextInputProps) => JSX.Element;
|
|
16
|
+
export default TextInput;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
declare const sizes: {
|
|
3
|
+
readonly none: "none";
|
|
4
|
+
readonly small: "small";
|
|
5
|
+
readonly default: "";
|
|
6
|
+
readonly medium: "";
|
|
7
|
+
readonly large: "large";
|
|
8
|
+
readonly xlarge: "xlarge";
|
|
9
|
+
};
|
|
10
|
+
declare type VSpacerSize = keyof typeof sizes;
|
|
11
|
+
declare type VSpacerSizePos = Exclude<VSpacerSize, 'none'>;
|
|
12
|
+
export declare type VSpacerProps = {
|
|
13
|
+
children?: never;
|
|
14
|
+
size?: VSpacerSizePos;
|
|
15
|
+
top?: never;
|
|
16
|
+
bottom?: never;
|
|
17
|
+
} | {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
size?: VSpacerSizePos;
|
|
20
|
+
top?: VSpacerSize;
|
|
21
|
+
bottom?: VSpacerSize;
|
|
22
|
+
};
|
|
23
|
+
declare const VSpacer: (props: VSpacerProps) => JSX.Element;
|
|
24
|
+
export default VSpacer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TabItemProps, TabsProps } from './Tabs';
|
|
2
|
+
export declare type VerticalTabsTOCItem = TabItemProps & {
|
|
3
|
+
items?: Array<VerticalTabsTOCSubItem>;
|
|
4
|
+
};
|
|
5
|
+
export declare type VerticalTabsTOCSubItem = TabItemProps & {
|
|
6
|
+
type?: never;
|
|
7
|
+
href: string;
|
|
8
|
+
};
|
|
9
|
+
export declare type VerticalTabsTOCProps = {
|
|
10
|
+
items: Array<VerticalTabsTOCItem>;
|
|
11
|
+
onItemSelect: (itemId: string) => void;
|
|
12
|
+
} & Pick<TabsProps, 'aria-label' | 'ssr' | 'activateOnFocus' | 'id' | 'startSeen'>;
|
|
13
|
+
declare const VerticalTabsTOC: (props: VerticalTabsTOCProps) => JSX.Element;
|
|
14
|
+
export default VerticalTabsTOC;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
3
|
+
import { HannaColorTheme } from '@reykjavik/hanna-css';
|
|
4
|
+
declare type WizardLayoutProps = {
|
|
5
|
+
wizardStepper?: ReactNode;
|
|
6
|
+
wizardFooter?: ReactNode;
|
|
7
|
+
colorTheme?: HannaColorTheme;
|
|
8
|
+
siteName?: string;
|
|
9
|
+
logoLink?: string;
|
|
10
|
+
globalAlerts?: ReactNode;
|
|
11
|
+
ssr?: SSRSupport;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
declare const WizardLayout: (props: WizardLayoutProps) => JSX.Element;
|
|
15
|
+
export default WizardLayout;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare type WizardStepperStep = {
|
|
2
|
+
label: string;
|
|
3
|
+
/**
|
|
4
|
+
* Should the step be clickable?
|
|
5
|
+
*
|
|
6
|
+
* * `true` = The items becomes clickable as allowed by the `activeStep`,
|
|
7
|
+
* `disableBacktrack` and `allowForwardSkip` props.
|
|
8
|
+
* * `false | undefined` = Never clickable, regardless of `activeStep`.
|
|
9
|
+
* * `"always"` = Always clickable regardless of `activeStep` or other props.
|
|
10
|
+
*/
|
|
11
|
+
clickable?: boolean | 'always';
|
|
12
|
+
/**
|
|
13
|
+
* Flags the item as having a non-default done state
|
|
14
|
+
*
|
|
15
|
+
* * `undefined` = automatically set "done" on items before `activeStep`
|
|
16
|
+
* * `true` = Always flag as "done", regardless of `activeStep`
|
|
17
|
+
* * `false` = Never flag as "done", regardless of `activeStep`
|
|
18
|
+
*/
|
|
19
|
+
done?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Flags the step as not part of the numbering scheme
|
|
22
|
+
*/
|
|
23
|
+
neutral?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare type WizardStepperProps = {
|
|
26
|
+
steps: ReadonlyArray<WizardStepperStep>;
|
|
27
|
+
/** Zero-based index of the active (current) step */
|
|
28
|
+
activeStep?: number;
|
|
29
|
+
/** By default, clickable "done" steps remain clickable */
|
|
30
|
+
disableBacktrack?: boolean;
|
|
31
|
+
/** By default, clickable steps after the active step are not immediately clickable */
|
|
32
|
+
allowForwardSkip?: boolean;
|
|
33
|
+
onClick: (clickedIndex: number) => void;
|
|
34
|
+
};
|
|
35
|
+
declare const WizardStepper: (props: WizardStepperProps) => JSX.Element;
|
|
36
|
+
export default WizardStepper;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BemProps, BemPropsModifier } from '@hugsmidjan/react/types';
|
|
3
|
+
declare type ButtonElmProps = {
|
|
4
|
+
href?: never;
|
|
5
|
+
} & BemPropsModifier & Omit<JSX.IntrinsicElements['button'], 'className' | 'style'>;
|
|
6
|
+
declare type AnchorElmProps = {
|
|
7
|
+
href: string;
|
|
8
|
+
type?: never;
|
|
9
|
+
name?: never;
|
|
10
|
+
value?: never;
|
|
11
|
+
} & BemPropsModifier & Omit<JSX.IntrinsicElements['a'], 'className' | 'style'>;
|
|
12
|
+
export declare type ButtonProps = {
|
|
13
|
+
/** Label takes preference over `children` */
|
|
14
|
+
label?: string | JSX.Element;
|
|
15
|
+
} & (ButtonElmProps | AnchorElmProps);
|
|
16
|
+
declare const sizes: {
|
|
17
|
+
readonly normal: "";
|
|
18
|
+
readonly small: "small";
|
|
19
|
+
readonly wide: "wide";
|
|
20
|
+
};
|
|
21
|
+
declare type ButtonSize = keyof typeof sizes;
|
|
22
|
+
declare const variants: {
|
|
23
|
+
readonly normal: "";
|
|
24
|
+
readonly destructive: "destructive";
|
|
25
|
+
};
|
|
26
|
+
declare type ButtonVariant = keyof typeof variants;
|
|
27
|
+
declare type NavigationFlag = 'none' | 'go-back' | 'go-forward';
|
|
28
|
+
declare type ButtonIcon = 'edit';
|
|
29
|
+
export declare type ButtonVariantProps = {
|
|
30
|
+
size?: ButtonSize;
|
|
31
|
+
variant?: ButtonVariant;
|
|
32
|
+
icon?: ButtonIcon | NavigationFlag;
|
|
33
|
+
/** @deprecated (Will be removed in v0.11) */
|
|
34
|
+
small?: boolean;
|
|
35
|
+
};
|
|
36
|
+
declare type _ButtonProps = ButtonProps & ButtonVariantProps & BemProps & {
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
};
|
|
39
|
+
declare const Button: (props: _ButtonProps) => JSX.Element;
|
|
40
|
+
export default Button;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { ImageProps } from './Image';
|
|
3
|
+
declare type BaseCardProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
href: string;
|
|
6
|
+
imgPlaceholder?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare type ImageCardProps = BaseCardProps & {
|
|
9
|
+
meta?: string;
|
|
10
|
+
image?: ImageProps;
|
|
11
|
+
};
|
|
12
|
+
export declare type TextCardProps = BaseCardProps & {
|
|
13
|
+
summary?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare type CardListProps<T> = {
|
|
16
|
+
cards: Array<T>;
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
summaryElement?: ReactElement;
|
|
19
|
+
titleTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'p';
|
|
20
|
+
imgPlaceholder?: boolean | string;
|
|
21
|
+
};
|
|
22
|
+
export declare type ImageCardListProps = CardListProps<ImageCardProps>;
|
|
23
|
+
export declare type TextCardListProps = CardListProps<TextCardProps>;
|
|
24
|
+
declare type _CardListProps = CardListProps<BaseCardProps> & {
|
|
25
|
+
bemPrefix: string;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
export declare const CardList: (props: _CardListProps) => JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare type Source = {
|
|
2
|
+
srcset: string;
|
|
3
|
+
media: string;
|
|
4
|
+
};
|
|
5
|
+
export declare type ImageProps = {
|
|
6
|
+
altText?: string;
|
|
7
|
+
} & ({
|
|
8
|
+
sources?: Array<Source>;
|
|
9
|
+
/** The default image source to (lazy) load */
|
|
10
|
+
src?: string;
|
|
11
|
+
/** Eagerly-loaded placeholder/thunbnail to use until a `sources` item has been picked. */
|
|
12
|
+
preloadSrc?: string;
|
|
13
|
+
inline?: false;
|
|
14
|
+
} | {
|
|
15
|
+
/** Should the image be fetched and inlined as <svg/> */
|
|
16
|
+
inline: true;
|
|
17
|
+
src: string;
|
|
18
|
+
sources?: undefined;
|
|
19
|
+
preloadSrc?: undefined;
|
|
20
|
+
});
|
|
21
|
+
declare type _ImageProps = {
|
|
22
|
+
/** container className */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Controls if the container is rendered when image is missing/undefined.
|
|
25
|
+
* (With a `--missing` className modifier added.)
|
|
26
|
+
*
|
|
27
|
+
* Accepts a function that defines a default content for the container.
|
|
28
|
+
*/
|
|
29
|
+
placeholder?: boolean | (() => JSX.Element);
|
|
30
|
+
};
|
|
31
|
+
declare const Image: (props: ImageProps & _ImageProps) => JSX.Element | null;
|
|
32
|
+
export default Image;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props object ready to be ..spread onto an anchor element
|
|
3
|
+
* */
|
|
4
|
+
export declare type LinkProps = JSX.IntrinsicElements['a'] & {
|
|
5
|
+
href: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type LinkRenderer = (props: LinkProps) => JSX.Element;
|
|
8
|
+
export declare let Link: LinkRenderer;
|
|
9
|
+
/**
|
|
10
|
+
* Allows you to set a callback function to wrapp <a href=""/> links with
|
|
11
|
+
* a custom routing component.
|
|
12
|
+
*
|
|
13
|
+
* Example use:
|
|
14
|
+
*
|
|
15
|
+
* ```js
|
|
16
|
+
* import { Link } from 'remix'; // or whatever :-)
|
|
17
|
+
*
|
|
18
|
+
* setLinkRenderer((linkProps) =>
|
|
19
|
+
* <Link to={linkProps.href}><a {...linkProps} /></Link>);
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* The Default linkrenderer defined as:
|
|
23
|
+
* ```js
|
|
24
|
+
* (linkProps) => React.createElement('a', linkProps);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const setLinkRenderer: (linkRenderer: LinkRenderer | undefined) => void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FormFieldInputProps } from '../FormField';
|
|
2
|
+
import { TogglerInputProps } from './TogglerInput';
|
|
3
|
+
export declare type TogglerGroupOption = {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string | JSX.Element;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare type TogglerGroupOptions = Array<TogglerGroupOption>;
|
|
10
|
+
declare type RestrictedInputProps = Omit<JSX.IntrinsicElements['input'], 'type' | 'value' | 'checked' | 'defaultChecked' | 'className' | 'id' | 'name' | 'children'>;
|
|
11
|
+
export declare type TogglerGroupProps = {
|
|
12
|
+
options: TogglerGroupOptions;
|
|
13
|
+
className?: string;
|
|
14
|
+
name: string;
|
|
15
|
+
children?: undefined;
|
|
16
|
+
disabled?: boolean | ReadonlyArray<number>;
|
|
17
|
+
inputProps?: RestrictedInputProps;
|
|
18
|
+
onSelected?: (payload: {
|
|
19
|
+
value: string;
|
|
20
|
+
checked: boolean;
|
|
21
|
+
option: TogglerGroupOption;
|
|
22
|
+
selectedValues: Array<string>;
|
|
23
|
+
}) => void;
|
|
24
|
+
} & Omit<FormFieldInputProps, 'disabled'>;
|
|
25
|
+
declare type _TogglerGroupProps = {
|
|
26
|
+
bem: string;
|
|
27
|
+
Toggler: (props: TogglerInputProps) => JSX.Element;
|
|
28
|
+
value?: ReadonlyArray<string>;
|
|
29
|
+
};
|
|
30
|
+
declare const TogglerGroup: (props: TogglerGroupProps & _TogglerGroupProps) => JSX.Element;
|
|
31
|
+
export default TogglerGroup;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { BemPropsModifier } from '@hugsmidjan/react/types';
|
|
3
|
+
import { FormFieldGroupWrappingProps } from '../FormField';
|
|
4
|
+
import { TogglerGroupOption, TogglerGroupOptions, TogglerGroupProps } from './TogglerGroup';
|
|
5
|
+
import { TogglerInputProps } from './TogglerInput';
|
|
6
|
+
export declare type TogglerGroupFieldProps = {
|
|
7
|
+
className?: string;
|
|
8
|
+
} & FormFieldGroupWrappingProps & TogglerGroupProps;
|
|
9
|
+
declare type _TogglerGroupFieldProps = {
|
|
10
|
+
Toggler: (props: TogglerInputProps) => ReactElement;
|
|
11
|
+
value?: string | ReadonlyArray<string>;
|
|
12
|
+
bem: string;
|
|
13
|
+
} & BemPropsModifier;
|
|
14
|
+
export declare type TogglerGroupFieldOption = TogglerGroupOption;
|
|
15
|
+
export declare type TogglerGroupFieldOptions = TogglerGroupOptions;
|
|
16
|
+
declare const TogglerGroupField: (props: TogglerGroupFieldProps & _TogglerGroupFieldProps) => JSX.Element;
|
|
17
|
+
export default TogglerGroupField;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BemPropsModifier } from '@hugsmidjan/react/types';
|
|
2
|
+
export declare type TogglerInputProps = {
|
|
3
|
+
label: string | JSX.Element;
|
|
4
|
+
children?: undefined;
|
|
5
|
+
Wrapper?: 'div' | 'li';
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
/** Hidden label prefix text to indicate that the field is required.
|
|
8
|
+
*
|
|
9
|
+
* If your field is required but should not say so in its label
|
|
10
|
+
* then set this prop to `false`
|
|
11
|
+
*
|
|
12
|
+
* Default: `"Þarf að fylla út"`
|
|
13
|
+
* */
|
|
14
|
+
reqText?: string | false;
|
|
15
|
+
errorMessage?: string | JSX.Element;
|
|
16
|
+
} & BemPropsModifier & Omit<JSX.IntrinsicElements['input'], 'type'>;
|
|
17
|
+
declare type _TogglerInputProps = {
|
|
18
|
+
bem: string;
|
|
19
|
+
type: 'radio' | 'checkbox';
|
|
20
|
+
};
|
|
21
|
+
declare const TogglerInput: (props: TogglerInputProps & _TogglerInputProps) => JSX.Element;
|
|
22
|
+
export default TogglerInput;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
3
|
+
import { BemProps } from '@hugsmidjan/react/types';
|
|
4
|
+
import { SeenProp } from '../utils/seenEffect';
|
|
5
|
+
export declare type CarouselProps<I extends Record<string, unknown> = {}, P extends Record<string, unknown> | undefined = {}> = {
|
|
6
|
+
className?: string;
|
|
7
|
+
ssr?: SSRSupport;
|
|
8
|
+
/** @deprecated Ingored because never used (Will be removed in v0.11) */
|
|
9
|
+
scrollRight?: boolean;
|
|
10
|
+
} & ({
|
|
11
|
+
children?: never;
|
|
12
|
+
items: Array<I>;
|
|
13
|
+
Component: (props: P extends undefined ? I : I & P) => ReactElement | null;
|
|
14
|
+
ComponentProps?: P;
|
|
15
|
+
} | {
|
|
16
|
+
children: Array<ReactElement>;
|
|
17
|
+
items?: never;
|
|
18
|
+
Component?: never;
|
|
19
|
+
ComponentProps?: never;
|
|
20
|
+
}) & SeenProp;
|
|
21
|
+
declare type AbstractCarouselProps<I extends Record<string, unknown> = {}, P extends Record<string, unknown> | undefined = {}> = CarouselProps<I, P> & BemProps & {
|
|
22
|
+
title?: string;
|
|
23
|
+
};
|
|
24
|
+
declare const AbstractCarousel: <I extends Record<string, unknown> = {}, P extends Record<string, unknown> | undefined = {}>(props: AbstractCarouselProps<I, P>) => JSX.Element | null;
|
|
25
|
+
export default AbstractCarousel;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BlingType } from '@reykjavik/hanna-utils/assets';
|
|
2
|
+
import { BlingProps } from '../Bling';
|
|
3
|
+
export declare type BlingComboProps = Array<Omit<BlingProps, 'type' | 'blingUrl'> & {
|
|
4
|
+
type: BlingType;
|
|
5
|
+
}>;
|
|
6
|
+
declare type BlingsProps = {
|
|
7
|
+
blings: BlingComboProps;
|
|
8
|
+
mirror?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const Blings: (props: BlingsProps) => JSX.Element;
|
|
11
|
+
export default Blings;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BemPropsModifier } from '@hugsmidjan/react/types';
|
|
2
|
+
import { SeenProp } from '../utils/seenEffect';
|
|
3
|
+
import { ButtonProps } from './Button';
|
|
4
|
+
import { ImageProps } from './Image';
|
|
5
|
+
export declare type BlockItem = {
|
|
6
|
+
title: string;
|
|
7
|
+
summary?: string | JSX.Element;
|
|
8
|
+
buttons?: Array<ButtonProps>;
|
|
9
|
+
};
|
|
10
|
+
export declare type ContentImageBlock = {
|
|
11
|
+
content: BlockItem;
|
|
12
|
+
image: ImageProps;
|
|
13
|
+
} & SeenProp;
|
|
14
|
+
export declare type ContentBlock = {
|
|
15
|
+
content: Array<BlockItem>;
|
|
16
|
+
image?: undefined;
|
|
17
|
+
} & SeenProp;
|
|
18
|
+
export declare type BlockProps = BemPropsModifier & (ContentBlock | ContentImageBlock);
|
|
19
|
+
declare const Block: (props: BlockProps & {
|
|
20
|
+
bem: string;
|
|
21
|
+
}) => JSX.Element;
|
|
22
|
+
export default Block;
|