@digigov/ui 2.0.0-8e254888 → 2.0.0-a32ad9b2
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/app/Footer/Footer.stories/index.js +49 -1
- package/app/Footer/Footer.stories.d.ts +43 -1
- package/app/Footer/Footer.stories.js.map +3 -3
- package/app/Footer/FooterLink/index.js +17 -0
- package/app/Footer/FooterLink/package.json +6 -0
- package/app/Footer/FooterLink.d.ts +7 -0
- package/app/Footer/FooterLink.js.map +7 -0
- package/app/Footer/index.d.ts +1 -1
- package/app/Footer/index.js +1 -1
- package/app/Footer/index.js.map +1 -1
- package/app/Header/Header.stories/index.js +53 -1
- package/app/Header/Header.stories.d.ts +50 -1
- package/app/Header/Header.stories.js.map +3 -3
- package/app/Header/HeaderLogo/index.js +12 -2
- package/app/Header/HeaderLogo.d.ts +6 -2
- package/app/Header/HeaderLogo.js.map +3 -3
- package/app/Header/HeaderSecondaryLogo/index.js +9 -1
- package/app/Header/HeaderSecondaryLogo.d.ts +6 -2
- package/app/Header/HeaderSecondaryLogo.js.map +3 -3
- package/app/Header/HeaderTitle/index.js +10 -2
- package/app/Header/HeaderTitle.d.ts +6 -2
- package/app/Header/HeaderTitle.js.map +3 -3
- package/app/Modal/hooks/index.js +2 -6
- package/app/Modal/hooks.d.ts +2 -2
- package/app/Modal/hooks.js.map +2 -2
- package/app/Modal/index.web/index.js +5 -5
- package/app/Modal/index.web.js.map +2 -2
- package/app/OutdatedBrowserBanner/index.d.ts +1 -0
- package/app/OutdatedBrowserBanner/index.js.map +2 -2
- package/app/PhaseBannerHeader/index.d.ts +1 -1
- package/app/PhaseBannerHeader/index.js.map +2 -2
- package/app/QrCodeScanner/index.js.map +2 -2
- package/app/Skeleton/Skeleton.stories/index.js +28 -0
- package/app/Skeleton/Skeleton.stories.d.ts +56 -0
- package/app/Skeleton/Skeleton.stories.js.map +2 -2
- package/cjs/app/Footer/Footer.stories/index.js +37 -2
- package/cjs/app/Footer/Footer.stories.js.map +4 -4
- package/cjs/app/Footer/FooterLink/index.js +50 -0
- package/cjs/app/Footer/FooterLink.js.map +7 -0
- package/cjs/app/Footer/index.js +3 -3
- package/cjs/app/Footer/index.js.map +2 -2
- package/cjs/app/Header/Header.stories/index.js +51 -2
- package/cjs/app/Header/Header.stories.js.map +4 -4
- package/cjs/app/Header/HeaderLogo/index.js +13 -4
- package/cjs/app/Header/HeaderLogo.js.map +3 -3
- package/cjs/app/Header/HeaderSecondaryLogo/index.js +12 -4
- package/cjs/app/Header/HeaderSecondaryLogo.js.map +3 -3
- package/cjs/app/Header/HeaderTitle/index.js +11 -4
- package/cjs/app/Header/HeaderTitle.js.map +3 -3
- package/cjs/app/Modal/hooks/index.js +2 -6
- package/cjs/app/Modal/hooks.js.map +2 -2
- package/cjs/app/Modal/index.web/index.js +5 -5
- package/cjs/app/Modal/index.web.js.map +2 -2
- package/cjs/app/OutdatedBrowserBanner/index.js.map +2 -2
- package/cjs/app/PhaseBannerHeader/index.js.map +2 -2
- package/cjs/app/QrCodeScanner/index.js.map +2 -2
- package/cjs/app/Skeleton/Skeleton.stories/index.js +30 -1
- package/cjs/app/Skeleton/Skeleton.stories.js.map +2 -2
- package/cjs/content/Accordion/Accordion.stories/index.js +54 -2
- package/cjs/content/Accordion/Accordion.stories.js.map +4 -4
- package/cjs/content/Accordion/hooks.js.map +1 -1
- package/cjs/content/Blockquote/Blockquote.stories/index.js +20 -1
- package/cjs/content/Blockquote/Blockquote.stories.js.map +2 -2
- package/cjs/content/Card/Card.stories/index.js +78 -2
- package/cjs/content/Card/Card.stories.js.map +4 -4
- package/cjs/content/Chip/Chip.stories/index.js +24 -1
- package/cjs/content/Chip/Chip.stories.js.map +2 -2
- package/cjs/content/List/List.stories/index.js +40 -2
- package/cjs/content/List/List.stories.js.map +4 -4
- package/cjs/content/Table/Table.stories/index.js +157 -2
- package/cjs/content/Table/Table.stories.js.map +4 -4
- package/cjs/feedback/CopyToClipboard/CopyToClipboard.stories/index.js +61 -3
- package/cjs/feedback/CopyToClipboard/CopyToClipboard.stories.js.map +4 -4
- package/cjs/feedback/ErrorSummary/ErrorSummary.stories/index.js +42 -3
- package/cjs/feedback/ErrorSummary/ErrorSummary.stories.js.map +4 -4
- package/cjs/feedback/NotificationBanner/NotificationBanner.stories/index.js +36 -1
- package/cjs/feedback/NotificationBanner/NotificationBanner.stories.js.map +2 -2
- package/cjs/feedback/PhaseBanner/PhaseBanner.stories/index.js +27 -3
- package/cjs/feedback/PhaseBanner/PhaseBanner.stories.js.map +4 -4
- package/cjs/feedback/WarningText/WarningText.stories/index.js +24 -1
- package/cjs/feedback/WarningText/WarningText.stories.js.map +2 -2
- package/cjs/form/AutoComplete/AutoComplete.stories/index.js +75 -0
- package/cjs/form/AutoComplete/AutoComplete.stories.js.map +4 -4
- package/cjs/form/AutoComplete/Status/index.js.map +2 -2
- package/cjs/form/AutoComplete/index.js.map +2 -2
- package/cjs/form/Button/Button.stories/index.js +44 -13
- package/cjs/form/Button/Button.stories.js.map +3 -3
- package/cjs/form/Button/ButtonLink/index.js +13 -4
- package/cjs/form/Button/ButtonLink.js.map +3 -3
- package/cjs/form/Button/CallToAction/index.js +11 -4
- package/cjs/form/Button/CallToAction.js.map +3 -3
- package/cjs/form/Button/__stories__/Primary/index.js +18 -1
- package/cjs/form/Button/__stories__/Primary.js.map +2 -2
- package/cjs/form/Checkbox/Checkbox.stories/index.js +113 -2
- package/cjs/form/Checkbox/Checkbox.stories.js.map +4 -4
- package/cjs/form/DateInputContainer/DateInputContainer.stories/index.js +77 -2
- package/cjs/form/DateInputContainer/DateInputContainer.stories.js.map +4 -4
- package/cjs/form/ErrorMessage/ErrorMessage.stories/index.js +26 -1
- package/cjs/form/ErrorMessage/ErrorMessage.stories.js.map +4 -4
- package/cjs/form/RadioContainer/RadioContainer.stories/index.js +115 -2
- package/cjs/form/RadioContainer/RadioContainer.stories.js.map +4 -4
- package/cjs/form/SelectContainer/SelectContainer.stories/index.js +79 -2
- package/cjs/form/SelectContainer/SelectContainer.stories.js.map +4 -4
- package/cjs/form/SingleCharacterInputs/SingleCharacterInput.stories/index.js +93 -2
- package/cjs/form/SingleCharacterInputs/SingleCharacterInput.stories.js.map +4 -4
- package/cjs/form/TextArea/TextArea.stories/index.js +88 -2
- package/cjs/form/TextArea/TextArea.stories.js.map +4 -4
- package/cjs/form/TextInput/TextInput.stories/index.js +94 -0
- package/cjs/form/TextInput/TextInput.stories.js.map +4 -4
- package/cjs/govgr/GovGRLogo/index.js +14 -4
- package/cjs/govgr/GovGRLogo/index.js.map +3 -3
- package/cjs/layouts/Stack/__stories__/AlignItems/index.js +2 -2
- package/cjs/layouts/Stack/__stories__/AlignItems.js.map +3 -3
- package/cjs/layouts/Stack/__stories__/Default/index.js +2 -2
- package/cjs/layouts/Stack/__stories__/Default.js.map +3 -3
- package/cjs/layouts/Stack/__stories__/JustifyContent/index.js +2 -2
- package/cjs/layouts/Stack/__stories__/JustifyContent.js.map +3 -3
- package/cjs/layouts/Stack/__stories__/NoWrap/index.js +2 -2
- package/cjs/layouts/Stack/__stories__/NoWrap.js.map +3 -3
- package/cjs/layouts/Stack/__stories__/Row/index.js +2 -2
- package/cjs/layouts/Stack/__stories__/Row.js.map +3 -3
- package/cjs/layouts/Stack/__stories__/Spacing/index.js +2 -2
- package/cjs/layouts/Stack/__stories__/Spacing.js.map +3 -3
- package/cjs/layouts/Stack/index.js +6 -0
- package/cjs/layouts/Stack/index.js.map +2 -2
- package/cjs/lazy/index.js +13 -2
- package/cjs/lazy.js.map +2 -2
- package/cjs/navigation/BackLink/index.js +13 -4
- package/cjs/navigation/BackLink/index.js.map +3 -3
- package/cjs/navigation/Breadcrumbs/BreadcrumbsListItemLink/index.js +48 -0
- package/cjs/navigation/Breadcrumbs/BreadcrumbsListItemLink.js.map +7 -0
- package/cjs/navigation/Breadcrumbs/index.js +2 -2
- package/cjs/navigation/Breadcrumbs/index.js.map +2 -2
- package/cjs/navigation/Drawer/hooks/index.js +2 -6
- package/cjs/navigation/Drawer/hooks.js.map +2 -2
- package/cjs/navigation/Link/index.js +6 -2
- package/cjs/navigation/Link/index.js.map +2 -2
- package/cjs/navigation/NavList/NavListAuto/index.js +7 -13
- package/cjs/navigation/NavList/NavListAuto/index.js.map +3 -3
- package/cjs/navigation/NavList/NavListItemAction/index.js +66 -0
- package/cjs/navigation/NavList/NavListItemAction.js.map +7 -0
- package/cjs/navigation/NavList/NavListItemLink/index.js +48 -0
- package/cjs/navigation/NavList/NavListItemLink.js.map +7 -0
- package/cjs/navigation/NavList/index.js +4 -4
- package/cjs/navigation/NavList/index.js.map +2 -2
- package/cjs/navigation/Pagination/hooks/index.js +2 -2
- package/cjs/navigation/Pagination/hooks.js.map +2 -2
- package/cjs/navigation/Tabs/__stories__/Default/index.js +1 -2
- package/cjs/navigation/Tabs/__stories__/Default.js.map +2 -2
- package/cjs/navigation/Tabs/__stories__/UsingAccordion/index.js +7 -8
- package/cjs/navigation/Tabs/__stories__/UsingAccordion.js.map +2 -2
- package/cjs/navigation/Tabs/hooks.js.map +1 -1
- package/cjs/registry/index.js +99 -91
- package/cjs/registry.js.map +2 -2
- package/cjs/typography/CodeBlock/index.js +1 -2
- package/cjs/typography/CodeBlock/index.js.map +2 -2
- package/cjs/utils/hooks/useDebounce/index.js +1 -1
- package/cjs/utils/hooks/useDebounce.js.map +2 -2
- package/content/Accordion/Accordion.stories/index.js +58 -1
- package/content/Accordion/Accordion.stories.d.ts +79 -1
- package/content/Accordion/Accordion.stories.js.map +3 -3
- package/content/Accordion/hooks.js.map +1 -1
- package/content/Blockquote/Blockquote.stories/index.js +18 -0
- package/content/Blockquote/Blockquote.stories.d.ts +27 -0
- package/content/Blockquote/Blockquote.stories.js.map +2 -2
- package/content/Card/Card.stories/index.js +81 -1
- package/content/Card/Card.stories.d.ts +126 -1
- package/content/Card/Card.stories.js.map +3 -3
- package/content/Chip/Chip.stories/index.js +22 -0
- package/content/Chip/Chip.stories.d.ts +36 -0
- package/content/Chip/Chip.stories.js.map +2 -2
- package/content/List/List.stories/index.js +38 -1
- package/content/List/List.stories.d.ts +51 -1
- package/content/List/List.stories.js.map +3 -3
- package/content/Table/Table.stories/index.js +164 -1
- package/content/Table/Table.stories.d.ts +124 -1
- package/content/Table/Table.stories.js.map +3 -3
- package/feedback/CopyToClipboard/CopyToClipboard.stories/index.js +58 -1
- package/feedback/CopyToClipboard/CopyToClipboard.stories.d.ts +81 -1
- package/feedback/CopyToClipboard/CopyToClipboard.stories.js.map +3 -3
- package/feedback/ErrorSummary/ErrorSummary.stories/index.js +39 -1
- package/feedback/ErrorSummary/ErrorSummary.stories.d.ts +42 -1
- package/feedback/ErrorSummary/ErrorSummary.stories.js.map +3 -3
- package/feedback/NotificationBanner/NotificationBanner.stories/index.js +34 -0
- package/feedback/NotificationBanner/NotificationBanner.stories.d.ts +60 -0
- package/feedback/NotificationBanner/NotificationBanner.stories.js.map +2 -2
- package/feedback/PhaseBanner/PhaseBanner.stories/index.js +28 -1
- package/feedback/PhaseBanner/PhaseBanner.stories.d.ts +30 -1
- package/feedback/PhaseBanner/PhaseBanner.stories.js.map +3 -3
- package/feedback/WarningText/WarningText.stories/index.js +22 -0
- package/feedback/WarningText/WarningText.stories.d.ts +36 -0
- package/feedback/WarningText/WarningText.stories.js.map +2 -2
- package/form/AutoComplete/AutoComplete.stories/index.js +74 -0
- package/form/AutoComplete/AutoComplete.stories.d.ts +82 -0
- package/form/AutoComplete/AutoComplete.stories.js.map +3 -3
- package/form/AutoComplete/Status/index.d.ts +1 -1
- package/form/AutoComplete/Status/index.js.map +2 -2
- package/form/AutoComplete/index.d.ts +1 -1
- package/form/AutoComplete/index.js.map +2 -2
- package/form/Button/Button.stories/index.js +43 -3
- package/form/Button/Button.stories.d.ts +59 -2
- package/form/Button/Button.stories.js.map +2 -2
- package/form/Button/ButtonLink/index.js +12 -2
- package/form/Button/ButtonLink.d.ts +6 -2
- package/form/Button/ButtonLink.js.map +3 -3
- package/form/Button/CallToAction/index.js +10 -2
- package/form/Button/CallToAction.d.ts +6 -2
- package/form/Button/CallToAction.js.map +3 -3
- package/form/Button/__stories__/Primary/index.js +18 -1
- package/form/Button/__stories__/Primary.d.ts +8 -1
- package/form/Button/__stories__/Primary.js.map +2 -2
- package/form/Checkbox/Checkbox.stories/index.js +115 -1
- package/form/Checkbox/Checkbox.stories.d.ts +166 -1
- package/form/Checkbox/Checkbox.stories.js.map +3 -3
- package/form/DateInputContainer/DateInputContainer.stories/index.js +82 -1
- package/form/DateInputContainer/DateInputContainer.stories.d.ts +141 -1
- package/form/DateInputContainer/DateInputContainer.stories.js.map +3 -3
- package/form/ErrorMessage/ErrorMessage.stories/index.js +24 -0
- package/form/ErrorMessage/ErrorMessage.stories.d.ts +33 -0
- package/form/ErrorMessage/ErrorMessage.stories.js.map +3 -3
- package/form/RadioContainer/RadioContainer.stories/index.js +117 -1
- package/form/RadioContainer/RadioContainer.stories.d.ts +174 -1
- package/form/RadioContainer/RadioContainer.stories.js.map +3 -3
- package/form/SelectContainer/SelectContainer.stories/index.js +80 -1
- package/form/SelectContainer/SelectContainer.stories.d.ts +135 -1
- package/form/SelectContainer/SelectContainer.stories.js.map +3 -3
- package/form/SingleCharacterInputs/SingleCharacterInput.stories/index.js +98 -1
- package/form/SingleCharacterInputs/SingleCharacterInput.stories.d.ts +108 -1
- package/form/SingleCharacterInputs/SingleCharacterInput.stories.js.map +3 -3
- package/form/TextArea/TextArea.stories/index.js +86 -1
- package/form/TextArea/TextArea.stories.d.ts +117 -1
- package/form/TextArea/TextArea.stories.js.map +3 -3
- package/form/TextInput/TextInput.stories/index.js +93 -0
- package/form/TextInput/TextInput.stories.d.ts +118 -0
- package/form/TextInput/TextInput.stories.js.map +3 -3
- package/govgr/GovGRLogo/index.d.ts +6 -2
- package/govgr/GovGRLogo/index.js +11 -1
- package/govgr/GovGRLogo/index.js.map +3 -3
- package/index.js +1 -1
- package/layouts/Stack/__stories__/AlignItems/index.js +1 -1
- package/layouts/Stack/__stories__/AlignItems.js.map +2 -2
- package/layouts/Stack/__stories__/Default/index.js +1 -1
- package/layouts/Stack/__stories__/Default.js.map +2 -2
- package/layouts/Stack/__stories__/JustifyContent/index.js +1 -1
- package/layouts/Stack/__stories__/JustifyContent.js.map +2 -2
- package/layouts/Stack/__stories__/NoWrap/index.js +1 -1
- package/layouts/Stack/__stories__/NoWrap.js.map +2 -2
- package/layouts/Stack/__stories__/Row/index.js +1 -1
- package/layouts/Stack/__stories__/Row.js.map +2 -2
- package/layouts/Stack/__stories__/Spacing/index.js +1 -1
- package/layouts/Stack/__stories__/Spacing.js.map +2 -2
- package/layouts/Stack/index.d.ts +1 -0
- package/layouts/Stack/index.js +1 -0
- package/layouts/Stack/index.js.map +2 -2
- package/lazy/index.js +13 -2
- package/navigation/BackLink/index.d.ts +6 -2
- package/navigation/BackLink/index.js +12 -2
- package/navigation/BackLink/index.js.map +3 -3
- package/navigation/Breadcrumbs/BreadcrumbsListItemLink/index.js +15 -0
- package/navigation/Breadcrumbs/BreadcrumbsListItemLink/package.json +6 -0
- package/navigation/Breadcrumbs/BreadcrumbsListItemLink.d.ts +7 -0
- package/navigation/Breadcrumbs/BreadcrumbsListItemLink.js.map +7 -0
- package/navigation/Breadcrumbs/index.d.ts +1 -1
- package/navigation/Breadcrumbs/index.js +1 -1
- package/navigation/Breadcrumbs/index.js.map +1 -1
- package/navigation/Drawer/hooks/index.js +2 -6
- package/navigation/Drawer/hooks.js.map +2 -2
- package/navigation/Link/index.js +6 -2
- package/navigation/Link/index.js.map +2 -2
- package/navigation/NavList/NavListAuto/index.js +10 -8
- package/navigation/NavList/NavListAuto/index.js.map +2 -2
- package/navigation/NavList/NavListItemAction/index.js +37 -0
- package/navigation/NavList/NavListItemAction/package.json +6 -0
- package/navigation/NavList/NavListItemAction.d.ts +27 -0
- package/navigation/NavList/NavListItemAction.js.map +7 -0
- package/navigation/NavList/NavListItemLink/index.js +15 -0
- package/navigation/NavList/NavListItemLink/package.json +6 -0
- package/navigation/NavList/NavListItemLink.d.ts +7 -0
- package/navigation/NavList/NavListItemLink.js.map +7 -0
- package/navigation/NavList/index.d.ts +2 -2
- package/navigation/NavList/index.js +2 -2
- package/navigation/NavList/index.js.map +2 -2
- package/navigation/Pagination/hooks/index.js +2 -2
- package/navigation/Pagination/hooks.js.map +2 -2
- package/navigation/Tabs/__stories__/Default/index.js +1 -2
- package/navigation/Tabs/__stories__/Default.js.map +2 -2
- package/navigation/Tabs/__stories__/UsingAccordion/index.js +7 -8
- package/navigation/Tabs/__stories__/UsingAccordion.js.map +2 -2
- package/navigation/Tabs/hooks.d.ts +1 -1
- package/navigation/Tabs/hooks.js.map +1 -1
- package/package.json +7 -7
- package/registry/index.js +99 -91
- package/src/app/BannerContainer/index.test.tsx +4 -0
- package/src/app/Footer/Footer.stories.jsx +179 -0
- package/src/app/Footer/FooterLink.tsx +20 -0
- package/src/app/Footer/index.test.tsx +4 -0
- package/src/app/Footer/index.tsx +1 -1
- package/src/app/Footer/interaction.test.tsx +4 -0
- package/src/app/Header/Header.stories.jsx +102 -0
- package/src/app/Header/HeaderLogo.tsx +18 -2
- package/src/app/Header/HeaderSecondaryLogo.tsx +20 -2
- package/src/app/Header/HeaderTitle.tsx +20 -2
- package/src/app/Header/index.test.tsx +4 -0
- package/src/app/Header/interaction.test.tsx +8 -0
- package/src/app/Loader/index.test.tsx +4 -0
- package/src/app/Masthead/index.test.tsx +4 -0
- package/src/app/Masthead/interaction.test.tsx +4 -0
- package/src/app/Modal/hooks.ts +8 -8
- package/src/app/Modal/index.test.tsx +4 -0
- package/src/app/Modal/index.web.tsx +5 -7
- package/src/app/Modal/interaction.test.tsx +12 -0
- package/src/app/NotFound/index.test.tsx +4 -0
- package/src/app/OutdatedBrowserBanner/index.tsx +1 -1
- package/src/app/Panel/index.test.tsx +4 -0
- package/src/app/PhaseBannerHeader/index.test.tsx +4 -0
- package/src/app/PhaseBannerHeader/index.tsx +1 -1
- package/src/app/QrCodeScanner/index.tsx +0 -1
- package/src/app/QrCodeViewer/index.test.tsx +4 -0
- package/src/app/Skeleton/Skeleton.stories.js +30 -0
- package/src/app/Skeleton/index.test.tsx +4 -0
- package/src/content/Accordion/Accordion.stories.jsx +86 -0
- package/src/content/Accordion/hooks.ts +1 -1
- package/src/content/Accordion/index.test.tsx +4 -0
- package/src/content/Accordion/interaction.test.tsx +4 -0
- package/src/content/Blockquote/Blockquote.stories.js +20 -0
- package/src/content/Blockquote/index.test.tsx +4 -0
- package/src/content/Card/Card.stories.jsx +118 -0
- package/src/content/Card/index.test.tsx +4 -0
- package/src/content/Card/interaction.test.tsx +4 -0
- package/src/content/Chip/Chip.stories.js +22 -0
- package/src/content/Chip/index.test.tsx +4 -0
- package/src/content/Details/index.test.tsx +4 -0
- package/src/content/Details/interaction.test.tsx +4 -0
- package/src/content/List/List.stories.jsx +60 -0
- package/src/content/List/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/content/List/index.test.tsx +4 -0
- package/src/content/Markdown/index.test.tsx +4 -0
- package/src/content/SafeHTML/index.test.tsx +4 -0
- package/src/content/StepNav/index.test.tsx +4 -0
- package/src/content/StepNav/interaction.test.tsx +4 -0
- package/src/content/SummaryList/index.test.tsx +4 -0
- package/src/content/SummaryList/interaction.test.tsx +4 -0
- package/src/content/Table/Table.stories.jsx +216 -0
- package/src/content/Table/index.test.tsx +4 -0
- package/src/content/Table/interaction.test.tsx +8 -0
- package/src/content/TaskList/index.test.tsx +4 -0
- package/src/content/Timeline/index.test.tsx +4 -0
- package/src/doc.mdx +49 -0
- package/src/feedback/CopyToClipboard/CopyToClipboard.stories.jsx +70 -0
- package/src/feedback/CopyToClipboard/doc.mdx +4 -2
- package/src/feedback/CopyToClipboard/index.test.tsx +4 -0
- package/src/feedback/CopyToClipboard/interaction.test.tsx +12 -0
- package/src/feedback/ErrorSummary/ErrorSummary.stories.jsx +67 -0
- package/src/feedback/ErrorSummary/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/feedback/ErrorSummary/index.test.tsx +4 -0
- package/src/feedback/ErrorSummary/interaction.test.tsx +4 -0
- package/src/feedback/NotificationBanner/NotificationBanner.stories.js +36 -0
- package/src/feedback/NotificationBanner/__snapshots__/index.spec.tsx.snap +24 -14
- package/src/feedback/NotificationBanner/index.test.tsx +4 -0
- package/src/feedback/NotificationBanner/interaction.test.tsx +8 -0
- package/src/feedback/PhaseBanner/PhaseBanner.stories.jsx +47 -0
- package/src/feedback/PhaseBanner/index.test.tsx +4 -0
- package/src/feedback/PhaseBanner/interaction.test.tsx +4 -0
- package/src/feedback/WarningText/WarningText.stories.js +24 -0
- package/src/feedback/WarningText/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/feedback/WarningText/index.test.tsx +4 -0
- package/src/form/AutoComplete/AutoComplete.stories.jsx +91 -0
- package/src/form/AutoComplete/Status/index.tsx +1 -1
- package/src/form/AutoComplete/index.test.tsx +4 -0
- package/src/form/AutoComplete/index.tsx +1 -1
- package/src/form/AutoComplete/interaction.test.tsx +4 -0
- package/src/form/Button/Button.stories.js +42 -2
- package/src/form/Button/ButtonLink.tsx +18 -2
- package/src/form/Button/CallToAction.tsx +20 -2
- package/src/form/Button/__stories__/Primary.tsx +24 -2
- package/src/form/Button/index.test.tsx +4 -0
- package/src/form/Button/interaction.test.tsx +20 -0
- package/src/form/Checkbox/Checkbox.stories.jsx +150 -0
- package/src/form/Checkbox/index.test.tsx +4 -0
- package/src/form/Checkbox/interaction.test.tsx +8 -0
- package/src/form/DateInputContainer/DateInputContainer.stories.jsx +115 -0
- package/src/form/DateInputContainer/index.test.tsx +4 -0
- package/src/form/DateInputContainer/interaction.test.tsx +8 -0
- package/src/form/ErrorMessage/ErrorMessage.stories.jsx +42 -0
- package/src/form/ErrorMessage/index.test.tsx +4 -0
- package/src/form/FileUpload/index.test.tsx +4 -0
- package/src/form/RadioContainer/RadioContainer.stories.jsx +157 -0
- package/src/form/RadioContainer/index.test.tsx +4 -0
- package/src/form/RadioContainer/interaction.test.tsx +8 -0
- package/src/form/SearchContainer/index.test.tsx +4 -0
- package/src/form/SelectContainer/SelectContainer.stories.jsx +107 -0
- package/src/form/SelectContainer/index.test.tsx +4 -0
- package/src/form/SelectContainer/interaction.test.tsx +4 -0
- package/src/form/SingleCharacterInputs/SingleCharacterInput.stories.jsx +130 -0
- package/src/form/SingleCharacterInputs/index.test.tsx +4 -0
- package/src/form/TextArea/TextArea.stories.jsx +117 -0
- package/src/form/TextArea/index.test.tsx +4 -0
- package/src/form/TextArea/interaction.test.tsx +12 -0
- package/src/form/TextInput/TextInput.stories.jsx +125 -0
- package/src/form/TextInput/index.test.tsx +4 -0
- package/src/form/TextInput/interaction.test.tsx +8 -0
- package/src/govgr/GovGRLogo/index.tsx +17 -2
- package/src/layouts/Basic/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/layouts/Basic/index.test.tsx +4 -0
- package/src/layouts/Grid/index.test.tsx +4 -0
- package/src/layouts/Screen/index.test.tsx +4 -0
- package/src/layouts/Stack/__stories__/AlignItems.tsx +1 -1
- package/src/layouts/Stack/__stories__/Default.tsx +1 -1
- package/src/layouts/Stack/__stories__/JustifyContent.tsx +1 -1
- package/src/layouts/Stack/__stories__/NoWrap.tsx +1 -1
- package/src/layouts/Stack/__stories__/Row.tsx +1 -1
- package/src/layouts/Stack/__stories__/Spacing.tsx +1 -1
- package/src/layouts/Stack/index.test.tsx +4 -0
- package/src/layouts/Stack/index.tsx +1 -0
- package/src/lazy.js +13 -2
- package/src/navigation/BackLink/doc.mdx +1 -1
- package/src/navigation/BackLink/index.test.tsx +4 -0
- package/src/navigation/BackLink/index.tsx +19 -2
- package/src/navigation/BackLink/interaction.test.tsx +4 -0
- package/src/navigation/BackToTopLink/index.test.tsx +4 -0
- package/src/navigation/Breadcrumbs/BreadcrumbsListItemLink.tsx +22 -0
- package/src/navigation/Breadcrumbs/index.test.tsx +4 -0
- package/src/navigation/Breadcrumbs/index.tsx +1 -1
- package/src/navigation/Breadcrumbs/interaction.test.tsx +12 -0
- package/src/navigation/Drawer/hooks.ts +6 -6
- package/src/navigation/Drawer/index.test.tsx +4 -0
- package/src/navigation/Dropdown/doc.mdx +13 -7
- package/src/navigation/Dropdown/index.test.tsx +4 -0
- package/src/navigation/Dropdown/interaction.test.tsx +20 -0
- package/src/navigation/Link/index.test.tsx +4 -0
- package/src/navigation/Link/index.tsx +10 -5
- package/src/navigation/Link/interaction.test.tsx +12 -0
- package/src/navigation/NavList/NavListAuto/index.tsx +10 -8
- package/src/navigation/NavList/NavListItemAction.tsx +69 -0
- package/src/navigation/NavList/NavListItemLink.tsx +22 -0
- package/src/navigation/NavList/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/navigation/NavList/doc.mdx +17 -15
- package/src/navigation/NavList/index.test.tsx +4 -0
- package/src/navigation/NavList/index.tsx +3 -2
- package/src/navigation/NavList/interaction.test.tsx +12 -0
- package/src/navigation/Pagination/doc.mdx +13 -8
- package/src/navigation/Pagination/hooks.ts +2 -2
- package/src/navigation/Pagination/index.test.tsx +4 -0
- package/src/navigation/Pagination/interaction.test.tsx +4 -0
- package/src/navigation/SkipLink/index.test.tsx +4 -0
- package/src/navigation/Tabs/__stories__/Default.tsx +109 -39
- package/src/navigation/Tabs/__stories__/UsingAccordion.tsx +121 -31
- package/src/navigation/Tabs/hooks.ts +2 -2
- package/src/navigation/Tabs/index.test.tsx +4 -0
- package/src/navigation/Tabs/interaction.test.tsx +6 -0
- package/src/registry.js +99 -91
- package/src/typography/CodeBlock/doc.mdx +1 -1
- package/src/typography/CodeBlock/index.test.tsx +4 -0
- package/src/typography/CodeBlock/index.tsx +14 -12
- package/src/typography/Heading/index.test.tsx +4 -0
- package/src/typography/HeadingCaption/index.test.tsx +4 -0
- package/src/typography/Hint/index.test.tsx +4 -0
- package/src/typography/NormalText/index.test.tsx +4 -0
- package/src/typography/Paragraph/index.test.tsx +4 -0
- package/src/utils/Base/doc.mdx +56 -3
- package/src/utils/VisuallyHidden/index.test.tsx +4 -0
- package/src/utils/hooks/useDebounce.ts +1 -1
- package/typography/CodeBlock/index.d.ts +1 -1
- package/typography/CodeBlock/index.js +1 -2
- package/typography/CodeBlock/index.js.map +2 -2
- package/utils/hooks/useDebounce/index.js +1 -1
- package/utils/hooks/useDebounce.js.map +2 -2
- package/utils/hooks/useLatest.d.ts +1 -1
- package/src/app/Footer/Footer.stories.js +0 -18
- package/src/app/Header/Header.stories.js +0 -20
- package/src/content/Accordion/Accordion.stories.js +0 -14
- package/src/content/Card/Card.stories.js +0 -21
- package/src/content/List/List.stories.js +0 -15
- package/src/content/Table/Table.stories.js +0 -27
- package/src/feedback/CopyToClipboard/CopyToClipboard.stories.js +0 -9
- package/src/feedback/ErrorSummary/ErrorSummary.stories.js +0 -16
- package/src/feedback/PhaseBanner/PhaseBanner.stories.js +0 -11
- package/src/form/AutoComplete/AutoComplete.stories.js +0 -16
- package/src/form/Checkbox/Checkbox.stories.js +0 -19
- package/src/form/DateInputContainer/DateInputContainer.stories.js +0 -14
- package/src/form/ErrorMessage/ErrorMessage.stories.js +0 -12
- package/src/form/RadioContainer/RadioContainer.stories.js +0 -19
- package/src/form/SelectContainer/SelectContainer.stories.js +0 -13
- package/src/form/SingleCharacterInputs/SingleCharacterInput.stories.js +0 -13
- package/src/form/TextArea/TextArea.stories.js +0 -17
- package/src/form/TextInput/TextInput.stories.js +0 -19
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
DateInputContainer,
|
|
4
|
+
DateInputItem,
|
|
5
|
+
} from '@digigov/ui/form/DateInputContainer';
|
|
6
|
+
import {
|
|
7
|
+
FieldContainer,
|
|
8
|
+
Fieldset,
|
|
9
|
+
FieldsetLegend,
|
|
10
|
+
} from '@digigov/ui/form/FieldContainer';
|
|
11
|
+
import { Hint } from '@digigov/ui/typography/Hint';
|
|
12
|
+
import { ErrorMessage } from '@digigov/ui/form/ErrorMessage';
|
|
13
|
+
import { VisuallyHidden } from '@digigov/ui/utils/VisuallyHidden';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Digigov UI/form/DateInputContainer',
|
|
17
|
+
description:
|
|
18
|
+
'Use the date input component to help users enter a memorable date or one they can easily look up.',
|
|
19
|
+
link: 'https://guide.services.gov.gr/docs/components/date-input',
|
|
20
|
+
component: DateInputContainer,
|
|
21
|
+
displayName: 'DateInputContainer',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const WithControls = {
|
|
25
|
+
render: (args) => {
|
|
26
|
+
return (
|
|
27
|
+
<FieldContainer error={args.error}>
|
|
28
|
+
<Fieldset aria-describedby={[`${args.hintId} ${args.errorId}`]}>
|
|
29
|
+
<FieldsetLegend
|
|
30
|
+
heading={args.singleQuestionInPage}
|
|
31
|
+
size={args.singleQuestionInPage ? 'sm' : 'lg'}
|
|
32
|
+
>
|
|
33
|
+
{args.legend}
|
|
34
|
+
</FieldsetLegend>
|
|
35
|
+
{args.hint && <Hint id={args.hintId}>{args.hintMessage}</Hint>}
|
|
36
|
+
{args.error && (
|
|
37
|
+
<ErrorMessage id={args.errorId}>
|
|
38
|
+
<VisuallyHidden>Λάθος:</VisuallyHidden>
|
|
39
|
+
{args.errorMessage}
|
|
40
|
+
</ErrorMessage>
|
|
41
|
+
)}
|
|
42
|
+
<DateInputContainer aria-describedby={args.id} dense={args.dense}>
|
|
43
|
+
<DateInputItem name="day">{args.day}</DateInputItem>
|
|
44
|
+
<DateInputItem name="month">{args.month}</DateInputItem>
|
|
45
|
+
<DateInputItem width={4} name="year" error={args.error}>
|
|
46
|
+
{args.year}
|
|
47
|
+
</DateInputItem>
|
|
48
|
+
</DateInputContainer>
|
|
49
|
+
</Fieldset>
|
|
50
|
+
</FieldContainer>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
args: {
|
|
54
|
+
singleQuestionInPage: true,
|
|
55
|
+
legend: 'Πότε εκδόθηκε το διαβατήριό σας;',
|
|
56
|
+
hint: true,
|
|
57
|
+
hintMessage: 'Για παράδειγμα, 05 11 2020',
|
|
58
|
+
hintId: 'passport-hint',
|
|
59
|
+
day: 'Ημέρα',
|
|
60
|
+
month: 'Μήνας',
|
|
61
|
+
year: 'Έτος',
|
|
62
|
+
error: false,
|
|
63
|
+
errorMessage: 'Παρακαλώ εισάγετε μια έγκυρη ημερομηνία',
|
|
64
|
+
errorId: 'passport-error',
|
|
65
|
+
dense: false,
|
|
66
|
+
},
|
|
67
|
+
argTypes: {
|
|
68
|
+
singleQuestionInPage: {
|
|
69
|
+
control: { type: 'boolean' },
|
|
70
|
+
},
|
|
71
|
+
legend: {
|
|
72
|
+
control: { type: 'text' },
|
|
73
|
+
},
|
|
74
|
+
hint: {
|
|
75
|
+
control: { type: 'boolean' },
|
|
76
|
+
},
|
|
77
|
+
hintMessage: {
|
|
78
|
+
control: { type: 'text' },
|
|
79
|
+
if: { arg: 'hint', eq: true },
|
|
80
|
+
},
|
|
81
|
+
hintId: {
|
|
82
|
+
control: { type: 'text' },
|
|
83
|
+
if: { arg: 'hint', eq: true },
|
|
84
|
+
},
|
|
85
|
+
day: {
|
|
86
|
+
control: { type: 'text' },
|
|
87
|
+
},
|
|
88
|
+
month: {
|
|
89
|
+
control: { type: 'text' },
|
|
90
|
+
},
|
|
91
|
+
year: {
|
|
92
|
+
control: { type: 'text' },
|
|
93
|
+
},
|
|
94
|
+
dense: {
|
|
95
|
+
control: { type: 'boolean' },
|
|
96
|
+
},
|
|
97
|
+
error: {
|
|
98
|
+
control: { type: 'boolean' },
|
|
99
|
+
},
|
|
100
|
+
errorMessage: {
|
|
101
|
+
control: { type: 'text' },
|
|
102
|
+
if: { arg: 'error', eq: true },
|
|
103
|
+
},
|
|
104
|
+
errorId: {
|
|
105
|
+
control: { type: 'text' },
|
|
106
|
+
if: { arg: 'error', eq: true },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export { Default } from '@digigov/ui/form/DateInputContainer/__stories__/Default';
|
|
112
|
+
export { MultipleQuestions } from '@digigov/ui/form/DateInputContainer/__stories__/MultipleQuestions';
|
|
113
|
+
export { WithErrorMessage } from '@digigov/ui/form/DateInputContainer/__stories__/WithErrorMessage';
|
|
114
|
+
export { WithErrorMessageForSingleField } from '@digigov/ui/form/DateInputContainer/__stories__/WithErrorMessageForSingleField';
|
|
115
|
+
export { Dense } from '@digigov/ui/form/DateInputContainer/__stories__/Dense';
|
|
@@ -30,6 +30,10 @@ test('renders the All DateInputContainer variants', async ({ mount, page }) => {
|
|
|
30
30
|
)
|
|
31
31
|
await page.evaluate(() => document.fonts.ready);
|
|
32
32
|
|
|
33
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
34
|
+
await page.mouse.move(0, 0);
|
|
35
|
+
|
|
36
|
+
|
|
33
37
|
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
34
38
|
expect(screenshot).toMatchSnapshot();
|
|
35
39
|
});
|
|
@@ -7,6 +7,10 @@ import { WithErrorMessageForSingleField } from '@digigov/ui/form/DateInputContai
|
|
|
7
7
|
test('renders the Default Actions with mouse', async ({ mount, page }) => {
|
|
8
8
|
await mount(<Default />);
|
|
9
9
|
await page.evaluate(() => document.fonts.ready);
|
|
10
|
+
|
|
11
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
12
|
+
await page.mouse.move(0, 0);
|
|
13
|
+
|
|
10
14
|
await page
|
|
11
15
|
.locator('#root>div>fieldset>div>div:nth-child(1)>label>input')
|
|
12
16
|
.click();
|
|
@@ -25,6 +29,10 @@ test('renders the WithErrorMessageForSingleField Actions with keyboard', async (
|
|
|
25
29
|
}) => {
|
|
26
30
|
await mount(<WithErrorMessageForSingleField />);
|
|
27
31
|
await page.evaluate(() => document.fonts.ready);
|
|
32
|
+
|
|
33
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
34
|
+
await page.mouse.move(0, 0);
|
|
35
|
+
|
|
28
36
|
await page.keyboard.press('Tab');
|
|
29
37
|
await page.keyboard.press('Tab');
|
|
30
38
|
await page.keyboard.press('Tab');
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ErrorMessage from '@digigov/ui/form/ErrorMessage';
|
|
3
|
+
import { VisuallyHidden } from '@digigov/ui/utils/VisuallyHidden';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Digigov UI/form/ErrorMessage',
|
|
7
|
+
description:
|
|
8
|
+
'Show an error message next to the field and in the error summary when there is a validation error.',
|
|
9
|
+
link: 'https://guide.services.gov.gr/docs/components/error-message',
|
|
10
|
+
component: ErrorMessage,
|
|
11
|
+
displayName: 'ErrorMessage',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const WithControls = {
|
|
15
|
+
render: (args) => {
|
|
16
|
+
return (
|
|
17
|
+
<ErrorMessage id={args.id}>
|
|
18
|
+
<VisuallyHidden>{args.visuallyHiddenMessage}</VisuallyHidden>
|
|
19
|
+
{args.errorMessage}
|
|
20
|
+
</ErrorMessage>
|
|
21
|
+
);
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
id: 'date-of-birth-error',
|
|
25
|
+
errorMessage: 'H ημερομηνία γέννησης πρέπει να είναι στο παρελθόν.',
|
|
26
|
+
visuallyHiddenMessage: 'Λάθος:',
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
id: {
|
|
30
|
+
control: { type: 'text' },
|
|
31
|
+
},
|
|
32
|
+
errorMessage: {
|
|
33
|
+
control: { type: 'text' },
|
|
34
|
+
},
|
|
35
|
+
visuallyHiddenMessage: {
|
|
36
|
+
control: { type: 'text' },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export { Default } from '@digigov/ui/form/ErrorMessage/__stories__/Default';
|
|
41
|
+
export { DateInputError } from '@digigov/ui/form/ErrorMessage/__stories__/DateInputError';
|
|
42
|
+
export { ErrorMessageOnly } from '@digigov/ui/form/ErrorMessage/__stories__/ErrorMessageOnly';
|
|
@@ -22,6 +22,10 @@ test('renders the All ErrorMessage variants', async ({ mount, page }) => {
|
|
|
22
22
|
)
|
|
23
23
|
await page.evaluate(() => document.fonts.ready);
|
|
24
24
|
|
|
25
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
26
|
+
await page.mouse.move(0, 0);
|
|
27
|
+
|
|
28
|
+
|
|
25
29
|
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
26
30
|
expect(screenshot).toMatchSnapshot();
|
|
27
31
|
});
|
|
@@ -18,6 +18,10 @@ test('renders the All FileUpload variants', async ({ mount, page }) => {
|
|
|
18
18
|
)
|
|
19
19
|
await page.evaluate(() => document.fonts.ready);
|
|
20
20
|
|
|
21
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
22
|
+
await page.mouse.move(0, 0);
|
|
23
|
+
|
|
24
|
+
|
|
21
25
|
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
22
26
|
expect(screenshot).toMatchSnapshot();
|
|
23
27
|
});
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RadioContainer, RadioItem } from '@digigov/ui/form/RadioContainer';
|
|
3
|
+
import {
|
|
4
|
+
FieldContainer,
|
|
5
|
+
Fieldset,
|
|
6
|
+
FieldsetLegend,
|
|
7
|
+
} from '@digigov/ui/form/FieldContainer';
|
|
8
|
+
import { Hint } from '@digigov/ui/typography/Hint';
|
|
9
|
+
import { ErrorMessage } from '@digigov/ui/form/ErrorMessage';
|
|
10
|
+
import { VisuallyHidden } from '@digigov/ui/utils/VisuallyHidden';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'Digigov UI/form/RadioContainer',
|
|
14
|
+
description:
|
|
15
|
+
'Use the radios component when users can only select one option from a list.',
|
|
16
|
+
link: 'https://guide.services.gov.gr/docs/components/radio',
|
|
17
|
+
component: RadioContainer,
|
|
18
|
+
displayName: 'RadioContainer',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const WithControls = {
|
|
22
|
+
render: (args) => {
|
|
23
|
+
return (
|
|
24
|
+
<FieldContainer error={args.error}>
|
|
25
|
+
<Fieldset aria-describedby={[`${args.hintId} ${args.errorId}`]}>
|
|
26
|
+
<FieldsetLegend
|
|
27
|
+
size={args.legendSize}
|
|
28
|
+
heading={args.singleQuestionInPage}
|
|
29
|
+
>
|
|
30
|
+
{args.legend}
|
|
31
|
+
</FieldsetLegend>
|
|
32
|
+
{args.hint && <Hint id={args.hintId}>{args.hintMessage}</Hint>}
|
|
33
|
+
{args.error && (
|
|
34
|
+
<ErrorMessage id={args.errorId}>
|
|
35
|
+
<VisuallyHidden>Λάθος:</VisuallyHidden>
|
|
36
|
+
{args.errorMessage}
|
|
37
|
+
</ErrorMessage>
|
|
38
|
+
)}
|
|
39
|
+
<RadioContainer dense={args.dense} layout={args.layout}>
|
|
40
|
+
{args.items &&
|
|
41
|
+
args.items.map((item) => (
|
|
42
|
+
<RadioItem
|
|
43
|
+
key={item.value}
|
|
44
|
+
name={args.fieldsetName}
|
|
45
|
+
value={item}
|
|
46
|
+
dividerText={item.dividerText}
|
|
47
|
+
aria-describedby={item.hintId}
|
|
48
|
+
>
|
|
49
|
+
{item.label}
|
|
50
|
+
{item.hint && (
|
|
51
|
+
<Hint id={item.hintId}>{item.hintMessage}</Hint>
|
|
52
|
+
)}
|
|
53
|
+
</RadioItem>
|
|
54
|
+
))}
|
|
55
|
+
</RadioContainer>
|
|
56
|
+
</Fieldset>
|
|
57
|
+
</FieldContainer>
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
args: {
|
|
61
|
+
legend: 'Πώς θέλετε να συνδεθείτε;',
|
|
62
|
+
legendSize: 'lg',
|
|
63
|
+
singleQuestionInPage: true,
|
|
64
|
+
fieldsetName: 'login-method',
|
|
65
|
+
hint: true,
|
|
66
|
+
hintMessage:
|
|
67
|
+
'Θα χρειαστείτε έναν λογαριασμό με τον οποίο θα αποδείξετε την ταυτότητά σας ώστε να προχωρήσετε.',
|
|
68
|
+
hintId: 'hint-id',
|
|
69
|
+
error: false,
|
|
70
|
+
errorMessage: 'Παρακαλώ επιλέξτε μία από τις παρακάτω επιλογές.',
|
|
71
|
+
errorId: 'error-id',
|
|
72
|
+
layout: 'vertical',
|
|
73
|
+
dense: false,
|
|
74
|
+
items: [
|
|
75
|
+
{
|
|
76
|
+
value: 'taxis',
|
|
77
|
+
label: 'Σύνδεση με Taxisnet',
|
|
78
|
+
hint: true,
|
|
79
|
+
hintMessage:
|
|
80
|
+
'Θα πρέπει να έχετε τους κωδικούς Taxisnet για να συνθείτε.',
|
|
81
|
+
hintId: 'hint-id-1',
|
|
82
|
+
dividerText: '',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
value: 'banking',
|
|
86
|
+
label: 'Σύνδεση με λογαρισμό e-banking',
|
|
87
|
+
hint: true,
|
|
88
|
+
hintMessage:
|
|
89
|
+
'Θα πρέπει να έχετε τους κωδικούς του e-banking της τράπεζας για να συνδεθείτε.',
|
|
90
|
+
hintId: 'hint-id-2',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
value: 'none',
|
|
94
|
+
label: 'Χωρίς σύνδεση',
|
|
95
|
+
dividerText: 'ή',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
argTypes: {
|
|
100
|
+
legend: {
|
|
101
|
+
control: { type: 'text' },
|
|
102
|
+
},
|
|
103
|
+
legendSize: {
|
|
104
|
+
control: { type: 'select' },
|
|
105
|
+
options: ['sm', 'md', 'lg'],
|
|
106
|
+
},
|
|
107
|
+
singleQuestionInPage: {
|
|
108
|
+
control: { type: 'boolean' },
|
|
109
|
+
},
|
|
110
|
+
fieldsetName: {
|
|
111
|
+
control: { type: 'text' },
|
|
112
|
+
},
|
|
113
|
+
hint: {
|
|
114
|
+
control: { type: 'boolean' },
|
|
115
|
+
},
|
|
116
|
+
hintMessage: {
|
|
117
|
+
control: { type: 'text' },
|
|
118
|
+
if: { arg: 'hint', eq: true },
|
|
119
|
+
},
|
|
120
|
+
hintId: {
|
|
121
|
+
control: { type: 'text' },
|
|
122
|
+
if: { arg: 'hint', eq: true },
|
|
123
|
+
},
|
|
124
|
+
error: {
|
|
125
|
+
control: { type: 'boolean' },
|
|
126
|
+
},
|
|
127
|
+
errorMessage: {
|
|
128
|
+
control: { type: 'text' },
|
|
129
|
+
if: { arg: 'error', eq: true },
|
|
130
|
+
},
|
|
131
|
+
errorId: {
|
|
132
|
+
control: { type: 'text' },
|
|
133
|
+
if: { arg: 'error', eq: true },
|
|
134
|
+
},
|
|
135
|
+
layout: {
|
|
136
|
+
control: { type: 'inline-radio' },
|
|
137
|
+
options: ['vertical', 'horizontal'],
|
|
138
|
+
},
|
|
139
|
+
dense: {
|
|
140
|
+
control: { type: 'boolean' },
|
|
141
|
+
},
|
|
142
|
+
items: {
|
|
143
|
+
control: { type: 'object' },
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export { Default } from '@digigov/ui/form/RadioContainer/__stories__/Default';
|
|
149
|
+
export { WithMediumLegend } from '@digigov/ui/form/RadioContainer/__stories__/WithMediumLegend';
|
|
150
|
+
export { MultipleQuestions } from '@digigov/ui/form/RadioContainer/__stories__/MultipleQuestions';
|
|
151
|
+
export { Inline } from '@digigov/ui/form/RadioContainer/__stories__/Inline';
|
|
152
|
+
export { WithHints } from '@digigov/ui/form/RadioContainer/__stories__/WithHints';
|
|
153
|
+
export { NoneAnswer } from '@digigov/ui/form/RadioContainer/__stories__/NoneAnswer';
|
|
154
|
+
export { WithErrorMessage } from '@digigov/ui/form/RadioContainer/__stories__/WithErrorMessage';
|
|
155
|
+
export { ConditionalReveal } from '@digigov/ui/form/RadioContainer/__stories__/ConditionalReveal';
|
|
156
|
+
export { InlineWithDivider } from '@digigov/ui/form/RadioContainer/__stories__/InlineWithDivider';
|
|
157
|
+
export { Dense } from '@digigov/ui/form/RadioContainer/__stories__/Dense';
|
|
@@ -50,6 +50,10 @@ test('renders the All RadioContainer variants', async ({ mount, page }) => {
|
|
|
50
50
|
)
|
|
51
51
|
await page.evaluate(() => document.fonts.ready);
|
|
52
52
|
|
|
53
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
54
|
+
await page.mouse.move(0, 0);
|
|
55
|
+
|
|
56
|
+
|
|
53
57
|
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
54
58
|
expect(screenshot).toMatchSnapshot();
|
|
55
59
|
});
|
|
@@ -7,6 +7,10 @@ import { WithHints } from '@digigov/ui/form/RadioContainer/__stories__/WithHints
|
|
|
7
7
|
test('renders the Default Navigate with keyboard', async ({ mount, page }) => {
|
|
8
8
|
await mount(<Default />);
|
|
9
9
|
await page.evaluate(() => document.fonts.ready);
|
|
10
|
+
|
|
11
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
12
|
+
await page.mouse.move(0, 0);
|
|
13
|
+
|
|
10
14
|
await page.keyboard.press('Tab');
|
|
11
15
|
await page.keyboard.press('Space');
|
|
12
16
|
await page.keyboard.press('ArrowDown');
|
|
@@ -21,6 +25,10 @@ test('renders the Default Navigate with keyboard', async ({ mount, page }) => {
|
|
|
21
25
|
test('renders the WithHints Click first', async ({ mount, page }) => {
|
|
22
26
|
await mount(<WithHints />);
|
|
23
27
|
await page.evaluate(() => document.fonts.ready);
|
|
28
|
+
|
|
29
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
30
|
+
await page.mouse.move(0, 0);
|
|
31
|
+
|
|
24
32
|
await page
|
|
25
33
|
.locator('#root>div>fieldset>div>div:nth-child(1)>label>input')
|
|
26
34
|
.click();
|
|
@@ -14,6 +14,10 @@ test('renders the All SearchContainer variants', async ({ mount, page }) => {
|
|
|
14
14
|
)
|
|
15
15
|
await page.evaluate(() => document.fonts.ready);
|
|
16
16
|
|
|
17
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
18
|
+
await page.mouse.move(0, 0);
|
|
19
|
+
|
|
20
|
+
|
|
17
21
|
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
18
22
|
expect(screenshot).toMatchSnapshot();
|
|
19
23
|
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
SelectContainer,
|
|
4
|
+
SelectOption,
|
|
5
|
+
} from '@digigov/ui/form/SelectContainer';
|
|
6
|
+
import { FieldContainer } from '@digigov/ui/form/FieldContainer';
|
|
7
|
+
import { LabelContainer } from '@digigov/ui/form/LabelContainer';
|
|
8
|
+
import { Hint } from '@digigov/ui/typography';
|
|
9
|
+
import { ErrorMessage } from '@digigov/ui/form/ErrorMessage';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Digigov UI/form/SelectContainer',
|
|
13
|
+
description:
|
|
14
|
+
'The select component should only be used as a last resort in public-facing services because research shows that some users find selects very difficult to use.',
|
|
15
|
+
link: 'https://guide.services.gov.gr/docs/components/select',
|
|
16
|
+
component: SelectContainer,
|
|
17
|
+
displayName: 'SelectContainer',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const WithControls = {
|
|
21
|
+
render: (args) => {
|
|
22
|
+
return (
|
|
23
|
+
<FieldContainer error={args.error}>
|
|
24
|
+
<LabelContainer>
|
|
25
|
+
{args.label}
|
|
26
|
+
{args.hint && <Hint id={args.hintId}>{args.hintMessage}</Hint>}
|
|
27
|
+
{args.error && (
|
|
28
|
+
<ErrorMessage id={args.errorId}>{args.errorMessage}</ErrorMessage>
|
|
29
|
+
)}
|
|
30
|
+
<SelectContainer
|
|
31
|
+
dense={args.dense}
|
|
32
|
+
name={args.selectName}
|
|
33
|
+
aria-label={args.ariaLabel}
|
|
34
|
+
>
|
|
35
|
+
{args.options.map((option) => (
|
|
36
|
+
<SelectOption key={option.value} value={option.value}>
|
|
37
|
+
{option.label}
|
|
38
|
+
</SelectOption>
|
|
39
|
+
))}
|
|
40
|
+
</SelectContainer>
|
|
41
|
+
</LabelContainer>
|
|
42
|
+
</FieldContainer>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
args: {
|
|
46
|
+
label: 'Ταξινόμηση',
|
|
47
|
+
selectName: 'select-list',
|
|
48
|
+
ariaLabel: 'ταξινόμηση',
|
|
49
|
+
hint: false,
|
|
50
|
+
hintMessage: 'Επιλέξτε τον τρόπο που θα ταξινομηθούν τα αποτελέσματα',
|
|
51
|
+
hintId: 'hintId',
|
|
52
|
+
error: false,
|
|
53
|
+
errorMessage: 'Πρέπει να επιλέξετε μία επιλογή',
|
|
54
|
+
errorId: 'errorId',
|
|
55
|
+
dense: false,
|
|
56
|
+
options: [
|
|
57
|
+
{ label: 'Δημοφιλή', value: 'popular' },
|
|
58
|
+
{ label: 'Πρόσφατα', value: 'recent' },
|
|
59
|
+
{ label: 'Περισσότερες προβολές', value: 'views' },
|
|
60
|
+
{ label: 'Περισσότερα σχόλια', value: 'comments' },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
argTypes: {
|
|
64
|
+
label: {
|
|
65
|
+
control: { type: 'text' },
|
|
66
|
+
},
|
|
67
|
+
selectName: {
|
|
68
|
+
control: { type: 'text' },
|
|
69
|
+
},
|
|
70
|
+
ariaLabel: {
|
|
71
|
+
control: { type: 'text' },
|
|
72
|
+
},
|
|
73
|
+
hint: {
|
|
74
|
+
control: { type: 'boolean' },
|
|
75
|
+
},
|
|
76
|
+
hintMessage: {
|
|
77
|
+
control: { type: 'text' },
|
|
78
|
+
if: { arg: 'hint', eq: true },
|
|
79
|
+
},
|
|
80
|
+
hintId: {
|
|
81
|
+
control: { type: 'text' },
|
|
82
|
+
if: { arg: 'hint', eq: true },
|
|
83
|
+
},
|
|
84
|
+
error: {
|
|
85
|
+
control: { type: 'boolean' },
|
|
86
|
+
},
|
|
87
|
+
errorMessage: {
|
|
88
|
+
control: { type: 'text' },
|
|
89
|
+
if: { arg: 'error', eq: true },
|
|
90
|
+
},
|
|
91
|
+
errorId: {
|
|
92
|
+
control: { type: 'text' },
|
|
93
|
+
if: { arg: 'error', eq: true },
|
|
94
|
+
},
|
|
95
|
+
dense: {
|
|
96
|
+
control: { type: 'boolean' },
|
|
97
|
+
},
|
|
98
|
+
options: {
|
|
99
|
+
control: { type: 'object' },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { Default } from '@digigov/ui/form/SelectContainer/__stories__/Default';
|
|
105
|
+
export { DisabledInput } from '@digigov/ui/form/SelectContainer/__stories__/DisabledInput';
|
|
106
|
+
export { WithHint } from '@digigov/ui/form/SelectContainer/__stories__/WithHint';
|
|
107
|
+
export { Dense } from '@digigov/ui/form/SelectContainer/__stories__/Dense';
|
|
@@ -26,6 +26,10 @@ test('renders the All SelectContainer variants', async ({ mount, page }) => {
|
|
|
26
26
|
)
|
|
27
27
|
await page.evaluate(() => document.fonts.ready);
|
|
28
28
|
|
|
29
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
30
|
+
await page.mouse.move(0, 0);
|
|
31
|
+
|
|
32
|
+
|
|
29
33
|
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
30
34
|
expect(screenshot).toMatchSnapshot();
|
|
31
35
|
});
|
|
@@ -9,6 +9,10 @@ test('renders the Default SelectContainer with mouse', async ({
|
|
|
9
9
|
}) => {
|
|
10
10
|
await mount(<Default />);
|
|
11
11
|
await page.evaluate(() => document.fonts.ready);
|
|
12
|
+
|
|
13
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
14
|
+
await page.mouse.move(0, 0);
|
|
15
|
+
|
|
12
16
|
await page.locator('#root>div>label>select').click();
|
|
13
17
|
const screenshot = await page.screenshot({
|
|
14
18
|
fullPage: true,
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
FieldContainer,
|
|
4
|
+
Fieldset,
|
|
5
|
+
FieldsetLegend,
|
|
6
|
+
} from '@digigov/ui/form/FieldContainer';
|
|
7
|
+
import {
|
|
8
|
+
SingleCharacterInputs,
|
|
9
|
+
SingleCharacterInput,
|
|
10
|
+
} from '@digigov/ui/form/SingleCharacterInputs';
|
|
11
|
+
import { Hint } from '@digigov/ui/typography/Hint';
|
|
12
|
+
import { ErrorMessage } from '@digigov/ui/form/ErrorMessage';
|
|
13
|
+
import { VisuallyHidden } from '@digigov/ui/utils/VisuallyHidden';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Digigov UI/form/SingleCharacterInputs',
|
|
17
|
+
description:
|
|
18
|
+
'Use the One-time password input component to help users enter a memorable digital character for One-time password.',
|
|
19
|
+
link: 'https://guide.services.gov.gr/docs/patterns/one-time-password',
|
|
20
|
+
component: SingleCharacterInputs,
|
|
21
|
+
displayName: 'SingleCharacterInputs',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const WithControls = {
|
|
25
|
+
render: (args) => {
|
|
26
|
+
return (
|
|
27
|
+
<FieldContainer error={args.error}>
|
|
28
|
+
<Fieldset aria-describedby={[`${args.hintId} ${args.errorId}`]}>
|
|
29
|
+
<FieldsetLegend heading={args.singleQuestionInPage}>
|
|
30
|
+
{args.legend}
|
|
31
|
+
</FieldsetLegend>
|
|
32
|
+
{args.hint && <Hint id={args.hintId}>{args.hintMessage}</Hint>}
|
|
33
|
+
{args.error && (
|
|
34
|
+
<ErrorMessage id={args.errorId}>
|
|
35
|
+
<VisuallyHidden>Λάθος:</VisuallyHidden>
|
|
36
|
+
{args.errorMessage}
|
|
37
|
+
</ErrorMessage>
|
|
38
|
+
)}
|
|
39
|
+
<SingleCharacterInputs>
|
|
40
|
+
{args.items.map((item) => (
|
|
41
|
+
<SingleCharacterInput
|
|
42
|
+
key={item.value}
|
|
43
|
+
name={item.value}
|
|
44
|
+
defaultValue={item.defaultValue}
|
|
45
|
+
error={item.error}
|
|
46
|
+
/>
|
|
47
|
+
))}
|
|
48
|
+
</SingleCharacterInputs>
|
|
49
|
+
</Fieldset>
|
|
50
|
+
</FieldContainer>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
args: {
|
|
54
|
+
singleQuestionInPage: false,
|
|
55
|
+
legend: 'Κωδικός Επιβεβαίωσης',
|
|
56
|
+
hint: true,
|
|
57
|
+
hintMessage:
|
|
58
|
+
'Εισάγετε τον μοναδικό κωδικό που λάβατε στο ηλεκτρονικό σας ταχυδρομείο.',
|
|
59
|
+
hintId: 'code-hint',
|
|
60
|
+
error: false,
|
|
61
|
+
errorMessage: 'Ο κωδικός που εισάγατε είναι λανθασμένος',
|
|
62
|
+
errorId: 'code-error',
|
|
63
|
+
items: [
|
|
64
|
+
{
|
|
65
|
+
defaultValue: '',
|
|
66
|
+
name: 'digit-1',
|
|
67
|
+
error: false,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
defaultValue: '',
|
|
71
|
+
name: 'digit-2',
|
|
72
|
+
error: false,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
defaultValue: '',
|
|
76
|
+
name: 'digit-3',
|
|
77
|
+
error: false,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
defaultValue: '',
|
|
81
|
+
name: 'digit-4',
|
|
82
|
+
error: false,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
defaultValue: '',
|
|
86
|
+
name: 'digit-5',
|
|
87
|
+
error: false,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
argTypes: {
|
|
92
|
+
singleQuestionInPage: {
|
|
93
|
+
control: { type: 'boolean' },
|
|
94
|
+
},
|
|
95
|
+
legend: {
|
|
96
|
+
control: { type: 'text' },
|
|
97
|
+
},
|
|
98
|
+
hint: {
|
|
99
|
+
control: { type: 'boolean' },
|
|
100
|
+
},
|
|
101
|
+
hintMessage: {
|
|
102
|
+
control: { type: 'text' },
|
|
103
|
+
if: { arg: 'hint', eq: true },
|
|
104
|
+
},
|
|
105
|
+
hintId: {
|
|
106
|
+
control: { type: 'text' },
|
|
107
|
+
if: { arg: 'hint', eq: true },
|
|
108
|
+
},
|
|
109
|
+
error: {
|
|
110
|
+
control: { type: 'boolean' },
|
|
111
|
+
},
|
|
112
|
+
errorMessage: {
|
|
113
|
+
control: { type: 'text' },
|
|
114
|
+
if: { arg: 'error', eq: true },
|
|
115
|
+
},
|
|
116
|
+
items: {
|
|
117
|
+
control: { type: 'object' },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
parameters: {
|
|
121
|
+
controls: {
|
|
122
|
+
exclude: ['ref'],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { Default } from '@digigov/ui/form/SingleCharacterInputs/__stories__/Default';
|
|
128
|
+
export { WithDefaultError } from '@digigov/ui/form/SingleCharacterInputs/__stories__/WithDefaultError';
|
|
129
|
+
export { WithErrorMessageInvalidCode } from '@digigov/ui/form/SingleCharacterInputs/__stories__/WithErrorMessageInvalidCode';
|
|
130
|
+
export { WithErrorMessageLessDigit } from '@digigov/ui/form/SingleCharacterInputs/__stories__/WithErrorMessageLessDigit';
|