@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,216 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
TableContainer,
|
|
5
|
+
Table,
|
|
6
|
+
TableCaption,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableRow,
|
|
9
|
+
TableBody,
|
|
10
|
+
TableHeadCell,
|
|
11
|
+
TableDataCell,
|
|
12
|
+
} from '@digigov/ui/content/Table';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Digigov UI/content/Table',
|
|
16
|
+
description:
|
|
17
|
+
'Use the table component to make information easier to compare and scan for users.',
|
|
18
|
+
link: 'https://guide.services.gov.gr/docs/components/table',
|
|
19
|
+
component: Table,
|
|
20
|
+
displayName: 'Table',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const data = {
|
|
24
|
+
title: 'Χρήστες',
|
|
25
|
+
labels: {
|
|
26
|
+
name: 'Ονοματεπώνυμο',
|
|
27
|
+
role: 'Ρόλος',
|
|
28
|
+
email: 'Email',
|
|
29
|
+
phone: 'Ώρες',
|
|
30
|
+
},
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
name: 'Μάριος Μενεξές',
|
|
34
|
+
role: 'Χειριστής',
|
|
35
|
+
email: 'marios@mail.com',
|
|
36
|
+
phone: '34',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Καλλιόπη Παπαδοπούλου',
|
|
40
|
+
role: 'Χειριστής',
|
|
41
|
+
email: 'kalliopi@mail.com',
|
|
42
|
+
phone: '65',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Μαρία Φλούπη',
|
|
46
|
+
role: 'Διαχειριστής',
|
|
47
|
+
email: 'maria@mail.com',
|
|
48
|
+
phone: '12',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Ηλέκτρα Αποστόλου',
|
|
52
|
+
role: 'Διαχειριστής',
|
|
53
|
+
email: 'ilektra@mail.com',
|
|
54
|
+
phone: '26',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const WithControls = {
|
|
60
|
+
render: (args) => {
|
|
61
|
+
return (
|
|
62
|
+
<TableContainer border={args.containerBorder}>
|
|
63
|
+
<Table
|
|
64
|
+
headerVariant={args.headerVariant}
|
|
65
|
+
verticalBorders={args.verticalBorders}
|
|
66
|
+
variant={args.variant}
|
|
67
|
+
dense={args.dense}
|
|
68
|
+
stacked={args.stacked}
|
|
69
|
+
>
|
|
70
|
+
{data && (
|
|
71
|
+
<>
|
|
72
|
+
<TableCaption size={args.tableCaptionSize}>
|
|
73
|
+
{data.title}
|
|
74
|
+
</TableCaption>
|
|
75
|
+
<TableHead>
|
|
76
|
+
<TableRow>
|
|
77
|
+
{data.labels &&
|
|
78
|
+
Object.keys(data.labels).map((key, index) => (
|
|
79
|
+
<TableHeadCell
|
|
80
|
+
key={key}
|
|
81
|
+
width={index === 0 && args.firstTableHeadCellWidth}
|
|
82
|
+
dataType={key === 'phone' && args.tableHeadCellDataType}
|
|
83
|
+
>
|
|
84
|
+
{data.labels[key]}
|
|
85
|
+
</TableHeadCell>
|
|
86
|
+
))}
|
|
87
|
+
</TableRow>
|
|
88
|
+
</TableHead>
|
|
89
|
+
<TableBody>
|
|
90
|
+
{data.content &&
|
|
91
|
+
data.content.map((item, index) => (
|
|
92
|
+
<TableRow
|
|
93
|
+
key={index}
|
|
94
|
+
highlight={index === 1 && args.tableRowHighlight}
|
|
95
|
+
color={index === 1 && args.tableRowColor}
|
|
96
|
+
>
|
|
97
|
+
<TableDataCell data-label={data.labels.name}>
|
|
98
|
+
{item.name}
|
|
99
|
+
</TableDataCell>
|
|
100
|
+
<TableDataCell data-label={data.labels.role}>
|
|
101
|
+
{item.role}
|
|
102
|
+
</TableDataCell>
|
|
103
|
+
<TableDataCell data-label={data.labels.email}>
|
|
104
|
+
{item.email}
|
|
105
|
+
</TableDataCell>
|
|
106
|
+
<TableDataCell
|
|
107
|
+
data-label={data.labels.phone}
|
|
108
|
+
dataType={args.tableHeadCellDataType}
|
|
109
|
+
>
|
|
110
|
+
{item.phone}
|
|
111
|
+
</TableDataCell>
|
|
112
|
+
</TableRow>
|
|
113
|
+
))}
|
|
114
|
+
</TableBody>
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
117
|
+
</Table>
|
|
118
|
+
</TableContainer>
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
args: {
|
|
122
|
+
containerBorder: false,
|
|
123
|
+
headerVariant: 'light',
|
|
124
|
+
verticalBorders: false,
|
|
125
|
+
variant: 'default',
|
|
126
|
+
stacked: 'md',
|
|
127
|
+
dense: false,
|
|
128
|
+
tableCaptionSize: 'md',
|
|
129
|
+
tableRowHighlight: false,
|
|
130
|
+
tableRowColor: 'primary',
|
|
131
|
+
firstTableHeadCellWidth: '25%',
|
|
132
|
+
tableHeadCellDataType: 'text',
|
|
133
|
+
},
|
|
134
|
+
argTypes: {
|
|
135
|
+
containerBorder: {
|
|
136
|
+
control: {
|
|
137
|
+
type: 'boolean',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
headerVariant: {
|
|
141
|
+
options: ['dark', 'light'],
|
|
142
|
+
control: { type: 'inline-radio' },
|
|
143
|
+
},
|
|
144
|
+
verticalBorders: {
|
|
145
|
+
control: {
|
|
146
|
+
type: 'boolean',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
variant: {
|
|
150
|
+
control: { type: 'inline-radio' },
|
|
151
|
+
options: ['default', 'zebra'],
|
|
152
|
+
},
|
|
153
|
+
stacked: {
|
|
154
|
+
control: {
|
|
155
|
+
type: 'select',
|
|
156
|
+
},
|
|
157
|
+
options: ['always', 'sm', 'md', 'never'],
|
|
158
|
+
},
|
|
159
|
+
dense: {
|
|
160
|
+
control: {
|
|
161
|
+
type: 'boolean',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
tableCaptionSize: {
|
|
165
|
+
control: {
|
|
166
|
+
type: 'select',
|
|
167
|
+
},
|
|
168
|
+
options: ['sm', 'md', 'lg', 'xl'],
|
|
169
|
+
},
|
|
170
|
+
tableRowHighlight: {
|
|
171
|
+
control: {
|
|
172
|
+
type: 'boolean',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
tableRowColor: {
|
|
176
|
+
control: {
|
|
177
|
+
type: 'inline-radio',
|
|
178
|
+
},
|
|
179
|
+
options: ['primary', 'secondary'],
|
|
180
|
+
},
|
|
181
|
+
firstTableHeadCellWidth: {
|
|
182
|
+
control: {
|
|
183
|
+
type: 'select',
|
|
184
|
+
},
|
|
185
|
+
options: ['25%', '33.3%', '50%', '66.6%', '75%', '100%', 'full'],
|
|
186
|
+
},
|
|
187
|
+
tableHeadCellDataType: {
|
|
188
|
+
control: {
|
|
189
|
+
type: 'inline-radio',
|
|
190
|
+
},
|
|
191
|
+
options: ['numeric', 'text'],
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
parameters: {
|
|
195
|
+
controls: { exclude: ['ref'] },
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export { Default } from '@digigov/ui/content/Table/__stories__/Default';
|
|
200
|
+
export { TableCaptions } from '@digigov/ui/content/Table/__stories__/TableCaptions';
|
|
201
|
+
export { NoData } from '@digigov/ui/content/Table/__stories__/NoData';
|
|
202
|
+
export { VerticalHeaders } from '@digigov/ui/content/Table/__stories__/VerticalHeaders';
|
|
203
|
+
export { ZebraProp } from '@digigov/ui/content/Table/__stories__/ZebraProp';
|
|
204
|
+
export { NumericDataType } from '@digigov/ui/content/Table/__stories__/NumericDataType';
|
|
205
|
+
export { VerticalBorders } from '@digigov/ui/content/Table/__stories__/VerticalBorders';
|
|
206
|
+
export { Stacked } from '@digigov/ui/content/Table/__stories__/Stacked';
|
|
207
|
+
export { DarkVariant } from '@digigov/ui/content/Table/__stories__/DarkVariant';
|
|
208
|
+
export { DarkVariantWithVerticalHeaders } from '@digigov/ui/content/Table/__stories__/DarkVariantWithVerticalHeaders';
|
|
209
|
+
export { WithLoader } from '@digigov/ui/content/Table/__stories__/WithLoader';
|
|
210
|
+
export { DefinedWidth } from '@digigov/ui/content/Table/__stories__/DefinedWidth';
|
|
211
|
+
export { Dense } from '@digigov/ui/content/Table/__stories__/Dense';
|
|
212
|
+
export { RowColors } from '@digigov/ui/content/Table/__stories__/RowColors';
|
|
213
|
+
export { MultipleProps } from '@digigov/ui/content/Table/__stories__/MultipleProps';
|
|
214
|
+
export { WithSortFilters } from '@digigov/ui/content/Table/__stories__/WithSortFilters';
|
|
215
|
+
export { WithFloatingScroll } from '@digigov/ui/content/Table/__stories__/WithFloatingScroll';
|
|
216
|
+
export { Full } from '@digigov/ui/content/Table/__stories__/Full';
|
|
@@ -83,6 +83,10 @@ test('renders the All Table variants', async ({ mount, page }) => {
|
|
|
83
83
|
</div>
|
|
84
84
|
)
|
|
85
85
|
await page.evaluate(() => document.fonts.ready);
|
|
86
|
+
|
|
87
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
88
|
+
await page.mouse.move(0, 0);
|
|
89
|
+
|
|
86
90
|
await delay(SCREENSHOT_DELAY);
|
|
87
91
|
|
|
88
92
|
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
@@ -9,6 +9,10 @@ const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
9
9
|
test('renders the WithLoader Toggle Loading', async ({ mount, page }) => {
|
|
10
10
|
await mount(<WithLoader />);
|
|
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 delay(SCREENSHOT_DELAY);
|
|
13
17
|
await page.locator('#root>button').click();
|
|
14
18
|
const screenshot = await page.screenshot({
|
|
@@ -24,6 +28,10 @@ test('renders the WithSortFilters Click on header cell', async ({
|
|
|
24
28
|
}) => {
|
|
25
29
|
await mount(<WithSortFilters />);
|
|
26
30
|
await page.evaluate(() => document.fonts.ready);
|
|
31
|
+
|
|
32
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
33
|
+
await page.mouse.move(0, 0);
|
|
34
|
+
|
|
27
35
|
await delay(SCREENSHOT_DELAY);
|
|
28
36
|
await page
|
|
29
37
|
.locator('#root>div>table>thead>tr>th:nth-child(1)>details>summary')
|
|
@@ -18,6 +18,10 @@ test('renders the All TaskList 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
|
});
|
|
@@ -18,6 +18,10 @@ test('renders the All Timeline 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
|
});
|
package/src/doc.mdx
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Introduction
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Digigov UI
|
|
8
|
+
|
|
9
|
+
Digigov UI is a collection of reusable, accessible, and design-consistent React components for building web applications.
|
|
10
|
+
It is designed to work seamlessly with the [GOV.GR design system](https://guide.services.gov.gr) and other [Digigov libraries](learn/overview).
|
|
11
|
+
|
|
12
|
+
## Before We Start
|
|
13
|
+
|
|
14
|
+
User interfaces play a crucial role in web applications, influencing both usability and accessibility.
|
|
15
|
+
With `@digigov/ui`, we provide a structured and efficient way to build scalable and accessible UI components.
|
|
16
|
+
|
|
17
|
+
The `@digigov/ui` library offers structure and flexibility, enabling developers to build cohesive and accessible interfaces with ease.
|
|
18
|
+
Whether you're designing a simple form or a complex application, `@digigov/ui` components provide a solid foundation that enhances development
|
|
19
|
+
efficiency while supporting customization and scalability."
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
The `@digigov/ui` package offers a collection of reusable, accessible, and design-consistent React components tailored for `GOV.GR` services. The library ensures seamless integration with `@digigov/css`, providing predefined styles that adhere to the [GOV.GR design guidelines](https://guide.services.gov.gr).
|
|
24
|
+
|
|
25
|
+
### 📦 Installation
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
yarn add @digigov/ui
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or using npm:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm install i @digigov/ui
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Key Features
|
|
40
|
+
|
|
41
|
+
✅ **Prebuilt Components**: Includes **Buttons**, **Modals**, **Tables**, **Inputs**, **Paragraphs**, **Headers**, **Tabs**, **Accordions** and more, and more—ready to use with minimal configuration.
|
|
42
|
+
|
|
43
|
+
🎨 **Customizability** – Built-in theming, **modify colors**, **typography**, and **spacing** using CSS variables make it easy to adapt components to different project needs.
|
|
44
|
+
|
|
45
|
+
♿ **Accessibility by Design**: Components follow WCAG standards to ensure usability for all users.
|
|
46
|
+
|
|
47
|
+
🔌 **Integration-Friendly**: Works seamlessly with `@digigov/form`, `@digigov/css`, and other Digigov libraries.
|
|
48
|
+
|
|
49
|
+
In the following sections, we will walk you through the concepts of `@digigov/ui` components, including usage examples, and best practices.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CopyToClipboard } from '@digigov/ui/feedback/CopyToClipboard';
|
|
3
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Digigov UI/feedback/CopyToClipboard',
|
|
7
|
+
component: CopyToClipboard,
|
|
8
|
+
displayName: 'CopyToClipboard',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const WithControls = {
|
|
12
|
+
render: (args) => {
|
|
13
|
+
return (
|
|
14
|
+
<CopyToClipboard
|
|
15
|
+
text={args.text}
|
|
16
|
+
variant={args.variant}
|
|
17
|
+
tooltipAlign={args.tooltipAlign}
|
|
18
|
+
dense={args.dense}
|
|
19
|
+
message={args.message}
|
|
20
|
+
id={args.id}
|
|
21
|
+
onCopy={() => {
|
|
22
|
+
console.log('content copied!');
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<Button color="secondary" aria-describedby="copy-to-clipboard">
|
|
26
|
+
Αντιγραφή
|
|
27
|
+
</Button>
|
|
28
|
+
</CopyToClipboard>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
args: {
|
|
32
|
+
text: 'copied-text',
|
|
33
|
+
variant: 'tooltip',
|
|
34
|
+
tooltipAlign: 'left',
|
|
35
|
+
dense: false,
|
|
36
|
+
message: 'Αντιγράφηκε στο πρόχειρο',
|
|
37
|
+
id: 'copy-to-clipboard',
|
|
38
|
+
},
|
|
39
|
+
argTypes: {
|
|
40
|
+
text: {
|
|
41
|
+
control: { type: 'text' },
|
|
42
|
+
},
|
|
43
|
+
variant: {
|
|
44
|
+
options: ['tooltip', 'banner'],
|
|
45
|
+
control: { type: 'select' },
|
|
46
|
+
},
|
|
47
|
+
tooltipAlign: {
|
|
48
|
+
options: ['left', 'right'],
|
|
49
|
+
control: { type: 'select' },
|
|
50
|
+
if: { arg: 'variant', eq: 'tooltip' },
|
|
51
|
+
},
|
|
52
|
+
dense: {
|
|
53
|
+
control: { type: 'boolean' },
|
|
54
|
+
if: { arg: 'variant', eq: 'tooltip' },
|
|
55
|
+
},
|
|
56
|
+
message: {
|
|
57
|
+
control: { type: 'text' },
|
|
58
|
+
},
|
|
59
|
+
id: {
|
|
60
|
+
control: { type: 'text' },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
parameters: {
|
|
64
|
+
controls: { exclude: ['timeout', 'ref'] },
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { Default } from '@digigov/ui/feedback/CopyToClipboard/__stories__/Default';
|
|
69
|
+
export { Banner } from '@digigov/ui/feedback/CopyToClipboard/__stories__/Banner';
|
|
70
|
+
export { Dense } from '@digigov/ui/feedback/CopyToClipboard/__stories__/Dense';
|
|
@@ -3,6 +3,8 @@ id: copy-to-clipboard
|
|
|
3
3
|
title: CopyToClipboard
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
# CopyToClipboard
|
|
7
|
+
|
|
6
8
|
## How to use
|
|
7
9
|
|
|
8
10
|
<code src="@digigov/ui/feedback/CopyToClipboard/__stories__/Default.tsx" />
|
|
@@ -17,6 +19,6 @@ title: CopyToClipboard
|
|
|
17
19
|
|
|
18
20
|
## API
|
|
19
21
|
|
|
20
|
-
See below for a complete reference to all of the props
|
|
22
|
+
See below for a complete reference to all of the props available to the components mentioned here.
|
|
21
23
|
|
|
22
|
-
<ComponentProps componentName={[
|
|
24
|
+
<ComponentProps componentName={['CopyToClipboardContainer']} />{' '}
|
|
@@ -22,6 +22,10 @@ test('renders the All CopyToClipboard 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
|
});
|
|
@@ -8,6 +8,10 @@ import { Dense } from '@digigov/ui/feedback/CopyToClipboard/__stories__/Dense';
|
|
|
8
8
|
test('renders the Banner Click button', async ({ mount, page }) => {
|
|
9
9
|
await mount(<Banner />);
|
|
10
10
|
await page.evaluate(() => document.fonts.ready);
|
|
11
|
+
|
|
12
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
13
|
+
await page.mouse.move(0, 0);
|
|
14
|
+
|
|
11
15
|
await page.locator('#root>div>div>button').click();
|
|
12
16
|
const screenshot = await page.screenshot({
|
|
13
17
|
fullPage: true,
|
|
@@ -19,6 +23,10 @@ test('renders the Banner Click button', async ({ mount, page }) => {
|
|
|
19
23
|
test('renders the Default Click button', async ({ mount, page }) => {
|
|
20
24
|
await mount(<Default />);
|
|
21
25
|
await page.evaluate(() => document.fonts.ready);
|
|
26
|
+
|
|
27
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
28
|
+
await page.mouse.move(0, 0);
|
|
29
|
+
|
|
22
30
|
await page.locator('#root>div>div>button').click();
|
|
23
31
|
const screenshot = await page.screenshot({
|
|
24
32
|
fullPage: true,
|
|
@@ -30,6 +38,10 @@ test('renders the Default Click button', async ({ mount, page }) => {
|
|
|
30
38
|
test('renders the Dense Click button', async ({ mount, page }) => {
|
|
31
39
|
await mount(<Dense />);
|
|
32
40
|
await page.evaluate(() => document.fonts.ready);
|
|
41
|
+
|
|
42
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
43
|
+
await page.mouse.move(0, 0);
|
|
44
|
+
|
|
33
45
|
await page.locator('#root>div>div>button').click();
|
|
34
46
|
const screenshot = await page.screenshot({
|
|
35
47
|
fullPage: true,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ErrorSummary } from '@digigov/ui/feedback/ErrorSummary';
|
|
3
|
+
import { Link } from '@digigov/ui/navigation/Link';
|
|
4
|
+
import { Heading } from '@digigov/ui/typography/Heading';
|
|
5
|
+
import { List, ListItem } from '@digigov/ui/content/List';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Digigov UI/feedback/ErrorSummary',
|
|
9
|
+
description:
|
|
10
|
+
'Use this component at the top of a page to summarise any errors a user has made.',
|
|
11
|
+
link: 'https://guide.services.gov.gr/docs/components/error-summary',
|
|
12
|
+
component: ErrorSummary,
|
|
13
|
+
displayName: 'ErrorSummary',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const WithControls = {
|
|
17
|
+
render: (args) => {
|
|
18
|
+
return (
|
|
19
|
+
<ErrorSummary dense={args.dense}>
|
|
20
|
+
<Heading size="sm">{args.heading}</Heading>
|
|
21
|
+
<List listStyle="none">
|
|
22
|
+
{args.links.map((link, index) => (
|
|
23
|
+
<ListItem key={index}>
|
|
24
|
+
<Link href={link.href}>{link.label}</Link>
|
|
25
|
+
</ListItem>
|
|
26
|
+
))}
|
|
27
|
+
</List>
|
|
28
|
+
</ErrorSummary>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
parameters: {
|
|
32
|
+
controls: { exclude: ['variant', 'ref'] },
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
dense: false,
|
|
36
|
+
heading: 'Υπήρξε κάποιο πρόβλημα',
|
|
37
|
+
links: [
|
|
38
|
+
{
|
|
39
|
+
href: '#',
|
|
40
|
+
label: 'Πρέπει να συμπληρώσετε το έτος',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
href: '#',
|
|
44
|
+
label: 'Πρέπει να συμπληρώσετε το μήνα',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
argTypes: {
|
|
49
|
+
dense: {
|
|
50
|
+
control: { type: 'boolean' },
|
|
51
|
+
},
|
|
52
|
+
heading: {
|
|
53
|
+
control: { type: 'text' },
|
|
54
|
+
},
|
|
55
|
+
links: {
|
|
56
|
+
control: { type: 'object' },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { Default } from '@digigov/ui/feedback/ErrorSummary/__stories__/Default';
|
|
62
|
+
export { Dense } from '@digigov/ui/feedback/ErrorSummary/__stories__/Dense';
|
|
63
|
+
export { LinkedToInput } from '@digigov/ui/feedback/ErrorSummary/__stories__/LinkedToInput';
|
|
64
|
+
export { LinkedToField } from '@digigov/ui/feedback/ErrorSummary/__stories__/LinkedToField';
|
|
65
|
+
export { LinkedToCheckbox } from '@digigov/ui/feedback/ErrorSummary/__stories__/LinkedToCheckbox';
|
|
66
|
+
export { ErrorGroupLinkedToInput } from '@digigov/ui/feedback/ErrorSummary/__stories__/ErrorGroupLinkedToInput';
|
|
67
|
+
export { WithBackLinkAndButton } from '@digigov/ui/feedback/ErrorSummary/__stories__/WithBackLinkAndButton';
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`renders the ErrorSummary with sample data 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Object {
|
|
5
|
+
"$$typeof": Symbol(react.transitional.element),
|
|
6
|
+
"_owner": null,
|
|
7
|
+
"_store": Object {},
|
|
8
|
+
"key": null,
|
|
9
|
+
"props": Object {
|
|
10
|
+
"children": "this is some random warning text",
|
|
11
|
+
},
|
|
12
|
+
"type": Object {
|
|
13
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
14
|
+
"render": [Function],
|
|
15
|
+
},
|
|
16
|
+
}
|
|
7
17
|
`;
|
|
@@ -38,6 +38,10 @@ test('renders the All ErrorSummary variants', async ({ mount, page }) => {
|
|
|
38
38
|
)
|
|
39
39
|
await page.evaluate(() => document.fonts.ready);
|
|
40
40
|
|
|
41
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
42
|
+
await page.mouse.move(0, 0);
|
|
43
|
+
|
|
44
|
+
|
|
41
45
|
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
42
46
|
expect(screenshot).toMatchSnapshot();
|
|
43
47
|
});
|
|
@@ -6,6 +6,10 @@ import { LinkedToCheckbox } from '@digigov/ui/feedback/ErrorSummary/__stories__/
|
|
|
6
6
|
test('renders the LinkedToCheckbox Go to checkbox', async ({ mount, page }) => {
|
|
7
7
|
await mount(<LinkedToCheckbox />);
|
|
8
8
|
await page.evaluate(() => document.fonts.ready);
|
|
9
|
+
|
|
10
|
+
// Move the mouse to the top-left corner to avoid random hover issues
|
|
11
|
+
await page.mouse.move(0, 0);
|
|
12
|
+
|
|
9
13
|
await page.keyboard.press('Tab');
|
|
10
14
|
await page.keyboard.press('Enter');
|
|
11
15
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import NotificationBanner from '@digigov/ui/feedback/NotificationBanner';
|
|
2
|
+
|
|
2
3
|
export default {
|
|
3
4
|
title: 'Digigov UI/feedback/NotificationBanner',
|
|
4
5
|
tags: ['Experimental'],
|
|
@@ -9,6 +10,41 @@ export default {
|
|
|
9
10
|
component: NotificationBanner,
|
|
10
11
|
displayName: 'NotificationBanner',
|
|
11
12
|
};
|
|
13
|
+
|
|
14
|
+
export const WithControls = {
|
|
15
|
+
args: {
|
|
16
|
+
title: 'Ειδοποίηση',
|
|
17
|
+
children: ' Σε 7 ημέρες θα μπορείτε να υποβάλετε την αίτηση.',
|
|
18
|
+
link: {
|
|
19
|
+
label: 'Προβολή αίτησης',
|
|
20
|
+
href: '#',
|
|
21
|
+
},
|
|
22
|
+
variant: 'info',
|
|
23
|
+
dense: false,
|
|
24
|
+
},
|
|
25
|
+
argTypes: {
|
|
26
|
+
title: {
|
|
27
|
+
control: { type: 'text' },
|
|
28
|
+
},
|
|
29
|
+
children: {
|
|
30
|
+
control: { type: 'text' },
|
|
31
|
+
},
|
|
32
|
+
link: {
|
|
33
|
+
control: { type: 'object' },
|
|
34
|
+
},
|
|
35
|
+
variant: {
|
|
36
|
+
options: ['info', 'success', 'error'],
|
|
37
|
+
control: { type: 'select' },
|
|
38
|
+
},
|
|
39
|
+
dense: {
|
|
40
|
+
control: { type: 'boolean' },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
parameters: {
|
|
44
|
+
controls: { exclude: ['ref'] },
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
12
48
|
export { Default } from '@digigov/ui/feedback/NotificationBanner/__stories__/Default';
|
|
13
49
|
export { Success } from '@digigov/ui/feedback/NotificationBanner/__stories__/Success';
|
|
14
50
|
export { Dense } from '@digigov/ui/feedback/NotificationBanner/__stories__/Dense';
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`renders the notification banner 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
Object {
|
|
5
|
+
"$$typeof": Symbol(react.transitional.element),
|
|
6
|
+
"_owner": null,
|
|
7
|
+
"_store": Object {},
|
|
8
|
+
"key": null,
|
|
9
|
+
"props": Object {
|
|
10
|
+
"children": "this is a notification",
|
|
11
|
+
"title": "Notification Banner Example",
|
|
12
|
+
},
|
|
13
|
+
"type": [Function],
|
|
14
|
+
}
|
|
9
15
|
`;
|
|
10
16
|
|
|
11
17
|
exports[`renders the notification banner with title and link 1`] = `
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
Object {
|
|
19
|
+
"$$typeof": Symbol(react.transitional.element),
|
|
20
|
+
"_owner": null,
|
|
21
|
+
"_store": Object {},
|
|
22
|
+
"key": null,
|
|
23
|
+
"props": Object {
|
|
24
|
+
"children": "this is a notification",
|
|
25
|
+
"link": Object {
|
|
15
26
|
"href": "/",
|
|
16
27
|
"label": "This is a label",
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</NotificationBanner>
|
|
28
|
+
},
|
|
29
|
+
"title": "Notification Banner Example",
|
|
30
|
+
},
|
|
31
|
+
"type": [Function],
|
|
32
|
+
}
|
|
23
33
|
`;
|
|
@@ -22,6 +22,10 @@ test('renders the All NotificationBanner 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
|
});
|