@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ErrorSummary } from '@digigov/ui/core/ErrorSummary';
|
|
3
|
-
import {
|
|
3
|
+
import { Heading } from '@digigov/ui/typography/Heading';
|
|
4
4
|
import { Link } from '@digigov/ui/core/Link';
|
|
5
5
|
import { Hint } from '@digigov/ui/typography/Hint';
|
|
6
6
|
import { ErrorMessage } from '@digigov/ui/core/ErrorMessage';
|
|
@@ -10,8 +10,8 @@ import { FieldContainer, Fieldset, FieldsetLegend } from '@digigov/ui/core/Field
|
|
|
10
10
|
|
|
11
11
|
var _ref = /*#__PURE__*/React.createElement("div", {
|
|
12
12
|
className: "example"
|
|
13
|
-
}, /*#__PURE__*/React.createElement(ErrorSummary, null, /*#__PURE__*/React.createElement(
|
|
14
|
-
size: "
|
|
13
|
+
}, /*#__PURE__*/React.createElement(ErrorSummary, null, /*#__PURE__*/React.createElement(Heading, {
|
|
14
|
+
size: "s"
|
|
15
15
|
}, "\u03A5\u03C0\u03AE\u03C1\u03BE\u03B5 \u03BA\u03AC\u03C0\u03BF\u03B9\u03BF \u03C0\u03C1\u03CC\u03B2\u03BB\u03B7\u03BC\u03B1"), /*#__PURE__*/React.createElement(Link, {
|
|
16
16
|
href: "#passport-date"
|
|
17
17
|
}, "\u0397 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BA\u03B4\u03BF\u03C3\u03B7\u03C2 \u03C4\u03BF\u03C5 \u03B4\u03B9\u03B1\u03B2\u03B1\u03C4\u03B7\u03C1\u03AF\u03BF\u03C5 \u03C3\u03B1\u03C2 \u03B8\u03B1 \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C3\u03C4\u03BF \u03C0\u03B1\u03C1\u03B5\u03BB\u03B8\u03CC\u03BD.")), /*#__PURE__*/React.createElement(FieldContainer, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ErrorSummary } from '@digigov/ui/core/ErrorSummary';
|
|
3
|
-
import {
|
|
3
|
+
import { Heading } from '@digigov/ui/typography/Heading';
|
|
4
4
|
import { Link } from '@digigov/ui/core/Link';
|
|
5
5
|
import { TextInput } from '@digigov/ui/core/TextInput';
|
|
6
6
|
import { FieldContainer } from '@digigov/ui/core/FieldContainer';
|
|
@@ -12,8 +12,8 @@ import { VisuallyHidden } from '@digigov/ui/core/VisuallyHidden';
|
|
|
12
12
|
|
|
13
13
|
var _ref = /*#__PURE__*/React.createElement("div", {
|
|
14
14
|
className: "example"
|
|
15
|
-
}, /*#__PURE__*/React.createElement(ErrorSummary, null, /*#__PURE__*/React.createElement(
|
|
16
|
-
size: "
|
|
15
|
+
}, /*#__PURE__*/React.createElement(ErrorSummary, null, /*#__PURE__*/React.createElement(Heading, {
|
|
16
|
+
size: "s"
|
|
17
17
|
}, "\u03A5\u03C0\u03AE\u03C1\u03BE\u03B5 \u03BA\u03AC\u03C0\u03BF\u03B9\u03BF \u03C0\u03C1\u03CC\u03B2\u03BB\u03B7\u03BC\u03B1"), /*#__PURE__*/React.createElement(Link, {
|
|
18
18
|
href: "#business-name"
|
|
19
19
|
}, "\u03A0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C3\u03C5\u03BC\u03C0\u03BB\u03B7\u03C1\u03CE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03CC\u03BD\u03BF\u03BC\u03B1 \u03B5\u03C0\u03B9\u03C7\u03B5\u03AF\u03C1\u03B7\u03C3\u03B7\u03C2")), /*#__PURE__*/React.createElement(FieldContainer, {
|
|
@@ -3,11 +3,15 @@ import { Link } from '@digigov/ui/core/Link';
|
|
|
3
3
|
import { Masthead } from '@digigov/ui/layouts/Basic/Masthead';
|
|
4
4
|
import { SectionBreak } from '@digigov/ui/core/SectionBreak';
|
|
5
5
|
|
|
6
|
-
var _ref = /*#__PURE__*/React.createElement(Masthead, null, /*#__PURE__*/React.createElement(SectionBreak,
|
|
6
|
+
var _ref = /*#__PURE__*/React.createElement(Masthead, null, /*#__PURE__*/React.createElement(SectionBreak, {
|
|
7
|
+
visible: false
|
|
8
|
+
}), /*#__PURE__*/React.createElement(Link, {
|
|
7
9
|
"aria-label": "\u03C0\u03BB\u03BF\u03B7\u03B3\u03B7\u03B8\u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03B9\u03C3\u03C4\u03BF\u03C3\u03B5\u03BB\u03AF\u03B4\u03B1 \u03C4\u03BF govgr",
|
|
8
10
|
role: "link",
|
|
9
11
|
href: "#"
|
|
10
|
-
}, "govgr link"), /*#__PURE__*/React.createElement(SectionBreak,
|
|
12
|
+
}, "govgr link"), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
13
|
+
visible: false
|
|
14
|
+
}));
|
|
11
15
|
|
|
12
16
|
export var DarkBackground = function DarkBackground() {
|
|
13
17
|
return _ref;
|
|
@@ -3,12 +3,16 @@ import { Link } from '@digigov/ui/core/Link';
|
|
|
3
3
|
import { Masthead } from '@digigov/ui/layouts/Basic/Masthead';
|
|
4
4
|
import { SectionBreak } from '@digigov/ui/core/SectionBreak';
|
|
5
5
|
|
|
6
|
-
var _ref = /*#__PURE__*/React.createElement(Masthead, null, /*#__PURE__*/React.createElement(SectionBreak,
|
|
6
|
+
var _ref = /*#__PURE__*/React.createElement(Masthead, null, /*#__PURE__*/React.createElement(SectionBreak, {
|
|
7
|
+
visible: false
|
|
8
|
+
}), /*#__PURE__*/React.createElement(Link, {
|
|
7
9
|
"aria-label": "\u03C0\u03BB\u03BF\u03B7\u03B3\u03B7\u03B8\u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03B9\u03C3\u03C4\u03BF\u03C3\u03B5\u03BB\u03AF\u03B4\u03B1 \u03C4\u03BF govgr",
|
|
8
10
|
role: "link",
|
|
9
11
|
href: "#",
|
|
10
12
|
underline: false
|
|
11
|
-
}, "govgr link"), /*#__PURE__*/React.createElement(SectionBreak,
|
|
13
|
+
}, "govgr link"), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
14
|
+
visible: false
|
|
15
|
+
}));
|
|
12
16
|
|
|
13
17
|
export var DarkBackgroundNoUnderline = function DarkBackgroundNoUnderline() {
|
|
14
18
|
return _ref;
|
|
@@ -7,6 +7,8 @@ export default {
|
|
|
7
7
|
displayName: 'NavList'
|
|
8
8
|
};
|
|
9
9
|
export * from '@digigov/ui/core/NavList/__stories__/Default';
|
|
10
|
-
export * from '@digigov/ui/core/NavList/__stories__/
|
|
10
|
+
export * from '@digigov/ui/core/NavList/__stories__/NavListHorizontalAutoExample';
|
|
11
|
+
export * from '@digigov/ui/core/NavList/__stories__/NavListVerticalAutoExample';
|
|
12
|
+
export * from '@digigov/ui/core/NavList/__stories__/NavListSecondaryAutoExample';
|
|
11
13
|
export * from '@digigov/ui/core/NavList/__stories__/NavListEpathlaExample';
|
|
12
14
|
export * from '@digigov/ui/core/NavList/__stories__/NavHorizontalLayout';
|
|
@@ -6,26 +6,26 @@
|
|
|
6
6
|
{
|
|
7
7
|
"actions": [
|
|
8
8
|
{
|
|
9
|
-
"name": "
|
|
9
|
+
"name": "hover",
|
|
10
10
|
"args": {
|
|
11
11
|
"selector": "html>body>div:nth-child(5)>nav>ul>li:nth-child(3)>button"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
|
-
"id": "
|
|
16
|
-
"title": "
|
|
15
|
+
"id": "dHQxEQCIJ4bJ",
|
|
16
|
+
"title": "Hover item"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"actions": [
|
|
20
20
|
{
|
|
21
|
-
"name": "
|
|
21
|
+
"name": "click",
|
|
22
22
|
"args": {
|
|
23
23
|
"selector": "html>body>div:nth-child(5)>nav>ul>li:nth-child(3)>button"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
],
|
|
27
|
-
"id": "
|
|
28
|
-
"title": "
|
|
27
|
+
"id": "WMfgyO3E_9S_",
|
|
28
|
+
"title": "Open sub menu"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
31
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["layout", "openSubMenus", "links", "role"];
|
|
3
|
+
var _excluded = ["layout", "border", "fixed", "openSubMenus", "links", "role"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { NavListProviderAuto } from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
|
|
6
|
+
import { NavListBaseAuto } from '@digigov/ui/core/NavList/NavListAuto/NavListBaseAuto';
|
|
7
7
|
export var NavListAuto = function NavListAuto(_ref) {
|
|
8
8
|
var layout = _ref.layout,
|
|
9
|
+
border = _ref.border,
|
|
10
|
+
fixed = _ref.fixed,
|
|
9
11
|
_ref$openSubMenus = _ref.openSubMenus,
|
|
10
12
|
openSubMenus = _ref$openSubMenus === void 0 ? false : _ref$openSubMenus,
|
|
11
13
|
_ref$links = _ref.links,
|
|
@@ -13,12 +15,16 @@ export var NavListAuto = function NavListAuto(_ref) {
|
|
|
13
15
|
role = _ref.role,
|
|
14
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
17
|
|
|
16
|
-
return /*#__PURE__*/React.createElement(
|
|
18
|
+
return /*#__PURE__*/React.createElement(NavListProviderAuto, {
|
|
17
19
|
openSubMenus: openSubMenus,
|
|
18
20
|
layout: layout,
|
|
21
|
+
border: border,
|
|
22
|
+
fixed: fixed,
|
|
19
23
|
links: links
|
|
20
|
-
}, /*#__PURE__*/React.createElement(
|
|
24
|
+
}, /*#__PURE__*/React.createElement(NavListBaseAuto, _extends({
|
|
21
25
|
layout: layout,
|
|
26
|
+
border: border,
|
|
27
|
+
fixed: fixed,
|
|
22
28
|
role: role
|
|
23
29
|
}, props)));
|
|
24
30
|
};
|
|
@@ -4,7 +4,7 @@ var _excluded = ["className", "children", "floating", "layout", "subMenu", "role
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Nav from '@digigov/ui/core/NavList/Nav';
|
|
6
6
|
import NavList from '@digigov/ui/core/NavList/NavList';
|
|
7
|
-
export var
|
|
7
|
+
export var NavListBaseAuto = function NavListBaseAuto(_ref) {
|
|
8
8
|
var className = _ref.className,
|
|
9
9
|
children = _ref.children,
|
|
10
10
|
floating = _ref.floating,
|
|
@@ -16,7 +16,9 @@ export var NavListBase = function NavListBase(_ref) {
|
|
|
16
16
|
return /*#__PURE__*/React.createElement(Nav, _extends({
|
|
17
17
|
open: true,
|
|
18
18
|
layout: layout
|
|
19
|
-
}, props
|
|
19
|
+
}, props, {
|
|
20
|
+
"aria-orientation": layout
|
|
21
|
+
}), /*#__PURE__*/React.createElement(NavList, {
|
|
20
22
|
layout: layout
|
|
21
23
|
}, children));
|
|
22
24
|
};
|
|
@@ -2,17 +2,21 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import { useNavList } from '@digigov/ui/hooks/useNavList';
|
|
4
4
|
import React, { createContext, useEffect, useState } from 'react';
|
|
5
|
-
export var
|
|
5
|
+
export var NavListContextAuto = /*#__PURE__*/createContext({
|
|
6
6
|
layout: 'horizontal',
|
|
7
|
+
border: true,
|
|
8
|
+
fixed: true,
|
|
7
9
|
openSubMenus: false,
|
|
8
10
|
links: [],
|
|
9
11
|
activeLink: {},
|
|
10
12
|
activeSubMenu: []
|
|
11
13
|
});
|
|
12
14
|
var TRAILING_SLASH = /\/$/gm;
|
|
13
|
-
export var
|
|
15
|
+
export var NavListProviderAuto = function NavListProviderAuto(_ref) {
|
|
14
16
|
var children = _ref.children,
|
|
15
17
|
layout = _ref.layout,
|
|
18
|
+
border = _ref.border,
|
|
19
|
+
fixed = _ref.fixed,
|
|
16
20
|
_ref$openSubMenus = _ref.openSubMenus,
|
|
17
21
|
openSubMenus = _ref$openSubMenus === void 0 ? false : _ref$openSubMenus,
|
|
18
22
|
_ref$showDividers = _ref.showDividers,
|
|
@@ -32,10 +36,15 @@ export var NavListProvider = function NavListProvider(_ref) {
|
|
|
32
36
|
|
|
33
37
|
var _useNavList = useNavList(),
|
|
34
38
|
container = _useNavList.container,
|
|
35
|
-
|
|
39
|
+
registerButton = _useNavList.registerButton,
|
|
40
|
+
registerLink = _useNavList.registerLink;
|
|
36
41
|
|
|
37
|
-
var
|
|
38
|
-
return _extends({},
|
|
42
|
+
var setRegisterButton = function setRegisterButton(name) {
|
|
43
|
+
return _extends({}, registerButton(name));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var setRegisterLink = function setRegisterLink(name) {
|
|
47
|
+
return _extends({}, registerLink(name));
|
|
39
48
|
}; // TODO: Cleanup unused props
|
|
40
49
|
|
|
41
50
|
|
|
@@ -75,18 +84,21 @@ export var NavListProvider = function NavListProvider(_ref) {
|
|
|
75
84
|
}
|
|
76
85
|
};
|
|
77
86
|
|
|
78
|
-
return /*#__PURE__*/React.createElement(
|
|
87
|
+
return /*#__PURE__*/React.createElement(NavListContextAuto.Provider, {
|
|
79
88
|
value: {
|
|
80
89
|
openSubMenus: openSubMenus,
|
|
81
90
|
layout: layout,
|
|
91
|
+
border: border,
|
|
92
|
+
fixed: fixed,
|
|
82
93
|
showDividers: showDividers,
|
|
83
94
|
links: links,
|
|
84
95
|
activeLink: activeLink,
|
|
85
96
|
activeSubMenu: activeSubMenu,
|
|
86
97
|
onSubMenuActive: onSubMenuActive,
|
|
87
98
|
container: container,
|
|
88
|
-
|
|
99
|
+
setRegisterButton: setRegisterButton,
|
|
100
|
+
setRegisterLink: setRegisterLink
|
|
89
101
|
}
|
|
90
102
|
}, children);
|
|
91
103
|
};
|
|
92
|
-
export default
|
|
104
|
+
export default NavListContextAuto;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["name", "href", "active", "layout", "children"];
|
|
4
|
+
import React, { useContext } from 'react';
|
|
5
|
+
import { NavListItemLink } from '@digigov/ui/core/NavList/NavListItemLink';
|
|
6
|
+
import NavListContextAuto from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
|
|
7
|
+
import NavListItem from '@digigov/react-core/NavListItem';
|
|
8
|
+
export var NavListItemAnchorAuto = function NavListItemAnchorAuto(_ref) {
|
|
9
|
+
var _container;
|
|
10
|
+
|
|
11
|
+
var name = _ref.name,
|
|
12
|
+
href = _ref.href,
|
|
13
|
+
active = _ref.active,
|
|
14
|
+
layout = _ref.layout,
|
|
15
|
+
children = _ref.children,
|
|
16
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
|
|
18
|
+
var _useContext = useContext(NavListContextAuto),
|
|
19
|
+
container = _useContext.container,
|
|
20
|
+
setRegisterLink = _useContext.setRegisterLink;
|
|
21
|
+
|
|
22
|
+
return /*#__PURE__*/React.createElement(NavListItem, {
|
|
23
|
+
layout: layout
|
|
24
|
+
}, setRegisterLink && /*#__PURE__*/React.createElement(NavListItemLink, _extends({
|
|
25
|
+
href: href,
|
|
26
|
+
active: active || container && ((_container = container(name)) === null || _container === void 0 ? void 0 : _container.active)
|
|
27
|
+
}, props, setRegisterLink(name)), children));
|
|
28
|
+
};
|
|
29
|
+
export default NavListItemAnchorAuto;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["item", "children", "role"];
|
|
4
|
+
import React, { useContext } from 'react';
|
|
5
|
+
import Divider from '@digigov/react-core/SectionBreak';
|
|
6
|
+
import NavListContextAuto from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
|
|
7
|
+
import NavItemAnchorAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAnchorAuto';
|
|
8
|
+
import NavItemButtonAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemButtonAuto';
|
|
9
|
+
import { NavListItem } from '@digigov/ui/core/NavList/NavListItem';
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(Divider, null);
|
|
12
|
+
|
|
13
|
+
export var NavListItemAuto = function NavListItemAuto(_ref) {
|
|
14
|
+
var _container;
|
|
15
|
+
|
|
16
|
+
var item = _ref.item,
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
role = _ref.role,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
|
|
21
|
+
var _useContext = useContext(NavListContextAuto),
|
|
22
|
+
layout = _useContext.layout,
|
|
23
|
+
showDividers = _useContext.showDividers,
|
|
24
|
+
container = _useContext.container,
|
|
25
|
+
setRegisterButton = _useContext.setRegisterButton;
|
|
26
|
+
|
|
27
|
+
var itemName = item !== null && item !== void 0 && item.name ? item.name : item === null || item === void 0 ? void 0 : item.label;
|
|
28
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement(NavListItem, _extends({
|
|
29
|
+
layout: layout
|
|
30
|
+
}, props), children) : item !== null && item !== void 0 && item.menu || item !== null && item !== void 0 && item.subMenu ? /*#__PURE__*/React.createElement(NavItemButtonAuto, {
|
|
31
|
+
item: item,
|
|
32
|
+
name: itemName,
|
|
33
|
+
active: container && ((_container = container(itemName)) === null || _container === void 0 ? void 0 : _container.active),
|
|
34
|
+
onSelect: setRegisterButton,
|
|
35
|
+
layout: layout
|
|
36
|
+
}, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React.createElement(NavItemAnchorAuto, {
|
|
37
|
+
href: item === null || item === void 0 ? void 0 : item.href,
|
|
38
|
+
name: itemName,
|
|
39
|
+
layout: layout
|
|
40
|
+
}, item === null || item === void 0 ? void 0 : item.label), showDividers && _ref2);
|
|
41
|
+
};
|
|
42
|
+
export default NavListItemAuto;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import NavListItemButton from '@digigov/ui/core/NavList/NavListItemButton';
|
|
4
|
+
import NavItemSubMenuAuto from '@digigov/ui/core/NavList/NavListAuto/NavListSubMenuAuto';
|
|
5
|
+
import NavItemMenuAuto from '@digigov/ui/core/NavList/NavListAuto/NavListMenuAuto';
|
|
6
|
+
import NavListItem from '@digigov/ui/core/NavList/NavListItem';
|
|
7
|
+
export var NavListItemButtonAuto = function NavListItemButtonAuto(_ref) {
|
|
8
|
+
var _item$menu, _item$menu2;
|
|
9
|
+
|
|
10
|
+
var item = _ref.item,
|
|
11
|
+
name = _ref.name,
|
|
12
|
+
active = _ref.active,
|
|
13
|
+
onSelect = _ref.onSelect,
|
|
14
|
+
layout = _ref.layout,
|
|
15
|
+
children = _ref.children;
|
|
16
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, onSelect && /*#__PURE__*/React.createElement(NavListItem, {
|
|
17
|
+
layout: layout
|
|
18
|
+
}, /*#__PURE__*/React.createElement(NavListItemButton, _extends({
|
|
19
|
+
active: active
|
|
20
|
+
}, onSelect(name)), children)), item !== null && item !== void 0 && item.subMenu ? /*#__PURE__*/React.createElement(NavItemSubMenuAuto, {
|
|
21
|
+
items: item === null || item === void 0 ? void 0 : item.subMenu,
|
|
22
|
+
open: active,
|
|
23
|
+
layout: layout
|
|
24
|
+
}) : /*#__PURE__*/React.createElement(NavItemMenuAuto, {
|
|
25
|
+
subMenu: item === null || item === void 0 ? void 0 : (_item$menu = item.menu) === null || _item$menu === void 0 ? void 0 : _item$menu.links,
|
|
26
|
+
title: item === null || item === void 0 ? void 0 : (_item$menu2 = item.menu) === null || _item$menu2 === void 0 ? void 0 : _item$menu2.title,
|
|
27
|
+
active: active,
|
|
28
|
+
layout: layout,
|
|
29
|
+
id: name
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
export default NavListItemButtonAuto;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import NavMenu from '@digigov/ui/core/NavList/NavMenu';
|
|
3
|
+
import NavMenuContainer from '@digigov/ui/core/NavList/NavMenuContainer';
|
|
4
|
+
import NavMenuContainerTitle from '@digigov/ui/core/NavList/NavMenuContainerTitle';
|
|
5
|
+
import NavMenuContainerContent from '@digigov/ui/core/NavList/NavMenuContainerContent';
|
|
6
|
+
import NavMenuContainerContentList from '@digigov/ui/core/NavList/NavMenuContainerContentList';
|
|
7
|
+
import NavMenuContainerContentListItem from '@digigov/ui/core/NavList/NavMenuContainerContentListItem';
|
|
8
|
+
import { Link } from '@digigov/ui/core';
|
|
9
|
+
export var NavListMenuAuto = function NavListMenuAuto(_ref) {
|
|
10
|
+
var layout = _ref.layout,
|
|
11
|
+
active = _ref.active,
|
|
12
|
+
title = _ref.title,
|
|
13
|
+
subMenu = _ref.subMenu,
|
|
14
|
+
id = _ref.id;
|
|
15
|
+
return /*#__PURE__*/React.createElement(NavMenu, {
|
|
16
|
+
layout: layout,
|
|
17
|
+
active: active,
|
|
18
|
+
id: id
|
|
19
|
+
}, /*#__PURE__*/React.createElement(NavMenuContainer, {
|
|
20
|
+
layout: layout,
|
|
21
|
+
paddingLeft: 5,
|
|
22
|
+
paddingRight: 5
|
|
23
|
+
}, /*#__PURE__*/React.createElement(NavMenuContainerTitle, {
|
|
24
|
+
layout: layout
|
|
25
|
+
}, title), /*#__PURE__*/React.createElement(NavMenuContainerContent, null, /*#__PURE__*/React.createElement(NavMenuContainerContentList, {
|
|
26
|
+
role: "menu",
|
|
27
|
+
layout: layout
|
|
28
|
+
}, subMenu === null || subMenu === void 0 ? void 0 : subMenu.map(function (item, index) {
|
|
29
|
+
return /*#__PURE__*/React.createElement(NavMenuContainerContentListItem, {
|
|
30
|
+
role: "presentation",
|
|
31
|
+
key: index
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
33
|
+
role: "menuitem",
|
|
34
|
+
id: item.name,
|
|
35
|
+
href: item.href
|
|
36
|
+
}, item.label));
|
|
37
|
+
})))));
|
|
38
|
+
};
|
|
39
|
+
export default NavListMenuAuto;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["items", "open", "layout"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Nav } from '@digigov/ui/core/NavList/Nav';
|
|
6
|
+
import { NavList } from '@digigov/ui/core/NavList/NavList';
|
|
7
|
+
import NavItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
|
|
8
|
+
export var NavListSubMenuAuto = function NavListSubMenuAuto(_ref) {
|
|
9
|
+
var items = _ref.items,
|
|
10
|
+
open = _ref.open,
|
|
11
|
+
layout = _ref.layout,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
|
|
14
|
+
return open ? /*#__PURE__*/React.createElement(Nav, _extends({
|
|
15
|
+
hidden: !open,
|
|
16
|
+
layout: layout
|
|
17
|
+
}, props, {
|
|
18
|
+
"aria-orientation": layout
|
|
19
|
+
}), /*#__PURE__*/React.createElement(NavList, {
|
|
20
|
+
layout: layout
|
|
21
|
+
}, items === null || items === void 0 ? void 0 : items.map(function (subMenuItem, index) {
|
|
22
|
+
return /*#__PURE__*/React.createElement(NavItemAuto, {
|
|
23
|
+
key: index,
|
|
24
|
+
item: subMenuItem
|
|
25
|
+
});
|
|
26
|
+
}))) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
27
|
+
};
|
|
28
|
+
export default NavListSubMenuAuto;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["link", "layout", "
|
|
3
|
+
var _excluded = ["link", "layout", "setRegisterButton", "setRegisterLink", "active", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import NavListItemContainer from '@digigov/react-core/NavListItem';
|
|
6
6
|
import NavListItemButton from '@digigov/ui/core/NavList/NavListItemButton';
|
|
7
7
|
import { NavListItemLink } from '@digigov/ui/core/NavList/NavListItemLink';
|
|
8
8
|
import { isNavListItemLinkInterface, isNavListItemSubMenuInterface } from '@digigov/ui/core/NavList/types';
|
|
9
9
|
export var NavListItem = function NavListItem(_ref) {
|
|
10
10
|
var link = _ref.link,
|
|
11
11
|
layout = _ref.layout,
|
|
12
|
-
|
|
12
|
+
setRegisterButton = _ref.setRegisterButton,
|
|
13
|
+
setRegisterLink = _ref.setRegisterLink,
|
|
13
14
|
active = _ref.active,
|
|
14
15
|
children = _ref.children,
|
|
15
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
17
|
|
|
17
|
-
return /*#__PURE__*/React.createElement(
|
|
18
|
+
return /*#__PURE__*/React.createElement(NavListItemContainer, _extends({
|
|
18
19
|
layout: layout
|
|
19
|
-
}, props), children ? children : isNavListItemSubMenuInterface(link) && link !== null && link !== void 0 && link.subMenu
|
|
20
|
+
}, props), children ? children : isNavListItemSubMenuInterface(link) && link !== null && link !== void 0 && link.subMenu ? /*#__PURE__*/React.createElement(NavListItemButton, setRegisterButton && setRegisterButton(link.name), link === null || link === void 0 ? void 0 : link.label) : isNavListItemLinkInterface(link) && /*#__PURE__*/React.createElement(NavListItemLink, _extends({
|
|
20
21
|
href: link === null || link === void 0 ? void 0 : link.href
|
|
21
|
-
},
|
|
22
|
+
}, setRegisterLink && setRegisterLink(link.name), {
|
|
22
23
|
active: active
|
|
23
|
-
}), link === null || link === void 0 ? void 0 : link.label));
|
|
24
|
+
}, props), link === null || link === void 0 ? void 0 : link.label));
|
|
24
25
|
};
|
|
25
26
|
export default NavListItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["container", "
|
|
3
|
+
var _excluded = ["container", "setRegisterButton", "children", "item", "layout", "role"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Link from '@digigov/ui/core/Link';
|
|
6
6
|
import { isNavListItemLinkInterface } from '@digigov/ui/core/NavList/types';
|
|
@@ -15,7 +15,7 @@ export var NavListItemBase = function NavListItemBase(_ref) {
|
|
|
15
15
|
var _item$subMenu;
|
|
16
16
|
|
|
17
17
|
var container = _ref.container,
|
|
18
|
-
|
|
18
|
+
setRegisterButton = _ref.setRegisterButton,
|
|
19
19
|
children = _ref.children,
|
|
20
20
|
item = _ref.item,
|
|
21
21
|
_ref$layout = _ref.layout,
|
|
@@ -26,7 +26,7 @@ export var NavListItemBase = function NavListItemBase(_ref) {
|
|
|
26
26
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavListItem, _extends({
|
|
27
27
|
layout: layout,
|
|
28
28
|
link: item,
|
|
29
|
-
|
|
29
|
+
setRegisterButton: setRegisterButton,
|
|
30
30
|
role: "menuitem"
|
|
31
31
|
}, props)), /*#__PURE__*/React.createElement(NavMenu, _extends({
|
|
32
32
|
layout: layout
|
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["layout", "children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import NavMenuContainerContentListWrapper from '@digigov/react-core/NavMenuContainerContentList';
|
|
2
6
|
export * from '@digigov/react-core/NavMenuContainerContentList';
|
|
7
|
+
|
|
8
|
+
var focusNavListItem = function focusNavListItem(e, nextItemIndex) {
|
|
9
|
+
var _document$activeEleme;
|
|
10
|
+
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
var id = (_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id;
|
|
13
|
+
var menuItems = Array.from(e.currentTarget.querySelectorAll("[role=menuitem]"));
|
|
14
|
+
var currentItem = menuItems.findIndex(function (x) {
|
|
15
|
+
var _document$activeEleme2;
|
|
16
|
+
|
|
17
|
+
return x.getAttribute('id') === ((_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 ? void 0 : _document$activeEleme2.id);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (currentItem + nextItemIndex > -1 && currentItem + nextItemIndex < menuItems.length) {
|
|
21
|
+
var _menuItems;
|
|
22
|
+
|
|
23
|
+
(_menuItems = menuItems[currentItem + nextItemIndex]) === null || _menuItems === void 0 ? void 0 : _menuItems.focus();
|
|
24
|
+
} else {
|
|
25
|
+
var menuElement = Array.from(document.querySelectorAll("[aria-controls]"));
|
|
26
|
+
|
|
27
|
+
var _currentItem = menuElement.findIndex(function (x) {
|
|
28
|
+
return id === null || id === void 0 ? void 0 : id.includes(x.getAttribute('aria-controls') || '');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (nextItemIndex > 0) {
|
|
32
|
+
var _menuElement;
|
|
33
|
+
|
|
34
|
+
(_menuElement = menuElement[_currentItem + nextItemIndex]) === null || _menuElement === void 0 ? void 0 : _menuElement.focus();
|
|
35
|
+
} else {
|
|
36
|
+
var _menuElement$_current;
|
|
37
|
+
|
|
38
|
+
(_menuElement$_current = menuElement[_currentItem]) === null || _menuElement$_current === void 0 ? void 0 : _menuElement$_current.focus();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export var NavMenuContainerContentList = function NavMenuContainerContentList(_ref) {
|
|
44
|
+
var layout = _ref.layout,
|
|
45
|
+
children = _ref.children,
|
|
46
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
+
|
|
48
|
+
return /*#__PURE__*/React.createElement(NavMenuContainerContentListWrapper, _extends({
|
|
49
|
+
layout: layout
|
|
50
|
+
}, props, {
|
|
51
|
+
onKeyDown: function onKeyDown(event) {
|
|
52
|
+
switch (event.key) {
|
|
53
|
+
case 'ArrowDown':
|
|
54
|
+
case 'ArrowRight':
|
|
55
|
+
focusNavListItem(event, 1);
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
case 'ArrowUp':
|
|
59
|
+
case 'ArrowLeft':
|
|
60
|
+
focusNavListItem(event, -1);
|
|
61
|
+
break;
|
|
62
|
+
|
|
63
|
+
default:
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}), children);
|
|
68
|
+
};
|
|
3
69
|
export default NavMenuContainerContentList;
|
|
@@ -35,18 +35,26 @@ var links = [{
|
|
|
35
35
|
}];
|
|
36
36
|
export var Default = function Default() {
|
|
37
37
|
var layout = 'vertical';
|
|
38
|
+
var border = false;
|
|
38
39
|
|
|
39
40
|
var _useNavList = useNavList(),
|
|
40
41
|
container = _useNavList.container,
|
|
41
|
-
|
|
42
|
+
registerButton = _useNavList.registerButton,
|
|
43
|
+
registerLink = _useNavList.registerLink;
|
|
42
44
|
|
|
43
|
-
var
|
|
44
|
-
return _extends({},
|
|
45
|
+
var setRegisterButton = function setRegisterButton(name) {
|
|
46
|
+
return _extends({}, registerButton(name));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var setRegisterLink = function setRegisterLink(name) {
|
|
50
|
+
return _extends({}, registerLink(name));
|
|
45
51
|
};
|
|
46
52
|
|
|
47
53
|
return /*#__PURE__*/React.createElement(Nav, {
|
|
48
54
|
open: true,
|
|
49
|
-
layout: layout
|
|
55
|
+
layout: layout,
|
|
56
|
+
border: border,
|
|
57
|
+
"aria-orientation": layout
|
|
50
58
|
}, /*#__PURE__*/React.createElement(NavList, {
|
|
51
59
|
layout: layout
|
|
52
60
|
}, links.map(function (item, key) {
|
|
@@ -57,7 +65,8 @@ export var Default = function Default() {
|
|
|
57
65
|
}, /*#__PURE__*/React.createElement(NavListItem, {
|
|
58
66
|
layout: layout,
|
|
59
67
|
link: item,
|
|
60
|
-
|
|
68
|
+
setRegisterButton: setRegisterButton,
|
|
69
|
+
setRegisterLink: setRegisterLink
|
|
61
70
|
}), /*#__PURE__*/React.createElement(NavMenu, _extends({
|
|
62
71
|
layout: layout
|
|
63
72
|
}, container(item.name)), /*#__PURE__*/React.createElement(NavMenuContainer, {
|
|
@@ -67,11 +76,15 @@ export var Default = function Default() {
|
|
|
67
76
|
}, /*#__PURE__*/React.createElement(NavMenuContainerTitle, {
|
|
68
77
|
layout: layout
|
|
69
78
|
}, item.label), /*#__PURE__*/React.createElement(NavMenuContainerContent, null, /*#__PURE__*/React.createElement(NavMenuContainerContentList, {
|
|
79
|
+
role: "menu",
|
|
70
80
|
layout: layout
|
|
71
81
|
}, (_item$subMenu = item.subMenu) === null || _item$subMenu === void 0 ? void 0 : _item$subMenu.map(function (subMenu, menuIndex) {
|
|
72
82
|
return isNavListItemLinkInterface(subMenu) && /*#__PURE__*/React.createElement(NavMenuContainerContentListItem, {
|
|
73
|
-
key: menuIndex
|
|
83
|
+
key: menuIndex,
|
|
84
|
+
role: "presentation"
|
|
74
85
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
86
|
+
role: "menuitem",
|
|
87
|
+
id: subMenu.name,
|
|
75
88
|
href: subMenu.href
|
|
76
89
|
}, subMenu.label));
|
|
77
90
|
}))))));
|