@digigov/ui 0.30.2 → 0.31.0
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 +16 -1
- package/admin/AccessibilityMenu/index.d.ts +13 -0
- package/admin/AccessibilityMenu/index.js +170 -0
- package/admin/AutoComplete/index.d.ts +2 -2
- package/admin/Chip/index.d.ts +1 -0
- package/admin/Chip/index.js +14 -0
- package/admin/Drawer/__stories__/Default.js +18 -7
- package/admin/Dropdown/__stories__/AlignRight.js +0 -2
- package/admin/Dropdown/__stories__/Default.js +0 -2
- package/admin/Dropdown/__stories__/PlacementTop.js +0 -2
- package/admin/FilterSection/index.d.ts +1 -2
- package/admin/FilterSection/index.js +4 -18
- package/admin/Modal/index.d.ts +2 -2
- package/admin/Modal/index.js +17 -12
- package/admin/Pagination/__stories__/Default.js +4 -7
- package/admin/Pagination/__stories__/PaginationSmall.js +2 -3
- package/app/Footer/__stories__/FooterAllInclusive.js +1 -0
- package/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
- package/app/Header/__stories__/WithNavigation.js +10 -8
- package/app/QrCodeScanner/__stories__/Default.js +3 -3
- package/app/QrCodeViewer/QRCode.stories.d.ts +0 -1
- package/app/QrCodeViewer/index.d.ts +1 -2
- package/app/QrCodeViewer/index.js +10 -10
- package/app/ThemeOptionsForm/index.d.ts +2 -0
- package/app/ThemeOptionsForm/index.js +243 -0
- package/app/ThemePaletteForm/index.d.ts +2 -0
- package/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +9 -8
- package/app/index.d.ts +2 -1
- package/app/index.js +17 -4
- package/core/Accordion/index.d.ts +2 -2
- package/core/Accordion/index.js +7 -7
- package/core/Divider/__stories__/Default.js +5 -10
- package/core/ErrorSummary/__stories__/Default.js +3 -3
- package/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
- package/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
- package/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
- package/core/Link/__stories__/DarkBackground.js +6 -2
- package/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
- package/core/NavList/NavList.stories.d.ts +3 -1
- package/core/NavList/NavList.stories.js +32 -4
- package/core/NavList/NavList.stories.playwright.json +6 -6
- package/core/NavList/{NavListAuto.js → NavListAuto/NavListAuto.js} +11 -5
- package/core/NavList/{NavListBase.d.ts → NavListAuto/NavListBaseAuto.d.ts} +1 -1
- package/core/NavList/{NavListBase.js → NavListAuto/NavListBaseAuto.js} +6 -4
- package/core/NavList/{NavListContext.d.ts → NavListAuto/NavListContextAuto.d.ts} +7 -4
- package/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +23 -11
- package/core/NavList/NavListAuto/NavListItemAnchorAuto.d.ts +11 -0
- package/core/NavList/{NavListSubMenu.js → NavListAuto/NavListItemAnchorAuto.js} +25 -21
- package/core/NavList/{NavListItemAuto.js → NavListAuto/NavListItemAuto.js} +23 -20
- package/core/NavList/NavListAuto/NavListItemButtonAuto.d.ts +12 -0
- package/core/NavList/NavListAuto/NavListItemButtonAuto.js +50 -0
- package/core/NavList/NavListAuto/NavListMenuAuto.d.ts +11 -0
- package/core/NavList/NavListAuto/NavListMenuAuto.js +59 -0
- package/core/NavList/NavListAuto/NavListSubMenuAuto.d.ts +9 -0
- package/core/NavList/NavListAuto/NavListSubMenuAuto.js +46 -0
- package/core/NavList/NavListItem.js +6 -5
- package/core/NavList/NavListItemBase.d.ts +1 -1
- package/core/NavList/NavListItemBase.js +3 -3
- package/core/NavList/NavMenuContainerContentList.d.ts +3 -1
- package/core/NavList/NavMenuContainerContentList.js +76 -3
- package/core/NavList/__stories__/Default.js +19 -6
- package/core/NavList/__stories__/NavHorizontalLayout.js +17 -5
- package/core/NavList/__stories__/NavListEpathlaExample.js +24 -12
- package/core/NavList/__stories__/NavListHorizontalAutoExample.d.ts +2 -0
- package/core/NavList/__stories__/NavListHorizontalAutoExample.js +67 -0
- package/core/NavList/__stories__/NavListSecondaryAutoExample.d.ts +2 -0
- package/core/NavList/__stories__/NavListSecondaryAutoExample.js +281 -0
- package/core/NavList/__stories__/NavListVerticalAutoExample.d.ts +2 -0
- package/core/NavList/__stories__/NavListVerticalAutoExample.js +67 -0
- package/core/NavList/index.d.ts +2 -5
- package/core/NavList/index.js +5 -33
- package/core/NavList/types.d.ts +20 -10
- package/core/Tabs/__stories__/Default.js +5 -5
- package/core/Tabs/index.d.ts +2 -2
- package/core/Tabs/index.js +5 -7
- package/es/admin/AccessibilityMenu/index.js +13 -0
- package/es/admin/Chip/index.js +1 -0
- package/es/admin/Drawer/__stories__/Default.js +19 -8
- package/es/admin/Dropdown/__stories__/AlignRight.js +0 -2
- package/es/admin/Dropdown/__stories__/Default.js +0 -2
- package/es/admin/Dropdown/__stories__/PlacementTop.js +0 -2
- package/es/admin/FilterSection/index.js +1 -2
- package/es/admin/Modal/index.js +16 -11
- package/es/admin/Pagination/__stories__/Default.js +4 -7
- package/es/admin/Pagination/__stories__/PaginationSmall.js +2 -3
- package/es/app/Footer/__stories__/FooterAllInclusive.js +1 -0
- package/es/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
- package/es/app/Header/__stories__/WithNavigation.js +10 -8
- package/es/app/QrCodeScanner/__stories__/Default.js +3 -3
- package/es/app/QrCodeViewer/index.js +8 -9
- package/es/app/ThemeOptionsForm/index.js +215 -0
- package/es/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +5 -4
- package/es/app/index.js +2 -1
- package/es/core/Accordion/index.js +7 -7
- package/es/core/Divider/__stories__/Default.js +5 -10
- package/es/core/ErrorSummary/__stories__/Default.js +3 -3
- package/es/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
- package/es/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
- package/es/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
- package/es/core/Link/__stories__/DarkBackground.js +6 -2
- package/es/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
- package/es/core/NavList/NavList.stories.js +3 -1
- package/es/core/NavList/NavList.stories.playwright.json +6 -6
- package/{esm/core/NavList → es/core/NavList/NavListAuto}/NavListAuto.js +11 -5
- package/{esm/core/NavList/NavListBase.js → es/core/NavList/NavListAuto/NavListBaseAuto.js} +4 -2
- package/es/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +20 -8
- package/es/core/NavList/NavListAuto/NavListItemAnchorAuto.js +29 -0
- package/es/core/NavList/NavListAuto/NavListItemAuto.js +42 -0
- package/es/core/NavList/NavListAuto/NavListItemButtonAuto.js +32 -0
- package/es/core/NavList/NavListAuto/NavListMenuAuto.js +39 -0
- package/es/core/NavList/NavListAuto/NavListSubMenuAuto.js +28 -0
- package/es/core/NavList/NavListItem.js +8 -7
- package/es/core/NavList/NavListItemBase.js +3 -3
- package/es/core/NavList/NavMenuContainerContentList.js +67 -1
- package/es/core/NavList/__stories__/Default.js +19 -6
- package/es/core/NavList/__stories__/NavHorizontalLayout.js +17 -5
- package/es/core/NavList/__stories__/NavListEpathlaExample.js +24 -12
- package/es/core/NavList/__stories__/NavListHorizontalAutoExample.js +51 -0
- package/es/core/NavList/__stories__/NavListSecondaryAutoExample.js +255 -0
- package/es/core/NavList/__stories__/NavListVerticalAutoExample.js +51 -0
- package/es/core/NavList/index.js +2 -5
- package/es/core/Tabs/__stories__/Default.js +5 -5
- package/es/core/Tabs/index.js +5 -7
- package/es/hooks/useFontSize.js +10 -0
- package/es/hooks/useHighlightLinks.js +38 -0
- package/es/hooks/useLetterSpacing.js +10 -0
- package/es/hooks/useLineHeight.js +10 -0
- package/es/hooks/useNavList.js +10 -7
- package/es/hooks/useTheme.js +19 -11
- package/es/hooks/useTogglableNav.js +292 -0
- package/es/hooks/{useTogglableSections.js → useTogglableTab.js} +2 -8
- package/es/hooks/useVariantVars.js +30 -0
- package/es/layouts/Basic/__stories__/Default.js +2 -2
- package/es/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
- package/es/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
- package/es/registry.js +36 -14
- package/es/typography/NormalText/__stories__/FontSizes.js +18 -6
- package/es/typography/NormalText/__stories__/FontWeight.js +3 -1
- package/es/typography/NormalText/__stories__/Variants.js +3 -1
- package/esm/admin/AccessibilityMenu/index.js +13 -0
- package/esm/admin/Chip/index.js +1 -0
- package/esm/admin/Drawer/__stories__/Default.js +19 -8
- package/esm/admin/Dropdown/__stories__/AlignRight.js +0 -2
- package/esm/admin/Dropdown/__stories__/Default.js +0 -2
- package/esm/admin/Dropdown/__stories__/PlacementTop.js +0 -2
- package/esm/admin/FilterSection/index.js +1 -2
- package/esm/admin/Modal/index.js +16 -11
- package/esm/admin/Pagination/__stories__/Default.js +4 -7
- package/esm/admin/Pagination/__stories__/PaginationSmall.js +2 -3
- package/esm/app/Footer/__stories__/FooterAllInclusive.js +1 -0
- package/esm/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
- package/esm/app/Header/__stories__/WithNavigation.js +10 -8
- package/esm/app/QrCodeScanner/__stories__/Default.js +3 -3
- package/esm/app/QrCodeViewer/index.js +8 -9
- package/esm/app/ThemeOptionsForm/index.js +215 -0
- package/esm/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +5 -4
- package/esm/app/index.js +2 -1
- package/esm/core/Accordion/index.js +7 -7
- package/esm/core/Divider/__stories__/Default.js +5 -10
- package/esm/core/ErrorSummary/__stories__/Default.js +3 -3
- package/esm/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
- package/esm/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
- package/esm/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
- package/esm/core/Link/__stories__/DarkBackground.js +6 -2
- package/esm/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
- package/esm/core/NavList/NavList.stories.js +3 -1
- package/esm/core/NavList/NavList.stories.playwright.json +6 -6
- package/{es/core/NavList → esm/core/NavList/NavListAuto}/NavListAuto.js +11 -5
- package/{es/core/NavList/NavListBase.js → esm/core/NavList/NavListAuto/NavListBaseAuto.js} +4 -2
- package/esm/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +20 -8
- package/esm/core/NavList/NavListAuto/NavListItemAnchorAuto.js +29 -0
- package/esm/core/NavList/NavListAuto/NavListItemAuto.js +42 -0
- package/esm/core/NavList/NavListAuto/NavListItemButtonAuto.js +32 -0
- package/esm/core/NavList/NavListAuto/NavListMenuAuto.js +39 -0
- package/esm/core/NavList/NavListAuto/NavListSubMenuAuto.js +28 -0
- package/esm/core/NavList/NavListItem.js +8 -7
- package/esm/core/NavList/NavListItemBase.js +3 -3
- package/esm/core/NavList/NavMenuContainerContentList.js +67 -1
- package/esm/core/NavList/__stories__/Default.js +19 -6
- package/esm/core/NavList/__stories__/NavHorizontalLayout.js +17 -5
- package/esm/core/NavList/__stories__/NavListEpathlaExample.js +24 -12
- package/esm/core/NavList/__stories__/NavListHorizontalAutoExample.js +51 -0
- package/esm/core/NavList/__stories__/NavListSecondaryAutoExample.js +255 -0
- package/esm/core/NavList/__stories__/NavListVerticalAutoExample.js +51 -0
- package/esm/core/NavList/index.js +2 -5
- package/esm/core/Tabs/__stories__/Default.js +5 -5
- package/esm/core/Tabs/index.js +5 -7
- package/esm/hooks/useFontSize.js +10 -0
- package/esm/hooks/useHighlightLinks.js +38 -0
- package/esm/hooks/useLetterSpacing.js +10 -0
- package/esm/hooks/useLineHeight.js +10 -0
- package/esm/hooks/useNavList.js +10 -7
- package/esm/hooks/useTheme.js +19 -11
- package/esm/hooks/useTogglableNav.js +292 -0
- package/esm/hooks/{useTogglableSections.js → useTogglableTab.js} +2 -8
- package/esm/hooks/useVariantVars.js +30 -0
- package/esm/index.js +1 -1
- package/esm/layouts/Basic/__stories__/Default.js +2 -2
- package/esm/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
- package/esm/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
- package/esm/registry.js +36 -14
- package/esm/typography/NormalText/__stories__/FontSizes.js +18 -6
- package/esm/typography/NormalText/__stories__/FontWeight.js +3 -1
- package/esm/typography/NormalText/__stories__/Variants.js +3 -1
- package/hooks/useFontSize.d.ts +6 -0
- package/hooks/useFontSize.js +23 -0
- package/hooks/useHighlightLinks.d.ts +8 -0
- package/hooks/useHighlightLinks.js +52 -0
- package/hooks/useLetterSpacing.d.ts +6 -0
- package/hooks/useLetterSpacing.js +23 -0
- package/hooks/useLineHeight.d.ts +6 -0
- package/hooks/useLineHeight.js +23 -0
- package/hooks/useNavList.d.ts +2 -2
- package/hooks/useNavList.js +11 -8
- package/hooks/useTheme.d.ts +4 -4
- package/hooks/useTheme.js +19 -12
- package/hooks/useTogglableNav.d.ts +25 -0
- package/hooks/useTogglableNav.js +305 -0
- package/hooks/{useTogglableSections.d.ts → useTogglableTab.d.ts} +4 -3
- package/hooks/{useTogglableSections.js → useTogglableTab.js} +3 -9
- package/hooks/useVariantVars.d.ts +11 -0
- package/hooks/useVariantVars.js +41 -0
- package/layouts/Basic/__stories__/Default.js +2 -2
- package/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
- package/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
- package/package.json +3 -3
- package/registry.d.ts +18 -7
- package/registry.js +49 -16
- package/src/admin/AccessibilityMenu/index.tsx +14 -0
- package/src/admin/AutoComplete/index.tsx +2 -2
- package/src/admin/Chip/index.tsx +1 -0
- package/src/admin/Drawer/__stories__/Default.tsx +23 -9
- package/src/admin/Dropdown/__stories__/AlignRight.tsx +2 -2
- package/src/admin/Dropdown/__stories__/Default.tsx +2 -2
- package/src/admin/Dropdown/__stories__/PlacementTop.tsx +2 -2
- package/src/admin/FilterSection/index.tsx +1 -2
- package/src/admin/Modal/index.tsx +43 -39
- package/src/admin/Pagination/__stories__/Default.tsx +4 -4
- package/src/admin/Pagination/__stories__/PaginationSmall.tsx +2 -2
- package/src/app/Footer/__stories__/FooterAllInclusive.tsx +1 -1
- package/src/app/Footer/__stories__/FooterWithSecondaryNavigation.tsx +1 -1
- package/src/app/Header/__stories__/WithNavigation.tsx +8 -8
- package/src/app/QrCodeScanner/__stories__/Default.tsx +2 -2
- package/src/app/QrCodeViewer/index.tsx +16 -14
- package/src/app/ThemeOptionsForm/index.tsx +220 -0
- package/src/app/{ThemeSelectorOptions → ThemePaletteForm}/index.tsx +3 -3
- package/src/app/index.ts +2 -1
- package/src/core/Accordion/index.tsx +5 -11
- package/src/core/Divider/__stories__/Default.tsx +5 -5
- package/src/core/ErrorSummary/__stories__/Default.tsx +2 -2
- package/src/core/ErrorSummary/__stories__/LinkedToCheckbox.tsx +2 -2
- package/src/core/ErrorSummary/__stories__/LinkedToField.tsx +2 -2
- package/src/core/ErrorSummary/__stories__/LinkedToInput.tsx +2 -2
- package/src/core/Link/__stories__/DarkBackground.tsx +2 -3
- package/src/core/Link/__stories__/DarkBackgroundNoUnderline.tsx +2 -3
- package/src/core/NavList/NavList.stories.js +3 -1
- package/src/core/NavList/NavList.stories.playwright.json +6 -6
- package/src/core/NavList/NavListAuto/NavListAuto.tsx +34 -0
- package/src/core/NavList/{NavListBase.tsx → NavListAuto/NavListBaseAuto.tsx} +2 -2
- package/src/core/NavList/{NavListContext.tsx → NavListAuto/NavListContextAuto.tsx} +26 -11
- package/src/core/NavList/NavListAuto/NavListItemAnchorAuto.tsx +41 -0
- package/src/core/NavList/NavListAuto/NavListItemAuto.tsx +51 -0
- package/src/core/NavList/NavListAuto/NavListItemButtonAuto.tsx +53 -0
- package/src/core/NavList/NavListAuto/NavListMenuAuto.tsx +51 -0
- package/src/core/NavList/NavListAuto/NavListSubMenuAuto.tsx +32 -0
- package/src/core/NavList/NavListItem.tsx +15 -9
- package/src/core/NavList/NavListItemBase.tsx +3 -3
- package/src/core/NavList/NavMenuContainerContentList.tsx +63 -1
- package/src/core/NavList/__stories__/Default.tsx +23 -8
- package/src/core/NavList/__stories__/NavHorizontalLayout.tsx +24 -8
- package/src/core/NavList/__stories__/NavListEpathlaExample.tsx +46 -25
- package/src/core/NavList/__stories__/NavListHorizontalAutoExample.tsx +65 -0
- package/src/core/NavList/__stories__/NavListSecondaryAutoExample.tsx +284 -0
- package/src/core/NavList/__stories__/NavListVerticalAutoExample.tsx +65 -0
- package/src/core/NavList/index.tsx +2 -5
- package/src/core/NavList/types.tsx +23 -9
- package/src/core/Tabs/__stories__/Default.tsx +5 -5
- package/src/core/Tabs/index.tsx +5 -9
- package/src/hooks/useFontSize.ts +32 -0
- package/src/hooks/useHighlightLinks.ts +45 -0
- package/src/hooks/useLetterSpacing.ts +27 -0
- package/src/hooks/useLineHeight.ts +31 -0
- package/src/hooks/useNavList.ts +5 -7
- package/src/hooks/useTheme.ts +28 -20
- package/src/hooks/useTogglableNav.tsx +294 -0
- package/src/hooks/{useTogglableSections.tsx → useTogglableTab.tsx} +12 -13
- package/src/hooks/useVariantVars.ts +35 -0
- package/src/layouts/Basic/__stories__/Default.tsx +3 -3
- package/src/layouts/Basic/__stories__/MultipleRowsLayout.tsx +8 -8
- package/src/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.tsx +6 -6
- package/src/registry.js +36 -14
- package/src/typography/NormalText/__stories__/FontSizes.tsx +6 -6
- package/src/typography/NormalText/__stories__/FontWeight.tsx +1 -1
- package/src/typography/NormalText/__stories__/Variants.tsx +1 -1
- package/typography/NormalText/__stories__/FontSizes.js +18 -6
- package/typography/NormalText/__stories__/FontWeight.js +3 -1
- package/typography/NormalText/__stories__/Variants.js +3 -1
- package/app/ThemeSelectorOptions/index.d.ts +0 -2
- package/core/NavList/NavListSubMenu.d.ts +0 -8
- package/core/NavList/__stories__/NavListAutoExample.d.ts +0 -2
- package/core/NavList/__stories__/NavListAutoExample.js +0 -63
- package/es/core/NavList/NavListItemAuto.js +0 -40
- package/es/core/NavList/NavListSubMenu.js +0 -25
- package/es/core/NavList/__stories__/NavListAutoExample.js +0 -48
- package/esm/core/NavList/NavListItemAuto.js +0 -40
- package/esm/core/NavList/NavListSubMenu.js +0 -25
- package/esm/core/NavList/__stories__/NavListAutoExample.js +0 -48
- package/src/core/NavList/NavListAuto.tsx +0 -20
- package/src/core/NavList/NavListItemAuto.tsx +0 -41
- package/src/core/NavList/NavListSubMenu.tsx +0 -28
- package/src/core/NavList/__stories__/NavListAutoExample.tsx +0 -53
- /package/core/NavList/{NavListAuto.d.ts → NavListAuto/NavListAuto.d.ts} +0 -0
- /package/core/NavList/{NavListItemAuto.d.ts → NavListAuto/NavListItemAuto.d.ts} +0 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import { useRef, useState, useCallback, useMemo } from 'react';
|
|
5
|
+
export function useTogglableNav(_ref) {
|
|
6
|
+
var toggleProperty = _ref.toggleProperty,
|
|
7
|
+
toggleOpenClose = _ref.toggleOpenClose,
|
|
8
|
+
toggleParentOpen = _ref.toggleParentOpen,
|
|
9
|
+
onToggleProperty = _ref.onToggleProperty,
|
|
10
|
+
initial = _ref.initial,
|
|
11
|
+
ariaNavigation = _ref.ariaNavigation,
|
|
12
|
+
toggleHook = _ref.toggleHook;
|
|
13
|
+
|
|
14
|
+
var _useState = useState(initial || {}),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
opened = _useState2[0],
|
|
17
|
+
setOpened = _useState2[1];
|
|
18
|
+
|
|
19
|
+
var registered = useRef({});
|
|
20
|
+
var openedKeys = useRef([]);
|
|
21
|
+
var registerButtonRef = useCallback(function (el) {
|
|
22
|
+
if (!el) return;
|
|
23
|
+
var key = el.getAttribute('aria-controls');
|
|
24
|
+
if (registered.current[key]) return;
|
|
25
|
+
registered.current[key] = {
|
|
26
|
+
el: el,
|
|
27
|
+
type: 'button'
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
var registerLinkRef = useCallback(function (el) {
|
|
31
|
+
if (!el) return;
|
|
32
|
+
var key = el.getAttribute('aria-controls');
|
|
33
|
+
if (registered.current[key]) return;
|
|
34
|
+
registered.current[key] = {
|
|
35
|
+
el: el,
|
|
36
|
+
type: 'link'
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
var toggle = useCallback(function (e) {
|
|
40
|
+
var key = e.currentTarget.getAttribute('aria-controls');
|
|
41
|
+
var selected = e.currentTarget.getAttribute('aria-selected') === 'true';
|
|
42
|
+
|
|
43
|
+
if (toggleHook) {
|
|
44
|
+
toggleHook(key);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
|
|
49
|
+
if (toggleOpenClose) {
|
|
50
|
+
if (toggleParentOpen) {
|
|
51
|
+
var items = key.split('__');
|
|
52
|
+
var currentKey = items.slice(0, items.length).join('__');
|
|
53
|
+
var totalKeys = items.map(function (_, index) {
|
|
54
|
+
return items.slice(0, index + 1).join('__');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (!selected && !openedKeys.current.includes(currentKey)) {
|
|
58
|
+
openedKeys.current.push(currentKey);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (selected && openedKeys.current.includes(currentKey)) {
|
|
62
|
+
openedKeys.current = openedKeys.current.filter(function (k) {
|
|
63
|
+
return k !== currentKey;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
setOpened(function (_) {
|
|
68
|
+
return _extends({}, totalKeys.reduce(function (acc, cur) {
|
|
69
|
+
acc[cur] = cur === currentKey ? !selected : true;
|
|
70
|
+
return acc;
|
|
71
|
+
}, {}));
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
setOpened(_defineProperty({}, key, !selected));
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
setOpened(_defineProperty({}, key, true));
|
|
78
|
+
}
|
|
79
|
+
}, []);
|
|
80
|
+
|
|
81
|
+
var getMenuItems = function getMenuItems(element) {
|
|
82
|
+
if (element) {
|
|
83
|
+
if ((element === null || element === void 0 ? void 0 : element.role) === 'menuitem') {
|
|
84
|
+
return element;
|
|
85
|
+
} else {
|
|
86
|
+
var childrenArray = Array.from(element === null || element === void 0 ? void 0 : element.children);
|
|
87
|
+
var menuItemsArray = [];
|
|
88
|
+
childrenArray.forEach(function (child) {
|
|
89
|
+
var menuItem = getMenuItems(child);
|
|
90
|
+
|
|
91
|
+
if (menuItem && !menuItemsArray.includes(menuItem)) {
|
|
92
|
+
menuItemsArray.push(menuItem);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return menuItemsArray.flatMap(function (x) {
|
|
96
|
+
return x;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return null;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var findChildren = function findChildren(parent, items) {
|
|
105
|
+
return items ? items.filter(function (child) {
|
|
106
|
+
return child.slice(0, child.lastIndexOf('__')) === parent;
|
|
107
|
+
}) : items;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
var findParent = function findParent(child, items) {
|
|
111
|
+
var parent = child.slice(0, child.lastIndexOf('__'));
|
|
112
|
+
return items.find(function (item) {
|
|
113
|
+
return item === parent;
|
|
114
|
+
}) ? parent : null;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var findSiblings = function findSiblings(key, items) {
|
|
118
|
+
var parent = key.slice(0, key.lastIndexOf('__'));
|
|
119
|
+
|
|
120
|
+
if (key.lastIndexOf('__') > 0) {
|
|
121
|
+
return items.filter(function (child) {
|
|
122
|
+
return child.slice(0, child.lastIndexOf('__')) === parent;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return items.filter(function (child) {
|
|
127
|
+
return !child.includes('__');
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
var findLeftSibling = function findLeftSibling(key, items) {
|
|
132
|
+
var siblings = findSiblings(key, items);
|
|
133
|
+
|
|
134
|
+
if (siblings.length > 0) {
|
|
135
|
+
var keyIndex = siblings.findIndex(function (item) {
|
|
136
|
+
return item === key;
|
|
137
|
+
});
|
|
138
|
+
return keyIndex > 0 ? siblings[keyIndex - 1] : null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return null;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
var findRightSibling = function findRightSibling(key, items) {
|
|
145
|
+
var siblings = findSiblings(key, items);
|
|
146
|
+
|
|
147
|
+
if (siblings.length > 0) {
|
|
148
|
+
var keyIndex = siblings.findIndex(function (item) {
|
|
149
|
+
return item === key;
|
|
150
|
+
});
|
|
151
|
+
return keyIndex < siblings.length - 1 ? siblings[keyIndex + 1] : null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return null;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
var getOpenItemChildren = function getOpenItemChildren(currentItem, items) {
|
|
158
|
+
var itemChildrenArray = [];
|
|
159
|
+
var itemChildren = findChildren(currentItem, items);
|
|
160
|
+
itemChildren.forEach(function (item) {
|
|
161
|
+
if (openedKeys.current.includes(item)) {
|
|
162
|
+
itemChildrenArray.push(item);
|
|
163
|
+
var internChildren = getOpenItemChildren(item, items);
|
|
164
|
+
|
|
165
|
+
if (internChildren.length > 0) {
|
|
166
|
+
itemChildrenArray.push(internChildren);
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
itemChildrenArray.push(item);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
return itemChildrenArray.flatMap(function (x) {
|
|
173
|
+
return x;
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
var onKeyDown = useCallback(function (e) {
|
|
178
|
+
var _document$querySelect;
|
|
179
|
+
|
|
180
|
+
var orientation = (_document$querySelect = document.querySelector("[aria-orientation]")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute('aria-orientation');
|
|
181
|
+
var key = e.target.getAttribute('aria-controls');
|
|
182
|
+
var keys = Object.entries(registered.current).map(function (_ref2) {
|
|
183
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
184
|
+
entryKey = _ref3[0],
|
|
185
|
+
_ = _ref3[1];
|
|
186
|
+
|
|
187
|
+
return entryKey;
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
var handleArrowRight = function handleArrowRight() {
|
|
191
|
+
var arrowRightItem = findRightSibling(key, keys);
|
|
192
|
+
|
|
193
|
+
if (arrowRightItem) {
|
|
194
|
+
registered.current[arrowRightItem].el.focus();
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
var handleArrowLeft = function handleArrowLeft() {
|
|
199
|
+
var arrowLeftItem = findLeftSibling(key, keys);
|
|
200
|
+
|
|
201
|
+
if (arrowLeftItem) {
|
|
202
|
+
registered.current[arrowLeftItem].el.focus();
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
switch (e.key) {
|
|
207
|
+
case 'ArrowRight':
|
|
208
|
+
handleArrowRight();
|
|
209
|
+
break;
|
|
210
|
+
|
|
211
|
+
case 'ArrowDown':
|
|
212
|
+
var openItem = getOpenItemChildren(key, keys);
|
|
213
|
+
var arrowDownItems = findChildren(key, openItem);
|
|
214
|
+
var menuItems = getMenuItems(document.getElementById(key));
|
|
215
|
+
|
|
216
|
+
if (arrowDownItems.length > 0) {
|
|
217
|
+
registered.current[arrowDownItems[0]].el.focus();
|
|
218
|
+
} else {
|
|
219
|
+
if (orientation === 'vertical') {
|
|
220
|
+
var _document$activeEleme;
|
|
221
|
+
|
|
222
|
+
if (((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.getAttribute('aria-selected')) === 'true' && menuItems && menuItems.length > 0) {
|
|
223
|
+
menuItems[0].focus();
|
|
224
|
+
} else {
|
|
225
|
+
handleArrowRight();
|
|
226
|
+
}
|
|
227
|
+
} else {
|
|
228
|
+
if (menuItems && menuItems.length > 0) {
|
|
229
|
+
menuItems[0].focus();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
break;
|
|
235
|
+
|
|
236
|
+
case 'ArrowLeft':
|
|
237
|
+
handleArrowLeft();
|
|
238
|
+
break;
|
|
239
|
+
|
|
240
|
+
case 'ArrowUp':
|
|
241
|
+
if (orientation === 'vertical') {
|
|
242
|
+
handleArrowLeft();
|
|
243
|
+
} else {
|
|
244
|
+
var arrowUpItem = findParent(key, keys);
|
|
245
|
+
|
|
246
|
+
if (arrowUpItem) {
|
|
247
|
+
registered.current[arrowUpItem].el.focus();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
break;
|
|
252
|
+
|
|
253
|
+
case ' ':
|
|
254
|
+
case 'Enter':
|
|
255
|
+
if (registered.current[key].type === 'link') {
|
|
256
|
+
registered.current[key].el.click();
|
|
257
|
+
} else {
|
|
258
|
+
toggle(e);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
}, []);
|
|
264
|
+
var registerButton = useCallback(function (key) {
|
|
265
|
+
var _extends2;
|
|
266
|
+
|
|
267
|
+
var isOpen = !!opened[key];
|
|
268
|
+
return _extends((_extends2 = {
|
|
269
|
+
ref: registerButtonRef
|
|
270
|
+
}, _defineProperty(_extends2, toggleProperty, isOpen), _defineProperty(_extends2, onToggleProperty, toggle), _defineProperty(_extends2, 'aria-controls', "".concat(key)), _extends2), ariaNavigation && {
|
|
271
|
+
onKeyDown: onKeyDown
|
|
272
|
+
});
|
|
273
|
+
}, [opened]);
|
|
274
|
+
var registerLink = useCallback(function (key) {
|
|
275
|
+
return _extends({
|
|
276
|
+
ref: registerLinkRef,
|
|
277
|
+
'aria-controls': "".concat(key)
|
|
278
|
+
}, ariaNavigation && {
|
|
279
|
+
onKeyDown: onKeyDown
|
|
280
|
+
});
|
|
281
|
+
}, [opened]);
|
|
282
|
+
return useMemo(function () {
|
|
283
|
+
return {
|
|
284
|
+
registerButton: registerButton,
|
|
285
|
+
registerLink: registerLink,
|
|
286
|
+
registered: registered,
|
|
287
|
+
opened: opened,
|
|
288
|
+
toggle: toggle,
|
|
289
|
+
setOpened: setOpened
|
|
290
|
+
};
|
|
291
|
+
}, [opened]);
|
|
292
|
+
}
|
|
@@ -4,10 +4,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
|
|
5
5
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
6
6
|
import { useRef, useState, useCallback, useMemo } from 'react';
|
|
7
|
-
export function
|
|
7
|
+
export function useTogglableTab(_ref) {
|
|
8
8
|
var toggleProperty = _ref.toggleProperty,
|
|
9
9
|
singleOpen = _ref.singleOpen,
|
|
10
|
-
toggleOpenClose = _ref.toggleOpenClose,
|
|
11
10
|
onToggleProperty = _ref.onToggleProperty,
|
|
12
11
|
initial = _ref.initial,
|
|
13
12
|
firstOpen = _ref.firstOpen,
|
|
@@ -34,7 +33,6 @@ export function useTogglableSections(_ref) {
|
|
|
34
33
|
}, []);
|
|
35
34
|
var toggle = useCallback(function (e) {
|
|
36
35
|
var key = e.currentTarget.getAttribute('aria-controls');
|
|
37
|
-
var selected = e.currentTarget.getAttribute('aria-selected') === 'true';
|
|
38
36
|
|
|
39
37
|
if (toggleHook) {
|
|
40
38
|
toggleHook(key);
|
|
@@ -43,11 +41,7 @@ export function useTogglableSections(_ref) {
|
|
|
43
41
|
e.preventDefault();
|
|
44
42
|
|
|
45
43
|
if (singleOpen) {
|
|
46
|
-
|
|
47
|
-
setOpened(_defineProperty({}, key, !selected));
|
|
48
|
-
} else {
|
|
49
|
-
setOpened(_defineProperty({}, key, true));
|
|
50
|
-
}
|
|
44
|
+
setOpened(_defineProperty({}, key, true));
|
|
51
45
|
} else {
|
|
52
46
|
setOpened(function (prev) {
|
|
53
47
|
return _extends({}, prev, _defineProperty({}, key, !prev[key]));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
function useVariantVars(_ref) {
|
|
5
|
+
var name = _ref.name,
|
|
6
|
+
variables = _ref.variables,
|
|
7
|
+
variants = _ref.variants;
|
|
8
|
+
var root = document.documentElement;
|
|
9
|
+
var storedValue = localStorage.getItem("--theme-".concat(name));
|
|
10
|
+
|
|
11
|
+
var _useState = useState(storedValue || variants[0]),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
value = _useState2[0],
|
|
14
|
+
setValue = _useState2[1];
|
|
15
|
+
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
localStorage.setItem("--theme-".concat(name), value);
|
|
18
|
+
variables.forEach(function (varName) {
|
|
19
|
+
root.style.setProperty("--".concat(varName), "var(--".concat(varName, "-").concat(value, ")"));
|
|
20
|
+
});
|
|
21
|
+
}, [value]);
|
|
22
|
+
|
|
23
|
+
function changeValue(v) {
|
|
24
|
+
setValue(v);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return [value, changeValue];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default useVariantVars;
|
package/esm/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Layout } from '@digigov/ui/layouts/Basic';
|
|
3
|
-
import {
|
|
3
|
+
import { Container } from '@digigov/ui/layouts/Basic/Container';
|
|
4
4
|
import { Main } from '@digigov/ui/layouts/Basic/Main';
|
|
5
5
|
import { Heading, Paragraph } from '@digigov/ui/typography';
|
|
6
6
|
|
|
7
|
-
var _ref = /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(
|
|
7
|
+
var _ref = /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Main, null, /*#__PURE__*/React.createElement(Heading, null, "Two-thirds column"), /*#__PURE__*/React.createElement(Paragraph, null, "This is a paragraph inside a two-thirds wide column"))));
|
|
8
8
|
|
|
9
9
|
export var Default = function Default() {
|
|
10
10
|
return _ref;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Layout } from '@digigov/ui/layouts/Basic';
|
|
3
|
-
import {
|
|
3
|
+
import { Container } from '@digigov/ui/layouts/Basic/Container';
|
|
4
4
|
import { Main } from '@digigov/ui/layouts/Basic/Main';
|
|
5
|
-
import {
|
|
5
|
+
import { Aside } from '@digigov/ui/layouts/Basic/Aside';
|
|
6
6
|
import { Heading, Paragraph } from '@digigov/ui/typography';
|
|
7
7
|
|
|
8
|
-
var _ref = /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(
|
|
8
|
+
var _ref = /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Main, null, /*#__PURE__*/React.createElement(Heading, null, "Two-thirds column"), /*#__PURE__*/React.createElement(Paragraph, null, "This is a paragraph inside a two-thirds wide column"))), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Main, null, /*#__PURE__*/React.createElement(Heading, null, "Two-thirds column"), /*#__PURE__*/React.createElement(Paragraph, null, "This is a paragraph inside a two-thirds wide column")), /*#__PURE__*/React.createElement(Aside, null, /*#__PURE__*/React.createElement(Heading, {
|
|
9
9
|
size: "m"
|
|
10
10
|
}, "One-third-column"), /*#__PURE__*/React.createElement(Paragraph, null, "This is a paragraph inside a one-third wide column"))));
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Layout } from '@digigov/ui/layouts/Basic';
|
|
3
|
-
import {
|
|
3
|
+
import { Container } from '@digigov/ui/layouts/Basic/Container';
|
|
4
4
|
import { Main } from '@digigov/ui/layouts/Basic/Main';
|
|
5
|
-
import {
|
|
5
|
+
import { Aside } from '@digigov/ui/layouts/Basic/Aside';
|
|
6
6
|
import { Heading, Paragraph } from '@digigov/ui/typography';
|
|
7
7
|
|
|
8
|
-
var _ref = /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(
|
|
8
|
+
var _ref = /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Main, null, /*#__PURE__*/React.createElement(Heading, null, "Two-thirds column"), /*#__PURE__*/React.createElement(Paragraph, null, "This is a paragraph inside a two-thirds wide column")), /*#__PURE__*/React.createElement(Aside, null, /*#__PURE__*/React.createElement(Heading, {
|
|
9
9
|
size: "m"
|
|
10
10
|
}, "One-third-column"), /*#__PURE__*/React.createElement(Paragraph, null, "This is a paragraph inside a one-third wide column"))));
|
|
11
11
|
|
package/esm/registry.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _digigov_ui_admin_AccessibilityMenu from '@digigov/ui/admin/AccessibilityMenu';
|
|
1
2
|
import * as _digigov_ui_admin_AdminLayout from '@digigov/ui/admin/AdminLayout';
|
|
2
3
|
import * as _digigov_ui_admin_AutoComplete from '@digigov/ui/admin/AutoComplete';
|
|
3
4
|
import * as _digigov_ui_admin_AutoComplete_Status from '@digigov/ui/admin/AutoComplete/Status';
|
|
@@ -55,7 +56,8 @@ import * as _digigov_ui_app_QrCodeViewer from '@digigov/ui/app/QrCodeViewer';
|
|
|
55
56
|
import * as _digigov_ui_app_QrCodeViewer_qrcodegen from '@digigov/ui/app/QrCodeViewer/qrcodegen';
|
|
56
57
|
import * as _digigov_ui_app_QrCodeViewer_types from '@digigov/ui/app/QrCodeViewer/types';
|
|
57
58
|
import * as _digigov_ui_app_QrCodeViewer_utils from '@digigov/ui/app/QrCodeViewer/utils';
|
|
58
|
-
import * as
|
|
59
|
+
import * as _digigov_ui_app_ThemeOptionsForm from '@digigov/ui/app/ThemeOptionsForm';
|
|
60
|
+
import * as _digigov_ui_app_ThemePaletteForm from '@digigov/ui/app/ThemePaletteForm';
|
|
59
61
|
import * as _digigov_ui_core_Accordion from '@digigov/ui/core/Accordion';
|
|
60
62
|
import * as _digigov_ui_core_BackLink from '@digigov/ui/core/BackLink';
|
|
61
63
|
import * as _digigov_ui_core_Base from '@digigov/ui/core/Base';
|
|
@@ -93,15 +95,18 @@ import * as _digigov_ui_core_Masthead from '@digigov/ui/core/Masthead';
|
|
|
93
95
|
import * as _digigov_ui_core_NavList from '@digigov/ui/core/NavList';
|
|
94
96
|
import * as _digigov_ui_core_NavList_Nav from '@digigov/ui/core/NavList/Nav';
|
|
95
97
|
import * as _digigov_ui_core_NavList_NavList from '@digigov/ui/core/NavList/NavList';
|
|
96
|
-
import * as
|
|
97
|
-
import * as
|
|
98
|
-
import * as
|
|
98
|
+
import * as _digigov_ui_core_NavList_NavListAuto_NavListAuto from '@digigov/ui/core/NavList/NavListAuto/NavListAuto';
|
|
99
|
+
import * as _digigov_ui_core_NavList_NavListAuto_NavListBaseAuto from '@digigov/ui/core/NavList/NavListAuto/NavListBaseAuto';
|
|
100
|
+
import * as _digigov_ui_core_NavList_NavListAuto_NavListContextAuto from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
|
|
101
|
+
import * as _digigov_ui_core_NavList_NavListAuto_NavListItemAnchorAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAnchorAuto';
|
|
102
|
+
import * as _digigov_ui_core_NavList_NavListAuto_NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
|
|
103
|
+
import * as _digigov_ui_core_NavList_NavListAuto_NavListItemButtonAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemButtonAuto';
|
|
104
|
+
import * as _digigov_ui_core_NavList_NavListAuto_NavListMenuAuto from '@digigov/ui/core/NavList/NavListAuto/NavListMenuAuto';
|
|
105
|
+
import * as _digigov_ui_core_NavList_NavListAuto_NavListSubMenuAuto from '@digigov/ui/core/NavList/NavListAuto/NavListSubMenuAuto';
|
|
99
106
|
import * as _digigov_ui_core_NavList_NavListItem from '@digigov/ui/core/NavList/NavListItem';
|
|
100
|
-
import * as _digigov_ui_core_NavList_NavListItemAuto from '@digigov/ui/core/NavList/NavListItemAuto';
|
|
101
107
|
import * as _digigov_ui_core_NavList_NavListItemBase from '@digigov/ui/core/NavList/NavListItemBase';
|
|
102
108
|
import * as _digigov_ui_core_NavList_NavListItemButton from '@digigov/ui/core/NavList/NavListItemButton';
|
|
103
109
|
import * as _digigov_ui_core_NavList_NavListItemLink from '@digigov/ui/core/NavList/NavListItemLink';
|
|
104
|
-
import * as _digigov_ui_core_NavList_NavListSubMenu from '@digigov/ui/core/NavList/NavListSubMenu';
|
|
105
110
|
import * as _digigov_ui_core_NavList_NavMenu from '@digigov/ui/core/NavList/NavMenu';
|
|
106
111
|
import * as _digigov_ui_core_NavList_NavMenuContainer from '@digigov/ui/core/NavList/NavMenuContainer';
|
|
107
112
|
import * as _digigov_ui_core_NavList_NavMenuContainerContent from '@digigov/ui/core/NavList/NavMenuContainerContent';
|
|
@@ -145,13 +150,19 @@ import * as _digigov_ui_govgr_images_minedu_logo_base64 from '@digigov/ui/govgr/
|
|
|
145
150
|
import * as _digigov_ui_govgr_images_minedu_logo_black_base64 from '@digigov/ui/govgr/images/minedu-logo-black-base64';
|
|
146
151
|
import * as _digigov_ui_govgr from '@digigov/ui/govgr';
|
|
147
152
|
import * as _digigov_ui_hooks_useDebounce from '@digigov/ui/hooks/useDebounce';
|
|
153
|
+
import * as _digigov_ui_hooks_useFontSize from '@digigov/ui/hooks/useFontSize';
|
|
154
|
+
import * as _digigov_ui_hooks_useHighlightLinks from '@digigov/ui/hooks/useHighlightLinks';
|
|
148
155
|
import * as _digigov_ui_hooks_useKeypress from '@digigov/ui/hooks/useKeypress';
|
|
149
156
|
import * as _digigov_ui_hooks_useLatest from '@digigov/ui/hooks/useLatest';
|
|
157
|
+
import * as _digigov_ui_hooks_useLetterSpacing from '@digigov/ui/hooks/useLetterSpacing';
|
|
158
|
+
import * as _digigov_ui_hooks_useLineHeight from '@digigov/ui/hooks/useLineHeight';
|
|
150
159
|
import * as _digigov_ui_hooks_useNavList from '@digigov/ui/hooks/useNavList';
|
|
151
160
|
import * as _digigov_ui_hooks_useOutdatedBrowserCheck from '@digigov/ui/hooks/useOutdatedBrowserCheck';
|
|
152
161
|
import * as _digigov_ui_hooks_useSearch from '@digigov/ui/hooks/useSearch';
|
|
153
162
|
import * as _digigov_ui_hooks_useTheme from '@digigov/ui/hooks/useTheme';
|
|
154
|
-
import * as
|
|
163
|
+
import * as _digigov_ui_hooks_useTogglableNav from '@digigov/ui/hooks/useTogglableNav';
|
|
164
|
+
import * as _digigov_ui_hooks_useTogglableTab from '@digigov/ui/hooks/useTogglableTab';
|
|
165
|
+
import * as _digigov_ui_hooks_useVariantVars from '@digigov/ui/hooks/useVariantVars';
|
|
155
166
|
import * as _digigov_ui from '@digigov/ui';
|
|
156
167
|
import * as _digigov_ui_layouts_Basic_Aside from '@digigov/ui/layouts/Basic/Aside';
|
|
157
168
|
import * as _digigov_ui_layouts_Basic_Bottom from '@digigov/ui/layouts/Basic/Bottom';
|
|
@@ -198,6 +209,7 @@ function lazyImport(pkgImport) {
|
|
|
198
209
|
}
|
|
199
210
|
|
|
200
211
|
export default {
|
|
212
|
+
'@digigov/ui/admin/AccessibilityMenu': lazyImport(_digigov_ui_admin_AccessibilityMenu),
|
|
201
213
|
'@digigov/ui/admin/AdminLayout': lazyImport(_digigov_ui_admin_AdminLayout),
|
|
202
214
|
'@digigov/ui/admin/AutoComplete': lazyImport(_digigov_ui_admin_AutoComplete),
|
|
203
215
|
'@digigov/ui/admin/AutoComplete/Status': lazyImport(_digigov_ui_admin_AutoComplete_Status),
|
|
@@ -255,7 +267,8 @@ export default {
|
|
|
255
267
|
'@digigov/ui/app/QrCodeViewer/qrcodegen': lazyImport(_digigov_ui_app_QrCodeViewer_qrcodegen),
|
|
256
268
|
'@digigov/ui/app/QrCodeViewer/types': lazyImport(_digigov_ui_app_QrCodeViewer_types),
|
|
257
269
|
'@digigov/ui/app/QrCodeViewer/utils': lazyImport(_digigov_ui_app_QrCodeViewer_utils),
|
|
258
|
-
'@digigov/ui/app/
|
|
270
|
+
'@digigov/ui/app/ThemeOptionsForm': lazyImport(_digigov_ui_app_ThemeOptionsForm),
|
|
271
|
+
'@digigov/ui/app/ThemePaletteForm': lazyImport(_digigov_ui_app_ThemePaletteForm),
|
|
259
272
|
'@digigov/ui/core/Accordion': lazyImport(_digigov_ui_core_Accordion),
|
|
260
273
|
'@digigov/ui/core/BackLink': lazyImport(_digigov_ui_core_BackLink),
|
|
261
274
|
'@digigov/ui/core/Base': lazyImport(_digigov_ui_core_Base),
|
|
@@ -293,15 +306,18 @@ export default {
|
|
|
293
306
|
'@digigov/ui/core/NavList': lazyImport(_digigov_ui_core_NavList),
|
|
294
307
|
'@digigov/ui/core/NavList/Nav': lazyImport(_digigov_ui_core_NavList_Nav),
|
|
295
308
|
'@digigov/ui/core/NavList/NavList': lazyImport(_digigov_ui_core_NavList_NavList),
|
|
296
|
-
'@digigov/ui/core/NavList/NavListAuto': lazyImport(
|
|
297
|
-
'@digigov/ui/core/NavList/
|
|
298
|
-
'@digigov/ui/core/NavList/
|
|
309
|
+
'@digigov/ui/core/NavList/NavListAuto/NavListAuto': lazyImport(_digigov_ui_core_NavList_NavListAuto_NavListAuto),
|
|
310
|
+
'@digigov/ui/core/NavList/NavListAuto/NavListBaseAuto': lazyImport(_digigov_ui_core_NavList_NavListAuto_NavListBaseAuto),
|
|
311
|
+
'@digigov/ui/core/NavList/NavListAuto/NavListContextAuto': lazyImport(_digigov_ui_core_NavList_NavListAuto_NavListContextAuto),
|
|
312
|
+
'@digigov/ui/core/NavList/NavListAuto/NavListItemAnchorAuto': lazyImport(_digigov_ui_core_NavList_NavListAuto_NavListItemAnchorAuto),
|
|
313
|
+
'@digigov/ui/core/NavList/NavListAuto/NavListItemAuto': lazyImport(_digigov_ui_core_NavList_NavListAuto_NavListItemAuto),
|
|
314
|
+
'@digigov/ui/core/NavList/NavListAuto/NavListItemButtonAuto': lazyImport(_digigov_ui_core_NavList_NavListAuto_NavListItemButtonAuto),
|
|
315
|
+
'@digigov/ui/core/NavList/NavListAuto/NavListMenuAuto': lazyImport(_digigov_ui_core_NavList_NavListAuto_NavListMenuAuto),
|
|
316
|
+
'@digigov/ui/core/NavList/NavListAuto/NavListSubMenuAuto': lazyImport(_digigov_ui_core_NavList_NavListAuto_NavListSubMenuAuto),
|
|
299
317
|
'@digigov/ui/core/NavList/NavListItem': lazyImport(_digigov_ui_core_NavList_NavListItem),
|
|
300
|
-
'@digigov/ui/core/NavList/NavListItemAuto': lazyImport(_digigov_ui_core_NavList_NavListItemAuto),
|
|
301
318
|
'@digigov/ui/core/NavList/NavListItemBase': lazyImport(_digigov_ui_core_NavList_NavListItemBase),
|
|
302
319
|
'@digigov/ui/core/NavList/NavListItemButton': lazyImport(_digigov_ui_core_NavList_NavListItemButton),
|
|
303
320
|
'@digigov/ui/core/NavList/NavListItemLink': lazyImport(_digigov_ui_core_NavList_NavListItemLink),
|
|
304
|
-
'@digigov/ui/core/NavList/NavListSubMenu': lazyImport(_digigov_ui_core_NavList_NavListSubMenu),
|
|
305
321
|
'@digigov/ui/core/NavList/NavMenu': lazyImport(_digigov_ui_core_NavList_NavMenu),
|
|
306
322
|
'@digigov/ui/core/NavList/NavMenuContainer': lazyImport(_digigov_ui_core_NavList_NavMenuContainer),
|
|
307
323
|
'@digigov/ui/core/NavList/NavMenuContainerContent': lazyImport(_digigov_ui_core_NavList_NavMenuContainerContent),
|
|
@@ -345,13 +361,19 @@ export default {
|
|
|
345
361
|
'@digigov/ui/govgr/images/minedu-logo-black-base64': lazyImport(_digigov_ui_govgr_images_minedu_logo_black_base64),
|
|
346
362
|
'@digigov/ui/govgr': lazyImport(_digigov_ui_govgr),
|
|
347
363
|
'@digigov/ui/hooks/useDebounce': lazyImport(_digigov_ui_hooks_useDebounce),
|
|
364
|
+
'@digigov/ui/hooks/useFontSize': lazyImport(_digigov_ui_hooks_useFontSize),
|
|
365
|
+
'@digigov/ui/hooks/useHighlightLinks': lazyImport(_digigov_ui_hooks_useHighlightLinks),
|
|
348
366
|
'@digigov/ui/hooks/useKeypress': lazyImport(_digigov_ui_hooks_useKeypress),
|
|
349
367
|
'@digigov/ui/hooks/useLatest': lazyImport(_digigov_ui_hooks_useLatest),
|
|
368
|
+
'@digigov/ui/hooks/useLetterSpacing': lazyImport(_digigov_ui_hooks_useLetterSpacing),
|
|
369
|
+
'@digigov/ui/hooks/useLineHeight': lazyImport(_digigov_ui_hooks_useLineHeight),
|
|
350
370
|
'@digigov/ui/hooks/useNavList': lazyImport(_digigov_ui_hooks_useNavList),
|
|
351
371
|
'@digigov/ui/hooks/useOutdatedBrowserCheck': lazyImport(_digigov_ui_hooks_useOutdatedBrowserCheck),
|
|
352
372
|
'@digigov/ui/hooks/useSearch': lazyImport(_digigov_ui_hooks_useSearch),
|
|
353
373
|
'@digigov/ui/hooks/useTheme': lazyImport(_digigov_ui_hooks_useTheme),
|
|
354
|
-
'@digigov/ui/hooks/
|
|
374
|
+
'@digigov/ui/hooks/useTogglableNav': lazyImport(_digigov_ui_hooks_useTogglableNav),
|
|
375
|
+
'@digigov/ui/hooks/useTogglableTab': lazyImport(_digigov_ui_hooks_useTogglableTab),
|
|
376
|
+
'@digigov/ui/hooks/useVariantVars': lazyImport(_digigov_ui_hooks_useVariantVars),
|
|
355
377
|
'@digigov/ui': lazyImport(_digigov_ui),
|
|
356
378
|
'@digigov/ui/layouts/Basic/Aside': lazyImport(_digigov_ui_layouts_Basic_Aside),
|
|
357
379
|
'@digigov/ui/layouts/Basic/Bottom': lazyImport(_digigov_ui_layouts_Basic_Bottom),
|
|
@@ -6,37 +6,49 @@ var _ref = /*#__PURE__*/React.createElement(NormalText, {
|
|
|
6
6
|
fontSize: "14"
|
|
7
7
|
}, " govgr-!-font-size-14 ");
|
|
8
8
|
|
|
9
|
-
var _ref2 = /*#__PURE__*/React.createElement(SectionBreak,
|
|
9
|
+
var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, {
|
|
10
|
+
visible: false
|
|
11
|
+
});
|
|
10
12
|
|
|
11
13
|
var _ref3 = /*#__PURE__*/React.createElement(NormalText, {
|
|
12
14
|
fontSize: "16"
|
|
13
15
|
}, " govgr-!-font-size-16 ");
|
|
14
16
|
|
|
15
|
-
var _ref4 = /*#__PURE__*/React.createElement(SectionBreak,
|
|
17
|
+
var _ref4 = /*#__PURE__*/React.createElement(SectionBreak, {
|
|
18
|
+
visible: false
|
|
19
|
+
});
|
|
16
20
|
|
|
17
21
|
var _ref5 = /*#__PURE__*/React.createElement(NormalText, {
|
|
18
22
|
fontSize: "19"
|
|
19
23
|
}, " govgr-!-font-size-19 ");
|
|
20
24
|
|
|
21
|
-
var _ref6 = /*#__PURE__*/React.createElement(SectionBreak,
|
|
25
|
+
var _ref6 = /*#__PURE__*/React.createElement(SectionBreak, {
|
|
26
|
+
visible: false
|
|
27
|
+
});
|
|
22
28
|
|
|
23
29
|
var _ref7 = /*#__PURE__*/React.createElement(NormalText, {
|
|
24
30
|
fontSize: "24"
|
|
25
31
|
}, " govgr-!-font-size-24 ");
|
|
26
32
|
|
|
27
|
-
var _ref8 = /*#__PURE__*/React.createElement(SectionBreak,
|
|
33
|
+
var _ref8 = /*#__PURE__*/React.createElement(SectionBreak, {
|
|
34
|
+
visible: false
|
|
35
|
+
});
|
|
28
36
|
|
|
29
37
|
var _ref9 = /*#__PURE__*/React.createElement(NormalText, {
|
|
30
38
|
fontSize: "30"
|
|
31
39
|
}, " govgr-!-font-size-30 ");
|
|
32
40
|
|
|
33
|
-
var _ref10 = /*#__PURE__*/React.createElement(SectionBreak,
|
|
41
|
+
var _ref10 = /*#__PURE__*/React.createElement(SectionBreak, {
|
|
42
|
+
visible: false
|
|
43
|
+
});
|
|
34
44
|
|
|
35
45
|
var _ref11 = /*#__PURE__*/React.createElement(NormalText, {
|
|
36
46
|
fontSize: "48"
|
|
37
47
|
}, " govgr-!-font-size-48 ");
|
|
38
48
|
|
|
39
|
-
var _ref12 = /*#__PURE__*/React.createElement(SectionBreak,
|
|
49
|
+
var _ref12 = /*#__PURE__*/React.createElement(SectionBreak, {
|
|
50
|
+
visible: false
|
|
51
|
+
});
|
|
40
52
|
|
|
41
53
|
var _ref13 = /*#__PURE__*/React.createElement(NormalText, {
|
|
42
54
|
fontSize: "72"
|
|
@@ -6,7 +6,9 @@ var _ref = /*#__PURE__*/React.createElement(NormalText, {
|
|
|
6
6
|
fontWeight: "regular"
|
|
7
7
|
}, " govgr-!-font-weight-regular ");
|
|
8
8
|
|
|
9
|
-
var _ref2 = /*#__PURE__*/React.createElement(SectionBreak,
|
|
9
|
+
var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, {
|
|
10
|
+
visible: false
|
|
11
|
+
});
|
|
10
12
|
|
|
11
13
|
var _ref3 = /*#__PURE__*/React.createElement(NormalText, {
|
|
12
14
|
fontWeight: "bold"
|
|
@@ -6,7 +6,9 @@ var _ref = /*#__PURE__*/React.createElement(NormalText, {
|
|
|
6
6
|
variant: "small"
|
|
7
7
|
}, " govgr-variant-small ");
|
|
8
8
|
|
|
9
|
-
var _ref2 = /*#__PURE__*/React.createElement(SectionBreak,
|
|
9
|
+
var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, {
|
|
10
|
+
visible: false
|
|
11
|
+
});
|
|
10
12
|
|
|
11
13
|
var _ref3 = /*#__PURE__*/React.createElement(NormalText, {
|
|
12
14
|
variant: "lead"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseVariantVarsResult } from "@digigov/ui/hooks/useVariantVars";
|
|
2
|
+
export declare type FontSizeOptions = 'default' | 'large';
|
|
3
|
+
export declare type StoredFontSizeOptions = FontSizeOptions | null;
|
|
4
|
+
export declare type UseFontSizeResult = UseVariantVarsResult<FontSizeOptions>;
|
|
5
|
+
export declare const useFontSize: () => UseFontSizeResult;
|
|
6
|
+
export default useFontSize;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useFontSize = exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _useVariantVars = _interopRequireDefault(require("@digigov/ui/hooks/useVariantVars"));
|
|
11
|
+
|
|
12
|
+
var useFontSize = function useFontSize() {
|
|
13
|
+
var config = {
|
|
14
|
+
'name': 'font-size',
|
|
15
|
+
'variables': ['text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl', 'text-3xl', 'text-4xl', 'text-5xl'],
|
|
16
|
+
'variants': ['default', 'large']
|
|
17
|
+
};
|
|
18
|
+
return (0, _useVariantVars["default"])(config);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.useFontSize = useFontSize;
|
|
22
|
+
var _default = useFontSize;
|
|
23
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare type HighlightLinksOptions = 'default' | 'highlight';
|
|
2
|
+
export declare type StoredHighlightLinksOptions = HighlightLinksOptions | null;
|
|
3
|
+
export declare type UseHighlightLinksResult = [
|
|
4
|
+
highlightLinks: HighlightLinksOptions,
|
|
5
|
+
changeHighlightLinks: (selectedHighlightLinks: HighlightLinksOptions) => void
|
|
6
|
+
];
|
|
7
|
+
export declare const useHighlightLinks: () => UseHighlightLinksResult;
|
|
8
|
+
export default useHighlightLinks;
|