@amsterdam/design-system-react 0.14.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Accordion/Accordion.d.ts +35 -0
- package/dist/Accordion/Accordion.js +22 -0
- package/dist/Accordion/Accordion.test.d.ts +1 -0
- package/dist/Accordion/Accordion.test.js +40 -0
- package/dist/Accordion/AccordionContext.d.ts +12 -0
- package/dist/Accordion/AccordionContext.js +11 -0
- package/dist/Accordion/AccordionSection.d.ts +19 -0
- package/dist/Accordion/AccordionSection.js +22 -0
- package/dist/Accordion/AccordionSection.test.d.ts +1 -0
- package/dist/Accordion/AccordionSection.test.js +83 -0
- package/dist/Accordion/index.d.ts +3 -0
- package/dist/Accordion/index.js +1 -0
- package/dist/ActionGroup/ActionGroup.d.ts +9 -0
- package/dist/ActionGroup/ActionGroup.js +9 -0
- package/dist/ActionGroup/ActionGroup.test.d.ts +1 -0
- package/dist/ActionGroup/ActionGroup.test.js +29 -0
- package/dist/ActionGroup/index.d.ts +2 -0
- package/dist/ActionGroup/index.js +1 -0
- package/dist/Alert/Alert.d.ts +46 -0
- package/dist/Alert/Alert.js +22 -0
- package/dist/Alert/Alert.test.d.ts +1 -0
- package/dist/Alert/Alert.test.js +59 -0
- package/dist/Alert/index.d.ts +2 -0
- package/dist/Alert/index.js +1 -0
- package/dist/Avatar/Avatar.d.ts +24 -0
- package/dist/Avatar/Avatar.js +25 -0
- package/dist/Avatar/Avatar.test.d.ts +1 -0
- package/dist/Avatar/Avatar.test.js +58 -0
- package/dist/Avatar/index.d.ts +2 -0
- package/dist/Avatar/index.js +1 -0
- package/dist/Badge/Badge.d.ts +20 -0
- package/dist/Badge/Badge.js +10 -0
- package/dist/Badge/Badge.test.d.ts +1 -0
- package/dist/Badge/Badge.test.js +39 -0
- package/dist/Badge/index.d.ts +2 -0
- package/dist/Badge/index.js +1 -0
- package/dist/Blockquote/Blockquote.d.ts +15 -0
- package/dist/Blockquote/Blockquote.js +9 -0
- package/dist/Blockquote/Blockquote.test.d.ts +1 -0
- package/dist/Blockquote/Blockquote.test.js +42 -0
- package/dist/Blockquote/index.d.ts +2 -0
- package/dist/Blockquote/index.js +1 -0
- package/dist/Breadcrumb/Breadcrumb.d.ts +11 -0
- package/dist/Breadcrumb/Breadcrumb.js +11 -0
- package/dist/Breadcrumb/Breadcrumb.test.d.ts +1 -0
- package/dist/Breadcrumb/Breadcrumb.test.js +41 -0
- package/dist/Breadcrumb/BreadcrumbLink.d.ts +7 -0
- package/dist/Breadcrumb/BreadcrumbLink.js +9 -0
- package/dist/Breadcrumb/BreadcrumbLink.test.d.ts +1 -0
- package/dist/Breadcrumb/BreadcrumbLink.test.js +36 -0
- package/dist/Breadcrumb/index.d.ts +3 -0
- package/dist/Breadcrumb/index.js +1 -0
- package/dist/Breakout/Breakout.d.ts +15 -0
- package/dist/Breakout/Breakout.js +12 -0
- package/dist/Breakout/Breakout.test.d.ts +1 -0
- package/dist/Breakout/Breakout.test.js +58 -0
- package/dist/Breakout/BreakoutCell.d.ts +37 -0
- package/dist/Breakout/BreakoutCell.js +11 -0
- package/dist/Breakout/BreakoutCell.test.d.ts +1 -0
- package/dist/Breakout/BreakoutCell.test.js +124 -0
- package/dist/Breakout/breakoutCellClasses.d.ts +6 -0
- package/dist/Breakout/breakoutCellClasses.js +11 -0
- package/dist/Breakout/index.d.ts +3 -0
- package/dist/Breakout/index.js +1 -0
- package/dist/Button/Button.d.ts +31 -0
- package/dist/Button/Button.js +10 -0
- package/dist/Button/Button.test.d.ts +1 -0
- package/dist/Button/Button.test.js +110 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.js +1 -0
- package/dist/Card/Card.d.ts +28 -0
- package/dist/Card/Card.js +19 -0
- package/dist/Card/Card.test.d.ts +1 -0
- package/dist/Card/Card.test.js +29 -0
- package/dist/Card/CardHeading.d.ts +11 -0
- package/dist/Card/CardHeading.js +10 -0
- package/dist/Card/CardHeading.test.d.ts +1 -0
- package/dist/Card/CardHeading.test.js +34 -0
- package/dist/Card/CardHeadingGroup.d.ts +15 -0
- package/dist/Card/CardHeadingGroup.js +10 -0
- package/dist/Card/CardHeadingGroup.test.d.ts +1 -0
- package/dist/Card/CardHeadingGroup.test.js +34 -0
- package/dist/Card/CardImage.d.ts +7 -0
- package/dist/Card/CardImage.js +10 -0
- package/dist/Card/CardImage.test.d.ts +1 -0
- package/dist/Card/CardImage.test.js +29 -0
- package/dist/Card/CardLink.d.ts +9 -0
- package/dist/Card/CardLink.js +9 -0
- package/dist/Card/CardLink.test.d.ts +1 -0
- package/dist/Card/CardLink.test.js +29 -0
- package/dist/Card/index.d.ts +4 -0
- package/dist/Card/index.js +1 -0
- package/dist/CharacterCount/CharacterCount.d.ts +17 -0
- package/dist/CharacterCount/CharacterCount.js +9 -0
- package/dist/CharacterCount/CharacterCount.test.d.ts +1 -0
- package/dist/CharacterCount/CharacterCount.test.js +34 -0
- package/dist/CharacterCount/index.d.ts +2 -0
- package/dist/CharacterCount/index.js +1 -0
- package/dist/Checkbox/Checkbox.d.ts +19 -0
- package/dist/Checkbox/Checkbox.js +24 -0
- package/dist/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/Checkbox/Checkbox.test.js +123 -0
- package/dist/Checkbox/index.d.ts +2 -0
- package/dist/Checkbox/index.js +1 -0
- package/dist/Column/Column.d.ts +57 -0
- package/dist/Column/Column.js +11 -0
- package/dist/Column/Column.test.d.ts +1 -0
- package/dist/Column/Column.test.js +55 -0
- package/dist/Column/index.d.ts +2 -0
- package/dist/Column/index.js +1 -0
- package/dist/DateInput/DateInput.d.ts +20 -0
- package/dist/DateInput/DateInput.js +10 -0
- package/dist/DateInput/DateInput.test.d.ts +1 -0
- package/dist/DateInput/DateInput.test.js +54 -0
- package/dist/DateInput/index.d.ts +2 -0
- package/dist/DateInput/index.js +1 -0
- package/dist/DescriptionList/DescriptionList.d.ts +30 -0
- package/dist/DescriptionList/DescriptionList.js +18 -0
- package/dist/DescriptionList/DescriptionList.test.d.ts +1 -0
- package/dist/DescriptionList/DescriptionList.test.js +39 -0
- package/dist/DescriptionList/DescriptionListDescription.d.ts +9 -0
- package/dist/DescriptionList/DescriptionListDescription.js +9 -0
- package/dist/DescriptionList/DescriptionListDescription.test.d.ts +1 -0
- package/dist/DescriptionList/DescriptionListDescription.test.js +29 -0
- package/dist/DescriptionList/DescriptionListSection.d.ts +9 -0
- package/dist/DescriptionList/DescriptionListSection.js +9 -0
- package/dist/DescriptionList/DescriptionListSection.test.d.ts +1 -0
- package/dist/DescriptionList/DescriptionListSection.test.js +29 -0
- package/dist/DescriptionList/DescriptionListTerm.d.ts +9 -0
- package/dist/DescriptionList/DescriptionListTerm.js +9 -0
- package/dist/DescriptionList/DescriptionListTerm.test.d.ts +1 -0
- package/dist/DescriptionList/DescriptionListTerm.test.js +29 -0
- package/dist/DescriptionList/index.d.ts +4 -0
- package/dist/DescriptionList/index.js +1 -0
- package/dist/Dialog/Dialog.d.ts +27 -0
- package/dist/Dialog/Dialog.js +17 -0
- package/dist/Dialog/Dialog.test.d.ts +1 -0
- package/dist/Dialog/Dialog.test.js +78 -0
- package/dist/Dialog/index.d.ts +2 -0
- package/dist/Dialog/index.js +1 -0
- package/dist/ErrorMessage/ErrorMessage.d.ts +19 -0
- package/dist/ErrorMessage/ErrorMessage.js +11 -0
- package/dist/ErrorMessage/ErrorMessage.test.d.ts +1 -0
- package/dist/ErrorMessage/ErrorMessage.test.js +49 -0
- package/dist/ErrorMessage/index.d.ts +2 -0
- package/dist/ErrorMessage/index.js +1 -0
- package/dist/Field/Field.d.ts +15 -0
- package/dist/Field/Field.js +9 -0
- package/dist/Field/Field.test.d.ts +1 -0
- package/dist/Field/Field.test.js +34 -0
- package/dist/Field/index.d.ts +2 -0
- package/dist/Field/index.js +1 -0
- package/dist/FieldSet/FieldSet.d.ts +23 -0
- package/dist/FieldSet/FieldSet.js +12 -0
- package/dist/FieldSet/FieldSet.test.d.ts +1 -0
- package/dist/FieldSet/FieldSet.test.js +59 -0
- package/dist/FieldSet/index.d.ts +2 -0
- package/dist/FieldSet/index.js +1 -0
- package/dist/Figure/Figure.d.ts +15 -0
- package/dist/Figure/Figure.js +11 -0
- package/dist/Figure/Figure.test.d.ts +1 -0
- package/dist/Figure/Figure.test.js +29 -0
- package/dist/Figure/FigureCaption.d.ts +15 -0
- package/dist/Figure/FigureCaption.js +9 -0
- package/dist/Figure/FigureCaption.test.d.ts +1 -0
- package/dist/Figure/FigureCaption.test.js +34 -0
- package/dist/Figure/index.d.ts +2 -0
- package/dist/Figure/index.js +1 -0
- package/dist/FileInput/FileInput.d.ts +7 -0
- package/dist/FileInput/FileInput.js +9 -0
- package/dist/FileInput/FileInput.test.d.ts +1 -0
- package/dist/FileInput/FileInput.test.js +29 -0
- package/dist/FileInput/index.d.ts +2 -0
- package/dist/FileInput/index.js +1 -0
- package/dist/FileList/FileList.d.ts +17 -0
- package/dist/FileList/FileList.js +13 -0
- package/dist/FileList/FileList.test.d.ts +1 -0
- package/dist/FileList/FileList.test.js +29 -0
- package/dist/FileList/FileListItem.d.ts +13 -0
- package/dist/FileList/FileListItem.js +14 -0
- package/dist/FileList/FileListItem.test.d.ts +1 -0
- package/dist/FileList/FileListItem.test.js +40 -0
- package/dist/FileList/index.d.ts +2 -0
- package/dist/FileList/index.js +1 -0
- package/dist/Grid/Grid.d.ts +40 -0
- package/dist/Grid/Grid.js +15 -0
- package/dist/Grid/Grid.test.d.ts +1 -0
- package/dist/Grid/Grid.test.js +65 -0
- package/dist/Grid/GridCell.d.ts +25 -0
- package/dist/Grid/GridCell.js +11 -0
- package/dist/Grid/GridCell.test.d.ts +1 -0
- package/dist/Grid/GridCell.test.js +80 -0
- package/dist/Grid/gridCellClasses.d.ts +8 -0
- package/dist/Grid/gridCellClasses.js +18 -0
- package/dist/Grid/index.d.ts +3 -0
- package/dist/Grid/index.js +1 -0
- package/dist/Grid/paddingClasses.d.ts +2 -0
- package/dist/Grid/paddingClasses.js +13 -0
- package/dist/Heading/Heading.d.ts +24 -0
- package/dist/Heading/Heading.js +15 -0
- package/dist/Heading/Heading.test.d.ts +1 -0
- package/dist/Heading/Heading.test.js +68 -0
- package/dist/Heading/getHeadingTag.d.ts +2 -0
- package/dist/Heading/getHeadingTag.js +13 -0
- package/dist/Heading/index.d.ts +2 -0
- package/dist/Heading/index.js +1 -0
- package/dist/Hint/Hint.d.ts +16 -0
- package/dist/Hint/Hint.js +21 -0
- package/dist/Hint/Hint.test.d.ts +1 -0
- package/dist/Hint/Hint.test.js +49 -0
- package/dist/Hint/index.d.ts +2 -0
- package/dist/Hint/index.js +1 -0
- package/dist/Icon/Icon.d.ts +30 -0
- package/dist/Icon/Icon.js +12 -0
- package/dist/Icon/Icon.test.d.ts +1 -0
- package/dist/Icon/Icon.test.js +51 -0
- package/dist/Icon/index.d.ts +2 -0
- package/dist/Icon/index.js +1 -0
- package/dist/IconButton/IconButton.d.ts +26 -0
- package/dist/IconButton/IconButton.js +11 -0
- package/dist/IconButton/IconButton.test.d.ts +1 -0
- package/dist/IconButton/IconButton.test.js +44 -0
- package/dist/IconButton/index.d.ts +2 -0
- package/dist/IconButton/index.js +1 -0
- package/dist/Image/Image.d.ts +14 -0
- package/dist/Image/Image.js +10 -0
- package/dist/Image/Image.test.d.ts +1 -0
- package/dist/Image/Image.test.js +39 -0
- package/dist/Image/generateAspectRatioClass.d.ts +1 -0
- package/dist/Image/generateAspectRatioClass.js +1 -0
- package/dist/Image/index.d.ts +3 -0
- package/dist/Image/index.js +2 -0
- package/dist/ImageSlider/ImageSlider.d.ts +49 -0
- package/dist/ImageSlider/ImageSlider.js +98 -0
- package/dist/ImageSlider/ImageSlider.test.d.ts +1 -0
- package/dist/ImageSlider/ImageSlider.test.js +66 -0
- package/dist/ImageSlider/ImageSliderContext.d.ts +13 -0
- package/dist/ImageSlider/ImageSliderContext.js +14 -0
- package/dist/ImageSlider/ImageSliderControls.d.ts +17 -0
- package/dist/ImageSlider/ImageSliderControls.js +17 -0
- package/dist/ImageSlider/ImageSliderControls.test.d.ts +1 -0
- package/dist/ImageSlider/ImageSliderControls.test.js +21 -0
- package/dist/ImageSlider/ImageSliderItem.d.ts +15 -0
- package/dist/ImageSlider/ImageSliderItem.js +15 -0
- package/dist/ImageSlider/ImageSliderItem.test.d.ts +1 -0
- package/dist/ImageSlider/ImageSliderItem.test.js +33 -0
- package/dist/ImageSlider/ImageSliderScroller.d.ts +9 -0
- package/dist/ImageSlider/ImageSliderScroller.js +9 -0
- package/dist/ImageSlider/ImageSliderScroller.test.d.ts +1 -0
- package/dist/ImageSlider/ImageSliderScroller.test.js +33 -0
- package/dist/ImageSlider/ImageSliderThumbnails.d.ts +14 -0
- package/dist/ImageSlider/ImageSliderThumbnails.js +32 -0
- package/dist/ImageSlider/ImageSliderThumbnails.test.d.ts +1 -0
- package/dist/ImageSlider/ImageSliderThumbnails.test.js +48 -0
- package/dist/ImageSlider/index.d.ts +3 -0
- package/dist/ImageSlider/index.js +1 -0
- package/dist/InvalidFormAlert/InvalidFormAlert.d.ts +68 -0
- package/dist/InvalidFormAlert/InvalidFormAlert.js +20 -0
- package/dist/InvalidFormAlert/InvalidFormAlert.test.d.ts +1 -0
- package/dist/InvalidFormAlert/InvalidFormAlert.test.js +104 -0
- package/dist/InvalidFormAlert/InvalidFormAlertWithErrors.d.ts +12 -0
- package/dist/InvalidFormAlert/InvalidFormAlertWithErrors.js +22 -0
- package/dist/InvalidFormAlert/index.d.ts +2 -0
- package/dist/InvalidFormAlert/index.js +1 -0
- package/dist/InvalidFormAlert/useAddErrorCountToDocumentTitle.d.ts +11 -0
- package/dist/InvalidFormAlert/useAddErrorCountToDocumentTitle.js +26 -0
- package/dist/Label/Label.d.ts +14 -0
- package/dist/Label/Label.js +13 -0
- package/dist/Label/Label.test.d.ts +1 -0
- package/dist/Label/Label.test.js +73 -0
- package/dist/Label/index.d.ts +1 -0
- package/dist/Label/index.js +1 -0
- package/dist/Link/Link.d.ts +13 -0
- package/dist/Link/Link.js +9 -0
- package/dist/Link/Link.test.d.ts +1 -0
- package/dist/Link/Link.test.js +39 -0
- package/dist/Link/index.d.ts +2 -0
- package/dist/Link/index.js +1 -0
- package/dist/LinkList/LinkList.d.ts +17 -0
- package/dist/LinkList/LinkList.js +14 -0
- package/dist/LinkList/LinkList.test.d.ts +1 -0
- package/dist/LinkList/LinkList.test.js +29 -0
- package/dist/LinkList/LinkListLink.d.ts +24 -0
- package/dist/LinkList/LinkListLink.js +14 -0
- package/dist/LinkList/LinkListLink.test.d.ts +1 -0
- package/dist/LinkList/LinkListLink.test.js +50 -0
- package/dist/LinkList/index.d.ts +3 -0
- package/dist/LinkList/index.js +1 -0
- package/dist/Logo/Logo.d.ts +11 -0
- package/dist/Logo/Logo.js +21 -0
- package/dist/Logo/Logo.test.d.ts +1 -0
- package/dist/Logo/Logo.test.js +29 -0
- package/dist/Logo/brand/LogoAmsterdam.d.ts +3 -0
- package/dist/Logo/brand/LogoAmsterdam.js +5 -0
- package/dist/Logo/brand/LogoGgdAmsterdam.d.ts +3 -0
- package/dist/Logo/brand/LogoGgdAmsterdam.js +5 -0
- package/dist/Logo/brand/LogoMuseumWeesp.d.ts +3 -0
- package/dist/Logo/brand/LogoMuseumWeesp.js +5 -0
- package/dist/Logo/brand/LogoStadsarchief.d.ts +3 -0
- package/dist/Logo/brand/LogoStadsarchief.js +5 -0
- package/dist/Logo/brand/LogoStadsbankVanLening.d.ts +3 -0
- package/dist/Logo/brand/LogoStadsbankVanLening.js +5 -0
- package/dist/Logo/brand/LogoVgaVerzekeringen.d.ts +3 -0
- package/dist/Logo/brand/LogoVgaVerzekeringen.js +5 -0
- package/dist/Logo/brand/index.d.ts +6 -0
- package/dist/Logo/brand/index.js +6 -0
- package/dist/Logo/index.d.ts +2 -0
- package/dist/Logo/index.js +1 -0
- package/dist/Mark/Mark.d.ts +9 -0
- package/dist/Mark/Mark.js +9 -0
- package/dist/Mark/Mark.test.d.ts +1 -0
- package/dist/Mark/Mark.test.js +29 -0
- package/dist/Mark/index.d.ts +2 -0
- package/dist/Mark/index.js +1 -0
- package/dist/OrderedList/OrderedList.d.ts +27 -0
- package/dist/OrderedList/OrderedList.js +11 -0
- package/dist/OrderedList/OrderedList.test.d.ts +1 -0
- package/dist/OrderedList/OrderedList.test.js +51 -0
- package/dist/OrderedList/OrderedListItem.d.ts +9 -0
- package/dist/OrderedList/OrderedListItem.js +9 -0
- package/dist/OrderedList/OrderedListItem.test.d.ts +1 -0
- package/dist/OrderedList/OrderedListItem.test.js +28 -0
- package/dist/OrderedList/index.d.ts +3 -0
- package/dist/OrderedList/index.js +1 -0
- package/dist/Overlap/Overlap.d.ts +9 -0
- package/dist/Overlap/Overlap.js +9 -0
- package/dist/Overlap/Overlap.test.d.ts +1 -0
- package/dist/Overlap/Overlap.test.js +34 -0
- package/dist/Overlap/index.d.ts +2 -0
- package/dist/Overlap/index.js +1 -0
- package/dist/Page/Page.d.ts +9 -0
- package/dist/Page/Page.js +9 -0
- package/dist/Page/Page.test.d.ts +1 -0
- package/dist/Page/Page.test.js +29 -0
- package/dist/Page/index.d.ts +2 -0
- package/dist/Page/index.js +1 -0
- package/dist/PageFooter/PageFooter.d.ts +19 -0
- package/dist/PageFooter/PageFooter.js +17 -0
- package/dist/PageFooter/PageFooter.test.d.ts +1 -0
- package/dist/PageFooter/PageFooter.test.js +29 -0
- package/dist/PageFooter/PageFooterMenu.d.ts +9 -0
- package/dist/PageFooter/PageFooterMenu.js +9 -0
- package/dist/PageFooter/PageFooterMenu.test.d.ts +1 -0
- package/dist/PageFooter/PageFooterMenu.test.js +31 -0
- package/dist/PageFooter/PageFooterMenuLink.d.ts +9 -0
- package/dist/PageFooter/PageFooterMenuLink.js +9 -0
- package/dist/PageFooter/PageFooterMenuLink.test.d.ts +1 -0
- package/dist/PageFooter/PageFooterMenuLink.test.js +29 -0
- package/dist/PageFooter/PageFooterSpotlight.d.ts +9 -0
- package/dist/PageFooter/PageFooterSpotlight.js +9 -0
- package/dist/PageFooter/PageFooterSpotlight.test.d.ts +1 -0
- package/dist/PageFooter/PageFooterSpotlight.test.js +29 -0
- package/dist/PageFooter/index.d.ts +5 -0
- package/dist/PageFooter/index.js +1 -0
- package/dist/PageHeader/PageHeader.d.ts +49 -0
- package/dist/PageHeader/PageHeader.js +31 -0
- package/dist/PageHeader/PageHeader.test.d.ts +2 -0
- package/dist/PageHeader/PageHeader.test.js +120 -0
- package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.d.ts +2 -0
- package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.js +6 -0
- package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.d.ts +1 -0
- package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.js +34 -0
- package/dist/PageHeader/PageHeaderMenuIcon.d.ts +2 -0
- package/dist/PageHeader/PageHeaderMenuIcon.js +2 -0
- package/dist/PageHeader/PageHeaderMenuLink.d.ts +9 -0
- package/dist/PageHeader/PageHeaderMenuLink.js +5 -0
- package/dist/PageHeader/PageHeaderMenuLink.test.d.ts +1 -0
- package/dist/PageHeader/PageHeaderMenuLink.test.js +41 -0
- package/dist/PageHeader/index.d.ts +3 -0
- package/dist/PageHeader/index.js +1 -0
- package/dist/PageHeader/matchMedia.mock.d.ts +0 -0
- package/dist/PageHeader/matchMedia.mock.js +15 -0
- package/dist/PageHeading/PageHeading.d.ts +15 -0
- package/dist/PageHeading/PageHeading.js +9 -0
- package/dist/PageHeading/PageHeading.test.d.ts +1 -0
- package/dist/PageHeading/PageHeading.test.js +36 -0
- package/dist/PageHeading/index.d.ts +2 -0
- package/dist/PageHeading/index.js +1 -0
- package/dist/Pagination/LinkItem.d.ts +7 -0
- package/dist/Pagination/LinkItem.js +7 -0
- package/dist/Pagination/Pagination.d.ts +59 -0
- package/dist/Pagination/Pagination.js +23 -0
- package/dist/Pagination/Pagination.test.d.ts +1 -0
- package/dist/Pagination/Pagination.test.js +120 -0
- package/dist/Pagination/Spacer.d.ts +1 -0
- package/dist/Pagination/Spacer.js +2 -0
- package/dist/Pagination/getRange.d.ts +16 -0
- package/dist/Pagination/getRange.js +41 -0
- package/dist/Pagination/index.d.ts +2 -0
- package/dist/Pagination/index.js +1 -0
- package/dist/Paragraph/Paragraph.d.ts +20 -0
- package/dist/Paragraph/Paragraph.js +10 -0
- package/dist/Paragraph/Paragraph.test.d.ts +1 -0
- package/dist/Paragraph/Paragraph.test.js +58 -0
- package/dist/Paragraph/index.d.ts +2 -0
- package/dist/Paragraph/index.js +1 -0
- package/dist/PasswordInput/PasswordInput.d.ts +13 -0
- package/dist/PasswordInput/PasswordInput.js +9 -0
- package/dist/PasswordInput/PasswordInput.test.d.ts +1 -0
- package/dist/PasswordInput/PasswordInput.test.js +85 -0
- package/dist/PasswordInput/index.d.ts +2 -0
- package/dist/PasswordInput/index.js +1 -0
- package/dist/Radio/Radio.d.ts +19 -0
- package/dist/Radio/Radio.js +16 -0
- package/dist/Radio/Radio.test.d.ts +1 -0
- package/dist/Radio/Radio.test.js +121 -0
- package/dist/Radio/RadioIcon.d.ts +3 -0
- package/dist/Radio/RadioIcon.js +3 -0
- package/dist/Radio/index.d.ts +2 -0
- package/dist/Radio/index.js +1 -0
- package/dist/Row/Row.d.ts +67 -0
- package/dist/Row/Row.js +11 -0
- package/dist/Row/Row.test.d.ts +1 -0
- package/dist/Row/Row.test.js +60 -0
- package/dist/Row/index.d.ts +2 -0
- package/dist/Row/index.js +1 -0
- package/dist/SearchField/SearchField.d.ts +294 -0
- package/dist/SearchField/SearchField.js +14 -0
- package/dist/SearchField/SearchField.test.d.ts +1 -0
- package/dist/SearchField/SearchField.test.js +46 -0
- package/dist/SearchField/SearchFieldButton.d.ts +8 -0
- package/dist/SearchField/SearchFieldButton.js +10 -0
- package/dist/SearchField/SearchFieldInput.d.ts +11 -0
- package/dist/SearchField/SearchFieldInput.js +12 -0
- package/dist/SearchField/SearchFieldInput.test.d.ts +1 -0
- package/dist/SearchField/SearchFieldInput.test.js +61 -0
- package/dist/SearchField/index.d.ts +2 -0
- package/dist/SearchField/index.js +1 -0
- package/dist/Select/Select.d.ts +22 -0
- package/dist/Select/Select.js +12 -0
- package/dist/Select/Select.test.d.ts +1 -0
- package/dist/Select/Select.test.js +70 -0
- package/dist/Select/SelectOption.d.ts +9 -0
- package/dist/Select/SelectOption.js +9 -0
- package/dist/Select/SelectOption.test.d.ts +1 -0
- package/dist/Select/SelectOption.test.js +41 -0
- package/dist/Select/SelectOptionGroup.d.ts +9 -0
- package/dist/Select/SelectOptionGroup.js +9 -0
- package/dist/Select/SelectOptionGroup.test.d.ts +1 -0
- package/dist/Select/SelectOptionGroup.test.js +41 -0
- package/dist/Select/index.d.ts +3 -0
- package/dist/Select/index.js +1 -0
- package/dist/SkipLink/SkipLink.d.ts +9 -0
- package/dist/SkipLink/SkipLink.js +9 -0
- package/dist/SkipLink/SkipLink.test.d.ts +1 -0
- package/dist/SkipLink/SkipLink.test.js +29 -0
- package/dist/SkipLink/index.d.ts +2 -0
- package/dist/SkipLink/index.js +1 -0
- package/dist/Spotlight/Spotlight.d.ts +24 -0
- package/dist/Spotlight/Spotlight.js +11 -0
- package/dist/Spotlight/Spotlight.test.d.ts +1 -0
- package/dist/Spotlight/Spotlight.test.js +42 -0
- package/dist/Spotlight/index.d.ts +2 -0
- package/dist/Spotlight/index.js +1 -0
- package/dist/StandaloneLink/StandaloneLink.d.ts +17 -0
- package/dist/StandaloneLink/StandaloneLink.js +10 -0
- package/dist/StandaloneLink/StandaloneLink.test.d.ts +1 -0
- package/dist/StandaloneLink/StandaloneLink.test.js +40 -0
- package/dist/StandaloneLink/index.d.ts +2 -0
- package/dist/StandaloneLink/index.js +1 -0
- package/dist/Switch/Switch.d.ts +9 -0
- package/dist/Switch/Switch.js +12 -0
- package/dist/Switch/Switch.test.d.ts +1 -0
- package/dist/Switch/Switch.test.js +65 -0
- package/dist/Switch/index.d.ts +2 -0
- package/dist/Switch/index.js +1 -0
- package/dist/Table/Table.d.ts +31 -0
- package/dist/Table/Table.js +25 -0
- package/dist/Table/Table.test.d.ts +1 -0
- package/dist/Table/Table.test.js +29 -0
- package/dist/Table/TableBody.d.ts +9 -0
- package/dist/Table/TableBody.js +9 -0
- package/dist/Table/TableBody.test.d.ts +1 -0
- package/dist/Table/TableBody.test.js +30 -0
- package/dist/Table/TableCaption.d.ts +10 -0
- package/dist/Table/TableCaption.js +10 -0
- package/dist/Table/TableCaption.test.d.ts +1 -0
- package/dist/Table/TableCaption.test.js +41 -0
- package/dist/Table/TableCell.d.ts +9 -0
- package/dist/Table/TableCell.js +9 -0
- package/dist/Table/TableCell.test.d.ts +1 -0
- package/dist/Table/TableCell.test.js +32 -0
- package/dist/Table/TableFooter.d.ts +9 -0
- package/dist/Table/TableFooter.js +9 -0
- package/dist/Table/TableFooter.test.d.ts +1 -0
- package/dist/Table/TableFooter.test.js +30 -0
- package/dist/Table/TableHeader.d.ts +9 -0
- package/dist/Table/TableHeader.js +9 -0
- package/dist/Table/TableHeader.test.d.ts +1 -0
- package/dist/Table/TableHeader.test.js +30 -0
- package/dist/Table/TableHeaderCell.d.ts +9 -0
- package/dist/Table/TableHeaderCell.js +9 -0
- package/dist/Table/TableHeaderCell.test.d.ts +1 -0
- package/dist/Table/TableHeaderCell.test.js +38 -0
- package/dist/Table/TableRow.d.ts +9 -0
- package/dist/Table/TableRow.js +9 -0
- package/dist/Table/TableRow.test.d.ts +1 -0
- package/dist/Table/TableRow.test.js +31 -0
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.js +1 -0
- package/dist/TableOfContents/TableOfContents.d.ts +33 -0
- package/dist/TableOfContents/TableOfContents.js +18 -0
- package/dist/TableOfContents/TableOfContents.test.d.ts +1 -0
- package/dist/TableOfContents/TableOfContents.test.js +40 -0
- package/dist/TableOfContents/TableOfContentsLink.d.ts +13 -0
- package/dist/TableOfContents/TableOfContentsLink.js +9 -0
- package/dist/TableOfContents/TableOfContentsLink.test.d.ts +1 -0
- package/dist/TableOfContents/TableOfContentsLink.test.js +30 -0
- package/dist/TableOfContents/TableOfContentsList.d.ts +9 -0
- package/dist/TableOfContents/TableOfContentsList.js +11 -0
- package/dist/TableOfContents/TableOfContentsList.test.d.ts +1 -0
- package/dist/TableOfContents/TableOfContentsList.test.js +36 -0
- package/dist/TableOfContents/index.d.ts +4 -0
- package/dist/TableOfContents/index.js +1 -0
- package/dist/Tabs/Tabs.d.ts +31 -0
- package/dist/Tabs/Tabs.js +56 -0
- package/dist/Tabs/Tabs.test.d.ts +1 -0
- package/dist/Tabs/Tabs.test.js +100 -0
- package/dist/Tabs/TabsButton.d.ts +15 -0
- package/dist/Tabs/TabsButton.js +19 -0
- package/dist/Tabs/TabsButton.test.d.ts +1 -0
- package/dist/Tabs/TabsButton.test.js +43 -0
- package/dist/Tabs/TabsContext.d.ts +11 -0
- package/dist/Tabs/TabsContext.js +10 -0
- package/dist/Tabs/TabsList.d.ts +9 -0
- package/dist/Tabs/TabsList.js +20 -0
- package/dist/Tabs/TabsList.test.d.ts +1 -0
- package/dist/Tabs/TabsList.test.js +28 -0
- package/dist/Tabs/TabsPanel.d.ts +15 -0
- package/dist/Tabs/TabsPanel.js +16 -0
- package/dist/Tabs/TabsPanel.test.d.ts +1 -0
- package/dist/Tabs/TabsPanel.test.js +38 -0
- package/dist/Tabs/index.d.ts +5 -0
- package/dist/Tabs/index.js +1 -0
- package/dist/TextArea/TextArea.d.ts +17 -0
- package/dist/TextArea/TextArea.js +9 -0
- package/dist/TextArea/TextArea.test.d.ts +1 -0
- package/dist/TextArea/TextArea.test.js +101 -0
- package/dist/TextArea/index.d.ts +2 -0
- package/dist/TextArea/index.js +1 -0
- package/dist/TextInput/TextInput.d.ts +20 -0
- package/dist/TextInput/TextInput.js +10 -0
- package/dist/TextInput/TextInput.test.d.ts +1 -0
- package/dist/TextInput/TextInput.test.js +88 -0
- package/dist/TextInput/index.d.ts +2 -0
- package/dist/TextInput/index.js +1 -0
- package/dist/TimeInput/TimeInput.d.ts +13 -0
- package/dist/TimeInput/TimeInput.js +9 -0
- package/dist/TimeInput/TimeInput.test.d.ts +1 -0
- package/dist/TimeInput/TimeInput.test.js +47 -0
- package/dist/TimeInput/index.d.ts +2 -0
- package/dist/TimeInput/index.js +1 -0
- package/dist/UnorderedList/UnorderedList.d.ts +27 -0
- package/dist/UnorderedList/UnorderedList.js +13 -0
- package/dist/UnorderedList/UnorderedList.test.d.ts +1 -0
- package/dist/UnorderedList/UnorderedList.test.js +51 -0
- package/dist/UnorderedList/UnorderedListItem.d.ts +9 -0
- package/dist/UnorderedList/UnorderedListItem.js +9 -0
- package/dist/UnorderedList/UnorderedListItem.test.d.ts +1 -0
- package/dist/UnorderedList/UnorderedListItem.test.js +28 -0
- package/dist/UnorderedList/index.d.ts +3 -0
- package/dist/UnorderedList/index.js +1 -0
- package/dist/common/accessibility.d.ts +13 -0
- package/dist/common/accessibility.js +13 -0
- package/dist/common/formatFileSize.d.ts +10 -0
- package/dist/common/formatFileSize.js +17 -0
- package/dist/common/formatFileSize.test.d.ts +1 -0
- package/dist/common/formatFileSize.test.js +18 -0
- package/dist/common/formatFileType.d.ts +10 -0
- package/dist/common/formatFileType.js +34 -0
- package/dist/common/formatFileType.test.d.ts +1 -0
- package/dist/common/formatFileType.test.js +23 -0
- package/dist/common/shortSize.d.ts +12 -0
- package/dist/common/shortSize.js +15 -0
- package/dist/common/types.d.ts +11 -0
- package/dist/common/types.js +9 -0
- package/dist/common/useIsAfterBreakpoint.d.ts +3 -0
- package/dist/common/useIsAfterBreakpoint.js +24 -0
- package/dist/common/useKeyboardFocus.d.ts +23 -0
- package/dist/common/useKeyboardFocus.js +56 -0
- package/dist/common/useKeyboardFocus.test.d.ts +1 -0
- package/dist/common/useKeyboardFocus.test.js +79 -0
- package/dist/index.cjs.js +1512 -1564
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +339 -345
- package/dist/index.esm.js +1509 -1560
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +64 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +23 -24
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { Checkbox } from './Checkbox';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Checkbox', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
const { container } = render(_jsx(Checkbox, {}));
|
|
9
|
+
const wrapper = container.querySelector(':only-child');
|
|
10
|
+
const input = screen.getByRole('checkbox');
|
|
11
|
+
const label = container.querySelector('label');
|
|
12
|
+
expect(wrapper).toBeInTheDocument();
|
|
13
|
+
expect(wrapper).toBeVisible();
|
|
14
|
+
expect(input).toBeInTheDocument();
|
|
15
|
+
expect(input).toBeVisible();
|
|
16
|
+
expect(label).toBeInTheDocument();
|
|
17
|
+
expect(label).toBeVisible();
|
|
18
|
+
});
|
|
19
|
+
it('renders a design system BEM class name', () => {
|
|
20
|
+
const { container } = render(_jsx(Checkbox, {}));
|
|
21
|
+
const wrapper = container.querySelector(':only-child');
|
|
22
|
+
const input = screen.getByRole('checkbox');
|
|
23
|
+
const label = container.querySelector('label');
|
|
24
|
+
expect(wrapper).toHaveClass('ams-checkbox');
|
|
25
|
+
expect(input).toHaveClass('ams-checkbox__input');
|
|
26
|
+
expect(label).toHaveClass('ams-checkbox__label');
|
|
27
|
+
});
|
|
28
|
+
it('renders an extra class name', () => {
|
|
29
|
+
const { container } = render(_jsx(Checkbox, { className: "extra" }));
|
|
30
|
+
const wrapper = container.querySelector(':only-child');
|
|
31
|
+
expect(wrapper).toHaveClass('ams-checkbox extra');
|
|
32
|
+
});
|
|
33
|
+
describe('Checked state', () => {
|
|
34
|
+
it('is not checked by default', () => {
|
|
35
|
+
render(_jsx(Checkbox, {}));
|
|
36
|
+
const input = screen.getByRole('checkbox');
|
|
37
|
+
expect(input).not.toBeChecked();
|
|
38
|
+
});
|
|
39
|
+
it('can have a checked state', () => {
|
|
40
|
+
const handleChange = () => { };
|
|
41
|
+
render(_jsx(Checkbox, { checked: true, onChange: handleChange }));
|
|
42
|
+
const input = screen.getByRole('checkbox');
|
|
43
|
+
expect(input).toBeChecked();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe('Indeterminate state', () => {
|
|
47
|
+
it('is not indeterminate by default', () => {
|
|
48
|
+
render(_jsx(Checkbox, {}));
|
|
49
|
+
const input = screen.getByRole('checkbox');
|
|
50
|
+
expect(input).not.toBePartiallyChecked();
|
|
51
|
+
});
|
|
52
|
+
it('can have an indeterminate state', () => {
|
|
53
|
+
render(_jsx(Checkbox, { indeterminate: true }));
|
|
54
|
+
const input = screen.getByRole('checkbox');
|
|
55
|
+
expect(input).toBePartiallyChecked();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('Invalid state', () => {
|
|
59
|
+
it('is not invalid by default', () => {
|
|
60
|
+
render(_jsx(Checkbox, {}));
|
|
61
|
+
const input = screen.getByRole('checkbox');
|
|
62
|
+
expect(input).not.toBeInvalid();
|
|
63
|
+
});
|
|
64
|
+
it('can have an invalid state', () => {
|
|
65
|
+
render(_jsx(Checkbox, { invalid: true }));
|
|
66
|
+
const input = screen.getByRole('checkbox');
|
|
67
|
+
expect(input).toHaveAttribute('aria-invalid');
|
|
68
|
+
expect(input).toBeInvalid();
|
|
69
|
+
});
|
|
70
|
+
it('omits non-essential invalid attributes when not invalid', () => {
|
|
71
|
+
render(_jsx(Checkbox, { invalid: false }));
|
|
72
|
+
const input = screen.getByRole('checkbox');
|
|
73
|
+
expect(input).not.toHaveAttribute('aria-invalid');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('Disabled state', () => {
|
|
77
|
+
it('is not disabled by default', () => {
|
|
78
|
+
render(_jsx(Checkbox, {}));
|
|
79
|
+
const input = screen.getByRole('checkbox');
|
|
80
|
+
expect(input).not.toBeDisabled();
|
|
81
|
+
});
|
|
82
|
+
it('can have a disabled state', () => {
|
|
83
|
+
render(_jsx(Checkbox, { disabled: true }));
|
|
84
|
+
const input = screen.getByRole('checkbox');
|
|
85
|
+
expect(input).toBeDisabled();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
describe('Disabled invalid state', () => {
|
|
89
|
+
it('can have a disabled invalid state', () => {
|
|
90
|
+
render(_jsx(Checkbox, { disabled: true, invalid: true }));
|
|
91
|
+
const input = screen.getByRole('checkbox');
|
|
92
|
+
expect(input).toBeDisabled();
|
|
93
|
+
expect(input).toBeInvalid();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
it('can trigger a change event', () => {
|
|
97
|
+
const handleChange = jest.fn();
|
|
98
|
+
render(_jsx(Checkbox, { onChange: handleChange }));
|
|
99
|
+
const input = screen.getByRole('checkbox');
|
|
100
|
+
input?.click();
|
|
101
|
+
expect(handleChange).toHaveBeenCalled();
|
|
102
|
+
});
|
|
103
|
+
it('does not trigger a change event when disabled', () => {
|
|
104
|
+
const handleChange = jest.fn();
|
|
105
|
+
render(_jsx(Checkbox, { disabled: true, onChange: handleChange }));
|
|
106
|
+
const input = screen.getByRole('checkbox');
|
|
107
|
+
input?.click();
|
|
108
|
+
expect(handleChange).not.toHaveBeenCalled();
|
|
109
|
+
});
|
|
110
|
+
it('can trigger a change event by clicking on label', () => {
|
|
111
|
+
const handleChange = jest.fn();
|
|
112
|
+
const { container } = render(_jsx(Checkbox, { onChange: handleChange }));
|
|
113
|
+
const label = container.querySelector('label');
|
|
114
|
+
label?.click();
|
|
115
|
+
expect(handleChange).toHaveBeenCalled();
|
|
116
|
+
});
|
|
117
|
+
it('supports ForwardRef in React', () => {
|
|
118
|
+
const ref = createRef();
|
|
119
|
+
render(_jsx(Checkbox, { ref: ref }));
|
|
120
|
+
const input = screen.getByRole('checkbox');
|
|
121
|
+
expect(ref.current).toBe(input);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Checkbox } from './Checkbox';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
import type { CrossAlignForColumn, MainAlign } from '../common/types';
|
|
7
|
+
export declare const columnTags: readonly ["article", "div", "section"];
|
|
8
|
+
type ColumnTag = (typeof columnTags)[number];
|
|
9
|
+
export declare const columnGapSizes: readonly ["none", "x-small", "small", "large", "x-large"];
|
|
10
|
+
type ColumnGap = (typeof columnGapSizes)[number];
|
|
11
|
+
export type ColumnProps = {
|
|
12
|
+
/**
|
|
13
|
+
* The vertical alignment of the items in the column.
|
|
14
|
+
* @default start
|
|
15
|
+
*/
|
|
16
|
+
align?: MainAlign;
|
|
17
|
+
/**
|
|
18
|
+
* The horizontal alignment of the items in the column.
|
|
19
|
+
* @default stretch
|
|
20
|
+
*/
|
|
21
|
+
alignHorizontal?: CrossAlignForColumn;
|
|
22
|
+
/**
|
|
23
|
+
* The HTML element to use.
|
|
24
|
+
* @default div
|
|
25
|
+
*/
|
|
26
|
+
as?: ColumnTag;
|
|
27
|
+
/**
|
|
28
|
+
* The amount of space between items.
|
|
29
|
+
* @default medium
|
|
30
|
+
*/
|
|
31
|
+
gap?: ColumnGap;
|
|
32
|
+
} & PropsWithChildren<HTMLAttributes<HTMLElement>>;
|
|
33
|
+
export declare const Column: import("react").ForwardRefExoticComponent<{
|
|
34
|
+
/**
|
|
35
|
+
* The vertical alignment of the items in the column.
|
|
36
|
+
* @default start
|
|
37
|
+
*/
|
|
38
|
+
align?: MainAlign;
|
|
39
|
+
/**
|
|
40
|
+
* The horizontal alignment of the items in the column.
|
|
41
|
+
* @default stretch
|
|
42
|
+
*/
|
|
43
|
+
alignHorizontal?: CrossAlignForColumn;
|
|
44
|
+
/**
|
|
45
|
+
* The HTML element to use.
|
|
46
|
+
* @default div
|
|
47
|
+
*/
|
|
48
|
+
as?: ColumnTag;
|
|
49
|
+
/**
|
|
50
|
+
* The amount of space between items.
|
|
51
|
+
* @default medium
|
|
52
|
+
*/
|
|
53
|
+
gap?: ColumnGap;
|
|
54
|
+
} & HTMLAttributes<HTMLElement> & {
|
|
55
|
+
children?: import("react").ReactNode | undefined;
|
|
56
|
+
} & import("react").RefAttributes<unknown>>;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2+
|
|
4
|
+
* Copyright Gemeente Amsterdam
|
|
5
|
+
*/
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
export const columnTags = ['article', 'div', 'section'];
|
|
9
|
+
export const columnGapSizes = ['none', 'x-small', 'small', 'large', 'x-large'];
|
|
10
|
+
export const Column = forwardRef(({ align, alignHorizontal, as: Tag = 'div', children, className, gap, ...restProps }, ref) => (_jsx(Tag, { ...restProps, className: clsx('ams-column', align && `ams-column--align-${align}`, alignHorizontal && `ams-column--align-horizontal-${alignHorizontal}`, gap && `ams-column--gap-${gap}`, className), ref: ref, children: children })));
|
|
11
|
+
Column.displayName = 'Column';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { Column, columnGapSizes, columnTags } from './Column';
|
|
5
|
+
import { ariaRoleForTag } from '../common/accessibility';
|
|
6
|
+
import { crossAlignOptionsForColumn, mainAlignOptions } from '../common/types';
|
|
7
|
+
import '@testing-library/jest-dom';
|
|
8
|
+
describe('Column', () => {
|
|
9
|
+
it('renders', () => {
|
|
10
|
+
const { container } = render(_jsx(Column, {}));
|
|
11
|
+
const component = container.querySelector(':only-child');
|
|
12
|
+
expect(component).toBeInTheDocument();
|
|
13
|
+
expect(component).toBeVisible();
|
|
14
|
+
});
|
|
15
|
+
it('renders a design system BEM class name', () => {
|
|
16
|
+
const { container } = render(_jsx(Column, {}));
|
|
17
|
+
const component = container.querySelector(':only-child');
|
|
18
|
+
expect(component).toHaveClass('ams-column');
|
|
19
|
+
});
|
|
20
|
+
columnGapSizes.map((gap) => it(`renders with ‘${gap}’ gap`, () => {
|
|
21
|
+
const { container } = render(_jsx(Column, { gap: gap }));
|
|
22
|
+
const component = container.querySelector(':only-child');
|
|
23
|
+
expect(component).toHaveClass(`ams-column--gap-${gap}`);
|
|
24
|
+
}));
|
|
25
|
+
it('renders an extra class name', () => {
|
|
26
|
+
const { container } = render(_jsx(Column, { className: "extra" }));
|
|
27
|
+
const component = container.querySelector(':only-child');
|
|
28
|
+
expect(component).toHaveClass('ams-column extra');
|
|
29
|
+
});
|
|
30
|
+
columnTags.forEach((tag) => {
|
|
31
|
+
it(`renders with a custom ${tag} tag`, () => {
|
|
32
|
+
const { container } = render(_jsx(Column, { "aria-label": tag === 'section' ? 'Accessible name' : undefined, as: tag }));
|
|
33
|
+
const component = tag === 'div' ? container.querySelector(tag) : screen.getByRole(ariaRoleForTag[tag]);
|
|
34
|
+
expect(component).toBeInTheDocument();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
it('supports ForwardRef in React', () => {
|
|
38
|
+
const ref = createRef();
|
|
39
|
+
const { container } = render(_jsx(Column, { ref: ref }));
|
|
40
|
+
const component = container.querySelector(':only-child');
|
|
41
|
+
expect(ref.current).toBe(component);
|
|
42
|
+
});
|
|
43
|
+
describe('Alignment', () => {
|
|
44
|
+
mainAlignOptions.map((align) => it(`sets the ‘${align}’ alignment`, () => {
|
|
45
|
+
const { container } = render(_jsx(Column, { align: align }));
|
|
46
|
+
const component = container.querySelector(':only-child');
|
|
47
|
+
expect(component).toHaveClass(`ams-column--align-${align}`);
|
|
48
|
+
}));
|
|
49
|
+
crossAlignOptionsForColumn.map((align) => it(`sets the ‘${align}’ vertical alignment`, () => {
|
|
50
|
+
const { container } = render(_jsx(Column, { alignHorizontal: align }));
|
|
51
|
+
const component = container.querySelector(':only-child');
|
|
52
|
+
expect(component).toHaveClass(`ams-column--align-horizontal-${align}`);
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Column } from './Column';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { InputHTMLAttributes } from 'react';
|
|
6
|
+
export declare const dateInputTypes: readonly ["date", "datetime-local"];
|
|
7
|
+
type DateInputType = (typeof dateInputTypes)[number];
|
|
8
|
+
export type DateInputProps = {
|
|
9
|
+
/** Whether the value fails a validation rule. */
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
/** The kind of data that the user should provide. */
|
|
12
|
+
type?: DateInputType;
|
|
13
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'type'>;
|
|
14
|
+
export declare const DateInput: import("react").ForwardRefExoticComponent<{
|
|
15
|
+
/** Whether the value fails a validation rule. */
|
|
16
|
+
invalid?: boolean;
|
|
17
|
+
/** The kind of data that the user should provide. */
|
|
18
|
+
type?: DateInputType;
|
|
19
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2+
|
|
4
|
+
* Copyright Gemeente Amsterdam
|
|
5
|
+
*/
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
export const dateInputTypes = ['date', 'datetime-local'];
|
|
9
|
+
export const DateInput = forwardRef(({ className, invalid, type = 'date', ...restProps }, ref) => (_jsx("input", { ...restProps, "aria-invalid": invalid || undefined, className: clsx('ams-date-input', className), ref: ref, type: type })));
|
|
10
|
+
DateInput.displayName = 'DateInput';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { DateInput, dateInputTypes } from './DateInput';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Date input', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
const { container } = render(_jsx(DateInput, {}));
|
|
9
|
+
const component = container.querySelector(':only-child');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
const { container } = render(_jsx(DateInput, {}));
|
|
15
|
+
const component = container.querySelector(':only-child');
|
|
16
|
+
expect(component).toHaveClass('ams-date-input');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
const { container } = render(_jsx(DateInput, { className: "extra" }));
|
|
20
|
+
const component = container.querySelector(':only-child');
|
|
21
|
+
expect(component).toHaveClass('ams-date-input extra');
|
|
22
|
+
});
|
|
23
|
+
it('supports ForwardRef in React', () => {
|
|
24
|
+
const ref = createRef();
|
|
25
|
+
const { container } = render(_jsx(DateInput, { ref: ref }));
|
|
26
|
+
const component = container.querySelector(':only-child');
|
|
27
|
+
expect(ref.current).toBe(component);
|
|
28
|
+
});
|
|
29
|
+
describe('Invalid state', () => {
|
|
30
|
+
it('is not invalid by default', () => {
|
|
31
|
+
const { container } = render(_jsx(DateInput, {}));
|
|
32
|
+
const component = container.querySelector(':only-child');
|
|
33
|
+
expect(component).not.toBeInvalid();
|
|
34
|
+
});
|
|
35
|
+
it('can have an invalid state', () => {
|
|
36
|
+
const { container } = render(_jsx(DateInput, { invalid: true }));
|
|
37
|
+
const component = container.querySelector(':only-child');
|
|
38
|
+
expect(component).toHaveAttribute('aria-invalid');
|
|
39
|
+
expect(component).toBeInvalid();
|
|
40
|
+
});
|
|
41
|
+
it('omits non-essential invalid attributes when not invalid', () => {
|
|
42
|
+
const { container } = render(_jsx(DateInput, { invalid: false }));
|
|
43
|
+
const component = container.querySelector(':only-child');
|
|
44
|
+
expect(component).not.toHaveAttribute('aria-invalid');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('Type', () => {
|
|
48
|
+
dateInputTypes.map((type) => it(`sets the ‘${type}’ type`, () => {
|
|
49
|
+
const { container } = render(_jsx(DateInput, { type: type }));
|
|
50
|
+
const component = container.querySelector(':only-child');
|
|
51
|
+
expect(component).toHaveAttribute('type', type);
|
|
52
|
+
}));
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DateInput } from './DateInput';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export declare const descriptionListTermsWidths: readonly ["narrow", "medium", "wide"];
|
|
7
|
+
type DescriptionListTermsWidth = (typeof descriptionListTermsWidths)[number];
|
|
8
|
+
export type DescriptionListProps = {
|
|
9
|
+
/** Changes the text colour for readability on a dark background. */
|
|
10
|
+
color?: 'inverse';
|
|
11
|
+
termsWidth?: DescriptionListTermsWidth;
|
|
12
|
+
} & PropsWithChildren<HTMLAttributes<HTMLDListElement>>;
|
|
13
|
+
export declare const DescriptionList: import("react").ForwardRefExoticComponent<{
|
|
14
|
+
/** Changes the text colour for readability on a dark background. */
|
|
15
|
+
color?: "inverse";
|
|
16
|
+
termsWidth?: DescriptionListTermsWidth;
|
|
17
|
+
} & HTMLAttributes<HTMLDListElement> & {
|
|
18
|
+
children?: import("react").ReactNode | undefined;
|
|
19
|
+
} & import("react").RefAttributes<HTMLDListElement>> & {
|
|
20
|
+
Description: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
21
|
+
children?: import("react").ReactNode | undefined;
|
|
22
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
23
|
+
Section: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
24
|
+
children?: import("react").ReactNode | undefined;
|
|
25
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
Term: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
27
|
+
children?: import("react").ReactNode | undefined;
|
|
28
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2+
|
|
4
|
+
* Copyright Gemeente Amsterdam
|
|
5
|
+
*/
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
import { DescriptionListDescription } from './DescriptionListDescription';
|
|
9
|
+
import { DescriptionListSection } from './DescriptionListSection';
|
|
10
|
+
import { DescriptionListTerm } from './DescriptionListTerm';
|
|
11
|
+
export const descriptionListTermsWidths = ['narrow', 'medium', 'wide'];
|
|
12
|
+
const DescriptionListRoot = forwardRef(({ children, className, color, termsWidth, ...restProps }, ref) => (_jsx("dl", { ...restProps, className: clsx('ams-description-list', color && `ams-description-list--${color}`, termsWidth && `ams-description-list--${termsWidth}`, className), ref: ref, children: children })));
|
|
13
|
+
DescriptionListRoot.displayName = 'DescriptionList';
|
|
14
|
+
export const DescriptionList = Object.assign(DescriptionListRoot, {
|
|
15
|
+
Description: DescriptionListDescription,
|
|
16
|
+
Section: DescriptionListSection,
|
|
17
|
+
Term: DescriptionListTerm,
|
|
18
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { DescriptionList, descriptionListTermsWidths } from './DescriptionList';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Description List', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
const { container } = render(_jsx(DescriptionList, {}));
|
|
9
|
+
const component = container.querySelector(':only-child');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
const { container } = render(_jsx(DescriptionList, {}));
|
|
15
|
+
const component = container.querySelector(':only-child');
|
|
16
|
+
expect(component).toHaveClass('ams-description-list');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
const { container } = render(_jsx(DescriptionList, { className: "extra" }));
|
|
20
|
+
const component = container.querySelector(':only-child');
|
|
21
|
+
expect(component).toHaveClass('ams-description-list extra');
|
|
22
|
+
});
|
|
23
|
+
descriptionListTermsWidths.map((width) => it(`renders the class name for the ‘${width}’ terms column width`, () => {
|
|
24
|
+
const { container } = render(_jsx(DescriptionList, { termsWidth: width }));
|
|
25
|
+
const component = container.querySelector(':only-child');
|
|
26
|
+
expect(component).toHaveClass(`ams-description-list--${width}`);
|
|
27
|
+
}));
|
|
28
|
+
it('supports ForwardRef in React', () => {
|
|
29
|
+
const ref = createRef();
|
|
30
|
+
const { container } = render(_jsx(DescriptionList, { ref: ref }));
|
|
31
|
+
const component = container.querySelector(':only-child');
|
|
32
|
+
expect(ref.current).toBe(component);
|
|
33
|
+
});
|
|
34
|
+
it('renders the class name for inverse color', () => {
|
|
35
|
+
const { container } = render(_jsx(DescriptionList, { color: "inverse" }));
|
|
36
|
+
const component = container.querySelector(':only-child');
|
|
37
|
+
expect(component).toHaveClass('ams-description-list--inverse');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type DescriptionListDescriptionProps = PropsWithChildren<HTMLAttributes<HTMLElement>>;
|
|
7
|
+
export declare const DescriptionListDescription: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
8
|
+
children?: import("react").ReactNode | undefined;
|
|
9
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2+
|
|
4
|
+
* Copyright Gemeente Amsterdam
|
|
5
|
+
*/
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
export const DescriptionListDescription = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("dd", { ...restProps, className: clsx('ams-description-list__description', className), ref: ref, children: children })));
|
|
9
|
+
DescriptionListDescription.displayName = 'DescriptionList.Description';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { DescriptionList } from './DescriptionList';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Description List Description', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
render(_jsx(DescriptionList.Description, { children: "Test" }));
|
|
9
|
+
const component = screen.getByRole('definition');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
render(_jsx(DescriptionList.Description, { children: "Test" }));
|
|
15
|
+
const component = screen.getByRole('definition');
|
|
16
|
+
expect(component).toHaveClass('ams-description-list__description');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
render(_jsx(DescriptionList.Description, { className: "extra", children: "Test" }));
|
|
20
|
+
const component = screen.getByRole('definition');
|
|
21
|
+
expect(component).toHaveClass('ams-description-list__description extra');
|
|
22
|
+
});
|
|
23
|
+
it('supports ForwardRef in React', () => {
|
|
24
|
+
const ref = createRef();
|
|
25
|
+
render(_jsx(DescriptionList.Description, { ref: ref, children: "Test" }));
|
|
26
|
+
const component = screen.getByRole('definition');
|
|
27
|
+
expect(ref.current).toBe(component);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type DescriptionListSectionProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const DescriptionListSection: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
children?: import("react").ReactNode | undefined;
|
|
9
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2+
|
|
4
|
+
* Copyright Gemeente Amsterdam
|
|
5
|
+
*/
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
export const DescriptionListSection = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("div", { ...restProps, className: clsx('ams-description-list__section', className), ref: ref, children: children })));
|
|
9
|
+
DescriptionListSection.displayName = 'DescriptionList.Section';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { DescriptionList } from './DescriptionList';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Description List Section', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
const { container } = render(_jsx(DescriptionList.Section, { children: "Test" }));
|
|
9
|
+
const component = container.querySelector(':only-child');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
const { container } = render(_jsx(DescriptionList.Section, { children: "Test" }));
|
|
15
|
+
const component = container.querySelector(':only-child');
|
|
16
|
+
expect(component).toHaveClass('ams-description-list__section');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
const { container } = render(_jsx(DescriptionList.Section, { className: "extra", children: "Test" }));
|
|
20
|
+
const component = container.querySelector(':only-child');
|
|
21
|
+
expect(component).toHaveClass('ams-description-list__section extra');
|
|
22
|
+
});
|
|
23
|
+
it('supports ForwardRef in React', () => {
|
|
24
|
+
const ref = createRef();
|
|
25
|
+
const { container } = render(_jsx(DescriptionList.Section, { ref: ref, children: "Test" }));
|
|
26
|
+
const component = container.querySelector(':only-child');
|
|
27
|
+
expect(ref.current).toBe(component);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type DescriptionListTermProps = PropsWithChildren<HTMLAttributes<HTMLElement>>;
|
|
7
|
+
export declare const DescriptionListTerm: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
8
|
+
children?: import("react").ReactNode | undefined;
|
|
9
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2+
|
|
4
|
+
* Copyright Gemeente Amsterdam
|
|
5
|
+
*/
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
export const DescriptionListTerm = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("dt", { ...restProps, className: clsx('ams-description-list__term', className), ref: ref, children: children })));
|
|
9
|
+
DescriptionListTerm.displayName = 'DescriptionList.Term';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { DescriptionList } from './DescriptionList';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Description List Term', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
render(_jsx(DescriptionList.Term, { children: "Test" }));
|
|
9
|
+
const component = screen.getByRole('term');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
render(_jsx(DescriptionList.Term, { children: "Test" }));
|
|
15
|
+
const component = screen.getByRole('term');
|
|
16
|
+
expect(component).toHaveClass('ams-description-list__term');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
render(_jsx(DescriptionList.Term, { className: "extra", children: "Test" }));
|
|
20
|
+
const component = screen.getByRole('term');
|
|
21
|
+
expect(component).toHaveClass('ams-description-list__term extra');
|
|
22
|
+
});
|
|
23
|
+
it('supports ForwardRef in React', () => {
|
|
24
|
+
const ref = createRef();
|
|
25
|
+
render(_jsx(DescriptionList.Term, { ref: ref, children: "Test" }));
|
|
26
|
+
const component = screen.getByRole('term');
|
|
27
|
+
expect(ref.current).toBe(component);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DescriptionList } from './DescriptionList';
|
|
2
|
+
export type { DescriptionListProps } from './DescriptionList';
|
|
3
|
+
export type { DescriptionListTermProps } from './DescriptionListTerm';
|
|
4
|
+
export type { DescriptionListDescriptionProps } from './DescriptionListDescription';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DescriptionList } from './DescriptionList';
|