@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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: autocomplete
|
|
3
|
+
title: AutoComplete
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Autocomplete is a feature in which an input field suggests a word based on user input. This allows users to quickly search
|
|
8
|
+
through, select from large collections of options and help services get more consistent data.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### How to import
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
import AutoComplete from '@digigov/ui/admin/AutoComplete';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### AutoComplete
|
|
20
|
+
|
|
21
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="Default.tsx" />
|
|
22
|
+
|
|
23
|
+
### AutoComplete with auto select
|
|
24
|
+
|
|
25
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithAutoSelect.tsx" />
|
|
26
|
+
|
|
27
|
+
### AutoComplete with inline style
|
|
28
|
+
|
|
29
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithInLine.tsx" />
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### AutoComplete with default value
|
|
33
|
+
|
|
34
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithDefaultValue.tsx" />
|
|
35
|
+
|
|
36
|
+
### AutoComplete with placeholder
|
|
37
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithPlaceHolder.tsx" />
|
|
38
|
+
|
|
39
|
+
### AutoComplete with all option's values
|
|
40
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithShowAllValues.tsx" />
|
|
41
|
+
|
|
42
|
+
### AutoComplete with min length
|
|
43
|
+
|
|
44
|
+
This is the minimum number of characters that should be entered before the autocomplete will attempt to suggest options(in above example is 2)
|
|
45
|
+
|
|
46
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithMinLength.tsx" />
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default function suggest(query, syncResults) {
|
|
2
|
+
var results = ['Afghanistan', 'Akrotiri', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua and Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Ashmore and Cartier Islands', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas, The', 'Bahrain', 'Bangladesh', 'Barbados', 'Bassas da India', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia and Herzegovina', 'Botswana', 'Bouvet Island', 'Brazil', 'British Indian Ocean Territory', 'British Virgin Islands', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burma', 'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde', 'Cayman Islands', 'Central African Republic', 'Chad', 'Chile', 'China', 'Christmas Island', 'Clipperton Island', 'Cocos (Keeling) Islands', 'Colombia', 'Comoros', 'Congo', 'Cook Islands', 'Coral Sea Islands', 'Costa Rica', "Cote d'Ivoire", 'Croatia', 'Cuba', 'Cyprus', 'Czech Republic', 'Denmark', 'Dhekelia', 'Djibouti', 'Dominica', 'Dominican Republic', 'Ecuador', 'Egypt', 'El Salvador', 'Equatorial Guinea', 'Eritrea', 'Estonia', 'Ethiopia', 'Europa Island', 'Falkland Islands', 'Faroe Islands', 'Fiji', 'Finland', 'France', 'French Guiana', 'French Polynesia', 'French Southern and Antarctic Lands', 'Gabon', 'Gambia,', 'Gaza Strip', 'Georgia', 'Germany', 'Ghana', 'Gibraltar', 'Glorioso Islands', 'Greece', 'Greenland', 'Grenada', 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', 'Haiti', 'Heard Island and McDonald Islands', 'Holy See (Vatican City)', 'Honduras', 'Hong Kong', 'Hungary', 'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Isle of Man', 'Israel', 'Italy', 'Jamaica', 'Jan Mayen', 'Japan', 'Jersey', 'Jordan', 'Juan de Nova Island', 'Kazakhstan', 'Kenya', 'Kiribati', 'Korea, North', 'Korea, South', 'Kuwait', 'Kyrgyzstan', 'Laos', 'Latvia', 'Lebanon', 'Lesotho', 'Liberia', 'Libya', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Macau', 'Macedonia', 'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Martinique', 'Mauritania', 'Mauritius', 'Mayotte', 'Mexico', 'Micronesia, Federated States of', 'Moldova', 'Monaco', 'Mongolia', 'Montserrat', 'Morocco', 'Mozambique', 'Namibia', 'Nauru', 'Navassa Island', 'Nepal', 'Netherlands', 'Netherlands Antilles', 'New Caledonia', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Norfolk Island', 'Northern Mariana Islands', 'Norway', 'Oman', 'Pakistan', 'Palau', 'Panama', 'Papua New Guinea', 'Paracel Islands', 'Paraguay', 'Peru', 'Philippines', 'Pitcairn Islands', 'Poland', 'Portugal', 'Puerto Rico', 'Qatar', 'Reunion', 'Romania', 'Russia', 'Rwanda', 'Saint Helena', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Pierre and Miquelon', 'Saint Vincent and the Grenadines', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Saudi Arabia', 'Senegal', 'Serbia and Montenegro', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovakia', 'Slovenia', 'Solomon Islands', 'Somalia', 'South Africa', 'South Georgia and the South Sandwich Islands', 'Spain', 'Spratly Islands', 'Sri Lanka', 'Sudan', 'Suriname', 'Svalbard', 'Swaziland', 'Sweden', 'Switzerland', 'Syria', 'Taiwan', 'Tajikistan', 'Tanzania', 'Thailand', 'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad and Tobago', 'Tromelin Island', 'Tunisia', 'Turkey', 'Turkmenistan', 'Turks and Caicos Islands', 'Tuvalu', 'Uganda', 'Ukraine', 'United Arab Emirates', 'United Kingdom', 'United States', 'Uruguay', 'Uzbekistan', 'Vanuatu', 'Venezuela', 'Vietnam', 'Virgin Islands', 'Wake Island', 'Wallis and Futuna', 'West Bank', 'Western Sahara', 'Yemen', 'Zambia', 'Zimbabwe'];
|
|
3
|
+
syncResults(query ? results.filter(function (result) {
|
|
4
|
+
return result.toLowerCase().indexOf(query.toLowerCase()) !== -1;
|
|
5
|
+
}) : []);
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import CopyToClipboard from '@digigov/ui/admin/CopyToClipboard';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Digigov UI/admin/CopyToClipboard',
|
|
4
|
+
component: CopyToClipboard
|
|
5
|
+
};
|
|
6
|
+
export * from '@digigov/ui/admin/CopyToClipboard/__stories__/Default';
|
|
7
|
+
export * from '@digigov/ui/admin/CopyToClipboard/__stories__/Banner';
|
|
8
|
+
export * from '@digigov/ui/admin/CopyToClipboard/__stories__/MultipleCopies';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CopyToClipboard } from '@digigov/ui/admin';
|
|
3
|
+
import { Button } from '@digigov/ui';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
6
|
+
text: "copied-text",
|
|
7
|
+
variant: "banner",
|
|
8
|
+
message: "text successfuly copied!"
|
|
9
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
10
|
+
color: "secondary"
|
|
11
|
+
}, "Banner example"));
|
|
12
|
+
|
|
13
|
+
export var Banner = function Banner() {
|
|
14
|
+
return _ref;
|
|
15
|
+
};
|
|
16
|
+
export default Banner;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CopyToClipboard } from '@digigov/ui/admin';
|
|
3
|
+
import { Button } from '@digigov/ui';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
6
|
+
text: "copied-text",
|
|
7
|
+
variant: "tooltipLeft",
|
|
8
|
+
message: "text successfuly copied!",
|
|
9
|
+
id: "copy-to-clipboard"
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
11
|
+
color: "secondary",
|
|
12
|
+
"aria-describedby": "copy-to-clipboard"
|
|
13
|
+
}, "Copy"));
|
|
14
|
+
|
|
15
|
+
export var Default = function Default() {
|
|
16
|
+
return _ref;
|
|
17
|
+
};
|
|
18
|
+
export default Default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import CopyToClipboard from '@digigov/ui/
|
|
3
|
-
import { AdminAside, AdminContainer, AdminLayout, AdminMain, AdminTopSection, AdminHeader, AdminHeaderSection, Dropdown, DropdownButton, DropdownContent } from '@digigov/react-extensions/admin
|
|
2
|
+
import { CopyToClipboard } from '@digigov/ui/admin';
|
|
3
|
+
import { AdminAside, AdminContainer, AdminLayout, AdminMain, AdminTopSection, AdminHeader, AdminHeaderSection, Dropdown, DropdownButton, DropdownContent } from '@digigov/react-extensions/admin';
|
|
4
4
|
import { MoreVertIcon, NavVertical, NavVerticalItem } from '@digigov/react-core';
|
|
5
5
|
import { Accordion, AccordionItem, AccordionSectionSummary, AccordionSectionSummaryHeading } from '@digigov/ui/core/Accordion';
|
|
6
6
|
import { SummaryList, SummaryListItem, SummaryListItemKey, SummaryListItemValue, SummaryListItemAction, Button, BackButton, ButtonGroup } from '@digigov/ui';
|
|
@@ -30,7 +30,9 @@ var fields = [{
|
|
|
30
30
|
actions: ['Ανάθεση']
|
|
31
31
|
}];
|
|
32
32
|
|
|
33
|
-
var _ref = /*#__PURE__*/React.createElement(AdminHeader, null, /*#__PURE__*/React.createElement(AdminHeaderSection, null, /*#__PURE__*/React.createElement(HeaderContent, null, /*#__PURE__*/React.createElement(GovGRLogo, null), /*#__PURE__*/React.createElement(HeaderTitle, null, "\u0398\u03C5\u03C1\u03AF\u03B4\u03B5\u03C2")), /*#__PURE__*/React.createElement(HeaderSubtitle, null, /*#__PURE__*/React.createElement(Dropdown,
|
|
33
|
+
var _ref = /*#__PURE__*/React.createElement(AdminHeader, null, /*#__PURE__*/React.createElement(AdminHeaderSection, null, /*#__PURE__*/React.createElement(HeaderContent, null, /*#__PURE__*/React.createElement(GovGRLogo, null), /*#__PURE__*/React.createElement(HeaderTitle, null, "\u0398\u03C5\u03C1\u03AF\u03B4\u03B5\u03C2")), /*#__PURE__*/React.createElement(HeaderSubtitle, null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
34
|
+
align: "right"
|
|
35
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
34
36
|
variant: "link"
|
|
35
37
|
}, "\u0388\u03C7\u03B5\u03C4\u03B5 \u03C3\u03C5\u03BD\u03B4\u03B5\u03B8\u03B5\u03AF \u03C9\u03C2 \u039A\u03B1\u03BB\u03BB\u03B9\u03CC\u03C0\u03B7 \u03A0\u03B1\u03C0\u03B1\u03B4\u03BF\u03C0\u03BF\u03CD\u03BB\u03BF\u03C5", /*#__PURE__*/React.createElement(MoreVertIcon, null)), /*#__PURE__*/React.createElement(DropdownContent, null, /*#__PURE__*/React.createElement(NavVertical, null, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
36
38
|
href: "#"
|
|
@@ -57,7 +59,7 @@ var _ref3 = /*#__PURE__*/React.createElement(Title, {
|
|
|
57
59
|
|
|
58
60
|
var _ref4 = /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
59
61
|
text: "AAABBBFFFLLL",
|
|
60
|
-
variant: "
|
|
62
|
+
variant: "tooltipLeft",
|
|
61
63
|
message: "text successfuly copied!"
|
|
62
64
|
}, /*#__PURE__*/React.createElement(Button, null, "\u0391\u03C0\u03AC\u03BD\u03C4\u03B7\u03C3\u03B7")), /*#__PURE__*/React.createElement(Button, {
|
|
63
65
|
color: "secondary"
|
|
@@ -81,7 +83,7 @@ var _ref6 = /*#__PURE__*/React.createElement(Grid, {
|
|
|
81
83
|
xs: 12
|
|
82
84
|
}, /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
83
85
|
text: "AAABBBFFFLLL",
|
|
84
|
-
variant: "
|
|
86
|
+
variant: "tooltipLeft",
|
|
85
87
|
message: "text successfuly copied!"
|
|
86
88
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
87
89
|
color: "secondary"
|
|
@@ -89,7 +91,7 @@ var _ref6 = /*#__PURE__*/React.createElement(Grid, {
|
|
|
89
91
|
|
|
90
92
|
var _ref7 = /*#__PURE__*/React.createElement(GovGRFooter, null);
|
|
91
93
|
|
|
92
|
-
export var
|
|
94
|
+
export var MultipleCopies = function MultipleCopies() {
|
|
93
95
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AdminLayout, null, _ref, /*#__PURE__*/React.createElement(AdminContainer, null, _ref2, /*#__PURE__*/React.createElement(Grid, {
|
|
94
96
|
item: true,
|
|
95
97
|
md: 9,
|
|
@@ -106,7 +108,7 @@ export var Default = function Default() {
|
|
|
106
108
|
}, /*#__PURE__*/React.createElement(SummaryListItemKey, null, field.name), /*#__PURE__*/React.createElement(SummaryListItemValue, null, field.value), /*#__PURE__*/React.createElement(SummaryListItemAction, null, /*#__PURE__*/React.createElement(ButtonGroup, null, field.actions && field.actions.map(function (action, subIndex) {
|
|
107
109
|
return /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
108
110
|
text: "MMMNNNKKKO",
|
|
109
|
-
variant: "
|
|
111
|
+
variant: "tooltipRight",
|
|
110
112
|
key: subIndex
|
|
111
113
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
112
114
|
key: subIndex,
|
|
@@ -115,4 +117,4 @@ export var Default = function Default() {
|
|
|
115
117
|
}))));
|
|
116
118
|
}))), _ref5, _ref6)))), _ref7));
|
|
117
119
|
};
|
|
118
|
-
export default
|
|
120
|
+
export default MultipleCopies;
|
|
@@ -7,7 +7,7 @@ import { useTranslation } from '@digigov/ui/app';
|
|
|
7
7
|
export var CopyToClipboard = /*#__PURE__*/React.forwardRef(function CopyToClipboard(_ref, ref) {
|
|
8
8
|
var text = _ref.text,
|
|
9
9
|
_ref$variant = _ref.variant,
|
|
10
|
-
variant = _ref$variant === void 0 ? '
|
|
10
|
+
variant = _ref$variant === void 0 ? 'tooltipRight' : _ref$variant,
|
|
11
11
|
message = _ref.message,
|
|
12
12
|
children = _ref.children;
|
|
13
13
|
|
|
@@ -39,7 +39,8 @@ export var CopyToClipboard = /*#__PURE__*/React.forwardRef(function CopyToClipbo
|
|
|
39
39
|
ref: ref
|
|
40
40
|
}, children, enabled && /*#__PURE__*/React.createElement(CopyToClipboardMessage, {
|
|
41
41
|
variant: variant,
|
|
42
|
-
enabled: enabled
|
|
42
|
+
enabled: enabled,
|
|
43
|
+
role: "tooltip"
|
|
43
44
|
}, /*#__PURE__*/React.createElement(NormalText, null, message || t('copy-to-clipboard.message'))));
|
|
44
45
|
});
|
|
45
46
|
export default CopyToClipboard;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: copy-to-clipboard
|
|
3
|
+
title: CopyToClipboard
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
import CopyToClipboard from '@digigov/ui/admin/CopyToClipboard';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## How to use
|
|
11
|
+
|
|
12
|
+
### Default
|
|
13
|
+
|
|
14
|
+
<Story packageName="@digigov/ui" component="admin/CopyToClipboard" story="Default.tsx" />
|
|
15
|
+
|
|
16
|
+
### Banner
|
|
17
|
+
|
|
18
|
+
<Story packageName="@digigov/ui" component="admin/CopyToClipboard" story="Banner.tsx" />
|
|
19
|
+
|
|
20
|
+
### Layout example
|
|
21
|
+
|
|
22
|
+
<Story packageName="@digigov/ui" component="admin/CopyToClipboard" story="MultipleCopies.tsx" />
|
|
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import Drawer from '@digigov/ui/admin/Drawer';
|
|
4
4
|
import { List, ListItem, BurgerIcon } from '@digigov/react-core';
|
|
5
5
|
import { Button, Title } from '@digigov/ui';
|
|
6
|
-
import { AdminAside, AdminContainer, AdminLayout, AdminMain, AdminTopSection, AdminHeader, AdminHeaderSection, DrawerHeading } from '@digigov/react-extensions/admin
|
|
6
|
+
import { AdminAside, AdminContainer, AdminLayout, AdminMain, AdminTopSection, AdminHeader, AdminHeaderSection, DrawerHeading } from '@digigov/react-extensions/admin';
|
|
7
7
|
import { GovGRLogo } from '@digigov/react-core';
|
|
8
8
|
import { Card, CardHeading, CardText } from '@digigov/react-core';
|
|
9
9
|
import Grid from '@digigov/react-core/Grid';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* eslint-disable digigov/no-relative-imports */
|
|
2
|
+
import Dropdown from '@digigov/ui/admin/Dropdown';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Digigov UI/admin/Dropdown',
|
|
5
|
+
component: Dropdown
|
|
6
|
+
};
|
|
7
|
+
export * from './__stories__/Default';
|
|
8
|
+
export * from './__stories__/AlignRight';
|
|
9
|
+
export * from './__stories__/PlacementTop';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Dropdown, { DropdownButton, DropdownContent } from '@digigov/ui/admin/Dropdown';
|
|
3
|
+
import Field from '@digigov/ui/core/Field';
|
|
4
|
+
import Label from '@digigov/react-core/Label';
|
|
5
|
+
import { SectionBreak } from '@digigov/ui/core/Divider';
|
|
6
|
+
import NavVertical from '@digigov/react-core/NavVertical';
|
|
7
|
+
import { LabelTitle } from '@digigov/react-core/LabelTitle';
|
|
8
|
+
import TextInput from '@digigov/ui/core/TextInput';
|
|
9
|
+
import NavVerticalItem from '@digigov/react-core/NavVerticalItem';
|
|
10
|
+
import Button from '@digigov/ui/core/Button';
|
|
11
|
+
|
|
12
|
+
var _ref = /*#__PURE__*/React.createElement(Dropdown, {
|
|
13
|
+
align: "right"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
15
|
+
role: "button",
|
|
16
|
+
"aria-haspopup": "true",
|
|
17
|
+
"aria-controls": "menu2",
|
|
18
|
+
arrow: true
|
|
19
|
+
}, "\u0391\u03BD\u03B1\u03B6\u03B7\u03C4\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(DropdownContent, {
|
|
20
|
+
role: "menu",
|
|
21
|
+
id: "menu2"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
23
|
+
role: "menuitem"
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(LabelTitle, null, "\u038C\u03BD\u03BF\u03BC\u03B1 \u03C0\u03B5\u03B4\u03AF\u03BF\u03C5"), /*#__PURE__*/React.createElement(TextInput, {
|
|
25
|
+
name: "input-name"
|
|
26
|
+
}))), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
27
|
+
visible: true,
|
|
28
|
+
role: "separator"
|
|
29
|
+
}), /*#__PURE__*/React.createElement(NavVertical, {
|
|
30
|
+
role: "menu"
|
|
31
|
+
}, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
32
|
+
role: "menuitem",
|
|
33
|
+
href: "#"
|
|
34
|
+
}, "\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
35
|
+
role: "menuitem",
|
|
36
|
+
href: "#"
|
|
37
|
+
}, "\u039C\u03B5\u03C4\u03B1\u03BA\u03AF\u03BD\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
38
|
+
role: "menuitem",
|
|
39
|
+
href: "#"
|
|
40
|
+
}, "\u039F\u03C1\u03B9\u03C3\u03C4\u03B9\u03BA\u03AE \u03B4\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE")), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
41
|
+
visible: true,
|
|
42
|
+
role: "separator"
|
|
43
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
44
|
+
role: "menuitem"
|
|
45
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B1")));
|
|
46
|
+
|
|
47
|
+
export var AlignRight = function AlignRight() {
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
style: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
justifyContent: 'center',
|
|
52
|
+
alignItems: 'center'
|
|
53
|
+
}
|
|
54
|
+
}, _ref);
|
|
55
|
+
};
|
|
56
|
+
export default AlignRight;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Dropdown, { DropdownButton, DropdownContent } from '@digigov/ui/admin/Dropdown';
|
|
3
|
+
import Field from '@digigov/ui/core/Field';
|
|
4
|
+
import Label from '@digigov/react-core/Label';
|
|
5
|
+
import { SectionBreak } from '@digigov/ui/core/Divider';
|
|
6
|
+
import NavVertical from '@digigov/react-core/NavVertical';
|
|
7
|
+
import { LabelTitle } from '@digigov/react-core/LabelTitle';
|
|
8
|
+
import TextInput from '@digigov/ui/core/TextInput';
|
|
9
|
+
import NavVerticalItem from '@digigov/react-core/NavVerticalItem';
|
|
10
|
+
import Button from '@digigov/ui/core/Button';
|
|
11
|
+
|
|
12
|
+
var _ref = /*#__PURE__*/React.createElement(Dropdown, null, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
13
|
+
role: "button",
|
|
14
|
+
"aria-haspopup": "true",
|
|
15
|
+
"aria-controls": "menu2",
|
|
16
|
+
arrow: true
|
|
17
|
+
}, "\u0391\u03BD\u03B1\u03B6\u03B7\u03C4\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(DropdownContent, {
|
|
18
|
+
role: "menu",
|
|
19
|
+
id: "menu2"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
21
|
+
role: "menuitem"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(LabelTitle, null, "\u038C\u03BD\u03BF\u03BC\u03B1 \u03C0\u03B5\u03B4\u03AF\u03BF\u03C5"), /*#__PURE__*/React.createElement(TextInput, {
|
|
23
|
+
name: "input-name"
|
|
24
|
+
}))), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
25
|
+
visible: true,
|
|
26
|
+
role: "separator"
|
|
27
|
+
}), /*#__PURE__*/React.createElement(NavVertical, {
|
|
28
|
+
role: "menu"
|
|
29
|
+
}, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
30
|
+
role: "menuitem",
|
|
31
|
+
href: "#"
|
|
32
|
+
}, "\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
33
|
+
role: "menuitem",
|
|
34
|
+
href: "#"
|
|
35
|
+
}, "\u039C\u03B5\u03C4\u03B1\u03BA\u03AF\u03BD\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
36
|
+
role: "menuitem",
|
|
37
|
+
href: "#"
|
|
38
|
+
}, "\u039F\u03C1\u03B9\u03C3\u03C4\u03B9\u03BA\u03AE \u03B4\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE")), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
39
|
+
visible: true,
|
|
40
|
+
role: "separator"
|
|
41
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
42
|
+
role: "menuitem"
|
|
43
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B1")));
|
|
44
|
+
|
|
45
|
+
export var Default = function Default() {
|
|
46
|
+
return _ref;
|
|
47
|
+
};
|
|
48
|
+
export default Default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Dropdown, { DropdownButton, DropdownContent } from '@digigov/ui/admin/Dropdown';
|
|
3
|
+
import Field from '@digigov/ui/core/Field';
|
|
4
|
+
import Label from '@digigov/react-core/Label';
|
|
5
|
+
import { SectionBreak } from '@digigov/ui/core/Divider';
|
|
6
|
+
import NavVertical from '@digigov/react-core/NavVertical';
|
|
7
|
+
import { LabelTitle } from '@digigov/react-core/LabelTitle';
|
|
8
|
+
import TextInput from '@digigov/ui/core/TextInput';
|
|
9
|
+
import NavVerticalItem from '@digigov/react-core/NavVerticalItem';
|
|
10
|
+
import Button from '@digigov/ui/core/Button';
|
|
11
|
+
|
|
12
|
+
var _ref = /*#__PURE__*/React.createElement(Dropdown, {
|
|
13
|
+
placement: "top"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
15
|
+
role: "button",
|
|
16
|
+
"aria-haspopup": "true",
|
|
17
|
+
"aria-controls": "menu2",
|
|
18
|
+
arrow: true
|
|
19
|
+
}, "\u0391\u03BD\u03B1\u03B6\u03B7\u03C4\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(DropdownContent, {
|
|
20
|
+
role: "menu",
|
|
21
|
+
id: "menu2"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
23
|
+
role: "menuitem"
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(LabelTitle, null, "\u038C\u03BD\u03BF\u03BC\u03B1 \u03C0\u03B5\u03B4\u03AF\u03BF\u03C5"), /*#__PURE__*/React.createElement(TextInput, {
|
|
25
|
+
name: "input-name"
|
|
26
|
+
}))), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
27
|
+
visible: true,
|
|
28
|
+
role: "separator"
|
|
29
|
+
}), /*#__PURE__*/React.createElement(NavVertical, {
|
|
30
|
+
role: "menu"
|
|
31
|
+
}, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
32
|
+
role: "menuitem",
|
|
33
|
+
href: "#"
|
|
34
|
+
}, "\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
35
|
+
role: "menuitem",
|
|
36
|
+
href: "#"
|
|
37
|
+
}, "\u039C\u03B5\u03C4\u03B1\u03BA\u03AF\u03BD\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
38
|
+
role: "menuitem",
|
|
39
|
+
href: "#"
|
|
40
|
+
}, "\u039F\u03C1\u03B9\u03C3\u03C4\u03B9\u03BA\u03AE \u03B4\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE")), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
41
|
+
visible: true,
|
|
42
|
+
role: "separator"
|
|
43
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
44
|
+
role: "menuitem"
|
|
45
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B1")));
|
|
46
|
+
|
|
47
|
+
export var PlacementTop = function PlacementTop() {
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
style: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
justifyContent: 'center',
|
|
52
|
+
alignItems: 'center'
|
|
53
|
+
}
|
|
54
|
+
}, _ref);
|
|
55
|
+
};
|
|
56
|
+
export default PlacementTop;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["closeBehaviour"];
|
|
3
|
+
var _excluded = ["closeBehaviour", "float"];
|
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import CoreDropdown from '@digigov/react-extensions/admin/Dropdown';
|
|
6
6
|
export * from '@digigov/react-extensions/admin/DropdownButton';
|
|
@@ -12,6 +12,8 @@ export * from '@digigov/react-extensions/admin/DropdownContent';
|
|
|
12
12
|
export var Dropdown = function Dropdown(_ref) {
|
|
13
13
|
var _ref$closeBehaviour = _ref.closeBehaviour,
|
|
14
14
|
closeBehaviour = _ref$closeBehaviour === void 0 ? 'clickOutside' : _ref$closeBehaviour,
|
|
15
|
+
_ref$float = _ref["float"],
|
|
16
|
+
_float = _ref$float === void 0 ? false : _ref$float,
|
|
15
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
18
|
|
|
17
19
|
var innerRef = useRef();
|
|
@@ -26,10 +28,35 @@ export var Dropdown = function Dropdown(_ref) {
|
|
|
26
28
|
document.addEventListener('click', handleClickOutside, true);
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
var toggleFloat = function toggleFloat() {
|
|
32
|
+
if (innerRef.current.open) {
|
|
33
|
+
var rect = innerRef.current.getBoundingClientRect();
|
|
34
|
+
innerRef.current.style.position = 'static';
|
|
35
|
+
var top = rect.top + window.pageYOffset;
|
|
36
|
+
var left = rect.left + window.pageXOffset;
|
|
37
|
+
innerRef.current.style.top = "".concat(top, "px");
|
|
38
|
+
innerRef.current.style.left = "".concat(left, "px");
|
|
39
|
+
innerRef.current.style.position = "absolute";
|
|
40
|
+
innerRef.current.style.display = "block";
|
|
41
|
+
} else {
|
|
42
|
+
innerRef.current.style.top = "0";
|
|
43
|
+
innerRef.current.style.left = "0";
|
|
44
|
+
innerRef.current.style.position = "relative";
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
if (_float) {
|
|
49
|
+
innerRef.current.addEventListener('toggle', toggleFloat);
|
|
50
|
+
}
|
|
51
|
+
|
|
29
52
|
return function () {
|
|
30
53
|
if (closeBehaviour === 'clickOutside') {
|
|
31
54
|
document.removeEventListener('click', handleClickOutside, true);
|
|
32
55
|
}
|
|
56
|
+
|
|
57
|
+
if (_float) {
|
|
58
|
+
innerRef.current.removeEventListener('toggle', toggleFloat);
|
|
59
|
+
}
|
|
33
60
|
};
|
|
34
61
|
}, []); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
35
62
|
// @ts-ignore
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: dropdown
|
|
3
|
+
title: Dropdown
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dropdown
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
import Dropdown from '@digigov/ui/admin/Dropdown';
|
|
10
|
+
```
|
|
11
|
+
## How to use
|
|
12
|
+
|
|
13
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="Default.tsx" />
|
|
14
|
+
|
|
15
|
+
### Dropdown with align right
|
|
16
|
+
|
|
17
|
+
You can display the dropdown menu to the right side of the `Dropdown` button.
|
|
18
|
+
|
|
19
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="AlignRight.tsx" />
|
|
20
|
+
|
|
21
|
+
### Dropdown with placement top
|
|
22
|
+
|
|
23
|
+
You can display the dropdown menu to the top of the `Dropdown` button.
|
|
24
|
+
|
|
25
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="PlacementTop.tsx" />
|
|
26
|
+
|
|
27
|
+
You can read more about the accessibility patterns used in our Dropdown
|
|
28
|
+
implementation in the ARIA Authoring Practices Guide (APG) at
|
|
29
|
+
[Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/) section.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from '@digigov/react-extensions/admin/FilterSection';
|
|
2
|
+
export * from '@digigov/react-extensions/admin/FilterSectionHorizontal';
|
|
2
3
|
export * from '@digigov/react-extensions/admin/FilterHeadingSection';
|
|
3
4
|
export * from '@digigov/react-extensions/admin/FilterContent';
|
|
4
5
|
export * from '@digigov/react-extensions/admin/FilterOptionsSection';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import Modal, { ModalHeading, ModalContent, ModalAction } from "@digigov/ui/admin/Modal";
|
|
4
|
+
import { Button } from "@digigov/ui/core";
|
|
5
|
+
import { Paragraph } from "@digigov/ui/typography";
|
|
6
|
+
|
|
7
|
+
function useModal() {
|
|
8
|
+
var _useState = useState(false),
|
|
9
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10
|
+
open = _useState2[0],
|
|
11
|
+
setOpen = _useState2[1];
|
|
12
|
+
|
|
13
|
+
function toggleModal() {
|
|
14
|
+
setOpen(!open);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
open: open,
|
|
19
|
+
toggleModal: toggleModal
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var _ref = /*#__PURE__*/React.createElement(ModalHeading, {
|
|
24
|
+
id: "modal-label"
|
|
25
|
+
}, "\u0395\u03C0\u03B9\u03B2\u03B5\u03B2\u03B1\u03AF\u03C9\u03C3\u03B7");
|
|
26
|
+
|
|
27
|
+
var _ref2 = /*#__PURE__*/React.createElement(ModalContent, {
|
|
28
|
+
id: "modal-content"
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Paragraph, null, "\u0395\u03AF\u03C3\u03C4\u03B5 \u03C3\u03AF\u03B3\u03BF\u03C5\u03C1\u03BF\u03B9 \u03CC\u03C4\u03B9 \u03B8\u03AD\u03BB\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03B4\u03B9\u03B1\u03B3\u03C1\u03AC\u03C8\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AE;"));
|
|
30
|
+
|
|
31
|
+
export var AlertDialog = function AlertDialog() {
|
|
32
|
+
var _useModal = useModal(),
|
|
33
|
+
open = _useModal.open,
|
|
34
|
+
toggleModal = _useModal.toggleModal;
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
color: "warning",
|
|
38
|
+
onClick: function onClick() {
|
|
39
|
+
return toggleModal();
|
|
40
|
+
}
|
|
41
|
+
}, "\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE"), /*#__PURE__*/React.createElement(Modal, {
|
|
42
|
+
open: open,
|
|
43
|
+
role: "alertdialog",
|
|
44
|
+
"aria-modal": "true",
|
|
45
|
+
"aria-labelledby": "modal-label",
|
|
46
|
+
"aria-describedby": "modal-content"
|
|
47
|
+
}, _ref, _ref2, /*#__PURE__*/React.createElement(ModalAction, null, /*#__PURE__*/React.createElement(Button, {
|
|
48
|
+
onClick: function onClick() {
|
|
49
|
+
return toggleModal();
|
|
50
|
+
}
|
|
51
|
+
}, "\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE"), /*#__PURE__*/React.createElement(Button, {
|
|
52
|
+
variant: "link",
|
|
53
|
+
onClick: function onClick() {
|
|
54
|
+
return toggleModal();
|
|
55
|
+
}
|
|
56
|
+
}, "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"))));
|
|
57
|
+
};
|
|
58
|
+
export default AlertDialog;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import Modal, { ModalHeading, ModalContent, ModalAction } from "@digigov/ui/admin/Modal";
|
|
4
|
+
import { Button, TextInput } from "@digigov/ui/core";
|
|
5
|
+
import Field from "@digigov/ui/core/Field";
|
|
6
|
+
import Label from "@digigov/react-core/Label";
|
|
7
|
+
|
|
8
|
+
function useModal() {
|
|
9
|
+
var _useState = useState(false),
|
|
10
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
+
open = _useState2[0],
|
|
12
|
+
setOpen = _useState2[1];
|
|
13
|
+
|
|
14
|
+
function toggleModal() {
|
|
15
|
+
setOpen(!open);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
open: open,
|
|
20
|
+
toggleModal: toggleModal
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var _ref = /*#__PURE__*/React.createElement(ModalHeading, {
|
|
25
|
+
id: "modal-label"
|
|
26
|
+
}, "\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5");
|
|
27
|
+
|
|
28
|
+
var _ref2 = /*#__PURE__*/React.createElement(ModalContent, null, /*#__PURE__*/React.createElement(Field, null, /*#__PURE__*/React.createElement(Label, null, "\u03A3\u03C5\u03BC\u03C0\u03BB\u03B7\u03C1\u03CE\u03C3\u03C4\u03B5 \u03C4\u03BF \u03C4\u03B7\u03BB\u03AD\u03C6\u03C9\u03BD\u03BF \u03B5\u03C0\u03B9\u03BA\u03BF\u03B9\u03BD\u03C9\u03BD\u03AF\u03B1\u03C2", /*#__PURE__*/React.createElement(TextInput, {
|
|
29
|
+
name: "inputext",
|
|
30
|
+
characterWidth: 10
|
|
31
|
+
}))));
|
|
32
|
+
|
|
33
|
+
var _ref3 = /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE");
|
|
34
|
+
|
|
35
|
+
export var Default = function Default() {
|
|
36
|
+
var _useModal = useModal(),
|
|
37
|
+
open = _useModal.open,
|
|
38
|
+
toggleModal = _useModal.toggleModal;
|
|
39
|
+
|
|
40
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
41
|
+
onClick: function onClick() {
|
|
42
|
+
return toggleModal();
|
|
43
|
+
}
|
|
44
|
+
}, "\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5"), /*#__PURE__*/React.createElement(Modal, {
|
|
45
|
+
open: open,
|
|
46
|
+
role: "dialog",
|
|
47
|
+
"aria-modal": "true",
|
|
48
|
+
"aria-labelledby": "modal-label"
|
|
49
|
+
}, _ref, _ref2, /*#__PURE__*/React.createElement(ModalAction, null, _ref3, /*#__PURE__*/React.createElement(Button, {
|
|
50
|
+
variant: "link",
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
return toggleModal();
|
|
53
|
+
}
|
|
54
|
+
}, "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"))));
|
|
55
|
+
};
|
|
56
|
+
export default Default;
|