@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,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { Badge, badgeColors } from './Badge';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Badge', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
const { container } = render(_jsx(Badge, { label: "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(Badge, { label: "test" }));
|
|
15
|
+
const component = container.querySelector(':only-child');
|
|
16
|
+
expect(component).toHaveClass('ams-badge');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
const { container } = render(_jsx(Badge, { className: "extra", label: "test" }));
|
|
20
|
+
const component = container.querySelector(':only-child');
|
|
21
|
+
expect(component).toHaveClass('ams-badge extra');
|
|
22
|
+
});
|
|
23
|
+
it('supports ForwardRef in React', () => {
|
|
24
|
+
const ref = createRef();
|
|
25
|
+
const { container } = render(_jsx(Badge, { label: "test", ref: ref }));
|
|
26
|
+
const component = container.querySelector(':only-child');
|
|
27
|
+
expect(ref.current).toBe(component);
|
|
28
|
+
});
|
|
29
|
+
it('renders with a number label', () => {
|
|
30
|
+
const { container } = render(_jsx(Badge, { label: 1 }));
|
|
31
|
+
const component = container.querySelector(':only-child');
|
|
32
|
+
expect(component).toHaveTextContent('1');
|
|
33
|
+
});
|
|
34
|
+
badgeColors.map((color) => it(`renders with ${color} color`, () => {
|
|
35
|
+
const { container } = render(_jsx(Badge, { color: color, label: "test" }));
|
|
36
|
+
const component = container.querySelector(':only-child');
|
|
37
|
+
expect(component).toHaveClass(`ams-badge--${color}`);
|
|
38
|
+
}));
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge } from './Badge';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { BlockquoteHTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type BlockquoteProps = {
|
|
7
|
+
/** Changes the text colour for readability on a dark background. */
|
|
8
|
+
color?: 'inverse';
|
|
9
|
+
} & PropsWithChildren<BlockquoteHTMLAttributes<HTMLQuoteElement>>;
|
|
10
|
+
export declare const Blockquote: import("react").ForwardRefExoticComponent<{
|
|
11
|
+
/** Changes the text colour for readability on a dark background. */
|
|
12
|
+
color?: "inverse";
|
|
13
|
+
} & BlockquoteHTMLAttributes<HTMLQuoteElement> & {
|
|
14
|
+
children?: import("react").ReactNode | undefined;
|
|
15
|
+
} & import("react").RefAttributes<HTMLQuoteElement>>;
|
|
@@ -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 Blockquote = forwardRef(({ children, className, color, ...restProps }, ref) => (_jsx("blockquote", { ...restProps, className: clsx('ams-blockquote', color && `ams-blockquote--${color}`, className), ref: ref, children: children })));
|
|
9
|
+
Blockquote.displayName = 'Blockquote';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { Blockquote } from './Blockquote';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Blockquote', () => {
|
|
7
|
+
it('renders a blockquote HTML element', () => {
|
|
8
|
+
const { container } = render(_jsx(Blockquote, {}));
|
|
9
|
+
// TODO: Testing library doesn't seem to recognize the 'blockquote' ARIA role?
|
|
10
|
+
// const quote = screen.getByRole('blockquote')
|
|
11
|
+
const quote = container.querySelector('blockquote:only-child');
|
|
12
|
+
expect(quote).toBeInTheDocument();
|
|
13
|
+
expect(quote).toBeVisible();
|
|
14
|
+
});
|
|
15
|
+
it('renders its content', () => {
|
|
16
|
+
render(_jsx(Blockquote, { children: "Quote" }));
|
|
17
|
+
const quote = screen.getByText('Quote');
|
|
18
|
+
expect(quote).toBeInTheDocument();
|
|
19
|
+
expect(quote).toBeVisible();
|
|
20
|
+
});
|
|
21
|
+
it('renders a design system BEM class name', () => {
|
|
22
|
+
const { container } = render(_jsx(Blockquote, {}));
|
|
23
|
+
const quote = container.querySelector(':only-child');
|
|
24
|
+
expect(quote).toHaveClass('ams-blockquote');
|
|
25
|
+
});
|
|
26
|
+
it('renders an extra class name', () => {
|
|
27
|
+
const { container } = render(_jsx(Blockquote, { className: "extra" }));
|
|
28
|
+
const quote = container.querySelector(':only-child');
|
|
29
|
+
expect(quote).toHaveClass('ams-blockquote extra');
|
|
30
|
+
});
|
|
31
|
+
it('renders the class name for inverse color', () => {
|
|
32
|
+
const { container } = render(_jsx(Blockquote, { color: "inverse" }));
|
|
33
|
+
const quote = container.querySelector(':only-child');
|
|
34
|
+
expect(quote).toHaveClass('ams-blockquote--inverse');
|
|
35
|
+
});
|
|
36
|
+
it('supports ForwardRef in React', () => {
|
|
37
|
+
const ref = createRef();
|
|
38
|
+
const { container } = render(_jsx(Blockquote, { ref: ref }));
|
|
39
|
+
const quote = container.querySelector(':only-child');
|
|
40
|
+
expect(ref.current).toBe(quote);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Blockquote } from './Blockquote';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
export type BreadcrumbProps = PropsWithChildren<HTMLAttributes<HTMLElement>>;
|
|
7
|
+
export declare const Breadcrumb: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
8
|
+
children?: import("react").ReactNode | undefined;
|
|
9
|
+
} & import("react").RefAttributes<HTMLElement>> & {
|
|
10
|
+
Link: import("react").ForwardRefExoticComponent<import("./BreadcrumbLink").BreadcrumbLinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
11
|
+
};
|
|
@@ -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
|
+
import { BreadcrumbLink } from './BreadcrumbLink';
|
|
9
|
+
const BreadcrumbRoot = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("nav", { ...restProps, className: clsx('ams-breadcrumb', className), ref: ref, children: _jsx("ol", { className: "ams-breadcrumb__list", children: children }) })));
|
|
10
|
+
BreadcrumbRoot.displayName = 'Breadcrumb';
|
|
11
|
+
export const Breadcrumb = Object.assign(BreadcrumbRoot, { Link: BreadcrumbLink });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { Breadcrumb } from './Breadcrumb';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Breadcrumb', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
render(_jsx(Breadcrumb, {}));
|
|
9
|
+
const component = screen.getByRole('navigation');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
render(_jsx(Breadcrumb, {}));
|
|
15
|
+
const component = screen.getByRole('navigation');
|
|
16
|
+
expect(component).toHaveClass('ams-breadcrumb');
|
|
17
|
+
});
|
|
18
|
+
it('renders an extra class name', () => {
|
|
19
|
+
render(_jsx(Breadcrumb, { className: "extra" }));
|
|
20
|
+
const component = screen.getByRole('navigation');
|
|
21
|
+
expect(component).toHaveClass('ams-breadcrumb extra');
|
|
22
|
+
});
|
|
23
|
+
it('renders Breadcrumb component with children', () => {
|
|
24
|
+
const breadcrumbLinks = [
|
|
25
|
+
{ href: '/link-1', label: 'Link 1' },
|
|
26
|
+
{ href: '/link-2', label: 'Link 2' },
|
|
27
|
+
{ href: '/link-3', label: 'Link 3' },
|
|
28
|
+
];
|
|
29
|
+
const { container } = render(_jsx(Breadcrumb, { children: breadcrumbLinks.map((link, index) => (_jsx(Breadcrumb.Link, { href: link.href, children: link.label }, index))) }));
|
|
30
|
+
const breadcrumb = screen.getByRole('navigation');
|
|
31
|
+
const breadcrumbs = container.querySelectorAll('.ams-breadcrumb__item');
|
|
32
|
+
expect(breadcrumb).toBeInTheDocument();
|
|
33
|
+
expect(breadcrumbs.length).toBe(3);
|
|
34
|
+
});
|
|
35
|
+
it('is able to pass a React ref', () => {
|
|
36
|
+
const ref = createRef();
|
|
37
|
+
const { container } = render(_jsx(Breadcrumb, { ref: ref, children: _jsx(Breadcrumb.Link, { href: "/link-1", children: "Valid Link" }) }));
|
|
38
|
+
const breadcrumb = container.querySelector(':only-child');
|
|
39
|
+
expect(ref.current).toBe(breadcrumb);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { AnchorHTMLAttributes } from 'react';
|
|
6
|
+
export type BreadcrumbLinkProps = AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
7
|
+
export declare const BreadcrumbLink: import("react").ForwardRefExoticComponent<BreadcrumbLinkProps & 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 BreadcrumbLink = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("li", { className: "ams-breadcrumb__item", children: _jsx("a", { ...restProps, className: clsx('ams-breadcrumb__link', className), ref: ref, children: children }) })));
|
|
9
|
+
BreadcrumbLink.displayName = 'Breadcrumb.Link';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { BreadcrumbLink } from './BreadcrumbLink';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
describe('Breadcrumb link', () => {
|
|
7
|
+
it('renders', () => {
|
|
8
|
+
render(_jsx(BreadcrumbLink, { href: "/" }));
|
|
9
|
+
const component = screen.getByRole('listitem');
|
|
10
|
+
expect(component).toBeInTheDocument();
|
|
11
|
+
expect(component).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
it('renders a design system BEM class name', () => {
|
|
14
|
+
render(_jsx(BreadcrumbLink, { href: "/" }));
|
|
15
|
+
const item = screen.getByRole('listitem');
|
|
16
|
+
expect(item).toHaveClass('ams-breadcrumb__item');
|
|
17
|
+
const link = screen.getByRole('link');
|
|
18
|
+
expect(link).toHaveClass('ams-breadcrumb__link');
|
|
19
|
+
});
|
|
20
|
+
it('renders an extra class name', () => {
|
|
21
|
+
render(_jsx(BreadcrumbLink, { className: "extra", href: "/" }));
|
|
22
|
+
const component = screen.getByRole('link');
|
|
23
|
+
expect(component).toHaveClass('ams-breadcrumb__link extra');
|
|
24
|
+
});
|
|
25
|
+
it('renders the href attribute', () => {
|
|
26
|
+
render(_jsx(BreadcrumbLink, { href: "/" }));
|
|
27
|
+
const component = screen.getByRole('link');
|
|
28
|
+
expect(component).toHaveAttribute('href', '/');
|
|
29
|
+
});
|
|
30
|
+
it('supports ForwardRef in React', () => {
|
|
31
|
+
const ref = createRef();
|
|
32
|
+
render(_jsx(BreadcrumbLink, { href: "/", ref: ref }));
|
|
33
|
+
const component = screen.getByRole('link');
|
|
34
|
+
expect(ref.current).toBe(component);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Breadcrumb } from './Breadcrumb';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { GridProps } from '../Grid';
|
|
6
|
+
export type BreakoutRowNumber = 1 | 2 | 3 | 4;
|
|
7
|
+
export type BreakoutRowNumbers = {
|
|
8
|
+
narrow: BreakoutRowNumber;
|
|
9
|
+
medium: BreakoutRowNumber;
|
|
10
|
+
wide: BreakoutRowNumber;
|
|
11
|
+
};
|
|
12
|
+
export type BreakoutProps = GridProps;
|
|
13
|
+
export declare const Breakout: import("react").ForwardRefExoticComponent<GridProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
14
|
+
Cell: import("react").ForwardRefExoticComponent<import("./BreakoutCell").BreakoutCellProps & import("react").RefAttributes<any>>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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 { BreakoutCell } from './BreakoutCell';
|
|
9
|
+
import { paddingClasses } from '../Grid/paddingClasses';
|
|
10
|
+
const BreakoutRoot = forwardRef(({ children, className, gapVertical, paddingBottom, paddingTop, paddingVertical, ...restProps }, ref) => (_jsx("div", { ...restProps, className: clsx('ams-breakout', gapVertical && `ams-breakout--gap-vertical--${gapVertical}`, paddingClasses('breakout', paddingBottom, paddingTop, paddingVertical), className), ref: ref, children: children })));
|
|
11
|
+
BreakoutRoot.displayName = 'Breakout';
|
|
12
|
+
export const Breakout = Object.assign(BreakoutRoot, { Cell: BreakoutCell });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { Breakout } from './Breakout';
|
|
5
|
+
import { gridGaps, gridPaddings } from '../Grid/Grid';
|
|
6
|
+
import '@testing-library/jest-dom';
|
|
7
|
+
describe('Breakout', () => {
|
|
8
|
+
it('renders', () => {
|
|
9
|
+
const { container } = render(_jsx(Breakout, {}));
|
|
10
|
+
const component = container.querySelector(':only-child');
|
|
11
|
+
expect(component).toBeInTheDocument();
|
|
12
|
+
expect(component).toBeVisible();
|
|
13
|
+
});
|
|
14
|
+
it('renders a design system BEM class name', () => {
|
|
15
|
+
const { container } = render(_jsx(Breakout, {}));
|
|
16
|
+
const component = container.querySelector(':only-child');
|
|
17
|
+
expect(component).toHaveClass('ams-breakout');
|
|
18
|
+
});
|
|
19
|
+
it('renders an extra class name', () => {
|
|
20
|
+
const { container } = render(_jsx(Breakout, { className: "extra" }));
|
|
21
|
+
const component = container.querySelector(':only-child');
|
|
22
|
+
expect(component).toHaveClass('ams-breakout extra');
|
|
23
|
+
});
|
|
24
|
+
gridGaps.forEach((size) => {
|
|
25
|
+
it(`renders the correct class name for a ${size} vertical gap`, () => {
|
|
26
|
+
const { container } = render(_jsx(Breakout, { gapVertical: size }));
|
|
27
|
+
const component = container.querySelector(':only-child');
|
|
28
|
+
expect(component).toHaveClass(`ams-breakout--gap-vertical--${size}`);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
gridPaddings.forEach((size) => {
|
|
32
|
+
it(`renders the correct class name for a ${size} bottom padding`, () => {
|
|
33
|
+
const { container } = render(_jsx(Breakout, { paddingBottom: size }));
|
|
34
|
+
const component = container.querySelector(':only-child');
|
|
35
|
+
expect(component).toHaveClass(`ams-breakout--padding-bottom--${size}`);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
gridPaddings.forEach((size) => {
|
|
39
|
+
it(`renders the correct class name for a ${size} top padding`, () => {
|
|
40
|
+
const { container } = render(_jsx(Breakout, { paddingTop: size }));
|
|
41
|
+
const component = container.querySelector(':only-child');
|
|
42
|
+
expect(component).toHaveClass(`ams-breakout--padding-top--${size}`);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
gridPaddings.forEach((size) => {
|
|
46
|
+
it(`renders the correct class name for a ${size} vertical padding`, () => {
|
|
47
|
+
const { container } = render(_jsx(Breakout, { paddingVertical: size }));
|
|
48
|
+
const component = container.querySelector(':only-child');
|
|
49
|
+
expect(component).toHaveClass(`ams-breakout--padding-vertical--${size}`);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
it('supports ForwardRef in React', () => {
|
|
53
|
+
const ref = createRef();
|
|
54
|
+
const { container } = render(_jsx(Breakout, { ref: ref }));
|
|
55
|
+
const component = container.querySelector(':only-child');
|
|
56
|
+
expect(ref.current).toBe(component);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
import type { BreakoutRowNumber, BreakoutRowNumbers } from './Breakout';
|
|
7
|
+
import type { GridColumnNumber, GridColumnNumbers } from '../Grid/Grid';
|
|
8
|
+
export declare const breakoutCellTags: readonly ["article", "div", "section"];
|
|
9
|
+
type BreakoutCellTag = (typeof breakoutCellTags)[number];
|
|
10
|
+
type BreakoutCellSpanAllProp = {
|
|
11
|
+
/** Lets the cell span the full width of all grid variants. */
|
|
12
|
+
colSpan: 'all';
|
|
13
|
+
colStart?: never;
|
|
14
|
+
/** The content of this cell.
|
|
15
|
+
* The Cell containing the Spotlight expands horizontally and vertically to cover the adjacent gaps and margins.
|
|
16
|
+
* The Cell containing the Image aligns itself to the bottom of the row, in case it is less tall than the text. */
|
|
17
|
+
has?: 'spotlight';
|
|
18
|
+
};
|
|
19
|
+
type BreakoutCellSpanAndStartProps = {
|
|
20
|
+
/** The amount of grid columns the cell spans. */
|
|
21
|
+
colSpan?: 'all' | GridColumnNumber | GridColumnNumbers;
|
|
22
|
+
/** The index of the grid column the cell starts at. */
|
|
23
|
+
colStart?: GridColumnNumber | GridColumnNumbers;
|
|
24
|
+
has?: 'figure';
|
|
25
|
+
};
|
|
26
|
+
type BreakoutCellRowSpanAndStartProps = {
|
|
27
|
+
/** The amount of grid rows the cell spans. */
|
|
28
|
+
rowSpan?: BreakoutRowNumber | BreakoutRowNumbers;
|
|
29
|
+
/** The index of the grid row the cell starts at. */
|
|
30
|
+
rowStart?: BreakoutRowNumber | BreakoutRowNumbers;
|
|
31
|
+
};
|
|
32
|
+
export type BreakoutCellProps = {
|
|
33
|
+
/** The HTML element to use. */
|
|
34
|
+
as?: BreakoutCellTag;
|
|
35
|
+
} & (BreakoutCellSpanAllProp | BreakoutCellSpanAndStartProps) & BreakoutCellRowSpanAndStartProps & PropsWithChildren<HTMLAttributes<HTMLElement>>;
|
|
36
|
+
export declare const BreakoutCell: import("react").ForwardRefExoticComponent<BreakoutCellProps & import("react").RefAttributes<any>>;
|
|
37
|
+
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
|
+
import { breakoutCellClasses } from './breakoutCellClasses';
|
|
9
|
+
export const breakoutCellTags = ['article', 'div', 'section'];
|
|
10
|
+
export const BreakoutCell = forwardRef(({ as: Tag = 'div', children, className, colSpan, colStart, has, rowSpan, rowStart, ...restProps }, ref) => (_jsx(Tag, { ...restProps, className: clsx('ams-breakout__cell', breakoutCellClasses(colSpan, colStart, rowSpan, rowStart), has && `ams-breakout__cell--has-${has}`, className), ref: ref, children: children })));
|
|
11
|
+
BreakoutCell.displayName = 'Breakout.Cell';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { createRef } from 'react';
|
|
4
|
+
import { Breakout } from './Breakout';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
import { breakoutCellTags } from './BreakoutCell';
|
|
7
|
+
import { ariaRoleForTag } from '../common/accessibility';
|
|
8
|
+
describe('Breakout cell', () => {
|
|
9
|
+
it('renders', () => {
|
|
10
|
+
const { container } = render(_jsx(Breakout.Cell, {}));
|
|
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(Breakout.Cell, {}));
|
|
17
|
+
const component = container.querySelector(':only-child');
|
|
18
|
+
expect(component).toHaveClass('ams-breakout__cell');
|
|
19
|
+
});
|
|
20
|
+
it('renders an extra class name', () => {
|
|
21
|
+
const { container } = render(_jsx(Breakout.Cell, { className: "extra" }));
|
|
22
|
+
const component = container.querySelector(':only-child');
|
|
23
|
+
expect(component).toHaveClass('ams-breakout__cell extra');
|
|
24
|
+
});
|
|
25
|
+
breakoutCellTags.forEach((tag) => {
|
|
26
|
+
it(`renders with a custom ${tag} tag`, () => {
|
|
27
|
+
const { container } = render(_jsx(Breakout.Cell, { "aria-label": tag === 'section' ? 'Accessible name' : undefined, as: tag }));
|
|
28
|
+
const component = tag === 'div' ? container.querySelector(tag) : screen.getByRole(ariaRoleForTag[tag]);
|
|
29
|
+
expect(component).toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
it('supports ForwardRef in React', () => {
|
|
33
|
+
const ref = createRef();
|
|
34
|
+
const { container } = render(_jsx(Breakout.Cell, { ref: ref }));
|
|
35
|
+
const component = container.querySelector(':only-child');
|
|
36
|
+
expect(ref.current).toBe(component);
|
|
37
|
+
});
|
|
38
|
+
it('renders no class names for undefined values for colStart and colSpan', () => {
|
|
39
|
+
const { container } = render(_jsx(Breakout.Cell, {}));
|
|
40
|
+
const elementWithColSpanClass = container.querySelector('[class*="ams-breakout__cell--col-span"]');
|
|
41
|
+
const elementWithColStartClass = container.querySelector('[class*="ams-breakout__cell--col-start"]');
|
|
42
|
+
const elementWithRowSpanClass = container.querySelector('[class*="ams-breakout__cell--row-span"]');
|
|
43
|
+
const elementWithRowStartClass = container.querySelector('[class*="ams-breakout__cell--row-start"]');
|
|
44
|
+
expect(elementWithColSpanClass).not.toBeInTheDocument();
|
|
45
|
+
expect(elementWithColStartClass).not.toBeInTheDocument();
|
|
46
|
+
expect(elementWithRowSpanClass).not.toBeInTheDocument();
|
|
47
|
+
expect(elementWithRowStartClass).not.toBeInTheDocument();
|
|
48
|
+
});
|
|
49
|
+
it('renders class names for single number values for colStart and colSpan', () => {
|
|
50
|
+
const { container } = render(_jsx(Breakout.Cell, { colSpan: 4, colStart: 2 }));
|
|
51
|
+
const component = container.querySelector(':only-child');
|
|
52
|
+
expect(component).toHaveClass('ams-breakout__cell--col-span-4 ams-breakout__cell--col-start-2');
|
|
53
|
+
});
|
|
54
|
+
it('renders class names for a single number value for colStart', () => {
|
|
55
|
+
const { container } = render(_jsx(Breakout.Cell, { colSpan: 8 }));
|
|
56
|
+
const component = container.querySelector(':only-child');
|
|
57
|
+
expect(component).toHaveClass('ams-breakout__cell--col-span-8');
|
|
58
|
+
});
|
|
59
|
+
it('renders class names for a single number value for colSpan', () => {
|
|
60
|
+
const { container } = render(_jsx(Breakout.Cell, { colStart: 6 }));
|
|
61
|
+
const component = container.querySelector(':only-child');
|
|
62
|
+
expect(component).toHaveClass('ams-breakout__cell--col-start-6');
|
|
63
|
+
});
|
|
64
|
+
it('renders class names for a single number for colSpan and an object for colStart', () => {
|
|
65
|
+
const { container } = render(_jsx(Breakout.Cell, { colSpan: 8, colStart: { narrow: 2, medium: 4, wide: 6 } }));
|
|
66
|
+
const component = container.querySelector(':only-child');
|
|
67
|
+
expect(component).toHaveClass('ams-breakout__cell--col-span-8 ams-breakout__cell--col-start-2 ams-breakout__cell--col-start-4-medium ams-breakout__cell--col-start-6-wide');
|
|
68
|
+
});
|
|
69
|
+
it('renders class names for an object for colSpan and a single number for colStart', () => {
|
|
70
|
+
const { container } = render(_jsx(Breakout.Cell, { colSpan: { narrow: 3, medium: 5, wide: 7 }, colStart: 2 }));
|
|
71
|
+
const component = container.querySelector(':only-child');
|
|
72
|
+
expect(component).toHaveClass('ams-breakout__cell--col-span-3 ams-breakout__cell--col-span-5-medium ams-breakout__cell--col-span-7-wide ams-breakout__cell--col-start-2');
|
|
73
|
+
});
|
|
74
|
+
it('renders class names for an object for both colSpan and colStart', () => {
|
|
75
|
+
const { container } = render(_jsx(Breakout.Cell, { colSpan: { narrow: 2, medium: 4, wide: 6 }, colStart: { narrow: 1, medium: 3, wide: 5 } }));
|
|
76
|
+
const component = container.querySelector(':only-child');
|
|
77
|
+
expect(component).toHaveClass('ams-breakout__cell--col-span-2 ams-breakout__cell--col-span-4-medium ams-breakout__cell--col-span-6-wide ams-breakout__cell--col-start-1 ams-breakout__cell--col-start-3-medium ams-breakout__cell--col-start-5-wide');
|
|
78
|
+
});
|
|
79
|
+
it('renders the correct class name for the “all” value of colSpan', () => {
|
|
80
|
+
const { container } = render(_jsx(Breakout.Cell, { colSpan: "all" }));
|
|
81
|
+
const component = container.querySelector(':only-child');
|
|
82
|
+
expect(component).toHaveClass('ams-breakout__cell--col-span-all');
|
|
83
|
+
});
|
|
84
|
+
it('renders class names for single number values for rowStart and rowSpan', () => {
|
|
85
|
+
const { container } = render(_jsx(Breakout.Cell, { rowSpan: 3, rowStart: 2 }));
|
|
86
|
+
const component = container.querySelector(':only-child');
|
|
87
|
+
expect(component).toHaveClass('ams-breakout__cell--row-span-3 ams-breakout__cell--row-start-2');
|
|
88
|
+
});
|
|
89
|
+
it('renders class names for a single number value for rowStart', () => {
|
|
90
|
+
const { container } = render(_jsx(Breakout.Cell, { rowStart: 4 }));
|
|
91
|
+
const component = container.querySelector(':only-child');
|
|
92
|
+
expect(component).toHaveClass('ams-breakout__cell--row-start-4');
|
|
93
|
+
});
|
|
94
|
+
it('renders class names for a single number value for rowSpan', () => {
|
|
95
|
+
const { container } = render(_jsx(Breakout.Cell, { rowSpan: 2 }));
|
|
96
|
+
const component = container.querySelector(':only-child');
|
|
97
|
+
expect(component).toHaveClass('ams-breakout__cell--row-span-2');
|
|
98
|
+
});
|
|
99
|
+
it('renders class names for a single number for rowSpan and an object for rowStart', () => {
|
|
100
|
+
const { container } = render(_jsx(Breakout.Cell, { rowSpan: 3, rowStart: { narrow: 1, medium: 2, wide: 3 } }));
|
|
101
|
+
const component = container.querySelector(':only-child');
|
|
102
|
+
expect(component).toHaveClass('ams-breakout__cell--row-span-3 ams-breakout__cell--row-start-1 ams-breakout__cell--row-start-2-medium ams-breakout__cell--row-start-3-wide');
|
|
103
|
+
});
|
|
104
|
+
it('renders class names for an object for rowSpan and a single number for rowStart', () => {
|
|
105
|
+
const { container } = render(_jsx(Breakout.Cell, { rowSpan: { narrow: 2, medium: 3, wide: 4 }, rowStart: 1 }));
|
|
106
|
+
const component = container.querySelector(':only-child');
|
|
107
|
+
expect(component).toHaveClass('ams-breakout__cell--row-span-2 ams-breakout__cell--row-span-3-medium ams-breakout__cell--row-span-4-wide ams-breakout__cell--row-start-1');
|
|
108
|
+
});
|
|
109
|
+
it('renders class names for an object for both rowSpan and rowStart', () => {
|
|
110
|
+
const { container } = render(_jsx(Breakout.Cell, { rowSpan: { narrow: 2, medium: 3, wide: 4 }, rowStart: { narrow: 1, medium: 2, wide: 3 } }));
|
|
111
|
+
const component = container.querySelector(':only-child');
|
|
112
|
+
expect(component).toHaveClass('ams-breakout__cell--row-span-2 ams-breakout__cell--row-span-3-medium ams-breakout__cell--row-span-4-wide ams-breakout__cell--row-start-1 ams-breakout__cell--row-start-2-medium ams-breakout__cell--row-start-3-wide');
|
|
113
|
+
});
|
|
114
|
+
it(`renders the correct class if it has a Figure`, () => {
|
|
115
|
+
const { container } = render(_jsx(Breakout.Cell, { has: "figure" }));
|
|
116
|
+
const component = container.querySelector(':only-child');
|
|
117
|
+
expect(component).toHaveClass(`ams-breakout__cell--has-figure`);
|
|
118
|
+
});
|
|
119
|
+
it(`renders the correct class if it has a Spotlight`, () => {
|
|
120
|
+
const { container } = render(_jsx(Breakout.Cell, { colSpan: "all", has: "spotlight" }));
|
|
121
|
+
const component = container.querySelector(':only-child');
|
|
122
|
+
expect(component).toHaveClass(`ams-breakout__cell--has-spotlight`);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { BreakoutCellProps } from './BreakoutCell';
|
|
6
|
+
export declare const breakoutCellClasses: (colSpan?: BreakoutCellProps["colSpan"], colStart?: BreakoutCellProps["colStart"], rowSpan?: BreakoutCellProps["rowSpan"], rowStart?: BreakoutCellProps["rowStart"]) => string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import { addGridClass } from '../Grid/gridCellClasses';
|
|
6
|
+
export const breakoutCellClasses = (colSpan, colStart, rowSpan, rowStart) => [
|
|
7
|
+
...addGridClass('ams-breakout__cell--col-span-', colSpan),
|
|
8
|
+
...addGridClass('ams-breakout__cell--col-start-', colStart),
|
|
9
|
+
...addGridClass('ams-breakout__cell--row-span-', rowSpan),
|
|
10
|
+
...addGridClass('ams-breakout__cell--row-start-', rowStart),
|
|
11
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Breakout } from './Breakout';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
import type { ButtonHTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
+
import type { IconProps } from '../Icon';
|
|
7
|
+
type IconBeforeProp = {
|
|
8
|
+
/** Shows the icon before the label. Requires a value for `icon`. Cannot be used together with `iconOnly`. */
|
|
9
|
+
iconBefore?: boolean;
|
|
10
|
+
iconOnly?: never;
|
|
11
|
+
};
|
|
12
|
+
type IconOnlyProp = {
|
|
13
|
+
iconBefore?: never;
|
|
14
|
+
/** Shows the icon without the label. Requires a value for `icon`. Cannot be used together with `iconBefore`. */
|
|
15
|
+
iconOnly?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type IconButtonProps = {
|
|
18
|
+
/** Adds an icon to the button, showing it after the label. */
|
|
19
|
+
icon: IconProps['svg'];
|
|
20
|
+
} & (IconBeforeProp | IconOnlyProp);
|
|
21
|
+
type TextButtonProps = {
|
|
22
|
+
icon?: never;
|
|
23
|
+
iconBefore?: never;
|
|
24
|
+
iconOnly?: never;
|
|
25
|
+
};
|
|
26
|
+
export type ButtonProps = {
|
|
27
|
+
/** The level of prominence. Use a primary button only once per page or section. */
|
|
28
|
+
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
29
|
+
} & (IconButtonProps | TextButtonProps) & PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
30
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
export {};
|
|
@@ -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 { Icon } from '../Icon';
|
|
9
|
+
export const Button = forwardRef(({ children, className, disabled, icon, iconBefore, iconOnly, type, variant = 'primary', ...restProps }, ref) => (_jsxs("button", { ...restProps, className: clsx('ams-button', `ams-button--${variant}`, icon && iconOnly && `ams-button--icon-only`, className), disabled: disabled, ref: ref, type: type || 'button', children: [icon && (iconBefore || iconOnly) && _jsx(Icon, { square: iconOnly, svg: icon }), icon && iconOnly ? _jsx("span", { className: "ams-visually-hidden", children: children }) : children, icon && !iconBefore && !iconOnly && _jsx(Icon, { svg: icon })] })));
|
|
10
|
+
Button.displayName = 'Button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|