@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
|
@@ -19,7 +19,7 @@ const DEFAULT_HREF_FLAG = true;
|
|
|
19
19
|
const epathlaLinks = [
|
|
20
20
|
{
|
|
21
21
|
name: 'index',
|
|
22
|
-
href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}`,
|
|
22
|
+
href: DEFAULT_HREF_FLAG ? '#index' : `/${LANG}`,
|
|
23
23
|
label: 'Αρχική',
|
|
24
24
|
},
|
|
25
25
|
{
|
|
@@ -108,7 +108,7 @@ const epathlaLinks = [
|
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
name: 'news',
|
|
111
|
-
href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/news`,
|
|
111
|
+
href: DEFAULT_HREF_FLAG ? '#news' : `/${LANG}/news`,
|
|
112
112
|
label: 'Νέα',
|
|
113
113
|
},
|
|
114
114
|
{
|
|
@@ -129,10 +129,14 @@ const epathlaLinks = [
|
|
|
129
129
|
];
|
|
130
130
|
|
|
131
131
|
export const NavListEpathlaExample = () => {
|
|
132
|
-
const { container,
|
|
132
|
+
const { container, registerButton, registerLink } = useNavList();
|
|
133
133
|
|
|
134
|
-
const
|
|
135
|
-
return { ...
|
|
134
|
+
const setRegisterButton = (name: string) => {
|
|
135
|
+
return { ...registerButton(name) };
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const setRegisterLink = (name: string) => {
|
|
139
|
+
return { ...registerLink(name) };
|
|
136
140
|
};
|
|
137
141
|
|
|
138
142
|
return (
|
|
@@ -141,29 +145,46 @@ export const NavListEpathlaExample = () => {
|
|
|
141
145
|
layout={'horizontal'}
|
|
142
146
|
links={epathlaLinks}
|
|
143
147
|
aria-label="Nav list"
|
|
144
|
-
role="menu"
|
|
145
148
|
>
|
|
146
149
|
{epathlaLinks.map((item, key) => (
|
|
147
150
|
<React.Fragment key={key}>
|
|
148
|
-
<NavListItem
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
151
|
+
<NavListItem
|
|
152
|
+
link={item}
|
|
153
|
+
setRegisterButton={setRegisterButton}
|
|
154
|
+
setRegisterLink={setRegisterLink}
|
|
155
|
+
/>
|
|
156
|
+
{item?.subMenu && (
|
|
157
|
+
<NavMenu
|
|
158
|
+
{...container(item.name)}
|
|
159
|
+
aria-expanded={container(item.name)?.active}
|
|
160
|
+
>
|
|
161
|
+
<NavMenuContainer paddingLeft={5} paddingRight={5}>
|
|
162
|
+
<NavMenuContainerTitle>{item.label}</NavMenuContainerTitle>
|
|
163
|
+
<NavMenuContainerContent>
|
|
164
|
+
<NavMenuContainerContentList role="menu">
|
|
165
|
+
{item.subMenu?.map((subMenu, menuIndex) => {
|
|
166
|
+
return (
|
|
167
|
+
isNavListItemLinkInterface(subMenu) && (
|
|
168
|
+
<NavMenuContainerContentListItem
|
|
169
|
+
key={menuIndex}
|
|
170
|
+
role="presentation"
|
|
171
|
+
>
|
|
172
|
+
<Link
|
|
173
|
+
role="menuitem"
|
|
174
|
+
id={`${item.name}-${menuIndex}`}
|
|
175
|
+
href={subMenu.href}
|
|
176
|
+
>
|
|
177
|
+
{subMenu.label}
|
|
178
|
+
</Link>
|
|
179
|
+
</NavMenuContainerContentListItem>
|
|
180
|
+
)
|
|
181
|
+
);
|
|
182
|
+
})}
|
|
183
|
+
</NavMenuContainerContentList>
|
|
184
|
+
</NavMenuContainerContent>
|
|
185
|
+
</NavMenuContainer>
|
|
186
|
+
</NavMenu>
|
|
187
|
+
)}
|
|
167
188
|
</React.Fragment>
|
|
168
189
|
))}
|
|
169
190
|
</NavListAuto>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavListAuto } from '@digigov/ui/core/NavList';
|
|
3
|
+
import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
|
|
4
|
+
|
|
5
|
+
const links = [
|
|
6
|
+
{
|
|
7
|
+
name: 'Nav1',
|
|
8
|
+
label: 'Nav list item 1',
|
|
9
|
+
href: '#',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'Nav2',
|
|
13
|
+
label: 'Nav list item 2',
|
|
14
|
+
menu: {
|
|
15
|
+
title: 'This is the first Menu',
|
|
16
|
+
links: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Nav2.1',
|
|
19
|
+
label: 'link navigation',
|
|
20
|
+
href: '#',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Nav2.2',
|
|
24
|
+
label: 'link navigation',
|
|
25
|
+
href: '#',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Nav2.3',
|
|
29
|
+
label: 'link navigation',
|
|
30
|
+
href: '#',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Nav2.4',
|
|
34
|
+
label: 'link navigation',
|
|
35
|
+
href: '#',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Nav3',
|
|
42
|
+
label: 'Nav list item 3',
|
|
43
|
+
href: '#',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export const NavListHorizontalAutoExample = () => {
|
|
48
|
+
const layout = 'horizontal';
|
|
49
|
+
const border = true;
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<NavListAuto
|
|
53
|
+
layout={layout}
|
|
54
|
+
border={border}
|
|
55
|
+
links={links}
|
|
56
|
+
aria-label="Nav list"
|
|
57
|
+
>
|
|
58
|
+
{links.map((item, key) => (
|
|
59
|
+
<NavListItemAuto key={key} item={item} />
|
|
60
|
+
))}
|
|
61
|
+
</NavListAuto>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default NavListHorizontalAutoExample;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { NavListAuto, NavListLayout } from '@digigov/ui/core/NavList';
|
|
3
|
+
import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
|
|
4
|
+
import FieldContainer, { Fieldset } from '@digigov/ui/core/FieldContainer';
|
|
5
|
+
import Hint from '@digigov/ui/typography/Hint';
|
|
6
|
+
import { RadioContainer, RadioItem } from '@digigov/ui/core/RadioContainer';
|
|
7
|
+
import { SectionBreak } from '@digigov/ui/core/SectionBreak';
|
|
8
|
+
|
|
9
|
+
const links = [
|
|
10
|
+
{
|
|
11
|
+
name: 'Nav1',
|
|
12
|
+
label: 'Item list 1',
|
|
13
|
+
menu: {
|
|
14
|
+
title: 'This is the first Menu',
|
|
15
|
+
links: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Nav1__Nav1.1',
|
|
18
|
+
label: 'link navigation',
|
|
19
|
+
href: '?q=item',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Nav1__Nav1.2',
|
|
23
|
+
label: 'link navigation',
|
|
24
|
+
href: '?q=item',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Nav2',
|
|
31
|
+
label: 'Item list 2',
|
|
32
|
+
menu: {
|
|
33
|
+
title: 'This is the second Menu',
|
|
34
|
+
links: [
|
|
35
|
+
{
|
|
36
|
+
name: 'Nav2__Nav2.1',
|
|
37
|
+
label: 'link navigation',
|
|
38
|
+
href: '?q=item',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Nav2__Nav2.2',
|
|
42
|
+
label: 'link navigation',
|
|
43
|
+
href: '?q=item',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Nav2__Nav2.3',
|
|
47
|
+
label: 'link navigation',
|
|
48
|
+
href: '?q=item',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Nav2__Nav2.4',
|
|
52
|
+
label: 'link navigation',
|
|
53
|
+
href: '?q=item',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Nav2__Nav2.5',
|
|
57
|
+
label: 'link navigation',
|
|
58
|
+
href: '?q=item',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Nav2__Nav2.6',
|
|
62
|
+
label: 'link navigation',
|
|
63
|
+
href: '?q=item',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'Nav2__Nav2.7',
|
|
67
|
+
label: 'link navigation',
|
|
68
|
+
href: '?q=item',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Nav3',
|
|
75
|
+
label: 'Item list 3',
|
|
76
|
+
subMenu: [
|
|
77
|
+
{
|
|
78
|
+
name: 'Nav3__Nav3.1',
|
|
79
|
+
label: 'Item list 4',
|
|
80
|
+
href: '?q=item4',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Nav3__Nav3.2',
|
|
84
|
+
label: 'Item list 5',
|
|
85
|
+
subMenu: [
|
|
86
|
+
{
|
|
87
|
+
name: 'Nav3__Nav3.2__Nav3.2.1',
|
|
88
|
+
label: 'Item list 5.2',
|
|
89
|
+
menu: {
|
|
90
|
+
title: 'This is the fifth Menu',
|
|
91
|
+
links: [
|
|
92
|
+
{
|
|
93
|
+
name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.1',
|
|
94
|
+
label: 'link navigation',
|
|
95
|
+
href: '?q=item',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.2',
|
|
99
|
+
label: 'link navigation',
|
|
100
|
+
href: '?q=item',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.3',
|
|
104
|
+
label: 'link navigation',
|
|
105
|
+
href: '?q=item',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.4',
|
|
109
|
+
label: 'link navigation',
|
|
110
|
+
href: '?q=item',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.5',
|
|
114
|
+
label: 'link navigation',
|
|
115
|
+
href: '?q=item',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.6',
|
|
119
|
+
label: 'link navigation',
|
|
120
|
+
href: '?q=item',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.7',
|
|
124
|
+
label: 'link navigation',
|
|
125
|
+
href: '?q=item',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'Nav3__Nav3.3',
|
|
134
|
+
label: 'Item list 6',
|
|
135
|
+
menu: {
|
|
136
|
+
title: 'This is the sixth Menu',
|
|
137
|
+
links: [
|
|
138
|
+
{
|
|
139
|
+
name: 'Nav3__Nav3.3__Nav3.3.1',
|
|
140
|
+
label: 'link navigation',
|
|
141
|
+
href: '?q=item',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'Nav3__Nav3.3__Nav3.3.2',
|
|
145
|
+
label: 'link navigation',
|
|
146
|
+
href: '?q=item',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'Nav3__Nav3.3__Nav3.3.3',
|
|
150
|
+
label: 'link navigation',
|
|
151
|
+
href: '?q=item',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'Nav3__Nav3.3__Nav3.3.4',
|
|
155
|
+
label: 'link navigation',
|
|
156
|
+
href: '?q=item',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'Nav3__Nav3.3__Nav3.3.5',
|
|
160
|
+
label: 'link navigation',
|
|
161
|
+
href: '?q=item',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'Nav3__Nav3.3__Nav3.3.6',
|
|
165
|
+
label: 'link navigation',
|
|
166
|
+
href: '?q=item',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'Nav3__Nav3.3__Nav3.3.7',
|
|
170
|
+
label: 'link navigation',
|
|
171
|
+
href: '?q=item',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'Nav3__Nav3.3__Nav3.3.8',
|
|
175
|
+
label: 'link navigation',
|
|
176
|
+
href: '?q=item',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: 'Nav3__Nav3.3__Nav3.3.9',
|
|
180
|
+
label: 'link navigation',
|
|
181
|
+
href: '?q=item',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'Nav3__Nav3.3__Nav3.3.10',
|
|
185
|
+
label: 'link navigation',
|
|
186
|
+
href: '?q=item',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'Nav3__Nav3.3__Nav3.3.11',
|
|
190
|
+
label: 'link navigation',
|
|
191
|
+
href: '?q=item',
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
|
|
200
|
+
export const NavListSecondaryAutoExample = () => {
|
|
201
|
+
const [layout, setLayout] = useState<NavListLayout>('horizontal');
|
|
202
|
+
const [border, setBorder] = useState<string>('no');
|
|
203
|
+
const [fixed, setFixed] = useState<string>('no');
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<>
|
|
207
|
+
<NavListAuto
|
|
208
|
+
layout={layout}
|
|
209
|
+
border={border === 'yes'}
|
|
210
|
+
fixed={fixed === 'yes'}
|
|
211
|
+
links={links}
|
|
212
|
+
aria-label="Nav list"
|
|
213
|
+
>
|
|
214
|
+
{links.map((item, key) => (
|
|
215
|
+
<NavListItemAuto key={key} item={item} />
|
|
216
|
+
))}
|
|
217
|
+
</NavListAuto>
|
|
218
|
+
<SectionBreak visible={false} size="l" />
|
|
219
|
+
<FieldContainer>
|
|
220
|
+
<Fieldset aria-describedby="name-hint">
|
|
221
|
+
<Hint id="name-hint">Layout options:</Hint>
|
|
222
|
+
<RadioContainer inline>
|
|
223
|
+
<RadioItem
|
|
224
|
+
defaultChecked={layout === 'vertical'}
|
|
225
|
+
name="changed_display"
|
|
226
|
+
value="vertical"
|
|
227
|
+
onClick={() => setLayout('vertical')}
|
|
228
|
+
>
|
|
229
|
+
Vertical
|
|
230
|
+
</RadioItem>
|
|
231
|
+
<RadioItem
|
|
232
|
+
defaultChecked={layout === 'horizontal'}
|
|
233
|
+
name="changed_display"
|
|
234
|
+
value="horizontal"
|
|
235
|
+
onClick={() => setLayout('horizontal')}
|
|
236
|
+
>
|
|
237
|
+
Horizontal
|
|
238
|
+
</RadioItem>
|
|
239
|
+
</RadioContainer>
|
|
240
|
+
<Hint id="name-hint">Bottom border:</Hint>
|
|
241
|
+
<RadioContainer inline>
|
|
242
|
+
<RadioItem
|
|
243
|
+
defaultChecked={border === 'yes'}
|
|
244
|
+
name="changed_border"
|
|
245
|
+
value="yes"
|
|
246
|
+
onClick={() => setBorder('yes')}
|
|
247
|
+
>
|
|
248
|
+
Yes
|
|
249
|
+
</RadioItem>
|
|
250
|
+
<RadioItem
|
|
251
|
+
defaultChecked={border === 'no'}
|
|
252
|
+
name="changed_border"
|
|
253
|
+
value="no"
|
|
254
|
+
onClick={() => setBorder('no')}
|
|
255
|
+
>
|
|
256
|
+
No
|
|
257
|
+
</RadioItem>
|
|
258
|
+
</RadioContainer>
|
|
259
|
+
<Hint id="name-hint">Position fixed:</Hint>
|
|
260
|
+
<RadioContainer inline>
|
|
261
|
+
<RadioItem
|
|
262
|
+
defaultChecked={fixed === 'yes'}
|
|
263
|
+
name="changed_position"
|
|
264
|
+
value="yes"
|
|
265
|
+
onClick={() => setFixed('yes')}
|
|
266
|
+
>
|
|
267
|
+
Yes
|
|
268
|
+
</RadioItem>
|
|
269
|
+
<RadioItem
|
|
270
|
+
defaultChecked={fixed === 'no'}
|
|
271
|
+
name="changed_position"
|
|
272
|
+
value="no"
|
|
273
|
+
onClick={() => setFixed('no')}
|
|
274
|
+
>
|
|
275
|
+
No
|
|
276
|
+
</RadioItem>
|
|
277
|
+
</RadioContainer>
|
|
278
|
+
</Fieldset>
|
|
279
|
+
</FieldContainer>
|
|
280
|
+
</>
|
|
281
|
+
);
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
export default NavListSecondaryAutoExample;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavListAuto } from '@digigov/ui/core/NavList';
|
|
3
|
+
import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
|
|
4
|
+
|
|
5
|
+
const links = [
|
|
6
|
+
{
|
|
7
|
+
name: 'Nav1',
|
|
8
|
+
label: 'Nav list item 1',
|
|
9
|
+
href: '#',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'Nav2',
|
|
13
|
+
label: 'Nav list item 2',
|
|
14
|
+
menu: {
|
|
15
|
+
title: 'This is the first Menu',
|
|
16
|
+
links: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Nav2.1',
|
|
19
|
+
label: 'link navigation',
|
|
20
|
+
href: '#',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Nav2.2',
|
|
24
|
+
label: 'link navigation',
|
|
25
|
+
href: '#',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Nav2.3',
|
|
29
|
+
label: 'link navigation',
|
|
30
|
+
href: '#',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Nav2.4',
|
|
34
|
+
label: 'link navigation',
|
|
35
|
+
href: '#',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Nav3',
|
|
42
|
+
label: 'Nav list item 3',
|
|
43
|
+
href: '#',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export const NavListVerticalAutoExample = () => {
|
|
48
|
+
const layout = 'vertical';
|
|
49
|
+
const border = false;
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<NavListAuto
|
|
53
|
+
layout={layout}
|
|
54
|
+
border={border}
|
|
55
|
+
links={links}
|
|
56
|
+
aria-label="Nav list"
|
|
57
|
+
>
|
|
58
|
+
{links.map((item, key) => (
|
|
59
|
+
<NavListItemAuto key={key} item={item} />
|
|
60
|
+
))}
|
|
61
|
+
</NavListAuto>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default NavListVerticalAutoExample;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export * from '@digigov/ui/core/NavList/NavListItem';
|
|
2
|
-
export * from '@digigov/ui/core/NavList/NavListAuto';
|
|
3
|
-
export * from '@digigov/ui/core/NavList/
|
|
4
|
-
export * from '@digigov/ui/core/NavList/NavListSubMenu';
|
|
5
|
-
export * from '@digigov/ui/core/NavList/NavListContext';
|
|
2
|
+
export * from '@digigov/ui/core/NavList/NavListAuto/NavListAuto';
|
|
3
|
+
export * from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
|
|
6
4
|
export * from '@digigov/ui/core/NavList/Nav';
|
|
7
5
|
export * from '@digigov/ui/core/NavList/NavList';
|
|
8
|
-
export * from '@digigov/ui/core/NavList/NavListItem';
|
|
9
6
|
export * from '@digigov/ui/core/NavList/NavListItemLink';
|
|
10
7
|
export * from '@digigov/ui/core/NavList/NavListItemButton';
|
|
11
8
|
export * from '@digigov/ui/core/NavList/NavMenu';
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { NavLinkInterface } from '@digigov/ui/core/NavList/
|
|
2
|
+
import { NavLinkInterface } from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
|
|
3
3
|
import { BaseCSSProperties } from '@material-ui/core/styles/withStyles';
|
|
4
|
+
import { NavProps } from '@digigov/ui/core/NavList';
|
|
4
5
|
|
|
5
6
|
export type NavListLayout = 'horizontal' | 'vertical';
|
|
6
7
|
|
|
7
|
-
export interface NavListAutoProps {
|
|
8
|
+
export interface NavListAutoProps extends NavProps {
|
|
8
9
|
children?: React.ReactNode;
|
|
9
10
|
className?: string;
|
|
10
11
|
layout?: NavListLayout;
|
|
12
|
+
border?: boolean;
|
|
13
|
+
fixed?: boolean;
|
|
11
14
|
role?: string;
|
|
12
15
|
openSubMenus?: boolean;
|
|
13
16
|
floating?: boolean;
|
|
@@ -16,6 +19,14 @@ export interface NavListAutoProps {
|
|
|
16
19
|
style?: BaseCSSProperties;
|
|
17
20
|
}
|
|
18
21
|
|
|
22
|
+
export interface NavListHeaderItemType {
|
|
23
|
+
name: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
subMenu: NavListItemLinkInterface[];
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
interface NavListItemInterface {
|
|
20
31
|
name: string;
|
|
21
32
|
label?: string;
|
|
@@ -27,18 +38,20 @@ interface NavListItemLinkInterface extends NavListItemInterface {
|
|
|
27
38
|
href: string;
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
label?: string;
|
|
33
|
-
title?: string;
|
|
34
|
-
children?: React.ReactNode;
|
|
35
|
-
subMenu: NavListItemLinkInterface[];
|
|
41
|
+
interface NavListItemMenuInterface extends NavListItemInterface {
|
|
42
|
+
links: NavListItemLinkInterface[];
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
export type NavListItemType =
|
|
39
46
|
| NavListItemLinkInterface
|
|
47
|
+
| NavListItemMenuContainerInterface
|
|
40
48
|
| NavListItemSubMenuInterface;
|
|
41
49
|
|
|
50
|
+
export interface NavListItemMenuContainerInterface
|
|
51
|
+
extends NavListItemInterface {
|
|
52
|
+
menu: NavListItemMenuInterface[];
|
|
53
|
+
}
|
|
54
|
+
|
|
42
55
|
export interface NavListItemSubMenuInterface extends NavListItemInterface {
|
|
43
56
|
subMenu: NavListItemType[];
|
|
44
57
|
}
|
|
@@ -61,5 +74,6 @@ export interface NavListItemProps {
|
|
|
61
74
|
link?: NavListItemType;
|
|
62
75
|
layout?: NavListLayout;
|
|
63
76
|
active?: boolean;
|
|
64
|
-
|
|
77
|
+
setRegisterButton?: (name: string) => any;
|
|
78
|
+
setRegisterLink?: (name: string) => any;
|
|
65
79
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useTabs,
|
|
9
9
|
} from '@digigov/ui/core/Tabs';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { Heading } from '@digigov/ui/typography/Heading';
|
|
12
12
|
import { VisuallyHidden } from '@digigov/ui/core/VisuallyHidden';
|
|
13
13
|
|
|
14
14
|
import {
|
|
@@ -30,9 +30,9 @@ export function Default() {
|
|
|
30
30
|
<TabsListItem {...register('b')}>Yποθέσεις</TabsListItem>
|
|
31
31
|
</TabsList>
|
|
32
32
|
<TabsPanel {...panel('a')}>
|
|
33
|
-
<
|
|
33
|
+
<Heading size="m" element="h3">
|
|
34
34
|
Στοιχεία πολίτη
|
|
35
|
-
</
|
|
35
|
+
</Heading>
|
|
36
36
|
<SummaryList>
|
|
37
37
|
<SummaryListItem>
|
|
38
38
|
<SummaryListItemKey>Όνομα</SummaryListItemKey>
|
|
@@ -62,9 +62,9 @@ export function Default() {
|
|
|
62
62
|
</SummaryList>
|
|
63
63
|
</TabsPanel>
|
|
64
64
|
<TabsPanel {...panel('b')}>
|
|
65
|
-
<
|
|
65
|
+
<Heading size="m" element="h3">
|
|
66
66
|
Yποθέσεις
|
|
67
|
-
</
|
|
67
|
+
</Heading>
|
|
68
68
|
Περιεχόμενα υποθέσεων
|
|
69
69
|
</TabsPanel>
|
|
70
70
|
</Tabs>
|
package/src/core/Tabs/index.tsx
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { useCallback, useRef } from 'react';
|
|
2
2
|
import Tabs from '@digigov/react-core/Tabs';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from '@digigov/ui/hooks/
|
|
4
|
+
useTogglableTab,
|
|
5
|
+
UseTogglableTabReturn,
|
|
6
|
+
} from '@digigov/ui/hooks/useTogglableTab';
|
|
7
7
|
|
|
8
|
-
export interface UseTabsReturn extends
|
|
8
|
+
export interface UseTabsReturn extends UseTogglableTabReturn {
|
|
9
9
|
panel: (key: string) => { active: boolean; tabIndex: number; id: string };
|
|
10
10
|
}
|
|
11
11
|
export const useTabs = (): UseTabsReturn => {
|
|
12
12
|
const registeredPanels = useRef({});
|
|
13
13
|
const goTo = useCallback((key: string) => {
|
|
14
|
-
console.log(
|
|
15
|
-
registeredPanels.current[key].offsetTop -
|
|
16
|
-
rest.registered.current[key].offsetTop
|
|
17
|
-
);
|
|
18
14
|
if (
|
|
19
15
|
registeredPanels.current[key].offsetTop -
|
|
20
16
|
rest.registered.current[key].offsetTop >=
|
|
@@ -26,7 +22,7 @@ export const useTabs = (): UseTabsReturn => {
|
|
|
26
22
|
});
|
|
27
23
|
}
|
|
28
24
|
}, []);
|
|
29
|
-
const { register, opened, ...rest } =
|
|
25
|
+
const { register, opened, ...rest } = useTogglableTab({
|
|
30
26
|
singleOpen: true,
|
|
31
27
|
toggleProperty: 'selected',
|
|
32
28
|
onToggleProperty: 'onClick',
|