@reykjavik/hanna-react 0.10.83 → 0.10.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AccordionList.d.ts +2 -2
- package/AccordionList.js +5 -5
- package/ActionCards.d.ts +2 -2
- package/ActionCards.js +4 -4
- package/Alert.d.ts +1 -1
- package/Alert.js +6 -6
- package/ArticleCards.d.ts +1 -1
- package/ArticleCards.js +2 -2
- package/ArticleCarousel/_ArticleCarouselCard.d.ts +2 -2
- package/ArticleCarousel/_ArticleCarouselCard.js +7 -7
- package/ArticleCarousel.d.ts +3 -3
- package/ArticleCarousel.js +3 -3
- package/ArticleMeta.js +2 -2
- package/BasicTable.d.ts +1 -1
- package/BasicTable.js +2 -2
- package/BgBox.d.ts +1 -1
- package/BgBox.js +3 -3
- package/Bling.js +2 -2
- package/BlockQuote.d.ts +1 -1
- package/BlockQuote.js +2 -2
- package/BreadCrumbs.js +2 -2
- package/ButtonBack.d.ts +1 -1
- package/ButtonBack.js +2 -2
- package/ButtonPrimary.d.ts +1 -1
- package/ButtonPrimary.js +2 -2
- package/ButtonSecondary.d.ts +1 -1
- package/ButtonSecondary.js +2 -2
- package/ButtonTertiary.d.ts +1 -1
- package/ButtonTertiary.js +2 -2
- package/CHANGELOG.md +13 -0
- package/Carousel.d.ts +2 -2
- package/Carousel.js +2 -2
- package/CenterColumn.d.ts +1 -1
- package/CenterColumn.js +2 -2
- package/Checkbox.d.ts +1 -1
- package/Checkbox.js +2 -2
- package/CheckboxButton.d.ts +1 -1
- package/CheckboxButton.js +2 -2
- package/CheckboxButtonsGroup.d.ts +1 -1
- package/CheckboxButtonsGroup.js +3 -3
- package/CheckboxGroup.d.ts +1 -1
- package/CheckboxGroup.js +3 -3
- package/CityBlock.d.ts +4 -4
- package/CityBlock.js +4 -4
- package/ContactBubble.d.ts +1 -1
- package/ContactBubble.js +6 -6
- package/ContentArticle.d.ts +4 -4
- package/ContentArticle.js +14 -14
- package/ContentImage.d.ts +1 -1
- package/ContentImage.js +2 -2
- package/Datepicker.d.ts +1 -1
- package/Datepicker.js +2 -2
- package/ExtraLinks.d.ts +2 -2
- package/ExtraLinks.js +6 -6
- package/FeatureList.d.ts +1 -1
- package/FeatureList.js +4 -4
- package/FileInput.d.ts +2 -2
- package/FileInput.js +4 -4
- package/Foonote.d.ts +1 -1
- package/Foonote.js +2 -2
- package/FooterBadges.js +2 -2
- package/Form.d.ts +1 -1
- package/FormField.d.ts +1 -1
- package/FormField.js +4 -4
- package/Gallery/_GalleryItem.d.ts +1 -1
- package/Gallery/_GalleryItem.js +7 -7
- package/Gallery/_GalleryModal.d.ts +1 -1
- package/Gallery/_GalleryModal.js +4 -4
- package/Gallery/_GalleryModalContext.d.ts +2 -2
- package/Gallery/_GalleryModalItem.d.ts +1 -1
- package/Gallery/_GalleryModalItem.js +2 -2
- package/Gallery.d.ts +4 -4
- package/Gallery.js +7 -7
- package/GridBlocks.d.ts +3 -3
- package/GridBlocks.js +8 -8
- package/Heading.d.ts +1 -1
- package/HeroBlock.d.ts +3 -3
- package/HeroBlock.js +8 -8
- package/Illustration.d.ts +1 -1
- package/Illustration.js +2 -2
- package/ImageCards.d.ts +2 -2
- package/ImageCards.js +4 -4
- package/InfoBlock.d.ts +1 -1
- package/InfoBlock.js +2 -2
- package/InfoHero.d.ts +3 -3
- package/InfoHero.js +10 -10
- package/IslandBlock.d.ts +4 -4
- package/IslandBlock.js +4 -4
- package/IslandPageBlock.d.ts +4 -4
- package/IslandPageBlock.js +4 -4
- package/LabeledTextBlock.d.ts +2 -2
- package/LabeledTextBlock.js +4 -4
- package/Layout.d.ts +1 -1
- package/Layout.js +13 -13
- package/MainMenu/_Auxiliary.d.ts +1 -1
- package/MainMenu/_Auxiliary.js +2 -2
- package/MainMenu/_PrimaryPanel.js +2 -2
- package/MainMenu.d.ts +3 -3
- package/MainMenu.js +15 -13
- package/MiniMetrics.d.ts +2 -2
- package/MiniMetrics.js +4 -4
- package/NameCard.js +4 -4
- package/NameCards.d.ts +1 -1
- package/NameCards.js +2 -2
- package/NewsHero.d.ts +2 -2
- package/NewsHero.js +7 -7
- package/PageFilter.d.ts +1 -1
- package/PageFilter.js +4 -4
- package/PageHeading.d.ts +1 -1
- package/PageHeading.js +2 -2
- package/Picture.d.ts +1 -1
- package/Picture.js +2 -2
- package/PullQuote.d.ts +1 -1
- package/PullQuote.js +2 -2
- package/RadioButtonsGroup.d.ts +1 -1
- package/RadioButtonsGroup.js +4 -4
- package/RadioGroup.d.ts +2 -2
- package/RadioGroup.js +4 -4
- package/RelatedLinks.js +2 -2
- package/RowBlock.d.ts +1 -1
- package/RowBlock.js +2 -2
- package/SearchInput.d.ts +1 -1
- package/SearchInput.js +2 -2
- package/SearchResults/_SearchResultsItem.js +4 -4
- package/SearchResults.d.ts +2 -2
- package/SearchResults.js +7 -7
- package/SeenEffect.d.ts +1 -1
- package/SeenEffect.js +3 -3
- package/Selectbox.d.ts +2 -2
- package/Selectbox.js +2 -2
- package/ShareButtons.d.ts +1 -1
- package/ShareButtons.js +2 -2
- package/SiteSearchAutocomplete.js +2 -2
- package/SiteSearchCurtain.js +2 -2
- package/SiteSearchInput.d.ts +2 -2
- package/SiteSearchInput.js +2 -2
- package/SubHeading.d.ts +2 -2
- package/SubHeading.js +2 -2
- package/Tabs.d.ts +2 -2
- package/Tabs.js +4 -4
- package/TagPill.d.ts +1 -1
- package/TagPill.js +3 -3
- package/TextBlock.d.ts +2 -2
- package/TextBlock.js +2 -2
- package/TextButton.d.ts +1 -1
- package/TextButton.js +2 -2
- package/TextInput.d.ts +1 -1
- package/TextInput.js +2 -2
- package/VerticalTabsTOC.d.ts +1 -1
- package/VerticalTabsTOC.js +2 -2
- package/WizardLayout.d.ts +1 -1
- package/WizardLayout.js +8 -8
- package/WizardLayoutClose.d.ts +1 -1
- package/WizardLayoutClose.js +2 -2
- package/_abstract/_AbstractCarousel.d.ts +2 -2
- package/_abstract/_AbstractCarousel.js +6 -6
- package/_abstract/_Blings.d.ts +1 -1
- package/_abstract/_Blings.js +2 -2
- package/_abstract/_Block.d.ts +3 -3
- package/_abstract/_Block.js +6 -6
- package/_abstract/_Button.js +2 -2
- package/_abstract/_CardList.d.ts +1 -1
- package/_abstract/_CardList.js +4 -4
- package/_abstract/_Image.js +2 -2
- package/_abstract/_Quote.js +2 -2
- package/_abstract/_TogglerGroup.d.ts +2 -2
- package/_abstract/_TogglerGroup.js +2 -2
- package/_abstract/_TogglerGroupField.d.ts +3 -3
- package/_abstract/_TogglerGroupField.js +4 -4
- package/assets.d.ts +2 -2
- package/esm/AccordionList.d.ts +25 -0
- package/esm/AccordionList.js +32 -0
- package/esm/ActionCards.d.ts +6 -0
- package/esm/ActionCards.js +9 -0
- package/esm/Alert.d.ts +48 -0
- package/esm/Alert.js +90 -0
- package/esm/ArticleCards.d.ts +8 -0
- package/esm/ArticleCards.js +4 -0
- package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +28 -0
- package/esm/ArticleCarousel/_ArticleCarouselCard.js +24 -0
- package/esm/ArticleCarousel.d.ts +12 -0
- package/esm/ArticleCarousel.js +8 -0
- package/esm/ArticleMeta.d.ts +10 -0
- package/esm/ArticleMeta.js +19 -0
- package/esm/Attention.d.ts +7 -0
- package/esm/Attention.js +4 -0
- package/esm/BasicTable.d.ts +14 -0
- package/esm/BasicTable.js +29 -0
- package/esm/BgBox.d.ts +8 -0
- package/esm/BgBox.js +9 -0
- package/esm/Bling.d.ts +81 -0
- package/esm/Bling.js +44 -0
- package/esm/BlockBreak.d.ts +2 -0
- package/esm/BlockBreak.js +6 -0
- package/esm/BlockQuote.d.ts +4 -0
- package/esm/BlockQuote.js +4 -0
- package/esm/BreadCrumbs.d.ts +11 -0
- package/esm/BreadCrumbs.js +28 -0
- package/esm/ButtonBack.d.ts +7 -0
- package/esm/ButtonBack.js +4 -0
- package/esm/ButtonBar.d.ts +17 -0
- package/esm/ButtonBar.js +15 -0
- package/esm/ButtonPrimary.d.ts +7 -0
- package/esm/ButtonPrimary.js +4 -0
- package/esm/ButtonSecondary.d.ts +7 -0
- package/esm/ButtonSecondary.js +4 -0
- package/esm/ButtonTertiary.d.ts +12 -0
- package/esm/ButtonTertiary.js +15 -0
- package/esm/Carousel.d.ts +4 -0
- package/esm/Carousel.js +4 -0
- package/esm/CarouselStepper.d.ts +4 -0
- package/esm/CarouselStepper.js +4 -0
- package/esm/CenterColumn.d.ts +7 -0
- package/esm/CenterColumn.js +7 -0
- package/esm/Checkbox.d.ts +4 -0
- package/esm/Checkbox.js +4 -0
- package/esm/CheckboxButton.d.ts +4 -0
- package/esm/CheckboxButton.js +4 -0
- package/esm/CheckboxButtonsGroup.d.ts +12 -0
- package/esm/CheckboxButtonsGroup.js +13 -0
- package/esm/CheckboxGroup.d.ts +10 -0
- package/esm/CheckboxGroup.js +7 -0
- package/esm/CityBlock.d.ts +21 -0
- package/esm/CityBlock.js +18 -0
- package/esm/ContactBubble.d.ts +58 -0
- package/esm/ContactBubble.js +152 -0
- package/esm/ContentArticle.d.ts +16 -0
- package/esm/ContentArticle.js +24 -0
- package/esm/ContentImage.d.ts +8 -0
- package/esm/ContentImage.js +18 -0
- package/esm/Datepicker.d.ts +40 -0
- package/esm/Datepicker.js +78 -0
- package/esm/ExtraLinks.d.ts +18 -0
- package/esm/ExtraLinks.js +24 -0
- package/esm/FeatureList.d.ts +12 -0
- package/esm/FeatureList.js +16 -0
- package/esm/FieldGroup.d.ts +10 -0
- package/esm/FieldGroup.js +9 -0
- package/esm/FileInput/_FileInput.utils.d.ts +36 -0
- package/esm/FileInput/_FileInput.utils.js +69 -0
- package/esm/FileInput/_FileInputFileList.d.ts +11 -0
- package/esm/FileInput/_FileInputFileList.js +19 -0
- package/esm/FileInput.d.ts +48 -0
- package/esm/FileInput.js +130 -0
- package/esm/Foonote.d.ts +12 -0
- package/esm/Foonote.js +7 -0
- package/esm/FooterBadges.d.ts +9 -0
- package/esm/FooterBadges.js +12 -0
- package/esm/FooterInfo.d.ts +20 -0
- package/esm/FooterInfo.js +12 -0
- package/esm/Footnote.d.ts +6 -0
- package/esm/Footnote.js +3 -0
- package/esm/Form.d.ts +7 -0
- package/esm/Form.js +10 -0
- package/esm/FormField.d.ts +65 -0
- package/esm/FormField.js +92 -0
- package/esm/Gallery/_GalleryItem.d.ts +7 -0
- package/esm/Gallery/_GalleryItem.js +19 -0
- package/esm/Gallery/_GalleryModal.d.ts +6 -0
- package/esm/Gallery/_GalleryModal.js +53 -0
- package/esm/Gallery/_GalleryModalContext.d.ts +9 -0
- package/esm/Gallery/_GalleryModalContext.js +2 -0
- package/esm/Gallery/_GalleryModalItem.d.ts +2 -0
- package/esm/Gallery/_GalleryModalItem.js +11 -0
- package/esm/Gallery.d.ts +17 -0
- package/esm/Gallery.js +27 -0
- package/esm/GridBlocks.d.ts +26 -0
- package/esm/GridBlocks.js +24 -0
- package/esm/Heading.d.ts +22 -0
- package/esm/Heading.js +19 -0
- package/esm/HeroBlock.d.ts +19 -0
- package/esm/HeroBlock.js +21 -0
- package/esm/IframeBlock.d.ts +28 -0
- package/esm/IframeBlock.js +26 -0
- package/esm/Illustration.d.ts +10 -0
- package/esm/Illustration.js +8 -0
- package/esm/ImageCards.d.ts +10 -0
- package/esm/ImageCards.js +12 -0
- package/esm/InfoBlock.d.ts +13 -0
- package/esm/InfoBlock.js +13 -0
- package/esm/InfoHero.d.ts +18 -0
- package/esm/InfoHero.js +83 -0
- package/esm/IslandBlock.d.ts +25 -0
- package/esm/IslandBlock.js +16 -0
- package/esm/IslandPageBlock.d.ts +24 -0
- package/esm/IslandPageBlock.js +16 -0
- package/esm/LabeledTextBlock.d.ts +11 -0
- package/esm/LabeledTextBlock.js +14 -0
- package/esm/Layout.d.ts +32 -0
- package/esm/Layout.js +56 -0
- package/esm/MainMenu/_Auxiliary.d.ts +6 -0
- package/esm/MainMenu/_Auxiliary.js +13 -0
- package/esm/MainMenu/_PrimaryPanel.d.ts +29 -0
- package/esm/MainMenu/_PrimaryPanel.js +22 -0
- package/esm/MainMenu.d.ts +62 -0
- package/esm/MainMenu.js +221 -0
- package/esm/MiniMetrics.d.ts +8 -0
- package/esm/MiniMetrics.js +12 -0
- package/esm/Modal.d.ts +8 -0
- package/esm/Modal.js +14 -0
- package/esm/NameCard.d.ts +64 -0
- package/esm/NameCard.js +82 -0
- package/esm/NameCards.d.ts +6 -0
- package/esm/NameCards.js +7 -0
- package/esm/NewsHero.d.ts +14 -0
- package/esm/NewsHero.js +86 -0
- package/esm/PageFilter.d.ts +16 -0
- package/esm/PageFilter.js +15 -0
- package/esm/PageHeading.d.ts +10 -0
- package/esm/PageHeading.js +12 -0
- package/esm/Picture.d.ts +7 -0
- package/esm/Picture.js +8 -0
- package/esm/ProcessOverview.d.ts +13 -0
- package/esm/ProcessOverview.js +17 -0
- package/esm/PullQuote.d.ts +4 -0
- package/esm/PullQuote.js +4 -0
- package/esm/RadioButtonsGroup.d.ts +12 -0
- package/esm/RadioButtonsGroup.js +14 -0
- package/esm/RadioGroup.d.ts +16 -0
- package/esm/RadioGroup.js +8 -0
- package/esm/RelatedLinks.d.ts +20 -0
- package/esm/RelatedLinks.js +26 -0
- package/esm/RowBlock.d.ts +12 -0
- package/esm/RowBlock.js +9 -0
- package/esm/RowBlockColumn.d.ts +8 -0
- package/esm/RowBlockColumn.js +11 -0
- package/esm/SearchInput.d.ts +18 -0
- package/esm/SearchInput.js +23 -0
- package/esm/SearchResults/_SearchResultsItem.d.ts +18 -0
- package/esm/SearchResults/_SearchResultsItem.js +14 -0
- package/esm/SearchResults.d.ts +37 -0
- package/esm/SearchResults.js +108 -0
- package/esm/SeenEffect.d.ts +4 -0
- package/esm/SeenEffect.js +9 -0
- package/esm/Selectbox.d.ts +11 -0
- package/esm/Selectbox.js +40 -0
- package/esm/ShareButtons.d.ts +9 -0
- package/esm/ShareButtons.js +56 -0
- package/esm/Sharpie.d.ts +23 -0
- package/esm/Sharpie.js +22 -0
- package/esm/SiteSearchAutocomplete.d.ts +40 -0
- package/esm/SiteSearchAutocomplete.js +48 -0
- package/esm/SiteSearchCurtain.d.ts +6 -0
- package/esm/SiteSearchCurtain.js +28 -0
- package/esm/SiteSearchInput.d.ts +24 -0
- package/esm/SiteSearchInput.js +30 -0
- package/esm/Skeleton.d.ts +25 -0
- package/esm/Skeleton.js +30 -0
- package/esm/SubHeading.d.ts +10 -0
- package/esm/SubHeading.js +13 -0
- package/esm/Tabs.d.ts +35 -0
- package/esm/Tabs.js +94 -0
- package/esm/TagPill.d.ts +25 -0
- package/esm/TagPill.js +34 -0
- package/esm/TextBlock.d.ts +15 -0
- package/esm/TextBlock.js +15 -0
- package/esm/TextButton.d.ts +9 -0
- package/esm/TextButton.js +9 -0
- package/esm/TextInput.d.ts +16 -0
- package/esm/TextInput.js +32 -0
- package/esm/Tooltip.d.ts +7 -0
- package/esm/Tooltip.js +58 -0
- package/esm/VSpacer.d.ts +22 -0
- package/esm/VSpacer.js +41 -0
- package/esm/VerticalTabsTOC.d.ts +14 -0
- package/esm/VerticalTabsTOC.js +68 -0
- package/esm/WizardLayout.d.ts +15 -0
- package/esm/WizardLayout.js +30 -0
- package/esm/WizardLayoutClose.d.ts +3 -0
- package/esm/WizardLayoutClose.js +4 -0
- package/esm/WizardStepper.d.ts +36 -0
- package/esm/WizardStepper.js +26 -0
- package/esm/_abstract/_AbstractCarousel.d.ts +29 -0
- package/esm/_abstract/_AbstractCarousel.js +108 -0
- package/esm/_abstract/_Blings.d.ts +11 -0
- package/esm/_abstract/_Blings.js +11 -0
- package/esm/_abstract/_Block.d.ts +21 -0
- package/esm/_abstract/_Block.js +23 -0
- package/esm/_abstract/_Button.d.ts +40 -0
- package/esm/_abstract/_Button.js +36 -0
- package/esm/_abstract/_CardList.d.ts +34 -0
- package/esm/_abstract/_CardList.js +37 -0
- package/esm/_abstract/_Image.d.ts +36 -0
- package/esm/_abstract/_Image.js +26 -0
- package/esm/_abstract/_Link.d.ts +60 -0
- package/esm/_abstract/_Link.js +64 -0
- package/esm/_abstract/_Quote.d.ts +11 -0
- package/esm/_abstract/_Quote.js +8 -0
- package/esm/_abstract/_TogglerGroup.d.ts +32 -0
- package/esm/_abstract/_TogglerGroup.js +28 -0
- package/esm/_abstract/_TogglerGroupField.d.ts +19 -0
- package/esm/_abstract/_TogglerGroupField.js +17 -0
- package/esm/_abstract/_TogglerInput.d.ts +23 -0
- package/esm/_abstract/_TogglerInput.js +23 -0
- package/esm/_abstract/breakOnNL.d.ts +1 -0
- package/esm/_abstract/breakOnNL.js +7 -0
- package/esm/assets.d.ts +42 -0
- package/esm/assets.js +58 -0
- package/esm/constants.d.ts +19 -0
- package/esm/constants.js +22 -0
- package/esm/focus-visible.d.ts +1 -0
- package/esm/focus-visible.js +3 -0
- package/esm/index.d.ts +97 -0
- package/esm/index.js +1 -0
- package/esm/package.json +1 -0
- package/esm/utils/HannaUIState.d.ts +8 -0
- package/esm/utils/HannaUIState.js +7 -0
- package/esm/utils/browserSide.d.ts +1 -0
- package/esm/utils/browserSide.js +1 -0
- package/esm/utils/config.d.ts +4 -0
- package/esm/utils/config.js +2 -0
- package/esm/utils/env.d.ts +1 -0
- package/esm/utils/env.js +8 -0
- package/esm/utils/seenEffect.d.ts +27 -0
- package/esm/utils/seenEffect.js +75 -0
- package/esm/utils/useDidChange.d.ts +37 -0
- package/esm/utils/useDidChange.js +43 -0
- package/esm/utils/useFormatMonitor.d.ts +38 -0
- package/esm/utils/useFormatMonitor.js +41 -0
- package/esm/utils/useGetSVGtext.d.ts +10 -0
- package/esm/utils/useGetSVGtext.js +23 -0
- package/esm/utils/useMenuToggling.d.ts +8 -0
- package/esm/utils/useMenuToggling.js +62 -0
- package/esm/utils/useMixedControlState.d.ts +137 -0
- package/esm/utils/useMixedControlState.js +101 -0
- package/esm/utils/useScrollbarWidthCSSVar.d.ts +17 -0
- package/esm/utils/useScrollbarWidthCSSVar.js +19 -0
- package/esm/utils.d.ts +8 -0
- package/esm/utils.js +8 -0
- package/package.json +390 -4
- package/utils/config.d.ts +2 -2
- package/utils/config.js +2 -2
- package/utils/useDidChange.d.ts +1 -1
- package/utils/useDidChange.js +1 -1
- package/utils/useMenuToggling.js +2 -2
- package/utils.d.ts +8 -8
- package/utils.js +8 -8
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { useCallback, useRef, useState } from 'react';
|
|
2
|
+
import { capitalize } from '@reykjavik/hanna-utils';
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
export function useMixedControlState(props, name, emptyValue) {
|
|
5
|
+
const value = props[name];
|
|
6
|
+
const defaultValue = props[`default${capitalize(name)}`];
|
|
7
|
+
return useMixedControlState.raw(value, defaultValue, name, emptyValue);
|
|
8
|
+
}
|
|
9
|
+
// ===========================================================================
|
|
10
|
+
//
|
|
11
|
+
//
|
|
12
|
+
// ===========================================================================
|
|
13
|
+
const defaultWarningLogger = (message) => console.error(message);
|
|
14
|
+
useMixedControlState.$warningLogger = defaultWarningLogger;
|
|
15
|
+
/** Validate sane use of the component, during development. */
|
|
16
|
+
const validateSaneUse = ({ warningPropName, value, defaultValue, lastMode, }) => {
|
|
17
|
+
const warn = useMixedControlState.$warningLogger || defaultWarningLogger;
|
|
18
|
+
if (value !== undefined && defaultValue !== undefined) {
|
|
19
|
+
warn(`WARNING:` +
|
|
20
|
+
` Don't mix` +
|
|
21
|
+
(warningPropName
|
|
22
|
+
? ` \`${warningPropName}\` and \`default${capitalize(warningPropName)}\` props`
|
|
23
|
+
: 'controlled and uncontrolled mode') +
|
|
24
|
+
`\n` +
|
|
25
|
+
`Use one or the other.`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const C_to_U = lastMode === 'controlled' && defaultValue !== undefined;
|
|
29
|
+
const U_to_C = lastMode === 'uncontrolled' && value !== undefined;
|
|
30
|
+
if (C_to_U || U_to_C) {
|
|
31
|
+
warn(`WARNING:` +
|
|
32
|
+
(C_to_U
|
|
33
|
+
? `A component seems to be attempting to change ` +
|
|
34
|
+
`from controlled to uncontrolled mode. ` +
|
|
35
|
+
`This is not possible.`
|
|
36
|
+
: `A component is changing ` + `from uncontrolled to controlled mode.`) +
|
|
37
|
+
`\n` +
|
|
38
|
+
`Decide between using ` +
|
|
39
|
+
(warningPropName
|
|
40
|
+
? `\`${warningPropName}\` (controlled) prop` +
|
|
41
|
+
` OR \`default${capitalize(warningPropName)}\` (uncontrolled)`
|
|
42
|
+
: `either controlled OR uncontrolled mode`) +
|
|
43
|
+
` for the lifetime of the component.`);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
function useRaw(value, defaultValue, warningPropName, emptyValue) {
|
|
48
|
+
const metaRef = useRef({
|
|
49
|
+
lastMode: undefined,
|
|
50
|
+
lastDefault: defaultValue,
|
|
51
|
+
// lastValue: value,
|
|
52
|
+
_emptyValue: emptyValue,
|
|
53
|
+
});
|
|
54
|
+
const meta = metaRef.current;
|
|
55
|
+
const { lastMode, lastDefault, _emptyValue /*, lastValue */ } = meta;
|
|
56
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
57
|
+
validateSaneUse({ warningPropName, value, defaultValue, lastMode });
|
|
58
|
+
}
|
|
59
|
+
const mode = lastMode === 'controlled'
|
|
60
|
+
? 'controlled'
|
|
61
|
+
: value !== undefined
|
|
62
|
+
? 'controlled'
|
|
63
|
+
: defaultValue !== undefined
|
|
64
|
+
? 'uncontrolled'
|
|
65
|
+
: lastMode;
|
|
66
|
+
const [localValue, _setLocalValue] = useState(defaultValue !== undefined ? defaultValue : _emptyValue);
|
|
67
|
+
const setLocalValue = useCallback((newState) => {
|
|
68
|
+
if (mode === 'controlled' && typeof newState === 'function') {
|
|
69
|
+
newState = newState(value !== undefined ? value : _emptyValue);
|
|
70
|
+
}
|
|
71
|
+
metaRef.current.lastMode = mode || 'uncontrolled';
|
|
72
|
+
const setterFn = typeof newState === 'function' ? newState : () => newState;
|
|
73
|
+
_setLocalValue((prevState) => {
|
|
74
|
+
let newState = setterFn(prevState);
|
|
75
|
+
newState = newState !== undefined ? newState : _emptyValue;
|
|
76
|
+
if (prevState !== newState) {
|
|
77
|
+
_setLocalValue.$isCalled = true;
|
|
78
|
+
}
|
|
79
|
+
return newState;
|
|
80
|
+
});
|
|
81
|
+
}, [value, mode, _emptyValue]);
|
|
82
|
+
// The mode can change but it should never go back to `undefined` state
|
|
83
|
+
// this is similar to what React does with <input/> and <select/> elements.
|
|
84
|
+
// In dev-mode an WARNING gets logged whenever the mode changes.
|
|
85
|
+
meta.lastMode = mode;
|
|
86
|
+
if (mode === 'uncontrolled') {
|
|
87
|
+
// only update lastDefault when in unconrolled mode
|
|
88
|
+
// to guarantee capture of changes that might happen during
|
|
89
|
+
// controlled mode. Something that should ideally not happen
|
|
90
|
+
// but is worth keeping as sane as possible nonetheless.
|
|
91
|
+
meta.lastDefault = defaultValue;
|
|
92
|
+
if (!_setLocalValue.$isCalled && defaultValue !== lastDefault) {
|
|
93
|
+
// Immediately exits and re-renders the component
|
|
94
|
+
_setLocalValue(defaultValue !== undefined ? defaultValue : _emptyValue);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// meta.lastValue = value;
|
|
98
|
+
const retValue = mode === 'controlled' ? value : localValue;
|
|
99
|
+
return [retValue, setLocalValue, mode];
|
|
100
|
+
}
|
|
101
|
+
useMixedControlState.raw = useRaw;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Measures the scrollbar width and sets it as a CSS variable on
|
|
3
|
+
* the `<html/>` element.
|
|
4
|
+
*
|
|
5
|
+
* Use this hook inside all of your top-level layout components
|
|
6
|
+
*
|
|
7
|
+
* The name of the variable is `--browser-scrollbar-width`, and you can
|
|
8
|
+
* reference it manually in your CSS, or via the hanna-css variable helper.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { hannaVars } from '@reykjavik/hanna-css';
|
|
12
|
+
*
|
|
13
|
+
* console.log(hannaVars.browser_scrollbar_width.toString())
|
|
14
|
+
* // "var(--browser-scrollbar-width)"
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const useScrollbarWidthCSSVar: () => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import getScrollbarWidth from '@hugsmidjan/qj/getScrollbarWidth';
|
|
3
|
+
/**
|
|
4
|
+
* Measures the scrollbar width and sets it as a CSS variable on
|
|
5
|
+
* the `<html/>` element.
|
|
6
|
+
*
|
|
7
|
+
* Use this hook inside all of your top-level layout components
|
|
8
|
+
*
|
|
9
|
+
* The name of the variable is `--browser-scrollbar-width`, and you can
|
|
10
|
+
* reference it manually in your CSS, or via the hanna-css variable helper.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { hannaVars } from '@reykjavik/hanna-css';
|
|
14
|
+
*
|
|
15
|
+
* console.log(hannaVars.browser_scrollbar_width.toString())
|
|
16
|
+
* // "var(--browser-scrollbar-width)"
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const useScrollbarWidthCSSVar = () => useEffect(() => getScrollbarWidth.setCSSvar(), []);
|
package/esm/utils.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './utils/browserSide.js';
|
|
2
|
+
export * from './utils/config.js';
|
|
3
|
+
export * from './utils/HannaUIState.js';
|
|
4
|
+
export * from './utils/useDidChange.js';
|
|
5
|
+
export * from './utils/useFormatMonitor.js';
|
|
6
|
+
export * from './utils/useGetSVGtext.js';
|
|
7
|
+
export * from './utils/useMixedControlState.js';
|
|
8
|
+
export * from './utils/useScrollbarWidthCSSVar.js';
|
package/esm/utils.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './utils/browserSide.js';
|
|
2
|
+
export * from './utils/config.js';
|
|
3
|
+
export * from './utils/HannaUIState.js';
|
|
4
|
+
export * from './utils/useDidChange.js';
|
|
5
|
+
export * from './utils/useFormatMonitor.js';
|
|
6
|
+
export * from './utils/useGetSVGtext.js';
|
|
7
|
+
export * from './utils/useMixedControlState.js';
|
|
8
|
+
export * from './utils/useScrollbarWidthCSSVar.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reykjavik/hanna-react",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.85",
|
|
4
4
|
"author": "Reykjavík (http://www.reykjavik.is)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Hugsmiðjan ehf (http://www.hugsmidjan.is)",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@floating-ui/react": "^0.19.2",
|
|
17
17
|
"@hugsmidjan/qj": "^4.10.2",
|
|
18
|
-
"@hugsmidjan/react": "^0.4.
|
|
19
|
-
"@reykjavik/hanna-css": "^0.3.
|
|
18
|
+
"@hugsmidjan/react": "^0.4.24",
|
|
19
|
+
"@reykjavik/hanna-css": "^0.3.17",
|
|
20
20
|
"@reykjavik/hanna-utils": "^0.2.3",
|
|
21
21
|
"@types/react": "^17.0.24",
|
|
22
22
|
"@types/react-autosuggest": "^10.1.0",
|
|
@@ -39,5 +39,391 @@
|
|
|
39
39
|
},
|
|
40
40
|
"sideEffects": [
|
|
41
41
|
"**/focus-visible.js"
|
|
42
|
-
]
|
|
42
|
+
],
|
|
43
|
+
"exports": {
|
|
44
|
+
"./AccordionList": {
|
|
45
|
+
"import": "./esm/AccordionList.js",
|
|
46
|
+
"require": "./AccordionList.js"
|
|
47
|
+
},
|
|
48
|
+
"./ActionCards": {
|
|
49
|
+
"import": "./esm/ActionCards.js",
|
|
50
|
+
"require": "./ActionCards.js"
|
|
51
|
+
},
|
|
52
|
+
"./Alert": {
|
|
53
|
+
"import": "./esm/Alert.js",
|
|
54
|
+
"require": "./Alert.js"
|
|
55
|
+
},
|
|
56
|
+
"./ArticleCards": {
|
|
57
|
+
"import": "./esm/ArticleCards.js",
|
|
58
|
+
"require": "./ArticleCards.js"
|
|
59
|
+
},
|
|
60
|
+
"./ArticleCarousel": {
|
|
61
|
+
"import": "./esm/ArticleCarousel.js",
|
|
62
|
+
"require": "./ArticleCarousel.js"
|
|
63
|
+
},
|
|
64
|
+
"./ArticleMeta": {
|
|
65
|
+
"import": "./esm/ArticleMeta.js",
|
|
66
|
+
"require": "./ArticleMeta.js"
|
|
67
|
+
},
|
|
68
|
+
"./assets": {
|
|
69
|
+
"import": "./esm/assets.js",
|
|
70
|
+
"require": "./assets.js"
|
|
71
|
+
},
|
|
72
|
+
"./Attention": {
|
|
73
|
+
"import": "./esm/Attention.js",
|
|
74
|
+
"require": "./Attention.js"
|
|
75
|
+
},
|
|
76
|
+
"./BasicTable": {
|
|
77
|
+
"import": "./esm/BasicTable.js",
|
|
78
|
+
"require": "./BasicTable.js"
|
|
79
|
+
},
|
|
80
|
+
"./BgBox": {
|
|
81
|
+
"import": "./esm/BgBox.js",
|
|
82
|
+
"require": "./BgBox.js"
|
|
83
|
+
},
|
|
84
|
+
"./Bling": {
|
|
85
|
+
"import": "./esm/Bling.js",
|
|
86
|
+
"require": "./Bling.js"
|
|
87
|
+
},
|
|
88
|
+
"./BlockBreak": {
|
|
89
|
+
"import": "./esm/BlockBreak.js",
|
|
90
|
+
"require": "./BlockBreak.js"
|
|
91
|
+
},
|
|
92
|
+
"./BlockQuote": {
|
|
93
|
+
"import": "./esm/BlockQuote.js",
|
|
94
|
+
"require": "./BlockQuote.js"
|
|
95
|
+
},
|
|
96
|
+
"./BreadCrumbs": {
|
|
97
|
+
"import": "./esm/BreadCrumbs.js",
|
|
98
|
+
"require": "./BreadCrumbs.js"
|
|
99
|
+
},
|
|
100
|
+
"./ButtonBack": {
|
|
101
|
+
"import": "./esm/ButtonBack.js",
|
|
102
|
+
"require": "./ButtonBack.js"
|
|
103
|
+
},
|
|
104
|
+
"./ButtonBar": {
|
|
105
|
+
"import": "./esm/ButtonBar.js",
|
|
106
|
+
"require": "./ButtonBar.js"
|
|
107
|
+
},
|
|
108
|
+
"./ButtonPrimary": {
|
|
109
|
+
"import": "./esm/ButtonPrimary.js",
|
|
110
|
+
"require": "./ButtonPrimary.js"
|
|
111
|
+
},
|
|
112
|
+
"./ButtonSecondary": {
|
|
113
|
+
"import": "./esm/ButtonSecondary.js",
|
|
114
|
+
"require": "./ButtonSecondary.js"
|
|
115
|
+
},
|
|
116
|
+
"./ButtonTertiary": {
|
|
117
|
+
"import": "./esm/ButtonTertiary.js",
|
|
118
|
+
"require": "./ButtonTertiary.js"
|
|
119
|
+
},
|
|
120
|
+
"./Carousel": {
|
|
121
|
+
"import": "./esm/Carousel.js",
|
|
122
|
+
"require": "./Carousel.js"
|
|
123
|
+
},
|
|
124
|
+
"./CarouselStepper": {
|
|
125
|
+
"import": "./esm/CarouselStepper.js",
|
|
126
|
+
"require": "./CarouselStepper.js"
|
|
127
|
+
},
|
|
128
|
+
"./CenterColumn": {
|
|
129
|
+
"import": "./esm/CenterColumn.js",
|
|
130
|
+
"require": "./CenterColumn.js"
|
|
131
|
+
},
|
|
132
|
+
"./Checkbox": {
|
|
133
|
+
"import": "./esm/Checkbox.js",
|
|
134
|
+
"require": "./Checkbox.js"
|
|
135
|
+
},
|
|
136
|
+
"./CheckboxButton": {
|
|
137
|
+
"import": "./esm/CheckboxButton.js",
|
|
138
|
+
"require": "./CheckboxButton.js"
|
|
139
|
+
},
|
|
140
|
+
"./CheckboxButtonsGroup": {
|
|
141
|
+
"import": "./esm/CheckboxButtonsGroup.js",
|
|
142
|
+
"require": "./CheckboxButtonsGroup.js"
|
|
143
|
+
},
|
|
144
|
+
"./CheckboxGroup": {
|
|
145
|
+
"import": "./esm/CheckboxGroup.js",
|
|
146
|
+
"require": "./CheckboxGroup.js"
|
|
147
|
+
},
|
|
148
|
+
"./CityBlock": {
|
|
149
|
+
"import": "./esm/CityBlock.js",
|
|
150
|
+
"require": "./CityBlock.js"
|
|
151
|
+
},
|
|
152
|
+
"./constants": {
|
|
153
|
+
"import": "./esm/constants.js",
|
|
154
|
+
"require": "./constants.js"
|
|
155
|
+
},
|
|
156
|
+
"./ContactBubble": {
|
|
157
|
+
"import": "./esm/ContactBubble.js",
|
|
158
|
+
"require": "./ContactBubble.js"
|
|
159
|
+
},
|
|
160
|
+
"./ContentArticle": {
|
|
161
|
+
"import": "./esm/ContentArticle.js",
|
|
162
|
+
"require": "./ContentArticle.js"
|
|
163
|
+
},
|
|
164
|
+
"./ContentImage": {
|
|
165
|
+
"import": "./esm/ContentImage.js",
|
|
166
|
+
"require": "./ContentImage.js"
|
|
167
|
+
},
|
|
168
|
+
"./Datepicker": {
|
|
169
|
+
"import": "./esm/Datepicker.js",
|
|
170
|
+
"require": "./Datepicker.js"
|
|
171
|
+
},
|
|
172
|
+
"./ExtraLinks": {
|
|
173
|
+
"import": "./esm/ExtraLinks.js",
|
|
174
|
+
"require": "./ExtraLinks.js"
|
|
175
|
+
},
|
|
176
|
+
"./FeatureList": {
|
|
177
|
+
"import": "./esm/FeatureList.js",
|
|
178
|
+
"require": "./FeatureList.js"
|
|
179
|
+
},
|
|
180
|
+
"./FieldGroup": {
|
|
181
|
+
"import": "./esm/FieldGroup.js",
|
|
182
|
+
"require": "./FieldGroup.js"
|
|
183
|
+
},
|
|
184
|
+
"./FileInput": {
|
|
185
|
+
"import": "./esm/FileInput.js",
|
|
186
|
+
"require": "./FileInput.js"
|
|
187
|
+
},
|
|
188
|
+
"./focus-visible": {
|
|
189
|
+
"import": "./esm/focus-visible.js",
|
|
190
|
+
"require": "./focus-visible.js"
|
|
191
|
+
},
|
|
192
|
+
"./Foonote": {
|
|
193
|
+
"import": "./esm/Foonote.js",
|
|
194
|
+
"require": "./Foonote.js"
|
|
195
|
+
},
|
|
196
|
+
"./FooterBadges": {
|
|
197
|
+
"import": "./esm/FooterBadges.js",
|
|
198
|
+
"require": "./FooterBadges.js"
|
|
199
|
+
},
|
|
200
|
+
"./FooterInfo": {
|
|
201
|
+
"import": "./esm/FooterInfo.js",
|
|
202
|
+
"require": "./FooterInfo.js"
|
|
203
|
+
},
|
|
204
|
+
"./Footnote": {
|
|
205
|
+
"import": "./esm/Footnote.js",
|
|
206
|
+
"require": "./Footnote.js"
|
|
207
|
+
},
|
|
208
|
+
"./Form": {
|
|
209
|
+
"import": "./esm/Form.js",
|
|
210
|
+
"require": "./Form.js"
|
|
211
|
+
},
|
|
212
|
+
"./FormField": {
|
|
213
|
+
"import": "./esm/FormField.js",
|
|
214
|
+
"require": "./FormField.js"
|
|
215
|
+
},
|
|
216
|
+
"./Gallery": {
|
|
217
|
+
"import": "./esm/Gallery.js",
|
|
218
|
+
"require": "./Gallery.js"
|
|
219
|
+
},
|
|
220
|
+
"./GridBlocks": {
|
|
221
|
+
"import": "./esm/GridBlocks.js",
|
|
222
|
+
"require": "./GridBlocks.js"
|
|
223
|
+
},
|
|
224
|
+
"./Heading": {
|
|
225
|
+
"import": "./esm/Heading.js",
|
|
226
|
+
"require": "./Heading.js"
|
|
227
|
+
},
|
|
228
|
+
"./HeroBlock": {
|
|
229
|
+
"import": "./esm/HeroBlock.js",
|
|
230
|
+
"require": "./HeroBlock.js"
|
|
231
|
+
},
|
|
232
|
+
"./IframeBlock": {
|
|
233
|
+
"import": "./esm/IframeBlock.js",
|
|
234
|
+
"require": "./IframeBlock.js"
|
|
235
|
+
},
|
|
236
|
+
"./Illustration": {
|
|
237
|
+
"import": "./esm/Illustration.js",
|
|
238
|
+
"require": "./Illustration.js"
|
|
239
|
+
},
|
|
240
|
+
"./ImageCards": {
|
|
241
|
+
"import": "./esm/ImageCards.js",
|
|
242
|
+
"require": "./ImageCards.js"
|
|
243
|
+
},
|
|
244
|
+
".": {
|
|
245
|
+
"import": "./esm/index.js",
|
|
246
|
+
"require": "./index.js"
|
|
247
|
+
},
|
|
248
|
+
"./InfoBlock": {
|
|
249
|
+
"import": "./esm/InfoBlock.js",
|
|
250
|
+
"require": "./InfoBlock.js"
|
|
251
|
+
},
|
|
252
|
+
"./InfoHero": {
|
|
253
|
+
"import": "./esm/InfoHero.js",
|
|
254
|
+
"require": "./InfoHero.js"
|
|
255
|
+
},
|
|
256
|
+
"./IslandBlock": {
|
|
257
|
+
"import": "./esm/IslandBlock.js",
|
|
258
|
+
"require": "./IslandBlock.js"
|
|
259
|
+
},
|
|
260
|
+
"./IslandPageBlock": {
|
|
261
|
+
"import": "./esm/IslandPageBlock.js",
|
|
262
|
+
"require": "./IslandPageBlock.js"
|
|
263
|
+
},
|
|
264
|
+
"./LabeledTextBlock": {
|
|
265
|
+
"import": "./esm/LabeledTextBlock.js",
|
|
266
|
+
"require": "./LabeledTextBlock.js"
|
|
267
|
+
},
|
|
268
|
+
"./Layout": {
|
|
269
|
+
"import": "./esm/Layout.js",
|
|
270
|
+
"require": "./Layout.js"
|
|
271
|
+
},
|
|
272
|
+
"./MainMenu": {
|
|
273
|
+
"import": "./esm/MainMenu.js",
|
|
274
|
+
"require": "./MainMenu.js"
|
|
275
|
+
},
|
|
276
|
+
"./MiniMetrics": {
|
|
277
|
+
"import": "./esm/MiniMetrics.js",
|
|
278
|
+
"require": "./MiniMetrics.js"
|
|
279
|
+
},
|
|
280
|
+
"./Modal": {
|
|
281
|
+
"import": "./esm/Modal.js",
|
|
282
|
+
"require": "./Modal.js"
|
|
283
|
+
},
|
|
284
|
+
"./NameCard": {
|
|
285
|
+
"import": "./esm/NameCard.js",
|
|
286
|
+
"require": "./NameCard.js"
|
|
287
|
+
},
|
|
288
|
+
"./NameCards": {
|
|
289
|
+
"import": "./esm/NameCards.js",
|
|
290
|
+
"require": "./NameCards.js"
|
|
291
|
+
},
|
|
292
|
+
"./NewsHero": {
|
|
293
|
+
"import": "./esm/NewsHero.js",
|
|
294
|
+
"require": "./NewsHero.js"
|
|
295
|
+
},
|
|
296
|
+
"./PageFilter": {
|
|
297
|
+
"import": "./esm/PageFilter.js",
|
|
298
|
+
"require": "./PageFilter.js"
|
|
299
|
+
},
|
|
300
|
+
"./PageHeading": {
|
|
301
|
+
"import": "./esm/PageHeading.js",
|
|
302
|
+
"require": "./PageHeading.js"
|
|
303
|
+
},
|
|
304
|
+
"./Picture": {
|
|
305
|
+
"import": "./esm/Picture.js",
|
|
306
|
+
"require": "./Picture.js"
|
|
307
|
+
},
|
|
308
|
+
"./ProcessOverview": {
|
|
309
|
+
"import": "./esm/ProcessOverview.js",
|
|
310
|
+
"require": "./ProcessOverview.js"
|
|
311
|
+
},
|
|
312
|
+
"./PullQuote": {
|
|
313
|
+
"import": "./esm/PullQuote.js",
|
|
314
|
+
"require": "./PullQuote.js"
|
|
315
|
+
},
|
|
316
|
+
"./RadioButtonsGroup": {
|
|
317
|
+
"import": "./esm/RadioButtonsGroup.js",
|
|
318
|
+
"require": "./RadioButtonsGroup.js"
|
|
319
|
+
},
|
|
320
|
+
"./RadioGroup": {
|
|
321
|
+
"import": "./esm/RadioGroup.js",
|
|
322
|
+
"require": "./RadioGroup.js"
|
|
323
|
+
},
|
|
324
|
+
"./RelatedLinks": {
|
|
325
|
+
"import": "./esm/RelatedLinks.js",
|
|
326
|
+
"require": "./RelatedLinks.js"
|
|
327
|
+
},
|
|
328
|
+
"./RowBlock": {
|
|
329
|
+
"import": "./esm/RowBlock.js",
|
|
330
|
+
"require": "./RowBlock.js"
|
|
331
|
+
},
|
|
332
|
+
"./RowBlockColumn": {
|
|
333
|
+
"import": "./esm/RowBlockColumn.js",
|
|
334
|
+
"require": "./RowBlockColumn.js"
|
|
335
|
+
},
|
|
336
|
+
"./SearchInput": {
|
|
337
|
+
"import": "./esm/SearchInput.js",
|
|
338
|
+
"require": "./SearchInput.js"
|
|
339
|
+
},
|
|
340
|
+
"./SearchResults": {
|
|
341
|
+
"import": "./esm/SearchResults.js",
|
|
342
|
+
"require": "./SearchResults.js"
|
|
343
|
+
},
|
|
344
|
+
"./SeenEffect": {
|
|
345
|
+
"import": "./esm/SeenEffect.js",
|
|
346
|
+
"require": "./SeenEffect.js"
|
|
347
|
+
},
|
|
348
|
+
"./Selectbox": {
|
|
349
|
+
"import": "./esm/Selectbox.js",
|
|
350
|
+
"require": "./Selectbox.js"
|
|
351
|
+
},
|
|
352
|
+
"./ShareButtons": {
|
|
353
|
+
"import": "./esm/ShareButtons.js",
|
|
354
|
+
"require": "./ShareButtons.js"
|
|
355
|
+
},
|
|
356
|
+
"./Sharpie": {
|
|
357
|
+
"import": "./esm/Sharpie.js",
|
|
358
|
+
"require": "./Sharpie.js"
|
|
359
|
+
},
|
|
360
|
+
"./SiteSearchAutocomplete": {
|
|
361
|
+
"import": "./esm/SiteSearchAutocomplete.js",
|
|
362
|
+
"require": "./SiteSearchAutocomplete.js"
|
|
363
|
+
},
|
|
364
|
+
"./SiteSearchCurtain": {
|
|
365
|
+
"import": "./esm/SiteSearchCurtain.js",
|
|
366
|
+
"require": "./SiteSearchCurtain.js"
|
|
367
|
+
},
|
|
368
|
+
"./SiteSearchInput": {
|
|
369
|
+
"import": "./esm/SiteSearchInput.js",
|
|
370
|
+
"require": "./SiteSearchInput.js"
|
|
371
|
+
},
|
|
372
|
+
"./Skeleton": {
|
|
373
|
+
"import": "./esm/Skeleton.js",
|
|
374
|
+
"require": "./Skeleton.js"
|
|
375
|
+
},
|
|
376
|
+
"./SubHeading": {
|
|
377
|
+
"import": "./esm/SubHeading.js",
|
|
378
|
+
"require": "./SubHeading.js"
|
|
379
|
+
},
|
|
380
|
+
"./Tabs": {
|
|
381
|
+
"import": "./esm/Tabs.js",
|
|
382
|
+
"require": "./Tabs.js"
|
|
383
|
+
},
|
|
384
|
+
"./TagPill": {
|
|
385
|
+
"import": "./esm/TagPill.js",
|
|
386
|
+
"require": "./TagPill.js"
|
|
387
|
+
},
|
|
388
|
+
"./TextBlock": {
|
|
389
|
+
"import": "./esm/TextBlock.js",
|
|
390
|
+
"require": "./TextBlock.js"
|
|
391
|
+
},
|
|
392
|
+
"./TextButton": {
|
|
393
|
+
"import": "./esm/TextButton.js",
|
|
394
|
+
"require": "./TextButton.js"
|
|
395
|
+
},
|
|
396
|
+
"./TextInput": {
|
|
397
|
+
"import": "./esm/TextInput.js",
|
|
398
|
+
"require": "./TextInput.js"
|
|
399
|
+
},
|
|
400
|
+
"./Tooltip": {
|
|
401
|
+
"import": "./esm/Tooltip.js",
|
|
402
|
+
"require": "./Tooltip.js"
|
|
403
|
+
},
|
|
404
|
+
"./utils": {
|
|
405
|
+
"import": "./esm/utils.js",
|
|
406
|
+
"require": "./utils.js"
|
|
407
|
+
},
|
|
408
|
+
"./VerticalTabsTOC": {
|
|
409
|
+
"import": "./esm/VerticalTabsTOC.js",
|
|
410
|
+
"require": "./VerticalTabsTOC.js"
|
|
411
|
+
},
|
|
412
|
+
"./VSpacer": {
|
|
413
|
+
"import": "./esm/VSpacer.js",
|
|
414
|
+
"require": "./VSpacer.js"
|
|
415
|
+
},
|
|
416
|
+
"./WizardLayout": {
|
|
417
|
+
"import": "./esm/WizardLayout.js",
|
|
418
|
+
"require": "./WizardLayout.js"
|
|
419
|
+
},
|
|
420
|
+
"./WizardLayoutClose": {
|
|
421
|
+
"import": "./esm/WizardLayoutClose.js",
|
|
422
|
+
"require": "./WizardLayoutClose.js"
|
|
423
|
+
},
|
|
424
|
+
"./WizardStepper": {
|
|
425
|
+
"import": "./esm/WizardStepper.js",
|
|
426
|
+
"require": "./WizardStepper.js"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
43
429
|
}
|
package/utils/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { LinkRenderer } from '../_abstract/_Link';
|
|
2
|
-
export { setLinkRenderer } from '../_abstract/_Link';
|
|
1
|
+
export type { LinkRenderer } from '../_abstract/_Link.js';
|
|
2
|
+
export { setLinkRenderer } from '../_abstract/_Link.js';
|
|
3
3
|
export type { SSRSupport } from '@hugsmidjan/react/hooks';
|
|
4
4
|
export { setDefaultSSR } from '@hugsmidjan/react/hooks';
|
package/utils/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setDefaultSSR = exports.setLinkRenderer = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "setLinkRenderer", { enumerable: true, get: function () { return
|
|
4
|
+
var _Link_js_1 = require("../_abstract/_Link.js");
|
|
5
|
+
Object.defineProperty(exports, "setLinkRenderer", { enumerable: true, get: function () { return _Link_js_1.setLinkRenderer; } });
|
|
6
6
|
var hooks_1 = require("@hugsmidjan/react/hooks");
|
|
7
7
|
Object.defineProperty(exports, "setDefaultSSR", { enumerable: true, get: function () { return hooks_1.setDefaultSSR; } });
|
package/utils/useDidChange.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* but resets/changes its internal state whenever a certain prop value changes.
|
|
9
9
|
*
|
|
10
10
|
* ```tsx
|
|
11
|
-
* import { useDidChange } from './utils';
|
|
11
|
+
* import { useDidChange } from './utils.js';
|
|
12
12
|
* // import { useDidChange } from '@reykjavik/hanna-react/utils';
|
|
13
13
|
*
|
|
14
14
|
* // inside your component/hook
|
package/utils/useDidChange.js
CHANGED
|
@@ -12,7 +12,7 @@ const react_1 = require("react");
|
|
|
12
12
|
* but resets/changes its internal state whenever a certain prop value changes.
|
|
13
13
|
*
|
|
14
14
|
* ```tsx
|
|
15
|
-
* import { useDidChange } from './utils';
|
|
15
|
+
* import { useDidChange } from './utils.js';
|
|
16
16
|
* // import { useDidChange } from '@reykjavik/hanna-react/utils';
|
|
17
17
|
*
|
|
18
18
|
* // inside your component/hook
|
package/utils/useMenuToggling.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useMenuToggling = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const hanna_utils_1 = require("@reykjavik/hanna-utils");
|
|
6
|
-
const
|
|
6
|
+
const useFormatMonitor_js_1 = require("./useFormatMonitor.js");
|
|
7
7
|
const htmlClass = (className, add) => {
|
|
8
8
|
document.documentElement.classList[add ? 'add' : 'remove'](className);
|
|
9
9
|
};
|
|
@@ -31,7 +31,7 @@ const useMenuToggling = (doInitialize = true) => {
|
|
|
31
31
|
(0, hanna_utils_1.focusElement)('.Layout__header__skiplink');
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
(0,
|
|
34
|
+
(0, useFormatMonitor_js_1.useFormatMonitor)(doInitialize
|
|
35
35
|
? (media) => {
|
|
36
36
|
if (media.becameHamburger) {
|
|
37
37
|
setIsMenuActive(true);
|
package/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './utils/browserSide';
|
|
2
|
-
export * from './utils/config';
|
|
3
|
-
export * from './utils/HannaUIState';
|
|
4
|
-
export * from './utils/useDidChange';
|
|
5
|
-
export * from './utils/useFormatMonitor';
|
|
6
|
-
export * from './utils/useGetSVGtext';
|
|
7
|
-
export * from './utils/useMixedControlState';
|
|
8
|
-
export * from './utils/useScrollbarWidthCSSVar';
|
|
1
|
+
export * from './utils/browserSide.js';
|
|
2
|
+
export * from './utils/config.js';
|
|
3
|
+
export * from './utils/HannaUIState.js';
|
|
4
|
+
export * from './utils/useDidChange.js';
|
|
5
|
+
export * from './utils/useFormatMonitor.js';
|
|
6
|
+
export * from './utils/useGetSVGtext.js';
|
|
7
|
+
export * from './utils/useMixedControlState.js';
|
|
8
|
+
export * from './utils/useScrollbarWidthCSSVar.js';
|
package/utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./utils/browserSide"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./utils/config"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./utils/HannaUIState"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./utils/useDidChange"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./utils/useFormatMonitor"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./utils/useGetSVGtext"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./utils/useMixedControlState"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./utils/useScrollbarWidthCSSVar"), exports);
|
|
4
|
+
tslib_1.__exportStar(require("./utils/browserSide.js"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./utils/config.js"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./utils/HannaUIState.js"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./utils/useDidChange.js"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./utils/useFormatMonitor.js"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./utils/useGetSVGtext.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./utils/useMixedControlState.js"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./utils/useScrollbarWidthCSSVar.js"), exports);
|