@digigov/ui 0.12.2 → 0.13.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 +8 -1
- package/{src/core/ServiceBadge/ServiceBadge.mdx → LICENSE} +0 -0
- package/api/APIErrors.d.ts +22 -0
- package/api/APIErrors.js +117 -0
- package/api/APIProvider.d.ts +15 -0
- package/api/APIProvider.js +43 -0
- package/api/fetchAPI.d.ts +18 -0
- package/api/fetchAPI.js +64 -0
- package/api/index.d.ts +9 -0
- package/api/index.js +104 -0
- package/api/index.spec.d.ts +1 -0
- package/api/index.spec.js +584 -0
- package/{src/api → api}/introduction.md +0 -0
- package/api/useResource.d.ts +11 -0
- package/api/useResource.js +144 -0
- package/api/useResourceAction.d.ts +2 -0
- package/api/useResourceAction.js +157 -0
- package/api/useResourceQuery.d.ts +18 -0
- package/api/useResourceQuery.js +229 -0
- package/api/utils.d.ts +6 -0
- package/api/utils.js +250 -0
- package/app/App.d.ts +14 -0
- package/app/App.js +49 -0
- package/{src/app/Confirmation/index.tsx → app/Confirmation/index.d.ts} +0 -0
- package/app/Confirmation/index.js +44 -0
- package/{src/app/Footer/index.tsx → app/Footer/index.d.ts} +0 -0
- package/app/Footer/index.js +200 -0
- package/app/Header/HeaderLogo.d.ts +3 -0
- package/app/Header/HeaderLogo.js +30 -0
- package/app/Header/HeaderSection.d.ts +5 -0
- package/app/Header/HeaderSection.js +20 -0
- package/app/Header/HeaderTitle.d.ts +5 -0
- package/app/Header/HeaderTitle.js +30 -0
- package/{src/app → app}/Header/__snapshots__/index.spec.tsx.snap +0 -0
- package/app/Header/index.d.ts +11 -0
- package/app/Header/index.js +106 -0
- package/{src/app → app}/Header/index.mdx +0 -0
- package/app/Header/index.spec.d.ts +1 -0
- package/app/Header/index.spec.js +45 -0
- package/app/NotFound/index.d.ts +3 -0
- package/app/NotFound/index.js +29 -0
- package/app/OutdatedBrowserBanner.d.ts +2 -0
- package/app/OutdatedBrowserBanner.js +41 -0
- package/app/PageTitle.d.ts +10 -0
- package/app/PageTitle.js +76 -0
- package/{src/app → app}/QrCodeScanner/__snapshots__/index.spec.tsx.snap +0 -0
- package/app/QrCodeScanner/index.d.ts +29 -0
- package/app/QrCodeScanner/index.js +85 -0
- package/{src/app → app}/QrCodeScanner/index.mdx +0 -0
- package/app/QrCodeScanner/index.spec.d.ts +1 -0
- package/app/QrCodeScanner/index.spec.js +26 -0
- package/app/i18n.d.ts +10 -0
- package/app/i18n.js +63 -0
- package/{src/app/index.ts → app/index.d.ts} +0 -0
- package/app/index.js +70 -0
- package/{src/core → core}/Accordion/__snapshots__/index.spec.tsx.snap +0 -0
- package/core/Accordion/index.d.ts +21 -0
- package/core/Accordion/index.js +127 -0
- package/{src/core → core}/Accordion/index.mdx +0 -0
- package/core/Accordion/index.spec.d.ts +1 -0
- package/core/Accordion/index.spec.js +19 -0
- package/{src/core → core}/Blockquote/__snapshots__/index.spec.tsx.snap +0 -0
- package/core/Blockquote/index.d.ts +3 -0
- package/core/Blockquote/index.js +29 -0
- package/{src/core → core}/Blockquote/index.mdx +0 -0
- package/core/Blockquote/index.spec.d.ts +1 -0
- package/core/Blockquote/index.spec.js +21 -0
- package/{src/core/Breadcrumbs/index.tsx → core/Breadcrumbs/index.d.ts} +0 -0
- package/core/Breadcrumbs/index.js +44 -0
- package/core/Button/BackButton.d.ts +3 -0
- package/core/Button/BackButton.js +34 -0
- package/core/Button/ButtonLink.d.ts +4 -0
- package/core/Button/ButtonLink.js +28 -0
- package/core/Button/CallToAction.d.ts +7 -0
- package/core/Button/CallToAction.js +41 -0
- package/core/Button/Icon.d.ts +2 -0
- package/core/Button/Icon.js +19 -0
- package/{src/core → core}/Button/__snapshots__/index.spec.tsx.snap +0 -0
- package/core/Button/index.d.ts +15 -0
- package/core/Button/index.js +122 -0
- package/{src/core → core}/Button/index.mdx +0 -0
- package/core/Button/index.spec.d.ts +1 -0
- package/core/Button/index.spec.js +21 -0
- package/{src/core/Card/index.tsx → core/Card/index.d.ts} +0 -0
- package/core/Card/index.js +57 -0
- package/{src/core → core}/Details/__snapshots__/index.spec.tsx.snap +0 -0
- package/{src/core/Details/index.tsx → core/Details/index.d.ts} +0 -2
- package/core/Details/index.js +35 -0
- package/{src/core → core}/Details/index.mdx +0 -0
- package/core/Details/index.spec.d.ts +1 -0
- package/core/Details/index.spec.js +27 -0
- package/core/Divider/index.d.ts +5 -0
- package/core/Divider/index.js +20 -0
- package/{src/core → core}/ErrorSummary/__snapshots__/index.spec.tsx.snap +0 -0
- package/{src/core/ErrorSummary/index.tsx → core/ErrorSummary/index.d.ts} +0 -1
- package/core/ErrorSummary/index.js +19 -0
- package/{src/core → core}/ErrorSummary/index.mdx +0 -0
- package/core/ErrorSummary/index.spec.d.ts +1 -0
- package/core/ErrorSummary/index.spec.js +21 -0
- package/{src/core/Hidden/index.tsx → core/Hidden/index.d.ts} +0 -0
- package/core/Hidden/index.js +18 -0
- package/{src/core → core}/Link/__snapshots__/index.spec.tsx.snap +0 -0
- package/core/Link/index.d.ts +12 -0
- package/core/Link/index.js +50 -0
- package/core/Link/index.spec.d.ts +1 -0
- package/core/Link/index.spec.js +31 -0
- package/{src/core/List/List.tsx → core/List/List.d.ts} +0 -2
- package/core/List/List.js +19 -0
- package/{src/core/List/ListItem.tsx → core/List/ListItem.d.ts} +0 -2
- package/core/List/ListItem.js +19 -0
- package/core/List/ListItemContent.d.ts +7 -0
- package/core/List/ListItemContent.js +45 -0
- package/core/List/ListItemIcon.d.ts +7 -0
- package/core/List/ListItemIcon.js +48 -0
- package/core/List/ListItemText.d.ts +8 -0
- package/core/List/ListItemText.js +36 -0
- package/core/List/ListItemTitle.d.ts +10 -0
- package/core/List/ListItemTitle.js +44 -0
- package/{src/core → core}/List/__snapshots__/index.spec.tsx.snap +0 -0
- package/{src/core/List/index.tsx → core/List/index.d.ts} +0 -0
- package/core/List/index.js +96 -0
- package/{src/core → core}/List/index.mdx +0 -0
- package/core/List/index.spec.d.ts +1 -0
- package/core/List/index.spec.js +21 -0
- package/core/NavList/NavList.d.ts +17 -0
- package/core/NavList/NavList.js +99 -0
- package/core/NavList/NavListContext.d.ts +20 -0
- package/core/NavList/NavListContext.js +102 -0
- package/core/NavList/NavListItem.d.ts +13 -0
- package/core/NavList/NavListItem.js +171 -0
- package/core/NavList/NavListItemBase.d.ts +16 -0
- package/core/NavList/NavListItemBase.js +161 -0
- package/core/NavList/NavListSubMenu.d.ts +8 -0
- package/core/NavList/NavListSubMenu.js +52 -0
- package/{src/core → core}/NavList/__snapshots__/index.spec.tsx.snap +0 -0
- package/{src/core/NavList/index.tsx → core/NavList/index.d.ts} +0 -0
- package/core/NavList/index.js +68 -0
- package/{src/core → core}/NavList/index.mdx +0 -0
- package/core/NavList/index.spec.d.ts +1 -0
- package/core/NavList/index.spec.js +21 -0
- package/{src/core → core}/NotificationBanner/__snapshots__/index.spec.tsx.snap +0 -0
- package/core/NotificationBanner/index.d.ts +18 -0
- package/core/NotificationBanner/index.js +78 -0
- package/{src/core → core}/NotificationBanner/index.mdx +0 -0
- package/core/NotificationBanner/index.spec.d.ts +1 -0
- package/core/NotificationBanner/index.spec.js +32 -0
- package/core/ServiceBadge/ServiceBadge.mdx +0 -0
- package/core/ServiceBadge/index.d.ts +9 -0
- package/core/ServiceBadge/index.js +36 -0
- package/{src/core → core}/ServiceBadge/index.mdx +0 -0
- package/{src/core → core}/SummaryList/__snapshots__/index.spec.tsx.snap +0 -0
- package/{src/core/SummaryList/index.tsx → core/SummaryList/index.d.ts} +0 -2
- package/core/SummaryList/index.js +79 -0
- package/{src/core → core}/SummaryList/index.mdx +0 -0
- package/core/SummaryList/index.spec.d.ts +1 -0
- package/core/SummaryList/index.spec.js +19 -0
- package/{src/core/Table/index.tsx → core/Table/index.d.ts} +0 -0
- package/core/Table/index.js +96 -0
- package/core/Tabs/index.d.ts +16 -0
- package/core/Tabs/index.js +88 -0
- package/{src/core → core}/Tabs/index.mdx +0 -0
- package/{src/core/VisuallyHidden/index.tsx → core/VisuallyHidden/index.d.ts} +0 -0
- package/core/VisuallyHidden/index.js +18 -0
- package/{src/core → core}/WarningText/__snapshots__/index.spec.tsx.snap +0 -0
- package/{src/core/WarningText/index.tsx → core/WarningText/index.d.ts} +0 -1
- package/core/WarningText/index.js +19 -0
- package/{src/core → core}/WarningText/index.mdx +0 -0
- package/core/WarningText/index.spec.d.ts +1 -0
- package/core/WarningText/index.spec.js +21 -0
- package/{src/core/index.ts → core/index.d.ts} +0 -0
- package/core/index.js +227 -0
- package/custom.d.js +1 -0
- package/es/api/APIErrors.js +96 -0
- package/es/api/APIProvider.js +25 -0
- package/es/api/fetchAPI.js +49 -0
- package/{src/api/index.tsx → es/api/index.js} +3 -6
- package/es/api/index.spec.js +546 -0
- package/es/api/introduction.md +6 -0
- package/es/api/useResource.js +128 -0
- package/es/api/useResourceAction.js +141 -0
- package/es/api/useResourceQuery.js +208 -0
- package/es/api/utils.js +233 -0
- package/es/app/App.js +27 -0
- package/es/app/Confirmation/index.js +3 -0
- package/es/app/Footer/index.js +15 -0
- package/{src/app/Header/HeaderLogo.tsx → es/app/Header/HeaderLogo.js} +7 -9
- package/es/app/Header/HeaderSection.js +7 -0
- package/es/app/Header/HeaderTitle.js +17 -0
- package/es/app/Header/__snapshots__/index.spec.tsx.snap +393 -0
- package/{src/app/Header/index.tsx → es/app/Header/index.js} +4 -10
- package/es/app/Header/index.mdx +50 -0
- package/es/app/Header/index.spec.js +32 -0
- package/es/app/NotFound/index.js +12 -0
- package/es/app/OutdatedBrowserBanner.js +24 -0
- package/es/app/PageTitle.js +57 -0
- package/es/app/QrCodeScanner/__snapshots__/index.spec.tsx.snap +22 -0
- package/es/app/QrCodeScanner/index.js +64 -0
- package/es/app/QrCodeScanner/index.mdx +22 -0
- package/es/app/QrCodeScanner/index.spec.js +13 -0
- package/es/app/i18n.js +42 -0
- package/es/app/index.js +5 -0
- package/es/core/Accordion/__snapshots__/index.spec.tsx.snap +78 -0
- package/es/core/Accordion/index.js +67 -0
- package/es/core/Accordion/index.mdx +104 -0
- package/es/core/Accordion/index.spec.js +9 -0
- package/es/core/Blockquote/__snapshots__/index.spec.tsx.snap +13 -0
- package/{src/core/Blockquote/index.tsx → es/core/Blockquote/index.js} +7 -9
- package/es/core/Blockquote/index.mdx +61 -0
- package/es/core/Blockquote/index.spec.js +9 -0
- package/es/core/Breadcrumbs/index.js +3 -0
- package/{src/core/Button/BackButton.tsx → es/core/Button/BackButton.js} +8 -10
- package/es/core/Button/ButtonLink.js +16 -0
- package/es/core/Button/CallToAction.js +27 -0
- package/es/core/Button/Icon.js +7 -0
- package/es/core/Button/__snapshots__/index.spec.tsx.snap +13 -0
- package/es/core/Button/index.js +37 -0
- package/es/core/Button/index.mdx +65 -0
- package/es/core/Button/index.spec.js +9 -0
- package/es/core/Card/index.js +4 -0
- package/es/core/Details/__snapshots__/index.spec.tsx.snap +50 -0
- package/es/core/Details/index.js +5 -0
- package/es/core/Details/index.mdx +34 -0
- package/es/core/Details/index.spec.js +17 -0
- package/es/core/Divider/index.js +7 -0
- package/es/core/ErrorSummary/__snapshots__/index.spec.tsx.snap +322 -0
- package/es/core/ErrorSummary/index.js +3 -0
- package/es/core/ErrorSummary/index.mdx +61 -0
- package/es/core/ErrorSummary/index.spec.js +9 -0
- package/es/core/Hidden/index.js +1 -0
- package/es/core/Link/__snapshots__/index.spec.tsx.snap +31 -0
- package/es/core/Link/index.js +26 -0
- package/es/core/Link/index.spec.js +21 -0
- package/es/core/List/List.js +3 -0
- package/es/core/List/ListItem.js +3 -0
- package/es/core/List/ListItemContent.js +27 -0
- package/es/core/List/ListItemIcon.js +29 -0
- package/es/core/List/ListItemText.js +19 -0
- package/es/core/List/ListItemTitle.js +25 -0
- package/es/core/List/__snapshots__/index.spec.tsx.snap +322 -0
- package/es/core/List/index.js +7 -0
- package/es/core/List/index.mdx +40 -0
- package/es/core/List/index.spec.js +9 -0
- package/es/core/NavList/NavList.js +78 -0
- package/es/core/NavList/NavListContext.js +80 -0
- package/es/core/NavList/NavListItem.js +141 -0
- package/es/core/NavList/NavListItemBase.js +133 -0
- package/es/core/NavList/NavListSubMenu.js +27 -0
- package/es/core/NavList/__snapshots__/index.spec.tsx.snap +334 -0
- package/es/core/NavList/index.js +5 -0
- package/es/core/NavList/index.mdx +185 -0
- package/es/core/NavList/index.spec.js +9 -0
- package/es/core/NotificationBanner/__snapshots__/index.spec.tsx.snap +737 -0
- package/es/core/NotificationBanner/index.js +35 -0
- package/es/core/NotificationBanner/index.mdx +77 -0
- package/es/core/NotificationBanner/index.spec.js +20 -0
- package/es/core/ServiceBadge/ServiceBadge.mdx +0 -0
- package/es/core/ServiceBadge/index.js +20 -0
- package/es/core/ServiceBadge/index.mdx +42 -0
- package/es/core/SummaryList/__snapshots__/index.spec.tsx.snap +57 -0
- package/es/core/SummaryList/index.js +7 -0
- package/es/core/SummaryList/index.mdx +82 -0
- package/es/core/SummaryList/index.spec.js +9 -0
- package/es/core/Table/index.js +7 -0
- package/es/core/Tabs/index.js +37 -0
- package/es/core/Tabs/index.mdx +54 -0
- package/es/core/VisuallyHidden/index.js +1 -0
- package/es/core/WarningText/__snapshots__/index.spec.tsx.snap +336 -0
- package/es/core/WarningText/index.js +3 -0
- package/es/core/WarningText/index.mdx +46 -0
- package/es/core/WarningText/index.spec.js +9 -0
- package/es/core/index.js +17 -0
- package/es/custom.d.js +0 -0
- package/{src → es}/form/inputs/Input/index.mdx +0 -0
- package/es/govgr/Footer/Copyright.js +37 -0
- package/es/govgr/Footer/HellenicRepublicLogo.js +3 -0
- package/es/govgr/Footer/LicenseCCSA.js +18 -0
- package/es/govgr/Footer/index.js +21 -0
- package/{src → es}/govgr/Footer/index.mdx +0 -0
- package/{src/govgr/Footer/logo.ts → es/govgr/Footer/logo.js} +1 -1
- package/{src/govgr/Footer/logos/logo-el.ts → es/govgr/Footer/logos/logo-el.js} +1 -1
- package/{src/govgr/Footer/logos/logo-en.ts → es/govgr/Footer/logos/logo-en.js} +1 -1
- package/{src → es}/govgr/Logo/govgr-logo.svg +0 -0
- package/es/govgr/Logo/index.js +3 -0
- package/{src/govgr/Logo/logo.ts → es/govgr/Logo/logo.js} +1 -1
- package/es/govgr/index.js +4 -0
- package/es/hooks/useDebounce.js +41 -0
- package/es/hooks/useLatest.js +12 -0
- package/{src/hooks/useOutdatedBrowserCheck.ts → es/hooks/useOutdatedBrowserCheck.js} +15 -16
- package/es/hooks/useSearch.js +25 -0
- package/es/hooks/useTogglableSections.js +96 -0
- package/es/index.js +5 -0
- package/es/layouts/Basic/Bottom/index.js +3 -0
- package/{src → es}/layouts/Basic/Bottom/index.mdx +0 -0
- package/es/layouts/Basic/Content/index.js +18 -0
- package/{src → es}/layouts/Basic/Content/index.mdx +0 -0
- package/es/layouts/Basic/Main/index.js +3 -0
- package/{src → es}/layouts/Basic/Main/index.mdx +0 -0
- package/es/layouts/Basic/Masthead/index.js +4 -0
- package/{src → es}/layouts/Basic/Masthead/index.mdx +0 -0
- package/{src/layouts/Basic/Side/index.tsx → es/layouts/Basic/Side/index.js} +3 -5
- package/{src → es}/layouts/Basic/Side/index.mdx +0 -0
- package/{src/layouts/Basic/Top/index.tsx → es/layouts/Basic/Top/index.js} +5 -7
- package/{src → es}/layouts/Basic/Top/index.mdx +0 -0
- package/{src → es}/layouts/Basic/__snapshots__/index.spec.tsx.snap +0 -0
- package/es/layouts/Basic/index.js +8 -0
- package/{src → es}/layouts/Basic/index.mdx +0 -0
- package/es/layouts/Basic/index.spec.js +10 -0
- package/es/layouts/Grid/index.js +1 -0
- package/es/layouts/index.js +2 -0
- package/{src/locales/el.ts → es/locales/el.js} +14 -19
- package/{src/locales/en.ts → es/locales/en.js} +13 -17
- package/es/router/index.js +15 -0
- package/{src → es}/router/index.mdx +0 -0
- package/es/test-utils/delay.js +31 -0
- package/es/test-utils/mountWithTheme.js +30 -0
- package/{src → es}/themes/govgr.js +29 -33
- package/es/themes/grnet.js +110 -0
- package/es/themes/index.js +2 -0
- package/es/typography/Caption.js +7 -0
- package/es/typography/NormalText.js +3 -0
- package/es/typography/Paragraph.js +2 -0
- package/es/typography/Title.js +48 -0
- package/es/typography/index.js +8 -0
- package/{src → es}/typography/index.mdx +0 -0
- package/es/utils/evaluateBrowserVersion.js +201 -0
- package/es/utils/withDeprecation.js +103 -0
- package/esm/api/APIErrors.js +96 -0
- package/esm/api/APIProvider.js +25 -0
- package/esm/api/fetchAPI.js +49 -0
- package/esm/api/index.js +13 -0
- package/esm/api/index.spec.js +546 -0
- package/esm/api/introduction.md +6 -0
- package/esm/api/useResource.js +128 -0
- package/esm/api/useResourceAction.js +141 -0
- package/esm/api/useResourceQuery.js +208 -0
- package/esm/api/utils.js +233 -0
- package/esm/app/App.js +27 -0
- package/esm/app/Confirmation/index.js +3 -0
- package/esm/app/Footer/index.js +15 -0
- package/esm/app/Header/HeaderLogo.js +17 -0
- package/esm/app/Header/HeaderSection.js +7 -0
- package/esm/app/Header/HeaderTitle.js +17 -0
- package/esm/app/Header/__snapshots__/index.spec.tsx.snap +393 -0
- package/esm/app/Header/index.js +13 -0
- package/esm/app/Header/index.mdx +50 -0
- package/esm/app/Header/index.spec.js +32 -0
- package/esm/app/NotFound/index.js +12 -0
- package/esm/app/OutdatedBrowserBanner.js +24 -0
- package/esm/app/PageTitle.js +57 -0
- package/esm/app/QrCodeScanner/__snapshots__/index.spec.tsx.snap +22 -0
- package/esm/app/QrCodeScanner/index.js +64 -0
- package/esm/app/QrCodeScanner/index.mdx +22 -0
- package/esm/app/QrCodeScanner/index.spec.js +13 -0
- package/esm/app/i18n.js +42 -0
- package/esm/app/index.js +5 -0
- package/esm/core/Accordion/__snapshots__/index.spec.tsx.snap +78 -0
- package/esm/core/Accordion/index.js +67 -0
- package/esm/core/Accordion/index.mdx +104 -0
- package/esm/core/Accordion/index.spec.js +9 -0
- package/esm/core/Blockquote/__snapshots__/index.spec.tsx.snap +13 -0
- package/esm/core/Blockquote/index.js +16 -0
- package/esm/core/Blockquote/index.mdx +61 -0
- package/esm/core/Blockquote/index.spec.js +9 -0
- package/esm/core/Breadcrumbs/index.js +3 -0
- package/esm/core/Button/BackButton.js +21 -0
- package/esm/core/Button/ButtonLink.js +16 -0
- package/esm/core/Button/CallToAction.js +27 -0
- package/esm/core/Button/Icon.js +7 -0
- package/esm/core/Button/__snapshots__/index.spec.tsx.snap +13 -0
- package/esm/core/Button/index.js +37 -0
- package/esm/core/Button/index.mdx +65 -0
- package/esm/core/Button/index.spec.js +9 -0
- package/esm/core/Card/index.js +4 -0
- package/esm/core/Details/__snapshots__/index.spec.tsx.snap +50 -0
- package/esm/core/Details/index.js +5 -0
- package/esm/core/Details/index.mdx +34 -0
- package/esm/core/Details/index.spec.js +17 -0
- package/esm/core/Divider/index.js +7 -0
- package/esm/core/ErrorSummary/__snapshots__/index.spec.tsx.snap +322 -0
- package/esm/core/ErrorSummary/index.js +3 -0
- package/esm/core/ErrorSummary/index.mdx +61 -0
- package/esm/core/ErrorSummary/index.spec.js +9 -0
- package/esm/core/Hidden/index.js +1 -0
- package/esm/core/Link/__snapshots__/index.spec.tsx.snap +31 -0
- package/esm/core/Link/index.js +26 -0
- package/esm/core/Link/index.spec.js +21 -0
- package/esm/core/List/List.js +3 -0
- package/esm/core/List/ListItem.js +3 -0
- package/esm/core/List/ListItemContent.js +27 -0
- package/esm/core/List/ListItemIcon.js +29 -0
- package/esm/core/List/ListItemText.js +19 -0
- package/esm/core/List/ListItemTitle.js +25 -0
- package/esm/core/List/__snapshots__/index.spec.tsx.snap +322 -0
- package/esm/core/List/index.js +7 -0
- package/esm/core/List/index.mdx +40 -0
- package/esm/core/List/index.spec.js +9 -0
- package/esm/core/NavList/NavList.js +78 -0
- package/esm/core/NavList/NavListContext.js +80 -0
- package/esm/core/NavList/NavListItem.js +141 -0
- package/esm/core/NavList/NavListItemBase.js +133 -0
- package/esm/core/NavList/NavListSubMenu.js +27 -0
- package/esm/core/NavList/__snapshots__/index.spec.tsx.snap +334 -0
- package/esm/core/NavList/index.js +5 -0
- package/esm/core/NavList/index.mdx +185 -0
- package/esm/core/NavList/index.spec.js +9 -0
- package/esm/core/NotificationBanner/__snapshots__/index.spec.tsx.snap +737 -0
- package/esm/core/NotificationBanner/index.js +35 -0
- package/esm/core/NotificationBanner/index.mdx +77 -0
- package/esm/core/NotificationBanner/index.spec.js +20 -0
- package/esm/core/ServiceBadge/ServiceBadge.mdx +0 -0
- package/esm/core/ServiceBadge/index.js +20 -0
- package/esm/core/ServiceBadge/index.mdx +42 -0
- package/esm/core/SummaryList/__snapshots__/index.spec.tsx.snap +57 -0
- package/esm/core/SummaryList/index.js +7 -0
- package/esm/core/SummaryList/index.mdx +82 -0
- package/esm/core/SummaryList/index.spec.js +9 -0
- package/esm/core/Table/index.js +7 -0
- package/esm/core/Tabs/index.js +37 -0
- package/esm/core/Tabs/index.mdx +54 -0
- package/esm/core/VisuallyHidden/index.js +1 -0
- package/esm/core/WarningText/__snapshots__/index.spec.tsx.snap +336 -0
- package/esm/core/WarningText/index.js +3 -0
- package/esm/core/WarningText/index.mdx +46 -0
- package/esm/core/WarningText/index.spec.js +9 -0
- package/esm/core/index.js +17 -0
- package/esm/custom.d.js +0 -0
- package/esm/form/inputs/Input/index.mdx +10 -0
- package/esm/govgr/Footer/Copyright.js +37 -0
- package/esm/govgr/Footer/HellenicRepublicLogo.js +3 -0
- package/esm/govgr/Footer/LicenseCCSA.js +18 -0
- package/esm/govgr/Footer/index.js +21 -0
- package/esm/govgr/Footer/index.mdx +97 -0
- package/esm/govgr/Footer/logo.js +1 -0
- package/esm/govgr/Footer/logos/logo-el.js +1 -0
- package/esm/govgr/Footer/logos/logo-en.js +1 -0
- package/esm/govgr/Logo/govgr-logo.svg +1 -0
- package/esm/govgr/Logo/index.js +3 -0
- package/esm/govgr/Logo/logo.js +1 -0
- package/esm/govgr/index.js +4 -0
- package/esm/hooks/useDebounce.js +41 -0
- package/esm/hooks/useLatest.js +12 -0
- package/esm/hooks/useOutdatedBrowserCheck.js +46 -0
- package/esm/hooks/useSearch.js +25 -0
- package/esm/hooks/useTogglableSections.js +96 -0
- package/esm/index.js +10 -0
- package/esm/layouts/Basic/Bottom/index.js +3 -0
- package/esm/layouts/Basic/Bottom/index.mdx +37 -0
- package/esm/layouts/Basic/Content/index.js +18 -0
- package/esm/layouts/Basic/Content/index.mdx +64 -0
- package/esm/layouts/Basic/Main/index.js +3 -0
- package/esm/layouts/Basic/Main/index.mdx +64 -0
- package/esm/layouts/Basic/Masthead/index.js +4 -0
- package/esm/layouts/Basic/Masthead/index.mdx +74 -0
- package/esm/layouts/Basic/Side/index.js +7 -0
- package/esm/layouts/Basic/Side/index.mdx +71 -0
- package/esm/layouts/Basic/Top/index.js +11 -0
- package/esm/layouts/Basic/Top/index.mdx +74 -0
- package/esm/layouts/Basic/__snapshots__/index.spec.tsx.snap +54 -0
- package/esm/layouts/Basic/index.js +8 -0
- package/esm/layouts/Basic/index.mdx +62 -0
- package/esm/layouts/Basic/index.spec.js +10 -0
- package/esm/layouts/Grid/index.js +1 -0
- package/esm/layouts/index.js +2 -0
- package/esm/locales/el.js +55 -0
- package/esm/locales/en.js +55 -0
- package/esm/router/index.js +15 -0
- package/esm/router/index.mdx +40 -0
- package/esm/test-utils/delay.js +31 -0
- package/esm/test-utils/mountWithTheme.js +30 -0
- package/esm/themes/govgr.js +79 -0
- package/esm/themes/grnet.js +110 -0
- package/esm/themes/index.js +2 -0
- package/esm/typography/Caption.js +7 -0
- package/esm/typography/NormalText.js +3 -0
- package/esm/typography/Paragraph.js +2 -0
- package/esm/typography/Title.js +48 -0
- package/esm/typography/index.js +8 -0
- package/esm/typography/index.mdx +32 -0
- package/esm/utils/evaluateBrowserVersion.js +201 -0
- package/esm/utils/withDeprecation.js +103 -0
- package/form/inputs/Input/index.mdx +10 -0
- package/govgr/Footer/Copyright.d.ts +8 -0
- package/govgr/Footer/Copyright.js +52 -0
- package/{src/govgr/Footer/HellenicRepublicLogo.tsx → govgr/Footer/HellenicRepublicLogo.d.ts} +0 -1
- package/govgr/Footer/HellenicRepublicLogo.js +19 -0
- package/govgr/Footer/LicenseCCSA.d.ts +3 -0
- package/govgr/Footer/LicenseCCSA.js +33 -0
- package/govgr/Footer/index.d.ts +13 -0
- package/govgr/Footer/index.js +39 -0
- package/govgr/Footer/index.mdx +97 -0
- package/govgr/Footer/logo.d.ts +2 -0
- package/govgr/Footer/logo.js +8 -0
- package/govgr/Footer/logos/logo-el.d.ts +2 -0
- package/govgr/Footer/logos/logo-el.js +8 -0
- package/govgr/Footer/logos/logo-en.d.ts +2 -0
- package/govgr/Footer/logos/logo-en.js +8 -0
- package/govgr/Logo/govgr-logo.svg +1 -0
- package/{src/govgr/Logo/index.tsx → govgr/Logo/index.d.ts} +0 -2
- package/govgr/Logo/index.js +19 -0
- package/govgr/Logo/logo.d.ts +2 -0
- package/govgr/Logo/logo.js +8 -0
- package/{src/govgr/index.ts → govgr/index.d.ts} +0 -0
- package/govgr/index.js +57 -0
- package/hooks/useDebounce.d.ts +3 -0
- package/hooks/useDebounce.js +63 -0
- package/hooks/useLatest.d.ts +3 -0
- package/hooks/useLatest.js +26 -0
- package/hooks/useOutdatedBrowserCheck.d.ts +2 -0
- package/hooks/useOutdatedBrowserCheck.js +60 -0
- package/hooks/useSearch.d.ts +4 -0
- package/hooks/useSearch.js +40 -0
- package/hooks/useTogglableSections.d.ts +18 -0
- package/hooks/useTogglableSections.js +108 -0
- package/{src/index.ts → index.d.ts} +0 -0
- package/index.js +70 -0
- package/{src/layouts/Basic/Bottom/index.tsx → layouts/Basic/Bottom/index.d.ts} +0 -1
- package/layouts/Basic/Bottom/index.js +19 -0
- package/layouts/Basic/Bottom/index.mdx +37 -0
- package/layouts/Basic/Content/index.d.ts +5 -0
- package/layouts/Basic/Content/index.js +31 -0
- package/layouts/Basic/Content/index.mdx +64 -0
- package/{src/layouts/Basic/Main/index.tsx → layouts/Basic/Main/index.d.ts} +0 -1
- package/layouts/Basic/Main/index.js +19 -0
- package/layouts/Basic/Main/index.mdx +64 -0
- package/{src/layouts/Basic/Masthead/index.tsx → layouts/Basic/Masthead/index.d.ts} +0 -2
- package/layouts/Basic/Masthead/index.js +27 -0
- package/layouts/Basic/Masthead/index.mdx +74 -0
- package/layouts/Basic/Side/index.d.ts +3 -0
- package/layouts/Basic/Side/index.js +20 -0
- package/layouts/Basic/Side/index.mdx +71 -0
- package/layouts/Basic/Top/index.d.ts +3 -0
- package/layouts/Basic/Top/index.js +24 -0
- package/layouts/Basic/Top/index.mdx +74 -0
- package/layouts/Basic/__snapshots__/index.spec.tsx.snap +54 -0
- package/{src/layouts/Basic/index.tsx → layouts/Basic/index.d.ts} +0 -2
- package/layouts/Basic/index.js +97 -0
- package/layouts/Basic/index.mdx +62 -0
- package/layouts/Basic/index.spec.d.ts +1 -0
- package/layouts/Basic/index.spec.js +20 -0
- package/{src/layouts/Grid/index.tsx → layouts/Grid/index.d.ts} +0 -0
- package/layouts/Grid/index.js +18 -0
- package/{src/layouts/index.ts → layouts/index.d.ts} +0 -0
- package/layouts/index.js +34 -0
- package/locales/el.d.ts +56 -0
- package/locales/el.js +62 -0
- package/locales/en.d.ts +56 -0
- package/locales/en.js +62 -0
- package/package.json +8 -31
- package/router/index.d.ts +9 -0
- package/router/index.js +37 -0
- package/router/index.mdx +40 -0
- package/test-utils/delay.d.ts +2 -0
- package/test-utils/delay.js +45 -0
- package/test-utils/mountWithTheme.d.ts +3 -0
- package/test-utils/mountWithTheme.js +43 -0
- package/themes/govgr.d.ts +3 -0
- package/themes/govgr.js +89 -0
- package/themes/grnet.d.ts +2 -0
- package/themes/grnet.js +128 -0
- package/themes/index.d.ts +32 -0
- package/themes/index.js +19 -0
- package/typography/Caption.d.ts +7 -0
- package/typography/Caption.js +20 -0
- package/typography/NormalText.d.ts +5 -0
- package/typography/NormalText.js +19 -0
- package/typography/Paragraph.d.ts +6 -0
- package/typography/Paragraph.js +13 -0
- package/typography/Title.d.ts +9 -0
- package/typography/Title.js +63 -0
- package/{src/typography/index.ts → typography/index.d.ts} +0 -0
- package/typography/index.js +97 -0
- package/typography/index.mdx +32 -0
- package/utils/evaluateBrowserVersion.d.ts +15 -0
- package/utils/evaluateBrowserVersion.js +216 -0
- package/utils/withDeprecation.d.ts +16 -0
- package/utils/withDeprecation.js +116 -0
- package/.eslintrc.js +0 -4
- package/.prettierrc.js +0 -3
- package/.rush/temp/package-deps_build.json +0 -176
- package/.rush/temp/shrinkwrap-deps.json +0 -278
- package/CHANGELOG.json +0 -796
- package/docs/components.mdx +0 -1
- package/docs/create-a-new-service.mdx +0 -93
- package/docs/create-common-page-layout.mdx +0 -205
- package/docs/create-static-page.mdx +0 -179
- package/docs/edit-start-page.mdx +0 -143
- package/docs/index.mdx +0 -66
- package/docs/introduction.mdx +0 -34
- package/src/api/APIErrors.tsx +0 -44
- package/src/api/APIProvider.tsx +0 -27
- package/src/api/fetchAPI.ts +0 -45
- package/src/api/index.spec.tsx +0 -419
- package/src/api/useResource.tsx +0 -96
- package/src/api/useResourceAction.tsx +0 -80
- package/src/api/useResourceQuery.tsx +0 -177
- package/src/api/utils.tsx +0 -156
- package/src/app/App.tsx +0 -33
- package/src/app/Header/HeaderSection.tsx +0 -13
- package/src/app/Header/HeaderTitle.tsx +0 -24
- package/src/app/Header/index.spec.tsx +0 -32
- package/src/app/NotFound/index.tsx +0 -21
- package/src/app/OutdatedBrowserBanner.tsx +0 -37
- package/src/app/PageTitle.tsx +0 -70
- package/src/app/QrCodeScanner/index.spec.tsx +0 -19
- package/src/app/QrCodeScanner/index.tsx +0 -90
- package/src/app/i18n.tsx +0 -44
- package/src/core/Accordion/index.spec.tsx +0 -30
- package/src/core/Accordion/index.tsx +0 -86
- package/src/core/Blockquote/index.spec.tsx +0 -10
- package/src/core/Button/ButtonLink.tsx +0 -20
- package/src/core/Button/CallToAction.tsx +0 -31
- package/src/core/Button/Icon.tsx +0 -9
- package/src/core/Button/index.spec.tsx +0 -8
- package/src/core/Button/index.tsx +0 -46
- package/src/core/Details/index.spec.tsx +0 -38
- package/src/core/Divider/index.tsx +0 -13
- package/src/core/ErrorSummary/index.spec.tsx +0 -10
- package/src/core/Link/index.spec.tsx +0 -22
- package/src/core/Link/index.tsx +0 -41
- package/src/core/List/ListItemContent.tsx +0 -32
- package/src/core/List/ListItemIcon.tsx +0 -31
- package/src/core/List/ListItemText.tsx +0 -23
- package/src/core/List/ListItemTitle.tsx +0 -37
- package/src/core/List/index.spec.tsx +0 -10
- package/src/core/NavList/NavList.tsx +0 -103
- package/src/core/NavList/NavListContext.tsx +0 -85
- package/src/core/NavList/NavListItem.tsx +0 -143
- package/src/core/NavList/NavListItemBase.tsx +0 -146
- package/src/core/NavList/NavListSubMenu.tsx +0 -33
- package/src/core/NavList/index.spec.tsx +0 -10
- package/src/core/NotificationBanner/index.spec.tsx +0 -27
- package/src/core/NotificationBanner/index.tsx +0 -52
- package/src/core/ServiceBadge/index.tsx +0 -35
- package/src/core/SummaryList/index.spec.tsx +0 -28
- package/src/core/Tabs/index.tsx +0 -36
- package/src/core/WarningText/index.spec.tsx +0 -10
- package/src/custom.d.ts +0 -8
- package/src/govgr/Footer/Copyright.tsx +0 -64
- package/src/govgr/Footer/LicenseCCSA.tsx +0 -24
- package/src/govgr/Footer/index.tsx +0 -49
- package/src/hooks/useDebounce.ts +0 -50
- package/src/hooks/useLatest.ts +0 -12
- package/src/hooks/useSearch.ts +0 -47
- package/src/hooks/useTogglableSections.tsx +0 -102
- package/src/layouts/Basic/Content/index.tsx +0 -24
- package/src/layouts/Basic/index.spec.tsx +0 -24
- package/src/router/index.tsx +0 -28
- package/src/test-utils/delay.ts +0 -9
- package/src/test-utils/mountWithTheme.tsx +0 -33
- package/src/themes/grnet.js +0 -109
- package/src/themes/index.tsx +0 -38
- package/src/typography/Caption.tsx +0 -15
- package/src/typography/NormalText.tsx +0 -7
- package/src/typography/Paragraph.tsx +0 -9
- package/src/typography/Title.tsx +0 -51
- package/src/utils/evaluateBrowserVersion.ts +0 -346
- package/src/utils/withDeprecation.tsx +0 -97
- package/tsconfig.json +0 -18
- package/tsconfig.production.json +0 -27
- package/ui.build.log +0 -17
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
-
import {
|
|
5
|
-
NavLinkInterface,
|
|
6
|
-
NavListProvider,
|
|
7
|
-
} from '@digigov/ui/core/NavList/NavListContext';
|
|
8
|
-
import { BaseCSSProperties } from '@material-ui/core/styles/withStyles';
|
|
9
|
-
|
|
10
|
-
export const useNavListStyles = makeStyles(
|
|
11
|
-
(theme) => ({
|
|
12
|
-
root: {
|
|
13
|
-
padding: theme.spacing(0),
|
|
14
|
-
margin: theme.spacing(0),
|
|
15
|
-
display: 'flex',
|
|
16
|
-
'&$vertical': {
|
|
17
|
-
flexDirection: 'column',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
subMenu: {
|
|
21
|
-
marginLeft: theme.spacing(3),
|
|
22
|
-
},
|
|
23
|
-
floating: {
|
|
24
|
-
left: 0,
|
|
25
|
-
zIndex: 99,
|
|
26
|
-
position: 'absolute',
|
|
27
|
-
background: theme.palette.grey['100'],
|
|
28
|
-
borderTop: `1px solid ${theme.palette.grey['500']}`,
|
|
29
|
-
borderRight: `1px solid ${theme.palette.grey['500']}`,
|
|
30
|
-
borderLeft: `1px solid ${theme.palette.grey['500']}`,
|
|
31
|
-
margin: theme.spacing(1.5, 0, 0, 0),
|
|
32
|
-
boxShadow: theme.shadows[3],
|
|
33
|
-
'& > li': {
|
|
34
|
-
width: '100%',
|
|
35
|
-
borderBottom: `1px solid ${theme.palette.grey['500']}`,
|
|
36
|
-
margin: 0,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
vertical: {},
|
|
40
|
-
floatClear: {
|
|
41
|
-
clear: 'both',
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
{ name: 'MuiNavList' }
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
export interface NavListProps {
|
|
48
|
-
children?: React.ReactNode;
|
|
49
|
-
className?: string;
|
|
50
|
-
horizontal?: boolean;
|
|
51
|
-
openSubMenus?: boolean;
|
|
52
|
-
floating?: boolean;
|
|
53
|
-
subMenu?: boolean;
|
|
54
|
-
links?: NavLinkInterface[];
|
|
55
|
-
style?: BaseCSSProperties;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const NavListBase: React.FC<NavListProps> = ({
|
|
59
|
-
className,
|
|
60
|
-
children,
|
|
61
|
-
floating,
|
|
62
|
-
horizontal,
|
|
63
|
-
subMenu,
|
|
64
|
-
...props
|
|
65
|
-
}) => {
|
|
66
|
-
const classes = useNavListStyles();
|
|
67
|
-
return (
|
|
68
|
-
<nav>
|
|
69
|
-
<ul
|
|
70
|
-
style={props.style}
|
|
71
|
-
className={clsx(
|
|
72
|
-
className,
|
|
73
|
-
classes.root,
|
|
74
|
-
subMenu && classes.subMenu,
|
|
75
|
-
floating && classes.floating,
|
|
76
|
-
!horizontal && classes.vertical
|
|
77
|
-
)}
|
|
78
|
-
>
|
|
79
|
-
{children}
|
|
80
|
-
</ul>
|
|
81
|
-
<div className={classes.floatClear} />
|
|
82
|
-
</nav>
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const NavList: React.FC<NavListProps> = ({
|
|
87
|
-
horizontal,
|
|
88
|
-
openSubMenus = false,
|
|
89
|
-
links = [],
|
|
90
|
-
...props
|
|
91
|
-
}) => {
|
|
92
|
-
return (
|
|
93
|
-
<NavListProvider
|
|
94
|
-
openSubMenus={openSubMenus}
|
|
95
|
-
horizontal={horizontal}
|
|
96
|
-
links={links}
|
|
97
|
-
>
|
|
98
|
-
<NavListBase horizontal={horizontal} {...props} />
|
|
99
|
-
</NavListProvider>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export default NavList;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface NavLinkInterface {
|
|
4
|
-
name?: string;
|
|
5
|
-
label?: string;
|
|
6
|
-
href?: string;
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
subMenu?: NavLinkInterface[];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface NavListContextInterface {
|
|
12
|
-
openSubMenus?: boolean;
|
|
13
|
-
horizontal?: boolean;
|
|
14
|
-
showDividers?: boolean;
|
|
15
|
-
links: NavLinkInterface[];
|
|
16
|
-
activeLink?: NavLinkInterface;
|
|
17
|
-
activeSubMenu?: NavLinkInterface[];
|
|
18
|
-
onSubMenuActive?: (name: string) => void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const NavListContext = createContext<NavListContextInterface>({
|
|
22
|
-
horizontal: false,
|
|
23
|
-
openSubMenus: false,
|
|
24
|
-
links: [],
|
|
25
|
-
activeLink: {},
|
|
26
|
-
activeSubMenu: [],
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const TRAILING_SLASH = /\/$/gm;
|
|
30
|
-
export const NavListProvider: React.FC<NavListContextInterface> = ({
|
|
31
|
-
children,
|
|
32
|
-
openSubMenus = false,
|
|
33
|
-
horizontal = false,
|
|
34
|
-
showDividers = false,
|
|
35
|
-
links = [],
|
|
36
|
-
}) => {
|
|
37
|
-
const [activeSubMenu, setActiveSubMenu] = useState<NavLinkInterface[]>([]);
|
|
38
|
-
const [activeLink, setActiveLink] = useState<NavLinkInterface>({});
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
const currentActiveLink = links.find((link) => {
|
|
41
|
-
if (link.subMenu?.length) {
|
|
42
|
-
return !!~link.subMenu.findIndex(
|
|
43
|
-
(subMenuLink) =>
|
|
44
|
-
window?.location.pathname.replace(TRAILING_SLASH, '') ===
|
|
45
|
-
subMenuLink.href?.replace(TRAILING_SLASH, '')
|
|
46
|
-
);
|
|
47
|
-
} else {
|
|
48
|
-
return (
|
|
49
|
-
window?.location.pathname.replace(TRAILING_SLASH, '') ===
|
|
50
|
-
link.href?.replace(TRAILING_SLASH, '') || false
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}) || { label: '', href: '' };
|
|
54
|
-
setActiveLink(currentActiveLink);
|
|
55
|
-
}, [links]);
|
|
56
|
-
const onSubMenuActive = (href: string): void => {
|
|
57
|
-
if (href === null) {
|
|
58
|
-
setActiveSubMenu([]);
|
|
59
|
-
}
|
|
60
|
-
const link = links.find(
|
|
61
|
-
(link) => link.href === href && link.subMenu && link.subMenu.length
|
|
62
|
-
);
|
|
63
|
-
if (link && link.subMenu) {
|
|
64
|
-
setActiveSubMenu(link.subMenu);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<NavListContext.Provider
|
|
70
|
-
value={{
|
|
71
|
-
openSubMenus,
|
|
72
|
-
horizontal,
|
|
73
|
-
showDividers,
|
|
74
|
-
links,
|
|
75
|
-
activeLink,
|
|
76
|
-
activeSubMenu,
|
|
77
|
-
onSubMenuActive,
|
|
78
|
-
}}
|
|
79
|
-
>
|
|
80
|
-
{children}
|
|
81
|
-
</NavListContext.Provider>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export default NavListContext;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import Divider from '@digigov/react-core/SectionBreak';
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
-
import NavListItemBase from '@digigov/ui/core/NavList/NavListItemBase';
|
|
6
|
-
import NavListSubMenu from '@digigov/ui/core/NavList/NavListSubMenu';
|
|
7
|
-
import NavListContext from '@digigov/ui/core/NavList/NavListContext';
|
|
8
|
-
import { BaseCSSProperties } from '@material-ui/core/styles/withStyles';
|
|
9
|
-
|
|
10
|
-
export interface NavListItemProps {
|
|
11
|
-
name?: string;
|
|
12
|
-
label?: string;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
className?: string;
|
|
15
|
-
href?: string;
|
|
16
|
-
selected?: boolean;
|
|
17
|
-
expandOn?: 'hover' | 'click';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const useNavListItemStyles = makeStyles(
|
|
21
|
-
(theme) => ({
|
|
22
|
-
root: {},
|
|
23
|
-
link: {
|
|
24
|
-
padding: theme.spacing(0.5, 2),
|
|
25
|
-
textDecoration: 'none',
|
|
26
|
-
'&:hover': {
|
|
27
|
-
textDecoration: 'underline',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
selected: {
|
|
31
|
-
borderStyle: 'solid',
|
|
32
|
-
borderColor: theme.palette.secondary.main,
|
|
33
|
-
fontWeight: 'bolder',
|
|
34
|
-
},
|
|
35
|
-
}),
|
|
36
|
-
{ name: 'MuiNavListItem' }
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
export const NavListItem: React.FC<NavListItemProps> = ({
|
|
40
|
-
name,
|
|
41
|
-
expandOn = 'click',
|
|
42
|
-
children,
|
|
43
|
-
href,
|
|
44
|
-
className,
|
|
45
|
-
selected: passSelected,
|
|
46
|
-
...props
|
|
47
|
-
}) => {
|
|
48
|
-
const [open, setOpen] = useState(false);
|
|
49
|
-
const [style, setStyle] = useState<BaseCSSProperties>({});
|
|
50
|
-
const ref = useRef<HTMLLIElement>(null);
|
|
51
|
-
const [delayHandler, setDelayHandler] = useState<
|
|
52
|
-
ReturnType<typeof setTimeout>
|
|
53
|
-
>();
|
|
54
|
-
const [selected, setSelected] = useState(passSelected || false);
|
|
55
|
-
const classes = useNavListItemStyles();
|
|
56
|
-
const {
|
|
57
|
-
openSubMenus,
|
|
58
|
-
horizontal,
|
|
59
|
-
showDividers,
|
|
60
|
-
activeLink,
|
|
61
|
-
links,
|
|
62
|
-
} = useContext(NavListContext);
|
|
63
|
-
const { href: contextHref, label, subMenu } =
|
|
64
|
-
links.find((link) => link.name === name) || {};
|
|
65
|
-
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
if (activeLink?.name && name) {
|
|
68
|
-
setSelected(activeLink.name === name);
|
|
69
|
-
}
|
|
70
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
|
-
}, [activeLink?.name]);
|
|
72
|
-
|
|
73
|
-
const toggleOpen = (): void => {
|
|
74
|
-
setOpen(!open);
|
|
75
|
-
};
|
|
76
|
-
const handleOpen = (): void => {
|
|
77
|
-
if (subMenu && subMenu.length) {
|
|
78
|
-
setDelayHandler(
|
|
79
|
-
setTimeout(() => {
|
|
80
|
-
setOpen(true);
|
|
81
|
-
}, 300)
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const handleClose = (): void => {
|
|
86
|
-
if (subMenu && subMenu.length) {
|
|
87
|
-
if (delayHandler) clearTimeout(delayHandler);
|
|
88
|
-
setOpen(false);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
if (
|
|
93
|
-
ref?.current?.clientWidth &&
|
|
94
|
-
horizontal &&
|
|
95
|
-
ref.current.clientWidth !== style.width
|
|
96
|
-
) {
|
|
97
|
-
setStyle({
|
|
98
|
-
top: ref.current.clientHeight - 12,
|
|
99
|
-
width: ref.current.clientWidth,
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}, [
|
|
103
|
-
horizontal,
|
|
104
|
-
style.width,
|
|
105
|
-
ref.current?.clientWidth,
|
|
106
|
-
ref.current?.clientHeight,
|
|
107
|
-
]);
|
|
108
|
-
|
|
109
|
-
const handlerProps =
|
|
110
|
-
expandOn === 'hover'
|
|
111
|
-
? {
|
|
112
|
-
onMouseEnter: handleOpen,
|
|
113
|
-
onMouseLeave: handleClose,
|
|
114
|
-
}
|
|
115
|
-
: {
|
|
116
|
-
onClick: toggleOpen,
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
return (
|
|
120
|
-
<>
|
|
121
|
-
<NavListItemBase
|
|
122
|
-
ref={ref}
|
|
123
|
-
href={contextHref || href}
|
|
124
|
-
label={label || children}
|
|
125
|
-
expandOn={expandOn}
|
|
126
|
-
open={open}
|
|
127
|
-
selected={selected}
|
|
128
|
-
isNested={subMenu && subMenu.length > 0}
|
|
129
|
-
horizontal={horizontal}
|
|
130
|
-
className={clsx(className, classes.root)}
|
|
131
|
-
{...handlerProps}
|
|
132
|
-
{...props}
|
|
133
|
-
>
|
|
134
|
-
{(open || openSubMenus) && subMenu && subMenu.length && (
|
|
135
|
-
<NavListSubMenu style={style} links={subMenu} />
|
|
136
|
-
)}
|
|
137
|
-
</NavListItemBase>
|
|
138
|
-
{!horizontal && showDividers && <Divider />}
|
|
139
|
-
</>
|
|
140
|
-
);
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export default NavListItem;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
-
import ExpandMore from '@material-ui/icons/ExpandMore';
|
|
5
|
-
import Link from '@digigov/ui/core/Link';
|
|
6
|
-
import { useRouter } from '@digigov/ui/router';
|
|
7
|
-
|
|
8
|
-
const TRAILING_SLASH = /\/$/gm;
|
|
9
|
-
export const useNavListItemBaseStyles = makeStyles(
|
|
10
|
-
(theme) => {
|
|
11
|
-
const transition = {
|
|
12
|
-
duration: theme.transitions.duration.shortest,
|
|
13
|
-
};
|
|
14
|
-
return {
|
|
15
|
-
root: {
|
|
16
|
-
position: 'relative',
|
|
17
|
-
listStyle: 'none',
|
|
18
|
-
boxSizing: 'border-box',
|
|
19
|
-
textAlign: 'left',
|
|
20
|
-
margin: theme.spacing(0),
|
|
21
|
-
...theme.typography.body1,
|
|
22
|
-
'&$horizontal': {
|
|
23
|
-
flexDirection: 'column',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
link: {
|
|
27
|
-
display: 'flex',
|
|
28
|
-
flexGrow: 1,
|
|
29
|
-
padding: theme.spacing(1),
|
|
30
|
-
textDecoration: 'none',
|
|
31
|
-
'&:hover': {
|
|
32
|
-
textDecoration: 'underline',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
selected: {
|
|
36
|
-
fontWeight: 'bolder',
|
|
37
|
-
'&$horizontal': {
|
|
38
|
-
borderStyle: 'solid',
|
|
39
|
-
borderColor: theme.palette.secondary.main,
|
|
40
|
-
borderTop: 0,
|
|
41
|
-
borderLeft: 0,
|
|
42
|
-
borderRight: 0,
|
|
43
|
-
},
|
|
44
|
-
'&$vertical': {
|
|
45
|
-
border: 0,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
// Pseudoclasses - do not remove //
|
|
49
|
-
horizontal: {},
|
|
50
|
-
vertical: {},
|
|
51
|
-
// End Pseudoclasses //
|
|
52
|
-
label: {
|
|
53
|
-
display: 'flex',
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
flex: 'auto',
|
|
56
|
-
},
|
|
57
|
-
icon: {
|
|
58
|
-
display: 'flex',
|
|
59
|
-
alignItems: 'center',
|
|
60
|
-
transform: 'rotate(0deg)',
|
|
61
|
-
transition: theme.transitions.create('transform', transition),
|
|
62
|
-
'&$open': {
|
|
63
|
-
transform: 'rotate(180deg)',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
submenu: {
|
|
67
|
-
display: 'flex',
|
|
68
|
-
},
|
|
69
|
-
/* Pseudo-class applied to the Expand icon if `open={true}`. */
|
|
70
|
-
open: {},
|
|
71
|
-
};
|
|
72
|
-
},
|
|
73
|
-
{ name: 'MuiNavListItemBase' }
|
|
74
|
-
);
|
|
75
|
-
export interface NavListItemBaseProps {
|
|
76
|
-
children?: React.ReactNode;
|
|
77
|
-
href?: string;
|
|
78
|
-
label?: React.ReactNode;
|
|
79
|
-
className?: string;
|
|
80
|
-
expandOn?: 'hover' | 'click';
|
|
81
|
-
selected?: boolean;
|
|
82
|
-
isNested?: boolean;
|
|
83
|
-
horizontal?: boolean;
|
|
84
|
-
open?: boolean;
|
|
85
|
-
onClick?: (e: any) => void;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export const NavListItemBase = React.forwardRef<
|
|
89
|
-
HTMLLIElement,
|
|
90
|
-
NavListItemBaseProps
|
|
91
|
-
>(function NavListItemBase(
|
|
92
|
-
{
|
|
93
|
-
href = '#',
|
|
94
|
-
label,
|
|
95
|
-
children,
|
|
96
|
-
className,
|
|
97
|
-
open = false,
|
|
98
|
-
horizontal = false,
|
|
99
|
-
selected = false,
|
|
100
|
-
isNested,
|
|
101
|
-
expandOn,
|
|
102
|
-
onClick,
|
|
103
|
-
...props
|
|
104
|
-
},
|
|
105
|
-
ref
|
|
106
|
-
) {
|
|
107
|
-
const classes = useNavListItemBaseStyles();
|
|
108
|
-
const [privateSelected, setPrivateSelected] = useState<boolean>(selected);
|
|
109
|
-
const { router } = useRouter();
|
|
110
|
-
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
const asPath = router?.asPath.split('?').shift();
|
|
113
|
-
const isSelected =
|
|
114
|
-
asPath?.replace(TRAILING_SLASH, '') === href.replace(TRAILING_SLASH, '');
|
|
115
|
-
if (isSelected !== privateSelected) {
|
|
116
|
-
setPrivateSelected(isSelected);
|
|
117
|
-
}
|
|
118
|
-
}, [href, router?.asPath, selected, privateSelected]);
|
|
119
|
-
return (
|
|
120
|
-
<li
|
|
121
|
-
ref={ref}
|
|
122
|
-
className={clsx(
|
|
123
|
-
className,
|
|
124
|
-
classes.root,
|
|
125
|
-
horizontal && classes.horizontal
|
|
126
|
-
)}
|
|
127
|
-
onClick={onClick}
|
|
128
|
-
>
|
|
129
|
-
<div
|
|
130
|
-
className={clsx(
|
|
131
|
-
horizontal ? classes.horizontal : classes.vertical,
|
|
132
|
-
(selected || privateSelected) && classes.selected
|
|
133
|
-
)}
|
|
134
|
-
>
|
|
135
|
-
<Link href={href} className={classes.link} {...props}>
|
|
136
|
-
<span className={classes.label}>{label}</span>
|
|
137
|
-
<span className={clsx(classes.icon, open && classes.open)}>
|
|
138
|
-
{isNested && <ExpandMore />}
|
|
139
|
-
</span>
|
|
140
|
-
</Link>
|
|
141
|
-
</div>
|
|
142
|
-
<div className={classes.submenu}>{children}</div>
|
|
143
|
-
</li>
|
|
144
|
-
);
|
|
145
|
-
});
|
|
146
|
-
export default NavListItemBase;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import { NavListBase, NavListProps } from '@digigov/ui/core/NavList';
|
|
3
|
-
import NavListItemBase from '@digigov/ui/core/NavList/NavListItemBase';
|
|
4
|
-
import NavListContext, {
|
|
5
|
-
NavLinkInterface,
|
|
6
|
-
} from '@digigov/ui/core/NavList/NavListContext';
|
|
7
|
-
|
|
8
|
-
export interface NavListSubMenuProps extends NavListProps {
|
|
9
|
-
links: NavLinkInterface[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const NavListSubMenu: React.FC<NavListSubMenuProps> = ({
|
|
13
|
-
links,
|
|
14
|
-
...props
|
|
15
|
-
}) => {
|
|
16
|
-
const { horizontal } = useContext(NavListContext);
|
|
17
|
-
return (
|
|
18
|
-
<NavListBase subMenu floating={horizontal} {...props}>
|
|
19
|
-
{links &&
|
|
20
|
-
links.map((subMenuLink, key) => {
|
|
21
|
-
return (
|
|
22
|
-
<NavListItemBase
|
|
23
|
-
expandOn="hover"
|
|
24
|
-
key={key}
|
|
25
|
-
href={subMenuLink.href}
|
|
26
|
-
label={subMenuLink.label}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
})}
|
|
30
|
-
</NavListBase>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
export default NavListSubMenu;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import mountWithTheme from '@digigov/ui/test-utils/mountWithTheme';
|
|
3
|
-
|
|
4
|
-
import Component from '@digigov/ui/core/NavList';
|
|
5
|
-
|
|
6
|
-
it('renders the ErrorSummary with sample data', () => {
|
|
7
|
-
expect(
|
|
8
|
-
mountWithTheme(<Component>this is some random warning text</Component>)
|
|
9
|
-
).toMatchSnapshot();
|
|
10
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import mountWithTheme from '@digigov/ui/test-utils/mountWithTheme';
|
|
3
|
-
|
|
4
|
-
import NotificationBanner from '@digigov/ui/core/NotificationBanner';
|
|
5
|
-
|
|
6
|
-
it('renders the notification banner', () => {
|
|
7
|
-
expect(
|
|
8
|
-
mountWithTheme(
|
|
9
|
-
<NotificationBanner title="Notification Banner Example">
|
|
10
|
-
this is a notification
|
|
11
|
-
</NotificationBanner>
|
|
12
|
-
)
|
|
13
|
-
).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('renders the notification banner with title and link', () => {
|
|
17
|
-
expect(
|
|
18
|
-
mountWithTheme(
|
|
19
|
-
<NotificationBanner
|
|
20
|
-
title="Notification Banner Example"
|
|
21
|
-
link={{ url: '/', label: 'This is a label' }}
|
|
22
|
-
>
|
|
23
|
-
this is a notification
|
|
24
|
-
</NotificationBanner>
|
|
25
|
-
)
|
|
26
|
-
).toMatchSnapshot();
|
|
27
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import withDeprecation from '@digigov/ui/utils/withDeprecation';
|
|
3
|
-
import CoreNotificationBanner, {
|
|
4
|
-
NotificationBannerProps as CoreNotificationBannerProps,
|
|
5
|
-
} from '@digigov/react-core/NotificationBanner';
|
|
6
|
-
import NotificationBannerHeader from '@digigov/react-core/NotificationBannerHeader';
|
|
7
|
-
import NotificationBannerHeading from '@digigov/react-core/NotificationBannerHeading';
|
|
8
|
-
import NotificationBannerContent from '@digigov/react-core/NotificationBannerContent';
|
|
9
|
-
import NotificationBannerLink from '@digigov/react-core/NotificationBannerLink';
|
|
10
|
-
|
|
11
|
-
export interface NotificationBannerProps extends CoreNotificationBannerProps {
|
|
12
|
-
variant?: 'important' | 'success';
|
|
13
|
-
title?: string;
|
|
14
|
-
link?: { url: string; label: string };
|
|
15
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const NotificationBanner: React.FC<NotificationBannerProps> = withDeprecation(
|
|
19
|
-
({ variant = 'important', title, link, children, ...props }) => {
|
|
20
|
-
const success = variant === 'success';
|
|
21
|
-
title = title ? title : success ? 'Success' : 'Important';
|
|
22
|
-
return (
|
|
23
|
-
<CoreNotificationBanner success={success} {...props}>
|
|
24
|
-
<NotificationBannerHeader>{title}</NotificationBannerHeader>
|
|
25
|
-
<NotificationBannerContent>
|
|
26
|
-
<NotificationBannerHeading>{children}</NotificationBannerHeading>
|
|
27
|
-
{link && (
|
|
28
|
-
<NotificationBannerLink href={link.url}>
|
|
29
|
-
{link.label}
|
|
30
|
-
</NotificationBannerLink>
|
|
31
|
-
)}
|
|
32
|
-
</NotificationBannerContent>
|
|
33
|
-
</CoreNotificationBanner>
|
|
34
|
-
);
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'NotificationBanner',
|
|
38
|
-
props: {
|
|
39
|
-
variant: {
|
|
40
|
-
warning: 'variant prop will be deprecated. Use success:boolean instead',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
export {
|
|
47
|
-
NotificationBannerHeader,
|
|
48
|
-
NotificationBannerContent,
|
|
49
|
-
NotificationBannerHeading,
|
|
50
|
-
NotificationBannerLink,
|
|
51
|
-
};
|
|
52
|
-
export default NotificationBanner;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import withDeprecation from '@digigov/ui/utils/withDeprecation';
|
|
3
|
-
import PhaseBanner, { PhaseBannerProps } from '@digigov/react-core/PhaseBanner';
|
|
4
|
-
import PhaseBannerTag from '@digigov/react-core/PhaseBannerTag';
|
|
5
|
-
import PhaseBannerText from '@digigov/react-core/PhaseBannerText';
|
|
6
|
-
interface ServiceBadgeProps extends PhaseBannerProps {
|
|
7
|
-
// badge text, defaults to 'BETA'
|
|
8
|
-
label?: string;
|
|
9
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
10
|
-
text?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const ServiceBadge: React.FC<ServiceBadgeProps> = withDeprecation(
|
|
14
|
-
({ label = 'BETA', text, children, ...props }) => {
|
|
15
|
-
return (
|
|
16
|
-
<PhaseBanner {...props}>
|
|
17
|
-
{children ? (
|
|
18
|
-
children
|
|
19
|
-
) : (
|
|
20
|
-
<>
|
|
21
|
-
<PhaseBannerTag>{label}</PhaseBannerTag>
|
|
22
|
-
{text && <PhaseBannerText>{text}</PhaseBannerText>}
|
|
23
|
-
</>
|
|
24
|
-
)}
|
|
25
|
-
;
|
|
26
|
-
</PhaseBanner>
|
|
27
|
-
);
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'ServiceBadge',
|
|
31
|
-
rename: 'PhaseBanner',
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export default ServiceBadge;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
SummaryList,
|
|
6
|
-
SummaryListItem,
|
|
7
|
-
SummaryListItemKey,
|
|
8
|
-
SummaryListItemValue,
|
|
9
|
-
SummaryListItemAction,
|
|
10
|
-
} from '@digigov/ui/core/SummaryList';
|
|
11
|
-
|
|
12
|
-
it('renders the SummaryList with sample data', () => {
|
|
13
|
-
expect(
|
|
14
|
-
mount(
|
|
15
|
-
<SummaryList>
|
|
16
|
-
<SummaryListItem>
|
|
17
|
-
<SummaryListItemKey>Όνομα</SummaryListItemKey>
|
|
18
|
-
<SummaryListItemValue> Μάριος</SummaryListItemValue>
|
|
19
|
-
<SummaryListItemAction> Αλλαγή</SummaryListItemAction>
|
|
20
|
-
</SummaryListItem>
|
|
21
|
-
<SummaryListItem>
|
|
22
|
-
<SummaryListItemKey>Επώνυμο</SummaryListItemKey>
|
|
23
|
-
<SummaryListItemValue>Μενεξές</SummaryListItemValue>
|
|
24
|
-
</SummaryListItem>
|
|
25
|
-
</SummaryList>
|
|
26
|
-
)
|
|
27
|
-
).toMatchSnapshot();
|
|
28
|
-
});
|