@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { Meta } from "@storybook/react/types-6-0";
|
|
3
3
|
import { Close, Search } from "@navikt/ds-icons";
|
|
4
4
|
import {
|
|
@@ -14,6 +14,7 @@ export default {
|
|
|
14
14
|
} as Meta;
|
|
15
15
|
|
|
16
16
|
export const All = () => {
|
|
17
|
+
const [show, setShow] = useState(false);
|
|
17
18
|
return (
|
|
18
19
|
<>
|
|
19
20
|
<h1>SearchField</h1>
|
|
@@ -23,7 +24,7 @@ export const All = () => {
|
|
|
23
24
|
>
|
|
24
25
|
<SearchFieldInput />
|
|
25
26
|
<SearchFieldButton>
|
|
26
|
-
<Search />
|
|
27
|
+
<Search /> Søk
|
|
27
28
|
</SearchFieldButton>
|
|
28
29
|
</SearchField>
|
|
29
30
|
<SearchField
|
|
@@ -31,7 +32,7 @@ export const All = () => {
|
|
|
31
32
|
description="Ea cupidatat eu sunt commodo"
|
|
32
33
|
>
|
|
33
34
|
<SearchFieldButton>
|
|
34
|
-
<Search />
|
|
35
|
+
<Search /> Søk
|
|
35
36
|
</SearchFieldButton>
|
|
36
37
|
<SearchFieldInput />
|
|
37
38
|
</SearchField>
|
|
@@ -41,9 +42,12 @@ export const All = () => {
|
|
|
41
42
|
label="Mollit eiusmod"
|
|
42
43
|
description="Ea cupidatat eu sunt commodo"
|
|
43
44
|
>
|
|
44
|
-
<SearchFieldInput
|
|
45
|
-
<
|
|
46
|
-
<
|
|
45
|
+
<SearchFieldInput />
|
|
46
|
+
<SearchFieldClearButton>
|
|
47
|
+
<Close />
|
|
48
|
+
</SearchFieldClearButton>
|
|
49
|
+
<SearchFieldButton onClick={() => setShow(!show)}>
|
|
50
|
+
<Search /> Søk
|
|
47
51
|
</SearchFieldButton>
|
|
48
52
|
</SearchField>
|
|
49
53
|
<SearchField
|
|
@@ -51,10 +55,10 @@ export const All = () => {
|
|
|
51
55
|
description="Ea cupidatat eu sunt commodo"
|
|
52
56
|
>
|
|
53
57
|
<SearchFieldButton>
|
|
54
|
-
<Search />
|
|
58
|
+
<Search /> Søk
|
|
55
59
|
</SearchFieldButton>
|
|
56
60
|
<SearchFieldClearButton>
|
|
57
|
-
<Close />
|
|
61
|
+
<Close /> Tøm
|
|
58
62
|
</SearchFieldClearButton>
|
|
59
63
|
<SearchFieldInput />
|
|
60
64
|
</SearchField>
|
|
@@ -66,7 +70,7 @@ export const All = () => {
|
|
|
66
70
|
hideLabel
|
|
67
71
|
>
|
|
68
72
|
<SearchFieldButton>
|
|
69
|
-
<Search />
|
|
73
|
+
<Search /> Søk
|
|
70
74
|
</SearchFieldButton>
|
|
71
75
|
<SearchFieldInput />
|
|
72
76
|
</SearchField>
|
|
@@ -75,7 +79,7 @@ export const All = () => {
|
|
|
75
79
|
<SearchField
|
|
76
80
|
label="Mollit eiusmod"
|
|
77
81
|
description="Ea cupidatat eu sunt commodo"
|
|
78
|
-
size="
|
|
82
|
+
size="small"
|
|
79
83
|
>
|
|
80
84
|
<SearchFieldButton>
|
|
81
85
|
<Search />
|
|
@@ -87,7 +91,7 @@ export const All = () => {
|
|
|
87
91
|
<SearchField
|
|
88
92
|
label="Mollit eiusmod"
|
|
89
93
|
description="Ea cupidatat eu sunt commodo"
|
|
90
|
-
size="
|
|
94
|
+
size="small"
|
|
91
95
|
>
|
|
92
96
|
<SearchFieldInput />
|
|
93
97
|
<SearchFieldButton>
|
|
@@ -95,6 +99,35 @@ export const All = () => {
|
|
|
95
99
|
<span className="sr-only">Søk</span>
|
|
96
100
|
</SearchFieldButton>
|
|
97
101
|
</SearchField>
|
|
102
|
+
<SearchField
|
|
103
|
+
label="Mollit eiusmod"
|
|
104
|
+
description="Ea cupidatat eu sunt commodo"
|
|
105
|
+
size="small"
|
|
106
|
+
>
|
|
107
|
+
<SearchFieldButton>
|
|
108
|
+
<Search />
|
|
109
|
+
<span className="sr-only">Søk</span>
|
|
110
|
+
</SearchFieldButton>
|
|
111
|
+
<SearchFieldClearButton>
|
|
112
|
+
<Close /> Tøm
|
|
113
|
+
</SearchFieldClearButton>
|
|
114
|
+
<SearchFieldInput />
|
|
115
|
+
</SearchField>
|
|
116
|
+
|
|
117
|
+
<SearchField
|
|
118
|
+
label="Mollit eiusmod"
|
|
119
|
+
description="Ea cupidatat eu sunt commodo"
|
|
120
|
+
size="small"
|
|
121
|
+
>
|
|
122
|
+
<SearchFieldInput />
|
|
123
|
+
<SearchFieldClearButton>
|
|
124
|
+
<Close /> Tøm
|
|
125
|
+
</SearchFieldClearButton>
|
|
126
|
+
<SearchFieldButton>
|
|
127
|
+
<Search />
|
|
128
|
+
<span className="sr-only">Søk</span>
|
|
129
|
+
</SearchFieldButton>
|
|
130
|
+
</SearchField>
|
|
98
131
|
|
|
99
132
|
<h2>SearchField w error</h2>
|
|
100
133
|
<SearchField
|
|
@@ -104,7 +137,7 @@ export const All = () => {
|
|
|
104
137
|
>
|
|
105
138
|
<SearchFieldInput />
|
|
106
139
|
<SearchFieldButton>
|
|
107
|
-
<Search />
|
|
140
|
+
<Search /> Søk
|
|
108
141
|
</SearchFieldButton>
|
|
109
142
|
</SearchField>
|
|
110
143
|
<SearchField
|
|
@@ -113,7 +146,7 @@ export const All = () => {
|
|
|
113
146
|
error="Errormsg"
|
|
114
147
|
>
|
|
115
148
|
<SearchFieldButton>
|
|
116
|
-
<Search />
|
|
149
|
+
<Search /> Søk
|
|
117
150
|
</SearchFieldButton>
|
|
118
151
|
<SearchFieldInput />
|
|
119
152
|
</SearchField>
|
|
@@ -128,7 +161,7 @@ export const All = () => {
|
|
|
128
161
|
>
|
|
129
162
|
<SearchFieldInput />
|
|
130
163
|
<SearchFieldButton>
|
|
131
|
-
<Search />
|
|
164
|
+
<Search /> Søk
|
|
132
165
|
</SearchFieldButton>
|
|
133
166
|
</SearchField>
|
|
134
167
|
<SearchField
|
|
@@ -137,7 +170,7 @@ export const All = () => {
|
|
|
137
170
|
hideLabel
|
|
138
171
|
>
|
|
139
172
|
<SearchFieldButton>
|
|
140
|
-
<Search />
|
|
173
|
+
<Search /> Søk
|
|
141
174
|
</SearchFieldButton>
|
|
142
175
|
<SearchFieldInput />
|
|
143
176
|
</SearchField>
|
|
@@ -29,7 +29,7 @@ Kommer i størrelsene "m" og "s".
|
|
|
29
29
|
checked={checked}
|
|
30
30
|
onChange={() => setChecked(!checked)}
|
|
31
31
|
label="Checkbox label text"
|
|
32
|
-
size="
|
|
32
|
+
size="small"
|
|
33
33
|
>
|
|
34
34
|
Ipsum voluptate pariatur <Link href="#123">demolink</Link> anim officia minim
|
|
35
35
|
ut mollit voluptate exercitation nulla mollit.
|
|
@@ -37,7 +37,7 @@ Kommer i størrelsene "m" og "s".
|
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
<Canvas>
|
|
40
|
-
<ConfirmationPanelExample size="
|
|
40
|
+
<ConfirmationPanelExample size="small" />
|
|
41
41
|
</Canvas>
|
|
42
42
|
|
|
43
43
|
## Errors
|
|
@@ -20,12 +20,12 @@ export const All = () => {
|
|
|
20
20
|
Ipsum voluptate pariatur <Link href="#123">testlink</Link> anim officia
|
|
21
21
|
minim ut mollit voluptate exercitation nulla mollit.
|
|
22
22
|
</ConfirmationPanel>
|
|
23
|
-
<h2>size
|
|
23
|
+
<h2>size small</h2>
|
|
24
24
|
<ConfirmationPanel
|
|
25
25
|
checked={checked}
|
|
26
26
|
onChange={() => setChecked(!checked)}
|
|
27
27
|
label="Checkbox label text"
|
|
28
|
-
size="
|
|
28
|
+
size="small"
|
|
29
29
|
>
|
|
30
30
|
Ipsum voluptate pariatur <Link href="#123">testlink</Link> anim officia
|
|
31
31
|
minim ut mollit voluptate exercitation nulla mollit.
|
|
@@ -46,7 +46,7 @@ export const All = () => {
|
|
|
46
46
|
onChange={() => setChecked(!checked)}
|
|
47
47
|
label="Checkbox label text"
|
|
48
48
|
error="Ex cupidatat do do do"
|
|
49
|
-
size="
|
|
49
|
+
size="small"
|
|
50
50
|
>
|
|
51
51
|
Ipsum voluptate pariatur <Link href="#123">testlink</Link> anim officia
|
|
52
52
|
minim ut mollit voluptate exercitation nulla mollit.
|
|
@@ -84,14 +84,14 @@ Fieldset justerer automatisk sizing på skjema-elementene. Man kan overstyre det
|
|
|
84
84
|
`TextField` i eks dette eksemplet
|
|
85
85
|
|
|
86
86
|
```jsx
|
|
87
|
-
<Fieldset size="
|
|
87
|
+
<Fieldset size="small" legend="Mollit eiusmod">
|
|
88
88
|
<TextField label="Textfield label" hideLabel />
|
|
89
89
|
<TextField label="Textfield label" hideLabel />
|
|
90
90
|
</Fieldset>
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
<Canvas>
|
|
94
|
-
<Fieldset size="
|
|
94
|
+
<Fieldset size="small" legend="Mollit eiusmod" description="Dolore minim">
|
|
95
95
|
<TextField label="Textfield label" hideLabel />
|
|
96
96
|
<TextField label="Textfield label" hideLabel />
|
|
97
97
|
</Fieldset>
|
|
@@ -47,7 +47,7 @@ export const All = () => {
|
|
|
47
47
|
|
|
48
48
|
<h2>Sizing</h2>
|
|
49
49
|
|
|
50
|
-
<Fieldset size="
|
|
50
|
+
<Fieldset size="small" legend="Mollit eiusmod" description="Dolore minim">
|
|
51
51
|
<TextField label="Textfield label" hideLabel />
|
|
52
52
|
<TextField label="Textfield label" hideLabel />
|
|
53
53
|
</Fieldset>
|
|
@@ -3,10 +3,10 @@ import { ConfirmationPanel } from "..";
|
|
|
3
3
|
import { Link } from "../..";
|
|
4
4
|
|
|
5
5
|
export const ConfirmationPanelExample = ({
|
|
6
|
-
size = "
|
|
6
|
+
size = "medium",
|
|
7
7
|
error,
|
|
8
8
|
}: {
|
|
9
|
-
size: "
|
|
9
|
+
size: "medium" | "small";
|
|
10
10
|
error?: string;
|
|
11
11
|
}) => {
|
|
12
12
|
const [checked, setChecked] = useState(false);
|
|
@@ -72,7 +72,7 @@ import { Select } from "../index";
|
|
|
72
72
|
label="Ipsum enim quis culpa"
|
|
73
73
|
description="Aute enim"
|
|
74
74
|
error="Select error message"
|
|
75
|
-
size="
|
|
75
|
+
size="small"
|
|
76
76
|
>
|
|
77
77
|
<option value="">Velg land</option>
|
|
78
78
|
<option value="norge">Norge</option>
|
|
@@ -85,7 +85,7 @@ import { Select } from "../index";
|
|
|
85
85
|
label="Ipsum enim quis culpa"
|
|
86
86
|
description="Aute enim"
|
|
87
87
|
error="Select error message"
|
|
88
|
-
size="
|
|
88
|
+
size="small"
|
|
89
89
|
>
|
|
90
90
|
<option value="">Velg land</option>
|
|
91
91
|
<option value="norge">Norge</option>
|
|
@@ -45,7 +45,7 @@ import { TextField } from "../index";
|
|
|
45
45
|
|
|
46
46
|
```jsx
|
|
47
47
|
<TextField
|
|
48
|
-
size="
|
|
48
|
+
size="small"
|
|
49
49
|
label="Laborum excepteur"
|
|
50
50
|
description="Cillum mollit"
|
|
51
51
|
error="TextField error"
|
|
@@ -54,7 +54,7 @@ import { TextField } from "../index";
|
|
|
54
54
|
|
|
55
55
|
<Canvas>
|
|
56
56
|
<TextField
|
|
57
|
-
size="
|
|
57
|
+
size="small"
|
|
58
58
|
label="Laborum excepteur"
|
|
59
59
|
description="Cillum mollit"
|
|
60
60
|
error="TextField error"
|
|
@@ -98,7 +98,7 @@ visuell validering.
|
|
|
98
98
|
description="Reprehenderit esse proident"
|
|
99
99
|
value={value}
|
|
100
100
|
maxLength={400}
|
|
101
|
-
size="
|
|
101
|
+
size="small"
|
|
102
102
|
onChange={(e) => setValue(e.target.value)}
|
|
103
103
|
/>
|
|
104
104
|
```
|
|
@@ -108,7 +108,7 @@ visuell validering.
|
|
|
108
108
|
label="In anim elit"
|
|
109
109
|
description="Reprehenderit esse proident"
|
|
110
110
|
maxLength={400}
|
|
111
|
-
size="
|
|
111
|
+
size="small"
|
|
112
112
|
value="Ullamco culpa officia incididunt consectetur voluptate consectetur eiusmod incididunt. Irure velit nulla est sit sit. In qui qui exercitation voluptate magna id officia pariatur est minim nostrud deserunt fugiat dolor. Proident cillum anim veniam quis tempor labore. Amet cupidatat cillum amet Lorem fugiat sit id esse magna fugiat qui cillum incididunt."
|
|
113
113
|
onChange={() => null}
|
|
114
114
|
/>
|
package/src/form/useFormField.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface FormFieldProps {
|
|
|
15
15
|
/**
|
|
16
16
|
* Changes font-size, padding and gaps
|
|
17
17
|
*/
|
|
18
|
-
size?: "
|
|
18
|
+
size?: "medium" | "small";
|
|
19
19
|
/**
|
|
20
20
|
* Disables element
|
|
21
21
|
*/
|
|
@@ -53,7 +53,7 @@ export const useFormField = (props: FormFieldProps, prefix: string) => {
|
|
|
53
53
|
hasError,
|
|
54
54
|
errorId,
|
|
55
55
|
inputDescriptionId,
|
|
56
|
-
size: size ?? fieldset?.size ?? "
|
|
56
|
+
size: size ?? fieldset?.size ?? "medium",
|
|
57
57
|
inputProps: {
|
|
58
58
|
id,
|
|
59
59
|
"aria-invalid": hasError,
|
|
@@ -3,20 +3,18 @@ import cl from "classnames";
|
|
|
3
3
|
|
|
4
4
|
export interface ContentContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* ContentContainer content
|
|
7
7
|
*/
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const ContentContainer = forwardRef<HTMLDivElement, ContentContainerProps>(
|
|
12
|
-
({
|
|
12
|
+
({ className, ...rest }, ref) => (
|
|
13
13
|
<div
|
|
14
14
|
ref={ref}
|
|
15
15
|
className={cl("navds-content-container", className)}
|
|
16
16
|
{...rest}
|
|
17
|
-
|
|
18
|
-
{children}
|
|
19
|
-
</div>
|
|
17
|
+
/>
|
|
20
18
|
)
|
|
21
19
|
);
|
|
22
20
|
|
package/src/grid/index.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Meta, Canvas } from "@storybook/addon-docs";
|
|
2
|
-
import { Grid, Cell
|
|
2
|
+
import { Grid, Cell } from "../../index";
|
|
3
3
|
|
|
4
4
|
<Meta title="ds-react/grid/intro" />
|
|
5
5
|
|
|
6
6
|
# Hvordan ta i bruk Grid
|
|
7
7
|
|
|
8
|
-
`<ContentContainer />` er ikke nødvendig her, men er laget for tas i bruk i grid.
|
|
9
|
-
|
|
10
8
|
```jsx
|
|
11
9
|
<ContentContainer>
|
|
12
10
|
<Grid>
|
|
@@ -23,6 +21,27 @@ import { Grid, Cell, ContentContainer } from "../../index";
|
|
|
23
21
|
</ContentContainer>
|
|
24
22
|
```
|
|
25
23
|
|
|
24
|
+
### ContentContainer
|
|
25
|
+
|
|
26
|
+
Denne fungerer som en wrapper som sentrer innholdet og passer på at anbefalt maksbredde ikke blir overskredet.
|
|
27
|
+
|
|
28
|
+
Stylingen som blir satt av den:
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
.navds-content-container {
|
|
32
|
+
margin-left: auto;
|
|
33
|
+
margin-right: auto;
|
|
34
|
+
max-width: var(--navds-content-container-max-width); # 79.5rem (1272px)
|
|
35
|
+
padding: var(--navds-content-container-padding-small); # 1rem
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (min-width: 448px) {
|
|
39
|
+
.navds-content-container {
|
|
40
|
+
padding: var(--navds-content-container-padding-medium-and-larger); # 1.5rem
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
26
45
|
## Bredder
|
|
27
46
|
|
|
28
47
|
Bredden til hver `Cell` bestemmes av propsene `lg`, `md`, `sm`og `xs`
|
|
@@ -56,5 +75,5 @@ Eks `xs={12} lg={4}` vil da si at `Cell` tar opp
|
|
|
56
75
|
4/12 av griddet når `width > 960px` og 12/12 av griddet
|
|
57
76
|
når skjermen er `width < 448px`
|
|
58
77
|
|
|
59
|
-
Griddet er dynamiskt, noe som vil si at griddet
|
|
60
|
-
selv om skjermen er 1920px eller 400px.
|
|
78
|
+
Griddet er dynamiskt, noe som vil si at griddet altids består av 12 columns
|
|
79
|
+
selv om skjermen er 1920px eller 400px. Innholdes "presses" altså sammen.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { ContentContainer } from "
|
|
2
|
+
import { BodyLong } from "../..";
|
|
3
|
+
import { Grid, Cell, ContentContainer } from "../index";
|
|
4
4
|
import "./styles.css";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -41,3 +41,11 @@ export const All = () => {
|
|
|
41
41
|
</ContentContainer>
|
|
42
42
|
);
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
export const Contentcontainer = () => {
|
|
46
|
+
return (
|
|
47
|
+
<ContentContainer className={"navds-story-content-container"}>
|
|
48
|
+
<BodyLong size="medium">-- Innhold --</BodyLong>
|
|
49
|
+
</ContentContainer>
|
|
50
|
+
);
|
|
51
|
+
};
|