@digigov/react-core 0.18.1 → 0.19.1
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/Base/index.d.ts +10 -10
- package/Base/index.js +7 -4
- package/CHANGELOG.md +21 -1
- package/Container/index.js +2 -2
- package/Header/__snapshots__/index.test.tsx.snap +0 -2
- package/Header/index.js +0 -1
- package/HeaderNavMenuContent/__snapshots__/index.test.tsx.snap +16 -0
- package/HeaderNavMenuContent/index.d.ts +11 -0
- package/HeaderNavMenuContent/index.js +40 -0
- package/HeaderNavMenuContent/index.test.d.ts +1 -0
- package/HeaderNavMenuContent/index.test.js +15 -0
- package/Masthead/index.d.ts +6 -0
- package/Masthead/index.js +4 -2
- package/NavHorizontal/__snapshots__/index.test.tsx.snap +6 -23
- package/NavHorizontal/index.d.ts +4 -4
- package/NavHorizontal/index.js +5 -4
- package/NavHorizontal/index.test.js +2 -10
- package/NavHorizontalList/__snapshots__/index.test.tsx.snap +22 -5
- package/NavHorizontalList/index.d.ts +7 -2
- package/NavHorizontalList/index.js +5 -3
- package/NavHorizontalList/index.test.js +8 -0
- package/NavHorizontalListItem/__snapshots__/index.test.tsx.snap +7 -87
- package/NavHorizontalListItem/index.d.ts +4 -12
- package/NavHorizontalListItem/index.js +7 -10
- package/NavHorizontalListItem/index.test.js +0 -34
- package/NavHorizontalListItemButton/__snapshots__/index.test.tsx.snap +146 -0
- package/NavHorizontalListItemButton/index.d.ts +22 -0
- package/NavHorizontalListItemButton/index.js +45 -0
- package/NavHorizontalListItemButton/index.test.d.ts +1 -0
- package/NavHorizontalListItemButton/index.test.js +31 -0
- package/NavHorizontalListItemLink/__snapshots__/index.test.tsx.snap +121 -0
- package/NavHorizontalListItemLink/index.d.ts +20 -0
- package/NavHorizontalListItemLink/index.js +41 -0
- package/NavHorizontalListItemLink/index.test.d.ts +1 -0
- package/NavHorizontalListItemLink/index.test.js +49 -0
- package/NavMenu/__snapshots__/index.test.tsx.snap +16 -0
- package/NavMenu/index.d.ts +10 -0
- package/NavMenu/index.js +39 -0
- package/NavMenu/index.test.d.ts +1 -0
- package/NavMenu/index.test.js +15 -0
- package/NavMenuContainer/__snapshots__/index.test.tsx.snap +29 -0
- package/NavMenuContainer/index.d.ts +10 -0
- package/NavMenuContainer/index.js +38 -0
- package/NavMenuContainer/index.test.d.ts +1 -0
- package/NavMenuContainer/index.test.js +15 -0
- package/NavMenuContainerContent/__snapshots__/index.test.tsx.snap +22 -0
- package/NavMenuContainerContent/index.d.ts +11 -0
- package/NavMenuContainerContent/index.js +41 -0
- package/NavMenuContainerContent/index.test.d.ts +1 -0
- package/NavMenuContainerContent/index.test.js +15 -0
- package/NavMenuContainerContentList/__snapshots__/index.test.tsx.snap +16 -0
- package/NavMenuContainerContentList/index.d.ts +10 -0
- package/NavMenuContainerContentList/index.js +39 -0
- package/NavMenuContainerContentList/index.test.d.ts +1 -0
- package/NavMenuContainerContentList/index.test.js +15 -0
- package/NavMenuContainerContentListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/NavMenuContainerContentListItem/index.d.ts +10 -0
- package/NavMenuContainerContentListItem/index.js +39 -0
- package/NavMenuContainerContentListItem/index.test.d.ts +1 -0
- package/NavMenuContainerContentListItem/index.test.js +15 -0
- package/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +36 -0
- package/NavMenuContainerTitle/index.d.ts +11 -0
- package/NavMenuContainerTitle/index.js +46 -0
- package/NavMenuContainerTitle/index.test.d.ts +1 -0
- package/NavMenuContainerTitle/index.test.js +15 -0
- package/README.md +0 -10
- package/es/Base/index.js +7 -4
- package/es/Container/index.js +2 -2
- package/es/Header/__snapshots__/index.test.tsx.snap +0 -2
- package/es/Header/index.js +0 -1
- package/es/HeaderNavMenuContent/__snapshots__/index.test.tsx.snap +16 -0
- package/es/HeaderNavMenuContent/index.js +24 -0
- package/es/HeaderNavMenuContent/index.test.js +9 -0
- package/es/Masthead/index.js +4 -2
- package/es/NavHorizontal/__snapshots__/index.test.tsx.snap +6 -23
- package/es/NavHorizontal/index.js +5 -4
- package/es/NavHorizontal/index.test.js +2 -10
- package/es/NavHorizontalList/__snapshots__/index.test.tsx.snap +22 -5
- package/es/NavHorizontalList/index.js +5 -3
- package/es/NavHorizontalList/index.test.js +8 -0
- package/es/NavHorizontalListItem/__snapshots__/index.test.tsx.snap +7 -87
- package/es/NavHorizontalListItem/index.js +7 -10
- package/es/NavHorizontalListItem/index.test.js +0 -34
- package/es/NavHorizontalListItemButton/__snapshots__/index.test.tsx.snap +146 -0
- package/es/NavHorizontalListItemButton/index.js +28 -0
- package/es/NavHorizontalListItemButton/index.test.js +25 -0
- package/es/NavHorizontalListItemLink/__snapshots__/index.test.tsx.snap +121 -0
- package/es/NavHorizontalListItemLink/index.js +25 -0
- package/es/NavHorizontalListItemLink/index.test.js +43 -0
- package/es/NavMenu/__snapshots__/index.test.tsx.snap +16 -0
- package/es/NavMenu/index.js +23 -0
- package/es/NavMenu/index.test.js +9 -0
- package/es/NavMenuContainer/__snapshots__/index.test.tsx.snap +29 -0
- package/es/NavMenuContainer/index.js +22 -0
- package/es/NavMenuContainer/index.test.js +9 -0
- package/es/NavMenuContainerContent/__snapshots__/index.test.tsx.snap +22 -0
- package/es/NavMenuContainerContent/index.js +25 -0
- package/es/NavMenuContainerContent/index.test.js +9 -0
- package/es/NavMenuContainerContentList/__snapshots__/index.test.tsx.snap +16 -0
- package/es/NavMenuContainerContentList/index.js +23 -0
- package/es/NavMenuContainerContentList/index.test.js +9 -0
- package/es/NavMenuContainerContentListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/es/NavMenuContainerContentListItem/index.js +23 -0
- package/es/NavMenuContainerContentListItem/index.test.js +9 -0
- package/es/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +36 -0
- package/es/NavMenuContainerTitle/index.js +29 -0
- package/es/NavMenuContainerTitle/index.test.js +9 -0
- package/es/index.js +147 -139
- package/es/registry.js +18 -0
- package/esm/Base/index.js +7 -4
- package/esm/Container/index.js +2 -2
- package/esm/Header/__snapshots__/index.test.tsx.snap +0 -2
- package/esm/Header/index.js +0 -1
- package/esm/HeaderNavMenuContent/__snapshots__/index.test.tsx.snap +16 -0
- package/esm/HeaderNavMenuContent/index.js +24 -0
- package/esm/HeaderNavMenuContent/index.test.js +9 -0
- package/esm/Masthead/index.js +4 -2
- package/esm/NavHorizontal/__snapshots__/index.test.tsx.snap +6 -23
- package/esm/NavHorizontal/index.js +5 -4
- package/esm/NavHorizontal/index.test.js +2 -10
- package/esm/NavHorizontalList/__snapshots__/index.test.tsx.snap +22 -5
- package/esm/NavHorizontalList/index.js +5 -3
- package/esm/NavHorizontalList/index.test.js +8 -0
- package/esm/NavHorizontalListItem/__snapshots__/index.test.tsx.snap +7 -87
- package/esm/NavHorizontalListItem/index.js +7 -10
- package/esm/NavHorizontalListItem/index.test.js +0 -34
- package/esm/NavHorizontalListItemButton/__snapshots__/index.test.tsx.snap +146 -0
- package/esm/NavHorizontalListItemButton/index.js +28 -0
- package/esm/NavHorizontalListItemButton/index.test.js +25 -0
- package/esm/NavHorizontalListItemLink/__snapshots__/index.test.tsx.snap +121 -0
- package/esm/NavHorizontalListItemLink/index.js +25 -0
- package/esm/NavHorizontalListItemLink/index.test.js +43 -0
- package/esm/NavMenu/__snapshots__/index.test.tsx.snap +16 -0
- package/esm/NavMenu/index.js +23 -0
- package/esm/NavMenu/index.test.js +9 -0
- package/esm/NavMenuContainer/__snapshots__/index.test.tsx.snap +29 -0
- package/esm/NavMenuContainer/index.js +22 -0
- package/esm/NavMenuContainer/index.test.js +9 -0
- package/esm/NavMenuContainerContent/__snapshots__/index.test.tsx.snap +22 -0
- package/esm/NavMenuContainerContent/index.js +25 -0
- package/esm/NavMenuContainerContent/index.test.js +9 -0
- package/esm/NavMenuContainerContentList/__snapshots__/index.test.tsx.snap +16 -0
- package/esm/NavMenuContainerContentList/index.js +23 -0
- package/esm/NavMenuContainerContentList/index.test.js +9 -0
- package/esm/NavMenuContainerContentListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/esm/NavMenuContainerContentListItem/index.js +23 -0
- package/esm/NavMenuContainerContentListItem/index.test.js +9 -0
- package/esm/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +36 -0
- package/esm/NavMenuContainerTitle/index.js +29 -0
- package/esm/NavMenuContainerTitle/index.test.js +9 -0
- package/esm/index.js +148 -140
- package/esm/registry.js +18 -0
- package/index.d.ts +147 -139
- package/index.js +1910 -1113
- package/package.json +2 -2
- package/registry.d.ts +9 -0
- package/registry.js +27 -0
- package/src/Accordion/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Accordion/index.test.tsx +8 -0
- package/src/Accordion/index.tsx +27 -0
- package/src/AccordionControls/__snapshots__/index.test.tsx.snap +18 -0
- package/src/AccordionControls/index.test.tsx +14 -0
- package/src/AccordionControls/index.tsx +25 -0
- package/src/AccordionSection/__snapshots__/index.test.tsx.snap +54 -0
- package/src/AccordionSection/index.test.tsx +20 -0
- package/src/AccordionSection/index.tsx +35 -0
- package/src/AccordionSectionContent/__snapshots__/index.test.tsx.snap +16 -0
- package/src/AccordionSectionContent/index.test.tsx +10 -0
- package/src/AccordionSectionContent/index.tsx +28 -0
- package/src/AccordionSectionHeader/__snapshots__/index.test.tsx.snap +24 -0
- package/src/AccordionSectionHeader/index.test.tsx +10 -0
- package/src/AccordionSectionHeader/index.tsx +39 -0
- package/src/AccordionSectionSummary/__snapshots__/index.test.tsx.snap +20 -0
- package/src/AccordionSectionSummary/index.test.tsx +10 -0
- package/src/AccordionSectionSummary/index.tsx +34 -0
- package/src/AccordionSectionSummaryHeading/__snapshots__/index.test.tsx.snap +26 -0
- package/src/AccordionSectionSummaryHeading/index.test.tsx +12 -0
- package/src/AccordionSectionSummaryHeading/index.tsx +44 -0
- package/src/ArrowIcon/__snapshots__/index.test.tsx.snap +115 -0
- package/src/ArrowIcon/index.test.tsx +20 -0
- package/src/ArrowIcon/index.tsx +52 -0
- package/src/Aside/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Aside/index.test.tsx +8 -0
- package/src/Aside/index.tsx +28 -0
- package/src/BackLink/__snapshots__/index.test.tsx.snap +93 -0
- package/src/BackLink/index.test.tsx +11 -0
- package/src/BackLink/index.tsx +41 -0
- package/src/Base/index.tsx +153 -0
- package/src/Blockquote/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Blockquote/index.test.tsx +8 -0
- package/src/Blockquote/index.tsx +26 -0
- package/src/Bottom/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Bottom/index.test.tsx +8 -0
- package/src/Bottom/index.tsx +26 -0
- package/src/Breadcrumbs/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Breadcrumbs/index.test.tsx +8 -0
- package/src/Breadcrumbs/index.tsx +27 -0
- package/src/BreadcrumbsList/__snapshots__/index.test.tsx.snap +16 -0
- package/src/BreadcrumbsList/index.test.tsx +8 -0
- package/src/BreadcrumbsList/index.tsx +27 -0
- package/src/BreadcrumbsListItem/__snapshots__/index.test.tsx.snap +42 -0
- package/src/BreadcrumbsListItem/index.test.tsx +15 -0
- package/src/BreadcrumbsListItem/index.tsx +40 -0
- package/src/BurgerIcon/__snapshots__/index.test.tsx.snap +460 -0
- package/src/BurgerIcon/index.test.tsx +45 -0
- package/src/BurgerIcon/index.tsx +57 -0
- package/src/Button/__snapshots__/index.test.tsx.snap +214 -0
- package/src/Button/index.test.tsx +58 -0
- package/src/Button/index.tsx +62 -0
- package/src/ButtonGroup/__snapshots__/index.test.tsx.snap +16 -0
- package/src/ButtonGroup/index.test.tsx +8 -0
- package/src/ButtonGroup/index.tsx +26 -0
- package/src/ButtonLink/__snapshots__/index.test.tsx.snap +199 -0
- package/src/ButtonLink/index.test.tsx +64 -0
- package/src/ButtonLink/index.tsx +41 -0
- package/src/CallToAction/__snapshots__/index.test.tsx.snap +46 -0
- package/src/CallToAction/index.test.tsx +8 -0
- package/src/CallToAction/index.tsx +31 -0
- package/src/Card/__snapshots__/index.test.tsx.snap +215 -0
- package/src/Card/index.test.tsx +66 -0
- package/src/Card/index.tsx +62 -0
- package/src/CardAction/__snapshots__/index.test.tsx.snap +16 -0
- package/src/CardAction/index.test.tsx +8 -0
- package/src/CardAction/index.tsx +28 -0
- package/src/CardHeading/__snapshots__/index.test.tsx.snap +20 -0
- package/src/CardHeading/index.test.tsx +8 -0
- package/src/CardHeading/index.tsx +29 -0
- package/src/CardText/__snapshots__/index.test.tsx.snap +16 -0
- package/src/CardText/index.test.tsx +8 -0
- package/src/CardText/index.tsx +27 -0
- package/src/CaretIcon/__snapshots__/index.test.tsx.snap +115 -0
- package/src/CaretIcon/index.test.tsx +20 -0
- package/src/CaretIcon/index.tsx +44 -0
- package/src/CheckIcon/__snapshots__/index.test.tsx.snap +452 -0
- package/src/CheckIcon/index.test.tsx +50 -0
- package/src/CheckIcon/index.tsx +34 -0
- package/src/Checkbox/__snapshots__/index.test.tsx.snap +51 -0
- package/src/Checkbox/index.test.tsx +19 -0
- package/src/Checkbox/index.tsx +28 -0
- package/src/CheckboxConditional/__snapshots__/index.test.tsx.snap +24 -0
- package/src/CheckboxConditional/index.test.tsx +10 -0
- package/src/CheckboxConditional/index.tsx +41 -0
- package/src/CheckboxItem/__snapshots__/index.test.tsx.snap +81 -0
- package/src/CheckboxItem/index.test.tsx +19 -0
- package/src/CheckboxItem/index.tsx +53 -0
- package/src/CloseIcon/__snapshots__/index.test.tsx.snap +28 -0
- package/src/CloseIcon/index.test.tsx +8 -0
- package/src/CloseIcon/index.tsx +35 -0
- package/src/Confirmation/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Confirmation/index.test.tsx +8 -0
- package/src/Confirmation/index.tsx +27 -0
- package/src/ConfirmationBody/__snapshots__/index.test.tsx.snap +16 -0
- package/src/ConfirmationBody/index.test.tsx +8 -0
- package/src/ConfirmationBody/index.tsx +27 -0
- package/src/ConfirmationTitle/__snapshots__/index.test.tsx.snap +16 -0
- package/src/ConfirmationTitle/index.test.tsx +8 -0
- package/src/ConfirmationTitle/index.tsx +27 -0
- package/src/Container/__snapshots__/index.test.tsx.snap +78 -0
- package/src/Container/index.test.tsx +20 -0
- package/src/Container/index.tsx +46 -0
- package/src/CopyrightContainer/__snapshots__/index.test.tsx.snap +16 -0
- package/src/CopyrightContainer/index.test.tsx +10 -0
- package/src/CopyrightContainer/index.tsx +28 -0
- package/src/DateInputContainer/__snapshots__/index.test.tsx.snap +16 -0
- package/src/DateInputContainer/index.test.tsx +10 -0
- package/src/DateInputContainer/index.tsx +30 -0
- package/src/DateInputItem/__snapshots__/index.test.tsx.snap +94 -0
- package/src/DateInputItem/index.test.tsx +24 -0
- package/src/DateInputItem/index.tsx +65 -0
- package/src/Details/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Details/index.test.tsx +8 -0
- package/src/Details/index.tsx +27 -0
- package/src/DetailsContent/__snapshots__/index.test.tsx.snap +16 -0
- package/src/DetailsContent/index.test.tsx +8 -0
- package/src/DetailsContent/index.tsx +28 -0
- package/src/DetailsSummary/__snapshots__/index.test.tsx.snap +16 -0
- package/src/DetailsSummary/index.test.tsx +8 -0
- package/src/DetailsSummary/index.tsx +27 -0
- package/src/ErrorMessage/__snapshots__/index.test.tsx.snap +16 -0
- package/src/ErrorMessage/index.test.tsx +8 -0
- package/src/ErrorMessage/index.tsx +29 -0
- package/src/ErrorSummary/__snapshots__/index.test.tsx.snap +16 -0
- package/src/ErrorSummary/index.test.tsx +8 -0
- package/src/ErrorSummary/index.tsx +26 -0
- package/src/FieldContainer/__snapshots__/index.test.tsx.snap +77 -0
- package/src/FieldContainer/index.test.tsx +20 -0
- package/src/FieldContainer/index.tsx +39 -0
- package/src/Fieldset/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Fieldset/index.test.tsx +8 -0
- package/src/Fieldset/index.tsx +28 -0
- package/src/FieldsetLegend/__snapshots__/index.test.tsx.snap +193 -0
- package/src/FieldsetLegend/index.test.tsx +98 -0
- package/src/FieldsetLegend/index.tsx +49 -0
- package/src/FileUpload/__snapshots__/index.test.tsx.snap +61 -0
- package/src/FileUpload/index.test.tsx +12 -0
- package/src/FileUpload/index.tsx +54 -0
- package/src/FileUploadContainer/__snapshots__/index.test.tsx.snap +29 -0
- package/src/FileUploadContainer/index.test.tsx +12 -0
- package/src/FileUploadContainer/index.tsx +36 -0
- package/src/Footer/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Footer/index.test.tsx +8 -0
- package/src/Footer/index.tsx +26 -0
- package/src/FooterContainer/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterContainer/index.test.tsx +8 -0
- package/src/FooterContainer/index.tsx +39 -0
- package/src/FooterContent/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterContent/index.test.tsx +8 -0
- package/src/FooterContent/index.tsx +28 -0
- package/src/FooterContentLogos/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterContentLogos/index.test.tsx +10 -0
- package/src/FooterContentLogos/index.tsx +29 -0
- package/src/FooterHeading/__snapshots__/index.test.tsx.snap +50 -0
- package/src/FooterHeading/index.test.tsx +20 -0
- package/src/FooterHeading/index.tsx +36 -0
- package/src/FooterImage/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterImage/index.test.tsx +8 -0
- package/src/FooterImage/index.tsx +37 -0
- package/src/FooterInlineList/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterInlineList/index.test.tsx +8 -0
- package/src/FooterInlineList/index.tsx +29 -0
- package/src/FooterInlineListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterInlineListItem/index.test.tsx +10 -0
- package/src/FooterInlineListItem/index.tsx +27 -0
- package/src/FooterLink/__snapshots__/index.test.tsx.snap +35 -0
- package/src/FooterLink/index.test.tsx +12 -0
- package/src/FooterLink/index.tsx +32 -0
- package/src/FooterList/__snapshots__/index.test.tsx.snap +33 -0
- package/src/FooterList/index.test.tsx +12 -0
- package/src/FooterList/index.tsx +34 -0
- package/src/FooterListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterListItem/index.test.tsx +8 -0
- package/src/FooterListItem/index.tsx +28 -0
- package/src/FooterMeta/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterMeta/index.test.tsx +8 -0
- package/src/FooterMeta/index.tsx +28 -0
- package/src/FooterMetaItem/__snapshots__/index.test.tsx.snap +50 -0
- package/src/FooterMetaItem/index.test.tsx +20 -0
- package/src/FooterMetaItem/index.tsx +34 -0
- package/src/FooterNavigation/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterNavigation/index.test.tsx +8 -0
- package/src/FooterNavigation/index.tsx +29 -0
- package/src/FooterSection/__snapshots__/index.test.tsx.snap +16 -0
- package/src/FooterSection/index.test.tsx +8 -0
- package/src/FooterSection/index.tsx +29 -0
- package/src/Form/__snapshots__/index.test.tsx.snap +33 -0
- package/src/Form/index.test.tsx +12 -0
- package/src/Form/index.tsx +31 -0
- package/src/GovGRLogo/__snapshots__/index.test.tsx.snap +27 -0
- package/src/GovGRLogo/govgr-logo-base64.js +1 -0
- package/src/GovGRLogo/govgr-logo-blue-base64.ts +1 -0
- package/src/GovGRLogo/index.test.tsx +8 -0
- package/src/GovGRLogo/index.tsx +42 -0
- package/src/Grid/__snapshots__/index.test.tsx.snap +135 -0
- package/src/Grid/index.test.tsx +29 -0
- package/src/Grid/index.tsx +126 -0
- package/src/Header/__snapshots__/index.test.tsx.snap +18 -0
- package/src/Header/index.test.tsx +8 -0
- package/src/Header/index.tsx +28 -0
- package/src/HeaderContent/__snapshots__/index.test.tsx.snap +16 -0
- package/src/HeaderContent/index.test.tsx +8 -0
- package/src/HeaderContent/index.tsx +27 -0
- package/src/HeaderLogo/__snapshots__/index.test.tsx.snap +18 -0
- package/src/HeaderLogo/index.test.tsx +8 -0
- package/src/HeaderLogo/index.tsx +45 -0
- package/src/HeaderNavMenuContent/__snapshots__/index.test.tsx.snap +16 -0
- package/src/HeaderNavMenuContent/index.test.tsx +10 -0
- package/src/HeaderNavMenuContent/index.tsx +29 -0
- package/src/HeaderSecondaryLogo/__snapshots__/index.test.tsx.snap +48 -0
- package/src/HeaderSecondaryLogo/index.test.tsx +26 -0
- package/src/HeaderSecondaryLogo/index.tsx +52 -0
- package/src/HeaderSection/__snapshots__/index.test.tsx.snap +16 -0
- package/src/HeaderSection/index.test.tsx +8 -0
- package/src/HeaderSection/index.tsx +27 -0
- package/src/HeaderSubtitle/__snapshots__/index.test.tsx.snap +16 -0
- package/src/HeaderSubtitle/index.test.tsx +8 -0
- package/src/HeaderSubtitle/index.tsx +20 -0
- package/src/HeaderTitle/__snapshots__/index.test.tsx.snap +37 -0
- package/src/HeaderTitle/index.test.tsx +13 -0
- package/src/HeaderTitle/index.tsx +33 -0
- package/src/Heading/__snapshots__/index.test.tsx.snap +300 -0
- package/src/Heading/index.test.tsx +144 -0
- package/src/Heading/index.tsx +64 -0
- package/src/HeadingCaption/__snapshots__/index.test.tsx.snap +67 -0
- package/src/HeadingCaption/index.test.tsx +26 -0
- package/src/HeadingCaption/index.tsx +36 -0
- package/src/HellenicRepublicLogo/__snapshots__/index.test.tsx.snap +30 -0
- package/src/HellenicRepublicLogo/index.test.tsx +8 -0
- package/src/HellenicRepublicLogo/index.tsx +61 -0
- package/src/HellenicRepublicLogo/logo-el.ts +1 -0
- package/src/HellenicRepublicLogo/logo-en.ts +1 -0
- package/src/HellenicRepublicLogo/logo-inverted-el.ts +1 -0
- package/src/HellenicRepublicLogo/logo-inverted-en.ts +1 -0
- package/src/Hidden/__snapshots__/index.test.tsx.snap +96 -0
- package/src/Hidden/index.test.tsx +50 -0
- package/src/Hidden/index.tsx +51 -0
- package/src/Hint/__snapshots__/index.test.tsx.snap +67 -0
- package/src/Hint/index.test.tsx +17 -0
- package/src/Hint/index.tsx +35 -0
- package/src/LabelContainer/__snapshots__/index.test.tsx.snap +16 -0
- package/src/LabelContainer/index.test.tsx +8 -0
- package/src/LabelContainer/index.tsx +27 -0
- package/src/LabelTitle/__snapshots__/index.test.tsx.snap +193 -0
- package/src/LabelTitle/index.test.tsx +68 -0
- package/src/LabelTitle/index.tsx +44 -0
- package/src/Layout/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Layout/index.test.tsx +8 -0
- package/src/Layout/index.tsx +29 -0
- package/src/LinkBase/__snapshots__/index.test.tsx.snap +50 -0
- package/src/LinkBase/index.test.tsx +16 -0
- package/src/LinkBase/index.tsx +33 -0
- package/src/List/__snapshots__/index.test.tsx.snap +212 -0
- package/src/List/index.test.tsx +61 -0
- package/src/List/index.tsx +40 -0
- package/src/ListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/src/ListItem/index.test.tsx +8 -0
- package/src/ListItem/index.tsx +26 -0
- package/src/Main/__snapshots__/index.test.tsx.snap +18 -0
- package/src/Main/index.test.tsx +8 -0
- package/src/Main/index.tsx +28 -0
- package/src/Masthead/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Masthead/index.test.tsx +8 -0
- package/src/Masthead/index.tsx +36 -0
- package/src/MastheadBody/__snapshots__/index.test.tsx.snap +16 -0
- package/src/MastheadBody/index.test.tsx +8 -0
- package/src/MastheadBody/index.tsx +27 -0
- package/src/MoreVertIcon/__snapshots__/index.test.tsx.snap +632 -0
- package/src/MoreVertIcon/index.test.tsx +50 -0
- package/src/MoreVertIcon/index.tsx +36 -0
- package/src/NavHorizontal/__snapshots__/index.test.tsx.snap +33 -0
- package/src/NavHorizontal/index.test.tsx +12 -0
- package/src/NavHorizontal/index.tsx +35 -0
- package/src/NavHorizontalList/__snapshots__/index.test.tsx.snap +33 -0
- package/src/NavHorizontalList/index.test.tsx +13 -0
- package/src/NavHorizontalList/index.tsx +39 -0
- package/src/NavHorizontalListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/src/NavHorizontalListItem/index.test.tsx +10 -0
- package/src/NavHorizontalListItem/index.tsx +28 -0
- package/src/NavHorizontalListItemButton/__snapshots__/index.test.tsx.snap +146 -0
- package/src/NavHorizontalListItemButton/index.test.tsx +29 -0
- package/src/NavHorizontalListItemButton/index.tsx +47 -0
- package/src/NavHorizontalListItemLink/__snapshots__/index.test.tsx.snap +121 -0
- package/src/NavHorizontalListItemLink/index.test.tsx +45 -0
- package/src/NavHorizontalListItemLink/index.tsx +44 -0
- package/src/NavMenu/__snapshots__/index.test.tsx.snap +16 -0
- package/src/NavMenu/index.test.tsx +7 -0
- package/src/NavMenu/index.tsx +27 -0
- package/src/NavMenuContainer/__snapshots__/index.test.tsx.snap +29 -0
- package/src/NavMenuContainer/index.test.tsx +7 -0
- package/src/NavMenuContainer/index.tsx +22 -0
- package/src/NavMenuContainerContent/__snapshots__/index.test.tsx.snap +22 -0
- package/src/NavMenuContainerContent/index.test.tsx +9 -0
- package/src/NavMenuContainerContent/index.tsx +23 -0
- package/src/NavMenuContainerContentList/__snapshots__/index.test.tsx.snap +16 -0
- package/src/NavMenuContainerContentList/index.test.tsx +9 -0
- package/src/NavMenuContainerContentList/index.tsx +28 -0
- package/src/NavMenuContainerContentListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/src/NavMenuContainerContentListItem/index.test.tsx +11 -0
- package/src/NavMenuContainerContentListItem/index.tsx +31 -0
- package/src/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +36 -0
- package/src/NavMenuContainerTitle/index.test.tsx +9 -0
- package/src/NavMenuContainerTitle/index.tsx +26 -0
- package/src/NavVertical/__snapshots__/index.test.tsx.snap +16 -0
- package/src/NavVertical/index.test.tsx +8 -0
- package/src/NavVertical/index.tsx +28 -0
- package/src/NavVerticalItem/__snapshots__/index.test.tsx.snap +50 -0
- package/src/NavVerticalItem/index.test.tsx +20 -0
- package/src/NavVerticalItem/index.tsx +35 -0
- package/src/NormalText/__snapshots__/index.test.tsx.snap +707 -0
- package/src/NormalText/index.test.tsx +346 -0
- package/src/NormalText/index.tsx +62 -0
- package/src/NotificationBannerContainer/__snapshots__/index.test.tsx.snap +68 -0
- package/src/NotificationBannerContainer/index.test.tsx +30 -0
- package/src/NotificationBannerContainer/index.tsx +43 -0
- package/src/NotificationBannerContent/__snapshots__/index.test.tsx.snap +16 -0
- package/src/NotificationBannerContent/index.test.tsx +10 -0
- package/src/NotificationBannerContent/index.tsx +30 -0
- package/src/NotificationBannerHeader/__snapshots__/index.test.tsx.snap +20 -0
- package/src/NotificationBannerHeader/index.test.tsx +10 -0
- package/src/NotificationBannerHeader/index.tsx +35 -0
- package/src/NotificationBannerHeading/__snapshots__/index.test.tsx.snap +16 -0
- package/src/NotificationBannerHeading/index.test.tsx +10 -0
- package/src/NotificationBannerHeading/index.tsx +29 -0
- package/src/NotificationBannerLink/__snapshots__/index.test.tsx.snap +37 -0
- package/src/NotificationBannerLink/index.test.tsx +20 -0
- package/src/NotificationBannerLink/index.tsx +38 -0
- package/src/PageTitle/__snapshots__/index.test.tsx.snap +16 -0
- package/src/PageTitle/index.test.tsx +8 -0
- package/src/PageTitle/index.tsx +19 -0
- package/src/PageTitleCaption/__snapshots__/index.test.tsx.snap +67 -0
- package/src/PageTitleCaption/index.test.tsx +26 -0
- package/src/PageTitleCaption/index.tsx +38 -0
- package/src/PageTitleHeading/__snapshots__/index.test.tsx.snap +84 -0
- package/src/PageTitleHeading/index.test.tsx +32 -0
- package/src/PageTitleHeading/index.tsx +38 -0
- package/src/PageTitleSection/__snapshots__/index.test.tsx.snap +16 -0
- package/src/PageTitleSection/index.test.tsx +8 -0
- package/src/PageTitleSection/index.tsx +21 -0
- package/src/Paragraph/__snapshots__/index.test.tsx.snap +724 -0
- package/src/Paragraph/index.test.tsx +331 -0
- package/src/Paragraph/index.tsx +61 -0
- package/src/PhaseBanner/__snapshots__/index.test.tsx.snap +41 -0
- package/src/PhaseBanner/index.test.tsx +12 -0
- package/src/PhaseBanner/index.tsx +43 -0
- package/src/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +16 -0
- package/src/PhaseBannerHeaderContainer/inde.test.tsx +10 -0
- package/src/PhaseBannerHeaderContainer/index.tsx +28 -0
- package/src/PhaseBannerTag/__snapshots__/index.test.tsx.snap +16 -0
- package/src/PhaseBannerTag/index.test.tsx +8 -0
- package/src/PhaseBannerTag/index.tsx +28 -0
- package/src/PhaseBannerText/__snapshots__/index.test.tsx.snap +16 -0
- package/src/PhaseBannerText/index.test.tsx +8 -0
- package/src/PhaseBannerText/index.tsx +29 -0
- package/src/RadioConditional/__snapshots__/index.test.tsx.snap +24 -0
- package/src/RadioConditional/index.test.tsx +8 -0
- package/src/RadioConditional/index.tsx +41 -0
- package/src/RadioContainer/__snapshots__/index.test.tsx.snap +16 -0
- package/src/RadioContainer/index.test.tsx +8 -0
- package/src/RadioContainer/index.tsx +34 -0
- package/src/RadioItem/__snapshots__/index.test.tsx.snap +112 -0
- package/src/RadioItem/index.test.tsx +28 -0
- package/src/RadioItem/index.tsx +51 -0
- package/src/SectionBreak/__snapshots__/index.test.tsx.snap +89 -0
- package/src/SectionBreak/index.test.tsx +28 -0
- package/src/SectionBreak/index.tsx +39 -0
- package/src/SelectContainer/__snapshots__/index.test.tsx.snap +57 -0
- package/src/SelectContainer/index.test.tsx +24 -0
- package/src/SelectContainer/index.tsx +34 -0
- package/src/SelectOption/__snapshots__/index.test.tsx.snap +35 -0
- package/src/SelectOption/index.test.tsx +14 -0
- package/src/SelectOption/index.tsx +41 -0
- package/src/SkipLink/__snapshots__/index.test.tsx.snap +20 -0
- package/src/SkipLink/index.test.tsx +8 -0
- package/src/SkipLink/index.tsx +33 -0
- package/src/SummaryList/__snapshots__/index.test.tsx.snap +16 -0
- package/src/SummaryList/index.test.tsx +8 -0
- package/src/SummaryList/index.tsx +35 -0
- package/src/SummaryListItem/__snapshots__/index.test.tsx.snap +16 -0
- package/src/SummaryListItem/index.test.tsx +8 -0
- package/src/SummaryListItem/index.tsx +28 -0
- package/src/SummaryListItemAction/__snapshots__/index.test.tsx.snap +16 -0
- package/src/SummaryListItemAction/index.test.tsx +10 -0
- package/src/SummaryListItemAction/index.tsx +28 -0
- package/src/SummaryListItemKey/__snapshots__/index.test.tsx.snap +16 -0
- package/src/SummaryListItemKey/index.test.tsx +10 -0
- package/src/SummaryListItemKey/index.tsx +28 -0
- package/src/SummaryListItemValue/__snapshots__/index.test.tsx.snap +16 -0
- package/src/SummaryListItemValue/index.test.tsx +10 -0
- package/src/SummaryListItemValue/index.tsx +27 -0
- package/src/SvgIcon/__snapshots__/index.test.tsx.snap +344 -0
- package/src/SvgIcon/index.test.tsx +62 -0
- package/src/SvgIcon/index.tsx +64 -0
- package/src/Table/__snapshots__/index.test.tsx.snap +84 -0
- package/src/Table/index.test.tsx +24 -0
- package/src/Table/index.tsx +69 -0
- package/src/TableBody/__snapshots__/index.test.tsx.snap +16 -0
- package/src/TableBody/index.test.tsx +8 -0
- package/src/TableBody/index.tsx +27 -0
- package/src/TableCaption/__snapshots__/index.test.tsx.snap +84 -0
- package/src/TableCaption/index.test.tsx +32 -0
- package/src/TableCaption/index.tsx +37 -0
- package/src/TableContainer/__snapshots__/index.test.tsx.snap +33 -0
- package/src/TableContainer/index.test.tsx +13 -0
- package/src/TableContainer/index.tsx +36 -0
- package/src/TableDataCell/__snapshots__/index.test.tsx.snap +33 -0
- package/src/TableDataCell/index.test.tsx +14 -0
- package/src/TableDataCell/index.tsx +38 -0
- package/src/TableHead/__snapshots__/index.test.tsx.snap +16 -0
- package/src/TableHead/index.test.tsx +8 -0
- package/src/TableHead/index.tsx +27 -0
- package/src/TableHeadCell/__snapshots__/index.test.tsx.snap +219 -0
- package/src/TableHeadCell/index.test.tsx +105 -0
- package/src/TableHeadCell/index.tsx +56 -0
- package/src/TableNoDataRow/__snapshots__/index.test.tsx.snap +22 -0
- package/src/TableNoDataRow/index.test.tsx +8 -0
- package/src/TableNoDataRow/index.tsx +31 -0
- package/src/TableRow/__snapshots__/index.test.tsx.snap +16 -0
- package/src/TableRow/index.test.tsx +8 -0
- package/src/TableRow/index.tsx +26 -0
- package/src/Tabs/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Tabs/index.test.tsx +8 -0
- package/src/Tabs/index.tsx +28 -0
- package/src/TabsHeading/__snapshots__/index.test.tsx.snap +50 -0
- package/src/TabsHeading/index.test.tsx +16 -0
- package/src/TabsHeading/index.tsx +36 -0
- package/src/TabsList/__snapshots__/index.test.tsx.snap +18 -0
- package/src/TabsList/index.test.tsx +8 -0
- package/src/TabsList/index.tsx +28 -0
- package/src/TabsListItem/__snapshots__/index.test.tsx.snap +133 -0
- package/src/TabsListItem/index.test.tsx +38 -0
- package/src/TabsListItem/index.tsx +50 -0
- package/src/TabsPanel/__snapshots__/index.test.tsx.snap +83 -0
- package/src/TabsPanel/index.test.tsx +20 -0
- package/src/TabsPanel/index.tsx +37 -0
- package/src/TextArea/__snapshots__/index.test.tsx.snap +113 -0
- package/src/TextArea/index.test.tsx +28 -0
- package/src/TextArea/index.tsx +49 -0
- package/src/TextInput/__snapshots__/index.test.tsx.snap +760 -0
- package/src/TextInput/index.test.tsx +256 -0
- package/src/TextInput/index.tsx +82 -0
- package/src/Top/__snapshots__/index.test.tsx.snap +16 -0
- package/src/Top/index.test.tsx +8 -0
- package/src/Top/index.tsx +27 -0
- package/src/UncheckIcon/__snapshots__/index.test.tsx.snap +452 -0
- package/src/UncheckIcon/index.test.tsx +50 -0
- package/src/UncheckIcon/index.tsx +34 -0
- package/src/Unpurge/index.tsx +112 -0
- package/src/VisuallyHidden/__snapshots__/index.test.tsx.snap +16 -0
- package/src/VisuallyHidden/index.test.tsx +8 -0
- package/src/VisuallyHidden/index.tsx +28 -0
- package/src/WarningText/__snapshots__/index.test.tsx.snap +30 -0
- package/src/WarningText/index.test.tsx +8 -0
- package/src/WarningText/index.tsx +48 -0
- package/src/index.ts +147 -0
- package/src/registry.js +336 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface RadioConditionalProps extends BaseProps<'div'> {}
|
|
6
|
+
/**
|
|
7
|
+
* RadioConditional asks the user a related question when they select a particular radios,
|
|
8
|
+
* so they only see the question when it’s relevant to them.
|
|
9
|
+
* RadioConditional must be used inside Radio component
|
|
10
|
+
*/
|
|
11
|
+
export const RadioConditional = React.forwardRef<
|
|
12
|
+
HTMLDivElement,
|
|
13
|
+
RadioConditionalProps
|
|
14
|
+
>(function RadioConditional({ className, children, ...props }, ref) {
|
|
15
|
+
return (
|
|
16
|
+
<Base
|
|
17
|
+
as="div"
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={clsx(className, {
|
|
20
|
+
'govgr-radios__conditional': true,
|
|
21
|
+
})}
|
|
22
|
+
{...props}
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
className={clsx({
|
|
26
|
+
'govgr-field': true,
|
|
27
|
+
})}
|
|
28
|
+
>
|
|
29
|
+
<label
|
|
30
|
+
className={clsx({
|
|
31
|
+
'govgr-label': true,
|
|
32
|
+
})}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</label>
|
|
36
|
+
</div>
|
|
37
|
+
</Base>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export default RadioConditional;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the RadioContainer with no props 1`] = `
|
|
4
|
+
<ForwardRef(RadioContainer)>
|
|
5
|
+
<ForwardRef(Base)
|
|
6
|
+
as="div"
|
|
7
|
+
className="govgr-radios"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
className="govgr-radios"
|
|
11
|
+
>
|
|
12
|
+
hello
|
|
13
|
+
</div>
|
|
14
|
+
</ForwardRef(Base)>
|
|
15
|
+
</ForwardRef(RadioContainer)>
|
|
16
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import RadioContainer from '@digigov/react-core/RadioContainer';
|
|
5
|
+
|
|
6
|
+
it('renders the RadioContainer with no props', () => {
|
|
7
|
+
expect(mount(<RadioContainer>hello</RadioContainer>)).toMatchSnapshot();
|
|
8
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface RadioContainerProps extends BaseProps<'div'> {
|
|
6
|
+
/**
|
|
7
|
+
* The `inline` prop controls whether the radio items will render next to each other or not.
|
|
8
|
+
* */
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* RadioContainer component is uses when users can only select one option from a list.
|
|
13
|
+
* It is used as parent component to wrap RadioItem compoent.
|
|
14
|
+
*/
|
|
15
|
+
export const RadioContainer = React.forwardRef<
|
|
16
|
+
HTMLDivElement,
|
|
17
|
+
RadioContainerProps
|
|
18
|
+
>(function RadioContainer({ className, children, inline, ...props }, ref) {
|
|
19
|
+
return (
|
|
20
|
+
<Base
|
|
21
|
+
as="div"
|
|
22
|
+
ref={ref}
|
|
23
|
+
className={clsx(className, {
|
|
24
|
+
'govgr-radios': true,
|
|
25
|
+
'govgr-radios--inline': inline === true,
|
|
26
|
+
})}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</Base>
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export default RadioContainer;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the RadioItem value props 1`] = `
|
|
4
|
+
<ForwardRef(RadioItem)
|
|
5
|
+
value="someValue"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
className="govgr-radios__item"
|
|
9
|
+
>
|
|
10
|
+
<label
|
|
11
|
+
className="govgr-label govgr-radios__label"
|
|
12
|
+
>
|
|
13
|
+
hello
|
|
14
|
+
<ForwardRef(Base)
|
|
15
|
+
as="input"
|
|
16
|
+
className="govgr-radios__input"
|
|
17
|
+
type="radio"
|
|
18
|
+
value="someValue"
|
|
19
|
+
>
|
|
20
|
+
<input
|
|
21
|
+
className="govgr-radios__input"
|
|
22
|
+
type="radio"
|
|
23
|
+
value="someValue"
|
|
24
|
+
/>
|
|
25
|
+
</ForwardRef(Base)>
|
|
26
|
+
</label>
|
|
27
|
+
</div>
|
|
28
|
+
</ForwardRef(RadioItem)>
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
exports[`renders the RadioItem with name props 1`] = `
|
|
32
|
+
<ForwardRef(RadioItem)
|
|
33
|
+
name="name"
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
className="govgr-radios__item"
|
|
37
|
+
>
|
|
38
|
+
<label
|
|
39
|
+
className="govgr-label govgr-radios__label"
|
|
40
|
+
>
|
|
41
|
+
hello
|
|
42
|
+
<ForwardRef(Base)
|
|
43
|
+
as="input"
|
|
44
|
+
className="govgr-radios__input"
|
|
45
|
+
name="name"
|
|
46
|
+
type="radio"
|
|
47
|
+
>
|
|
48
|
+
<input
|
|
49
|
+
className="govgr-radios__input"
|
|
50
|
+
name="name"
|
|
51
|
+
type="radio"
|
|
52
|
+
/>
|
|
53
|
+
</ForwardRef(Base)>
|
|
54
|
+
</label>
|
|
55
|
+
</div>
|
|
56
|
+
</ForwardRef(RadioItem)>
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`renders the RadioItem with name and value props 1`] = `
|
|
60
|
+
<ForwardRef(RadioItem)
|
|
61
|
+
name="name"
|
|
62
|
+
value="someValue"
|
|
63
|
+
>
|
|
64
|
+
<div
|
|
65
|
+
className="govgr-radios__item"
|
|
66
|
+
>
|
|
67
|
+
<label
|
|
68
|
+
className="govgr-label govgr-radios__label"
|
|
69
|
+
>
|
|
70
|
+
hello
|
|
71
|
+
<ForwardRef(Base)
|
|
72
|
+
as="input"
|
|
73
|
+
className="govgr-radios__input"
|
|
74
|
+
name="name"
|
|
75
|
+
type="radio"
|
|
76
|
+
value="someValue"
|
|
77
|
+
>
|
|
78
|
+
<input
|
|
79
|
+
className="govgr-radios__input"
|
|
80
|
+
name="name"
|
|
81
|
+
type="radio"
|
|
82
|
+
value="someValue"
|
|
83
|
+
/>
|
|
84
|
+
</ForwardRef(Base)>
|
|
85
|
+
</label>
|
|
86
|
+
</div>
|
|
87
|
+
</ForwardRef(RadioItem)>
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
exports[`renders the RadioItem with no props 1`] = `
|
|
91
|
+
<ForwardRef(RadioItem)>
|
|
92
|
+
<div
|
|
93
|
+
className="govgr-radios__item"
|
|
94
|
+
>
|
|
95
|
+
<label
|
|
96
|
+
className="govgr-label govgr-radios__label"
|
|
97
|
+
>
|
|
98
|
+
hello
|
|
99
|
+
<ForwardRef(Base)
|
|
100
|
+
as="input"
|
|
101
|
+
className="govgr-radios__input"
|
|
102
|
+
type="radio"
|
|
103
|
+
>
|
|
104
|
+
<input
|
|
105
|
+
className="govgr-radios__input"
|
|
106
|
+
type="radio"
|
|
107
|
+
/>
|
|
108
|
+
</ForwardRef(Base)>
|
|
109
|
+
</label>
|
|
110
|
+
</div>
|
|
111
|
+
</ForwardRef(RadioItem)>
|
|
112
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import RadioItem from '@digigov/react-core/RadioItem';
|
|
5
|
+
|
|
6
|
+
it('renders the RadioItem with no props', () => {
|
|
7
|
+
expect(mount(<RadioItem>hello</RadioItem>)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('renders the RadioItem with name props', () => {
|
|
11
|
+
expect(mount(<RadioItem name={'name'}>hello</RadioItem>)).toMatchSnapshot();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('renders the RadioItem value props', () => {
|
|
15
|
+
expect(
|
|
16
|
+
mount(<RadioItem value={'someValue'}>hello</RadioItem>)
|
|
17
|
+
).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('renders the RadioItem with name and value props', () => {
|
|
21
|
+
expect(
|
|
22
|
+
mount(
|
|
23
|
+
<RadioItem name={'name'} value={'someValue'}>
|
|
24
|
+
hello
|
|
25
|
+
</RadioItem>
|
|
26
|
+
)
|
|
27
|
+
).toMatchSnapshot();
|
|
28
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface RadioItemProps extends BaseProps<'input'> {
|
|
6
|
+
/**
|
|
7
|
+
*Name property is optional and it contains a single value which describes the name of the <input> element.
|
|
8
|
+
*/
|
|
9
|
+
name?: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Value property is optional and it specifies the value of an <input> element.
|
|
13
|
+
*/
|
|
14
|
+
value?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* RadioItem component is used for display radio buttons.
|
|
18
|
+
* RadioItem component must be included inside Radio component, as a children component.
|
|
19
|
+
*/
|
|
20
|
+
export const RadioItem = React.forwardRef<HTMLInputElement, RadioItemProps>(
|
|
21
|
+
function RadioItem({ name, value, className, children, ...props }, ref) {
|
|
22
|
+
return (
|
|
23
|
+
<div
|
|
24
|
+
className={clsx(className, {
|
|
25
|
+
'govgr-radios__item': true,
|
|
26
|
+
})}
|
|
27
|
+
>
|
|
28
|
+
<label
|
|
29
|
+
className={clsx({
|
|
30
|
+
'govgr-label govgr-radios__label': true,
|
|
31
|
+
})}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
<Base
|
|
35
|
+
as="input"
|
|
36
|
+
ref={ref}
|
|
37
|
+
type="radio"
|
|
38
|
+
name={name}
|
|
39
|
+
value={value}
|
|
40
|
+
className={clsx({
|
|
41
|
+
'govgr-radios__input': true,
|
|
42
|
+
})}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
</label>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export default RadioItem;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the SectionBreak with no props 1`] = `
|
|
4
|
+
<ForwardRef(SectionBreak)>
|
|
5
|
+
<ForwardRef(Base)
|
|
6
|
+
as="hr"
|
|
7
|
+
className="govgr-section-break"
|
|
8
|
+
>
|
|
9
|
+
<hr
|
|
10
|
+
className="govgr-section-break"
|
|
11
|
+
/>
|
|
12
|
+
</ForwardRef(Base)>
|
|
13
|
+
</ForwardRef(SectionBreak)>
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
exports[`renders the SectionBreak with size=l 1`] = `
|
|
17
|
+
<ForwardRef(SectionBreak)
|
|
18
|
+
size="l"
|
|
19
|
+
>
|
|
20
|
+
<ForwardRef(Base)
|
|
21
|
+
as="hr"
|
|
22
|
+
className="govgr-section-break--l govgr-section-break"
|
|
23
|
+
>
|
|
24
|
+
<hr
|
|
25
|
+
className="govgr-section-break--l govgr-section-break"
|
|
26
|
+
/>
|
|
27
|
+
</ForwardRef(Base)>
|
|
28
|
+
</ForwardRef(SectionBreak)>
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
exports[`renders the SectionBreak with size=m 1`] = `
|
|
32
|
+
<ForwardRef(SectionBreak)
|
|
33
|
+
size="m"
|
|
34
|
+
>
|
|
35
|
+
<ForwardRef(Base)
|
|
36
|
+
as="hr"
|
|
37
|
+
className="govgr-section-break--m govgr-section-break"
|
|
38
|
+
>
|
|
39
|
+
<hr
|
|
40
|
+
className="govgr-section-break--m govgr-section-break"
|
|
41
|
+
/>
|
|
42
|
+
</ForwardRef(Base)>
|
|
43
|
+
</ForwardRef(SectionBreak)>
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
exports[`renders the SectionBreak with size=xl 1`] = `
|
|
47
|
+
<ForwardRef(SectionBreak)
|
|
48
|
+
size="xl"
|
|
49
|
+
>
|
|
50
|
+
<ForwardRef(Base)
|
|
51
|
+
as="hr"
|
|
52
|
+
className="govgr-section-break--xl govgr-section-break"
|
|
53
|
+
>
|
|
54
|
+
<hr
|
|
55
|
+
className="govgr-section-break--xl govgr-section-break"
|
|
56
|
+
/>
|
|
57
|
+
</ForwardRef(Base)>
|
|
58
|
+
</ForwardRef(SectionBreak)>
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
exports[`renders the SectionBreak with visible=false 1`] = `
|
|
62
|
+
<ForwardRef(SectionBreak)
|
|
63
|
+
visible={false}
|
|
64
|
+
>
|
|
65
|
+
<ForwardRef(Base)
|
|
66
|
+
as="hr"
|
|
67
|
+
className="govgr-section-break"
|
|
68
|
+
>
|
|
69
|
+
<hr
|
|
70
|
+
className="govgr-section-break"
|
|
71
|
+
/>
|
|
72
|
+
</ForwardRef(Base)>
|
|
73
|
+
</ForwardRef(SectionBreak)>
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
exports[`renders the SectionBreak with visible=true 1`] = `
|
|
77
|
+
<ForwardRef(SectionBreak)
|
|
78
|
+
visible={true}
|
|
79
|
+
>
|
|
80
|
+
<ForwardRef(Base)
|
|
81
|
+
as="hr"
|
|
82
|
+
className="govgr-section-break--visible govgr-section-break"
|
|
83
|
+
>
|
|
84
|
+
<hr
|
|
85
|
+
className="govgr-section-break--visible govgr-section-break"
|
|
86
|
+
/>
|
|
87
|
+
</ForwardRef(Base)>
|
|
88
|
+
</ForwardRef(SectionBreak)>
|
|
89
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import SectionBreak from '@digigov/react-core/SectionBreak';
|
|
5
|
+
|
|
6
|
+
it('renders the SectionBreak with no props', () => {
|
|
7
|
+
expect(mount(<SectionBreak />)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('renders the SectionBreak with visible=true', () => {
|
|
11
|
+
expect(mount(<SectionBreak visible={true} />)).toMatchSnapshot();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('renders the SectionBreak with visible=false', () => {
|
|
15
|
+
expect(mount(<SectionBreak visible={false} />)).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders the SectionBreak with size=xl', () => {
|
|
19
|
+
expect(mount(<SectionBreak size={'xl'} />)).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('renders the SectionBreak with size=l', () => {
|
|
23
|
+
expect(mount(<SectionBreak size={'l'} />)).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('renders the SectionBreak with size=m', () => {
|
|
27
|
+
expect(mount(<SectionBreak size={'m'} />)).toMatchSnapshot();
|
|
28
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface SectionBreakProps extends BaseProps<'hr'> {
|
|
6
|
+
/**
|
|
7
|
+
* visible is optional.
|
|
8
|
+
* By default, SectionBreak only visible by its margin. You can add the 'visible' prop to make it visible with a separator line.
|
|
9
|
+
*/
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* size is optional and it is about the different size margins.
|
|
14
|
+
*/
|
|
15
|
+
size?: 'xl' | 'l' | 'm';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* SectionBreak is used to create a thematic break between sections of content.
|
|
19
|
+
*/
|
|
20
|
+
export const SectionBreak = React.forwardRef<HTMLHRElement, SectionBreakProps>(
|
|
21
|
+
function SectionBreak({ visible, size, className, ...props }, ref) {
|
|
22
|
+
return (
|
|
23
|
+
<Base
|
|
24
|
+
as="hr"
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={clsx(className, {
|
|
27
|
+
'govgr-section-break': true,
|
|
28
|
+
'govgr-section-break--visible': visible === true,
|
|
29
|
+
'govgr-section-break--xl': size === 'xl',
|
|
30
|
+
'govgr-section-break--l': size === 'l',
|
|
31
|
+
'govgr-section-break--m': size === 'm',
|
|
32
|
+
})}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export default SectionBreak;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the SelectContainer with name and defaultValue 1`] = `
|
|
4
|
+
<ForwardRef(SelectContainer)
|
|
5
|
+
defaultValue="some-value"
|
|
6
|
+
name="some-name"
|
|
7
|
+
>
|
|
8
|
+
<ForwardRef(Base)
|
|
9
|
+
as="select"
|
|
10
|
+
className="govgr-select"
|
|
11
|
+
defaultValue="some-value"
|
|
12
|
+
name="some-name"
|
|
13
|
+
>
|
|
14
|
+
<select
|
|
15
|
+
className="govgr-select"
|
|
16
|
+
defaultValue="some-value"
|
|
17
|
+
name="some-name"
|
|
18
|
+
>
|
|
19
|
+
hello
|
|
20
|
+
</select>
|
|
21
|
+
</ForwardRef(Base)>
|
|
22
|
+
</ForwardRef(SelectContainer)>
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
exports[`renders the SelectContainer with name props 1`] = `
|
|
26
|
+
<ForwardRef(SelectContainer)
|
|
27
|
+
name="some-name"
|
|
28
|
+
>
|
|
29
|
+
<ForwardRef(Base)
|
|
30
|
+
as="select"
|
|
31
|
+
className="govgr-select"
|
|
32
|
+
name="some-name"
|
|
33
|
+
>
|
|
34
|
+
<select
|
|
35
|
+
className="govgr-select"
|
|
36
|
+
name="some-name"
|
|
37
|
+
>
|
|
38
|
+
hello
|
|
39
|
+
</select>
|
|
40
|
+
</ForwardRef(Base)>
|
|
41
|
+
</ForwardRef(SelectContainer)>
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
exports[`renders the SelectContainer with no props 1`] = `
|
|
45
|
+
<ForwardRef(SelectContainer)>
|
|
46
|
+
<ForwardRef(Base)
|
|
47
|
+
as="select"
|
|
48
|
+
className="govgr-select"
|
|
49
|
+
>
|
|
50
|
+
<select
|
|
51
|
+
className="govgr-select"
|
|
52
|
+
>
|
|
53
|
+
hello
|
|
54
|
+
</select>
|
|
55
|
+
</ForwardRef(Base)>
|
|
56
|
+
</ForwardRef(SelectContainer)>
|
|
57
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import SelectContainer from '@digigov/react-core/SelectContainer';
|
|
5
|
+
|
|
6
|
+
it('renders the SelectContainer with no props', () => {
|
|
7
|
+
expect(mount(<SelectContainer>hello</SelectContainer>)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('renders the SelectContainer with name props', () => {
|
|
11
|
+
expect(
|
|
12
|
+
mount(<SelectContainer name={'some-name'}>hello</SelectContainer>)
|
|
13
|
+
).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('renders the SelectContainer with name and defaultValue', () => {
|
|
17
|
+
expect(
|
|
18
|
+
mount(
|
|
19
|
+
<SelectContainer name={'some-name'} defaultValue={'some-value'}>
|
|
20
|
+
hello
|
|
21
|
+
</SelectContainer>
|
|
22
|
+
)
|
|
23
|
+
).toMatchSnapshot();
|
|
24
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface SelectContainerProps extends BaseProps<'select'> {
|
|
6
|
+
/**
|
|
7
|
+
* name is optional but strongly recommended.
|
|
8
|
+
*/
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The SelectContainer component allows users to choose an option from a long list.
|
|
13
|
+
* It is used as a parent component to wrap SelectOption component.
|
|
14
|
+
*/
|
|
15
|
+
export const SelectContainer = React.forwardRef<
|
|
16
|
+
HTMLSelectElement,
|
|
17
|
+
SelectContainerProps
|
|
18
|
+
>(function SelectContainer({ name, className, children, ...props }, ref) {
|
|
19
|
+
return (
|
|
20
|
+
<Base
|
|
21
|
+
as="select"
|
|
22
|
+
name={name}
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={clsx(className, {
|
|
25
|
+
'govgr-select': true,
|
|
26
|
+
})}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</Base>
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export default SelectContainer;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the SelectOption with no props 1`] = `
|
|
4
|
+
<ForwardRef(SelectOption)>
|
|
5
|
+
<ForwardRef(Base)
|
|
6
|
+
as="option"
|
|
7
|
+
className=""
|
|
8
|
+
>
|
|
9
|
+
<option
|
|
10
|
+
className=""
|
|
11
|
+
>
|
|
12
|
+
hello
|
|
13
|
+
</option>
|
|
14
|
+
</ForwardRef(Base)>
|
|
15
|
+
</ForwardRef(SelectOption)>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
exports[`renders the SelectOption with value props 1`] = `
|
|
19
|
+
<ForwardRef(SelectOption)
|
|
20
|
+
value="some-value"
|
|
21
|
+
>
|
|
22
|
+
<ForwardRef(Base)
|
|
23
|
+
as="option"
|
|
24
|
+
className=""
|
|
25
|
+
value="some-value"
|
|
26
|
+
>
|
|
27
|
+
<option
|
|
28
|
+
className=""
|
|
29
|
+
value="some-value"
|
|
30
|
+
>
|
|
31
|
+
hello
|
|
32
|
+
</option>
|
|
33
|
+
</ForwardRef(Base)>
|
|
34
|
+
</ForwardRef(SelectOption)>
|
|
35
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import SelectOption from '@digigov/react-core/SelectOption';
|
|
5
|
+
|
|
6
|
+
it('renders the SelectOption with no props', () => {
|
|
7
|
+
expect(mount(<SelectOption>hello</SelectOption>)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('renders the SelectOption with value props', () => {
|
|
11
|
+
expect(
|
|
12
|
+
mount(<SelectOption value={'some-value'}>hello</SelectOption>)
|
|
13
|
+
).toMatchSnapshot();
|
|
14
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface SelectOptionProps extends BaseProps<'option'> {
|
|
6
|
+
/**
|
|
7
|
+
* value is optional.
|
|
8
|
+
*/
|
|
9
|
+
value?: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* selected is optional.
|
|
13
|
+
*/
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* SelectOption component is used for display options value.
|
|
18
|
+
* SelectOption component must be included inside Select component as children component
|
|
19
|
+
*/
|
|
20
|
+
export const SelectOption = React.forwardRef<
|
|
21
|
+
HTMLOptionElement,
|
|
22
|
+
SelectOptionProps
|
|
23
|
+
>(function SelectOption(
|
|
24
|
+
{ value, selected, className, children, ...props },
|
|
25
|
+
ref
|
|
26
|
+
) {
|
|
27
|
+
return (
|
|
28
|
+
<Base
|
|
29
|
+
as="option"
|
|
30
|
+
value={value}
|
|
31
|
+
ref={ref}
|
|
32
|
+
selected={selected}
|
|
33
|
+
className={clsx(className, {})}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</Base>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export default SelectOption;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the SkipLink with no props 1`] = `
|
|
4
|
+
<ForwardRef(SkipLink)>
|
|
5
|
+
<ForwardRef(Base)
|
|
6
|
+
as="a"
|
|
7
|
+
className="govgr--skip-link"
|
|
8
|
+
href="#main-content"
|
|
9
|
+
tabIndex={0}
|
|
10
|
+
>
|
|
11
|
+
<a
|
|
12
|
+
className="govgr--skip-link"
|
|
13
|
+
href="#main-content"
|
|
14
|
+
tabIndex={0}
|
|
15
|
+
>
|
|
16
|
+
hello
|
|
17
|
+
</a>
|
|
18
|
+
</ForwardRef(Base)>
|
|
19
|
+
</ForwardRef(SkipLink)>
|
|
20
|
+
`;
|