@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,110 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CloseIcon } from '@amsterdam/design-system-react-icons';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
import { createRef } from 'react';
|
|
6
|
+
import { Button } from './Button';
|
|
7
|
+
describe('Button', () => {
|
|
8
|
+
it('renders an element with role button', () => {
|
|
9
|
+
render(_jsx(Button, { children: "Click me!" }));
|
|
10
|
+
const button = screen.getByRole('button', {
|
|
11
|
+
name: 'Click me!',
|
|
12
|
+
});
|
|
13
|
+
expect(button).toBeInTheDocument();
|
|
14
|
+
expect(button).toBeVisible();
|
|
15
|
+
});
|
|
16
|
+
it('renders a design system BEM class name', () => {
|
|
17
|
+
render(_jsx(Button, { children: "Click me!" }));
|
|
18
|
+
const button = screen.getByRole('button', {
|
|
19
|
+
name: 'Click me!',
|
|
20
|
+
});
|
|
21
|
+
expect(button).toHaveClass('ams-button');
|
|
22
|
+
});
|
|
23
|
+
it('renders an extra class name', () => {
|
|
24
|
+
render(_jsx(Button, { className: "extra", children: "Click me!" }));
|
|
25
|
+
const button = screen.getByRole('button', {
|
|
26
|
+
name: 'Click me!',
|
|
27
|
+
});
|
|
28
|
+
expect(button).toHaveClass('ams-button extra');
|
|
29
|
+
});
|
|
30
|
+
it('renders a default button with variant primary', () => {
|
|
31
|
+
render(_jsx(Button, { children: "primary" }));
|
|
32
|
+
const button = screen.getByRole('button', {
|
|
33
|
+
name: 'primary',
|
|
34
|
+
});
|
|
35
|
+
expect(button).toBeInTheDocument();
|
|
36
|
+
expect(button).toHaveAttribute('type', 'button');
|
|
37
|
+
expect(button).toHaveClass('ams-button--primary');
|
|
38
|
+
});
|
|
39
|
+
it('renders a button with a specified variant', () => {
|
|
40
|
+
render(_jsxs(_Fragment, { children: [_jsx(Button, { variant: "primary", children: "primary" }), _jsx(Button, { variant: "secondary", children: "secondary" }), _jsx(Button, { variant: "tertiary", children: "tertiary" })] }));
|
|
41
|
+
const buttonPrimary = screen.getByRole('button', {
|
|
42
|
+
name: 'primary',
|
|
43
|
+
});
|
|
44
|
+
const buttonSecondary = screen.getByRole('button', {
|
|
45
|
+
name: 'secondary',
|
|
46
|
+
});
|
|
47
|
+
const buttonTertiary = screen.getByRole('button', {
|
|
48
|
+
name: 'tertiary',
|
|
49
|
+
});
|
|
50
|
+
expect(buttonPrimary).toBeInTheDocument();
|
|
51
|
+
expect(buttonPrimary).toHaveClass('ams-button--primary');
|
|
52
|
+
expect(buttonSecondary).toBeInTheDocument();
|
|
53
|
+
expect(buttonSecondary).toHaveClass('ams-button--secondary');
|
|
54
|
+
expect(buttonTertiary).toBeInTheDocument();
|
|
55
|
+
expect(buttonTertiary).toHaveClass('ams-button--tertiary');
|
|
56
|
+
});
|
|
57
|
+
it('renders a disabled button with a specified variant', () => {
|
|
58
|
+
render(_jsxs(_Fragment, { children: [_jsx(Button, { disabled: true, variant: "primary", children: "primary" }), _jsx(Button, { disabled: true, variant: "secondary", children: "secondary" }), _jsx(Button, { disabled: true, variant: "tertiary", children: "tertiary" })] }));
|
|
59
|
+
const buttonPrimary = screen.getByRole('button', {
|
|
60
|
+
name: 'primary',
|
|
61
|
+
});
|
|
62
|
+
const buttonSecondary = screen.getByRole('button', {
|
|
63
|
+
name: 'secondary',
|
|
64
|
+
});
|
|
65
|
+
const buttonTertiary = screen.getByRole('button', {
|
|
66
|
+
name: 'tertiary',
|
|
67
|
+
});
|
|
68
|
+
expect(buttonPrimary).toBeInTheDocument();
|
|
69
|
+
expect(buttonPrimary).toBeDisabled();
|
|
70
|
+
expect(buttonSecondary).toBeInTheDocument();
|
|
71
|
+
expect(buttonSecondary).toBeDisabled();
|
|
72
|
+
expect(buttonTertiary).toBeInTheDocument();
|
|
73
|
+
expect(buttonTertiary).toBeDisabled();
|
|
74
|
+
});
|
|
75
|
+
it('is able to pass a React ref', () => {
|
|
76
|
+
const ref = createRef();
|
|
77
|
+
const { container } = render(_jsx(Button, { ref: ref, children: "Click me!" }));
|
|
78
|
+
const button = container.querySelector(':only-child');
|
|
79
|
+
expect(ref.current).toBe(button);
|
|
80
|
+
});
|
|
81
|
+
it('renders a button with an icon at the end', () => {
|
|
82
|
+
render(_jsx(Button, { icon: CloseIcon, children: _jsx("span", { children: "Sluiten" }) }));
|
|
83
|
+
const button = screen.getByRole('button', {
|
|
84
|
+
name: 'Sluiten',
|
|
85
|
+
});
|
|
86
|
+
const icon = button.querySelector('.ams-icon:last-child');
|
|
87
|
+
expect(button).toBeInTheDocument();
|
|
88
|
+
expect(icon).toBeInTheDocument();
|
|
89
|
+
});
|
|
90
|
+
it('renders a button with an icon before the label', () => {
|
|
91
|
+
render(_jsx(Button, { icon: CloseIcon, iconBefore: true, children: _jsx("span", { children: "Sluiten" }) }));
|
|
92
|
+
const button = screen.getByRole('button', {
|
|
93
|
+
name: 'Sluiten',
|
|
94
|
+
});
|
|
95
|
+
const icon = button.querySelector('.ams-icon:first-child');
|
|
96
|
+
expect(button).toBeInTheDocument();
|
|
97
|
+
expect(icon).toBeInTheDocument();
|
|
98
|
+
});
|
|
99
|
+
it('renders a button with an icon only', () => {
|
|
100
|
+
render(_jsx(Button, { icon: CloseIcon, iconOnly: true, variant: "tertiary", children: "Sluiten" }));
|
|
101
|
+
const button = screen.getByRole('button', {
|
|
102
|
+
name: 'Sluiten',
|
|
103
|
+
});
|
|
104
|
+
const icon = button.querySelector('.ams-icon');
|
|
105
|
+
const label = button.querySelector('.ams-visually-hidden');
|
|
106
|
+
expect(button).toBeInTheDocument();
|
|
107
|
+
expect(icon).toBeInTheDocument();
|
|
108
|
+
expect(label).toBeInTheDocument();
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './Button';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type CardProps = PropsWithChildren<HTMLAttributes<HTMLElement>>;
|
|
7
|
+
export declare const Card: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
8
|
+
children?: import("react").ReactNode | undefined;
|
|
9
|
+
} & import("react").RefAttributes<HTMLElement>> & {
|
|
10
|
+
Heading: import("react").ForwardRefExoticComponent<{
|
|
11
|
+
color?: "inverse";
|
|
12
|
+
level: 1 | 2 | 3 | 4;
|
|
13
|
+
size?: "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "level-6";
|
|
14
|
+
} & HTMLAttributes<HTMLHeadingElement> & {
|
|
15
|
+
children?: import("react").ReactNode | undefined;
|
|
16
|
+
} & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
HeadingGroup: import("react").ForwardRefExoticComponent<{
|
|
18
|
+
tagline: string;
|
|
19
|
+
} & HTMLAttributes<HTMLElement> & {
|
|
20
|
+
children?: import("react").ReactNode | undefined;
|
|
21
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
22
|
+
Image: import("react").ForwardRefExoticComponent<{
|
|
23
|
+
alt: string;
|
|
24
|
+
} & import("../common/types").AspectRatioProps & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, "children"> & import("react").RefAttributes<HTMLImageElement>>;
|
|
25
|
+
Link: import("react").ForwardRefExoticComponent<import("react").AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
26
|
+
children?: import("react").ReactNode | undefined;
|
|
27
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { CardHeading } from './CardHeading';
|
|
9
|
+
import { CardHeadingGroup } from './CardHeadingGroup';
|
|
10
|
+
import { CardImage } from './CardImage';
|
|
11
|
+
import { CardLink } from './CardLink';
|
|
12
|
+
const CardRoot = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("article", { ...restProps, className: clsx('ams-card', className), ref: ref, children: children })));
|
|
13
|
+
CardRoot.displayName = 'Card';
|
|
14
|
+
export const Card = Object.assign(CardRoot, {
|
|
15
|
+
Heading: CardHeading,
|
|
16
|
+
HeadingGroup: CardHeadingGroup,
|
|
17
|
+
Image: CardImage,
|
|
18
|
+
Link: CardLink,
|
|
19
|
+
});
|
|
@@ -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 { Card } from './Card';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Card', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
const { container } = render(_jsx(Card, {}));
|
|
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
|
+
render(_jsx(Card, {}));
|
|
15
|
+
const component = screen.getByRole('article');
|
|
16
|
+
expect(component).toHaveClass('ams-card');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
render(_jsx(Card, { className: "extra" }));
|
|
20
|
+
const component = screen.getByRole('article');
|
|
21
|
+
expect(component).toHaveClass('ams-card extra');
|
|
22
|
+
});
|
|
23
|
+
it('supports ForwardRef in React', () => {
|
|
24
|
+
const ref = createRef();
|
|
25
|
+
render(_jsx(Card, { ref: ref }));
|
|
26
|
+
const component = screen.getByRole('article');
|
|
27
|
+
expect(ref.current).toBe(component);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
export declare const CardHeading: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
color?: "inverse";
|
|
7
|
+
level: 1 | 2 | 3 | 4;
|
|
8
|
+
size?: "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "level-6";
|
|
9
|
+
} & import("react").HTMLAttributes<HTMLHeadingElement> & {
|
|
10
|
+
children?: import("react").ReactNode | undefined;
|
|
11
|
+
} & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
@@ -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
|
+
import { Heading } from '../Heading';
|
|
9
|
+
export const CardHeading = forwardRef(({ children, className, size = 'level-4', ...restProps }, ref) => (_jsx(Heading, { ...restProps, className: clsx('ams-card__heading', className), ref: ref, size: size, children: children })));
|
|
10
|
+
CardHeading.displayName = 'Card.Heading';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { CardHeading } from './CardHeading';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Card Heading', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
render(_jsx(CardHeading, { level: 1 }));
|
|
9
|
+
const component = screen.getByRole('heading');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
render(_jsx(CardHeading, { level: 2 }));
|
|
15
|
+
const component = screen.getByRole('heading');
|
|
16
|
+
expect(component).toHaveClass('ams-card__heading');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
render(_jsx(CardHeading, { className: "extra", level: 3 }));
|
|
20
|
+
const component = screen.getByRole('heading');
|
|
21
|
+
expect(component).toHaveClass('ams-card__heading extra');
|
|
22
|
+
});
|
|
23
|
+
it('renders the correct size level class', () => {
|
|
24
|
+
render(_jsx(CardHeading, { level: 4, size: "level-1", children: "Size level 1" }));
|
|
25
|
+
const component = screen.getByRole('heading');
|
|
26
|
+
expect(component).toHaveClass('ams-heading--1');
|
|
27
|
+
});
|
|
28
|
+
it('supports ForwardRef in React', () => {
|
|
29
|
+
const ref = createRef();
|
|
30
|
+
render(_jsx(CardHeading, { level: 4, ref: ref }));
|
|
31
|
+
const component = screen.getByRole('heading');
|
|
32
|
+
expect(ref.current).toBe(component);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type CardHeadingGroupProps = {
|
|
7
|
+
/** A short phrase of text, e.g. to categorise the card. Displayed above the card heading. */
|
|
8
|
+
tagline: string;
|
|
9
|
+
} & PropsWithChildren<HTMLAttributes<HTMLElement>>;
|
|
10
|
+
export declare const CardHeadingGroup: import("react").ForwardRefExoticComponent<{
|
|
11
|
+
/** A short phrase of text, e.g. to categorise the card. Displayed above the card heading. */
|
|
12
|
+
tagline: string;
|
|
13
|
+
} & HTMLAttributes<HTMLElement> & {
|
|
14
|
+
children?: import("react").ReactNode | undefined;
|
|
15
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 { Paragraph } from '../Paragraph';
|
|
9
|
+
export const CardHeadingGroup = forwardRef(({ children, className, tagline, ...restProps }, ref) => (_jsxs("hgroup", { ...restProps, className: clsx('ams-card__heading-group', className), ref: ref, children: [children, _jsx(Paragraph, { size: "small", children: tagline })] })));
|
|
10
|
+
CardHeadingGroup.displayName = 'Card.HeadingGroup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { CardHeadingGroup } from './CardHeadingGroup';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Card heading group', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
const { container } = render(_jsx(CardHeadingGroup, { tagline: "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(CardHeadingGroup, { tagline: "test" }));
|
|
15
|
+
const component = container.querySelector(':only-child');
|
|
16
|
+
expect(component).toHaveClass('ams-card__heading-group');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
const { container } = render(_jsx(CardHeadingGroup, { className: "extra", tagline: "test" }));
|
|
20
|
+
const component = container.querySelector(':only-child');
|
|
21
|
+
expect(component).toHaveClass('ams-card__heading-group extra');
|
|
22
|
+
});
|
|
23
|
+
it('renders a tagline', () => {
|
|
24
|
+
render(_jsx(CardHeadingGroup, { tagline: "tagline" }));
|
|
25
|
+
const tagline = screen.getByText('tagline');
|
|
26
|
+
expect(tagline).toBeInTheDocument();
|
|
27
|
+
});
|
|
28
|
+
it('supports ForwardRef in React', () => {
|
|
29
|
+
const ref = createRef();
|
|
30
|
+
const { container } = render(_jsx(CardHeadingGroup, { ref: ref, tagline: "test" }));
|
|
31
|
+
const component = container.querySelector(':only-child');
|
|
32
|
+
expect(ref.current).toBe(component);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
export declare const CardImage: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
alt: string;
|
|
7
|
+
} & import("../common/types").AspectRatioProps & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, "children"> & import("react").RefAttributes<HTMLImageElement>>;
|
|
@@ -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
|
+
import { Image } from '../Image';
|
|
9
|
+
export const CardImage = forwardRef(({ className, ...restProps }, ref) => (_jsx(Image, { ...restProps, className: clsx('ams-card__image', className), ref: ref })));
|
|
10
|
+
CardImage.displayName = 'Card.Image';
|
|
@@ -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 { CardImage } from './CardImage';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Card Image', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
const { container } = render(_jsx(CardImage, { alt: "" }));
|
|
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(CardImage, { alt: "" }));
|
|
15
|
+
const component = container.querySelector(':only-child');
|
|
16
|
+
expect(component).toHaveClass('ams-card__image');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
const { container } = render(_jsx(CardImage, { alt: "", className: "extra" }));
|
|
20
|
+
const component = container.querySelector(':only-child');
|
|
21
|
+
expect(component).toHaveClass('ams-card__image extra');
|
|
22
|
+
});
|
|
23
|
+
it('supports ForwardRef in React', () => {
|
|
24
|
+
const ref = createRef();
|
|
25
|
+
const { container } = render(_jsx(CardImage, { alt: "", ref: ref }));
|
|
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 { AnchorHTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type CardLinkProps = PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
7
|
+
export declare const CardLink: import("react").ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
8
|
+
children?: import("react").ReactNode | undefined;
|
|
9
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -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 CardLink = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("a", { ...restProps, className: clsx('ams-card__link', className), ref: ref, children: children })));
|
|
9
|
+
CardLink.displayName = 'Card.Link';
|
|
@@ -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 { CardLink } from './CardLink';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Card link', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
render(_jsx(CardLink, { href: "/" }));
|
|
9
|
+
const component = screen.getByRole('link');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
render(_jsx(CardLink, { href: "/" }));
|
|
15
|
+
const component = screen.getByRole('link');
|
|
16
|
+
expect(component).toHaveClass('ams-card__link');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
render(_jsx(CardLink, { className: "extra", href: "/" }));
|
|
20
|
+
const component = screen.getByRole('link');
|
|
21
|
+
expect(component).toHaveClass('ams-card__link extra');
|
|
22
|
+
});
|
|
23
|
+
it('supports ForwardRef in React', () => {
|
|
24
|
+
const ref = createRef();
|
|
25
|
+
render(_jsx(CardLink, { href: "/", ref: ref }));
|
|
26
|
+
const component = screen.getByRole('link');
|
|
27
|
+
expect(ref.current).toBe(component);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Card } from './Card';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes } from 'react';
|
|
6
|
+
export type CharacterCountProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
/** The current length of the field’s value. */
|
|
8
|
+
length: number;
|
|
9
|
+
/** The maximum length of the field’s value. */
|
|
10
|
+
maxLength: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const CharacterCount: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
13
|
+
/** The current length of the field’s value. */
|
|
14
|
+
length: number;
|
|
15
|
+
/** The maximum length of the field’s value. */
|
|
16
|
+
maxLength: number;
|
|
17
|
+
} & 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 CharacterCount = forwardRef(({ className, length, maxLength, ...restProps }, ref) => (_jsx("div", { ...restProps, className: clsx('ams-character-count', length > maxLength && 'ams-character-count--error', className), ref: ref, role: "status", children: `${length} van ${maxLength} tekens` })));
|
|
9
|
+
CharacterCount.displayName = 'CharacterCount';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { CharacterCount } from './CharacterCount';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Character count', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
render(_jsx(CharacterCount, { length: 10, maxLength: 100 }));
|
|
9
|
+
const component = screen.getByRole('status');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
render(_jsx(CharacterCount, { length: 10, maxLength: 100 }));
|
|
15
|
+
const component = screen.getByRole('status');
|
|
16
|
+
expect(component).toHaveClass('ams-character-count');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
render(_jsx(CharacterCount, { className: "extra", length: 10, maxLength: 100 }));
|
|
20
|
+
const component = screen.getByRole('status');
|
|
21
|
+
expect(component).toHaveClass('ams-character-count extra');
|
|
22
|
+
});
|
|
23
|
+
it('renders an error class when length is larger than maxLength', () => {
|
|
24
|
+
render(_jsx(CharacterCount, { length: 101, maxLength: 100 }));
|
|
25
|
+
const component = screen.getByRole('status');
|
|
26
|
+
expect(component).toHaveClass('ams-character-count--error');
|
|
27
|
+
});
|
|
28
|
+
it('supports ForwardRef in React', () => {
|
|
29
|
+
const ref = createRef();
|
|
30
|
+
render(_jsx(CharacterCount, { length: 10, maxLength: 100, ref: ref }));
|
|
31
|
+
const component = screen.getByRole('status');
|
|
32
|
+
expect(ref.current).toBe(component);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CharacterCount } from './CharacterCount';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { InputHTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type CheckboxProps = {
|
|
7
|
+
/** Allows being neither checked nor unchecked. */
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
/** Whether the value fails a validation rule. */
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
} & PropsWithChildren<Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'type'>>;
|
|
12
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<{
|
|
13
|
+
/** Allows being neither checked nor unchecked. */
|
|
14
|
+
indeterminate?: boolean;
|
|
15
|
+
/** Whether the value fails a validation rule. */
|
|
16
|
+
invalid?: boolean;
|
|
17
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & {
|
|
18
|
+
children?: import("react").ReactNode | undefined;
|
|
19
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2+
|
|
4
|
+
* Copyright Gemeente Amsterdam
|
|
5
|
+
*/
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { forwardRef, useEffect, useId, useImperativeHandle, useRef } from 'react';
|
|
8
|
+
export const Checkbox = forwardRef(({ children, className, indeterminate, invalid, ...restProps }, ref) => {
|
|
9
|
+
const id = useId();
|
|
10
|
+
const innerRef = useRef(null);
|
|
11
|
+
// use a passed ref if it's there, otherwise use innerRef
|
|
12
|
+
useImperativeHandle(ref, () => innerRef.current);
|
|
13
|
+
// set input to indeterminate
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (innerRef.current) {
|
|
16
|
+
innerRef.current.indeterminate = Boolean(indeterminate);
|
|
17
|
+
}
|
|
18
|
+
}, [innerRef, indeterminate]);
|
|
19
|
+
return (
|
|
20
|
+
// This div is here because NVDA doesn't match the input to the label
|
|
21
|
+
// without a containing element
|
|
22
|
+
_jsxs("div", { className: clsx('ams-checkbox', className), children: [_jsx("input", { ...restProps, "aria-invalid": invalid || undefined, className: "ams-checkbox__input", id: id, ref: innerRef, type: "checkbox" }), _jsxs("label", { className: "ams-checkbox__label", htmlFor: id, children: [_jsx("span", { className: "ams-checkbox__checkmark" }), children] })] }));
|
|
23
|
+
});
|
|
24
|
+
Checkbox.displayName = 'Checkbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|