@digigov/ui 0.21.2 → 0.23.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 +39 -1
- package/admin/AutoComplete/AccesibleAutoComplete/index.d.ts +5 -0
- package/admin/AutoComplete/AccesibleAutoComplete/index.js +106 -0
- package/admin/AutoComplete/AutoComplete.stories.d.ts +13 -0
- package/admin/AutoComplete/AutoComplete.stories.js +115 -0
- package/admin/AutoComplete/Status/index.d.ts +40 -0
- package/admin/AutoComplete/Status/index.js +184 -0
- package/{app/CopyToClipboard → admin/AutoComplete}/__stories__/Default.d.ts +0 -0
- package/admin/AutoComplete/__stories__/Default.js +34 -0
- package/admin/AutoComplete/__stories__/WithAutoSelect.d.ts +3 -0
- package/admin/AutoComplete/__stories__/WithAutoSelect.js +35 -0
- package/admin/AutoComplete/__stories__/WithDefaultValue.d.ts +3 -0
- package/admin/AutoComplete/__stories__/WithDefaultValue.js +33 -0
- package/admin/AutoComplete/__stories__/WithInLine.d.ts +3 -0
- package/admin/AutoComplete/__stories__/WithInLine.js +33 -0
- package/admin/AutoComplete/__stories__/WithMinLength.d.ts +3 -0
- package/admin/AutoComplete/__stories__/WithMinLength.js +35 -0
- package/admin/AutoComplete/__stories__/WithPlaceHolder.d.ts +3 -0
- package/admin/AutoComplete/__stories__/WithPlaceHolder.js +33 -0
- package/admin/AutoComplete/__stories__/WithShowAllValues.d.ts +3 -0
- package/admin/AutoComplete/__stories__/WithShowAllValues.js +33 -0
- package/admin/AutoComplete/index.d.ts +101 -0
- package/admin/AutoComplete/index.js +744 -0
- package/admin/AutoComplete/index.mdx +46 -0
- package/admin/AutoComplete/utils.d.ts +1 -0
- package/admin/AutoComplete/utils.js +13 -0
- package/admin/CopyToClipboard/CopyToClipboard.stories.d.ts +9 -0
- package/admin/CopyToClipboard/CopyToClipboard.stories.js +58 -0
- package/admin/CopyToClipboard/__stories__/Banner.d.ts +3 -0
- package/admin/CopyToClipboard/__stories__/Banner.js +30 -0
- package/admin/CopyToClipboard/__stories__/Default.d.ts +3 -0
- package/admin/CopyToClipboard/__stories__/Default.js +32 -0
- package/admin/CopyToClipboard/__stories__/MultipleCopies.d.ts +3 -0
- package/{app/CopyToClipboard/__stories__/Default.js → admin/CopyToClipboard/__stories__/MultipleCopies.js} +20 -18
- package/admin/CopyToClipboard/index.d.ts +1 -1
- package/admin/CopyToClipboard/index.js +3 -2
- package/admin/CopyToClipboard/index.mdx +22 -0
- package/admin/Drawer/__stories__/Default.js +1 -1
- package/admin/Drawer/index.mdx +12 -0
- package/admin/Dropdown/Dropdown.stories.d.ts +9 -0
- package/admin/Dropdown/Dropdown.stories.js +60 -0
- package/admin/Dropdown/__stories__/AlignRight.d.ts +3 -0
- package/admin/Dropdown/__stories__/AlignRight.js +83 -0
- package/admin/Dropdown/__stories__/Default.d.ts +3 -0
- package/admin/Dropdown/__stories__/Default.js +75 -0
- package/admin/Dropdown/__stories__/PlacementTop.d.ts +3 -0
- package/admin/Dropdown/__stories__/PlacementTop.js +83 -0
- package/admin/Dropdown/index.d.ts +7 -1
- package/admin/Dropdown/index.js +29 -1
- package/admin/Dropdown/index.mdx +29 -0
- package/admin/FilterSection/index.d.ts +1 -0
- package/admin/FilterSection/index.js +14 -0
- package/admin/Modal/Modal.stories.d.ts +8 -0
- package/admin/Modal/Modal.stories.js +44 -0
- package/admin/Modal/__stories__/AlertDialog.d.ts +3 -0
- package/admin/Modal/__stories__/AlertDialog.js +80 -0
- package/admin/Modal/__stories__/Default.d.ts +3 -0
- package/admin/Modal/__stories__/Default.js +79 -0
- package/admin/Modal/index.mdx +26 -0
- package/admin/Pagination/__stories__/Default.js +57 -16
- package/admin/Pagination/index.mdx +12 -0
- package/admin/index.d.ts +2 -1
- package/admin/index.js +17 -4
- package/api/fetchAPI.js +6 -4
- package/api/index.spec.js +18 -19
- package/api/useResource.js +6 -4
- package/api/useResourceAction.js +6 -4
- package/api/useResourceQuery.js +7 -4
- package/api/utils.js +8 -6
- package/app/Confirmation/Confirmation.mdx +9 -0
- package/app/Footer/Footer.mdx +27 -0
- package/app/Header/index.mdx +18 -0
- package/app/I18nText.js +7 -7
- package/app/NotFound/index.mdx +12 -0
- package/app/PhaseBannerHeader/index.mdx +12 -0
- package/core/Accordion/__stories__/Default.js +17 -1
- package/core/Accordion/__stories__/WithHints.js +17 -1
- package/core/Accordion/index.mdx +16 -84
- package/core/BackLink/index.mdx +16 -0
- package/core/Blockquote/index.mdx +17 -2
- package/core/Breadcrumbs/__stories__/Default.js +13 -1
- package/core/Breadcrumbs/breadcrumbs.mdx +22 -0
- package/core/Button/Button.stories.d.ts +5 -0
- package/core/Button/Button.stories.js +72 -0
- package/core/Button/__stories__/Back.d.ts +4 -0
- package/core/Button/__stories__/Back.js +26 -0
- package/core/Button/__stories__/ButtonLinkButton.d.ts +6 -0
- package/core/Button/__stories__/ButtonLinkButton.js +30 -0
- package/core/Button/__stories__/CallToActionButton.d.ts +6 -0
- package/core/Button/__stories__/CallToActionButton.js +30 -0
- package/core/Button/__stories__/Disabled.d.ts +6 -0
- package/core/Button/__stories__/Disabled.js +27 -0
- package/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
- package/core/Button/__stories__/Primary.js +3 -1
- package/core/Button/__stories__/Secondary.js +3 -2
- package/core/Button/__stories__/Warning.js +2 -1
- package/core/Button/__stories__/WithVariantLink.d.ts +6 -0
- package/core/Button/__stories__/WithVariantLink.js +29 -0
- package/core/Button/index.mdx +97 -0
- package/core/Card/Card.stories.d.ts +1 -0
- package/core/Card/Card.stories.js +14 -0
- package/core/Card/__stories__/WithClickableLink.js +1 -3
- package/core/Card/__stories__/WithGroupButton.d.ts +3 -0
- package/core/Card/__stories__/WithGroupButton.js +32 -0
- package/core/Card/card.mdx +78 -0
- package/core/Checkboxes/Checkbox.stories.d.ts +1 -0
- package/core/Checkboxes/Checkbox.stories.js +14 -0
- package/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
- package/core/Checkboxes/__stories__/Default.js +5 -1
- package/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
- package/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
- package/core/Checkboxes/__stories__/NoneAnswerWithError.d.ts +3 -0
- package/core/Checkboxes/__stories__/NoneAnswerWithError.js +57 -0
- package/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
- package/core/Checkboxes/__stories__/WithHint.js +5 -1
- package/core/Checkboxes/checkboxes.mdx +54 -0
- package/core/Confirmation/confirmation.mdx +19 -0
- package/core/DateInput/DateInput.stories.d.ts +1 -0
- package/core/DateInput/DateInput.stories.js +14 -0
- package/core/DateInput/__stories__/Default.js +3 -1
- package/core/DateInput/__stories__/MultipleQuestions.d.ts +3 -0
- package/core/DateInput/__stories__/MultipleQuestions.js +41 -0
- package/core/DateInput/index.mdx +34 -0
- package/core/Details/index.mdx +9 -25
- package/core/ErrorMessage/__stories__/Default.js +1 -1
- package/core/ErrorMessage/index.mdx +21 -0
- package/core/ErrorSummary/__stories__/LinkedToCheckbox.js +1 -1
- package/core/ErrorSummary/index.mdx +21 -38
- package/core/FileUpload/__stories__/Default.d.ts +1 -0
- package/core/FileUpload/__stories__/Default.js +4 -2
- package/core/FileUpload/index.mdx +22 -0
- package/core/Link/__stories__/DarkBackground.js +4 -2
- package/core/Link/__stories__/DarkBackgroundNoUnderline.js +4 -2
- package/core/Link/__stories__/Default.js +3 -1
- package/core/Link/__stories__/NoUnderline.js +3 -1
- package/core/Link/link.mdx +34 -0
- package/core/List/index.mdx +22 -3
- package/core/Masthead/masthead.mdx +14 -0
- package/core/NavList/NavList.d.ts +1 -14
- package/core/NavList/NavList.js +14 -71
- package/core/NavList/NavList.stories.d.ts +8 -0
- package/core/NavList/NavList.stories.js +44 -0
- package/core/NavList/NavListBase.d.ts +4 -0
- package/core/NavList/NavListBase.js +76 -0
- package/core/NavList/NavListItem.d.ts +1 -0
- package/core/NavList/NavListItem.js +3 -1
- package/core/NavList/NavListItemBase.d.ts +1 -0
- package/core/NavList/NavListItemBase.js +7 -3
- package/core/NavList/NavListSubMenu.d.ts +1 -1
- package/core/NavList/NavListSubMenu.js +2 -2
- package/core/NavList/__stories__/Default.d.ts +3 -0
- package/core/NavList/__stories__/Default.js +69 -0
- package/core/NavList/__stories__/NavHorizontalLayout.d.ts +3 -0
- package/core/NavList/__stories__/NavHorizontalLayout.js +67 -0
- package/core/NavList/index.mdx +22 -1
- package/core/NavList/types.d.ts +14 -0
- package/core/NavList/types.js +5 -0
- package/core/NotificationBanner/index.mdx +13 -60
- package/core/PhaseBanner/PhaseBanner.stories.d.ts +1 -0
- package/core/PhaseBanner/PhaseBanner.stories.js +14 -0
- package/core/PhaseBanner/__stories__/Underlined.d.ts +3 -0
- package/{admin/CopyToClipboardMessage/index.js → core/PhaseBanner/__stories__/Underlined.js} +21 -17
- package/core/PhaseBanner/index.mdx +24 -0
- package/core/Radios/__stories__/ConditionalReveal.js +5 -1
- package/core/Radios/__stories__/Default.js +1 -3
- package/core/Radios/__stories__/Inline.js +5 -1
- package/core/Radios/__stories__/MultipleQuestions.js +7 -3
- package/core/Radios/__stories__/WithErrorMessage.js +7 -1
- package/core/Radios/__stories__/WithHints.js +17 -7
- package/core/Radios/index.mdx +56 -0
- package/core/Select/Select.stories.d.ts +1 -0
- package/core/Select/Select.stories.js +14 -0
- package/core/Select/__stories__/Default.js +2 -2
- package/core/Select/__stories__/DisabledInput.js +3 -1
- package/core/Select/__stories__/WithHint.d.ts +3 -0
- package/core/Select/__stories__/WithHint.js +45 -0
- package/core/Select/index.mdx +42 -0
- package/core/SummaryList/SummaryList.stories.d.ts +2 -2
- package/core/SummaryList/SummaryList.stories.js +8 -8
- package/core/SummaryList/__stories__/Default.js +1 -1
- package/core/SummaryList/__stories__/WithActions.d.ts +3 -0
- package/core/SummaryList/__stories__/{SummaryListWithActions.js → WithActions.js} +10 -12
- package/core/SummaryList/__stories__/WithoutBorders.d.ts +3 -0
- package/core/SummaryList/__stories__/{SummaryListWithoutBorders.js → WithoutBorders.js} +5 -5
- package/core/SummaryList/index.mdx +17 -65
- package/core/Table/Table.stories.d.ts +1 -0
- package/core/Table/Table.stories.js +14 -0
- package/core/Table/TableFloatingScroll.d.ts +3 -0
- package/core/Table/TableFloatingScroll.js +105 -0
- package/core/Table/__stories__/DarkVariant.js +1 -1
- package/core/Table/__stories__/Default.js +1 -1
- package/core/Table/__stories__/NoData.js +3 -1
- package/core/Table/__stories__/TableCaptions.d.ts +3 -0
- package/core/Table/__stories__/TableCaptions.js +30 -0
- package/core/Table/__stories__/WithLoader.js +16 -12
- package/core/Table/index.d.ts +1 -0
- package/core/Table/index.js +13 -0
- package/core/Table/index.mdx +59 -0
- package/core/Tabs/__stories__/Default.d.ts +1 -0
- package/core/Tabs/__stories__/Default.js +6 -2
- package/core/Tabs/index.mdx +10 -2
- package/core/TextArea/index.mdx +50 -0
- package/core/TextInput/index.mdx +59 -0
- package/core/VisuallyHidden/__stories__/Default.js +14 -2
- package/core/VisuallyHidden/index.mdx +17 -0
- package/core/WarningText/index.mdx +10 -35
- package/es/admin/AutoComplete/AccesibleAutoComplete/index.js +87 -0
- package/es/admin/AutoComplete/AutoComplete.stories.js +13 -0
- package/es/admin/AutoComplete/Status/index.js +153 -0
- package/es/admin/AutoComplete/__stories__/Default.js +19 -0
- package/es/admin/AutoComplete/__stories__/WithAutoSelect.js +20 -0
- package/es/admin/AutoComplete/__stories__/WithDefaultValue.js +18 -0
- package/es/admin/AutoComplete/__stories__/WithInLine.js +18 -0
- package/es/admin/AutoComplete/__stories__/WithMinLength.js +19 -0
- package/es/admin/AutoComplete/__stories__/WithPlaceHolder.js +18 -0
- package/es/admin/AutoComplete/__stories__/WithShowAllValues.js +18 -0
- package/es/admin/AutoComplete/index.js +676 -0
- package/es/admin/AutoComplete/index.mdx +46 -0
- package/es/admin/AutoComplete/utils.js +6 -0
- package/es/admin/CopyToClipboard/CopyToClipboard.stories.js +8 -0
- package/es/admin/CopyToClipboard/__stories__/Banner.js +16 -0
- package/es/admin/CopyToClipboard/__stories__/Default.js +18 -0
- package/{esm/app/CopyToClipboard/__stories__/Default.js → es/admin/CopyToClipboard/__stories__/MultipleCopies.js} +10 -8
- package/es/admin/CopyToClipboard/index.js +3 -2
- package/es/admin/CopyToClipboard/index.mdx +22 -0
- package/es/admin/Drawer/__stories__/Default.js +1 -1
- package/es/admin/Drawer/index.mdx +12 -0
- package/es/admin/Dropdown/Dropdown.stories.js +9 -0
- package/es/admin/Dropdown/__stories__/AlignRight.js +56 -0
- package/es/admin/Dropdown/__stories__/Default.js +48 -0
- package/es/admin/Dropdown/__stories__/PlacementTop.js +56 -0
- package/es/admin/Dropdown/index.js +28 -1
- package/es/admin/Dropdown/index.mdx +29 -0
- package/es/admin/FilterSection/index.js +1 -0
- package/es/admin/Modal/Modal.stories.js +7 -0
- package/es/admin/Modal/__stories__/AlertDialog.js +58 -0
- package/es/admin/Modal/__stories__/Default.js +56 -0
- package/es/admin/Modal/index.mdx +26 -0
- package/es/admin/Pagination/__stories__/Default.js +56 -16
- package/es/admin/Pagination/index.mdx +12 -0
- package/es/admin/index.js +3 -2
- package/es/api/fetchAPI.js +6 -3
- package/es/api/index.spec.js +19 -17
- package/es/api/useResource.js +6 -3
- package/es/api/useResourceAction.js +6 -3
- package/es/api/useResourceQuery.js +6 -3
- package/es/api/utils.js +8 -5
- package/es/app/Confirmation/Confirmation.mdx +9 -0
- package/es/app/Footer/Footer.mdx +27 -0
- package/es/app/Header/index.mdx +18 -0
- package/es/app/I18nText.js +7 -6
- package/es/app/NotFound/index.mdx +12 -0
- package/es/app/PhaseBannerHeader/index.mdx +12 -0
- package/es/core/Accordion/__stories__/Default.js +17 -1
- package/es/core/Accordion/__stories__/WithHints.js +17 -1
- package/es/core/Accordion/index.mdx +16 -84
- package/es/core/BackLink/index.mdx +16 -0
- package/es/core/Blockquote/index.mdx +17 -2
- package/es/core/Breadcrumbs/__stories__/Default.js +13 -1
- package/es/core/Breadcrumbs/breadcrumbs.mdx +22 -0
- package/es/core/Button/Button.stories.js +7 -1
- package/es/core/Button/__stories__/Back.js +13 -0
- package/es/core/Button/__stories__/ButtonLinkButton.js +17 -0
- package/es/core/Button/__stories__/CallToActionButton.js +17 -0
- package/es/core/Button/__stories__/Disabled.js +14 -0
- package/es/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
- package/es/core/Button/__stories__/Primary.js +3 -1
- package/es/core/Button/__stories__/Secondary.js +3 -2
- package/es/core/Button/__stories__/Warning.js +2 -1
- package/es/core/Button/__stories__/WithVariantLink.js +16 -0
- package/es/core/Button/index.mdx +97 -0
- package/es/core/Card/Card.stories.js +2 -1
- package/es/core/Card/__stories__/WithClickableLink.js +2 -3
- package/es/core/Card/__stories__/WithGroupButton.js +11 -0
- package/es/core/Card/card.mdx +78 -0
- package/es/core/Checkboxes/Checkbox.stories.js +1 -0
- package/es/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
- package/es/core/Checkboxes/__stories__/Default.js +5 -1
- package/es/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
- package/es/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
- package/es/core/Checkboxes/__stories__/NoneAnswerWithError.js +34 -0
- package/es/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
- package/es/core/Checkboxes/__stories__/WithHint.js +5 -1
- package/es/core/Checkboxes/checkboxes.mdx +54 -0
- package/es/core/Confirmation/confirmation.mdx +19 -0
- package/es/core/DateInput/DateInput.stories.js +1 -0
- package/es/core/DateInput/__stories__/Default.js +3 -1
- package/es/core/DateInput/__stories__/MultipleQuestions.js +20 -0
- package/es/core/DateInput/index.mdx +34 -0
- package/es/core/Details/index.mdx +9 -25
- package/es/core/ErrorMessage/__stories__/Default.js +1 -1
- package/es/core/ErrorMessage/index.mdx +21 -0
- package/es/core/ErrorSummary/__stories__/LinkedToCheckbox.js +1 -1
- package/es/core/ErrorSummary/index.mdx +21 -38
- package/es/core/FileUpload/__stories__/Default.js +2 -1
- package/es/core/FileUpload/index.mdx +22 -0
- package/es/core/Link/__stories__/DarkBackground.js +7 -5
- package/es/core/Link/__stories__/DarkBackgroundNoUnderline.js +7 -5
- package/es/core/Link/__stories__/Default.js +5 -3
- package/es/core/Link/__stories__/NoUnderline.js +5 -3
- package/es/core/Link/link.mdx +34 -0
- package/es/core/List/index.mdx +22 -3
- package/es/core/Masthead/masthead.mdx +14 -0
- package/es/core/NavList/NavList.js +11 -64
- package/es/core/NavList/NavList.stories.js +7 -0
- package/es/core/NavList/NavListBase.js +60 -0
- package/es/core/NavList/NavListItem.js +3 -1
- package/es/core/NavList/NavListItemBase.js +7 -3
- package/es/core/NavList/NavListSubMenu.js +1 -1
- package/es/core/NavList/__stories__/Default.js +48 -0
- package/es/core/NavList/__stories__/NavHorizontalLayout.js +46 -0
- package/es/core/NavList/index.mdx +22 -1
- package/es/core/NavList/types.js +1 -0
- package/es/core/NotificationBanner/index.mdx +13 -60
- package/es/core/PhaseBanner/PhaseBanner.stories.js +2 -1
- package/es/core/PhaseBanner/__stories__/Underlined.js +14 -0
- package/es/core/PhaseBanner/index.mdx +24 -0
- package/es/core/Radios/__stories__/ConditionalReveal.js +5 -1
- package/es/core/Radios/__stories__/Default.js +1 -2
- package/es/core/Radios/__stories__/Inline.js +5 -1
- package/es/core/Radios/__stories__/MultipleQuestions.js +7 -3
- package/es/core/Radios/__stories__/WithErrorMessage.js +7 -1
- package/es/core/Radios/__stories__/WithHints.js +17 -7
- package/es/core/Radios/index.mdx +56 -0
- package/es/core/Select/Select.stories.js +2 -1
- package/es/core/Select/__stories__/Default.js +5 -4
- package/es/core/Select/__stories__/DisabledInput.js +5 -3
- package/es/core/Select/__stories__/WithHint.js +23 -0
- package/es/core/Select/index.mdx +42 -0
- package/es/core/SummaryList/SummaryList.stories.js +2 -2
- package/es/core/SummaryList/__stories__/Default.js +1 -1
- package/es/core/SummaryList/__stories__/WithActions.js +20 -0
- package/es/core/SummaryList/__stories__/WithoutBorders.js +11 -0
- package/es/core/SummaryList/index.mdx +17 -65
- package/es/core/Table/Table.stories.js +1 -0
- package/es/core/Table/TableFloatingScroll.js +85 -0
- package/es/core/Table/__stories__/DarkVariant.js +1 -1
- package/es/core/Table/__stories__/Default.js +1 -1
- package/es/core/Table/__stories__/NoData.js +3 -1
- package/es/core/Table/__stories__/TableCaptions.js +17 -0
- package/es/core/Table/__stories__/WithLoader.js +12 -10
- package/es/core/Table/index.js +2 -1
- package/es/core/Table/index.mdx +59 -0
- package/es/core/Tabs/__stories__/Default.js +3 -2
- package/es/core/Tabs/index.mdx +10 -2
- package/es/core/TextArea/index.mdx +50 -0
- package/es/core/TextInput/index.mdx +59 -0
- package/es/core/VisuallyHidden/__stories__/Default.js +9 -5
- package/es/core/VisuallyHidden/index.mdx +17 -0
- package/es/core/WarningText/index.mdx +10 -35
- package/es/govgr/Footer/index.mdx +4 -4
- package/es/introduction.md +4 -1
- package/es/layouts/Basic/Content/index.mdx +0 -12
- package/es/layouts/Basic/Main/index.mdx +0 -10
- package/es/layouts/Basic/Masthead/index.mdx +0 -12
- package/es/layouts/Basic/Side/index.mdx +0 -12
- package/es/layouts/Basic/Top/index.mdx +0 -12
- package/es/layouts/Basic/index.mdx +1 -15
- package/es/layouts/Grid/Grid.stories.js +2 -1
- package/es/layouts/Grid/__stories__/Default.js +26 -6
- package/es/layouts/Grid/__stories__/Inline.js +75 -0
- package/es/layouts/Grid/index.js +1 -0
- package/es/layouts/index.js +2 -0
- package/es/registry.js +66 -30
- package/es/test-utils/delay.js +6 -3
- package/es/typography/Caption/index.mdx +16 -0
- package/es/typography/Hint/index.mdx +16 -0
- package/es/typography/NormalText/index.mdx +26 -0
- package/es/typography/Paragraph/index.mdx +30 -0
- package/es/typography/Title/index.mdx +12 -0
- package/esm/admin/AutoComplete/AccesibleAutoComplete/index.js +87 -0
- package/esm/admin/AutoComplete/AutoComplete.stories.js +13 -0
- package/esm/admin/AutoComplete/Status/index.js +153 -0
- package/esm/admin/AutoComplete/__stories__/Default.js +19 -0
- package/esm/admin/AutoComplete/__stories__/WithAutoSelect.js +20 -0
- package/esm/admin/AutoComplete/__stories__/WithDefaultValue.js +18 -0
- package/esm/admin/AutoComplete/__stories__/WithInLine.js +18 -0
- package/esm/admin/AutoComplete/__stories__/WithMinLength.js +19 -0
- package/esm/admin/AutoComplete/__stories__/WithPlaceHolder.js +18 -0
- package/esm/admin/AutoComplete/__stories__/WithShowAllValues.js +18 -0
- package/esm/admin/AutoComplete/index.js +676 -0
- package/esm/admin/AutoComplete/index.mdx +46 -0
- package/esm/admin/AutoComplete/utils.js +6 -0
- package/esm/admin/CopyToClipboard/CopyToClipboard.stories.js +8 -0
- package/esm/admin/CopyToClipboard/__stories__/Banner.js +16 -0
- package/esm/admin/CopyToClipboard/__stories__/Default.js +18 -0
- package/{es/app/CopyToClipboard/__stories__/Default.js → esm/admin/CopyToClipboard/__stories__/MultipleCopies.js} +10 -8
- package/esm/admin/CopyToClipboard/index.js +3 -2
- package/esm/admin/CopyToClipboard/index.mdx +22 -0
- package/esm/admin/Drawer/__stories__/Default.js +1 -1
- package/esm/admin/Drawer/index.mdx +12 -0
- package/esm/admin/Dropdown/Dropdown.stories.js +9 -0
- package/esm/admin/Dropdown/__stories__/AlignRight.js +56 -0
- package/esm/admin/Dropdown/__stories__/Default.js +48 -0
- package/esm/admin/Dropdown/__stories__/PlacementTop.js +56 -0
- package/esm/admin/Dropdown/index.js +28 -1
- package/esm/admin/Dropdown/index.mdx +29 -0
- package/esm/admin/FilterSection/index.js +1 -0
- package/esm/admin/Modal/Modal.stories.js +7 -0
- package/esm/admin/Modal/__stories__/AlertDialog.js +58 -0
- package/esm/admin/Modal/__stories__/Default.js +56 -0
- package/esm/admin/Modal/index.mdx +26 -0
- package/esm/admin/Pagination/__stories__/Default.js +56 -16
- package/esm/admin/Pagination/index.mdx +12 -0
- package/esm/admin/index.js +3 -2
- package/esm/api/fetchAPI.js +6 -3
- package/esm/api/index.spec.js +19 -17
- package/esm/api/useResource.js +6 -3
- package/esm/api/useResourceAction.js +6 -3
- package/esm/api/useResourceQuery.js +6 -3
- package/esm/api/utils.js +8 -5
- package/esm/app/Confirmation/Confirmation.mdx +9 -0
- package/esm/app/Footer/Footer.mdx +27 -0
- package/esm/app/Header/index.mdx +18 -0
- package/esm/app/I18nText.js +7 -6
- package/esm/app/NotFound/index.mdx +12 -0
- package/esm/app/PhaseBannerHeader/index.mdx +12 -0
- package/esm/core/Accordion/__stories__/Default.js +17 -1
- package/esm/core/Accordion/__stories__/WithHints.js +17 -1
- package/esm/core/Accordion/index.mdx +16 -84
- package/esm/core/BackLink/index.mdx +16 -0
- package/esm/core/Blockquote/index.mdx +17 -2
- package/esm/core/Breadcrumbs/__stories__/Default.js +13 -1
- package/esm/core/Breadcrumbs/breadcrumbs.mdx +22 -0
- package/esm/core/Button/Button.stories.js +7 -1
- package/esm/core/Button/__stories__/Back.js +13 -0
- package/esm/core/Button/__stories__/ButtonLinkButton.js +17 -0
- package/esm/core/Button/__stories__/CallToActionButton.js +17 -0
- package/esm/core/Button/__stories__/Disabled.js +14 -0
- package/esm/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
- package/esm/core/Button/__stories__/Primary.js +3 -1
- package/esm/core/Button/__stories__/Secondary.js +3 -2
- package/esm/core/Button/__stories__/Warning.js +2 -1
- package/esm/core/Button/__stories__/WithVariantLink.js +16 -0
- package/esm/core/Button/index.mdx +97 -0
- package/esm/core/Card/Card.stories.js +2 -1
- package/esm/core/Card/__stories__/WithClickableLink.js +2 -3
- package/esm/core/Card/__stories__/WithGroupButton.js +11 -0
- package/esm/core/Card/card.mdx +78 -0
- package/esm/core/Checkboxes/Checkbox.stories.js +1 -0
- package/esm/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
- package/esm/core/Checkboxes/__stories__/Default.js +5 -1
- package/esm/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
- package/esm/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
- package/esm/core/Checkboxes/__stories__/NoneAnswerWithError.js +34 -0
- package/esm/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
- package/esm/core/Checkboxes/__stories__/WithHint.js +5 -1
- package/esm/core/Checkboxes/checkboxes.mdx +54 -0
- package/esm/core/Confirmation/confirmation.mdx +19 -0
- package/esm/core/DateInput/DateInput.stories.js +1 -0
- package/esm/core/DateInput/__stories__/Default.js +3 -1
- package/esm/core/DateInput/__stories__/MultipleQuestions.js +20 -0
- package/esm/core/DateInput/index.mdx +34 -0
- package/esm/core/Details/index.mdx +9 -25
- package/esm/core/ErrorMessage/__stories__/Default.js +1 -1
- package/esm/core/ErrorMessage/index.mdx +21 -0
- package/esm/core/ErrorSummary/__stories__/LinkedToCheckbox.js +1 -1
- package/esm/core/ErrorSummary/index.mdx +21 -38
- package/esm/core/FileUpload/__stories__/Default.js +2 -1
- package/esm/core/FileUpload/index.mdx +22 -0
- package/esm/core/Link/__stories__/DarkBackground.js +7 -5
- package/esm/core/Link/__stories__/DarkBackgroundNoUnderline.js +7 -5
- package/esm/core/Link/__stories__/Default.js +5 -3
- package/esm/core/Link/__stories__/NoUnderline.js +5 -3
- package/esm/core/Link/link.mdx +34 -0
- package/esm/core/List/index.mdx +22 -3
- package/esm/core/Masthead/masthead.mdx +14 -0
- package/esm/core/NavList/NavList.js +11 -64
- package/esm/core/NavList/NavList.stories.js +7 -0
- package/esm/core/NavList/NavListBase.js +60 -0
- package/esm/core/NavList/NavListItem.js +3 -1
- package/esm/core/NavList/NavListItemBase.js +7 -3
- package/esm/core/NavList/NavListSubMenu.js +1 -1
- package/esm/core/NavList/__stories__/Default.js +48 -0
- package/esm/core/NavList/__stories__/NavHorizontalLayout.js +46 -0
- package/esm/core/NavList/index.mdx +22 -1
- package/esm/core/NavList/types.js +1 -0
- package/esm/core/NotificationBanner/index.mdx +13 -60
- package/esm/core/PhaseBanner/PhaseBanner.stories.js +2 -1
- package/esm/core/PhaseBanner/__stories__/Underlined.js +14 -0
- package/esm/core/PhaseBanner/index.mdx +24 -0
- package/esm/core/Radios/__stories__/ConditionalReveal.js +5 -1
- package/esm/core/Radios/__stories__/Default.js +1 -2
- package/esm/core/Radios/__stories__/Inline.js +5 -1
- package/esm/core/Radios/__stories__/MultipleQuestions.js +7 -3
- package/esm/core/Radios/__stories__/WithErrorMessage.js +7 -1
- package/esm/core/Radios/__stories__/WithHints.js +17 -7
- package/esm/core/Radios/index.mdx +56 -0
- package/esm/core/Select/Select.stories.js +2 -1
- package/esm/core/Select/__stories__/Default.js +5 -4
- package/esm/core/Select/__stories__/DisabledInput.js +5 -3
- package/esm/core/Select/__stories__/WithHint.js +23 -0
- package/esm/core/Select/index.mdx +42 -0
- package/esm/core/SummaryList/SummaryList.stories.js +2 -2
- package/esm/core/SummaryList/__stories__/Default.js +1 -1
- package/esm/core/SummaryList/__stories__/WithActions.js +20 -0
- package/esm/core/SummaryList/__stories__/WithoutBorders.js +11 -0
- package/esm/core/SummaryList/index.mdx +17 -65
- package/esm/core/Table/Table.stories.js +1 -0
- package/esm/core/Table/TableFloatingScroll.js +85 -0
- package/esm/core/Table/__stories__/DarkVariant.js +1 -1
- package/esm/core/Table/__stories__/Default.js +1 -1
- package/esm/core/Table/__stories__/NoData.js +3 -1
- package/esm/core/Table/__stories__/TableCaptions.js +17 -0
- package/esm/core/Table/__stories__/WithLoader.js +12 -10
- package/esm/core/Table/index.js +2 -1
- package/esm/core/Table/index.mdx +59 -0
- package/esm/core/Tabs/__stories__/Default.js +3 -2
- package/esm/core/Tabs/index.mdx +10 -2
- package/esm/core/TextArea/index.mdx +50 -0
- package/esm/core/TextInput/index.mdx +59 -0
- package/esm/core/VisuallyHidden/__stories__/Default.js +9 -5
- package/esm/core/VisuallyHidden/index.mdx +17 -0
- package/esm/core/WarningText/index.mdx +10 -35
- package/esm/govgr/Footer/index.mdx +4 -4
- package/esm/index.js +1 -1
- package/esm/introduction.md +4 -1
- package/esm/layouts/Basic/Content/index.mdx +0 -12
- package/esm/layouts/Basic/Main/index.mdx +0 -10
- package/esm/layouts/Basic/Masthead/index.mdx +0 -12
- package/esm/layouts/Basic/Side/index.mdx +0 -12
- package/esm/layouts/Basic/Top/index.mdx +0 -12
- package/esm/layouts/Basic/index.mdx +1 -15
- package/esm/layouts/Grid/Grid.stories.js +2 -1
- package/esm/layouts/Grid/__stories__/Default.js +26 -6
- package/esm/layouts/Grid/__stories__/Inline.js +75 -0
- package/esm/layouts/Grid/index.js +1 -0
- package/esm/layouts/index.js +2 -0
- package/esm/registry.js +66 -30
- package/esm/test-utils/delay.js +6 -3
- package/esm/typography/Caption/index.mdx +16 -0
- package/esm/typography/Hint/index.mdx +16 -0
- package/esm/typography/NormalText/index.mdx +26 -0
- package/esm/typography/Paragraph/index.mdx +30 -0
- package/esm/typography/Title/index.mdx +12 -0
- package/govgr/Footer/index.mdx +4 -4
- package/introduction.md +4 -1
- package/layouts/Basic/Content/index.mdx +0 -12
- package/layouts/Basic/Main/index.mdx +0 -10
- package/layouts/Basic/Masthead/index.mdx +0 -12
- package/layouts/Basic/Side/index.mdx +0 -12
- package/layouts/Basic/Top/index.mdx +0 -12
- package/layouts/Basic/index.mdx +1 -15
- package/layouts/Grid/Grid.stories.d.ts +1 -0
- package/layouts/Grid/Grid.stories.js +14 -0
- package/layouts/Grid/__stories__/Default.js +26 -6
- package/layouts/Grid/__stories__/Inline.d.ts +3 -0
- package/layouts/Grid/__stories__/Inline.js +88 -0
- package/layouts/Grid/index.d.ts +1 -0
- package/layouts/Grid/index.js +6 -0
- package/layouts/index.d.ts +2 -0
- package/layouts/index.js +22 -1
- package/package.json +3 -3
- package/registry.d.ts +33 -15
- package/registry.js +99 -45
- package/test-utils/delay.js +5 -3
- package/typography/Caption/index.mdx +16 -0
- package/typography/Hint/index.mdx +16 -0
- package/typography/NormalText/index.mdx +26 -0
- package/typography/Paragraph/index.mdx +30 -0
- package/typography/Title/index.mdx +12 -0
- package/admin/CopyToClipboardMessage/index.d.ts +0 -3
- package/app/CopyToClipboard/CopyToClipboard.stories.d.ts +0 -7
- package/app/CopyToClipboard/CopyToClipboard.stories.js +0 -30
- package/app/CopyToClipboard/index.d.ts +0 -9
- package/app/CopyToClipboard/index.js +0 -69
- package/app/NotFound/NotFound.mdx +0 -5
- package/app/QrCodeScanner/index.mdx +0 -7
- package/core/Button/Button.mdx +0 -55
- package/core/SummaryList/__stories__/SummaryListWithActions.d.ts +0 -3
- package/core/SummaryList/__stories__/SummaryListWithoutBorders.d.ts +0 -3
- package/es/admin/CopyToClipboardMessage/index.js +0 -3
- package/es/app/CopyToClipboard/CopyToClipboard.stories.js +0 -6
- package/es/app/CopyToClipboard/index.js +0 -45
- package/es/app/NotFound/NotFound.mdx +0 -5
- package/es/app/QrCodeScanner/index.mdx +0 -7
- package/es/core/Button/Button.mdx +0 -55
- package/es/core/SummaryList/__stories__/SummaryListWithActions.js +0 -21
- package/es/core/SummaryList/__stories__/SummaryListWithoutBorders.js +0 -11
- package/esm/admin/CopyToClipboardMessage/index.js +0 -3
- package/esm/app/CopyToClipboard/CopyToClipboard.stories.js +0 -6
- package/esm/app/CopyToClipboard/index.js +0 -45
- package/esm/app/NotFound/NotFound.mdx +0 -5
- package/esm/app/QrCodeScanner/index.mdx +0 -7
- package/esm/core/Button/Button.mdx +0 -55
- package/esm/core/SummaryList/__stories__/SummaryListWithActions.js +0 -21
- package/esm/core/SummaryList/__stories__/SummaryListWithoutBorders.js +0 -11
|
@@ -1,59 +1,42 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
id: error-summary
|
|
3
|
+
title: ErrorSummary
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Error Summary
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
# ErrorSummary
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
Use this component at the top of a page to summarise any errors a user has made.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import Paragraph from '@digigov/ui/typography/Paragraph';
|
|
15
|
-
function CustomWarning (props){
|
|
16
|
-
return (
|
|
17
|
-
<ErrorSummary><Paragraph>Action Label</Paragraph></ErrorSummary>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
export CustomErrorSummary
|
|
11
|
+
When a user makes an error, you must show both an error summary and an error message next to each answer that contains an error.
|
|
12
|
+
|
|
21
13
|
|
|
22
|
-
```
|
|
23
14
|
|
|
24
|
-
|
|
15
|
+
```bash
|
|
16
|
+
import ErrorSummary from '@digigov/ui/core/ErrorSummary';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## How to use
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
<Story packageName="@digigov/ui" component="core/ErrorSummary" story="Default.tsx" />
|
|
27
22
|
|
|
28
|
-
Use this component at the top of a page to summarise any errors a user has
|
|
29
|
-
made.
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
message next to each answer that contains an error.
|
|
24
|
+
### Linking from the error summary to each answer
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
You must link the errors in the error summary to the answer they relate to.
|
|
35
27
|
|
|
36
|
-
|
|
28
|
+
For questions that require a user to answer using a single field, like a file upload, select, textarea, text input or character count, link to the field.
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
- include the heading "There is a problem"
|
|
40
|
-
- link to each of the answers that have validation errors
|
|
41
|
-
- make sure the error messages in the error summary are worded the same as
|
|
42
|
-
those which appear next to the inputs with errors
|
|
30
|
+
<Story packageName="@digigov/ui" component="core/ErrorSummary" story="LinkedToInput.tsx" />
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
example, by adding "Error: " to the beginning of the page `<title>` so screen
|
|
46
|
-
readers read it out as soon as possible.
|
|
32
|
+
When a user has to enter their answer into multiple fields, such as the day, month and year fields in the date input component, link to the first field that contains an error.
|
|
47
33
|
|
|
48
|
-
|
|
34
|
+
If you do not know which field contains an error, link to the first field.
|
|
49
35
|
|
|
50
|
-
|
|
36
|
+
<Story packageName="@digigov/ui" component="core/ErrorSummary" story="LinkedToField.tsx" />
|
|
51
37
|
|
|
52
|
-
|
|
38
|
+
For questions that require a user to select one or more options from a list using radios or checkboxes, link to the first radio or checkbox.
|
|
53
39
|
|
|
54
|
-
<
|
|
55
|
-
<br />
|
|
40
|
+
<Story packageName="@digigov/ui" component="core/ErrorSummary" story="LinkedToCheckbox.tsx" />
|
|
56
41
|
|
|
57
|
-
### Styles
|
|
58
42
|
|
|
59
|
-
<StylesDoc data={ErrorSummary.__doc__} />
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: file-upload
|
|
3
|
+
title: FileUpload
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FileUpload
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
import FileUpload from '@digigov/ui/core/FileUpload';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## How to use
|
|
15
|
+
|
|
16
|
+
<Story packageName="@digigov/ui" component="core/FileUpload" story="Default.tsx" />
|
|
17
|
+
|
|
18
|
+
### Error message
|
|
19
|
+
|
|
20
|
+
Error messages should be styled like this:
|
|
21
|
+
|
|
22
|
+
<Story packageName="@digigov/ui" component="core/FileUpload" story="WithErrorMessage.tsx" />
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import Link from
|
|
3
|
-
import { Masthead } from
|
|
4
|
-
import SectionBreak from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Link from '@digigov/ui/core/Link';
|
|
3
|
+
import { Masthead } from '@digigov/ui/layouts';
|
|
4
|
+
import SectionBreak from '@digigov/ui/core/Divider';
|
|
5
5
|
|
|
6
6
|
var _ref = /*#__PURE__*/React.createElement(Masthead, null, /*#__PURE__*/React.createElement(SectionBreak, null), /*#__PURE__*/React.createElement(Link, {
|
|
7
|
+
"aria-label": "\u03C0\u03BB\u03BF\u03B7\u03B3\u03B7\u03B8\u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03B9\u03C3\u03C4\u03BF\u03C3\u03B5\u03BB\u03AF\u03B4\u03B1 \u03C4\u03BF govgr",
|
|
8
|
+
role: "link",
|
|
7
9
|
href: "#"
|
|
8
|
-
}, "
|
|
10
|
+
}, "govgr link"), /*#__PURE__*/React.createElement(SectionBreak, null));
|
|
9
11
|
|
|
10
12
|
export var DarkBackground = function DarkBackground() {
|
|
11
13
|
return _ref;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import Link from
|
|
3
|
-
import { Masthead } from
|
|
4
|
-
import SectionBreak from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Link from '@digigov/ui/core/Link';
|
|
3
|
+
import { Masthead } from '@digigov/ui/layouts';
|
|
4
|
+
import SectionBreak from '@digigov/ui/core/Divider';
|
|
5
5
|
|
|
6
6
|
var _ref = /*#__PURE__*/React.createElement(Masthead, null, /*#__PURE__*/React.createElement(SectionBreak, null), /*#__PURE__*/React.createElement(Link, {
|
|
7
|
+
"aria-label": "\u03C0\u03BB\u03BF\u03B7\u03B3\u03B7\u03B8\u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03B9\u03C3\u03C4\u03BF\u03C3\u03B5\u03BB\u03AF\u03B4\u03B1 \u03C4\u03BF govgr",
|
|
8
|
+
role: "link",
|
|
7
9
|
href: "#",
|
|
8
10
|
underline: false
|
|
9
|
-
}, "
|
|
11
|
+
}, "govgr link"), /*#__PURE__*/React.createElement(SectionBreak, null));
|
|
10
12
|
|
|
11
13
|
export var DarkBackgroundNoUnderline = function DarkBackgroundNoUnderline() {
|
|
12
14
|
return _ref;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import Link from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Link from '@digigov/ui/core/Link';
|
|
3
3
|
|
|
4
4
|
var _ref = /*#__PURE__*/React.createElement(Link, {
|
|
5
|
+
"aria-label": "\u03C0\u03BB\u03BF\u03B7\u03B3\u03B7\u03B8\u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03B9\u03C3\u03C4\u03BF\u03C3\u03B5\u03BB\u03AF\u03B4\u03B1 \u03C4\u03BF govgr",
|
|
6
|
+
role: "link",
|
|
5
7
|
href: "#"
|
|
6
|
-
}, "
|
|
8
|
+
}, "govgr link");
|
|
7
9
|
|
|
8
10
|
export var Default = function Default() {
|
|
9
11
|
return _ref;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import Link from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Link from '@digigov/ui/core/Link';
|
|
3
3
|
|
|
4
4
|
var _ref = /*#__PURE__*/React.createElement(Link, {
|
|
5
|
+
"aria-label": "\u03C0\u03BB\u03BF\u03B7\u03B3\u03B7\u03B8\u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03B9\u03C3\u03C4\u03BF\u03C3\u03B5\u03BB\u03AF\u03B4\u03B1 \u03C4\u03BF govgr",
|
|
6
|
+
role: "link",
|
|
5
7
|
href: "#",
|
|
6
8
|
underline: false
|
|
7
|
-
}, "
|
|
9
|
+
}, "govgr link");
|
|
8
10
|
|
|
9
11
|
export var NoUnderline = function NoUnderline() {
|
|
10
12
|
return _ref;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: link
|
|
3
|
+
title: Link
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
import Link from '@digigov/ui/core/Link';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## How to use
|
|
11
|
+
|
|
12
|
+
### Default
|
|
13
|
+
|
|
14
|
+
<Story packageName="@digigov/ui" component="core/Link" story="Default.tsx" />
|
|
15
|
+
|
|
16
|
+
### No Underline
|
|
17
|
+
|
|
18
|
+
<Story packageName="@digigov/ui" component="core/Link" story="NoUnderline.tsx" />
|
|
19
|
+
|
|
20
|
+
### Opens in a new tab
|
|
21
|
+
|
|
22
|
+
<Story packageName="@digigov/ui" component="core/Link" story="OpensInNewTab.tsx" />
|
|
23
|
+
|
|
24
|
+
### At dark background
|
|
25
|
+
|
|
26
|
+
<Story packageName="@digigov/ui" component="core/Link" story="DarkBackground.tsx" />
|
|
27
|
+
|
|
28
|
+
### At dark background and no underline
|
|
29
|
+
|
|
30
|
+
<Story packageName="@digigov/ui" component="core/Link" story="DarkBackgroundNoUnderline.tsx" />
|
|
31
|
+
|
|
32
|
+
You can read more about the accessibility patterns used in our Link
|
|
33
|
+
implementation in the ARIA Authoring Practices Guide (APG) at
|
|
34
|
+
[Link](https://www.w3.org/WAI/ARIA/apg/patterns/link/) section.
|
package/esm/core/List/index.mdx
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: list
|
|
2
3
|
title: List
|
|
3
|
-
parent: docs/ui/components
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import List, { ListItem } from '@digigov/ui/core/List';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
```bash
|
|
8
|
+
import List from '@digigov/ui/core/List';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## How to use
|
|
12
|
+
|
|
13
|
+
### Default
|
|
14
|
+
|
|
15
|
+
<Story packageName="@digigov/ui" component="core/List" story="Default.tsx" />
|
|
16
|
+
|
|
17
|
+
### List with bullets
|
|
18
|
+
|
|
19
|
+
<Story packageName="@digigov/ui" component="core/List" story="BulletList.tsx" />
|
|
20
|
+
|
|
21
|
+
### List with numbers
|
|
22
|
+
|
|
23
|
+
<Story packageName="@digigov/ui" component="core/List" story="NumberedList.tsx" />
|
|
24
|
+
|
|
25
|
+
### List with extra space
|
|
26
|
+
|
|
27
|
+
<Story packageName="@digigov/ui" component="core/List" story="WithExtraSpace.tsx" />
|
|
@@ -1,78 +1,25 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
4
|
-
_excluded2 = ["horizontal", "openSubMenus", "links"];
|
|
3
|
+
var _excluded = ["horizontal", "openSubMenus", "links", "role"];
|
|
5
4
|
import React from 'react';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
8
5
|
import { NavListProvider } from '@digigov/ui/core/NavList/NavListContext';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
subMenu: {
|
|
20
|
-
marginLeft: theme.spacing(3)
|
|
21
|
-
},
|
|
22
|
-
floating: {
|
|
23
|
-
left: 0,
|
|
24
|
-
zIndex: 99,
|
|
25
|
-
position: 'absolute',
|
|
26
|
-
background: theme.palette.grey['100'],
|
|
27
|
-
borderTop: "1px solid ".concat(theme.palette.grey['500']),
|
|
28
|
-
borderRight: "1px solid ".concat(theme.palette.grey['500']),
|
|
29
|
-
borderLeft: "1px solid ".concat(theme.palette.grey['500']),
|
|
30
|
-
margin: theme.spacing(1.5, 0, 0, 0),
|
|
31
|
-
boxShadow: theme.shadows[3],
|
|
32
|
-
'& > li': {
|
|
33
|
-
width: '100%',
|
|
34
|
-
borderBottom: "1px solid ".concat(theme.palette.grey['500']),
|
|
35
|
-
margin: 0
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
vertical: {},
|
|
39
|
-
floatClear: {
|
|
40
|
-
clear: 'both'
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}, {
|
|
44
|
-
name: 'MuiNavList'
|
|
45
|
-
});
|
|
46
|
-
export var NavListBase = function NavListBase(_ref) {
|
|
47
|
-
var className = _ref.className,
|
|
48
|
-
children = _ref.children,
|
|
49
|
-
floating = _ref.floating,
|
|
50
|
-
horizontal = _ref.horizontal,
|
|
51
|
-
subMenu = _ref.subMenu,
|
|
6
|
+
import { NavListBase } from '@digigov/ui/core/NavList/NavListBase';
|
|
7
|
+
export var NavList = function NavList(_ref) {
|
|
8
|
+
var horizontal = _ref.horizontal,
|
|
9
|
+
_ref$openSubMenus = _ref.openSubMenus,
|
|
10
|
+
openSubMenus = _ref$openSubMenus === void 0 ? false : _ref$openSubMenus,
|
|
11
|
+
_ref$links = _ref.links,
|
|
12
|
+
links = _ref$links === void 0 ? [] : _ref$links,
|
|
13
|
+
role = _ref.role,
|
|
52
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
53
15
|
|
|
54
|
-
var classes = useNavListStyles();
|
|
55
|
-
return /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement("ul", {
|
|
56
|
-
style: props.style,
|
|
57
|
-
className: clsx(className, classes.root, !horizontal && classes.vertical, floating && classes.floating, subMenu && classes.subMenu)
|
|
58
|
-
}, children), /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: classes.floatClear
|
|
60
|
-
}));
|
|
61
|
-
};
|
|
62
|
-
export var NavList = function NavList(_ref2) {
|
|
63
|
-
var horizontal = _ref2.horizontal,
|
|
64
|
-
_ref2$openSubMenus = _ref2.openSubMenus,
|
|
65
|
-
openSubMenus = _ref2$openSubMenus === void 0 ? false : _ref2$openSubMenus,
|
|
66
|
-
_ref2$links = _ref2.links,
|
|
67
|
-
links = _ref2$links === void 0 ? [] : _ref2$links,
|
|
68
|
-
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
69
|
-
|
|
70
16
|
return /*#__PURE__*/React.createElement(NavListProvider, {
|
|
71
17
|
openSubMenus: openSubMenus,
|
|
72
18
|
horizontal: horizontal,
|
|
73
19
|
links: links
|
|
74
20
|
}, /*#__PURE__*/React.createElement(NavListBase, _extends({
|
|
75
|
-
horizontal: horizontal
|
|
21
|
+
horizontal: horizontal,
|
|
22
|
+
role: role
|
|
76
23
|
}, props)));
|
|
77
24
|
};
|
|
78
25
|
export default NavList;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import NavList from '@digigov/ui/core/NavList';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Digigov UI/core/NavList',
|
|
4
|
+
component: NavList
|
|
5
|
+
};
|
|
6
|
+
export * from '@digigov/ui/core/NavList/__stories__/Default';
|
|
7
|
+
export * from '@digigov/ui/core/NavList/__stories__/NavHorizontalLayout';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["className", "children", "floating", "horizontal", "subMenu", "role"];
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
6
|
+
export var useNavListStyles = makeStyles(function (theme) {
|
|
7
|
+
return {
|
|
8
|
+
root: {
|
|
9
|
+
padding: theme.spacing(0),
|
|
10
|
+
margin: theme.spacing(0),
|
|
11
|
+
display: 'flex',
|
|
12
|
+
'&$vertical': {
|
|
13
|
+
flexDirection: 'column'
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
subMenu: {
|
|
17
|
+
marginLeft: theme.spacing(3)
|
|
18
|
+
},
|
|
19
|
+
floating: {
|
|
20
|
+
left: 0,
|
|
21
|
+
zIndex: 99,
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
background: theme.palette.grey['100'],
|
|
24
|
+
borderTop: "1px solid ".concat(theme.palette.grey['500']),
|
|
25
|
+
borderRight: "1px solid ".concat(theme.palette.grey['500']),
|
|
26
|
+
borderLeft: "1px solid ".concat(theme.palette.grey['500']),
|
|
27
|
+
margin: theme.spacing(1.5, 0, 0, 0),
|
|
28
|
+
boxShadow: theme.shadows[3],
|
|
29
|
+
'& > li': {
|
|
30
|
+
width: '100%',
|
|
31
|
+
borderBottom: "1px solid ".concat(theme.palette.grey['500']),
|
|
32
|
+
margin: 0
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
vertical: {},
|
|
36
|
+
floatClear: {
|
|
37
|
+
clear: 'both'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
name: 'MuiNavList'
|
|
42
|
+
});
|
|
43
|
+
export var NavListBase = function NavListBase(_ref) {
|
|
44
|
+
var className = _ref.className,
|
|
45
|
+
children = _ref.children,
|
|
46
|
+
floating = _ref.floating,
|
|
47
|
+
horizontal = _ref.horizontal,
|
|
48
|
+
subMenu = _ref.subMenu,
|
|
49
|
+
role = _ref.role,
|
|
50
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
|
|
52
|
+
var classes = useNavListStyles();
|
|
53
|
+
return /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement("ul", {
|
|
54
|
+
style: props.style,
|
|
55
|
+
role: role,
|
|
56
|
+
className: clsx(className, classes.root, !horizontal && classes.vertical, floating && classes.floating, subMenu && classes.subMenu)
|
|
57
|
+
}, children), /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: classes.floatClear
|
|
59
|
+
}));
|
|
60
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["name", "expandOn", "children", "href", "className", "selected"];
|
|
4
|
+
var _excluded = ["name", "expandOn", "children", "href", "className", "selected", "role"];
|
|
5
5
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import Divider from '@digigov/react-core/SectionBreak';
|
|
@@ -41,6 +41,7 @@ export var NavListItem = function NavListItem(_ref) {
|
|
|
41
41
|
href = _ref.href,
|
|
42
42
|
className = _ref.className,
|
|
43
43
|
passSelected = _ref.selected,
|
|
44
|
+
role = _ref.role,
|
|
44
45
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
46
|
|
|
46
47
|
var _useState = useState(false),
|
|
@@ -132,6 +133,7 @@ export var NavListItem = function NavListItem(_ref) {
|
|
|
132
133
|
selected: selected,
|
|
133
134
|
isNested: subMenu && subMenu.length > 0,
|
|
134
135
|
horizontal: horizontal,
|
|
136
|
+
role: role,
|
|
135
137
|
className: clsx(className, classes.root)
|
|
136
138
|
}, handlerProps, props), (open || openSubMenus) && subMenu && subMenu.length && /*#__PURE__*/React.createElement(NavListSubMenu, {
|
|
137
139
|
style: style,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
-
var _excluded = ["href", "label", "children", "className", "open", "horizontal", "selected", "isNested", "expandOn", "onClick"];
|
|
4
|
+
var _excluded = ["href", "label", "children", "className", "open", "horizontal", "selected", "isNested", "expandOn", "onClick", "role"];
|
|
5
5
|
import React, { useState, useEffect } from 'react';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -93,6 +93,7 @@ export var NavListItemBase = /*#__PURE__*/React.forwardRef(function NavListItemB
|
|
|
93
93
|
isNested = _ref.isNested,
|
|
94
94
|
expandOn = _ref.expandOn,
|
|
95
95
|
onClick = _ref.onClick,
|
|
96
|
+
role = _ref.role,
|
|
96
97
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
97
98
|
|
|
98
99
|
var classes = useNavListItemBaseStyles();
|
|
@@ -116,13 +117,16 @@ export var NavListItemBase = /*#__PURE__*/React.forwardRef(function NavListItemB
|
|
|
116
117
|
return /*#__PURE__*/React.createElement("li", {
|
|
117
118
|
ref: ref,
|
|
118
119
|
className: clsx(className, classes.root, horizontal && classes.horizontal),
|
|
119
|
-
onClick: onClick
|
|
120
|
+
onClick: onClick,
|
|
121
|
+
role: "none"
|
|
120
122
|
}, /*#__PURE__*/React.createElement("div", {
|
|
121
123
|
className: clsx(horizontal ? classes.horizontal : classes.vertical, (selected || privateSelected) && classes.selected)
|
|
122
124
|
}, /*#__PURE__*/React.createElement(Link, _extends({
|
|
123
125
|
href: href,
|
|
124
126
|
className: classes.link
|
|
125
|
-
}, props
|
|
127
|
+
}, props, {
|
|
128
|
+
role: role
|
|
129
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
126
130
|
className: classes.label
|
|
127
131
|
}, label), /*#__PURE__*/React.createElement("span", {
|
|
128
132
|
className: clsx(classes.icon, open && classes.open)
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["links"];
|
|
4
4
|
import React, { useContext } from 'react';
|
|
5
|
-
import { NavListBase } from '@digigov/ui/core/NavList';
|
|
5
|
+
import { NavListBase } from '@digigov/ui/core/NavList/NavListBase';
|
|
6
6
|
import NavListItemBase from '@digigov/ui/core/NavList/NavListItemBase';
|
|
7
7
|
import NavListContext from '@digigov/ui/core/NavList/NavListContext';
|
|
8
8
|
export var NavListSubMenu = function NavListSubMenu(_ref) {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import NavList, { NavListItem } from '@digigov/ui/core/NavList';
|
|
3
|
+
var links = [{
|
|
4
|
+
name: 'Nav1',
|
|
5
|
+
href: '#',
|
|
6
|
+
label: 'Nav list item 1'
|
|
7
|
+
}, {
|
|
8
|
+
name: 'Nav2',
|
|
9
|
+
href: '#',
|
|
10
|
+
label: 'Nav list item 2',
|
|
11
|
+
subMenu: [{
|
|
12
|
+
name: 'Nav2.1',
|
|
13
|
+
href: '#',
|
|
14
|
+
label: 'Nav list item 2.1'
|
|
15
|
+
}, {
|
|
16
|
+
name: 'Nav2.2',
|
|
17
|
+
href: '#',
|
|
18
|
+
label: 'Nav list item 2.2'
|
|
19
|
+
}, {
|
|
20
|
+
name: 'Nav2.3',
|
|
21
|
+
href: '#',
|
|
22
|
+
label: 'Nav list item 2.3'
|
|
23
|
+
}, {
|
|
24
|
+
name: 'Nav2.4',
|
|
25
|
+
href: '#',
|
|
26
|
+
label: 'Nav list item 2.4'
|
|
27
|
+
}]
|
|
28
|
+
}, {
|
|
29
|
+
name: 'Nav3',
|
|
30
|
+
href: '#',
|
|
31
|
+
label: 'Nav list item 3'
|
|
32
|
+
}];
|
|
33
|
+
export var Default = function Default() {
|
|
34
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavList, {
|
|
35
|
+
links: links,
|
|
36
|
+
"aria-label": "Nav list",
|
|
37
|
+
role: "menu"
|
|
38
|
+
}, links.map(function (link, key) {
|
|
39
|
+
return /*#__PURE__*/React.createElement(NavListItem, {
|
|
40
|
+
key: key,
|
|
41
|
+
name: link.name,
|
|
42
|
+
"aria-label": link.label,
|
|
43
|
+
role: "menuitem",
|
|
44
|
+
"aria-haspopup": link.subMenu ? 'true' : 'false'
|
|
45
|
+
});
|
|
46
|
+
})));
|
|
47
|
+
};
|
|
48
|
+
export default Default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import NavList, { NavListItem } from '@digigov/ui/core/NavList';
|
|
3
|
+
var links = [{
|
|
4
|
+
name: 'Nav1',
|
|
5
|
+
href: '#',
|
|
6
|
+
label: 'Nav list item 1'
|
|
7
|
+
}, {
|
|
8
|
+
name: 'Nav2',
|
|
9
|
+
href: '#',
|
|
10
|
+
label: 'Nav list item 2',
|
|
11
|
+
subMenu: [{
|
|
12
|
+
name: 'Nav2.1',
|
|
13
|
+
href: '#',
|
|
14
|
+
label: 'Nav list item 2.1'
|
|
15
|
+
}, {
|
|
16
|
+
name: 'Nav2.2',
|
|
17
|
+
href: '#',
|
|
18
|
+
label: 'Nav list item 2.2'
|
|
19
|
+
}, {
|
|
20
|
+
name: 'Nav2.3',
|
|
21
|
+
href: '#',
|
|
22
|
+
label: 'Nav list item 2.3'
|
|
23
|
+
}]
|
|
24
|
+
}, {
|
|
25
|
+
name: 'Nav3',
|
|
26
|
+
href: '#',
|
|
27
|
+
label: 'Nav list item 3'
|
|
28
|
+
}];
|
|
29
|
+
export var NavHorizontalLayout = function NavHorizontalLayout() {
|
|
30
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavList, {
|
|
31
|
+
horizontal: true,
|
|
32
|
+
links: links,
|
|
33
|
+
role: "menubar",
|
|
34
|
+
"aria-orientation": "horizontal",
|
|
35
|
+
"aria-label": "Nav list"
|
|
36
|
+
}, links.map(function (link, key) {
|
|
37
|
+
return /*#__PURE__*/React.createElement(NavListItem, {
|
|
38
|
+
"aria-label": link.label,
|
|
39
|
+
role: "menuitem",
|
|
40
|
+
"aria-haspopup": link.subMenu ? 'true' : 'false',
|
|
41
|
+
key: key,
|
|
42
|
+
name: link.name
|
|
43
|
+
});
|
|
44
|
+
})));
|
|
45
|
+
};
|
|
46
|
+
export default NavHorizontalLayout;
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: NavList
|
|
2
3
|
title: NavList
|
|
3
|
-
parent: docs/ui/components
|
|
4
4
|
---
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
import NavList, { NavListItem } from '@digigov/ui/core/NavList';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## How to use
|
|
11
|
+
|
|
12
|
+
### Vertical NavList
|
|
13
|
+
|
|
14
|
+
<Story packageName="@digigov/ui" component="core/NavList" story="Default.tsx" />
|
|
15
|
+
|
|
16
|
+
### Horizontal NavList
|
|
17
|
+
|
|
18
|
+
<Story packageName="@digigov/ui" component="core/NavList" story="NavHorizontalLayout.tsx" />
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Accessibility
|
|
22
|
+
|
|
23
|
+
You can read more about the accessibility patterns used in our NavList
|
|
24
|
+
implementation in the ARIA Authoring Practices Guide (APG) at
|
|
25
|
+
[Menu or Menu bar](https://www.w3.org/WAI/ARIA/apg/patterns/menu/).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|