@navikt/ds-react 0.7.7 → 0.8.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/cjs/accordion/Accordion.js +10 -26
- package/cjs/accordion/AccordionContent.js +60 -0
- package/cjs/accordion/AccordionHeader.js +66 -0
- package/cjs/accordion/AccordionItem.js +62 -0
- package/cjs/accordion/index.js +6 -2
- package/cjs/accordion-menu/AccordionMenu.js +5 -1
- package/cjs/accordion-menu/AccordionMenuCollapsable.js +3 -3
- package/cjs/accordion-menu/AccordionMenuItem.js +4 -4
- package/cjs/accordion-menu/index.js +5 -5
- package/cjs/alert/Alert.js +18 -12
- package/cjs/alert/AlertContent.js +50 -0
- package/cjs/alert/AlertTitle.js +49 -0
- package/cjs/alert/index.js +6 -2
- package/cjs/button/Button.js +5 -3
- package/cjs/button/index.js +6 -2
- package/cjs/card/MicroCard.js +3 -3
- package/cjs/card/index.js +6 -2
- package/cjs/copy-to-clipboard/CopyToClipboard.js +9 -8
- package/cjs/copy-to-clipboard/index.js +6 -2
- package/cjs/form/ConfirmationPanel.js +2 -2
- package/cjs/form/ErrorMessage.js +1 -1
- package/cjs/form/Fieldset/Fieldset.js +2 -2
- package/cjs/form/Fieldset/index.js +5 -1
- package/cjs/form/Fieldset/useFieldset.js +2 -1
- package/cjs/form/Select.js +3 -3
- package/cjs/form/TextField.js +2 -2
- package/cjs/form/Textarea.js +5 -4
- package/cjs/form/checkbox/Checkbox.js +2 -2
- package/cjs/form/checkbox/CheckboxGroup.js +2 -2
- package/cjs/form/checkbox/index.js +6 -2
- package/cjs/form/checkbox/useCheckbox.js +2 -1
- package/cjs/form/error-summary/ErrorSummary.js +4 -4
- package/cjs/form/error-summary/ErrorSummaryItem.js +2 -2
- package/cjs/form/error-summary/index.js +6 -2
- package/cjs/form/index.js +9 -5
- package/cjs/form/radio/Radio.js +2 -2
- package/cjs/form/radio/RadioGroup.js +2 -2
- package/cjs/form/radio/index.js +6 -2
- package/cjs/form/radio/useRadio.js +2 -1
- package/cjs/form/search-field/SearchField.js +3 -3
- package/cjs/form/search-field/SearchFieldButton.js +2 -2
- package/cjs/form/search-field/SearchFieldClearButton.js +3 -3
- package/cjs/form/search-field/SearchFieldInput.js +2 -2
- package/cjs/form/search-field/index.js +8 -4
- package/cjs/form/useFormField.js +3 -2
- package/cjs/grid/Cell.js +1 -1
- package/cjs/{content-container → grid}/ContentContainer.js +3 -3
- package/cjs/grid/Grid.js +1 -1
- package/cjs/grid/index.js +10 -3
- package/cjs/guide-panel/Guide.js +44 -0
- package/cjs/guide-panel/GuidePanel.js +47 -0
- package/cjs/guide-panel/Illustration.js +24 -0
- package/cjs/guide-panel/index.js +19 -0
- package/cjs/guide-panel/package.json +6 -0
- package/cjs/help-text/HelpText.js +64 -0
- package/cjs/help-text/index.js +19 -0
- package/cjs/help-text/package.json +6 -0
- package/cjs/index.js +6 -4
- package/cjs/internal-header/InternalHeader.js +1 -1
- package/cjs/internal-header/InternalHeaderTitle.js +1 -1
- package/cjs/internal-header/InternalHeaderUser.js +1 -1
- package/cjs/internal-header/index.js +8 -4
- package/cjs/link/Link.js +3 -3
- package/cjs/link/index.js +6 -2
- package/cjs/link-panel/LinkPanel.js +10 -10
- package/cjs/link-panel/LinkPanelDescription.js +43 -0
- package/cjs/link-panel/LinkPanelTitle.js +42 -0
- package/cjs/link-panel/index.js +6 -2
- package/cjs/loader/Loader.js +4 -7
- package/cjs/loader/index.js +6 -2
- package/cjs/modal/Modal.js +6 -4
- package/cjs/modal/ModalContent.js +42 -0
- package/cjs/modal/index.js +6 -2
- package/cjs/{header/Header.js → page-header/PageHeader.js} +10 -9
- package/cjs/page-header/index.js +19 -0
- package/cjs/page-header/package.json +6 -0
- package/cjs/panel/Panel.js +2 -2
- package/cjs/panel/index.js +6 -2
- package/cjs/popover/Popover.js +13 -4
- package/cjs/popover/PopoverContent.js +42 -0
- package/cjs/popover/index.js +6 -2
- package/cjs/speech-bubble/Bubble.js +1 -1
- package/cjs/speech-bubble/SpeechBubble.js +1 -1
- package/cjs/speech-bubble/index.js +7 -3
- package/cjs/tag/Tag.js +5 -3
- package/cjs/tag/index.js +6 -2
- package/cjs/typography/BodyLong.js +3 -3
- package/cjs/typography/BodyShort.js +3 -3
- package/cjs/typography/Detail.js +3 -3
- package/cjs/typography/{Title.js → Heading.js} +8 -8
- package/cjs/typography/Ingress.js +2 -2
- package/cjs/typography/Label.js +3 -3
- package/cjs/typography/index.js +11 -7
- package/cjs/util/index.js +3 -2
- package/cjs/util/useId.js +5 -4
- package/esm/accordion/Accordion.d.ts +11 -22
- package/esm/accordion/Accordion.js +9 -25
- package/esm/accordion/Accordion.js.map +1 -1
- package/esm/accordion/AccordionContent.d.ts +10 -0
- package/esm/accordion/AccordionContent.js +37 -0
- package/esm/accordion/AccordionContent.js.map +1 -0
- package/esm/accordion/AccordionHeader.d.ts +10 -0
- package/esm/accordion/AccordionHeader.js +43 -0
- package/esm/accordion/AccordionHeader.js.map +1 -0
- package/esm/accordion/AccordionItem.d.ts +35 -0
- package/esm/accordion/AccordionItem.js +38 -0
- package/esm/accordion/AccordionItem.js.map +1 -0
- package/esm/accordion-menu/AccordionMenu.d.ts +9 -3
- package/esm/accordion-menu/AccordionMenu.js +4 -0
- package/esm/accordion-menu/AccordionMenu.js.map +1 -1
- package/esm/accordion-menu/AccordionMenuCollapsable.d.ts +3 -2
- package/esm/accordion-menu/AccordionMenuCollapsable.js +2 -2
- package/esm/accordion-menu/AccordionMenuCollapsable.js.map +1 -1
- package/esm/accordion-menu/AccordionMenuItem.d.ts +11 -10
- package/esm/accordion-menu/AccordionMenuItem.js +3 -3
- package/esm/accordion-menu/AccordionMenuItem.js.map +1 -1
- package/esm/accordion-menu/index.d.ts +3 -3
- package/esm/accordion-menu/index.js +0 -2
- package/esm/accordion-menu/index.js.map +1 -1
- package/esm/alert/Alert.d.ts +26 -4
- package/esm/alert/Alert.js +17 -12
- package/esm/alert/Alert.js.map +1 -1
- package/esm/alert/AlertContent.d.ts +10 -0
- package/esm/alert/AlertContent.js +27 -0
- package/esm/alert/AlertContent.js.map +1 -0
- package/esm/alert/AlertTitle.d.ts +10 -0
- package/esm/alert/AlertTitle.js +26 -0
- package/esm/alert/AlertTitle.js.map +1 -0
- package/esm/button/Button.d.ts +5 -4
- package/esm/button/Button.js +4 -2
- package/esm/button/Button.js.map +1 -1
- package/esm/card/MicroCard.d.ts +7 -7
- package/esm/card/MicroCard.js +2 -2
- package/esm/card/MicroCard.js.map +1 -1
- package/esm/copy-to-clipboard/CopyToClipboard.d.ts +9 -7
- package/esm/copy-to-clipboard/CopyToClipboard.js +10 -9
- package/esm/copy-to-clipboard/CopyToClipboard.js.map +1 -1
- package/esm/form/ConfirmationPanel.js +1 -1
- package/esm/form/ConfirmationPanel.js.map +1 -1
- package/esm/form/ErrorMessage.d.ts +1 -0
- package/esm/form/ErrorMessage.js +1 -1
- package/esm/form/ErrorMessage.js.map +1 -1
- package/esm/form/Fieldset/Fieldset.d.ts +1 -1
- package/esm/form/Fieldset/Fieldset.js +1 -1
- package/esm/form/Fieldset/Fieldset.js.map +1 -1
- package/esm/form/Fieldset/useFieldset.d.ts +1 -1
- package/esm/form/Select.js +2 -2
- package/esm/form/Select.js.map +1 -1
- package/esm/form/TextField.js +1 -1
- package/esm/form/TextField.js.map +1 -1
- package/esm/form/Textarea.js +2 -2
- package/esm/form/Textarea.js.map +1 -1
- package/esm/form/checkbox/Checkbox.js +1 -1
- package/esm/form/checkbox/Checkbox.js.map +1 -1
- package/esm/form/checkbox/CheckboxGroup.js +1 -1
- package/esm/form/checkbox/CheckboxGroup.js.map +1 -1
- package/esm/form/checkbox/useCheckbox.d.ts +1 -1
- package/esm/form/checkbox/useCheckbox.js +2 -1
- package/esm/form/checkbox/useCheckbox.js.map +1 -1
- package/esm/form/error-summary/ErrorSummary.d.ts +2 -2
- package/esm/form/error-summary/ErrorSummary.js +4 -4
- package/esm/form/error-summary/ErrorSummary.js.map +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.d.ts +6 -9
- package/esm/form/error-summary/ErrorSummaryItem.js +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.js.map +1 -1
- package/esm/form/radio/Radio.js +1 -1
- package/esm/form/radio/Radio.js.map +1 -1
- package/esm/form/radio/RadioGroup.js +1 -1
- package/esm/form/radio/RadioGroup.js.map +1 -1
- package/esm/form/radio/useRadio.d.ts +1 -1
- package/esm/form/radio/useRadio.js.map +1 -1
- package/esm/form/search-field/SearchField.d.ts +1 -1
- package/esm/form/search-field/SearchField.js +2 -2
- package/esm/form/search-field/SearchField.js.map +1 -1
- package/esm/form/search-field/SearchFieldButton.d.ts +2 -2
- package/esm/form/search-field/SearchFieldButton.js +1 -1
- package/esm/form/search-field/SearchFieldButton.js.map +1 -1
- package/esm/form/search-field/SearchFieldClearButton.d.ts +2 -2
- package/esm/form/search-field/SearchFieldClearButton.js +2 -2
- package/esm/form/search-field/SearchFieldClearButton.js.map +1 -1
- package/esm/form/search-field/SearchFieldInput.js +1 -1
- package/esm/form/search-field/SearchFieldInput.js.map +1 -1
- package/esm/form/useFormField.d.ts +2 -2
- package/esm/form/useFormField.js +1 -1
- package/esm/form/useFormField.js.map +1 -1
- package/esm/{content-container → grid}/ContentContainer.d.ts +1 -1
- package/esm/{content-container → grid}/ContentContainer.js +2 -2
- package/esm/grid/ContentContainer.js.map +1 -0
- package/esm/grid/index.d.ts +2 -0
- package/esm/grid/index.js +2 -0
- package/esm/grid/index.js.map +1 -1
- package/esm/guide-panel/Guide.d.ts +14 -0
- package/esm/guide-panel/Guide.js +21 -0
- package/esm/guide-panel/Guide.js.map +1 -0
- package/esm/guide-panel/GuidePanel.d.ts +18 -0
- package/esm/guide-panel/GuidePanel.js +24 -0
- package/esm/guide-panel/GuidePanel.js.map +1 -0
- package/esm/guide-panel/Illustration.d.ts +2 -0
- package/esm/guide-panel/Illustration.js +18 -0
- package/esm/guide-panel/Illustration.js.map +1 -0
- package/esm/guide-panel/index.d.ts +3 -0
- package/esm/guide-panel/index.js +3 -0
- package/esm/guide-panel/index.js.map +1 -0
- package/esm/help-text/HelpText.d.ts +15 -0
- package/esm/help-text/HelpText.js +41 -0
- package/esm/help-text/HelpText.js.map +1 -0
- package/esm/help-text/index.d.ts +2 -0
- package/esm/help-text/index.js +3 -0
- package/esm/help-text/index.js.map +1 -0
- package/esm/index.d.ts +4 -3
- package/esm/index.js +5 -3
- package/esm/index.js.map +1 -1
- package/esm/link/Link.d.ts +2 -1
- package/esm/link/Link.js +2 -2
- package/esm/link/Link.js.map +1 -1
- package/esm/link-panel/LinkPanel.d.ts +16 -21
- package/esm/link-panel/LinkPanel.js +9 -8
- package/esm/link-panel/LinkPanel.js.map +1 -1
- package/esm/link-panel/LinkPanelDescription.d.ts +7 -0
- package/esm/link-panel/LinkPanelDescription.js +19 -0
- package/esm/link-panel/LinkPanelDescription.js.map +1 -0
- package/esm/link-panel/LinkPanelTitle.d.ts +8 -0
- package/esm/link-panel/LinkPanelTitle.js +18 -0
- package/esm/link-panel/LinkPanelTitle.js.map +1 -0
- package/esm/loader/Loader.d.ts +3 -3
- package/esm/loader/Loader.js +3 -6
- package/esm/loader/Loader.js.map +1 -1
- package/esm/modal/Modal.d.ts +6 -6
- package/esm/modal/Modal.js +5 -3
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/ModalContent.d.ts +10 -0
- package/esm/modal/ModalContent.js +19 -0
- package/esm/modal/ModalContent.js.map +1 -0
- package/esm/modal/index.d.ts +1 -0
- package/esm/modal/index.js.map +1 -1
- package/esm/page-header/PageHeader.d.ts +27 -0
- package/esm/page-header/PageHeader.js +24 -0
- package/esm/page-header/PageHeader.js.map +1 -0
- package/esm/page-header/index.d.ts +2 -0
- package/esm/page-header/index.js +3 -0
- package/esm/page-header/index.js.map +1 -0
- package/esm/panel/Panel.d.ts +12 -15
- package/esm/panel/Panel.js +1 -1
- package/esm/panel/Panel.js.map +1 -1
- package/esm/popover/Popover.d.ts +13 -8
- package/esm/popover/Popover.js +12 -3
- package/esm/popover/Popover.js.map +1 -1
- package/esm/popover/PopoverContent.d.ts +10 -0
- package/esm/popover/PopoverContent.js +19 -0
- package/esm/popover/PopoverContent.js.map +1 -0
- package/esm/popover/index.d.ts +1 -0
- package/esm/speech-bubble/Bubble.d.ts +1 -1
- package/esm/tag/Tag.d.ts +7 -1
- package/esm/tag/Tag.js +4 -2
- package/esm/tag/Tag.js.map +1 -1
- package/esm/typography/BodyLong.d.ts +16 -19
- package/esm/typography/BodyLong.js +2 -2
- package/esm/typography/BodyLong.js.map +1 -1
- package/esm/typography/BodyShort.d.ts +16 -19
- package/esm/typography/BodyShort.js +2 -2
- package/esm/typography/BodyShort.js.map +1 -1
- package/esm/typography/Detail.d.ts +16 -19
- package/esm/typography/Detail.js +2 -2
- package/esm/typography/Detail.js.map +1 -1
- package/esm/typography/Heading.d.ts +24 -0
- package/esm/typography/{Title.js → Heading.js} +8 -8
- package/esm/typography/Heading.js.map +1 -0
- package/esm/typography/Ingress.d.ts +11 -14
- package/esm/typography/Ingress.js +1 -1
- package/esm/typography/Ingress.js.map +1 -1
- package/esm/typography/Label.d.ts +16 -19
- package/esm/typography/Label.js +2 -2
- package/esm/typography/Label.js.map +1 -1
- package/esm/typography/index.d.ts +1 -1
- package/esm/typography/index.js +1 -1
- package/esm/typography/index.js.map +1 -1
- package/esm/util/OverridableComponent.d.ts +6 -25
- package/esm/util/OverridableComponent.js +1 -0
- package/esm/util/useId.d.ts +2 -0
- package/esm/util/useId.js +1 -1
- package/esm/util/useId.js.map +1 -1
- package/package.json +6 -3
- package/src/accordion/Accordion.tsx +23 -98
- package/src/accordion/AccordionContent.tsx +59 -0
- package/src/accordion/AccordionHeader.tsx +84 -0
- package/src/accordion/AccordionItem.tsx +93 -0
- package/src/accordion/stories/accordion.stories.mdx +55 -16
- package/src/accordion/stories/accordion.stories.tsx +76 -43
- package/src/accordion-menu/AccordionMenu.tsx +18 -3
- package/src/accordion-menu/AccordionMenuCollapsable.tsx +32 -29
- package/src/accordion-menu/AccordionMenuItem.tsx +17 -18
- package/src/accordion-menu/index.ts +3 -6
- package/src/accordion-menu/stories/accordion-menu.stories.mdx +34 -38
- package/src/accordion-menu/stories/accordion-menu.stories.tsx +60 -79
- package/src/alert/Alert.tsx +66 -43
- package/src/alert/AlertContent.tsx +41 -0
- package/src/alert/AlertTitle.tsx +41 -0
- package/src/alert/stories/alert.stories.mdx +48 -7
- package/src/alert/stories/alert.stories.tsx +95 -11
- package/src/button/Button.tsx +24 -11
- package/src/button/stories/button.stories.mdx +13 -14
- package/src/button/stories/button.stories.tsx +18 -14
- package/src/card/MicroCard.tsx +25 -23
- package/src/copy-to-clipboard/CopyToClipboard.tsx +34 -30
- package/src/copy-to-clipboard/stories/copy-to-clipboard.stories.tsx +9 -10
- package/src/copy-to-clipboard/stories/copy.stories.mdx +24 -14
- package/src/form/ConfirmationPanel.tsx +1 -1
- package/src/form/ErrorMessage.tsx +2 -2
- package/src/form/Fieldset/Fieldset.tsx +2 -2
- package/src/form/Select.tsx +2 -2
- package/src/form/TextField.tsx +1 -1
- package/src/form/Textarea.tsx +2 -2
- package/src/form/checkbox/Checkbox.tsx +1 -1
- package/src/form/checkbox/CheckboxGroup.tsx +1 -1
- package/src/form/checkbox/stories/checkbox.stories.mdx +7 -3
- package/src/form/checkbox/stories/checkbox.stories.tsx +1 -1
- package/src/form/error-summary/ErrorSummary.tsx +18 -17
- package/src/form/error-summary/ErrorSummaryItem.tsx +11 -11
- package/src/form/error-summary/stories/error-summary.stories.tsx +2 -2
- package/src/form/radio/Radio.tsx +1 -1
- package/src/form/radio/RadioGroup.tsx +1 -1
- package/src/form/radio/stories/radio.stories.mdx +11 -3
- package/src/form/radio/stories/radio.stories.tsx +1 -1
- package/src/form/search-field/SearchField.tsx +3 -3
- package/src/form/search-field/SearchFieldButton.tsx +3 -3
- package/src/form/search-field/SearchFieldClearButton.tsx +5 -5
- package/src/form/search-field/SearchFieldInput.tsx +3 -2
- package/src/form/search-field/stories/search-field-example.tsx +9 -10
- package/src/form/search-field/stories/search-field.stories.mdx +23 -68
- package/src/form/search-field/stories/search-field.stories.tsx +48 -15
- package/src/form/stories/confirmation-panel.stories.mdx +2 -2
- package/src/form/stories/confirmation-panel.stories.tsx +3 -3
- package/src/form/stories/fieldset.stories.mdx +2 -2
- package/src/form/stories/fieldset.stories.tsx +1 -1
- package/src/form/stories/live-examples.tsx +2 -2
- package/src/form/stories/select.stories.mdx +2 -2
- package/src/form/stories/select.stories.tsx +1 -1
- package/src/form/stories/text-field.stories.mdx +2 -2
- package/src/form/stories/text-field.stories.tsx +1 -1
- package/src/form/stories/textarea.stories.mdx +2 -2
- package/src/form/stories/textarea.stories.tsx +1 -1
- package/src/form/useFormField.ts +2 -2
- package/src/{content-container → grid}/ContentContainer.tsx +3 -5
- package/src/grid/index.ts +2 -0
- package/src/grid/stories/grid.stories.mdx +24 -5
- package/src/grid/stories/grid.stories.tsx +10 -2
- package/src/grid/stories/styles.css +16 -0
- package/src/guide-panel/Guide.tsx +34 -0
- package/src/guide-panel/GuidePanel.tsx +39 -0
- package/src/guide-panel/Illustration.tsx +99 -0
- package/src/guide-panel/index.ts +3 -0
- package/src/guide-panel/stories/example.css +13 -0
- package/src/guide-panel/stories/guidepanel.stories.mdx +81 -0
- package/src/guide-panel/stories/guidepanel.stories.tsx +68 -0
- package/src/help-text/HelpText.tsx +78 -0
- package/src/help-text/index.ts +2 -0
- package/src/help-text/stories/help-text.stories.mdx +35 -0
- package/src/help-text/stories/help-text.stories.tsx +32 -0
- package/src/index.ts +6 -3
- package/src/link/Link.tsx +7 -14
- package/src/link/stories/link.stories.tsx +1 -1
- package/src/link-panel/LinkPanel.tsx +32 -44
- package/src/link-panel/LinkPanelDescription.tsx +23 -0
- package/src/link-panel/LinkPanelTitle.tsx +27 -0
- package/src/link-panel/stories/link-panel.stories.mdx +52 -23
- package/src/link-panel/stories/link-panel.stories.tsx +43 -34
- package/src/loader/Loader.tsx +13 -10
- package/src/loader/stories/loader.stories.mdx +27 -28
- package/src/loader/stories/loader.stories.tsx +31 -91
- package/src/modal/Modal.tsx +16 -14
- package/src/modal/ModalContent.tsx +26 -0
- package/src/modal/index.ts +1 -0
- package/src/modal/stories/modal.stories.mdx +10 -1
- package/src/modal/stories/modal.stories.tsx +20 -16
- package/src/page-header/PageHeader.tsx +76 -0
- package/src/page-header/index.ts +2 -0
- package/src/{header → page-header}/stories/header.stories.mdx +31 -24
- package/src/{header → page-header}/stories/header.stories.tsx +27 -27
- package/src/{header → page-header}/stories/pictogram.tsx +0 -0
- package/src/panel/Panel.tsx +14 -23
- package/src/popover/Popover.tsx +29 -11
- package/src/popover/PopoverContent.tsx +26 -0
- package/src/popover/index.ts +1 -0
- package/src/popover/stories/popover.stories.tsx +6 -8
- package/src/speech-bubble/Bubble.tsx +1 -1
- package/src/tag/Tag.tsx +18 -10
- package/src/tag/stories/tag.stories.mdx +24 -0
- package/src/tag/stories/tag.stories.tsx +13 -0
- package/src/typography/BodyLong.tsx +22 -21
- package/src/typography/BodyShort.tsx +22 -21
- package/src/typography/Detail.tsx +22 -21
- package/src/typography/Heading.tsx +45 -0
- package/src/typography/Ingress.tsx +23 -24
- package/src/typography/Label.tsx +21 -21
- package/src/typography/index.ts +1 -1
- package/src/typography/stories/typography.stories.tsx +18 -23
- package/src/util/OverridableComponent.ts +7 -44
- package/src/util/useId.ts +1 -1
- package/cjs/content-container/index.js +0 -15
- package/cjs/content-container/package.json +0 -6
- package/cjs/header/index.js +0 -15
- package/cjs/header/package.json +0 -6
- package/esm/content-container/ContentContainer.js.map +0 -1
- package/esm/content-container/index.d.ts +0 -2
- package/esm/content-container/index.js +0 -3
- package/esm/content-container/index.js.map +0 -1
- package/esm/header/Header.d.ts +0 -27
- package/esm/header/Header.js +0 -23
- package/esm/header/Header.js.map +0 -1
- package/esm/header/index.d.ts +0 -2
- package/esm/header/index.js +0 -3
- package/esm/header/index.js.map +0 -1
- package/esm/typography/Title.d.ts +0 -25
- package/esm/typography/Title.js.map +0 -1
- package/src/content-container/index.ts +0 -2
- package/src/content-container/stories/container.stories.mdx +0 -31
- package/src/content-container/stories/container.stories.tsx +0 -33
- package/src/content-container/stories/style.css +0 -15
- package/src/form/stories/error-uu.stories.tsx +0 -75
- package/src/header/Header.tsx +0 -69
- package/src/header/index.ts +0 -2
- package/src/loader/stories/demo.css +0 -18
- package/src/typography/Title.tsx +0 -56
package/esm/modal/Modal.js
CHANGED
|
@@ -15,8 +15,9 @@ import ReactModal from "react-modal";
|
|
|
15
15
|
import mergeRefs from "react-merge-refs";
|
|
16
16
|
import { Close } from "@navikt/ds-icons";
|
|
17
17
|
import { Button } from "..";
|
|
18
|
+
import ModalContent from "./ModalContent";
|
|
18
19
|
const Modal = forwardRef((_a, ref) => {
|
|
19
|
-
var { children, open,
|
|
20
|
+
var { children, open, onClose, className, shouldCloseOnOverlayClick = true } = _a, rest = __rest(_a, ["children", "open", "onClose", "className", "shouldCloseOnOverlayClick"]);
|
|
20
21
|
const modalRef = useRef(null);
|
|
21
22
|
const mergedRef = mergeRefs([modalRef, ref]);
|
|
22
23
|
const buttonRef = useRef(null);
|
|
@@ -29,12 +30,13 @@ const Modal = forwardRef((_a, ref) => {
|
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
return (React.createElement(ReactModal, Object.assign({}, rest, { isOpen: open, ref: mergedRef, className: cl("navds-modal", className), overlayClassName: "navds-modal__overlay", shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, onRequestClose: (e) => onModalCloseRequest(e) }),
|
|
32
|
-
|
|
33
|
+
children,
|
|
33
34
|
React.createElement(Button, { className: cl("navds-modal__button", {
|
|
34
35
|
"navds-modal__button--shake": shouldCloseOnOverlayClick,
|
|
35
|
-
}), size: "
|
|
36
|
+
}), size: "small", variant: "secondary", ref: buttonRef, "aria-label": "lukk modalvindu", onClick: onClose },
|
|
36
37
|
React.createElement(Close, { focusable: "false", role: "img", "aria-label": "X-ikon for \u00E5 lukke modal" }))));
|
|
37
38
|
});
|
|
38
39
|
Modal.setAppElement = (element) => ReactModal.setAppElement(element);
|
|
40
|
+
Modal.Content = ModalContent;
|
|
39
41
|
export default Modal;
|
|
40
42
|
//# sourceMappingURL=Modal.js.map
|
package/esm/modal/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,YAAkC,MAAM,gBAAgB,CAAC;AAsChE,MAAM,KAAK,GAAG,UAAU,CACtB,CACE,EAOC,EACD,GAAG,EACH,EAAE;QATF,EACE,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EACT,yBAAyB,GAAG,IAAI,OAEjC,EADI,IAAI,cANT,yEAOC,CADQ;IAIT,MAAM,QAAQ,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,SAAS,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alContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Modal.Content content
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare type ModalContentType = React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const ModalContent: ModalContentType;
|
|
10
|
+
export default ModalContent;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
13
|
+
import cl from "classnames";
|
|
14
|
+
const ModalContent = forwardRef((_a, ref) => {
|
|
15
|
+
var { className } = _a, rest = __rest(_a, ["className"]);
|
|
16
|
+
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cl("navds-modal__content", className) })));
|
|
17
|
+
});
|
|
18
|
+
export default ModalContent;
|
|
19
|
+
//# sourceMappingURL=ModalContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContent.js","sourceRoot":"","sources":["../../src/modal/ModalContent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAc5B,MAAM,YAAY,GAAqB,UAAU,CAC/C,CAAC,EAAsB,EAAE,GAAG,EAAE,EAAE;QAA/B,EAAE,SAAS,OAAW,EAAN,IAAI,cAApB,aAAsB,CAAF;IAAY,OAAA,CAC/B,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,IAChD,CACH,CAAA;CAAA,CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/esm/modal/index.d.ts
CHANGED
package/esm/modal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAE3C,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
export interface PageHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* PageHeader title
|
|
5
|
+
*/
|
|
6
|
+
children: string;
|
|
7
|
+
/**
|
|
8
|
+
* Pictogram placed in PageHeader
|
|
9
|
+
*/
|
|
10
|
+
illustration?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Short text placed under title
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Predefined variants for PageHeader
|
|
17
|
+
* @default "guide"
|
|
18
|
+
*/
|
|
19
|
+
variant?: "situation" | "product" | "guide";
|
|
20
|
+
/**
|
|
21
|
+
* Decides how to align content
|
|
22
|
+
* @default "left"
|
|
23
|
+
*/
|
|
24
|
+
align?: "left" | "center";
|
|
25
|
+
}
|
|
26
|
+
declare const PageHeader: React.ForwardRefExoticComponent<PageHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export default PageHeader;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
13
|
+
import cl from "classnames";
|
|
14
|
+
import { BodyShort, Heading } from "..";
|
|
15
|
+
const PageHeader = forwardRef((_a, ref) => {
|
|
16
|
+
var { children, className, illustration, description, variant = "guide", align = "left" } = _a, rest = __rest(_a, ["children", "className", "illustration", "description", "variant", "align"]);
|
|
17
|
+
return (React.createElement("div", Object.assign({ ref: ref, className: cl("navds-page-header", className, `navds-page-header--${variant}`, `navds-page-header--${align}`) }, rest),
|
|
18
|
+
illustration && (React.createElement("div", { className: "navds-page-header__illustration" }, illustration)),
|
|
19
|
+
React.createElement("div", { className: "navds-page-header__wrapper" },
|
|
20
|
+
React.createElement(Heading, { className: "navds-page-header__title", size: "2xlarge", level: "1" }, children),
|
|
21
|
+
description && (React.createElement(BodyShort, { className: "navds-page-header__description" }, description)))));
|
|
22
|
+
});
|
|
23
|
+
export default PageHeader;
|
|
24
|
+
//# sourceMappingURL=PageHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../src/page-header/PageHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AA2BxC,MAAM,UAAU,GAAG,UAAU,CAC3B,CACE,EAQC,EACD,GAAG,EACH,EAAE;QAVF,EACE,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,OAAO,GAAG,OAAO,EACjB,KAAK,GAAG,MAAM,OAEf,EADI,IAAI,cAPT,4EAQC,CADQ;IAIT,OAAO,CACL,2CACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,mBAAmB,EACnB,SAAS,EACT,sBAAsB,OAAO,EAAE,EAC/B,sBAAsB,KAAK,EAAE,CAC9B,IACG,IAAI;QAEP,YAAY,IAAI,CACf,6BAAK,SAAS,EAAC,iCAAiC,IAAE,YAAY,CAAO,CACtE;QACD,6BAAK,SAAS,EAAC,4BAA4B;YACzC,oBAAC,OAAO,IACN,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAC,SAAS,EACd,KAAK,EAAC,GAAG,IAER,QAAQ,CACD;YACT,WAAW,IAAI,CACd,oBAAC,SAAS,IAAC,SAAS,EAAC,gCAAgC,IAClD,WAAW,CACF,CACb,CACG,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,cAAc,cAAc,CAAC"}
|
package/esm/panel/Panel.d.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { OverridableComponent } from "
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
border?: boolean;
|
|
15
|
-
} & React.HTMLAttributes<HTMLElement>;
|
|
16
|
-
defaultComponent: "div";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface PanelProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Panel content
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Toggles border on panel
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
border?: boolean;
|
|
17
13
|
}
|
|
14
|
+
export declare type PanelType = OverridableComponent<PanelProps, HTMLElement>;
|
|
18
15
|
declare const Panel: PanelType;
|
|
19
16
|
export default Panel;
|
package/esm/panel/Panel.js
CHANGED
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React, { forwardRef } from "react";
|
|
13
13
|
import cl from "classnames";
|
|
14
14
|
const Panel = forwardRef((_a, ref) => {
|
|
15
|
-
var { children, className, border = false,
|
|
15
|
+
var { children, className, border = false, as: Component = "div" } = _a, rest = __rest(_a, ["children", "className", "border", "as"]);
|
|
16
16
|
return (React.createElement(Component, Object.assign({ ref: ref, className: cl("navds-panel", className, {
|
|
17
17
|
"navds-panel--border": border,
|
|
18
18
|
}) }, rest), children));
|
package/esm/panel/Panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.js","sourceRoot":"","sources":["../../src/panel/Panel.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Panel.js","sourceRoot":"","sources":["../../src/panel/Panel.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAiB5B,MAAM,KAAK,GAAc,UAAU,CACjC,CACE,EAAuE,EACvE,GAAG,EACH,EAAE;QAFF,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,EAAE,EAAE,EAAE,SAAS,GAAG,KAAK,OAAW,EAAN,IAAI,cAArE,yCAAuE,CAAF;IAGrE,OAAO,CACL,oBAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE;YACtC,qBAAqB,EAAE,MAAM;SAC9B,CAAC,IACE,IAAI,GAEP,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/esm/popover/Popover.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from "react";
|
|
2
1
|
import { Placement } from "@popperjs/core";
|
|
2
|
+
import React, { HTMLAttributes } from "react";
|
|
3
|
+
import { PopoverContentType } from "./PopoverContent";
|
|
3
4
|
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
5
|
/**
|
|
5
|
-
* Element
|
|
6
|
+
* Element popover anchors to
|
|
6
7
|
*/
|
|
7
8
|
anchorEl: HTMLElement | null;
|
|
8
9
|
/**
|
|
9
|
-
* Open state
|
|
10
|
+
* Open state
|
|
10
11
|
*/
|
|
11
12
|
open: boolean;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* onClose callback
|
|
14
15
|
*/
|
|
15
16
|
onClose: () => void;
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Popover content
|
|
18
19
|
*/
|
|
19
20
|
children: React.ReactNode;
|
|
20
21
|
/**
|
|
@@ -23,14 +24,18 @@ export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
23
24
|
*/
|
|
24
25
|
placement?: Placement;
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Toggles rendering of arrow
|
|
28
|
+
* @default true
|
|
27
29
|
*/
|
|
28
30
|
arrow?: boolean;
|
|
29
31
|
/**
|
|
30
32
|
* Distance from anchor to popover
|
|
31
|
-
* @default 16 w/arrow, 4
|
|
33
|
+
* @default 16 w/arrow, 4 w/no-arrow
|
|
32
34
|
*/
|
|
33
35
|
offset?: number;
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
interface PopoverComponent extends React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>> {
|
|
38
|
+
Content: PopoverContentType;
|
|
39
|
+
}
|
|
40
|
+
declare const Popover: PopoverComponent;
|
|
36
41
|
export default Popover;
|
package/esm/popover/Popover.js
CHANGED
|
@@ -9,10 +9,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
+
import cl from "classnames";
|
|
12
13
|
import React, { forwardRef, useCallback, useEffect, useRef, } from "react";
|
|
13
|
-
import { usePopper } from "react-popper";
|
|
14
14
|
import mergeRefs from "react-merge-refs";
|
|
15
|
-
import
|
|
15
|
+
import { usePopper } from "react-popper";
|
|
16
|
+
import { useClientLayoutEffect } from "..";
|
|
17
|
+
import PopoverContent from "./PopoverContent";
|
|
16
18
|
const useEventLister = (event, callback) => useEffect(() => {
|
|
17
19
|
document.addEventListener(event, callback);
|
|
18
20
|
return () => {
|
|
@@ -44,9 +46,15 @@ const Popover = forwardRef((_a, ref) => {
|
|
|
44
46
|
offset: [0, offset !== null && offset !== void 0 ? offset : (arrow ? 16 : 4)],
|
|
45
47
|
},
|
|
46
48
|
},
|
|
49
|
+
{
|
|
50
|
+
name: "arrow",
|
|
51
|
+
options: {
|
|
52
|
+
padding: 8,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
47
55
|
],
|
|
48
56
|
});
|
|
49
|
-
|
|
57
|
+
useClientLayoutEffect(() => {
|
|
50
58
|
open && update && update();
|
|
51
59
|
}, [open, update]);
|
|
52
60
|
return (React.createElement("div", Object.assign({ ref: mergedRef, className: cl("navds-popover", className, {
|
|
@@ -55,5 +63,6 @@ const Popover = forwardRef((_a, ref) => {
|
|
|
55
63
|
children,
|
|
56
64
|
arrow && (React.createElement("div", { "data-popper-arrow": true, style: styles.arrow, className: "navds-popover__arrow" }))));
|
|
57
65
|
});
|
|
66
|
+
Popover.Content = PopoverContent;
|
|
58
67
|
export default Popover;
|
|
59
68
|
//# sourceMappingURL=Popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../src/popover/Popover.tsx"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../src/popover/Popover.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EACZ,UAAU,EAEV,WAAW,EACX,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAC3C,OAAO,cAAsC,MAAM,kBAAkB,CAAC;AAoCtE,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,QAAQ,EAAE,EAAE,CACjD,SAAS,CAAC,GAAG,EAAE;IACb,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,GAAG,EAAE;QACV,QAAQ,CAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC,CAAC;AACJ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AASxB,MAAM,OAAO,GAAG,UA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,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PopoverContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Modal.Content content
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare type PopoverContentType = React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const PopoverContent: PopoverContentType;
|
|
10
|
+
export default PopoverContent;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
13
|
+
import cl from "classnames";
|
|
14
|
+
const PopoverContent = forwardRef((_a, ref) => {
|
|
15
|
+
var { className } = _a, rest = __rest(_a, ["className"]);
|
|
16
|
+
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cl("navds-popover__content", className) })));
|
|
17
|
+
});
|
|
18
|
+
export default PopoverContent;
|
|
19
|
+
//# sourceMappingURL=PopoverContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverContent.js","sourceRoot":"","sources":["../../src/popover/PopoverContent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAc5B,MAAM,cAAc,GAAuB,UAAU,CACnD,CAAC,EAAsB,EAAE,GAAG,EAAE,EAAE;QAA/B,EAAE,SAAS,OAAW,EAAN,IAAI,cAApB,aAAsB,CAAF;IAAY,OAAA,CAC/B,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,SAAS,CAAC,IAClD,CACH,CAAA;CAAA,CACF,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/esm/popover/index.d.ts
CHANGED
package/esm/tag/Tag.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from "react";
|
|
2
2
|
export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Tag
|
|
5
5
|
*/
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/**
|
|
8
8
|
* Changes background-color and border-color
|
|
9
|
+
*
|
|
9
10
|
*/
|
|
10
11
|
variant: "warning" | "error" | "info" | "success";
|
|
12
|
+
/**
|
|
13
|
+
* Changes sizing of tag
|
|
14
|
+
* @default "medium"
|
|
15
|
+
*/
|
|
16
|
+
size?: "medium" | "small";
|
|
11
17
|
}
|
|
12
18
|
declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>>;
|
|
13
19
|
export default Tag;
|
package/esm/tag/Tag.js
CHANGED
|
@@ -11,9 +11,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef } from "react";
|
|
13
13
|
import cl from "classnames";
|
|
14
|
+
import { BodyShort, Detail } from "..";
|
|
14
15
|
const Tag = forwardRef((_a, ref) => {
|
|
15
|
-
var {
|
|
16
|
-
|
|
16
|
+
var { className, variant, size = "medium" } = _a, rest = __rest(_a, ["className", "variant", "size"]);
|
|
17
|
+
const Component = size === "medium" ? BodyShort : Detail;
|
|
18
|
+
return (React.createElement(Component, Object.assign({}, rest, { ref: ref, as: "span", size: size, className: cl("navds-tag", className, `navds-tag--${variant}`, `navds-tag--${size}`) })));
|
|
17
19
|
});
|
|
18
20
|
export default Tag;
|
|
19
21
|
//# sourceMappingURL=Tag.js.map
|
package/esm/tag/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/tag/Tag.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/tag/Tag.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAmBvC,MAAM,GAAG,GAAG,UAAU,CACpB,CAAC,EAAgD,EAAE,GAAG,EAAE,EAAE;QAAzD,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,GAAG,QAAQ,OAAW,EAAN,IAAI,cAA9C,gCAAgD,CAAF;IAC7C,MAAM,SAAS,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IAEzD,OAAO,CACL,oBAAC,SAAS,oBACJ,IAAI,IACR,GAAG,EAAE,GAAG,EACR,EAAE,EAAC,MAAM,EACT,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,WAAW,EACX,SAAS,EACT,cAAc,OAAO,EAAE,EACvB,cAAc,IAAI,EAAE,CACrB,IACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { OverridableComponent } from "
|
|
3
|
-
export interface BodyLongProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
spacing?: boolean;
|
|
18
|
-
} & React.HTMLAttributes<HTMLParagraphElement>;
|
|
19
|
-
defaultComponent: "p";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface BodyLongProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/**
|
|
5
|
+
* medium: 18px, small: 16px
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: "medium" | "small";
|
|
9
|
+
/**
|
|
10
|
+
* Paragraph text
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Adds margins to typo
|
|
15
|
+
*/
|
|
16
|
+
spacing?: boolean;
|
|
20
17
|
}
|
|
21
|
-
declare const BodyLong: OverridableComponent<BodyLongProps>;
|
|
18
|
+
declare const BodyLong: OverridableComponent<BodyLongProps, HTMLParagraphElement>;
|
|
22
19
|
export default BodyLong;
|
|
@@ -12,9 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React, { forwardRef } from "react";
|
|
13
13
|
import cl from "classnames";
|
|
14
14
|
const BodyLong = forwardRef((_a, ref) => {
|
|
15
|
-
var { className, size = "
|
|
15
|
+
var { className, size = "medium", spacing, as: Component = "p" } = _a, rest = __rest(_a, ["className", "size", "spacing", "as"]);
|
|
16
16
|
return (React.createElement(Component, Object.assign({}, rest, { ref: ref, className: cl(className, "navds-body-long", {
|
|
17
|
-
"navds-body--
|
|
17
|
+
"navds-body-long--small": size === "small",
|
|
18
18
|
"navds-typo--spacing": !!spacing,
|
|
19
19
|
}) })));
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyLong.js","sourceRoot":"","sources":["../../src/typography/BodyLong.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"BodyLong.js","sourceRoot":"","sources":["../../src/typography/BodyLong.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAoB5B,MAAM,QAAQ,GAGV,UAAU,CACZ,CACE,EAAqE,EACrE,GAAG,EACH,EAAE;QAFF,EAAE,SAAS,EAAE,IAAI,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,GAAG,GAAG,OAAW,EAAN,IAAI,cAAnE,sCAAqE,CAAF;IAEhE,OAAA,CACH,oBAAC,SAAS,oBACJ,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,iBAAiB,EAAE;YAC1C,wBAAwB,EAAE,IAAI,KAAK,OAAO;YAC1C,qBAAqB,EAAE,CAAC,CAAC,OAAO;SACjC,CAAC,IACF,CACH,CAAA;CAAA,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { OverridableComponent } from "
|
|
3
|
-
export interface BodyShortProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
spacing?: boolean;
|
|
18
|
-
} & React.HTMLAttributes<HTMLParagraphElement>;
|
|
19
|
-
defaultComponent: "p";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface BodyShortProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/**
|
|
5
|
+
* medium: 18px, small: 16px
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: "medium" | "small";
|
|
9
|
+
/**
|
|
10
|
+
* Paragraph text
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Adds margins to typo
|
|
15
|
+
*/
|
|
16
|
+
spacing?: boolean;
|
|
20
17
|
}
|
|
21
|
-
declare const BodyShort: OverridableComponent<BodyShortProps>;
|
|
18
|
+
declare const BodyShort: OverridableComponent<BodyShortProps, HTMLParagraphElement>;
|
|
22
19
|
export default BodyShort;
|